来料检测任务,测量值修改

master
shaoyong 6 months ago
parent 4a185e96db
commit f374672092

@ -174,3 +174,9 @@ export function getCkeckProjectXJList(query) {
params: query params: query
}); });
} }
export function getWeightValue(recordId) {
return request({
url: '/quality/qcIncome/getWeightValue/' + recordId,
method: 'get'
})
}

@ -139,7 +139,7 @@
</el-dialog> </el-dialog>
<!--测量值弹窗--> <!--测量值弹窗-->
<el-dialog title="测量值" :visible.sync="valueOpen" width="600px" append-to-body> <el-dialog title="测量值" :visible.sync="valueOpen" width="600px" append-to-body>
<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic"> <el-form :model="dynamicValidateForm" v-loading="dyloading" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<el-form-item <el-form-item
v-for="(domain, index) in dynamicValidateForm.domains" v-for="(domain, index) in dynamicValidateForm.domains"
:label="'测量值' + index" :label="'测量值' + index"
@ -156,7 +156,7 @@
<el-button type="primary" @click="submitForm('dynamicValidateForm')"></el-button> <el-button type="primary" @click="submitForm('dynamicValidateForm')"></el-button>
<el-button @click="addDomain"></el-button> <el-button @click="addDomain"></el-button>
<el-button v-if="this.weight === '1'" type="primary" icon="el-icon-refresh" @click="handleWeightValue"></el-button> <el-button v-if="this.weight === '1'" type="primary" icon="el-icon-refresh" @click="handleWeightValue"></el-button>
<el-button @click="resetForm('dynamicValidateForm')"></el-button> <el-button @click="handleResetForm()"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
@ -193,6 +193,7 @@ export default {
return { return {
viewStatus : '0', viewStatus : '0',
showFlag: false, showFlag: false,
dyloading: false,
// //
selectedRows: {}, selectedRows: {},
// //
@ -389,6 +390,12 @@ export default {
this.showFlag = false; this.showFlag = false;
this.reset(); this.reset();
}, },
// 使nextTick
handleResetForm() {
this.$nextTick(() => {
this.dynamicValidateForm.domains = [{ value: ''}];
});
},
// /YN // /YN
/* handleStatusChange(row) { /* handleStatusChange(row) {
@ -409,12 +416,13 @@ export default {
this.recordId = row.recordId; this.recordId = row.recordId;
this.weight = row.weight; this.weight = row.weight;
const actualValue = row.actualValue; const actualValue = row.actualValue;
if(actualValue !== null || actualValue !== ''){ console.log(actualValue);
if(actualValue !== null && actualValue !== '') {
this.dynamicValidateForm.domains = []; this.dynamicValidateForm.domains = [];
let values = actualValue.split(","); let values = actualValue.split(",");
values.forEach((item,index) => { values.forEach((item,index) => {
this.dynamicValidateForm.domains.push({ this.dynamicValidateForm.domains.push({
value: item, value: item.toString(),
key: Date.now() + index key: Date.now() + index
}); });
}); });
@ -523,13 +531,14 @@ export default {
this.defectForm.defectItems.forEach(item => (item.noOkQuality = 0)); this.defectForm.defectItems.forEach(item => (item.noOkQuality = 0));
}, },
handleWeightValue() { handleWeightValue() {
this.dyloading = true;
const recordId = this.recordId; const recordId = this.recordId;
getWeightValue(recordId).then(response => { getWeightValue(recordId).then(response => {
if(response.code === 200) { if(response.code === 200) {
let value = response.msg; let value = response.msg;
if(value !== null || value !== ''){ if(value !== null && value !== ''){
let arr = value.split(","); let arr = value.split(",");
console.log(arr); this.dynamicValidateForm.domains = [];
arr.forEach((item,index)=> { arr.forEach((item,index)=> {
this.dynamicValidateForm.domains.push({ this.dynamicValidateForm.domains.push({
value: item, value: item,
@ -537,8 +546,7 @@ export default {
}); });
}); });
} }
this.dyloading = false;
console.log(this.dynamicValidateForm.domains);
}else { }else {
this.$modal.msgError(response.msg); this.$modal.msgError(response.msg);
} }

Loading…
Cancel
Save