fix:检测项为空时,不传

This commit is contained in:
shijing 2025-07-15 09:56:47 +08:00
parent 51bcaa2dbb
commit ed526af585
1 changed files with 9 additions and 19 deletions

View File

@ -1390,21 +1390,9 @@ export default {
if (valid) {
let ftestdefects = [],ftestitems = [];
let obj = {};
if(row.ftest!==null){
ftestdefects = row.ftest.ftestdefects;
ftestdefects.forEach((item) => {
item.test_user = that.formbw.test_user;
item.test_date = that.formbw.test_date;
item.has = row[item.defect_name]?row[item.defect_name]:false;
})
ftestitems = row.ftest.ftestitems;
ftestitems.forEach((item1) => {
item1.test_user = that.formbw.test_user;
item1.test_date = that.formbw.test_date;
item1.test_val_json = row[item1.testitem_name]?row[item1.testitem_name]:null;
})
}else{
that.qct_testitems.forEach((item) => {
console.log('row[item.testitem_name]',row[item.testitem_name]);
if(row[item.testitem_name]!==''&&row[item.testitem_name]!==null){
let obj0 = {};
obj0.testitem = item.testitem;
obj0.test_user = that.formbw.test_user;
@ -1412,8 +1400,10 @@ export default {
obj0.testitem_name = item.testitem_name;
obj0.test_val_json = row[item.testitem_name]?row[item.testitem_name]:null;
ftestitems.push(obj0);
}
})
that.qct_defects.forEach((item1) => {
if(row[item1.defect_name]!==''&&row[item1.defect_name]!==null){
let obj1 = {};
obj1.defect = item1.defect;
obj1.test_user = that.formbw.test_user;
@ -1421,8 +1411,8 @@ export default {
obj1.test_date = that.formbw.test_date;
obj1.has = row[item1.defect_name]?row[item1.defect_name]:false;
ftestdefects.push(obj1);
})
}
})
obj.note = row.note;
obj.number = row.number;
obj.mioitem = row.mioitem;