From c22c2893c3ab986740023f4e34f75725431ce027 Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Wed, 17 Jan 2024 11:43:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=8C=BA=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/basic/locationArea/index.ts | 52 ++++ src/views/eam/basic/locationArea/index.vue | 231 ++++++++++++++++++ .../basic/locationArea/locationArea.data.ts | 80 ++++++ 3 files changed, 363 insertions(+) create mode 100644 src/api/eam/basic/locationArea/index.ts create mode 100644 src/views/eam/basic/locationArea/index.vue create mode 100644 src/views/eam/basic/locationArea/locationArea.data.ts diff --git a/src/api/eam/basic/locationArea/index.ts b/src/api/eam/basic/locationArea/index.ts new file mode 100644 index 0000000..744bcc7 --- /dev/null +++ b/src/api/eam/basic/locationArea/index.ts @@ -0,0 +1,52 @@ +import request from '@/config/axios' + +export interface LocationAreaVO { + number: string + name: string + description: string + type: string + siteId: string + available: string + concurrencyStamp: number +} + +// 查询库区列表 +export const getLocationAreaPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/location-area/senior', data }) + } else { + return await request.get({ url: `/eam/location-area/page`, params }) + } +} + +// 查询库区详情 +export const getLocationArea = async (id: number) => { + return await request.get({ url: `/eam/location-area/get?id=` + id }) +} + +// 新增库区 +export const createLocationArea = async (data: LocationAreaVO) => { + return await request.post({ url: `/eam/location-area/create`, data }) +} + +// 修改库区 +export const updateLocationArea = async (data: LocationAreaVO) => { + return await request.put({ url: `/eam/location-area/update`, data }) +} + +// 删除库区 +export const deleteLocationArea = async (id: number) => { + return await request.delete({ url: `/eam/location-area/delete?id=` + id }) +} + +// 导出库区 Excel +export const exportLocationArea = async (params) => { + return await request.download({ url: `/eam/location-area/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/location-area/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/eam/basic/locationArea/index.vue b/src/views/eam/basic/locationArea/index.vue new file mode 100644 index 0000000..684cced --- /dev/null +++ b/src/views/eam/basic/locationArea/index.vue @@ -0,0 +1,231 @@ + + + diff --git a/src/views/eam/basic/locationArea/locationArea.data.ts b/src/views/eam/basic/locationArea/locationArea.data.ts new file mode 100644 index 0000000..ff4f4e1 --- /dev/null +++ b/src/views/eam/basic/locationArea/locationArea.data.ts @@ -0,0 +1,80 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const LocationAreaRules = reactive({ + number: [required], + name: [required], + concurrencyStamp: [required], +}) + +export const LocationArea = useCrudSchemas(reactive([ + { + label: '编号', + field: 'number', + sort: 'custom', + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + form: { + component: 'Editor', + componentProps: { + valueHtml: '', + height: 200 + } + }, + }, + { + label: '类型', + field: 'type', + sort: 'custom', + isSearch: true, + form: { + component: 'SelectV2' + }, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + }, + { + label: '地点ID', + field: 'siteId', + sort: 'custom', + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))