Ben Lin
2024-06-27 dfd2d0218bbcea93b4bfb0e7ca7ac9b1cc1cc7da
src/api/tigerapi/wms/house.ts
@@ -1,5 +1,5 @@
import { buildUUID } from '../../../utils/uuid';
import { ApiAction, ApiActionPage } from '../../model/baseModel';
import { ApiAction } from '../../model/baseModel';
import {
  WhPageListGetResultModel,
  HouseListItem,
@@ -7,9 +7,8 @@
  RegionListItem,
  ShelfListItem,
  LocationListItem,
  LocationGuiZeListItem,
} from '../model/warehoueseModel';
import { genAction, Api, genActionPage, isExist } from '../system';
import { genAction, Api, isExist } from '../system';
import { useUserStore } from '/@/store/modules/user';
import { formatToDateTime } from '/@/utils/dateUtil';
import { defHttp } from '/@/utils/http/axios';
@@ -23,7 +22,7 @@
  );
//通过仓库code查要修改的数据
export function getWHList(params: string) {
  var rmParams = genAction('', '');
  let rmParams = genAction('', '');
  if (params.slice(0, 1) == 'W') {
    rmParams = genAction('WMS_WAREHOUSE', " ID = '" + params.slice(1) + "'");
  }
@@ -37,7 +36,7 @@
  return getWareHouse(rmParams);
}
async function getWareHouse(params: ApiAction<string>) {
  var data;
  let data;
  if (params.DataType == 'WMS_WAREHOUSE') {
    data = await defHttp.post<ApiAction<WhListItem>>(
      {
@@ -116,7 +115,7 @@
    );
  } else {
    const usParams = genAction('WMS_WAREHOUSE', "WH_CODE='" + params.WH_CODE + "'");
    var check = await isExist(usParams);
    const check = await isExist(usParams);
    console.log('check', check);
    if (!check.Data) {
      const time = new Date();
@@ -175,8 +174,8 @@
      'WMS_REGION',
      "REGION_CODE='" + params.REGION_CODE + "'AND AUTH_ORG='" + regionitem.ORG_CODE + "'",
    );
    var check = await isExist(usParams);
    console.log('check',check)
    const check = await isExist(usParams);
    console.log('check', check);
    if (!check.Data) {
      regionitem.ID = buildUUID(); //生成GUID
      regionitem.UPDATE_TIME = formatToDateTime(new Date());
@@ -244,7 +243,7 @@
      'WMS_SHELF',
      "SHELF_CODE='" + params.SHELF_CODE + "'AND AUTH_ORG='" + Shelfitem.ORG_CODE + "'",
    );
    var check = await isExist(usParams);
    const check = await isExist(usParams);
    if (!check.Data) {
      //Shelfitem.AUTH_ORG = useUserStore().getUserInfo.orgCode as string;
      data = await defHttp.post(
@@ -255,7 +254,7 @@
        },
      );
    } else {
      data=false;
      data = false;
    }
  }
  return data;
@@ -305,7 +304,7 @@
export const SaveLocation = async (params: Recordable, isUpdate: boolean) => {
  let data;
  {
    var locations = [];
    const locations = [];
    params.forEach((items) => {
      items.forEach((item) => {
        item.CREATE_USER = useUserStore().getUserInfo.userId as string;