From b96f23a3216e1ac21e6cd586ccd7df356c9ef3f6 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Fri, 15 Mar 2024 11:34:27 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=B7=A5=E4=BD=8D=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8F=AD=E7=BB=84=E3=80=81=E4=BA=A7=E7=BA=BF?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8F=8A=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/index.ts | 0 src/api/mes/workstation/index.ts | 49 ++++ src/utils/disposition/defaultButtons.ts | 12 + src/views/mes/workstation/index.vue | 248 ++++++++++++++++++ src/views/mes/workstation/workstation.data.ts | 78 ++++++ 5 files changed, 387 insertions(+) delete mode 100644 src/api/mes/index.ts create mode 100644 src/api/mes/workstation/index.ts create mode 100644 src/views/mes/workstation/index.vue create mode 100644 src/views/mes/workstation/workstation.data.ts diff --git a/src/api/mes/index.ts b/src/api/mes/index.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/api/mes/workstation/index.ts b/src/api/mes/workstation/index.ts new file mode 100644 index 000000000..f12b0a5c4 --- /dev/null +++ b/src/api/mes/workstation/index.ts @@ -0,0 +1,49 @@ +import request from '@/config/axios' + +export interface WorkstationVO { + code: string + activeTime: Date + expireTime: Date + name: string +} + +// 查询工位列表 +export const getWorkstationPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/workstation/senior', data }) + } else { + return await request.get({ url: `/mes/workstation/page`, params }) + } +} + +// 查询工位详情 +export const getWorkstation = async (id: number) => { + return await request.get({ url: `/mes/workstation/get?id=` + id }) +} + +// 新增工位 +export const createWorkstation = async (data: WorkstationVO) => { + return await request.post({ url: `/mes/workstation/create`, data }) +} + +// 修改工位 +export const updateWorkstation = async (data: WorkstationVO) => { + return await request.put({ url: `/mes/workstation/update`, data }) +} + +// 删除工位 +export const deleteWorkstation = async (id: number) => { + return await request.delete({ url: `/mes/workstation/delete?id=` + id }) +} + +// 导出工位 Excel +export const exportWorkstation = async (params) => { + return await request.download({ url: `/mes/workstation/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/workstation/get-import-template' }) +} diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index f25895502..b7f8ca791 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -735,6 +735,18 @@ export function mainThawRequesttBtn(option:any) { hasPermi: '' }) } +// 主列表-绑定 +export function mainListBindBtn(option:any) { + return __defaultBtnOption(option,{ + label: '绑定', + name: 'bind', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue new file mode 100644 index 000000000..c72da2656 --- /dev/null +++ b/src/views/mes/workstation/index.vue @@ -0,0 +1,248 @@ + + + diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts new file mode 100644 index 000000000..b74f05a6d --- /dev/null +++ b/src/views/mes/workstation/workstation.data.ts @@ -0,0 +1,78 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +// 表单校验 +export const WorkstationRules = reactive({ + code: [required], + name: [required] +}) + +export const Workstation = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + isSearch: true + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '班组代码', + field: 'teamCode', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '生效时间', + field: 'activeTime', + sort: 'custom', + formatter: dateFormatter, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '失效时间', + field: 'expireTime', + sort: 'custom', + formatter: dateFormatter, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))