fix:发货选择物料批次时默认最多显示50个

This commit is contained in:
shijing 2025-08-07 16:37:00 +08:00
parent f55e2d6a80
commit be1448c25d
1 changed files with 30 additions and 22 deletions

View File

@ -96,7 +96,7 @@
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }} -- {{ item.warehouse_name }}</span
>{{ item.count_canmio }} -- {{ item.warehouse_name }}</span
>
</el-option>
</el-select>
@ -520,38 +520,46 @@ export default {
}
}
},
selectBatchChange(item) {
selectBatchChange(items) {
let that = this;
that.wprList = [];
that.mioitems = [];
if(item){
if(items){
let count = 0;
if(that.tableDatas.length>0){
that.tableDatas.forEach((item) => {
if(item.batch == that.selectBatch.batch){
count += item.count;
that.tableDatas.forEach((item0) => {
if(item0.batch == that.selectBatch.batch){
count += item0.count;
}
})
}
that.$API.wpm.wpr.list.req({ page: 0, mb: item.id }).then((res) => {
res.forEach((item,index) => {
if(index>=count){
that.wprList.push(item);
}
})
console.log('that.wprList',that.wprList)
if(that.wprList.length>0){
that.wprList.forEach((item,index) => {
if(item.number_out!==null){
that.mioitems[index] = item.number_out;
let canDo = Number(items.count_canmio);
that.$API.wpm.wpr.list.req({ page: 0, mb: items.id,querys:"{id,number,number_out}" }).then((res) => {
if (canDo>50) {
res.forEach((item,index) => {
if(index>=count&&index<50+count){
that.wprList.push(item);
}
})
}else{
res.forEach((item,index) => {
if(index>=count){
that.wprList.push(item);
}
})
}
that.form.batch = item.batch;
that.form.mb = item.id;
that.batchcount = that.wprList.length;
that.form.count = that.wprList.length;
that.form.warehouse = item.warehouse;
if(that.wprList.length>0){
that.wprList.forEach((item1,index) => {
if(item1.number_out!==null){
that.mioitems[index] = item1.number_out;
}
})
}
that.form.batch = items.batch;
that.form.mb = items.id;
that.batchcount = canDo;
that.form.count =canDo>50?50: that.wprList.length;
that.form.warehouse = items.warehouse;
that.inputBatchDisable = true;
})
}