fix:分批时不是本批次的板段标记出来
This commit is contained in:
parent
4b9da28d5d
commit
a2e849640f
|
|
@ -57,13 +57,18 @@
|
||||||
<el-button v-if="mode!=='show'" type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
<el-button v-if="mode!=='show'" type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-if="route_code=='pengma'" style="padding-left: 80px;margin-bottom: 20px;margin-top: -5px;">
|
<el-col v-if="route_code=='pengma'" style="padding-left: 80px;margin-bottom: 20px;margin-top: -5px;">
|
||||||
<div v-for="(item2,index2) in form.handoverb[$index].handoverbw" :key="item2.wpr" class="wprItem">
|
<div v-for="(item2,index2) in form.handoverb[$index].handoverbw" :key="item2.wpr" style="display: inline-block;">
|
||||||
<span>{{ item2.number }}</span>
|
<div v-if="item2.wpr!==undefined&&item2.wpr!==null&&item2.wpr!==''" class="wprItem">
|
||||||
<el-icon class="circleCloseFilled" @click="deleteWpr($index,index2,item2.wpr)"><el-icon-circleClose-filled /></el-icon>
|
<span>{{ item2.number }}</span>
|
||||||
|
<el-icon class="circleCloseFilled" @click="deleteWpr($index,index2,item2.wpr)"><el-icon-circleClose-filled /></el-icon>
|
||||||
|
</div>
|
||||||
|
<div v-else class="wprItem disabledItem">
|
||||||
|
<span>{{ item2.number }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="item3 in diff" :key="item3" class="wprItem disabledItem">
|
<!-- <div v-for="item3 in diff" :key="item3" class="wprItem disabledItem">
|
||||||
<span>{{ item3 }}</span>
|
<span>{{ item3 }}</span>
|
||||||
</div>
|
</div> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-else-if="route_code=='kaiaomian'" :span="24" style="padding-left: 80px;margin-bottom: 20px;margin-top: -5px;">
|
<el-col v-else-if="route_code=='kaiaomian'" :span="24" style="padding-left: 80px;margin-bottom: 20px;margin-top: -5px;">
|
||||||
<span v-for="(item2) in wprOptions" :key="item2.wpr" style="margin-right: 10px;">
|
<span v-for="(item2) in wprOptions" :key="item2.wpr" style="margin-right: 10px;">
|
||||||
|
|
@ -232,25 +237,27 @@ export default {
|
||||||
if(arrs.length>1){
|
if(arrs.length>1){
|
||||||
that.form.handoverb[index].wpr = '';
|
that.form.handoverb[index].wpr = '';
|
||||||
arrs.forEach(arr=>{
|
arrs.forEach(arr=>{
|
||||||
that.wprOptions.forEach(item=>{
|
let obj = {};
|
||||||
|
obj.number = arr;
|
||||||
|
let options = that.wprOptions.filter(item=>{return item.number.indexOf(arr) > -1&&!item.disabled});
|
||||||
|
if(options.length>0){
|
||||||
|
obj.wpr = options[0].id;
|
||||||
|
barchArrs.push(arr);
|
||||||
|
}
|
||||||
|
that.form.handoverb[index].handoverbw.push(obj);
|
||||||
|
that.wprOptions.forEach(item=>{
|
||||||
if(item.number.indexOf(arr) > -1&&!item.disabled){
|
if(item.number.indexOf(arr) > -1&&!item.disabled){
|
||||||
item.disabled = true;
|
item.disabled = true;
|
||||||
let obj = {};
|
|
||||||
obj.number = item.number;
|
|
||||||
obj.wpr = item.id;
|
|
||||||
barchArrs.push(arr);
|
|
||||||
that.form.handoverb[index].handoverbw.push(obj);
|
|
||||||
that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
that.form.handoverb[index].count = barchArrs.length;
|
||||||
//如果arrs里有不是这个批次的wpr,提示错误
|
//如果arrs里有不是这个批次的wpr,提示错误
|
||||||
let diff = arrs.filter(item => !barchArrs.includes(item));
|
let diff = arrs.filter(item => !barchArrs.includes(item));
|
||||||
that.diff = diff;
|
that.diff = diff;
|
||||||
console.log('diff',diff)
|
|
||||||
if(diff.length>0){
|
if(diff.length>0){
|
||||||
that.$message.warning("物料"+diff.join(",")+"不在该批次中");
|
that.$message.warning("物料"+diff.join(",")+"不在该批次中");
|
||||||
// that.$confirm("物料"+diff.join(",")+"不在该批次中", "提示", {type: "warning",}).then(() => {});
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
//放入对应的行中的handoverb中,并且在列表中disabled
|
//放入对应的行中的handoverb中,并且在列表中disabled
|
||||||
|
|
@ -332,6 +339,7 @@ export default {
|
||||||
let total = 0;
|
let total = 0;
|
||||||
if(this.form.handoverb.length>0){
|
if(this.form.handoverb.length>0){
|
||||||
this.form.handoverb.forEach(item=>{
|
this.form.handoverb.forEach(item=>{
|
||||||
|
item.handoverbw = item.handoverbw.filter(item=>{ return item.wpr&&item.wpr!==''&&item.wpr!==null&&item.wpr!==undefined})
|
||||||
total += item.count;
|
total += item.count;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue