From 8c70602bf7417b48e53464c8c101ece25c40d5b0 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期五, 12 四月 2024 18:30:48 +0800 Subject: [PATCH] 生丝定级标准保存失败的数据处理 --- src/views/productManage/silkRegisterForm/addPage.vue | 1 + src/views/systemSetting/silkStandardSetting/index.vue | 17 ++++++++++++++--- src/views/productManage/productRegisterForm/components/addProductDialog.vue | 22 ++++++++++++---------- src/views/productManage/productRegisterForm/addProductRegisterPage.vue | 12 ++++++++---- 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/views/productManage/productRegisterForm/addProductRegisterPage.vue b/src/views/productManage/productRegisterForm/addProductRegisterPage.vue index 1ee4194..62c0700 100644 --- a/src/views/productManage/productRegisterForm/addProductRegisterPage.vue +++ b/src/views/productManage/productRegisterForm/addProductRegisterPage.vue @@ -124,7 +124,7 @@ placeholder="璇峰厛閫夋嫨杞﹂棿" no-data-text='璇峰厛閫夋嫨杞﹂棿' class="select-width" - @change='getGroupNumber' + @change="getGroupNumber(false,'groupNumber')" > <el-option v-for="item in workshopGroupList" @@ -990,21 +990,25 @@ } }); }, - getGroupNumber(val){ + getGroupNumber(val,prop){ if(this.ruleForm.workshopNumber){ //缁勫埆 getWorkshopManageGroup({number:this.ruleForm.workshopNumber}).then((res) => { if (res.code == 200) { let workshopGroupList = res.data || {}; this.workshopGroupList=[] - this.ruleForm.groupNumber='' if(Object.keys(workshopGroupList).length>0){ for(let i in workshopGroupList){ this.workshopGroupList.push(workshopGroupList[i]) } + if(prop&&prop!='groupNumber'){ + this.ruleForm.groupNumber='' + } // 缂栬緫 if(val){ - this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber) + setTimeout(()=>{ + this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber) + },200) } } }else{ diff --git a/src/views/productManage/productRegisterForm/components/addProductDialog.vue b/src/views/productManage/productRegisterForm/components/addProductDialog.vue index 54923a2..af31334 100644 --- a/src/views/productManage/productRegisterForm/components/addProductDialog.vue +++ b/src/views/productManage/productRegisterForm/components/addProductDialog.vue @@ -48,9 +48,9 @@ </el-form-item> </el-col> <el-col :span="11"> - <el-form-item label="杞﹂棿" prop="workshopId"> + <el-form-item label="杞﹂棿" prop="workshopNumber"> <el-select - v-model="proForm.workshopId" + v-model="proForm.workshopNumber" placeholder="璇烽�夋嫨" class="select-width" @change="getGroupNumber" @@ -194,7 +194,7 @@ proForm: { createTime: "", groupNumber: "", - workshopId: "", + workshopNumber: "", spec: "", marketId: "", tareWeight: "", @@ -210,7 +210,7 @@ marketId: [ { required: true, message: "璇烽�夋嫨", trigger: ["change", "blur"] }, ], - workshopId: [ + workshopNumber: [ { required: true, message: "璇烽�夋嫨", trigger: ["change", "blur"] }, ], groupNumber: [ @@ -232,7 +232,7 @@ deep: true, immediate:true, }, - 'form.workshopId': function () { + 'form.workshopNumber': function () { this.getGroupNumber() } }, @@ -240,7 +240,7 @@ getInfo(){ this.proForm.createTime=this.form.createTime this.proForm.groupNumber=this.form.groupNumber - this.proForm.workshopId=this.form.workshopId + this.proForm.workshopNumber=this.form.workshopNumber this.proForm.spec=this.form.spec this.proForm.marketId=this.form.marketId if(!this.proForm.carNumber){ @@ -249,12 +249,14 @@ this.$forceUpdate(); }, getGroupNumber(){ - if(this.proForm.workshopId){ + if(this.proForm.workshopNumber){ //缁勫埆 - getWorkshopManageGroup({number:this.proForm.workshopId}).then((res) => { + getWorkshopManageGroup({number:this.proForm.workshopNumber}).then((res) => { if (res.code == 200) { this.workshopGroupList=[] let workshopGroupList = res.data || {}; + this.workshopGroupList=[] + this.ruleForm.groupNumber='' if(Object.keys(workshopGroupList).length>0){ for(let i in workshopGroupList){ this.workshopGroupList.push(workshopGroupList[i]) @@ -267,13 +269,13 @@ } }, changeForm(val){ - if(this.editDialogVisible&&this.proForm.createTime&&this.proForm.groupNumber&&this.proForm.marketId&&this.proForm.spec&&this.proForm.workshopId){ + if(this.editDialogVisible&&this.proForm.createTime&&this.proForm.groupNumber&&this.proForm.marketId&&this.proForm.spec&&this.proForm.workshopNumber){ changeYieldRegister({ createTime: this.proForm.createTime, groupNumber: this.proForm.groupNumber, marketId: this.proForm.marketId, spec: this.proForm.spec, - workshopId: this.proForm.workshopId, + workshopNumber: this.proForm.workshopNumber, }).then((res) => { if (res.code == 200) { if(res.data){ diff --git a/src/views/productManage/silkRegisterForm/addPage.vue b/src/views/productManage/silkRegisterForm/addPage.vue index cb5a4c1..7b0000d 100644 --- a/src/views/productManage/silkRegisterForm/addPage.vue +++ b/src/views/productManage/silkRegisterForm/addPage.vue @@ -115,6 +115,7 @@ placeholder="璇峰厛閫夋嫨杞﹂棿" no-data-text="璇峰厛閫夋嫨杞﹂棿" class="select-width" + @change="getGroupNumber" > <el-option v-for="item in workshopGroupList" diff --git a/src/views/systemSetting/silkStandardSetting/index.vue b/src/views/systemSetting/silkStandardSetting/index.vue index f2ac1f7..dd236fe 100644 --- a/src/views/systemSetting/silkStandardSetting/index.vue +++ b/src/views/systemSetting/silkStandardSetting/index.vue @@ -17,7 +17,6 @@ <div class="edit-sace-label">{{ isEdit ? "閿佸畾淇濆瓨" : "鐣岄潰璁捐" }}</div> </div> <div> - 111锛歿{ this.silkTableList.tableData }} <SilkTableList :detail-enter="isEdit" :silk-table-list="silkTableList" @@ -219,7 +218,20 @@ } }, saveParam() { - let saveList = this.tableData.map((item) => { + let tableData=JSON.parse( + JSON.stringify(this.silkTableList.tableData) + ); + for(let i in tableData){ + tableData[i].dynamicsRanks=[] + for(let j in this.columnInputList){ + tableData[i].dynamicsRanks.push({ + rankName:this.columnInputList[j].rankName, + rankProp:this.columnInputList[j].rankProp, + rankValue:tableData[i][this.columnInputList[j].rankProp] + }) + } + } + let saveList = tableData.map((item) => { return { checkItem: item.checkItem, dynamicsRanks: item.dynamicsRanks, @@ -273,7 +285,6 @@ item.rankName = val } }) - console.log(this.columnInputList, "888") }, getCheckItemName(val) { if (val) { -- Gitblit v1.8.0