schangxiang@126.com
2025-09-09 3d8966ba2c81e7e0365c8b123e861d18ee4f94f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import BaseService from "../baseService";
import { BasePosition } from "../../entity/basicInfo/base/basePosition";
import { StorageEnter } from "../../entity/storage/operation/storageEnter";
 
/**
 * 其他入库单
 */
export default class EnterService extends BaseService {
  /**
   * 添加保存前事件
   */
  public async onAddSaveBefore(t: StorageEnter) {
    let userInfo = await this.userInfo;
    this.info.result = true;
 
    let dataInfo: any = t;
    let detailList = dataInfo.Storage_EnterList;
    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
      });
      if (!contractInfo) {
        this.info.result = false;
        this.info.msg = `明细物料${slist.productModel}货位不正确,无法修改!`;
      }
    }
 
    return this.info;
  }
}