From 25bfdf783be9c8e34afcec8106c39e17aa66a1e2 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期一, 29 四月 2024 15:56:43 +0800 Subject: [PATCH] 纤度检验表的 车间显示问题处理 --- src/views/productManage/productRegisterForm/addProductRegisterPage.vue | 49 +++++++++++++++++++++++++++++++------------------ 1 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/views/productManage/productRegisterForm/addProductRegisterPage.vue b/src/views/productManage/productRegisterForm/addProductRegisterPage.vue index d5ecb79..62c0700 100644 --- a/src/views/productManage/productRegisterForm/addProductRegisterPage.vue +++ b/src/views/productManage/productRegisterForm/addProductRegisterPage.vue @@ -91,9 +91,9 @@ </el-form-item> </el-col> <el-col :span="3"> - <el-form-item label="杞﹂棿" prop="workshopId"> + <el-form-item label="杞﹂棿" prop="workshopNumber"> <el-select - v-model="ruleForm.workshopId" + v-model="ruleForm.workshopNumber" placeholder="璇烽�夋嫨" class="select-width" @change='getGroupNumber' @@ -124,7 +124,7 @@ placeholder="璇峰厛閫夋嫨杞﹂棿" no-data-text='璇峰厛閫夋嫨杞﹂棿' class="select-width" - @change='getGroupNumber' + @change="getGroupNumber(false,'groupNumber')" > <el-option v-for="item in workshopGroupList" @@ -639,7 +639,7 @@ circle: "", marketId: "", fallingSilkCocoonNumber: "", - workshopId: "", + workshopNumber: "", bucketCocoonNumber: "", groupNumber: "", vehicleSpeed: "", @@ -672,7 +672,7 @@ marketId: [ { required: true, message: "璇烽�夋嫨", trigger: ["change", "blur"] }, ], - workshopId: [ + workshopNumber: [ { required: true, message: "璇烽�夋嫨", trigger: ["change", "blur"] }, ], groupNumber: [ @@ -710,7 +710,7 @@ circle: "", marketId: "", fallingSilkCocoonNumber: "", - workshopId: "", + workshopNumber: "", bucketCocoonNumber: "", groupNumber: "", vehicleSpeed: "", @@ -743,7 +743,7 @@ JSON.stringify(response.data ? response.data : {}) ); this.ruleForm = config; - this.$set(this.ruleForm,'workshopId',this.ruleForm.workshopId+'') + this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'') this.tableDataItems=config.items ? config.items : []; @@ -792,7 +792,6 @@ } } } - console.log(this.tableData,'==this.tableData') this.ruleForm.carNumber=this.tableData.length>0?this.tableData[0].carNumber:'' }, // 琛ㄦ牸鐨勮绠楅棶棰� @@ -887,7 +886,7 @@ JSON.stringify(data ? data : {}) ); this.ruleForm = config; - this.$set(this.ruleForm,'workshopId',this.ruleForm.workshopId+'') + this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'') this.tableDataItems=config.items ? config.items : []; @@ -971,7 +970,7 @@ }).then((res) => { if (res.code == 200) { this.nameList = res.data || []; - this.$set(this.ruleForm,'workshopId',this.ruleForm.workshopId+'') + this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'') } }); //瑙勬牸 @@ -991,25 +990,36 @@ } }); }, - getGroupNumber(val){ - if(this.ruleForm.workshopId){ + getGroupNumber(val,prop){ + if(this.ruleForm.workshopNumber){ //缁勫埆 - getWorkshopManageGroup({number:this.ruleForm.workshopId}).then((res) => { + getWorkshopManageGroup({number:this.ruleForm.workshopNumber}).then((res) => { if (res.code == 200) { - this.workshopGroupList=[] let workshopGroupList = res.data || {}; + this.workshopGroupList=[] if(Object.keys(workshopGroupList).length>0){ for(let i in workshopGroupList){ this.workshopGroupList.push(workshopGroupList[i]) } - this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber) + if(prop&&prop!='groupNumber'){ + this.ruleForm.groupNumber='' + } + // 缂栬緫 + if(val){ + setTimeout(()=>{ + this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber) + },200) + } } + }else{ + this.workshopGroupList=[] + this.ruleForm.groupNumber='' } }); if(this.ruleForm.groupNumber&&this.ruleForm.marketId){ let workshopName='' for(let i in this.nameList){ - if( this.nameList[i].number==this.ruleForm.workshopId){ + if( this.nameList[i].number==this.ruleForm.workshopNumber){ workshopName= this.nameList[i].name break; } @@ -1044,6 +1054,10 @@ if(val){ this.getTableEdit() } + }else{ + this.tableData=[] + this.ruleForm.level='' + this.ruleForm.carNumber='' } }); } @@ -1079,7 +1093,7 @@ circle: "", marketId: "", fallingSilkCocoonNumber: "", - workshopId: "", + workshopNumber: "", bucketCocoonNumber: "", groupNumber: "", vehicleSpeed: "", @@ -1133,7 +1147,6 @@ form.theorySilkAmount=Number(form.theorySilkAmount) form.total=Number(form.total) form.vehicleSpeed=Number(form.vehicleSpeed) - form.workshopId =Number(form.workshopId) for(let i in tableData){ let listItems1={ allYield:Number(tableData[i].allYield1)||0, //浜ч噺 -- Gitblit v1.8.0