From 9ab87045bc3a0153accc41f04cf9134d724dc351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Fri, 1 Mar 2024 15:24:10 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eam/item/applicationRecordDetail/index.ts | 18 +- src/api/eam/item/itemAccounts/index.ts | 4 +- src/api/eam/item/itemApplyDetail/index.ts | 16 +- src/api/eam/item/itemLocationReplace/index.ts | 49 ++++ src/views/eam/item/itemAccounts/index.vue | 12 +- .../item/itemApplyMain/itemApplyMain.data.ts | 118 +++++++++ .../eam/item/itemLocationReplace/index.vue | 244 ++++++++++++++++++ .../itemLocationReplace.data.ts | 62 +++++ 8 files changed, 501 insertions(+), 22 deletions(-) create mode 100644 src/api/eam/item/itemLocationReplace/index.ts create mode 100644 src/views/eam/item/itemLocationReplace/index.vue create mode 100644 src/views/eam/item/itemLocationReplace/itemLocationReplace.data.ts diff --git a/src/api/eam/item/applicationRecordDetail/index.ts b/src/api/eam/item/applicationRecordDetail/index.ts index 7d1ed1a..9a45b46 100644 --- a/src/api/eam/item/applicationRecordDetail/index.ts +++ b/src/api/eam/item/applicationRecordDetail/index.ts @@ -20,38 +20,38 @@ export const getApplicationRecordDetailPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = { ...params } - return await request.post({ url: '/eam/item-apply-detail/senior', data }) + return await request.post({ url: '/eam/item-apply-request-detail/senior', data }) } else { - return await request.get({ url: `/eam/item-apply-detail/page`, params }) + return await request.get({ url: `/eam/item-apply-request-detail/page`, params }) } } // 查询备件申领记录主详情 export const getApplicationRecordDetail = async (id : number) => { - return await request.get({ url: `/eam/item-apply-detail/get?id=` + id }) + return await request.get({ url: `/eam/item-apply-request-detail/get?id=` + id }) } // 新增备件申领记录主 export const createApplicationRecordDetail = async (data : ItemApplyDetailVO) => { - return await request.post({ url: `/eam/item-apply-detail/create`, data }) + return await request.post({ url: `/eam/item-apply-request-detail/create`, data }) } // 修改备件申领记录主 export const updateApplicationRecordDetail = async (data : ItemApplyDetailVO) => { - return await request.put({ url: `/eam/item-apply-detail/update`, data }) + return await request.put({ url: `/eam/item-apply-request-detail/update`, data }) } // 删除备件申领记录主 export const deleteApplicationRecordDetail = async (id : number) => { - return await request.delete({ url: `/eam/item-apply-detail/delete?id=` + id }) + return await request.delete({ url: `/eam/item-apply-request-detail/delete?id=` + id }) } // 导出备件申领记录主 Excel export const exportApplicationRecordDetail = async (params) => { - return await request.download({ url: `/eam/item-apply-detail/export-excel`, params }) + return await request.download({ url: `/eam/item-apply-request-detail/export-excel`, params }) } // 下载用户导入模板 export const importTemplate = () => { - return request.download({ url: '/eam/item-apply-detail/get-import-template' }) -} \ No newline at end of file + return request.download({ url: '/eam/item-apply-request-detail/get-import-template' }) +} diff --git a/src/api/eam/item/itemAccounts/index.ts b/src/api/eam/item/itemAccounts/index.ts index db06aaf..e3e5524 100644 --- a/src/api/eam/item/itemAccounts/index.ts +++ b/src/api/eam/item/itemAccounts/index.ts @@ -52,6 +52,6 @@ export const importTemplate = () => { } // 更改备件库位 -export const createDeviceItemBatch = async (data: Array) => { - return await request.post({url: `/rel/device-item/createBatch `, data }); +export const replaceLocation = async (data: Array) => { + return await request.post({url: `/eam/item-accounts/replaceLocation `, data }); }; diff --git a/src/api/eam/item/itemApplyDetail/index.ts b/src/api/eam/item/itemApplyDetail/index.ts index 0e5a01c..0941c11 100644 --- a/src/api/eam/item/itemApplyDetail/index.ts +++ b/src/api/eam/item/itemApplyDetail/index.ts @@ -20,38 +20,38 @@ export const getItemApplyDetailPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} - return await request.post({ url: '/eam/item-apply-detail/senior', data }) + return await request.post({ url: '/eam/item-apply-request-detail/senior', data }) } else { - return await request.get({ url: `/eam/item-apply-detail/page`, params }) + return await request.get({ url: `/eam/item-apply-request-detail/page`, params }) } } // 查询备件申领记录主详情 export const getItemApplyDetail = async (id: number) => { - return await request.get({ url: `/eam/item-apply-detail/get?id=` + id }) + return await request.get({ url: `/eam/item-apply-request-detail/get?id=` + id }) } // 新增备件申领记录主 export const createItemApplyDetail = async (data: ItemApplyDetailVO) => { - return await request.post({ url: `/eam/item-apply-detail/create`, data }) + return await request.post({ url: `/eam/item-apply-request-detail/create`, data }) } // 修改备件申领记录主 export const updateItemApplyDetail = async (data: ItemApplyDetailVO) => { - return await request.put({ url: `/eam/item-apply-detail/update`, data }) + return await request.put({ url: `/eam/item-apply-request-detail/update`, data }) } // 删除备件申领记录主 export const deleteItemApplyDetail = async (id: number) => { - return await request.delete({ url: `/eam/item-apply-detail/delete?id=` + id }) + return await request.delete({ url: `/eam/item-apply-request-detail/delete?id=` + id }) } // 导出备件申领记录主 Excel export const exportItemApplyDetail = async (params) => { - return await request.download({ url: `/eam/item-apply-detail/export-excel`, params }) + return await request.download({ url: `/eam/item-apply-request-detail/export-excel`, params }) } // 下载用户导入模板 export const importTemplate = () => { - return request.download({ url: '/eam/item-apply-detail/get-import-template' }) + return request.download({ url: '/eam/item-apply-request-detail/get-import-template' }) } diff --git a/src/api/eam/item/itemLocationReplace/index.ts b/src/api/eam/item/itemLocationReplace/index.ts new file mode 100644 index 0000000..7bdab64 --- /dev/null +++ b/src/api/eam/item/itemLocationReplace/index.ts @@ -0,0 +1,49 @@ +import request from '@/config/axios' + +export interface ItemLocationReplaceVO { + locationNumber: string + describe: string + oldItemNumber: string + itemNumber: string +} + +// 查询备件库位变更记录列表 +export const getItemLocationReplacePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/item-location-replace/senior', data }) + } else { + return await request.get({ url: `/eam/item-location-replace/page`, params }) + } +} + +// 查询备件库位变更记录详情 +export const getItemLocationReplace = async (id: number) => { + return await request.get({ url: `/eam/item-location-replace/get?id=` + id }) +} + +// 新增备件库位变更记录 +export const createItemLocationReplace = async (data: ItemLocationReplaceVO) => { + return await request.post({ url: `/eam/item-location-replace/create`, data }) +} + +// 修改备件库位变更记录 +export const updateItemLocationReplace = async (data: ItemLocationReplaceVO) => { + return await request.put({ url: `/eam/item-location-replace/update`, data }) +} + +// 删除备件库位变更记录 +export const deleteItemLocationReplace = async (id: number) => { + return await request.delete({ url: `/eam/item-location-replace/delete?id=` + id }) +} + +// 导出备件库位变更记录 Excel +export const exportItemLocationReplace = async (params) => { + return await request.download({ url: `/eam/item-location-replace/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/item-location-replace/get-import-template' }) +} diff --git a/src/views/eam/item/itemAccounts/index.vue b/src/views/eam/item/itemAccounts/index.vue index 02e09e2..23aefd4 100644 --- a/src/views/eam/item/itemAccounts/index.vue +++ b/src/views/eam/item/itemAccounts/index.vue @@ -50,6 +50,8 @@ :isBusiness="false" /> + + @@ -75,6 +77,7 @@ const { t } = useI18n() // 国际化 const route = useRoute() // 路由信息 const routeName = ref() const locationNumber = ref() +const id = ref() routeName.value = route.name const tableColumns = ref(ItemAccounts.allSchemas.tableColumns) @@ -147,14 +150,16 @@ const buttonTableClick = async (val, row) => { } else if (val == 'delete') { // 删除 handleDelete(row.id) } else if (val == 'selectItem') { - openItem(row.locationNumber) + openItem(row.locationNumber,row.id) } } const searchTableRef = ref() /** 绑定备件操作 */ -const openItem = async (number: String) => { +const openItem = async (number: String,id: number) => { + console.log(id) locationNumber.value = number + id = id searchTableRef.value.open( '选择备件', Item.allSchemas, @@ -171,10 +176,11 @@ const openItem = async (number: String) => { const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => { const deviceItemRelList = selections.map((element) => ({ + id: id.value, locationNumber: locationNumber.value, itemNumber: element.number })) - createDeviceItemBatch(deviceItemRelList).then((res) => { + ItemAccountsApi.replaceLocation(deviceItemRelList).then((res) => { console.log('res', res) }) console.log('deviceItemRelList', deviceItemRelList) diff --git a/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts b/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts index 1bf2b52..5046d96 100644 --- a/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts +++ b/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts @@ -116,6 +116,124 @@ export const ItemApplyDetail = useCrudSchemas(reactive([ ] }, }, + { + label: '类型', + field: 'type', + sort: 'custom', + dictType: DICT_TYPE.DEVICE_MOLD_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select', + disabled: false + } + }, + + + { + label: '设备/模具编号', + field: 'deviceNumber', + sort: 'custom', + isSearch: true, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择单号', + searchField: 'number', + searchTitle: '单号信息', + searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 + searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: "TRUE", + isMainValue: false + }, { + key: 'type', + value: "type", + isMainValue: true + } + ] + }, + }, + { + label: '申领数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 + } + }, + { + label: '库存数量', + field: 'currentQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 + } + }, + + + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select', + disabled: true + } + }, + + + { + label: '是否以旧换新', + field: 'isRadeIn', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select', + disabled: true + } + }, { label: '备注', field: 'remark', diff --git a/src/views/eam/item/itemLocationReplace/index.vue b/src/views/eam/item/itemLocationReplace/index.vue new file mode 100644 index 0000000..4497063 --- /dev/null +++ b/src/views/eam/item/itemLocationReplace/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/eam/item/itemLocationReplace/itemLocationReplace.data.ts b/src/views/eam/item/itemLocationReplace/itemLocationReplace.data.ts new file mode 100644 index 0000000..bebf9b7 --- /dev/null +++ b/src/views/eam/item/itemLocationReplace/itemLocationReplace.data.ts @@ -0,0 +1,62 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const ItemLocationReplaceRules = reactive({ + locationNumber: [required], + oldItemNumber: [required], + itemNumber: [required], +}) + +export const ItemLocationReplace = useCrudSchemas(reactive([ + { + label: '库位编号', + field: 'locationNumber', + sort: 'custom', + isSearch: true, + }, + + { + label: '变更前备件编号', + field: 'oldItemNumber', + sort: 'custom', + isSearch: true, + }, + { + label: '变更后备件编号', + field: 'itemNumber', + sort: 'custom', + isSearch: true, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + }, + { + label: '描述', + field: 'describe', + sort: 'custom', + isSearch: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))