diff --git a/src/api/quality/income.js b/src/api/quality/income.js index 61c2c37..4311aa1 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 f5a7c8a..a747779 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); }