From 11a1c6deeebfb3cfd755b9bcbb4fead8c02da17d Mon Sep 17 00:00:00 2001
From: gaojs <757918719@qq.com>
Date: Wed, 22 May 2024 17:59:25 +0800
Subject: [PATCH] =?UTF-8?q?EAM=20=E2=80=94=E2=80=94>=20=E4=BF=9D=E5=85=BB?=
=?UTF-8?q?=E8=AE=A1=E5=88=92=20=E5=A2=9E=E6=94=B9=E6=9F=A5=20=E5=81=9C?=
=?UTF-8?q?=E7=94=A8=E5=90=AF=E7=94=A8=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/eam/maintenance/index.ts | 71 +++++
src/views/eam/maintenance/index.vue | 291 ++++++++++++++++++
src/views/eam/maintenance/maintenance.data.ts | 214 +++++++++++++
3 files changed, 576 insertions(+)
create mode 100644 src/api/eam/maintenance/index.ts
create mode 100644 src/views/eam/maintenance/index.vue
create mode 100644 src/views/eam/maintenance/maintenance.data.ts
diff --git a/src/api/eam/maintenance/index.ts b/src/api/eam/maintenance/index.ts
new file mode 100644
index 000000000..fcf6d24dd
--- /dev/null
+++ b/src/api/eam/maintenance/index.ts
@@ -0,0 +1,71 @@
+import request from '@/config/axios'
+import {InspectionItemSelectSetVO} from "@/api/eam/inspectionItemSelectSet";
+
+export interface MaintenanceVO {
+ id: number
+ number: string
+ describing: string
+ equipmentCode: string
+ type: string
+ optionCode: string
+ cycle: string
+ classes: string
+ peoples: number
+ estimatedMinutes: number
+ factoryAreaCode: string
+ workshopCode: string
+ workshopSectionCode: string
+ departmentCode: string
+ remark: string
+ siteId: string
+ available: string
+ deletionTime: Date
+ deleterId: byte[]
+ concurrencyStamp: number
+}
+
+// 查询保养计划列表
+export const getMaintenancePage = async (params) => {
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/eam/basic/maintenance/senior', data })
+ } else {
+ return await request.get({ url: `/eam/basic/maintenance/page`, params })
+ }
+}
+
+// 查询保养计划详情
+export const getMaintenance = async (id: number) => {
+ return await request.get({ url: `/eam/basic/maintenance/get?id=` + id })
+}
+
+// 新增保养计划
+export const createMaintenance = async (data: MaintenanceVO) => {
+ return await request.post({ url: `/eam/basic/maintenance/create`, data })
+}
+
+// 修改保养计划
+export const updateMaintenance = async (data: MaintenanceVO) => {
+ return await request.put({ url: `/eam/basic/maintenance/update`, data })
+}
+
+// 删除保养计划
+export const deleteMaintenance = async (id: number) => {
+ return await request.delete({ url: `/eam/basic/maintenance/delete?id=` + id })
+}
+
+// 导出保养计划 Excel
+export const exportMaintenance = async (params) => {
+ return await request.download({ url: `/eam/basic/maintenance/export-excel`, params })
+}
+
+// 下载用户导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/eam/basic/maintenance/get-import-template' })
+}
+
+// 启用 / 禁用
+export const updateEnableCode = async (data: InspectionItemSelectSetVO) => {
+ return await request.post({ url: `/eam/basic/maintenance/ables` , data })
+}
diff --git a/src/views/eam/maintenance/index.vue b/src/views/eam/maintenance/index.vue
new file mode 100644
index 000000000..9409b27b2
--- /dev/null
+++ b/src/views/eam/maintenance/index.vue
@@ -0,0 +1,291 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.number }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/eam/maintenance/maintenance.data.ts b/src/views/eam/maintenance/maintenance.data.ts
new file mode 100644
index 000000000..d8eacab32
--- /dev/null
+++ b/src/views/eam/maintenance/maintenance.data.ts
@@ -0,0 +1,214 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter } from '@/utils/formatTime'
+
+// 表单校验
+export const MaintenanceRules = reactive({
+ number: [required],
+ equipmentCode: [required],
+ optionCode: [required],
+ factoryAreaCode: [required],
+ concurrencyStamp: [required],
+})
+
+export const Maintenance = useCrudSchemas(reactive([
+ {
+ label: 'id',
+ field: 'id',
+ sort: 'custom',
+ isSearch: false,
+ isTable: false,
+ isForm: false,
+ isDetail:false,
+ },
+ {
+ label: '计划编号',
+ field: 'number',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '描述',
+ field: 'describing',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '设备编号',
+ field: 'equipmentCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '设备类别枚举',
+ field: 'type',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '方案编号',
+ field: 'optionCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '周期',
+ field: 'cycle',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '班次',
+ field: 'classes',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '人数',
+ field: 'peoples',
+ sort: 'custom',
+ isSearch: true,
+ form: {
+ component: 'InputNumber',
+ value: 0
+ },
+ },
+ {
+ label: '预计所需时间',
+ field: 'estimatedMinutes',
+ sort: 'custom',
+ isSearch: true,
+ form: {
+ component: 'InputNumber',
+ value: 0
+ },
+ },
+ {
+ label: '所属厂区编号',
+ field: 'factoryAreaCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '车间编号',
+ field: 'workshopCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ label: '工段编号',
+ field: 'workshopSectionCode',
+ sort: 'custom',
+ isSearch: true,
+ },
+ {
+ 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')]
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '部门id',
+ field: 'departmentCode',
+ sort: 'custom',
+ isSearch: false,
+ isTable: false,
+ isForm: false,
+ isDetail:false,
+ },
+ {
+ label: '备注',
+ field: 'remark',
+ sort: 'custom',
+ isSearch: false,
+ },
+ {
+ label: '地点ID',
+ field: 'siteId',
+ sort: 'custom',
+ isSearch: false,
+ isTable: false,
+ isForm: false,
+ isDetail:false,
+ },
+ {
+ label: '是否可用',
+ field: 'available',
+ sort: 'custom',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string', // 默认都是字符串类型其他暂不考虑
+ isTable: true,
+ isDetail: false,
+ isSearch: true,
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ label: '删除时间',
+ field: 'deletionTime',
+ 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: '删除人id',
+ field: 'deleterId',
+ 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: 'action',
+ isForm: false,
+ table: {
+ width: 150,
+ fixed: 'right'
+ }
+ }
+]))