From bcbca918e3f1f824c686e603b6833125b35d3a1d Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 10 Mar 2025 11:04:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=94=9F=E4=BA=A7=E9=A2=86=E6=96=99?= =?UTF-8?q?=E6=97=B6=E6=95=B0=E9=87=8F=E4=B8=8D=E5=8F=AF=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/inm/mioitem_form.vue | 105 ++++++++++++++++----------------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/src/views/inm/mioitem_form.vue b/src/views/inm/mioitem_form.vue index 5e5bb07e..0a33caae 100644 --- a/src/views/inm/mioitem_form.vue +++ b/src/views/inm/mioitem_form.vue @@ -125,6 +125,7 @@ v-model="form.count" :min="1" :precision="3" + :disabled="form.type == 'do_out'" style="width: 100%" @change="countChange" /> @@ -266,6 +267,7 @@ export default { components: [], wbatchOptions: [], mioitems:[''], + mioitemw:[], project_code:'', }; }, @@ -427,9 +429,9 @@ export default { } }, selectBatchChange(item) { - // var item = this.getItem(this.batchOptions, id) this.form.batch = item.batch; this.form.mb = item.id; + this.form.count = item.count; this.form.warehouse = item.warehouse; this.warehouseDisable = true; this.inputBatchDisable = true; @@ -437,6 +439,7 @@ export default { selectBatchClear() { this.form.mb = ""; this.form.batch = ""; + this.form.count = ""; this.form.warehouse = ""; this.warehouseDisable = false; this.inputBatchDisable = false; @@ -444,7 +447,7 @@ export default { //显示 open(mode = "add", type = "") { this.mode = mode; - this.form.type = type; + this.form.type = this.type = type; if (mode == "add") { this.init(); } @@ -452,33 +455,41 @@ export default { return this; }, countChange(){ - if(this.project_code=='bxerp'){ - let numbers = this.mioitems[0]; - if(this.form.count>this.mioitems.length){ - this.mioitems = []; - for(let i=0;i { + let that = this; + that.$refs.dialogForm.validate(async (valid) => { if (valid) { - this.isSaveing = true; - this.form.mio = this.mioId; - if (this.components.length > 0) { - this.form.assemb = []; - for (var i = 0; i < this.components.length; i++) { - this.form.assemb.push({ - material: this.components[i].id, - batch: this.components[i].batch, + that.isSaveing = true; + that.form.mio = that.mioId; + if (that.components.length > 0) { + that.form.assemb = []; + for (var i = 0; i < that.components.length; i++) { + that.form.assemb.push({ + material: that.components[i].id, + batch: that.components[i].batch, }); } } - let mioitemw = []; - if(this.mioitems.length>1){ - this.mioitems.forEach((item)=>{ - let obj = {}; - obj.number= item; - mioitemw.push(obj); - }) - this.form.mioitemw = mioitemw; - } + that.form.mioitemw = that.mioitemw; try { let res; - if (this.mode == "add") { - res = await this.$API.inm.mioitem.create.req( - this.form - ); - } else if (this.mode == "edit") { - res = await this.$API.inm.mioitem.update.req( - this.form.id, - this.form - ); + if (that.mode == "add") { + res = await that.$API.inm.mioitem.create.req(that.form); + } else if (that.mode == "edit") { + res = await that.$API.inm.mioitem.update.req(that.form.id,that.form); } - this.isSaveing = false; - this.$emit("success", this.form, this.mode); - this.visible = false; - this.$message.success("操作成功"); + that.isSaveing = false; + that.$emit("success", that.form, that.mode); + that.visible = false; + that.$message.success("操作成功"); } catch (err) { console.log(err); //可以处理校验错误 - this.isSaveing = false; + that.isSaveing = false; return err; } }