From aa59eac0cd169f5fcf7e16ab4d5c34c2baa1bd84 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期四, 11 四月 2024 18:55:21 +0800 Subject: [PATCH] 循环回数对应的片数组合成对应的字段赋值到单元格 --- src/views/productManage/productRegisterForm/components/addProductDialog.vue | 48 ++++++++++++++++++++++++------------------------ 1 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/views/productManage/productRegisterForm/components/addProductDialog.vue b/src/views/productManage/productRegisterForm/components/addProductDialog.vue index 81e7236..79b65f1 100644 --- a/src/views/productManage/productRegisterForm/components/addProductDialog.vue +++ b/src/views/productManage/productRegisterForm/components/addProductDialog.vue @@ -118,7 +118,7 @@ <span slot="label"> <span class="formLabel">鍑�閲�</span> </span> - <el-input v-model="proForm.netWeight" @blur="changeTableInput" size="small"></el-input> + <el-input v-model="proForm.netWeight" @blur="changeTableInput" size="small"></el-input> </el-form-item> </el-col> <el-col :span="20"> @@ -157,6 +157,7 @@ <script> import { getWorkshopManageGroup, + changeYieldRegister, } from "@/api/productManage/productRegisterForm.js"; export default { props: { @@ -231,27 +232,6 @@ deep: true, immediate:true, }, - "form.carNumber": { - handler() { - this.$set(this.proForm,'carNumber',this.form.carNumber) - }, - deep: true, - immediate:true, - }, - "form.pieceNumber": { - handler() { - this.$set(this.proForm,'pieceNumber',this.form.pieceNumber) - }, - deep: true, - immediate:true, - }, - "form.pieces": { - handler() { - this.$set(this.proForm,'pieces',this.form.pieces) - }, - deep: true, - immediate:true, - }, 'form.workshopId': function () { this.getGroupNumber() } @@ -294,10 +274,30 @@ } }, changeForm(val){ - this.$emit('changeForm',this.proForm,val) + if(this.proForm.createTime&&this.proForm.groupNumber&&this.proForm.marketId&&this.proForm.spec&&this.proForm.workshopId){ + changeYieldRegister({ + createTime: this.proForm.createTime, + groupNumber: this.proForm.groupNumber, + marketId: this.proForm.marketId, + spec: this.proForm.spec, + workshopId: this.proForm.workshopId, + }).then((res) => { + if (res.code == 200) { + if(res.data){ + if(Object.keys(res.data).length>0){ + this.$emit('changeForm',this.proForm,val,res.data) + } + } + } + }); + }else{ + this.$emit('changeForm',this.proForm,val,{}) + } }, changeTableInput(){ - this.$emit('changeTableInput',this.proForm) + if(this.proForm.pieces&&this.proForm.carNumber&&this.proForm.pieceNumber){ + this.$emit('changeTableInput',this.proForm) + } }, handleClose() { this.editDialogVisible = false; -- Gitblit v1.8.0