fix:检验时设备改成非必填;搜索框左移;只有检测项时关联缺陷项不判断

This commit is contained in:
shijing 2025-02-26 10:29:32 +08:00
parent 2f645882d5
commit a3f2e2c0b7
1 changed files with 24 additions and 10 deletions

View File

@ -25,9 +25,9 @@
</div>
</el-header>
<el-main id="mlogbwMain">
<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="!isSubmit&&process_type=='20'&&mode=='outs'" @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>
<el-input v-if="multipleSet" v-model="wprInputText" @change="wprinputChange" style="width:200px;position: absolute;top: 20px;left: 308px;">批量操作</el-input>
<sc-form-table
hideDelete
id="mlogbwlist"
@ -205,7 +205,7 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="设备" prop="equipment">
<el-form-item label="设备">
<el-select
v-model="form.equipment"
placeholder="设备"
@ -429,6 +429,7 @@ export default {
},
defectlists:[],
testitemlists:[],
qct_defects_origin:[],
selectWpr:[],
tableHeight:500,
apiObjPrint:this.$API.cm.labelmat.fromWm,
@ -455,8 +456,9 @@ export default {
}
that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => {
that.process_type=res.process_type;
// console.log('res',res);
if(that.mode == 'outs'){//
that.getdefects();
}
})
this.visible = true;
setTimeout(() => {
@ -480,6 +482,7 @@ export default {
obj.canEdit = that.process_type=='20'?false:true;
that.qct_defects.push(obj);
})
that.qct_defects_origin = that.qct_defects;
that.qct_testitems = [];
res.qct_testitems.forEach((item2) => {
let obj2 = Object.assign({}, item2);
@ -499,6 +502,7 @@ export default {
}
that.qct_testitems.push(obj2);
})
that.qct_testitems_origin = that.qct_testitems;
that.getList();
})
}else{
@ -515,7 +519,6 @@ export default {
let that = this;
that.options.forEach((item) => {
if(item.id == row.wpr){
// console.log('item',item);
let index = that.mlogbwlist.indexOf(row);
that.mlogbwlist[index].number = item.number;
}
@ -566,9 +569,20 @@ export default {
obj.mlogb = row.mlogb;
obj.wpr = row.wpr;
obj.note = row.note;
that.qct_defects_origin.forEach(item => {
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')
let judge = eval(str);
row[item.defect_name] = judge;
}else{
row[item.defect_name] = false;
}
});
//qct
if(that.qct!==null&&that.qct!==''){
//
console.log('row',row);
if(row.ftest!==null&&row.ftest!==undefined&&row.ftest!==''){
console.log('已填过');
obj.ftest =row.ftest;
@ -578,7 +592,6 @@ export default {
row.ftest.ftestitems.forEach((item1) => {
item1.test_val_json = row[item1.testitem_name];
})
// console.log('obj',obj);
}else{//
console.log('未填过');
obj.ftest = {};
@ -587,7 +600,7 @@ export default {
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.forEach((item) => {
that.qct_defects_origin.forEach((item) => {
let itemObj = {};
itemObj.defect = item.defect;
itemObj.test_user = that.handle_user;
@ -604,6 +617,7 @@ export default {
})
}
}
console.log('obj',obj);
if(row.id!==''&&row.id!==undefined&&row.id!==null){
obj.id = row.id;
that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => {
@ -677,7 +691,7 @@ export default {
defectCountSun(row){
let that = this;
let index = that.mlogbwlist.indexOf(row);
that.qct_defects.forEach(item => {
that.qct_defects_origin.forEach(item => {
// 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, '');