优化绑定商品
This commit is contained in:
parent
d6a8aca57f
commit
456b262cbe
|
|
@ -16,7 +16,7 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="tableData.list" v-loading="tableData.loading">
|
||||
<el-table ref="table" :data="tableData.list" @select="firstSelectChange" v-loading="tableData.loading">
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column label="商品信息">
|
||||
<template v-slot="scope">
|
||||
|
|
@ -36,11 +36,11 @@
|
|||
</template>
|
||||
</el-table-column> <el-table-column label="是否售罄">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isPauseSale == 1?'是':'否' }}
|
||||
{{ scope.row.isPauseSale == 1 ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="是否分销">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isDistribute == 1?'是':'否' }}
|
||||
{{ scope.row.isDistribute == 1 ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价">
|
||||
|
|
@ -85,16 +85,30 @@ export default {
|
|||
loading: false,
|
||||
list: []
|
||||
},
|
||||
goods: []
|
||||
goods: [],
|
||||
// 是否单选
|
||||
isselect: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
firstSelectChange() {
|
||||
// console.log(selection)
|
||||
let selection = this.$refs.table.selection
|
||||
if (selection.length > 1 && this.isselect) {
|
||||
const del_row = selection.shift();
|
||||
this.$refs.table.toggleRowSelection(del_row, false);
|
||||
}
|
||||
},
|
||||
// 确定选商品
|
||||
confirmHandle() {
|
||||
let res = this.$refs.table.selection
|
||||
this.$emit('success', res)
|
||||
this.close()
|
||||
},
|
||||
// 是否单选
|
||||
isselectEvent() {
|
||||
this.isselect = true
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.searhForm.name = ''
|
||||
|
|
|
|||
|
|
@ -38,19 +38,19 @@
|
|||
<div class="head-container" id="table_drag">
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px" />
|
||||
<el-table-column label="耗材信息ID" prop="conInfoId" />
|
||||
<el-table-column label="耗材信息名称" prop="conName" />
|
||||
<!-- <el-table-column label="耗材信息ID" prop="conInfoId" /> -->
|
||||
<el-table-column label="耗材信息" prop="conName" />
|
||||
<el-table-column label="商品" prop="name" />
|
||||
<el-table-column label="规格" prop="specSnap" />
|
||||
<el-table-column label="单笔消耗数" prop="surplusStock" />
|
||||
<!-- <el-table-column label="价格" prop="conName" /> -->
|
||||
<el-table-column label="规格名称" prop="specSnap" />
|
||||
<el-table-column label="耗材信息代码" prop="conCode" />
|
||||
<el-table-column label="耗材信息单位" prop="conUnit" />
|
||||
<el-table-column label="商品名称" prop="name" />
|
||||
<el-table-column label="库存" prop="stockNumber" />
|
||||
<el-table-column label="单笔消耗数" prop="surplusStock" />
|
||||
<el-table-column label="创建时间" prop="createTime">
|
||||
<template v-slot="scope">
|
||||
<!-- <template v-slot="scope">
|
||||
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
|
|
@ -58,11 +58,11 @@
|
|||
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" prop="updateTime">
|
||||
<!-- <el-table-column label="更新时间" prop="updateTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
||||
|
|
@ -80,11 +80,11 @@
|
|||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" />
|
||||
</div>
|
||||
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="50%">
|
||||
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="1000px">
|
||||
<el-form ref="addSelect" :inline="true">
|
||||
<template v-if="addSelect.length">
|
||||
<template v-if="addSelect[0].isDistribute == 1">
|
||||
<el-form-item label="商品规格">
|
||||
<el-form-item label="商品规格1">
|
||||
<el-input v-model="addSelect[0].specSnap" style="width: 130px;" placeholder="请选择商品规格"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -278,11 +278,13 @@ export default {
|
|||
this.getTableDatasku()
|
||||
this.getTableDatainformation()
|
||||
this.$nextTick(() => {
|
||||
this.tableDrag()
|
||||
// this.tableDrag()
|
||||
this.$refs.shopList.isselectEvent()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
selectShop(res) {
|
||||
console.log(res,'调试1')
|
||||
this.addSelect = res
|
||||
res[0]['specSnap'] = res[0].name
|
||||
this.clickdialogframe('add')
|
||||
|
|
@ -420,6 +422,7 @@ export default {
|
|||
shopId: localStorage.getItem('shopId'),
|
||||
specSnap: this.querytableDatasku.specSnap,
|
||||
name: this.querytableDatasku.name,
|
||||
sort:'id.desc',
|
||||
shopName: this.querytableDatasku.shopName
|
||||
})
|
||||
this.tableDatasku.loading = false
|
||||
|
|
|
|||
Loading…
Reference in New Issue