Clarify batch defect merge options
This commit is contained in:
parent
f8d3524c67
commit
eef6594f3c
|
|
@ -103,7 +103,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="合格B类默认记合格">
|
<el-form-item label="生产日志默认将合格B类计入合格品">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="form.clear_defect"
|
v-model="form.clear_defect"
|
||||||
></el-switch>
|
></el-switch>
|
||||||
|
|
|
||||||
|
|
@ -228,10 +228,10 @@
|
||||||
<span style="color: red;">请手动录入新批次号,不要用已有批次!</span>
|
<span style="color: red;">请手动录入新批次号,不要用已有批次!</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="24" :sm="24" v-if="defectMismatch">
|
<el-col :md="24" :sm="24" v-if="canClearBatchDefect">
|
||||||
<el-form-item label="清除缺陷">
|
<el-form-item label="清除批次缺陷">
|
||||||
<el-checkbox v-model="form.clear_defect">
|
<el-checkbox v-model="form.clear_defect">
|
||||||
源批次缺陷不一致,勾选后合并批次将清除缺陷标记
|
{{ clearBatchDefectHint }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -469,19 +469,30 @@ export default {
|
||||||
if (!this.form.handoverb || this.form.handoverb.length === 0) return 0;
|
if (!this.form.handoverb || this.form.handoverb.length === 0) return 0;
|
||||||
return this.form.handoverb.reduce((sum, item) => sum + Number(item.count || 0), 0);
|
return this.form.handoverb.reduce((sum, item) => sum + Number(item.count || 0), 0);
|
||||||
},
|
},
|
||||||
// 合批时源批次 state 均为 OK(10) 且 defect 不一致,才显示"清除缺陷"勾选
|
canClearBatchDefect() {
|
||||||
defectMismatch() {
|
|
||||||
if (this.mtype !== 30) return false;
|
if (this.mtype !== 30) return false;
|
||||||
if (this.new_wm) return false;
|
if (this.new_wm) return false;
|
||||||
const items = this.form.handoverb || [];
|
const items = this.form.handoverb || [];
|
||||||
if (items.length < 2) return false;
|
if (items.length < 2) return false;
|
||||||
if (!items.every(i => Number(i.state) === 10)) return false;
|
const states = new Set(items.map(i => Number(i.state)));
|
||||||
const defectIds = new Set(items.map(i => i.defect == null ? null : i.defect));
|
if (states.size !== 1) return false;
|
||||||
return defectIds.size > 1;
|
const tracking = Number(items[0].tracking);
|
||||||
|
if (tracking === 20) return true;
|
||||||
|
return items.every(i =>
|
||||||
|
Number(i.state) === 10 &&
|
||||||
|
i.defect != null &&
|
||||||
|
Number(i.defect_okcate) === 20
|
||||||
|
);
|
||||||
|
},
|
||||||
|
clearBatchDefectHint() {
|
||||||
|
const items = this.form.handoverb || [];
|
||||||
|
return Number(items[0] && items[0].tracking) === 20
|
||||||
|
? "仅清除合批后批次的缺陷归类,单件缺陷记录保持不变"
|
||||||
|
: "将合格B类合并为无缺陷批次";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
defectMismatch(val) {
|
canClearBatchDefect(val) {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
this.form.clear_defect = false;
|
this.form.clear_defect = false;
|
||||||
}
|
}
|
||||||
|
|
@ -538,7 +549,7 @@ export default {
|
||||||
let that = this;
|
let that = this;
|
||||||
var req = {
|
var req = {
|
||||||
page: 0,
|
page: 0,
|
||||||
state__in:'10,34',
|
state__in: this.mtype === 30 ? '10,20,34' : '10,34',
|
||||||
tag:that.tag,
|
tag:that.tag,
|
||||||
mgroupx:that.mgroupId
|
mgroupx:that.mgroupId
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;">
|
<div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;">
|
||||||
<div v-if="mlogItem.submit_time == null && hasOkBDefect" style="margin-right: 16px;display:flex;align-items:center;">
|
<div v-if="mlogItem.submit_time == null && hasOkBDefect" style="margin-right: 16px;display:flex;align-items:center;">
|
||||||
<span style="margin-right: 6px;">合格B类记为合格</span>
|
<span style="margin-right: 6px;">将合格B类计入合格品</span>
|
||||||
<el-switch v-model="mlogItem.clear_defect"></el-switch>
|
<el-switch v-model="mlogItem.clear_defect"></el-switch>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
<el-button
|
||||||
|
|
|
||||||
|
|
@ -193,10 +193,10 @@
|
||||||
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input>
|
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="24" :sm="24" v-if="defectMismatch">
|
<el-col :md="24" :sm="24" v-if="canClearBatchDefect">
|
||||||
<el-form-item label="清除缺陷">
|
<el-form-item label="清除批次缺陷">
|
||||||
<el-checkbox v-model="form.clear_defect">
|
<el-checkbox v-model="form.clear_defect">
|
||||||
源批次缺陷不一致,勾选后合并批次将清除缺陷标记
|
{{ clearBatchDefectHint }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -479,14 +479,25 @@ export default {
|
||||||
that.getTid();
|
that.getTid();
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 合批时源批次 state 均为 OK(10) 且 defect 不一致,才显示"清除缺陷"勾选
|
canClearBatchDefect() {
|
||||||
defectMismatch() {
|
|
||||||
if (this.mtype !== 30) return false;
|
if (this.mtype !== 30) return false;
|
||||||
const items = this.form.handoverb || [];
|
const items = this.form.handoverb || [];
|
||||||
if (items.length < 2) return false;
|
if (items.length < 2) return false;
|
||||||
if (!items.every(i => Number(i.state) === 10)) return false;
|
const states = new Set(items.map(i => Number(i.state)));
|
||||||
const defectIds = new Set(items.map(i => i.defect == null ? null : i.defect));
|
if (states.size !== 1) return false;
|
||||||
return defectIds.size > 1;
|
const tracking = Number(items[0].tracking);
|
||||||
|
if (tracking === 20) return true;
|
||||||
|
return items.every(i =>
|
||||||
|
Number(i.state) === 10 &&
|
||||||
|
i.defect != null &&
|
||||||
|
Number(i.defect_okcate) === 20
|
||||||
|
);
|
||||||
|
},
|
||||||
|
clearBatchDefectHint() {
|
||||||
|
const items = this.form.handoverb || [];
|
||||||
|
return Number(items[0] && items[0].tracking) === 20
|
||||||
|
? "仅清除合批后批次的缺陷归类,单件缺陷记录保持不变"
|
||||||
|
: "将合格B类合并为无缺陷批次";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -496,7 +507,7 @@ export default {
|
||||||
console.log('batchList',v)
|
console.log('batchList',v)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
defectMismatch(val) {
|
canClearBatchDefect(val) {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
this.form.clear_defect = false;
|
this.form.clear_defect = false;
|
||||||
}
|
}
|
||||||
|
|
@ -661,6 +672,13 @@ export default {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.mtype = mtype;
|
this.mtype = mtype;
|
||||||
this.form.clear_defect = false;
|
this.form.clear_defect = false;
|
||||||
|
if (mtype === 30) {
|
||||||
|
this.paramsM = {
|
||||||
|
...this.paramsM,
|
||||||
|
state__in: '10,20,34'
|
||||||
|
};
|
||||||
|
delete this.paramsM.state;
|
||||||
|
}
|
||||||
if(data!==''&&data!==null&&data!==undefined){
|
if(data!==''&&data!==null&&data!==undefined){
|
||||||
console.log(typeof(data)=='string')
|
console.log(typeof(data)=='string')
|
||||||
if(typeof(data)=='string'){
|
if(typeof(data)=='string'){
|
||||||
|
|
@ -675,6 +693,8 @@ export default {
|
||||||
obj.label = item.label;
|
obj.label = item.label;
|
||||||
obj.batch = item.batch;
|
obj.batch = item.batch;
|
||||||
obj.defect = item.defect;
|
obj.defect = item.defect;
|
||||||
|
obj.defect_okcate = item.defect_okcate;
|
||||||
|
obj.tracking = item.tracking || (item.material_ && item.material_.tracking);
|
||||||
obj.material = item.material;
|
obj.material = item.material;
|
||||||
obj.count_cando = item.count_canhandover;
|
obj.count_cando = item.count_canhandover;
|
||||||
obj.count = item.count_canhandover;
|
obj.count = item.count_canhandover;
|
||||||
|
|
@ -704,6 +724,8 @@ export default {
|
||||||
obj.count = item.count_canhandover;
|
obj.count = item.count_canhandover;
|
||||||
obj.defect = item.defect;
|
obj.defect = item.defect;
|
||||||
obj.defect_name = item.defect_name;
|
obj.defect_name = item.defect_name;
|
||||||
|
obj.defect_okcate = item.defect_okcate;
|
||||||
|
obj.tracking = item.material_ && item.material_.tracking;
|
||||||
obj.count_cando = item.count_canhandover;
|
obj.count_cando = item.count_canhandover;
|
||||||
obj.material = item.material;
|
obj.material = item.material;
|
||||||
if(that.type==50){
|
if(that.type==50){
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
<div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;">
|
<div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;">
|
||||||
<!-- hasOkBDefect -->
|
<!-- hasOkBDefect -->
|
||||||
<div v-if="mlogItem.submit_time == null" style="margin-right: 16px;display:flex;align-items:center;">
|
<div v-if="mlogItem.submit_time == null" style="margin-right: 16px;display:flex;align-items:center;">
|
||||||
<span style="margin-right: 6px;">合格B类记为合格</span>
|
<span style="margin-right: 6px;">将合格B类计入合格品</span>
|
||||||
<el-switch v-model="mlogItem.clear_defect"></el-switch>
|
<el-switch v-model="mlogItem.clear_defect"></el-switch>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
<el-button
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue