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