import BaseService from "../baseService";
|
import { BasePosition } from "../../entity/basicInfo/base/basePosition";
|
import { StorageAllocateEnter } from "../../entity/storage/allocate/storageAllocateEnter";
|
|
/**
|
* 调拨入库
|
*/
|
export default class AllocateEnterService extends BaseService {
|
/**
|
* 添加保存前事件
|
*/
|
public async onAddSaveBefore(t: StorageAllocateEnter) {
|
let userInfo = await this.userInfo;
|
this.info.result = true;
|
|
let dataInfo: any = t;
|
let detailList = dataInfo.Storage_AllocateEnterList;
|
if (!detailList || !detailList.length) {
|
return this.info;
|
}
|
|
for (let slist of detailList) {
|
let contractInfo = await this.dbRead.findOne(BasePosition, {
|
userProduct_Id: userInfo.userProduct_Id,
|
positionName: slist.positionName,
|
storage_Id: t.storage_Id_In
|
});
|
if (!contractInfo) {
|
this.info.result = false;
|
this.info.msg = `明细物料${slist.productModel}货位1不正确,无法修改!`;
|
}
|
}
|
|
return this.info;
|
}
|
}
|