fix:玻纤无聊添加时不需要ftest
This commit is contained in:
parent
b5162b034f
commit
6bcdb0a9d8
|
|
@ -140,7 +140,7 @@
|
|||
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
|
||||
</template>
|
||||
</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">
|
||||
<el-link
|
||||
v-if="scope.row.isEdit"
|
||||
|
|
@ -444,9 +444,11 @@ export default {
|
|||
open(mode = "ins",qct = '') {
|
||||
let that = this;
|
||||
this.mode = mode;
|
||||
this.qct = qct;
|
||||
if(that.mode == 'ins'){//输入
|
||||
that.getOptions();
|
||||
this.qct = ""
|
||||
}else{
|
||||
this.qct = qct;
|
||||
}
|
||||
that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => {
|
||||
that.process_type=res.process_type;
|
||||
|
|
@ -469,7 +471,7 @@ export default {
|
|||
},
|
||||
getdefects(){
|
||||
let that = this;
|
||||
if(that.qct!==null&&that.qct!==''){
|
||||
if(that.qct!==''){
|
||||
that.$API.qm.qct.item.req(that.qct).then((res) => {
|
||||
that.qct_defects = [];
|
||||
res.qct_defects.forEach((item) => {
|
||||
|
|
@ -522,7 +524,6 @@ export default {
|
|||
},
|
||||
getList(){
|
||||
let that = this;
|
||||
|
||||
that.$API.wpm.mlogbw.list.req(that.params).then((res) => {
|
||||
that.mlogbwlist = [];
|
||||
if(res.length>0){
|
||||
|
|
@ -530,28 +531,30 @@ export default {
|
|||
let obj = {};
|
||||
obj = Object.assign({},item);
|
||||
obj.isEdit = false;
|
||||
if(that.qct!=null&&that.qct!=''&&item.ftest!=null){
|
||||
if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
|
||||
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(that.qct!=''){
|
||||
if(item.ftest!=null){
|
||||
if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
|
||||
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] = "";
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
that.mlogbwlist.push(obj);
|
||||
})
|
||||
|
|
@ -560,25 +563,23 @@ export default {
|
|||
},
|
||||
//添加
|
||||
formTableSave(row) {
|
||||
|
||||
let that = this;
|
||||
let obj = {};
|
||||
obj.number = row.number;
|
||||
obj.mlogb = row.mlogb;
|
||||
obj.wpr = row.wpr;
|
||||
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不为空,有检验表
|
||||
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!==''){
|
||||
console.log('已填过');
|
||||
obj.ftest =row.ftest;
|
||||
|
|
|
|||
Loading…
Reference in New Issue