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