From 42558892818b8fc605ff623eba1c6e5cf1445899 Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 7 Apr 2025 16:34:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=89=E5=AD=90=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/inm/mio_form.vue | 4 +- src/views/inm/mioitem_form.vue | 130 ++++++++++++++++++++------------- src/views/pm/utask_form.vue | 4 +- src/views/pm/utask_form_2.vue | 4 +- 4 files changed, 86 insertions(+), 56 deletions(-) diff --git a/src/views/inm/mio_form.vue b/src/views/inm/mio_form.vue index fa95efae..d13faa1a 100644 --- a/src/views/inm/mio_form.vue +++ b/src/views/inm/mio_form.vue @@ -12,9 +12,9 @@ :rules="rules" label-width="120px" > - + - + + + @@ -53,6 +64,8 @@ clearable style="width: 100%" :disabled="inputBatchDisable" + @clear="selectBatchClear" + @change="selectChange" > - + - + @@ -253,6 +265,7 @@ export default { }, ], }, + selectObj:{}, visible: false, isSaveing: false, materialOptions: [], @@ -269,6 +282,8 @@ export default { mioitems:[''], mioitemw:[], project_code:'', + mTracking:10, + apiObj:this.$API.mtm.material.list, }; }, mounted() { @@ -347,7 +362,7 @@ export default { this.inputBatchDisable = true; } else if (type == "do_in") { //生产入库 - query = { page: 0, type__in: type__in }; + query = { page: 0,is_hidden: false, type__in: type__in }; this.inputBatchDisable = false; } else if (type == "pur_in") { //采购入库 @@ -368,12 +383,13 @@ export default { }; this.inputBatchDisable = true; } else { - query = { page: 0 }; + query = { page: 0 ,is_hidden:false}; } - - this.$API.mtm.material.list.req(query).then((res) => { - this.materialOptions = res; - }); + this.query = query; + this.apiObj=this.$API.mtm.material.list; + // this.$API.mtm.material.list.req(query).then((res) => { + // this.materialOptions = res; + // }); }, async initAssemb(item) { this.selectBatchDisable = true; @@ -410,23 +426,35 @@ export default { } }); }, - selectMaterialChange(item) { - var that = this; - var type = this.form.type; - var material = item.id; - that.form.material = material; - - if (type == "do_in") { - if (item.is_assemb) { - this.initAssemb(item); - } else { - this.selectBatchDisable = false; - this.components = []; - this.assembShow = false; - this.getBatchOptions(); + selectChange(item){ + console.log(item) + let that = this; + that.wbatchOptions.forEach((item) => { + if(that.form.batch == item.batch){ + that.form.count = item.count; + that.form.wm = item.id; + } + }) + + }, + selectMaterialChange() { + var that = this; + if(that.form.material!==''&&that.form.material!==null&&that.form.material!==undefined){ + var type = that.form.type; + that.form.material = that.selectObj.id; + that.mTracking = that.selectObj.tracking; + if (type == "do_in") { + if (that.selectObj.is_assemb) { + that.initAssemb(that.selectObj); + } else { + that.selectBatchDisable = false; + that.components = []; + that.assembShow = false; + that.getBatchOptions(); + } + } else { + that.getBatchOptions(); } - } else { - this.getBatchOptions(); } }, getItem(options, id) { @@ -437,15 +465,18 @@ export default { } }, selectBatchChange(item) { - 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; + if(item!==''&&item!==null&&item!==undefined){ + 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; + } }, selectBatchClear() { this.form.mb = ""; + this.form.wm = ""; this.form.batch = ""; this.form.count = ""; this.form.warehouse = ""; @@ -464,23 +495,22 @@ export default { }, countChange(){ let that = this; - if(that.project_code=='bxerp'){ - if(that.form.type == "pur_in"){ - that.mioitems = [];that.mioitemw = []; - for(let i=0;i1&&( that.form.type == 'pur_in'|| that.form.type == 'other_in')){ + that.mioitems = [];that.mioitemw = []; + for(let i=0;i - + - +