From 11d58c3e18e5a45b9a2039f2d68705fe87ff2475 Mon Sep 17 00:00:00 2001 From: gaojs Date: Sun, 7 Apr 2024 13:48:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=85=B7=E7=B1=BB=E5=9E=8B=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/partternType/index.ts | 54 ++++ src/views/mes/partternType/index.vue | 244 ++++++++++++++++++ .../mes/partternType/partternType.data.ts | 144 +++++++++++ 3 files changed, 442 insertions(+) create mode 100644 src/api/mes/partternType/index.ts create mode 100644 src/views/mes/partternType/index.vue create mode 100644 src/views/mes/partternType/partternType.data.ts diff --git a/src/api/mes/partternType/index.ts b/src/api/mes/partternType/index.ts new file mode 100644 index 000000000..29002581a --- /dev/null +++ b/src/api/mes/partternType/index.ts @@ -0,0 +1,54 @@ +import request from '@/config/axios' + +export interface PartternTypeVO { + deleteTime: Date + id: number + status: string + concurrencyStamp: number + remark: string + deleter: string + siteId: number + code: string + name: string +} + +// 查询模具类型列表 +export const getPartternTypePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/parttern-type/senior', data }) + } else { + return await request.get({ url: `/mes/parttern-type/page`, params }) + } +} + +// 查询模具类型详情 +export const getPartternType = async (id: number) => { + return await request.get({ url: `/mes/parttern-type/get?id=` + id }) +} + +// 新增模具类型 +export const createPartternType = async (data: PartternTypeVO) => { + return await request.post({ url: `/mes/parttern-type/create`, data }) +} + +// 修改模具类型 +export const updatePartternType = async (data: PartternTypeVO) => { + return await request.put({ url: `/mes/parttern-type/update`, data }) +} + +// 删除模具类型 +export const deletePartternType = async (id: number) => { + return await request.delete({ url: `/mes/parttern-type/delete?id=` + id }) +} + +// 导出模具类型 Excel +export const exportPartternType = async (params) => { + return await request.download({ url: `/mes/parttern-type/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/parttern-type/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/mes/partternType/index.vue b/src/views/mes/partternType/index.vue new file mode 100644 index 000000000..77a6cefb8 --- /dev/null +++ b/src/views/mes/partternType/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/mes/partternType/partternType.data.ts b/src/views/mes/partternType/partternType.data.ts new file mode 100644 index 000000000..2cf9df99c --- /dev/null +++ b/src/views/mes/partternType/partternType.data.ts @@ -0,0 +1,144 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const PartternTypeRules = reactive({ + code: [required], +}) + +export const PartternType = useCrudSchemas(reactive([ + { + label: '删除时间', + field: 'deleteTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm:false, + isDetail:false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '主键', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm:false, + isDetail:false, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: false, + isTable: false, + isForm:false, + isDetail:false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm:false, + isDetail:false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + }, + { + label: '删除用户名', + field: 'deleter', + sort: 'custom', + isSearch: false, + isTable: false, + isForm:false, + isDetail:false, + }, + { + label: '位置ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm:false, + isDetail:false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '类型编码', + field: 'code', + sort: 'custom', + isSearch: true, + }, + { + label: '类型名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + dictType: DICT_TYPE.QUALIFY_STATUS, + dictClass: 'string', + isForm: true, + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: '2', + componentProps: { + inactiveValue: '2', + activeValue: '1' + } + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail:false, + table: { + width: 150, + fixed: 'right' + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + isTable: false + } +]))