Fix production material batch lookup

This commit is contained in:
caoqianming 2026-07-28 17:19:23 +08:00
parent 7f814e1a4f
commit 2912518b67
1 changed files with 34 additions and 9 deletions

View File

@ -571,8 +571,10 @@ export default {
} }
}, },
getBatchOptions() { getBatchOptions() {
// // 使 wmaterial
this.getWBatchs(); if (!this.isBatchPick) {
this.getWBatchs();
}
this.$API.inm.warehouse.batch this.$API.inm.warehouse.batch
.req({ page: 0, material: this.form.material }) .req({ page: 0, material: this.form.material })
.then((res) => { .then((res) => {
@ -775,13 +777,36 @@ export default {
if(that.type=='other_in'||that.type=='do_out'){ if(that.type=='other_in'||that.type=='do_out'){
let mioitemSelecObj =JSON.parse(sessionStorage.getItem("mioitemSelecObj")); let mioitemSelecObj =JSON.parse(sessionStorage.getItem("mioitemSelecObj"));
if(mioitemSelecObj!==null){ if(mioitemSelecObj!==null){
that.selectObj = mioitemSelecObj; if (that.isBatchPick) {
that.form.material = that.selectObj.id; // MaterialBatch Material
that.form.unit = that.selectObj.unit; if (
that.form.unit_price = that.selectObj.unit_price; mioitemSelecObj.material &&
that.form.batch = that.cate=='helpso'?that.selectObj.bin_number_main:''; mioitemSelecObj.warehouse &&
that.mTracking = that.selectObj.tracking; mioitemSelecObj.batch
that.getBatchOptions(); ) {
that.selectObj = mioitemSelecObj;
that.form.material = mioitemSelecObj.material;
that.form.unit = mioitemSelecObj.material_ ? mioitemSelecObj.material_.unit : undefined;
that.form.unit_price = mioitemSelecObj.material_ ? mioitemSelecObj.material_.unit_price : 0;
that.form.batch = mioitemSelecObj.batch;
that.form.mb = mioitemSelecObj.id;
that.form.warehouse = mioitemSelecObj.warehouse;
that.batchcount = Number(mioitemSelecObj.count_canmio);
that.form.count = Number(mioitemSelecObj.count_canmio);
that.mTracking = mioitemSelecObj.material_ ? mioitemSelecObj.material_.tracking : 10;
that.inputBatchDisable = true;
} else {
sessionStorage.removeItem("mioitemSelecObj");
}
} else {
that.selectObj = mioitemSelecObj;
that.form.material = that.selectObj.id;
that.form.unit = that.selectObj.unit;
that.form.unit_price = that.selectObj.unit_price;
that.form.batch = that.cate=='helpso'?that.selectObj.bin_number_main:'';
that.mTracking = that.selectObj.tracking;
that.getBatchOptions();
}
} }
} }
return this; return this;