From 1de7c41e03da609c1a764645dd4b94b60ab5381f Mon Sep 17 00:00:00 2001 From: "YEJIAXING-PC\\lenovo" <591141169@qq.com> Date: Wed, 14 May 2025 17:07:19 +0800 Subject: [PATCH] =?UTF-8?q?PC=E7=AB=AF=E6=B2=A1=E6=9C=89=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E5=8D=95=EF=BC=8C=E6=94=B6=E8=B4=A7=E8=AE=A2=E5=8D=95=E4=B9=9F?= =?UTF-8?q?=E7=9C=8B=E4=B8=8D=E5=87=BA=E6=9D=A5=E6=94=B6=E4=BA=86=E5=A4=9A?= =?UTF-8?q?=E5=B0=91=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/item/itemUseRecordMain/index.ts | 51 +++ .../eam/item/itemUseRecordMain/index.vue | 334 ++++++++++++++++++ .../itemUseRecordMain.data.ts | 136 +++++++ 3 files changed, 521 insertions(+) create mode 100644 src/api/eam/item/itemUseRecordMain/index.ts create mode 100644 src/views/eam/item/itemUseRecordMain/index.vue create mode 100644 src/views/eam/item/itemUseRecordMain/itemUseRecordMain.data.ts diff --git a/src/api/eam/item/itemUseRecordMain/index.ts b/src/api/eam/item/itemUseRecordMain/index.ts new file mode 100644 index 0000000..ed7edda --- /dev/null +++ b/src/api/eam/item/itemUseRecordMain/index.ts @@ -0,0 +1,51 @@ +import request from '@/config/axios' + +export interface ItemUseRecordMainVO { + id: number + number: string + associatedNumber: string + inventoryAction: string + available: string + concurrencyStamp: number +} + +// 查询备件使用操作主表记录列表 +export const getItemUseRecordMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/item-use-record-main/senior', data }) + } else { + return await request.get({ url: `/eam/item-use-record-main/pageForReceipt`, params }) + } +} + +// 查询备件使用操作主表记录详情 +export const getItemUseRecordMain = async (id: number) => { + return await request.get({ url: `/eam/item-use-record-main/get?id=` + id }) +} + +// 新增备件使用操作主表记录 +export const createItemUseRecordMain = async (data: ItemUseRecordMainVO) => { + return await request.post({ url: `/eam/item-use-record-main/create`, data }) +} + +// 修改备件使用操作主表记录 +export const updateItemUseRecordMain = async (data: ItemUseRecordMainVO) => { + return await request.put({ url: `/eam/item-use-record-main/update`, data }) +} + +// 删除备件使用操作主表记录 +export const deleteItemUseRecordMain = async (id: number) => { + return await request.delete({ url: `/eam/item-use-record-main/delete?id=` + id }) +} + +// 导出备件使用操作主表记录 Excel +export const exportItemUseRecordMain = async (params) => { + return await request.download({ url: `/eam/item-use-record-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/item-use-record-main/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/eam/item/itemUseRecordMain/index.vue b/src/views/eam/item/itemUseRecordMain/index.vue new file mode 100644 index 0000000..5ad3047 --- /dev/null +++ b/src/views/eam/item/itemUseRecordMain/index.vue @@ -0,0 +1,334 @@ + + + diff --git a/src/views/eam/item/itemUseRecordMain/itemUseRecordMain.data.ts b/src/views/eam/item/itemUseRecordMain/itemUseRecordMain.data.ts new file mode 100644 index 0000000..679e647 --- /dev/null +++ b/src/views/eam/item/itemUseRecordMain/itemUseRecordMain.data.ts @@ -0,0 +1,136 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter2 } from '@/utils/formatTime' +import { Item } from '@/views/eam/basic/item/item.data' +import * as ItemApi from '@/api/eam/basic/item' +import { validateHanset, validateEmail } from '@/utils/validator' +const { t } = useI18n() // 国际化 + +/** + * @returns {Array} 备件申请主表 + */ +export const ItemUseRecordMain = useCrudSchemas(reactive([ + { + label: '收货单编号', + field: 'number', + sort: 'custom', + isSearch: true, + table: { + width: 150, + fixed: 'left' + }, + }, + { + label: '关联工单', + field: 'associatedNumber', + sort: 'custom', + }, + + { + label: '库存动作', + field: 'inventoryAction', + sort: 'custom', + dictType: DICT_TYPE.INVENTORY_ACTION, + dictClass: 'string', + isSearch: false, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select' + } + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 200, + fixed: 'right' + } + } +])) + +//表单校验 +export const ItemUseRecordMainRules = reactive({ + number: [ + required, + { max: 20, message: '请输入收货订单号', trigger: 'blur' }, + ] +}) + +/** + * @returns {Array} 备件申请子表 + */ +export const ItemInLocationInaccount = useCrudSchemas(reactive([ + { + label: '备件编号', + field: 'itemNumber', + sort: 'custom', + isSearch: true, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择备件编号', + searchField: 'number', + searchTitle: '备件信息', + searchAllSchemas: Item.allSchemas, // 查询弹窗所需类 + searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + }, + }, + { + label: '库位编号', + field: 'locationNumber', + sort: 'custom', + isForm: false, + isSearch: true, + table: { + width: 180, + }, + }, + { + label: '入库类型', + field: 'type', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.ITEM_OUT_IN_TYPE, + dictClass: 'string', + form: { + component: 'Select' + } + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 + } + }, +])) + +//表单校验 +export const ItemInLocationInaccountRules = reactive({ + itemNumber: [ + { required: true, message: '请输入备件编号', trigger: 'blur' }, + ], + +})