From f3746720925e6a1598042eb3180ad2f46ecd5dc3 Mon Sep 17 00:00:00 2001 From: shaoyong Date: Tue, 21 May 2024 11:20:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=A5=E6=96=99=E6=A3=80=E6=B5=8B=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=EF=BC=8C=E6=B5=8B=E9=87=8F=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/quality/income.js | 6 +++++ .../quality/qcIncome/checkProjectType.vue | 26 ++++++++++++------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/api/quality/income.js b/src/api/quality/income.js index 61c2c378..4311aa14 100644 --- a/src/api/quality/income.js +++ b/src/api/quality/income.js @@ -174,3 +174,9 @@ export function getCkeckProjectXJList(query) { params: query }); } + export function getWeightValue(recordId) { + return request({ + url: '/quality/qcIncome/getWeightValue/' + recordId, + method: 'get' + }) + } diff --git a/src/views/quality/qcIncome/checkProjectType.vue b/src/views/quality/qcIncome/checkProjectType.vue index f5a7c8a5..a747779e 100644 --- a/src/views/quality/qcIncome/checkProjectType.vue +++ b/src/views/quality/qcIncome/checkProjectType.vue @@ -139,7 +139,7 @@ - + 提交 新增测量值 自动获取 - 重置 + 重置 @@ -192,7 +192,8 @@ export default { data() { return { viewStatus : '0', - showFlag : false, + showFlag: false, + dyloading: false, // 选中数组 selectedRows: {}, // 非单个禁用 @@ -389,6 +390,12 @@ export default { this.showFlag = false; this.reset(); }, + // 使用nextTick解决循环引用问题 + handleResetForm() { + this.$nextTick(() => { + this.dynamicValidateForm.domains = [{ value: ''}]; + }); + }, // 数据状态修改/Y合格N不合格 /* handleStatusChange(row) { @@ -409,12 +416,13 @@ export default { this.recordId = row.recordId; this.weight = row.weight; const actualValue = row.actualValue; - if(actualValue !== null || actualValue !== ''){ + console.log(actualValue); + if(actualValue !== null && actualValue !== '') { this.dynamicValidateForm.domains = []; let values = actualValue.split(","); values.forEach((item,index) => { this.dynamicValidateForm.domains.push({ - value: item, + value: item.toString(), key: Date.now() + index }); }); @@ -523,13 +531,14 @@ export default { this.defectForm.defectItems.forEach(item => (item.noOkQuality = 0)); }, handleWeightValue() { + this.dyloading = true; const recordId = this.recordId; getWeightValue(recordId).then(response => { if(response.code === 200) { let value = response.msg; - if(value !== null || value !== ''){ + if(value !== null && value !== ''){ let arr = value.split(","); - console.log(arr); + this.dynamicValidateForm.domains = []; arr.forEach((item,index)=> { this.dynamicValidateForm.domains.push({ value: item, @@ -537,8 +546,7 @@ export default { }); }); } - - console.log(this.dynamicValidateForm.domains); + this.dyloading = false; }else { this.$modal.msgError(response.msg); }