feat: 合批弹框联动显示"清除缺陷"勾选
源批次 state 均为合格(10)、defect 不一致时,合批弹框显示"清除缺陷" 勾选框,提交带 clear_defect=true;条件失效或重新打开时自动复位。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2b6729fa4f
commit
23dc249d1d
|
|
@ -224,11 +224,18 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24" v-if="change_batch&&new_wm==''">
|
<el-col :md="12" :sm="24" v-if="change_batch&&new_wm==''">
|
||||||
<el-form-item label="新批次号" prop="new_batch">
|
<el-form-item label="新批次号" prop="new_batch">
|
||||||
<el-input v-model="form.new_batch" placeholder="新批次号" @change="new_batch(form.new_batch)" :disabled="type==50&&isFeiPinku"></el-input>
|
<el-input v-model="form.new_batch" placeholder="新批次号" @change="new_batch(form.new_batch)" :disabled="type==50&&isFeiPinku"></el-input>
|
||||||
<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-form-item label="清除缺陷">
|
||||||
|
<el-checkbox v-model="form.clear_defect">
|
||||||
|
源批次缺陷不一致,勾选后合并批次将清除缺陷标记
|
||||||
|
</el-checkbox>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-footer v-if="mode!=='show'">
|
<el-footer v-if="mode!=='show'">
|
||||||
|
|
@ -308,7 +315,8 @@ export default {
|
||||||
recive_user: null,
|
recive_user: null,
|
||||||
recive_mgroup: null,
|
recive_mgroup: null,
|
||||||
handoverb:[],
|
handoverb:[],
|
||||||
new_batch:''
|
new_batch:'',
|
||||||
|
clear_defect: false
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
new_batch:[
|
new_batch:[
|
||||||
|
|
@ -457,6 +465,25 @@ export default {
|
||||||
}
|
}
|
||||||
that.getMgroupOptions();
|
that.getMgroupOptions();
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 合批时源批次 state 均为 OK(10) 且 defect 不一致,才显示"清除缺陷"勾选
|
||||||
|
defectMismatch() {
|
||||||
|
if (this.mtype !== 30) return false;
|
||||||
|
if (this.new_wm) return false;
|
||||||
|
const items = this.form.handoverb || [];
|
||||||
|
if (items.length < 2) return false;
|
||||||
|
if (!items.every(i => Number(i.state) === 10)) return false;
|
||||||
|
const defectIds = new Set(items.map(i => i.defect == null ? null : i.defect));
|
||||||
|
return defectIds.size > 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
defectMismatch(val) {
|
||||||
|
if (!val) {
|
||||||
|
this.form.clear_defect = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
deletebw(index){
|
deletebw(index){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
@ -656,6 +683,7 @@ export default {
|
||||||
if(mtype!==undefined&&mtype!==null){
|
if(mtype!==undefined&&mtype!==null){
|
||||||
that.mtype = mtype;
|
that.mtype = mtype;
|
||||||
}
|
}
|
||||||
|
that.form.clear_defect = false;
|
||||||
that.checkedStatus=[];
|
that.checkedStatus=[];
|
||||||
that.selectItems=[];
|
that.selectItems=[];
|
||||||
if(mtype==30){
|
if(mtype==30){
|
||||||
|
|
|
||||||
|
|
@ -189,10 +189,17 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24" v-if="change_batch">
|
<el-col :md="12" :sm="24" v-if="change_batch">
|
||||||
<el-form-item label="新批次号" required>
|
<el-form-item label="新批次号" required>
|
||||||
<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-form-item label="清除缺陷">
|
||||||
|
<el-checkbox v-model="form.clear_defect">
|
||||||
|
源批次缺陷不一致,勾选后合并批次将清除缺陷标记
|
||||||
|
</el-checkbox>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row v-if="addShow&&route_code=='tuihuo'">
|
<el-row v-if="addShow&&route_code=='tuihuo'">
|
||||||
<el-col>
|
<el-col>
|
||||||
|
|
@ -342,6 +349,7 @@ export default {
|
||||||
ticket:null,
|
ticket:null,
|
||||||
ticket_:null,
|
ticket_:null,
|
||||||
oinfo_json:{},
|
oinfo_json:{},
|
||||||
|
clear_defect: false,
|
||||||
},
|
},
|
||||||
initForm:{},
|
initForm:{},
|
||||||
selectObjIds:[],
|
selectObjIds:[],
|
||||||
|
|
@ -470,12 +478,28 @@ export default {
|
||||||
}
|
}
|
||||||
that.getTid();
|
that.getTid();
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 合批时源批次 state 均为 OK(10) 且 defect 不一致,才显示"清除缺陷"勾选
|
||||||
|
defectMismatch() {
|
||||||
|
if (this.mtype !== 30) return false;
|
||||||
|
const items = this.form.handoverb || [];
|
||||||
|
if (items.length < 2) return false;
|
||||||
|
if (!items.every(i => Number(i.state) === 10)) return false;
|
||||||
|
const defectIds = new Set(items.map(i => i.defect == null ? null : i.defect));
|
||||||
|
return defectIds.size > 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
batchList:{
|
batchList:{
|
||||||
deep:true,
|
deep:true,
|
||||||
handler (v) {
|
handler (v) {
|
||||||
console.log('batchList',v)
|
console.log('batchList',v)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
defectMismatch(val) {
|
||||||
|
if (!val) {
|
||||||
|
this.form.clear_defect = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -636,6 +660,7 @@ export default {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.mtype = mtype;
|
this.mtype = mtype;
|
||||||
|
this.form.clear_defect = false;
|
||||||
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'){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue