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() {
//
// 使 wmaterial
if (!this.isBatchPick) {
this.getWBatchs();
}
this.$API.inm.warehouse.batch
.req({ page: 0, material: this.form.material })
.then((res) => {
@ -775,6 +777,28 @@ export default {
if(that.type=='other_in'||that.type=='do_out'){
let mioitemSelecObj =JSON.parse(sessionStorage.getItem("mioitemSelecObj"));
if(mioitemSelecObj!==null){
if (that.isBatchPick) {
// MaterialBatch Material
if (
mioitemSelecObj.material &&
mioitemSelecObj.warehouse &&
mioitemSelecObj.batch
) {
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;
@ -784,6 +808,7 @@ export default {
that.getBatchOptions();
}
}
}
return this;
},
countChange(){