Fix production material batch lookup
This commit is contained in:
parent
7f814e1a4f
commit
2912518b67
|
|
@ -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(){
|
||||
|
|
|
|||
Loading…
Reference in New Issue