Commit 72e6be7a authored by 李苏's avatar 李苏 💬

单独分类表格,引用数据统一改变

parent dbb68e96
......@@ -12,10 +12,25 @@
</BasePage>
<!-- 静态编辑表格-->
<div lass="min_full" style="height: 50%;">
<EditTable ref="editTable" :app='editTableConfig'>
</EditTable>
<div lass="min_full" style="height: 50%;display: flex;">
<div style="height: 100%;width: 70%;">
<EditTable ref="editTable" :app='editTableConfig'>
</EditTable>
</div>
<div style="height: 100%;width: 30%;" >
<EditTable ref="editTable1" :app='editTableConfig2'>
<template slot="tabCustom">
<el-table-column label="操作" width="90" header-align="center" fixed="right">
<template slot-scope="scope">
<el-button style="text-align: center;color: red;width: 100%;" @click.native.prevent="cz(scope.row)"
type="text" size="small">
<i class="el-icon-delete"></i>重置
</el-button>
</template>
</el-table-column>
</template>
</EditTable>
</div>
</div>
......@@ -117,8 +132,8 @@
editTableConfig: {
editTableTitle: [{
label: '仓库',
prop: 'ckid',
width: 130,
prop: 'ckName',
width: 180,
},
{
label: '批号',
......@@ -130,17 +145,59 @@
prop: 'packCode',
width: 130,
},
{
label: '库位',
prop: 'kwCode',
width: 130,
},
{
label: '库存数量',
prop: 'kcsl',
width: 130,
},
{
label: '库位',
prop: 'kwCode',
// width: 130,
},
// {
// label: "检出数量",
// prop: "jhsl",
// width: 180,
// allowEdit: true,
// type: 'inputNumber',
// blur: toFixed(null),
// change: (row) => {
// row.jhsl = parseInt(row.jhsl)
// /*row.oldJhsl
// row.kcsl
// */
// if (row.jhsl < 0) {
// this.$warning('数量无效')
// row.jhsl = row.oldJhsl
// return
// }
// if (row.jhsl > row.oldKcsl) {
// this.$warning('数量不能大于原库存数量')
// row.jhsl = row.oldJhsl
// return
// }
// /* 数量为合理数量时*/
// let jhsl = parseInt(row.jhsl)
// let oldJhsl = parseInt(row.oldJhsl)
// let slc = jhsl - oldJhsl
// row.kcsl = row.kcsl - slc
// this.$refs.basePage.$refs.TablePager.tableData.forEach(item => {
// if (item.id == this.$id) {
// item.jhsl = item.jhsl + slc
// }
// })
// /* 记录当前的拣货数量*/
// row.oldJhsl = row.jhsl
// }
// },
],
editTableData: []
},
editTableConfig2:{
editTableTitle:[ {
label: "检出数量",
prop: "jhsl",
width: 180,
......@@ -176,19 +233,47 @@
row.oldJhsl = row.jhsl
}
},
],
editTableData: []
},],
editTableData:[]
}
}
},
methods: {
cz(row){
console.log(row)
row.jhsl = parseInt(0)
/*row.oldJhsl
row.kcsl
*/
if (row.jhsl < 0) {
this.$warning('数量无效')
row.jhsl = row.oldJhsl
return
}
if (row.jhsl > row.oldKcsl) {
this.$warning('数量不能大于原库存数量')
row.jhsl = row.oldJhsl
return
}
/* 数量为合理数量时*/
let jhsl = parseInt(row.jhsl)
let oldJhsl = parseInt(row.oldJhsl)
let slc = jhsl - oldJhsl
row.kcsl = row.kcsl - slc
this.$refs.basePage.$refs.TablePager.tableData.forEach(item => {
if (item.id == this.$id) {
item.jhsl = item.jhsl + slc
}
})
/* 记录当前的拣货数量*/
row.oldJhsl = row.jhsl
},
pageQueryFinally(list) {
console.log('清空明细list')
this.detailList = {}
this.editTableConfig.editTableData = []
this.editTableConfig2.editTableData = []
list.forEach((item) => {
/* 剩余拣货数量==yfsl*/
let alljhsl = item.yfsl
......@@ -233,6 +318,7 @@
this.$emit('getRow', val)
this.$id = val.id
this.editTableConfig.editTableData = this.detailList[this.$id]
this.editTableConfig2.editTableData = this.detailList[this.$id]
},
demo(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment