fix:光芯交接改动

This commit is contained in:
shijing 2025-06-23 11:24:49 +08:00
parent f749fc14f0
commit 5a3ffca288
1 changed files with 36 additions and 37 deletions

View File

@ -37,11 +37,12 @@
<el-form-item label="交接物料">
<xtSelect
:apiObj="apiObjM"
v-model="form.wm_in"
v-model:obj="selectObj"
v-model="selectObjIds"
v-model:obj="selectObjs"
:labelField="'batch'"
style="width: 100%;"
:params = "paramsM"
:multiple="true"
@change="materialChange0"
>
<el-table-column label="物料" prop="full_name">
@ -52,7 +53,7 @@
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
</template>
</el-table-column>
<el-table-column label="数量" prop="count_canhandover" width="110px"></el-table-column>
<el-table-column label="可交接数量" prop="count_canhandover" width="110px"></el-table-column>
</xtSelect>
</el-form-item>
</el-col>
@ -233,9 +234,11 @@ export default {
recive_mgroup: null,
handoverb:[],
},
selectObjIds:[],
apiObjM:null,
paramsM:{},
selectObj:{},
selectObjs:[],
rules: {
batch: [
{
@ -441,9 +444,11 @@ export default {
},
//
open(mode = "add",data,mtype) {
console.log(data)
this.mode = mode;
this.mtype = mtype;
if(data!==''&&data!==null&&data!==undefined){
console.log(typeof(data)=='string')
if(typeof(data)=='string'){
this.codeText = data.replace(" ","");
this.codeTextChange(this.codeText)
@ -462,35 +467,23 @@ export default {
},
materialChange0(){
let that = this;
if(that.selectObj.count_canhandover>0){
let obj = {};
obj.wm = that.selectObj.id;
obj.state = that.selectObj.state;
obj.batch = that.selectObj.batch;
obj.label = that.selectObj.defect !== null?that.selectObj.batch+'('+that.selectObj.material_name+')'+that.selectObj.defect_name:that.selectObj.batch+'('+that.selectObj.material_name+')';
obj.count = that.selectObj.count_canhandover;
obj.defect = that.selectObj.defect;
obj.defect_name = that.selectObj.defect_name;
obj.count_cando = that.selectObj.count_canhandover;
obj.material = that.selectObj.material;
if(that.form.handoverb.length>0){
let datas = that.form.handoverb.filter((item) => {
return item.wm==that.selectObj.id;
});
if(datas.length>0){
that.$message.warning('该物料已存在');
}else{
that.totalCount += Number(obj.count_canhandover);
that.form.handoverb.push(obj);
}
}else{
that.totalCount += Number(obj.count_canhandover);
that.form.handoverb.push(obj);
}
that.form.handoverb = [];
that.totalCount = 0;
that.selectObjs.forEach(item=>{
let obj = {};
obj.wm = item.id;
obj.state = item.state;
obj.batch = item.batch;
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';
obj.count = item.count_canhandover;
obj.defect = item.defect;
obj.defect_name = item.defect_name;
obj.count_cando = item.count_canhandover;
obj.material = item.material;
that.totalCount += Number(obj.count);
that.form.handoverb.push(obj);
that.getResaveMgroups(obj.material);
}else{
that.$message.warning('该物料暂无可交接数量');
}
})
},
countChange(){
let that = this;
@ -553,11 +546,19 @@ export default {
},
//
setData(data) {
console.log(data)
let that = this;
Object.assign(this.form, data);
that.totalCount = 0;
that.form.handoverb = data.handoverb;
data.handoverb.forEach(item=>{
item.label = item.batch;
that.totalCount += Number(item.count);
})
if(data.type==30){
this.getUserList3();
that.getUserList3();
}else{
this.getUserList2();
that.getUserList2();
}
},
//
@ -594,7 +595,7 @@ export default {
if(res1.length>0){
res1.forEach(item=>{
let cando = Number(item.count_canhandover);
if(cando>0&&item.defect_name==res.defect_name){
if(cando>0&&(item.defect==null||item.defect_name==res.defect_name)){
let obj = {};
obj.wm = item.id;
obj.batch = item.batch;
@ -606,11 +607,9 @@ export default {
obj.count_cando = cando;
obj.material = item.material;
that.form.handoverb.push(obj)
that.totalCount += Number(obj.count);
that.getResaveMgroups(obj.material);
}
// else{
// that.$message.error("")
// }
})
}
that.codeText = '';