From 9e6ae42645f41fc68870f3344593c6d964e2c84e Mon Sep 17 00:00:00 2001 From: gaojs <757918719@qq.com> Date: Fri, 17 May 2024 17:06:22 +0800 Subject: [PATCH] =?UTF-8?q?EAM=20=E2=80=94=E2=80=94>=20=E7=82=B9=E6=A3=80?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=9B=86=20=E4=B8=8E=20=E7=82=B9=E6=A3=80?= =?UTF-8?q?=E9=A1=B9=20=E5=85=B3=E8=81=94=20=20=E5=89=8D=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/basicDocumentType/index.ts | 2 +- src/api/eam/basicFaultCause/index.ts | 2 +- src/api/eam/basicFaultType/index.ts | 2 +- src/api/eam/basicInspectionOption/index.ts | 2 +- src/api/eam/basicMaintenanceOption/index.ts | 2 +- src/api/eam/basicSpotCheckSelectSet/index.ts | 61 ++++ src/api/eam/inspectionItemSelectSet/index.ts | 3 +- .../basicSpotCheckSelectSet.data.ts | 147 +++++++++ .../eam/basicSpotCheckSelectSet/index.vue | 287 ++++++++++++++++++ .../itemSelectSetForm.vue | 287 ++++++++++++++++++ .../eam/inspectionItemSelectSet/index.vue | 4 +- .../itemSelectSetForm.vue | 9 +- 12 files changed, 793 insertions(+), 15 deletions(-) create mode 100644 src/api/eam/basicSpotCheckSelectSet/index.ts create mode 100644 src/views/eam/basicSpotCheckSelectSet/basicSpotCheckSelectSet.data.ts create mode 100644 src/views/eam/basicSpotCheckSelectSet/index.vue create mode 100644 src/views/eam/basicSpotCheckSelectSet/itemSelectSetForm.vue diff --git a/src/api/eam/basicDocumentType/index.ts b/src/api/eam/basicDocumentType/index.ts index ec53a58df..d7809baf4 100644 --- a/src/api/eam/basicDocumentType/index.ts +++ b/src/api/eam/basicDocumentType/index.ts @@ -62,6 +62,6 @@ export const importTemplate = () => { } // 启用 / 禁用 -export const updateEnableCode = async (data: EquipmentMainPartVO) => { +export const updateEnableCode = async (data: DocumentTypeVO) => { return await request.post({ url: `/eam/document-type/ables` , data }) } diff --git a/src/api/eam/basicFaultCause/index.ts b/src/api/eam/basicFaultCause/index.ts index ffffb2d80..5c72afd0e 100644 --- a/src/api/eam/basicFaultCause/index.ts +++ b/src/api/eam/basicFaultCause/index.ts @@ -63,6 +63,6 @@ export const importTemplate = () => { } // 启用 / 禁用 -export const updateEnableCode = async (data: EquipmentMainPartVO) => { +export const updateEnableCode = async (data: BasicFaultCauseVO) => { return await request.post({ url: `/eam/basic-fault-cause/ables` , data }) } diff --git a/src/api/eam/basicFaultType/index.ts b/src/api/eam/basicFaultType/index.ts index 3af2b44ce..69865950a 100644 --- a/src/api/eam/basicFaultType/index.ts +++ b/src/api/eam/basicFaultType/index.ts @@ -62,6 +62,6 @@ export const importTemplate = () => { } // 启用 / 禁用 -export const updateEnableCode = async (data: EquipmentMainPartVO) => { +export const updateEnableCode = async (data: BasicFaultTypeVO) => { return await request.post({ url: `/eam/basic-fault-type/ables` , data }) } diff --git a/src/api/eam/basicInspectionOption/index.ts b/src/api/eam/basicInspectionOption/index.ts index c41812cbe..663c61889 100644 --- a/src/api/eam/basicInspectionOption/index.ts +++ b/src/api/eam/basicInspectionOption/index.ts @@ -59,6 +59,6 @@ export const importTemplate = () => { } // 启用 / 禁用 -export const updateEnableCode = async (data: EquipmentMainPartVO) => { +export const updateEnableCode = async (data: BasicInspectionOptionVO) => { return await request.post({ url: `/eam/basic-inspection-option/ables` , data }) } diff --git a/src/api/eam/basicMaintenanceOption/index.ts b/src/api/eam/basicMaintenanceOption/index.ts index 0d95570c6..1fa280e6d 100644 --- a/src/api/eam/basicMaintenanceOption/index.ts +++ b/src/api/eam/basicMaintenanceOption/index.ts @@ -59,6 +59,6 @@ export const importTemplate = () => { } // 启用 / 禁用 -export const updateEnableCode = async (data: EquipmentMainPartVO) => { +export const updateEnableCode = async (data: BasicMaintenanceOptionVO) => { return await request.post({ url: `/eam/basic-maintenance-option/ables` , data }) } diff --git a/src/api/eam/basicSpotCheckSelectSet/index.ts b/src/api/eam/basicSpotCheckSelectSet/index.ts new file mode 100644 index 000000000..c48befc48 --- /dev/null +++ b/src/api/eam/basicSpotCheckSelectSet/index.ts @@ -0,0 +1,61 @@ +import request from '@/config/axios' + +export interface BasicSpotCheckSelectSetVO { + id: number + name: string + describing: string + itemCode: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询点检选择集维护列表 +export const getBasicSpotCheckSelectSetPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/basic-spot-check-select-set/senior', data }) + } else { + return await request.get({ url: `/eam/basic-spot-check-select-set/page`, params }) + } +} + +// 查询点检选择集维护详情 +export const getBasicSpotCheckSelectSet = async (id: number) => { + return await request.get({ url: `/eam/basic-spot-check-select-set/get?id=` + id }) +} + +// 新增点检选择集维护 +export const createBasicSpotCheckSelectSet = async (data: BasicSpotCheckSelectSetVO) => { + return await request.post({ url: `/eam/basic-spot-check-select-set/create`, data }) +} + +// 修改点检选择集维护 +export const updateBasicSpotCheckSelectSet = async (data: BasicSpotCheckSelectSetVO) => { + return await request.put({ url: `/eam/basic-spot-check-select-set/update`, data }) +} + +// 删除点检选择集维护 +export const deleteBasicSpotCheckSelectSet = async (id: number) => { + return await request.delete({ url: `/eam/basic-spot-check-select-set/delete?id=` + id }) +} + +// 导出点检选择集维护 Excel +export const exportBasicSpotCheckSelectSet = async (params) => { + return await request.download({ url: `/eam/basic-spot-check-select-set/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/basic-spot-check-select-set/get-import-template' }) +} + +// 启用 / 禁用 +export const updateEnableCode = async (data: BasicSpotCheckSelectSetVO) => { + return await request.post({ url: `/eam/basic-spot-check-select-set/ables` , data }) +} diff --git a/src/api/eam/inspectionItemSelectSet/index.ts b/src/api/eam/inspectionItemSelectSet/index.ts index af1f6e522..ec0cfe547 100644 --- a/src/api/eam/inspectionItemSelectSet/index.ts +++ b/src/api/eam/inspectionItemSelectSet/index.ts @@ -1,5 +1,4 @@ import request from '@/config/axios' -import {EquipmentMainPartVO} from "@/api/eam/equipmentMainPart"; export interface InspectionItemSelectSetVO { id: number @@ -56,6 +55,6 @@ export const importTemplate = () => { } // 启用 / 禁用 -export const updateEnableCode = async (data: EquipmentMainPartVO) => { +export const updateEnableCode = async (data: InspectionItemSelectSetVO) => { return await request.post({ url: `/eam/inspection-item-select-set/ables` , data }) } diff --git a/src/views/eam/basicSpotCheckSelectSet/basicSpotCheckSelectSet.data.ts b/src/views/eam/basicSpotCheckSelectSet/basicSpotCheckSelectSet.data.ts new file mode 100644 index 000000000..a676dc588 --- /dev/null +++ b/src/views/eam/basicSpotCheckSelectSet/basicSpotCheckSelectSet.data.ts @@ -0,0 +1,147 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const BasicSpotCheckSelectSetRules = reactive({ + name: [required], + describing: [required], + concurrencyStamp: [required], +}) + +export const BasicSpotCheckSelectSet = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '选择集名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '描述', + field: 'describing', + sort: 'custom', + isSearch: true, + }, + { + label: '项编号', + field: 'itemCode', + sort: 'custom', + isSearch: true, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + 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: true, + }, + { + 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' + } + } +])) diff --git a/src/views/eam/basicSpotCheckSelectSet/index.vue b/src/views/eam/basicSpotCheckSelectSet/index.vue new file mode 100644 index 000000000..ab1beec5a --- /dev/null +++ b/src/views/eam/basicSpotCheckSelectSet/index.vue @@ -0,0 +1,287 @@ + + + diff --git a/src/views/eam/basicSpotCheckSelectSet/itemSelectSetForm.vue b/src/views/eam/basicSpotCheckSelectSet/itemSelectSetForm.vue new file mode 100644 index 000000000..b11ccf52e --- /dev/null +++ b/src/views/eam/basicSpotCheckSelectSet/itemSelectSetForm.vue @@ -0,0 +1,287 @@ + + + + diff --git a/src/views/eam/inspectionItemSelectSet/index.vue b/src/views/eam/inspectionItemSelectSet/index.vue index 7b35c7a3f..7b9ad8bec 100644 --- a/src/views/eam/inspectionItemSelectSet/index.vue +++ b/src/views/eam/inspectionItemSelectSet/index.vue @@ -39,7 +39,7 @@ - + @@ -56,7 +56,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import Detail from '@/components/Detail/src/Detail.vue' -import TeamForm from "@/views/eam/inspectionItemSelectSet/itemSelectSetForm.vue"; +import ItemForm from "@/views/eam/inspectionItemSelectSet/itemSelectSetForm.vue"; defineOptions({ name: 'InspectionItemSelectSet' }) diff --git a/src/views/eam/inspectionItemSelectSet/itemSelectSetForm.vue b/src/views/eam/inspectionItemSelectSet/itemSelectSetForm.vue index f7aa42b20..217708e79 100644 --- a/src/views/eam/inspectionItemSelectSet/itemSelectSetForm.vue +++ b/src/views/eam/inspectionItemSelectSet/itemSelectSetForm.vue @@ -91,9 +91,6 @@ const formRules = reactive({ remark: [ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], - items: [ - { required: true, message: '巡检项不能为空', trigger: 'blur' }, - ], }) const basicFormRef = ref() // 表单 Ref @@ -206,9 +203,9 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { // 校验表单 - // if (!basicFormRef) return - // const valid = await basicFormRef.value.validate() - // if (!valid) return + if (!basicFormRef) return + const valid = await basicFormRef.value.validate() + if (!valid) return if (tags.value.length > 10 ){ message.warning('巡检项最多10个'); return