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