| | |
| | | import { buildUUID } from '../../../utils/uuid'; |
| | | import { ApiAction, ApiActionPage } from '../../model/baseModel'; |
| | | import { ApiAction } from '../../model/baseModel'; |
| | | import { |
| | | WhPageListGetResultModel, |
| | | HouseListItem, |
| | |
| | | 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'; |
| | |
| | | ); |
| | | //通过仓库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) + "'"); |
| | | } |
| | |
| | | return getWareHouse(rmParams); |
| | | } |
| | | async function getWareHouse(params: ApiAction<string>) { |
| | | var data; |
| | | let data; |
| | | if (params.DataType == 'WMS_WAREHOUSE') { |
| | | data = await defHttp.post<ApiAction<WhListItem>>( |
| | | { |
| | |
| | | ); |
| | | } 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(); |
| | |
| | | '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()); |
| | |
| | | '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( |
| | |
| | | }, |
| | | ); |
| | | } else { |
| | | data=false; |
| | | data = false; |
| | | } |
| | | } |
| | | return data; |
| | |
| | | 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; |