From 4950bcd2f9095f204407143e08fb015d2639f51d Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Wed, 10 Nov 2021 09:56:08 +0800 Subject: [PATCH] xiugai --- hb_client/src/views/wpm/worktask.vue | 369 +++++++++++++++------------ 1 file changed, 210 insertions(+), 159 deletions(-) diff --git a/hb_client/src/views/wpm/worktask.vue b/hb_client/src/views/wpm/worktask.vue index d9e978f..e1880d4 100644 --- a/hb_client/src/views/wpm/worktask.vue +++ b/hb_client/src/views/wpm/worktask.vue @@ -107,48 +107,50 @@ >{{ item.name }} - +
半成品
- - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +
@@ -308,55 +310,100 @@ > + + + +
+ 消耗物料表 +
+ + + + + + + + + + + +
+
+ + +
+ 产出物料表 +
+ + + + + + + +
+
+
- 消耗物料表 -
- - - - - - - - - - - - - + +
- -
- 产出物料表 -
- - - - - - - - - -
- - - - + + + - + - + { if (res.code >= 200) { @@ -654,95 +708,92 @@ export default { next() { if (this.values++ > this.forms.length) this.values = 0; }, - handleSelectionChange(val) { - let _this = this; + handleSelectionChange(val) { + let _this = this; _this.wpID = []; - val.forEach((item) => { - _this.wpID.push(item.id); - + val.forEach((item) => { + _this.wpID.push(item.id); }); - - }, + }, //车间操作 handlework(item) { - - this.step=item.id; - // console.log(this.wpID); + this.step = item.id; + // console.log(this.wpID); createWork({ step: item.id, - wproducts:this.wpID, + wproducts: this.wpID, subproduction_plan: this.subproduction_plan, }).then((res) => { if (res.code >= 200) { - this.dialogVisiblework = true; - this.forms=res.data.forms; - this.otherforms=res.data.forms.slice(0);//渲染生产表 - this.otherforms.shift(); - //console.log(this.otherforms) - this.input = res.data.forms[0].input; //消耗 - this.output = res.data.forms[0].output; //产出 - this.wproducts=res.data.forms[0].wproducts; - + this.dialogVisiblework = true; + this.forms = res.data.forms; + this.otherforms = res.data.forms.slice(0); //渲染生产表 + this.otherforms.shift(); + //console.log(this.otherforms) + this.input = res.data.forms[0].input; //消耗 + if ( + res.data.forms[0].output !== undefined && + res.data.forms[0].output.length > 0 + ) { + this.output = res.data.forms[0].output; //产出 + this.showPrise = true; + } + + this.wproducts = res.data.forms[0].wproducts; } }); - }, - //提交 - submint(){ + submint() { this.form = []; - this.otherforms.forEach((item) => { - let _this = this; - _this.field1 = []; - item.form_fields.forEach((items) => { - _this.field1.push({ - form_field:items.id, - field_value:items.sort + this.otherforms.forEach((item) => { + let _this = this; + _this.field1 = []; + item.form_fields.forEach((items) => { + _this.field1.push({ + form_field: items.id, + field_value: items.sort, + }); + }); - }) - - }) - - this.form.push({ - form:item.id, - record_data:_this.field1 - - }) - + this.form.push({ + form: item.id, + record_data: _this.field1, + }); }); + console.log(this.remark); - console.log( this.form); - - - submitWork({ - step:this.step, - subproduction_plan:this.subproduction_plan, - wproducts:this.wproducts, - input: this.input, + submitWork({ + step: this.step, + subproduction_plan: this.subproduction_plan, + wproducts: this.wproducts, + input: this.input, output: this.output, - forms: this.from + forms: this.from, + remark: this.remark, }).then((res) => { if (res.code >= 200) { - this.dialogVisiblework = false; + this.dialogVisiblework = false; this.$message.success("成功!"); - this.getwproductLists(); - + this.getwproductLists(); } }); - }, //大工序下子工序产出的半成品 - getwproductLists(){ - getwproductList({page:0, subproduction_plan:this.subproduction_plan, p_state__process:this.process}).then((response) => { + getwproductLists() { + getwproductList({ + page: 0, + subproduction_plan: this.subproduction_plan, + p_state__process: this.process, + }).then((response) => { if (response.data) { this.wproductData = response.data; //console.log( this.wproductData) } - }); - } + }, }, }; \ No newline at end of file