fix:玻纤无聊添加时不需要ftest

This commit is contained in:
shijing 2025-03-13 14:32:48 +08:00
parent b5162b034f
commit 6bcdb0a9d8
1 changed files with 37 additions and 36 deletions

View File

@ -140,7 +140,7 @@
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input> <el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="open" label="操作" width="90" align="center" fixed="right" v-if="!isSubmit"> <el-table-column label="操作" width="90" align="center" fixed="right" v-if="!isSubmit">
<template #default="scope"> <template #default="scope">
<el-link <el-link
v-if="scope.row.isEdit" v-if="scope.row.isEdit"
@ -444,9 +444,11 @@ export default {
open(mode = "ins",qct = '') { open(mode = "ins",qct = '') {
let that = this; let that = this;
this.mode = mode; this.mode = mode;
this.qct = qct;
if(that.mode == 'ins'){// if(that.mode == 'ins'){//
that.getOptions(); that.getOptions();
this.qct = ""
}else{
this.qct = qct;
} }
that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => { that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => {
that.process_type=res.process_type; that.process_type=res.process_type;
@ -469,7 +471,7 @@ export default {
}, },
getdefects(){ getdefects(){
let that = this; let that = this;
if(that.qct!==null&&that.qct!==''){ if(that.qct!==''){
that.$API.qm.qct.item.req(that.qct).then((res) => { that.$API.qm.qct.item.req(that.qct).then((res) => {
that.qct_defects = []; that.qct_defects = [];
res.qct_defects.forEach((item) => { res.qct_defects.forEach((item) => {
@ -522,7 +524,6 @@ export default {
}, },
getList(){ getList(){
let that = this; let that = this;
that.$API.wpm.mlogbw.list.req(that.params).then((res) => { that.$API.wpm.mlogbw.list.req(that.params).then((res) => {
that.mlogbwlist = []; that.mlogbwlist = [];
if(res.length>0){ if(res.length>0){
@ -530,28 +531,30 @@ export default {
let obj = {}; let obj = {};
obj = Object.assign({},item); obj = Object.assign({},item);
obj.isEdit = false; obj.isEdit = false;
if(that.qct!=null&&that.qct!=''&&item.ftest!=null){ if(that.qct!=''){
if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){ if(item.ftest!=null){
item.ftest.ftestdefects.forEach((item1) => { if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
obj[item1.defect_name] = item1.has; item.ftest.ftestdefects.forEach((item1) => {
}) obj[item1.defect_name] = item1.has;
} })
if(item.ftest.ftestitems!==undefined&&item.ftest.ftestitems!==''&&item.ftest.ftestitems!==null&&item.ftest.ftestitems.length>0){
item.ftest.ftestitems.forEach((item2) => {
obj[item2.testitem_name] = item2.test_val_json;
})
}
}else{
that.qct_defects.forEach((item1) => {
obj[item1.defect_name] = false;
})
that.qct_testitems.forEach((item2) => {
if(item2.testitem_field_type=='input-number'||item.testitem_field_type=='input-int'){
obj[item2.testitem_name] = 0;
}else{
obj[item2.testitem_name] = "";
} }
}) if(item.ftest.ftestitems!==undefined&&item.ftest.ftestitems!==''&&item.ftest.ftestitems!==null&&item.ftest.ftestitems.length>0){
item.ftest.ftestitems.forEach((item2) => {
obj[item2.testitem_name] = item2.test_val_json;
})
}
}else{
that.qct_defects.forEach((item1) => {
obj[item1.defect_name] = false;
})
that.qct_testitems.forEach((item2) => {
if(item2.testitem_field_type=='input-number'||item.testitem_field_type=='input-int'){
obj[item2.testitem_name] = 0;
}else{
obj[item2.testitem_name] = "";
}
})
}
} }
that.mlogbwlist.push(obj); that.mlogbwlist.push(obj);
}) })
@ -560,25 +563,23 @@ export default {
}, },
// //
formTableSave(row) { formTableSave(row) {
let that = this; let that = this;
let obj = {}; let obj = {};
obj.number = row.number; obj.number = row.number;
obj.mlogb = row.mlogb; obj.mlogb = row.mlogb;
obj.wpr = row.wpr; obj.wpr = row.wpr;
obj.note = row.note; obj.note = row.note;
that.qct_defects_origin.forEach(item => {
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'row.\$1')
let judge = eval(str);
row[item.defect_name] = judge;
}
});
//qct //qct
if(that.qct!==null&&that.qct!==''){ if(that.qct!==''){
that.qct_defects_origin.forEach(item => {
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'row.\$1')
let judge = eval(str);
row[item.defect_name] = judge;
}
});
// //
console.log('row',row);
if(row.ftest!==null&&row.ftest!==undefined&&row.ftest!==''){ if(row.ftest!==null&&row.ftest!==undefined&&row.ftest!==''){
console.log('已填过'); console.log('已填过');
obj.ftest =row.ftest; obj.ftest =row.ftest;