diff --git a/src/api/eam/basic/factoryArea/index.ts b/src/api/eam/basic/factoryArea/index.ts new file mode 100644 index 0000000..70212c8 --- /dev/null +++ b/src/api/eam/basic/factoryArea/index.ts @@ -0,0 +1,53 @@ +import request from '@/config/axios' + +export interface FactoryAreaVO { + number: string + name: string + description: string + leader: string + leaderPhone: string + siteId: string + available: string + concurrencyStamp: number +} + +// 查询厂区列表 +export const getFactoryAreaPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/basic/factory-area/senior', data }) + } else { + return await request.get({ url: `/basic/factory-area/page`, params }) + } +} + +// 查询厂区详情 +export const getFactoryArea = async (id: number) => { + return await request.get({ url: `/basic/factory-area/get?id=` + id }) +} + +// 新增厂区 +export const createFactoryArea = async (data: FactoryAreaVO) => { + return await request.post({ url: `/basic/factory-area/create`, data }) +} + +// 修改厂区 +export const updateFactoryArea = async (data: FactoryAreaVO) => { + return await request.put({ url: `/basic/factory-area/update`, data }) +} + +// 删除厂区 +export const deleteFactoryArea = async (id: number) => { + return await request.delete({ url: `/basic/factory-area/delete?id=` + id }) +} + +// 导出厂区 Excel +export const exportFactoryArea = async (params) => { + return await request.download({ url: `/basic/factory-area/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/basic/factory-area/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/eam/basic/factoryArea/factoryArea.data.ts b/src/views/eam/basic/factoryArea/factoryArea.data.ts new file mode 100644 index 0000000..4122dfe --- /dev/null +++ b/src/views/eam/basic/factoryArea/factoryArea.data.ts @@ -0,0 +1,80 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' + +// 表单校验 +export const FactoryAreaRules = reactive({ + number: [required], + name: [required], + available: [required], + concurrencyStamp: [required], +}) + +export const FactoryArea = useCrudSchemas(reactive([ + { + label: '编号唯一标识', + field: 'number', + sort: 'custom', + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + isSearch: true, + form: { + component: 'Editor', + componentProps: { + valueHtml: '', + height: 200 + } + }, + }, + { + label: '负责人', + field: 'leader', + sort: 'custom', + isSearch: true, + }, + { + label: '负责人电话', + field: 'leaderPhone', + sort: 'custom', + isSearch: true, + }, + { + label: '地点ID', + field: 'siteId', + sort: 'custom', + isSearch: true, + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + isSearch: true, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/basic/factoryArea/index.vue b/src/views/eam/basic/factoryArea/index.vue new file mode 100644 index 0000000..add50a3 --- /dev/null +++ b/src/views/eam/basic/factoryArea/index.vue @@ -0,0 +1,231 @@ + + +