| | |
| | | import { UserConfigFn } from 'vite'; |
| | | import { buildUUID } from '../../utils/uuid'; |
| | | import { DateFormat } from '../../utils/dataformat'; |
| | | import { ApiAction,ApiActionJob, ApiActionPage } from '../model/baseModel'; |
| | | import { ApiAction, ApiActionJob, ApiActionPage } from '../model/baseModel'; |
| | | import { |
| | | MenuParams, |
| | | RoleParams, |
| | |
| | | iSYS_ROLE_WH, |
| | | } from './model/systemModel'; |
| | | import { defHttp } from '/@/utils/http/axios'; |
| | | import { isUnDef } from '/@/utils/is'; |
| | | |
| | | export enum Api { |
| | | QueryUrl = '/Base/Query', |
| | |
| | | GetOrgTreeList = '/SYS/getOrgTreeList', |
| | | GetHouseTreeList = '/WMS/GetHouseModel', |
| | | GetHouseOrgTreeList = '/WMS/GetHouseModelOrg', |
| | | GetCreateBillCode = '/WMS/CreateBillCode', |
| | | GetCreateBillCode = '/WMS/CreateBillCode', |
| | | GetCreateTFBillCode = '/WMS/CreateTFBillCode', |
| | | GetAllRoleList = '/system/getAllRoleList', |
| | | urlSetSysUserToGroup = '/SYS/SetSysUserToGroup', |
| | |
| | | StartJob = '/Tsk/StartJob', |
| | | StopJob = '/Tsk/PauseJob', |
| | | AddJob = '/Tsk/AddJob', |
| | | UpdateJob= '/Tsk/UpdateJob', |
| | | urlQueryEnum= '/Base/QueryEnum', |
| | | DeleteWareHouse='/WMS/DelWareHouseModel', |
| | | AddLocation='/WMS/AddLoctionModel', |
| | | CheckLocation='/WMS/CheckLocation', |
| | | SummaryCount='/WMS/SummaryCount', |
| | | GenerateCount='/WMS/GenerateCount', |
| | | GetUpdateOrg='/WMS/GetUpdateOrg', |
| | | GetQrCode='/WMS/Item/GetQRCode', |
| | | UpdateReq='/WMS/UpdateReq', |
| | | MaterialResale='/WMS/MaterialResale', |
| | | GetProdctResult='/WMS/ProductInput/GetProdctResult', |
| | | UpdateJob = '/Tsk/UpdateJob', |
| | | urlQueryEnum = '/Base/QueryEnum', |
| | | DeleteWareHouse = '/WMS/DelWareHouseModel', |
| | | AddLocation = '/WMS/AddLoctionModel', |
| | | CheckLocation = '/WMS/CheckLocation', |
| | | SummaryCount = '/WMS/SummaryCount', |
| | | GenerateCount = '/WMS/GenerateCount', |
| | | GetUpdateOrg = '/WMS/GetUpdateOrg', |
| | | GetQrCode = '/WMS/Item/GetQRCode', |
| | | UpdateReq = '/WMS/UpdateReq', |
| | | MaterialResale = '/WMS/MaterialResale', |
| | | GetProdctResult = '/WMS/ProductInput/GetProdctResult', |
| | | // 完工入库状态还原 |
| | | GetStatusRestored = '/WMS/ProductInput/StatusRestored', |
| | | // 批量更新内容 |
| | | GetUpdateTime = '/MaterialInfo/UpdateTime' |
| | | GetUpdateTime = '/MaterialInfo/UpdateTime', |
| | | //导入 |
| | | ValidateTableImport = '/SMT/ValidateTableImport', |
| | | SaveValidateTableImport = '/SMT/SaveValidateTableImport', |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param pageSize |
| | | * @returns |
| | | */ |
| | | export function genActionPage(datatype: string, sqlcmd: string, page: number, pageSize: number,option?:object) { |
| | | export function genActionPage( |
| | | datatype: string, |
| | | sqlcmd: string, |
| | | page: number, |
| | | pageSize: number, |
| | | option?: object, |
| | | ) { |
| | | const time = new Date(); |
| | | const params: ApiActionPage = { |
| | | id: buildUUID(), |
| | | dataType: datatype, |
| | | Options:option, |
| | | Options: option, |
| | | isAsync: true, |
| | | timestamp: time.toDateString(), |
| | | isSuccessed: true, |
| | |
| | | /* |
| | | * 生成Action |
| | | */ |
| | | export function genAction<T>(datatype: string, data: T,option?:object) { |
| | | export function genAction<T>(datatype: string, data: T, option?: object) { |
| | | const time = new Date(); |
| | | const params: ApiAction<T> = { |
| | | ID: buildUUID(), |
| | | DataAssembly:'', |
| | | Options:option, |
| | | DataAssembly: '', |
| | | Options: option, |
| | | DataType: datatype, |
| | | IsAsync: true, |
| | | Timestamp: time.toDateString(), |
| | |
| | | Message: '', |
| | | StatusCode: 0, |
| | | Data: data, |
| | | LocaleMsg: undefined, |
| | | }; |
| | | return params; |
| | | } |
| | | export function genActionjob<sting>(datatype: string, assembly: string, data: string,timeone:number,remark:string) { |
| | | export function genActionjob<sting>( |
| | | datatype: string, |
| | | assembly: string, |
| | | data: string, |
| | | timeone: number, |
| | | remark: string, |
| | | ) { |
| | | const time = new Date(); |
| | | const params: ApiActionJob<string> = { |
| | | ID: buildUUID(), |
| | | DataAssembly:assembly, |
| | | DataAssembly: assembly, |
| | | DataType: datatype, |
| | | IsAsync: true, |
| | | Timestamp: time.toDateString(), |
| | |
| | | Message: '', |
| | | StatusCode: 0, |
| | | Data: { |
| | | jobName:data, |
| | | period:timeone, |
| | | remark: remark |
| | | jobName: data, |
| | | period: timeone, |
| | | remark: remark, |
| | | }, |
| | | }; |
| | | return params; |
| | |
| | | }, |
| | | ); |
| | | |
| | | export const setBasStatus = (params: any) => |
| | | export const setBasStatus = (params: any) => |
| | | defHttp.post( |
| | | { url: Api.UpdateEntity, params: genAction('BAS_ITEM', params) }, |
| | | { |
| | |
| | | }; |
| | | return model; |
| | | } |
| | | |
| | | export const GetEnum = async (enumName: { name: string }) => { |
| | | const usParams = genAction(enumName.name, ''); |
| | | return await defHttp.post( |
| | | { url: Api.urlQueryEnum, params: usParams }, |
| | | { |
| | | errorMessageMode: 'none', |
| | | isTransformResponse: false, |
| | | //apiUrl: globSetting.taskApiUrl |
| | | }, |
| | | ); |
| | | }; |