From a245463793e55da80e09ee4347831aa16a02ad22 Mon Sep 17 00:00:00 2001 From: gaojs <757918719@qq.com> Date: Mon, 17 Jun 2024 14:35:16 +0800 Subject: [PATCH] =?UTF-8?q?EAM=20=E2=80=94=E2=80=94>=20=20=E5=B7=A1?= =?UTF-8?q?=E6=A3=80=E5=B7=A5=E5=8D=95=20=E7=8A=B6=E6=80=81=E6=B5=81?= =?UTF-8?q?=E8=BD=AC=20=20=E5=89=8D=E5=90=8E=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eam/equipmentInspectionDetail/index.ts | 60 + src/api/eam/equipmentInspectionMain/index.ts | 24 +- .../eam/relationInspectionPlanItem/index.ts | 57 + src/utils/dict.ts | 3 + .../equipmentInspectionDetail.data.ts | 232 ++++ .../eam/equipmentInspectionDetail/index.vue | 244 ++++ .../InspectionOrderDetail.vue | 1055 +++++++++++++++++ .../equipmentInspectionMain.data.ts | 188 ++- .../equipmentInspectionMain/finishForm1.vue | 143 +++ .../equipmentInspectionMain/finishForm2.vue | 150 +++ .../eam/equipmentInspectionMain/index.vue | 291 ++++- .../equipmentMaintenanceMain.data.ts | 25 +- .../equipmentMaintenanceMain/finishForm2.vue | 1 - .../eam/equipmentMaintenanceMain/index.vue | 5 +- .../equipmentRepairJobMain.data.ts | 5 +- 15 files changed, 2460 insertions(+), 23 deletions(-) create mode 100644 src/api/eam/equipmentInspectionDetail/index.ts create mode 100644 src/api/eam/relationInspectionPlanItem/index.ts create mode 100644 src/views/eam/equipmentInspectionDetail/equipmentInspectionDetail.data.ts create mode 100644 src/views/eam/equipmentInspectionDetail/index.vue create mode 100644 src/views/eam/equipmentInspectionMain/InspectionOrderDetail.vue create mode 100644 src/views/eam/equipmentInspectionMain/finishForm1.vue create mode 100644 src/views/eam/equipmentInspectionMain/finishForm2.vue diff --git a/src/api/eam/equipmentInspectionDetail/index.ts b/src/api/eam/equipmentInspectionDetail/index.ts new file mode 100644 index 000000000..2381178c3 --- /dev/null +++ b/src/api/eam/equipmentInspectionDetail/index.ts @@ -0,0 +1,60 @@ +import request from '@/config/axios' + +export interface EquipmentInspectionDetailVO { + id: number + number: string + masterId: number + completionTime: Date + uncompletedCause: string + result: string + name: string + content: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询巡检工单子列表 +export const getEquipmentInspectionDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/equipment-inspection-detail/senior', data }) + } else { + return await request.get({ url: `/eam/equipment-inspection-detail/page`, params }) + } +} + +// 查询巡检工单子详情 +export const getEquipmentInspectionDetail = async (id: number) => { + return await request.get({ url: `/eam/equipment-inspection-detail/get?id=` + id }) +} + +// 新增巡检工单子 +export const createEquipmentInspectionDetail = async (data: EquipmentInspectionDetailVO) => { + return await request.post({ url: `/eam/equipment-inspection-detail/create`, data }) +} + +// 修改巡检工单子 +export const updateEquipmentInspectionDetail = async (data: EquipmentInspectionDetailVO) => { + return await request.put({ url: `/eam/equipment-inspection-detail/update`, data }) +} + +// 删除巡检工单子 +export const deleteEquipmentInspectionDetail = async (id: number) => { + return await request.delete({ url: `/eam/equipment-inspection-detail/delete?id=` + id }) +} + +// 导出巡检工单子 Excel +export const exportEquipmentInspectionDetail = async (params) => { + return await request.download({ url: `/eam/equipment-inspection-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/equipment-inspection-detail/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/eam/equipmentInspectionMain/index.ts b/src/api/eam/equipmentInspectionMain/index.ts index 80732677f..5ea08a095 100644 --- a/src/api/eam/equipmentInspectionMain/index.ts +++ b/src/api/eam/equipmentInspectionMain/index.ts @@ -1,4 +1,6 @@ import request from '@/config/axios' +import {EquipmentMainPartVO} from "@/api/eam/equipmentMainPart"; +import {EquipmentMaintenanceMainVO} from "@/api/eam/equipmentMaintenanceMain"; export interface EquipmentInspectionMainVO { id: number @@ -66,6 +68,11 @@ export const updateEquipmentInspectionMain = async (data: EquipmentInspectionMai return await request.put({ url: `/eam/equipment-inspection-main/update`, data }) } +// 修改巡检工单主 +export const updateEquipmentInspection = async (data: EquipmentInspectionMainVO) => { + return await request.post({ url: `/eam/equipment-inspection-main/updateOrders`, data }) +} + // 删除巡检工单主 export const deleteEquipmentInspectionMain = async (id: number) => { return await request.delete({ url: `/eam/equipment-inspection-main/delete?id=` + id }) @@ -79,4 +86,19 @@ export const exportEquipmentInspectionMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/equipment-inspection-main/get-import-template' }) -} \ No newline at end of file +} + +// 修改保养工单状态 +export const updateEquipmentInspectionOrder = async (data: EquipmentInspectionMainVO) => { + return await request.post({ url: `/eam/equipment-inspection-main/updateOrder`, data }) +} + +//完成保养工单 +export const executeEquipmentInspectionOrder = async (data: EquipmentInspectionMainVO) => { + return await request.post({ url: `/eam/equipment-inspection-main/execute`, data }) +} + +//验证不通过,打回保养工单 +export const backEquipmentInspectionOrder = async (data: EquipmentInspectionMainVO) => { + return await request.post({ url: `/eam/equipment-inspection-main/fallback`, data }) +} diff --git a/src/api/eam/relationInspectionPlanItem/index.ts b/src/api/eam/relationInspectionPlanItem/index.ts new file mode 100644 index 000000000..08f78637e --- /dev/null +++ b/src/api/eam/relationInspectionPlanItem/index.ts @@ -0,0 +1,57 @@ +import request from '@/config/axios' + +export interface RelationInspectionPlanItemVO { + id: number + planNumber: string + itemCode: string + itemName: string + isSelectd: boolean + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询巡检计划和巡检项关系列表 +export const getRelationInspectionPlanItemPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/relation-inspection-plan-item/senior', data }) + } else { + return await request.get({ url: `/eam/relation-inspection-plan-item/page`, params }) + } +} + +// 查询巡检计划和巡检项关系详情 +export const getRelationInspectionPlanItem = async (id: number) => { + return await request.get({ url: `/eam/relation-inspection-plan-item/get?id=` + id }) +} + +// 新增巡检计划和巡检项关系 +export const createRelationInspectionPlanItem = async (data: RelationInspectionPlanItemVO) => { + return await request.post({ url: `/eam/relation-inspection-plan-item/create`, data }) +} + +// 修改巡检计划和巡检项关系 +export const updateRelationInspectionPlanItem = async (data: RelationInspectionPlanItemVO) => { + return await request.put({ url: `/eam/relation-inspection-plan-item/update`, data }) +} + +// 删除巡检计划和巡检项关系 +export const deleteRelationInspectionPlanItem = async (id: number) => { + return await request.delete({ url: `/eam/relation-inspection-plan-item/delete?id=` + id }) +} + +// 导出巡检计划和巡检项关系 Excel +export const exportRelationInspectionPlanItem = async (params) => { + return await request.download({ url: `/eam/relation-inspection-plan-item/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/relation-inspection-plan-item/get-import-template' }) +} \ No newline at end of file diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 8a459e4bd..993ce93a2 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -364,6 +364,9 @@ export enum DICT_TYPE { EAM_MAINTENANCE_SOURCES = 'eam_maintenance_sources', // 维保数据来源 EAM_MAINTENANCE_URGENCY = 'eam_maintenance_urgency', // 维保紧急程度 EAM_MAINTENANCE_LEVEL = 'eam_maintenance_level', // 维保维修级别 + EAM_INSPECTION_SOURCES = 'eam_inspection_sources', // 巡检工单数据来源 + EAM_SPOTCHECK_SOURCES = 'eam_spotcheck_sources', // 点检工单数据来源 + EAM_BAOYANG_SOURCES = 'eam_baoyang_sources', // 保养工单数据来源 EAM_REPAIR_STATUS = 'eam_repair_status', // 维修状态 EAM_COMPLETE_RESULT = 'eam_complete_result', // 维修状态 OFF_BACK_STATUS = 'off_back_status', diff --git a/src/views/eam/equipmentInspectionDetail/equipmentInspectionDetail.data.ts b/src/views/eam/equipmentInspectionDetail/equipmentInspectionDetail.data.ts new file mode 100644 index 000000000..9ae61c6b6 --- /dev/null +++ b/src/views/eam/equipmentInspectionDetail/equipmentInspectionDetail.data.ts @@ -0,0 +1,232 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as ItemApi from "@/api/eam/relationInspectionPlanItem"; +import { + RelationInspectionPlanItem +} from "@/views/eam/equipmentInspectionMain/equipmentInspectionMain.data"; + +// 表单校验 +export const EquipmentInspectionDetailRules = reactive({ + number: [required], + masterId: [required], + name: [required], + uncompletedCause:[{ + required:false , + message:'该项为必填项', + tagger:['blur','change'] + }], + result: [ + { + required:false , + message:'该项为必填项', + tagger:['blur'] + }], +}) + +export const EquipmentInspectionDetail = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '巡检工单号', + field: 'number', + sort: 'custom', + isSearch: true, + form:{ + componentProps: { + disabled: true + } + } + }, + { + label: '主表id', + field: 'masterId', + sort: 'custom', + isSearch: true, + form:{ + componentProps: { + disabled: true + } + } + }, + { + label: '完成时间', + field: 'completionTime', + 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')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '未完成原因', + field: 'uncompletedCause', + sort: 'custom', + isSearch: true, + }, + { + label: '结果枚举', + field: 'result', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.IS_COMPLETED, + dictClass: 'string', + }, + { + label: '巡检项名称', + field: 'name', + sort: 'custom', + isSearch: true, + isForm: true, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择 非必选巡检项', + searchTitle: '非必选巡检项信息', // 查询弹窗标题 + searchAllSchemas: RelationInspectionPlanItem.allSchemas, // 查询弹窗所需类 + searchField: 'itemName', // 查询弹窗赋值字段 + searchPage: ItemApi.getRelationInspectionPlanItemPage, // 查询弹窗所需分页方法 + searchCondition: [] + } + } + }, + // { + // label: '巡检内容', + // field: 'content', + // sort: 'custom', + // isSearch: true, + // form: { + // componentProps: { + // type:"textarea", + // maxlength:"100" + // } + // } + // }, + { + 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: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '地点ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '是否可用默认TRUE', + field: 'available', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail: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/equipmentInspectionDetail/index.vue b/src/views/eam/equipmentInspectionDetail/index.vue new file mode 100644 index 000000000..b90cb77e2 --- /dev/null +++ b/src/views/eam/equipmentInspectionDetail/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/eam/equipmentInspectionMain/InspectionOrderDetail.vue b/src/views/eam/equipmentInspectionMain/InspectionOrderDetail.vue new file mode 100644 index 000000000..de0513971 --- /dev/null +++ b/src/views/eam/equipmentInspectionMain/InspectionOrderDetail.vue @@ -0,0 +1,1055 @@ + + + + + diff --git a/src/views/eam/equipmentInspectionMain/equipmentInspectionMain.data.ts b/src/views/eam/equipmentInspectionMain/equipmentInspectionMain.data.ts index 285f462e7..8c84665ed 100644 --- a/src/views/eam/equipmentInspectionMain/equipmentInspectionMain.data.ts +++ b/src/views/eam/equipmentInspectionMain/equipmentInspectionMain.data.ts @@ -4,6 +4,8 @@ import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data"; import * as WorkshopApi from "@/api/wms/workshop"; +import {BasicFaultType} from "@/views/eam/basicFaultType/basicFaultType.data"; +import * as BasicFaultTypeApi from "@/api/eam/basicFaultType"; // 表单校验 export const EquipmentInspectionMainRules = reactive({ @@ -38,6 +40,8 @@ export const EquipmentInspectionMain = useCrudSchemas(reactive([ label: '来源字典', field: 'sources', sort: 'custom', + dictType: DICT_TYPE.EAM_INSPECTION_SOURCES, + dictClass: 'string', isSearch: false, }, { @@ -232,6 +236,12 @@ export const EquipmentInspectionMain = useCrudSchemas(reactive([ sort: 'custom', isSearch: false, }, + { + label: '巡检人电话', + field: 'maintenancePhone', + sort: 'custom', + isSearch: false, + }, { label: '完成时间', field: 'completionTime', @@ -321,16 +331,31 @@ export const EquipmentInspectionMain = useCrudSchemas(reactive([ label: '故障类型枚举', field: 'faultType', sort: 'custom', - dictType: DICT_TYPE.FAILURE_REASON, - dictClass: 'string', isSearch: true, - isSearch: false, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择故障类型', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '故障类型信息', // 查询弹窗标题 + searchAllSchemas: BasicFaultType.allSchemas, // 查询弹窗所需类 + searchPage: BasicFaultTypeApi.getBasicFaultTypePage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + }, }, { label: '所属厂区编号', field: 'factoryAreaCode', sort: 'custom', isSearch: false, + isTable: false, + isForm: false, + isDetail:false, }, { label: '车间编号', @@ -494,3 +519,160 @@ export const EquipmentInspectionMain = useCrudSchemas(reactive([ } } ])) + +// 表单校验 +export const RelationInspectionPlanItemRules = reactive({ + planNumber: [required], + itemCode: [required], + itemName: [required], + concurrencyStamp: [required], +}) + +export const RelationInspectionPlanItem = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '计划编号', + field: 'planNumber', + sort: 'custom', + isSearch: true, + }, + { + label: '项编号', + field: 'itemCode', + sort: 'custom', + isSearch: true, + }, + { + label: '巡检项名称', + field: 'itemName', + sort: 'custom', + isSearch: true, + }, + { + label: '是否必选', + field: 'isSelectd', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.FALSE_OR_TRUE, + dictClass: 'string', + }, + { + 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, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '地点ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '是否可用默认TRUE', + field: 'available', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail: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/equipmentInspectionMain/finishForm1.vue b/src/views/eam/equipmentInspectionMain/finishForm1.vue new file mode 100644 index 000000000..408be1c53 --- /dev/null +++ b/src/views/eam/equipmentInspectionMain/finishForm1.vue @@ -0,0 +1,143 @@ + + + + diff --git a/src/views/eam/equipmentInspectionMain/finishForm2.vue b/src/views/eam/equipmentInspectionMain/finishForm2.vue new file mode 100644 index 000000000..7e1d975c7 --- /dev/null +++ b/src/views/eam/equipmentInspectionMain/finishForm2.vue @@ -0,0 +1,150 @@ + + + + diff --git a/src/views/eam/equipmentInspectionMain/index.vue b/src/views/eam/equipmentInspectionMain/index.vue index 8f3d48364..1f5982cf0 100644 --- a/src/views/eam/equipmentInspectionMain/index.vue +++ b/src/views/eam/equipmentInspectionMain/index.vue @@ -33,7 +33,7 @@ @@ -48,10 +48,31 @@ :apiCreate="EquipmentInspectionMainApi.createEquipmentInspectionMain" @searchTableSuccess="searchTableSuccess" :isBusiness="false" + @onChange="onChange" /> + + + + - + @@ -60,11 +81,25 @@