From caeb71b06d19a8ffd854c19e5e4b58f7180cdce8 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期一, 29 四月 2024 18:55:14 +0800 Subject: [PATCH] 纤度检验表的保存接口参数修改 --- src/views/employeeSalary/salaryPlan/components/addDialog.vue | 57 ++++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 42 insertions(+), 15 deletions(-) diff --git a/src/views/employeeSalary/salaryPlan/components/addDialog.vue b/src/views/employeeSalary/salaryPlan/components/addDialog.vue index 5ed0a6c..6fd49ea 100644 --- a/src/views/employeeSalary/salaryPlan/components/addDialog.vue +++ b/src/views/employeeSalary/salaryPlan/components/addDialog.vue @@ -35,9 +35,9 @@ </el-option> </el-select> </el-form-item> - <el-form-item prop="salaryType" label="钖祫绫诲瀷"> + <el-form-item prop="salaryTypeId" label="钖祫绫诲瀷"> <el-select - v-model="form.salaryType" + v-model="form.salaryTypeId" style="width: calc(100% - 40px)" placeholder="璇烽�夋嫨杞﹂棿" > @@ -45,7 +45,7 @@ v-for="item in unitList" :key="item.id" :label="item.name" - :value="item.name" + :value="item.id" > </el-option> </el-select> @@ -169,7 +169,7 @@ </el-form> <span slot="footer" class="dialog-footer"> <el-button type="cancel" @click="cancelMethod()">鍙栨秷</el-button> - <el-button type="primary" @click="submitForm('form')">纭� 瀹�</el-button> + <el-button type="primary" :loading="isAddloading" @click="submitForm('form')">纭� 瀹�</el-button> </span> </el-dialog> <BomDialog @@ -221,15 +221,15 @@ form: { name: "", workTypes: [], - salaryType: "", + salaryTypeId: null, salaryFormula: "", salaryFormulaHtml: "", error: "", }, // 婊″嫟濂栬缃� - absenteeism:1, + absenteeism:{value:1,id:null}, // 璁剧疆閲庣氦鐨勭敓涓濇爣鍑� - wildSilkList: ['閲庣氦'], + wildSilkList: {value:'閲庣氦',id:null}, activeName: 1, formulaName: [ { @@ -325,7 +325,7 @@ trigger: ["blur", "change"], }, ], - salaryType: [ + salaryTypeId: [ { required: true, message: "璇烽�夋嫨", trigger: ["blur", "change"] }, ], salaryFormulaHtml: [ @@ -334,6 +334,7 @@ }, unitList: [], constType: "", + isAddloading: false, }; }, computed: {}, @@ -363,7 +364,7 @@ this.form = { name: "", workTypes: [], - salaryType: "", + salaryTypeId: null, salaryFormula: "", salaryFormulaHtml: "", error: "", @@ -496,14 +497,20 @@ }, confirmValueSave(form, type) { if (type == 9) { - this.wildSilkList = form.wildSilkList; + let wildSilkList = form.wildSilkList; this.handleConfirmSave([ - {name:this.wildSilkList.join(',')} + { + name:wildSilkList.join(','), + id:this.wildSilkList.id + } ],type) } else if (type == 10) { - this.absenteeism = form.absenteeism + ""; + let absenteeism = form.absenteeism + ""; this.handleConfirmSave([ - {name:this.absenteeism} + { + name:absenteeism, + id:this.absenteeism.id + } ],type) } else if (type == 3) { this.formulaClick( @@ -547,6 +554,7 @@ values: dataList, } } + this.isAddloading = true; saveSalaryType(params).then((res) => { if (res.code == 200) { this.$message({ @@ -562,14 +570,33 @@ } this.handleGetBomKindDictList(val?val:''); } + this.isAddloading = false; + }).catch(() => { + setTimeout(() => { + this.isAddloading = false; + }, 3000); }); }, handleGetBomKindDictList(val) { getSalaryTypeList({ type: val?val:8 }).then((res) => { if(val==9){ - this.wildSilkList=(res.data&&res.data.length>0)?res.data[0].name.split(','):['閲庣氦'] + // 閲庣氦鐨勭敓涓濇爣鍑嗛厤缃� + this.wildSilkList=(res.data&&res.data.length>0)?{ + ...res.data[0], + value:res.data[0].name.split(',')||[] + }:{ + id:null, + value:['閲庣氦'] + } }else if(val==10){ - this.absenteeism=(res.data&&res.data.length>0)?res.data[0].name:1 + // 鑰冨嫟閰嶇疆 + this.absenteeism=(res.data&&res.data.length>0)?{ + ...res.data[0], + value:res.data[0].name||1 + }:{ + id:null, + value:1 + } }else{ this.unitList = res.data; } -- Gitblit v1.8.0