From 2173def08e7df74c823ee4dd051a32829edda14b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sun, 2 Oct 2022 23:57:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=95=86=E5=93=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=9A=84=E6=97=B6=E5=80=99=E5=95=86=E5=93=81=E6=9D=A1?= =?UTF-8?q?=E7=A0=81=E5=87=BA=E7=8E=B0=E4=B8=8D=E8=BF=9E=E5=8F=B7=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/material/modules/MaterialModal.vue | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/jshERP-web/src/views/material/modules/MaterialModal.vue b/jshERP-web/src/views/material/modules/MaterialModal.vue index e0caf54a..120a7330 100644 --- a/jshERP-web/src/views/material/modules/MaterialModal.vue +++ b/jshERP-web/src/views/material/modules/MaterialModal.vue @@ -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)