Commit 2173def0 authored by 季圣华's avatar 季圣华
Browse files

解决商品新增的时候商品条码出现不连号的bug

parent 6b70cab6
......@@ -409,8 +409,7 @@
}
},
created () {
this.maxBarCodeAction();
this.loadParseMaterialProperty();
this.loadParseMaterialProperty()
},
methods: {
// 获取所有的editableTable实例
......@@ -438,6 +437,7 @@
this.activeKey = '1'
this.manySkuSelected = 0
this.barCodeSwitch = false
this.maxBarCodeInfo = ''
this.visible = true;
if(JSON.stringify(record) === '{}') {
this.fileList = []
......@@ -698,13 +698,6 @@
}
});
},
maxBarCodeAction(){
getMaxBarCode({}).then((res)=> {
if (res && res.code === 200) {
this.maxBarCodeInfo = res.data.barCode - 0
}
})
},
loadTreeData(){
let that = this;
let params = {};
......@@ -840,8 +833,18 @@
if(this.unitStatus == false) {
unit = this.form.getFieldValue('unit')
}
this.maxBarCodeInfo = this.maxBarCodeInfo + 1
target.setValues([{rowKey: row.id, values: {barCode: this.maxBarCodeInfo, commodityUnit: unit?unit:''}}])
if(this.maxBarCodeInfo === '') {
getMaxBarCode({}).then((res)=> {
if (res && res.code === 200) {
this.maxBarCodeInfo = res.data.barCode - 0
this.maxBarCodeInfo = this.maxBarCodeInfo + 1
target.setValues([{rowKey: row.id, values: {barCode: this.maxBarCodeInfo, commodityUnit: unit?unit:''}}])
}
})
} else {
this.maxBarCodeInfo = this.maxBarCodeInfo + 1
target.setValues([{rowKey: row.id, values: {barCode: this.maxBarCodeInfo, commodityUnit: unit?unit:''}}])
}
},
onDeleted(value) {
this.meDeleteIdList = (value)
......
Supports Markdown
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