- |
+
+
+ |
+ 序号 |
物料批次 |
物料编号 |
{{ item.testitem_name }} |
@@ -38,6 +41,9 @@
|
+
+ {{ index + 1 }}
+ |
{{ row.mlogb__batch }}
@@ -66,7 +72,7 @@
{{ row.note }}
|
-
+
@@ -198,7 +204,7 @@
-
+
@@ -210,11 +216,13 @@
-
+
-
+
+
+
@@ -225,7 +233,7 @@
保存
- 取消
+ 取消
@@ -318,6 +326,7 @@ export default {
route_code:"",
wprInputText:"",
canMultiple:false,
+ selectedAll:false,
checkAll: false,
hideAdd: false,
visible: false,
@@ -359,7 +368,6 @@ export default {
selectWprList:[],
selectedindexes:[],
qct_defects_origin:[],
- selectWpr:[],
tableHeight:500,
apiObjPrint:this.$API.cm.labelmat.fromWm,
printer_name:localStorage.getItem("printer_name")
@@ -402,17 +410,23 @@ export default {
selectChange(){
let that = this;
that.selectWprList = [];
- console.log('selectedindexes',that.selectedindexes);
that.mlogbwlist.forEach((item) => {
if(that.selectedindexes.indexOf(item.id)>-1){
that.selectWprList.push(item);
}
})
- console.log('selectWprList',that.selectWprList);
},
- selectAllChange(datas){
+ selectAllChange(){
let that = this;
- that.selectWprList = datas;
+ if(that.selectedAll){
+ that.mlogbwlist.forEach((item) => {
+ that.selectedindexes.push(item.id);
+ that.selectWprList.push(item);
+ })
+ }else{
+ that.selectedindexes=[];
+ that.selectWprList=[];
+ }
},
getEquipment4() {
let that = this;
@@ -475,15 +489,6 @@ export default {
that.options = res;
})
},
- optionChange(row){
- let that = this;
- that.options.forEach((item) => {
- if(item.id == row.wpr){
- let index = that.mlogbwlist.indexOf(row);
- that.mlogbwlist[index].number = item.number;
- }
- })
- },
getList(){
let that = this;
let params = {};
@@ -527,7 +532,6 @@ export default {
}
that.mlogbwlist.push(obj);
})
- // console.log('that.mlogbwlist',that.mlogbwlist);
}
})
},
@@ -624,7 +628,7 @@ export default {
let getEd = false;
if(that.qct_testitems.length>0){
for(let i=0;i {
if(that.form.defectids.indexOf(item.defect) > -1){
item.canEdit = true;
- item.value=null;
+ item.value=false;
that.defectlists.push(item);
}
})
@@ -771,7 +775,7 @@ export default {
if(that.checkAll){
that.qct_defects.forEach(item => {
item.canEdit = true;
- item.value=null;
+ item.value=false;
that.defectlists.push(item);
that.form.defectids.push(item.defect);
})
@@ -811,7 +815,6 @@ export default {
that.qct_testitems = [];
that.qct_testitems = that.testitemlists;
that.tableHeight = document.getElementById('mlogbwMain').clientHeight-80;
- // that.getList();
}).catch(() => {
that.isSaveing = false;
})
@@ -826,14 +829,11 @@ export default {
this.form.defectids = [];
this.checkVisible = false;
},
+ //批量操作
check_set(){
- this.wprNumber = "";
- this.selectWpr = [];
- if(this.selectWprList.length>0){
- this.selectWpr = this.selectWprList;
- }
- console.log('this.selectWpr',this.selectWpr);
- this.setVisible=true;
+ let that = this;
+ that.wprNumber = "";
+ that.setVisible=true;
},
//扫描物料将这一行放到第一行并编辑这一行
wprinputChange(){
@@ -847,12 +847,13 @@ export default {
that.wprInputText = "";
that.mlogbwlist.unshift(obj);
that.$nextTick(() => {
- that.$refs.mlogbwTable.setCurrentRows(obj); // 选中第一行
+ that.selectedindexes.push(obj.id);
+ that.selectWprList.push(item);
})
let getEd = false;
if(that.qct_testitems.length>0){
for(let i=0;i {
- console.log(err);
this.$notify.error({
title: '获取数据失败',
message: err.data
@@ -901,45 +901,48 @@ export default {
let that = this;
that.mlogbwlist.forEach(item => {
if(item.number == wprNumber){
- that.selectWpr.push(item);
+ that.selectWprList.push(item);
that.wprNumber = "";
}
});
},
selectWprDel(row){
let that = this;
- that.selectWpr.forEach((item,index) => {
+ that.selectWprList.forEach((item,index) => {
if(item.number == row.number){
- that.selectWpr.splice(index,1);
+ that.selectWprList.splice(index,1);
}
});
},
+ defect_change(item){
+ let that = this;
+ that.selectWprList.forEach(row => {
+ row[item.defect_name] = item.value;
+ });
+ },
saveSetting(){
let that = this;
that.$refs.dialogForm.validate((valid) => {
if (valid) {
- that.selectWpr.forEach(item => {
+ that.selectWprList.forEach(item => {
+ if(!item.ftest){
+ item.ftest = {};
+ }
item.ftest.ftestdefects = [];
if(that.defectlists.length>0){
that.defectlists.forEach((item1) => {
let obj = {};
obj.defect = item1.defect;
- obj.has = item1.value;
+ obj.has = item[item1.defect_name]?item[item1.defect_name]:false;
item.ftest.ftestdefects.push(obj);
})
}
-
- // item.ftest.ftestdefects.forEach(defect => {
- // let defectindex = that.setForm.defectids.indexOf(defect.defect);
- // if(defectindex > -1){
- // defect.has = that.defectlists[defectindex].value;
- // }
- // })
});
- that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => {
+ that.$API.wpm.mlogbw.update.req("bulk",that.selectWprList).then((res) => {
that.setVisible = false;
+ that.selectedAll = false;
that.selectWprList = [];
- that.$refs.mlogbwTable.clearSelection();
+ that.selectedindexes = [];
that.defectlists.forEach(item => {
item.value = false;
});
@@ -950,6 +953,16 @@ export default {
}
});
},
+ saveSettingCancel(){
+ let that = this;
+ that.setVisible = false;
+ that.selectedAll = false;
+ that.selectWprList = [];
+ that.selectedindexes = [];
+ // that.defectlists.forEach(item => {
+ // item.value = false;
+ // });
+ },
},
};
|