From 9f5aa25aca73fee83ec511a0916da15c8e354b6b Mon Sep 17 00:00:00 2001 From: shijing Date: Sat, 16 Dec 2023 09:37:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E5=93=81=E7=BB=84=E5=90=88=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mtm/materials_form.vue | 61 ++++++++++++++++++++++++++++++- src/views/statistics/pass_num.vue | 2 +- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/src/views/mtm/materials_form.vue b/src/views/mtm/materials_form.vue index 203fa0c9..a69fd419 100644 --- a/src/views/mtm/materials_form.vue +++ b/src/views/mtm/materials_form.vue @@ -62,10 +62,32 @@ - + + + + + @@ -110,6 +132,9 @@ export default { materialOptions: [], setFiltersVisible: false, processOptions: [], + componentList:[ + {id:'',count:1} + ], }; }, mounted() { @@ -146,6 +171,13 @@ export default { if (valid) { this.isSaveing = true; this.form.brothers = this.brothers; + if(this.form.is_assemb){ + let obj = {}; + this.componentList.forEach(item=>{ + obj[item.id] = item.count; + }) + this.form.components = obj; + } if (this.mode == "add") { this.$API.mtm.material.create.req(this.form).then(res => { this.isSaveing = false; @@ -173,8 +205,26 @@ export default { setData(data) { Object.assign(this.form, data); this.brothers = data.brothers; + let arr = []; + for(let key in data.components){ + let obj = {}; + obj.id=key; + obj.count = data.components[key] + arr.push(obj) + } + this.componentList = arr; this.getMaterial(data.type) }, + addComponent(){ + let obj = {}; + obj.id=''; + obj.count = 1; + this.componentList.push(obj) + }, + delComponent(index){ + this.componentList.splice(index,1); + console.log('this.componentList:',this.componentList); + }, //设置过滤项 setFilters(filters) { this.selectionFilters = filters; @@ -183,4 +233,11 @@ export default { }, }; - + diff --git a/src/views/statistics/pass_num.vue b/src/views/statistics/pass_num.vue index 41cc43fa..eb0b018d 100644 --- a/src/views/statistics/pass_num.vue +++ b/src/views/statistics/pass_num.vue @@ -195,7 +195,7 @@ }, option2: { title: { - text: '预制棒(10车间)', + text: '预制管(10车间)', }, grid: { top: '80px'