From f7d9e9a6919178c5232ba0040ab4ce6d16ae0103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=9C=E9=98=B3?= <1301318913@qq.com> Date: Wed, 27 Mar 2024 16:22:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8F=AD=E7=BB=84=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/teamSetting/index.ts | 61 +++++ .../mes/productionPlan/productionPlan.data.ts | 8 +- src/views/mes/teamSetting/index.vue | 244 ++++++++++++++++++ src/views/mes/teamSetting/teamSetting.data.ts | 178 +++++++++++++ 4 files changed, 487 insertions(+), 4 deletions(-) create mode 100644 src/api/mes/teamSetting/index.ts create mode 100644 src/views/mes/teamSetting/index.vue create mode 100644 src/views/mes/teamSetting/teamSetting.data.ts diff --git a/src/api/mes/teamSetting/index.ts b/src/api/mes/teamSetting/index.ts new file mode 100644 index 000000000..61224bc56 --- /dev/null +++ b/src/api/mes/teamSetting/index.ts @@ -0,0 +1,61 @@ +import request from '@/config/axios' + +export interface TeamSettingVO { + id: number + teamCode: string + teamName: string + teamType: string + endTime: Date + textOne: string + textTwo: string + textThree: string + textFour: string + textFive: string + deleteTime: Date + status: string + concurrencyStamp: number + remark: string + deleter: string + siteId: number +} + +// 查询班组人员管理列表 +export const getTeamSettingPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/teamSetting/senior', data }) + } else { + return await request.get({ url: `/mes/teamSetting/page`, params }) + } +} + +// 查询班组人员管理详情 +export const getTeamSetting = async (id: number) => { + return await request.get({ url: `/mes/teamSetting/get?id=` + id }) +} + +// 新增班组人员管理 +export const createTeamSetting = async (data: TeamSettingVO) => { + return await request.post({ url: `/mes/teamSetting/create`, data }) +} + +// 修改班组人员管理 +export const updateTeamSetting = async (data: TeamSettingVO) => { + return await request.put({ url: `/mes/teamSetting/update`, data }) +} + +// 删除班组人员管理 +export const deleteTeamSetting = async (id: number) => { + return await request.delete({ url: `/mes/teamSetting/delete?id=` + id }) +} + +// 导出班组人员管理 Excel +export const exportTeamSetting = async (params) => { + return await request.download({ url: `/mes/teamSetting/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/teamSetting/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/mes/productionPlan/productionPlan.data.ts b/src/views/mes/productionPlan/productionPlan.data.ts index 539264c0e..f6f8f68ec 100644 --- a/src/views/mes/productionPlan/productionPlan.data.ts +++ b/src/views/mes/productionPlan/productionPlan.data.ts @@ -78,7 +78,7 @@ export const ProductionPlan = useCrudSchemas(reactive([ field: 'deleteTime', sort: 'custom', formatter: dateFormatter, - isSearch: true, + isSearch: false, search: { component: 'DatePicker', componentProps: { @@ -99,7 +99,7 @@ export const ProductionPlan = useCrudSchemas(reactive([ label: '状态', field: 'status', sort: 'custom', - isSearch: true, + isSearch: false, form: { component: 'Radio' }, @@ -118,7 +118,7 @@ export const ProductionPlan = useCrudSchemas(reactive([ label: '备注', field: 'remark', sort: 'custom', - isSearch: true, + isSearch: false, }, { label: '创建时间', @@ -140,7 +140,7 @@ export const ProductionPlan = useCrudSchemas(reactive([ label: '删除用户名', field: 'deleter', sort: 'custom', - isSearch: true, + isSearch: false, }, { label: '位置ID', diff --git a/src/views/mes/teamSetting/index.vue b/src/views/mes/teamSetting/index.vue new file mode 100644 index 000000000..135bba85f --- /dev/null +++ b/src/views/mes/teamSetting/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/mes/teamSetting/teamSetting.data.ts b/src/views/mes/teamSetting/teamSetting.data.ts new file mode 100644 index 000000000..a24d17006 --- /dev/null +++ b/src/views/mes/teamSetting/teamSetting.data.ts @@ -0,0 +1,178 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const TeamSettingRules = reactive({ + endTime: [required], + concurrencyStamp: [required], +}) + +export const TeamSetting = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isForm: false, + }, + { + label: '班组编号', + field: 'teamCode', + sort: 'custom', + isSearch: true, + }, + { + label: '班组名称', + field: 'teamName', + sort: 'custom', + isSearch: true, + }, + { + label: '班组类型', + field: 'teamType', + sort: 'custom', + isSearch: true, + // form: { + // component: 'SelectV2' + // }, + }, + { + label: '结束时间', + field: 'endTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: 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: 'textOne', + sort: 'custom', + isSearch: false, + }, + { + label: '备用字段二', + field: 'textTwo', + sort: 'custom', + isSearch: false, + }, + { + label: '备用字段三', + field: 'textThree', + sort: 'custom', + isSearch: false, + }, + { + label: '备用字段四', + field: 'textFour', + sort: 'custom', + isSearch: false, + }, + { + label: '备用字段五', + field: 'textFive', + sort: 'custom', + isSearch: false, + }, + { + label: '删除时间', + field: 'deleteTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: 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: 'status', + sort: 'custom', + isSearch: false, + form: { + component: 'Radio' + }, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: 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')] + } + }, + isForm: false, + }, + { + label: '删除用户名', + field: 'deleter', + sort: 'custom', + isSearch: false, + }, + { + label: '位置ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))