|
|
@ -1,32 +1,117 @@ |
|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
import * as UserApi from '@/api/system/user' |
|
|
|
import { Location } from '../../basic/location/location.data' |
|
|
|
import * as LocationApi from '@/api/eam/basic/location' |
|
|
|
import { ItemAccounts } from '../itemAccounts/itemAccounts.data' |
|
|
|
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts' |
|
|
|
const userListAll = await UserApi.getSimpleUserList() |
|
|
|
|
|
|
|
// 表单校验
|
|
|
|
export const ItemLocationReplaceRules = reactive({ |
|
|
|
locationNumber: [required], |
|
|
|
oldItemNumber: [required], |
|
|
|
itemNumber: [required], |
|
|
|
oldLocationNumber: [required], |
|
|
|
}) |
|
|
|
|
|
|
|
export const ItemLocationReplace = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
{ |
|
|
|
label: '库位编号', |
|
|
|
label: '变更后库位编号', |
|
|
|
field: 'locationNumber', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
form: { |
|
|
|
componentProps: { |
|
|
|
enterSearch: true, |
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '请选择变更后库位编号', // 输入框占位文本
|
|
|
|
searchField: 'number', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '库位信息', // 查询弹窗标题
|
|
|
|
isConcatDetailSchemas:false,//是否是主子表合并 默认false
|
|
|
|
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: LocationApi.selectPageByConditions, // 查询弹窗所需分页方法
|
|
|
|
isEnter:true, |
|
|
|
searchCondition: [{ |
|
|
|
key:'available', |
|
|
|
value:'TRUE', |
|
|
|
message: '是否可用', |
|
|
|
isMainValue: false |
|
|
|
},{ |
|
|
|
key:'qty', |
|
|
|
value:'0', |
|
|
|
message: '库存数量', |
|
|
|
isMainValue: false |
|
|
|
},] |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
label: '变更前备件编号', |
|
|
|
field: 'oldItemNumber', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
componentProps: { |
|
|
|
disabled: true, |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '变更后备件编号', |
|
|
|
field: 'itemNumber', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
form: { |
|
|
|
componentProps: { |
|
|
|
enterSearch: true, |
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '请选择变更后备件编号', // 输入框占位文本
|
|
|
|
searchField: 'itemNumber', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '备件信息', // 查询弹窗标题
|
|
|
|
isConcatDetailSchemas:false,//是否是主子表合并 默认false
|
|
|
|
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
|
|
|
|
isEnter:true, |
|
|
|
searchCondition: [{ |
|
|
|
key:'available', |
|
|
|
value:'TRUE', |
|
|
|
message: '是否可用', |
|
|
|
isMainValue: false |
|
|
|
}, { |
|
|
|
key:'isInAccount', |
|
|
|
value:'isInAccount', |
|
|
|
message: '请选择变更后库位!', |
|
|
|
isMainValue: true |
|
|
|
}] |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '变更前库位编号', |
|
|
|
field: 'oldLocationNumber', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
componentProps: { |
|
|
|
disabled: true, |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否账内', |
|
|
|
field: 'isInAccount', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
dictType: DICT_TYPE.TRUE_FALSE, |
|
|
|
dictClass: 'string', |
|
|
|
form: { |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '变更时间', |
|
|
@ -44,6 +129,18 @@ export const ItemLocationReplace = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
}, |
|
|
|
isForm: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '变更人', |
|
|
|
field: 'creator', |
|
|
|
sort: 'custom', |
|
|
|
isForm: false, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return userListAll.find((account) => account.id == cellValue)?.nickname |
|
|
|
}, |
|
|
|
table: { |
|
|
|
width: 170 |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '操作', |
|
|
|
field: 'action', |
|
|
|