diff --git a/src/views/wpm_bx/mlogbw_check.vue b/src/views/wpm_bx/mlogbw_check.vue
index bda39093..b885b8af 100644
--- a/src/views/wpm_bx/mlogbw_check.vue
+++ b/src/views/wpm_bx/mlogbw_check.vue
@@ -99,37 +99,6 @@
-
-
-
-
-
- {{ scope.row.wave_number }}
-
-
-
{{ scope.row[item.testitem_name] }}
@@ -514,7 +483,7 @@ export default {
ins:'输入物料详情',
outs:'输出物料详情',
},
- mode:'ins',
+ mode:'',
//表单数据
form: {
test_user:"",
@@ -587,10 +556,7 @@ export default {
},
mounted() {
let that = this;
- this.route_code = this.$route.path.split("/")[2];
- if(this.route_code=='niuzhuan'&&that.mode == 'ins'){
- // that.gettestitem();
- }
+ that.route_code = that.$route.path.split("/")[2];
that.hideAdd = that.isSubmit;
if(that.mgroupName=='排一次棒'||that.mgroupName=='排板'){
// that.getNewNumber();
@@ -599,9 +565,12 @@ export default {
that.currentDate = that.$TOOL.dateFormat2(new Date());
},
methods: {
- open(mode = "ins",qct = '') {
+ open(mode = "",qct = '') {
let that = this;
this.mode = mode;
+ if(that.route_code=='niuzhuan'&&that.mode == 'ins'){
+ that.gettestitem();
+ }
if(that.mode == 'ins'&&that.route_code!=='niuzhuan'){//输入
that.getOptions();
that.qct = ""
@@ -622,17 +591,25 @@ export default {
gettestitem(){
let that = this;
that.$API.qm.qct.getQct.req({ material: that.material_in,type:'in',tag:'process' }).then((res) => {
- console.log('gettestitem',res);
- // that.qct = res[0].id;
+ that.qct = res.id;
that.testitems = [];
- // let list = res[0].qct_testitems;
- // list.forEach(item=>{
- // let obj = Object.assign({}, item);
- // obj.value = null;
- // obj.canEdit = true;
- // obj.addto_wpr = item.addto_wpr;
- // that.testitems.push(obj)
- // })
+ let list = res.qct_testitems;
+ list.forEach(item=>{
+ if(item.testitem_type=='20'){
+ let obj = Object.assign({}, item);
+ obj.value = null;
+ obj.canEdit = true;
+ if(item.testitem_field_type=='input-number'||item.testitem_field_type=='input-int'){
+ obj.value = null;
+ }
+ if(item.testitem_field_type=='select-text'||item.testitem_field_type=='selects-text'){
+ let str = obj.testitem_choices.replace(/'/g, '"');
+ let arr = JSON.parse(str);
+ obj.testitem_choices = arr;
+ }
+ that.testitems.push(obj)
+ }
+ })
});
},
getNewNumber(){
@@ -709,22 +686,24 @@ export default {
that.qct_defects_origin = that.qct_defects;
that.qct_testitems = [];
res.qct_testitems.forEach((item2) => {
- let obj2 = Object.assign({}, item2);
- obj2.value = '';
- obj2.canEdit = that.processType=='20'?false:true;
-
- obj2.addto_wpr = item2.addto_wpr;
- if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
- obj2.value = null;
- that.addTemplate[item2.testitem_name] = null;
+ if(item2.type=='10'){
+ let obj2 = Object.assign({}, item2);
+ obj2.value = '';
+ obj2.canEdit = that.processType=='20'?false:true;
+
+ obj2.addto_wpr = item2.addto_wpr;
+ if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
+ obj2.value = null;
+ that.addTemplate[item2.testitem_name] = null;
+ }
+ if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){
+ let str = obj2.testitem_choices.replace(/'/g, '"');
+ let arr = JSON.parse(str);
+ obj2.testitem_choices = arr;
+ that.addTemplate[item2.testitem_name] = null;
+ }
+ that.qct_testitems.push(obj2);
}
- if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){
- let str = obj2.testitem_choices.replace(/'/g, '"');
- let arr = JSON.parse(str);
- obj2.testitem_choices = arr;
- that.addTemplate[item2.testitem_name] = null;
- }
- that.qct_testitems.push(obj2);
})
that.qct_testitems_origin = that.qct_testitems;
that.getList();
@@ -802,30 +781,55 @@ export default {
}
});
//检验表已经填过
- if(row.ftest!==null&&row.ftest!==undefined&&row.ftest!==''){
- console.log('已填过');
- obj.ftest =row.ftest;
- obj.ftest.ftestdefects.forEach((item) => {
- item.has = row[item.defect_name];
- })
- row.ftest.ftestitems.forEach((item1) => {
- item1.test_val_json = row[item1.testitem_name];
- })
- }else{//检验表未填过
- console.log('未填过');
- obj.ftest = {};
- obj.ftest.ftestitems = [];
- obj.ftest.ftestdefects = [];
- obj.ftest.qct = that.qct;
- obj.ftest.test_date = that.handle_date!=null?that.handle_date:that.currentDate;
- obj.ftest.test_user = that.handle_user;
- that.qct_defects_origin.forEach((item) => {
+ // if(row.ftest!==null&&row.ftest!==undefined&&row.ftest!==''){
+ // console.log('已填过');
+ // obj.ftest =row.ftest;
+ // obj.ftest.ftestdefects.forEach((item) => {
+ // item.has = row[item.defect_name];
+ // })
+ // row.ftest.ftestitems.forEach((item1) => {
+ // item1.test_val_json = row[item1.testitem_name];
+ // })
+ // }else{//检验表未填过
+ // console.log('未填过');
+ // obj.ftest = {};
+ // obj.ftest.ftestitems = [];
+ // obj.ftest.ftestdefects = [];
+ // obj.ftest.qct = that.qct;
+ // obj.ftest.test_date = that.handle_date!=null?that.handle_date:that.currentDate;
+ // obj.ftest.test_user = that.handle_user;
+ // that.qct_defects_origin.forEach((item) => {
+ // let itemObj = {};
+ // itemObj.defect = item.defect;
+ // itemObj.test_user = that.handle_user;
+ // itemObj.has = row[item.defect_name]?row[item.defect_name]:false;
+ // obj.ftest.ftestdefects.push(itemObj);
+ // })
+ // that.qct_testitems.forEach((item1) => {
+ // let itemObj1 = {};
+ // itemObj1.testitem = item1.testitem;
+ // itemObj1.test_user = that.handle_user;
+ // itemObj1.addto_wpr = item1.addto_wpr;
+ // itemObj1.test_val_json = row[item1.testitem_name];
+ // obj.ftest.ftestitems.push(itemObj1);
+ // })
+ // }
+ obj.ftest = {};
+ obj.ftest.ftestitems = [];
+ obj.ftest.ftestdefects = [];
+ obj.ftest.qct = that.qct;
+ obj.ftest.test_date = that.handle_date!=null?that.handle_date:that.currentDate;
+ obj.ftest.test_user = that.handle_user;
+ if(that.qct_defects.length>0){
+ that.qct_defects.forEach((item) => {
let itemObj = {};
itemObj.defect = item.defect;
itemObj.test_user = that.handle_user;
itemObj.has = row[item.defect_name]?row[item.defect_name]:false;
obj.ftest.ftestdefects.push(itemObj);
})
+ }
+ if(that.qct_testitems.length>0){
that.qct_testitems.forEach((item1) => {
let itemObj1 = {};
itemObj1.testitem = item1.testitem;
@@ -834,16 +838,22 @@ export default {
itemObj1.test_val_json = row[item1.testitem_name];
obj.ftest.ftestitems.push(itemObj1);
})
- }
+ }
+ if(that.mode == 'ins'&&that.route_code=='niuzhuan'&&that.testitems.length>0){
+ obj.equip = row.equip;
+ obj.work_start_time = row.work_start_time;
+ that.testitems.forEach((item1) => {
+ let itemObj1 = {};
+ itemObj1.testitem = item1.testitem;
+ itemObj1.test_user = that.handle_user;
+ itemObj1.addto_wpr = item1.addto_wpr;
+ itemObj1.test_val_json = row[item1.testitem_name];
+ obj.ftest.ftestitems.push(itemObj1);
+ })
+ }
}else{
obj.ftest = null;
}
- if(that.mode == 'ins'&&that.route_code=='niuzhuan'){
- obj.equip = row.equip;
- obj.work_start_time = row.work_start_time;
- obj.work_time = row.work_time;
- obj.wave_number = row.wave_number;
- }
if(row.id!==''&&row.id!==undefined&&row.id!==null){
obj.id = row.id;
that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => {