From ca96595db551e4bf60d04a4060a1aebff46441f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Tue, 27 Feb 2024 17:29:52 +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 --- src/api/eam/item/replaceItemDes/index.ts | 52 ++++ src/views/eam/item/replaceItemDes/index.vue | 239 ++++++++++++++++++ .../replaceItemDes/replaceItemDes.data.ts | 60 +++++ 3 files changed, 351 insertions(+) create mode 100644 src/api/eam/item/replaceItemDes/index.ts create mode 100644 src/views/eam/item/replaceItemDes/index.vue create mode 100644 src/views/eam/item/replaceItemDes/replaceItemDes.data.ts diff --git a/src/api/eam/item/replaceItemDes/index.ts b/src/api/eam/item/replaceItemDes/index.ts new file mode 100644 index 0000000..502c819 --- /dev/null +++ b/src/api/eam/item/replaceItemDes/index.ts @@ -0,0 +1,52 @@ +import request from '@/config/axios' + +export interface AttachmentFileVO { + itemNumber: string + qty: number + areaNumber: string + isInAccount: string + siteId: string + available: string + concurrencyStamp: number +} + +// 查询备件台账列表 +export const getReplaceItemDesPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/attachment-file/senior', data }) + } else { + return await request.get({ url: `/eam/attachment-file/page`, params }) + } +} + +// 查询备件台账详情 +export const getReplaceItemDes = async (id: number) => { + return await request.get({ url: `/eam/attachment-file/get?id=` + id }) +} + +// 新增备件台账 +export const createReplaceItemDes = async (data: AttachmentFileVO) => { + return await request.post({ url: `/eam/attachment-file/create`, data }) +} + +// 修改备件台账 +export const updateReplaceItemDes = async (data: AttachmentFileVO) => { + return await request.put({ url: `/eam/attachment-file/update`, data }) +} + +// 删除备件台账 +export const deleteReplaceItemDes = async (id: number) => { + return await request.delete({ url: `/eam/attachment-file/delete?id=` + id }) +} + +// 导出备件台账 Excel +export const exportReplaceItemDes = async (params) => { + return await request.download({ url: `/eam/attachment-file/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/attachment-file/get-import-template' }) +} diff --git a/src/views/eam/item/replaceItemDes/index.vue b/src/views/eam/item/replaceItemDes/index.vue new file mode 100644 index 0000000..9a74584 --- /dev/null +++ b/src/views/eam/item/replaceItemDes/index.vue @@ -0,0 +1,239 @@ + + + diff --git a/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts b/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts new file mode 100644 index 0000000..b4c4c8a --- /dev/null +++ b/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts @@ -0,0 +1,60 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +import { Item } from '@/views/eam/basic/item/item.data' +import * as ItemApi from '@/api/eam/basic/item' + +// 表单校验 +export const ReplaceItemDesRules = reactive({ + itemNumber: [required], + areaNumber: [required], + concurrencyStamp: [required], +}) + +export const ReplaceItemDes = useCrudSchemas(reactive([ + { + label: '备件编号', + field: 'number', + sort: 'custom', + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件编号', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '备件信息', // 查询弹窗标题 + searchAllSchemas: Item.allSchemas, // 查询弹窗所需类 + searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: "TRUE", + isMainValue: false + }] + } + } + }, + { + label: '文件', + field: 'filePathList', + sort: 'custom', + table: { + }, + form: { + component: 'UploadFile', + componentProps: { + + } + } + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + + fixed: 'right' + } + } +]))