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' + } + } +]))