fix:检验工序检验调整
This commit is contained in:
parent
52456dc155
commit
58ae8af50d
|
|
@ -4,6 +4,7 @@
|
||||||
v-model="visible"
|
v-model="visible"
|
||||||
:size="'90%'"
|
:size="'90%'"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
|
:close-on-click-modal="false"
|
||||||
@closed="$emit('closed')"
|
@closed="$emit('closed')"
|
||||||
>
|
>
|
||||||
<el-container>
|
<el-container>
|
||||||
|
|
@ -24,8 +25,9 @@
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main id="mlogbwMain">
|
<el-main id="mlogbwMain">
|
||||||
<el-button type="primary" v-if="!isSubmit" @click="check_start" style="position: absolute;top: 20px;left: 150px;">检验</el-button>
|
<el-button type="primary" v-if="!isSubmit&&process_type=='20'" @click="check_start" style="position: absolute;top: 20px;left: 150px;">检验</el-button>
|
||||||
<el-button type="primary" v-if="multipleSet" @click="check_set" style="position: absolute;top: 20px;left: 210px;">批量操作</el-button>
|
<el-button type="primary" v-if="multipleSet" @click="check_set" style="position: absolute;top: 20px;left: 210px;">批量操作</el-button>
|
||||||
|
<el-input v-if="multipleSet" v-model="wprInputText" @change="wprinputChange" style="width:200px;position: absolute;top: 20px;right: 50px;">批量操作</el-input>
|
||||||
<sc-form-table
|
<sc-form-table
|
||||||
hideDelete
|
hideDelete
|
||||||
id="mlogbwlist"
|
id="mlogbwlist"
|
||||||
|
|
@ -37,8 +39,8 @@
|
||||||
>
|
>
|
||||||
<el-table-column prop="number" label="物料编号" fixed min-width="120px">
|
<el-table-column prop="number" label="物料编号" fixed min-width="120px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
|
<!-- <span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
|
||||||
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input>
|
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input> -->
|
||||||
<el-select
|
<el-select
|
||||||
v-if="scope.row.isEdit&&mode == 'ins'"
|
v-if="scope.row.isEdit&&mode == 'ins'"
|
||||||
v-model="scope.row.wpr"
|
v-model="scope.row.wpr"
|
||||||
|
|
@ -55,6 +57,7 @@
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<span v-else>{{ scope.row.number }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
|
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
|
||||||
|
|
@ -275,7 +278,7 @@
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="检验"
|
title="批量检验"
|
||||||
v-model="setVisible"
|
v-model="setVisible"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
>
|
>
|
||||||
|
|
@ -288,14 +291,15 @@
|
||||||
label-width="150px"
|
label-width="150px"
|
||||||
>
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col v-for="item in testitemlists" :key="item.id">
|
<!-- <el-col v-for="item in testitemlists" :key="item.id">
|
||||||
<el-form-item :label="item.testitem_name">
|
<el-form-item :label="item.testitem_name">
|
||||||
<el-input v-model="item.value"></el-input>
|
<el-input v-model="item.value"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col v-for="item2 in defectlists" :key="item2.id">
|
<el-col v-for="item2 in defectlists" :key="item2.id" :span="12">
|
||||||
<el-form-item :label="item2.defect_name">
|
<el-form-item :label="item2.defect_name">
|
||||||
<el-input v-model="item2.value"></el-input>
|
<el-switch v-model="item2.value"></el-switch>
|
||||||
|
<!-- <el-input v-model="item2.value"></el-input> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col>
|
<el-col>
|
||||||
|
|
@ -309,9 +313,9 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-table :data="selectWpr" border>
|
<el-table :data="selectWpr" border>
|
||||||
<el-table-column prop="number" label="物料编号"></el-table-column>
|
<el-table-column prop="number" label="物料编号"></el-table-column>
|
||||||
<el-table-column v-for="item in testitemlists" :key="item.id" :label="item.testitem_name">
|
<!-- <el-table-column v-for="item in testitemlists" :key="item.id" :label="item.testitem_name">
|
||||||
{{ item.value }}
|
{{ item.value }}
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column v-for="item2 in defectlists" :key="item2.id" :label="item2.defect_name">
|
<el-table-column v-for="item2 in defectlists" :key="item2.id" :label="item2.defect_name">
|
||||||
{{ item2.value }}
|
{{ item2.value }}
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -391,6 +395,7 @@ export default {
|
||||||
qct:"",
|
qct:"",
|
||||||
values:"",
|
values:"",
|
||||||
wprNumber:"",
|
wprNumber:"",
|
||||||
|
wprInputText:"",
|
||||||
params: {mlogb:'',page:0},
|
params: {mlogb:'',page:0},
|
||||||
hideAdd: true,
|
hideAdd: true,
|
||||||
visible: false,
|
visible: false,
|
||||||
|
|
@ -403,6 +408,7 @@ export default {
|
||||||
qct_testitems:[],
|
qct_testitems:[],
|
||||||
mlogbwlist:[],
|
mlogbwlist:[],
|
||||||
equipmentOptions:[],
|
equipmentOptions:[],
|
||||||
|
process_type:"",
|
||||||
addTemplate:{
|
addTemplate:{
|
||||||
mlogb: "",
|
mlogb: "",
|
||||||
number: "",
|
number: "",
|
||||||
|
|
@ -437,20 +443,25 @@ export default {
|
||||||
}
|
}
|
||||||
that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
|
that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
|
||||||
that.currentDate = this.$TOOL.dateFormat2(new Date());
|
that.currentDate = this.$TOOL.dateFormat2(new Date());
|
||||||
console.log(that.currentDate);
|
// console.log(that.currentDate);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open(mode = "ins",qct = '') {
|
open(mode = "ins",qct = '') {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.qct = qct;
|
this.qct = qct;
|
||||||
that.getOptions();
|
if(that.mode == 'ins'){//输入
|
||||||
that.getdefects();
|
that.getOptions();
|
||||||
|
}
|
||||||
|
that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => {
|
||||||
|
that.process_type=res.process_type;
|
||||||
|
// console.log('res',res);
|
||||||
|
that.getdefects();
|
||||||
|
})
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
// setTimeout(() => {
|
setTimeout(() => {
|
||||||
// this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
|
this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
|
||||||
// },500)
|
},500)
|
||||||
|
|
||||||
},
|
},
|
||||||
getEquipments(){
|
getEquipments(){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
@ -465,12 +476,16 @@ export default {
|
||||||
that.qct_defects = [];
|
that.qct_defects = [];
|
||||||
res.qct_defects.forEach((item) => {
|
res.qct_defects.forEach((item) => {
|
||||||
that.addTemplate[item.defect_name] = false;
|
that.addTemplate[item.defect_name] = false;
|
||||||
|
let obj = Object.assign({}, item);
|
||||||
|
obj.canEdit = that.process_type=='20'?false:true;
|
||||||
|
that.qct_defects.push(obj);
|
||||||
})
|
})
|
||||||
that.qct_defects = res.qct_defects;
|
|
||||||
that.qct_testitems = [];
|
that.qct_testitems = [];
|
||||||
res.qct_testitems.forEach((item2) => {
|
res.qct_testitems.forEach((item2) => {
|
||||||
let obj2 = Object.assign({}, item2);
|
let obj2 = Object.assign({}, item2);
|
||||||
obj2.value = '';
|
obj2.value = '';
|
||||||
|
obj2.canEdit = that.process_type=='20'?false:true;
|
||||||
|
|
||||||
obj2.addto_wpr = item2.addto_wpr;
|
obj2.addto_wpr = item2.addto_wpr;
|
||||||
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
|
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
|
||||||
obj2.value = 0;
|
obj2.value = 0;
|
||||||
|
|
@ -492,17 +507,15 @@ export default {
|
||||||
},
|
},
|
||||||
getOptions(){
|
getOptions(){
|
||||||
let that = this;
|
let that = this;
|
||||||
if(that.mode == 'ins'){//输入
|
that.$API.wpm.wpr.list.req({wm:that.wm,page:0}).then((res) => {
|
||||||
that.$API.wpm.wpr.list.req({wm:that.wm,page:0}).then((res) => {
|
that.options = res;
|
||||||
that.options = res;
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
optionChange(row){
|
optionChange(row){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.options.forEach((item) => {
|
that.options.forEach((item) => {
|
||||||
if(item.id == row.wpr){
|
if(item.id == row.wpr){
|
||||||
console.log('item',item);
|
// console.log('item',item);
|
||||||
let index = that.mlogbwlist.indexOf(row);
|
let index = that.mlogbwlist.indexOf(row);
|
||||||
that.mlogbwlist[index].number = item.number;
|
that.mlogbwlist[index].number = item.number;
|
||||||
}
|
}
|
||||||
|
|
@ -517,7 +530,6 @@ export default {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj = Object.assign({},item);
|
obj = Object.assign({},item);
|
||||||
obj.isEdit = false;
|
obj.isEdit = false;
|
||||||
obj.canEdit = false;
|
|
||||||
if(that.qct!=null&&that.qct!=''&&item.ftest!=null){
|
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){
|
if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
|
||||||
item.ftest.ftestdefects.forEach((item1) => {
|
item.ftest.ftestdefects.forEach((item1) => {
|
||||||
|
|
@ -566,7 +578,7 @@ export default {
|
||||||
row.ftest.ftestitems.forEach((item1) => {
|
row.ftest.ftestitems.forEach((item1) => {
|
||||||
item1.test_val_json = row[item1.testitem_name];
|
item1.test_val_json = row[item1.testitem_name];
|
||||||
})
|
})
|
||||||
console.log('obj',obj);
|
// console.log('obj',obj);
|
||||||
}else{//检验表未填过
|
}else{//检验表未填过
|
||||||
console.log('未填过');
|
console.log('未填过');
|
||||||
obj.ftest = {};
|
obj.ftest = {};
|
||||||
|
|
@ -621,7 +633,7 @@ export default {
|
||||||
formTableEdit(row) {
|
formTableEdit(row) {
|
||||||
this.mlogbwlist.forEach((item, index) => {
|
this.mlogbwlist.forEach((item, index) => {
|
||||||
if (item.id == row.id) {
|
if (item.id == row.id) {
|
||||||
console.log('row',row);
|
// console.log('row',row);
|
||||||
this.mlogbwlist[index].isEdit = true;
|
this.mlogbwlist[index].isEdit = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -666,7 +678,7 @@ export default {
|
||||||
let that = this;
|
let that = this;
|
||||||
let index = that.mlogbwlist.indexOf(row);
|
let index = that.mlogbwlist.indexOf(row);
|
||||||
that.qct_defects.forEach(item => {
|
that.qct_defects.forEach(item => {
|
||||||
console.log('item.rule_expression',item.rule_expression);
|
// console.log('item.rule_expression',item.rule_expression);
|
||||||
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
||||||
let str = item.rule_expression.replace(/`/g, '');
|
let str = item.rule_expression.replace(/`/g, '');
|
||||||
str = str.replace(/\${(.*?)}/g, 'row.\$1')
|
str = str.replace(/\${(.*?)}/g, 'row.\$1')
|
||||||
|
|
@ -806,6 +818,11 @@ export default {
|
||||||
that.checkVisible = false;
|
that.checkVisible = false;
|
||||||
this.multipleSet = true;
|
this.multipleSet = true;
|
||||||
that.descriptionVisible = true;
|
that.descriptionVisible = true;
|
||||||
|
that.qct_defects = [];
|
||||||
|
that.qct_defects = that.defectlists;
|
||||||
|
that.qct_testitems = [];
|
||||||
|
that.qct_testitems = that.testitemlists;
|
||||||
|
that.tableHeight = document.getElementById('mlogbwMain').clientHeight-80;
|
||||||
that.getList();
|
that.getList();
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
return err;
|
return err;
|
||||||
|
|
@ -824,11 +841,25 @@ export default {
|
||||||
check_set(){
|
check_set(){
|
||||||
this.setVisible=true;
|
this.setVisible=true;
|
||||||
},
|
},
|
||||||
|
//扫描物料将这一行放到第一行并编辑这一行
|
||||||
|
wprinputChange(){
|
||||||
|
let that = this;
|
||||||
|
that.mlogbwlist.forEach((item,index) => {
|
||||||
|
if(item.number == that.wprInputText){
|
||||||
|
let obj = Object.assign({},item);
|
||||||
|
obj.isEdit = true;
|
||||||
|
that.mlogbwlist.splice(index,1);
|
||||||
|
that.mlogbwlist.unshift(obj);
|
||||||
|
that.wprInputText = "";
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
wprChange(wprNumber){
|
wprChange(wprNumber){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.mlogbwlist.forEach(item => {
|
that.mlogbwlist.forEach(item => {
|
||||||
if(item.number == wprNumber){
|
if(item.number == wprNumber){
|
||||||
that.selectWpr.push(item);
|
that.selectWpr.push(item);
|
||||||
|
that.wprNumber = "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -854,17 +885,14 @@ export default {
|
||||||
item.ftest.ftestitems.forEach(testitem => {
|
item.ftest.ftestitems.forEach(testitem => {
|
||||||
let testitemindex = that.setForm.testitemids.indexOf(testitem.testitem);
|
let testitemindex = that.setForm.testitemids.indexOf(testitem.testitem);
|
||||||
if( testitemindex > -1){
|
if( testitemindex > -1){
|
||||||
console.log('that.testitemlists[testitemindex].value',that.testitemlists[testitemindex].value)
|
|
||||||
testitem.test_val_json = that.testitemlists[testitemindex].value;
|
testitem.test_val_json = that.testitemlists[testitemindex].value;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
console.log('that.selectWpr',that.selectWpr);
|
|
||||||
that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => {
|
that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => {
|
||||||
console.log('blukres',res);
|
|
||||||
that.setVisible = false;
|
that.setVisible = false;
|
||||||
that.descriptionVisible = false;
|
// that.descriptionVisible = false;
|
||||||
that.setForm = {};
|
// that.setForm = {};
|
||||||
that.getList();
|
that.getList();
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue