diff --git a/src/api/eam/equipmentMaintenanceMain/index.ts b/src/api/eam/equipmentMaintenanceMain/index.ts new file mode 100644 index 000000000..835e6bff0 --- /dev/null +++ b/src/api/eam/equipmentMaintenanceMain/index.ts @@ -0,0 +1,74 @@ +import request from '@/config/axios' + +export interface EquipmentMaintenanceMainVO { + id: number + number: string + describing: string + equipmentCode: string + type: string + classes: string + planNumber: string + faultType: string + cycle: string + times: string + verifyer: number + verifyContent: string + verifyTime: Date + maintenancer: number + maintenancePhone: string + completeResult: string + completionTime: Date + maintenanceTime: Date + status: string + factoryAreaCode: string + workshopCode: string + workshopSectionCode: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询设备保养工单主列表 +export const getEquipmentMaintenanceMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/equipment-maintenance-main/senior', data }) + } else { + return await request.get({ url: `/eam/equipment-maintenance-main/page`, params }) + } +} + +// 查询设备保养工单主详情 +export const getEquipmentMaintenanceMain = async (id: number) => { + return await request.get({ url: `/eam/equipment-maintenance-main/get?id=` + id }) +} + +// 新增设备保养工单主 +export const createEquipmentMaintenanceMain = async (data: EquipmentMaintenanceMainVO) => { + return await request.post({ url: `/eam/equipment-maintenance-main/create`, data }) +} + +// 修改设备保养工单主 +export const updateEquipmentMaintenanceMain = async (data: EquipmentMaintenanceMainVO) => { + return await request.put({ url: `/eam/equipment-maintenance-main/update`, data }) +} + +// 删除设备保养工单主 +export const deleteEquipmentMaintenanceMain = async (id: number) => { + return await request.delete({ url: `/eam/equipment-maintenance-main/delete?id=` + id }) +} + +// 导出设备保养工单主 Excel +export const exportEquipmentMaintenanceMain = async (params) => { + return await request.download({ url: `/eam/equipment-maintenance-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/equipment-maintenance-main/get-import-template' }) +} \ No newline at end of file diff --git a/src/components/rowDrop/index.vue b/src/components/rowDrop/index.vue index 73363f566..8ceae3d64 100644 --- a/src/components/rowDrop/index.vue +++ b/src/components/rowDrop/index.vue @@ -153,7 +153,7 @@ const initSelectSta = () => { if (item.field != 'action') { checkedDataList.value.push(item.label) _showTableColumns.push(_myTableColumns.find(myItem => (myItem.label == item.label))) - allData.value.push(t(`ts.${item.label}`)) + allData.value.push(t(`ts.${item.label}`).replace('ts.','')) } } }) @@ -165,7 +165,7 @@ const initSelectSta = () => { if (!myTableItem.fixed) { if (myTableItem.field != 'action') { if (allData.value.indexOf(myTableItem.label) == -1) { - allData.value.push(t(`ts.${myTableItem.label}`)) + allData.value.push(t(`ts.${myTableItem.label}`).replace('ts.','')) } } } @@ -195,7 +195,7 @@ const initSelectSta = () => { if (!item.fixed) { if (item.field != 'action') { checkedDataList.value.push(item.label) - allData.value.push(t(`ts.${item.label}`)) + allData.value.push(t(`ts.${item.label}`).replace('ts.','')) } } }) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 5a6b94b3f..d828c8d92 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -1086,7 +1086,7 @@ export default { 查看质检报告:'Check the quality inspection report', 长春:'ChangChun', 成都:'ChengDu', - 富维海拉智慧工厂管理平台:'HELLR Smart Factory Management Platform', + 富维海拉智慧工厂管理平台:'HELLA Smart Factory Management Platform', 采购未收货记录:'Purchase unreceived record', 请选择要货计划单号:'Please select the desired shipment tracking number', 大小不超过:'Not more in size', diff --git a/src/main.ts b/src/main.ts index c8c5c34d5..50255e0c3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -74,7 +74,7 @@ const setupAll = async () => { // 多语言相关 const localeStore = useLocaleStore() if(localeStore&&localeStore.currentLocale&&localeStore.currentLocale.lang.indexOf('en')>-1&&document.querySelector('#app-loading-title')){ - document.querySelector('#app-loading-title').innerHTML = 'HELLR Smart Factory Management Platform' // 富维海拉智慧工厂管理平台 + document.querySelector('#app-loading-title').innerHTML = 'HELLA Smart Factory Management Platform' // 富维海拉智慧工厂管理平台 } setupAll() diff --git a/src/utils/dict.ts b/src/utils/dict.ts index c3ef09211..320790719 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -348,4 +348,5 @@ export enum DICT_TYPE { SUBJECT = 'subject', //科目 REGION = 'region', //区域 PART_CLASS = 'part_class', //备件分类 -} \ No newline at end of file + MAINTENANCE_CYCLE ='maintenance_cycle' // 保养周期 +} diff --git a/src/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data.ts b/src/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data.ts new file mode 100644 index 000000000..b324fe9e1 --- /dev/null +++ b/src/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data.ts @@ -0,0 +1,318 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const EquipmentMaintenanceMainRules = reactive({ + number: [required], + equipmentCode: [required], + planNumber: [required], + status: [required], + factoryAreaCode: [required], + concurrencyStamp: [required], +}) + +export const EquipmentMaintenanceMain = 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: 'classes', + sort: 'custom', + isSearch: true, + }, + { + label: '保养计划工单号', + field: 'planNumber', + sort: 'custom', + isSearch: true, + }, + { + label: '故障类型枚举', + field: 'faultType', + sort: 'custom', + isSearch: true, + }, + { + label: '保养周期', + field: 'cycle', + sort: 'custom', + isSearch: true, + }, + { + label: '保养次数', + field: 'times', + sort: 'custom', + isSearch: true, + }, + { + label: '验证人', + field: 'verifyer', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '验证内容', + field: 'verifyContent', + sort: 'custom', + isSearch: true, + form: { + component: 'Editor', + componentProps: { + valueHtml: '', + height: 200 + } + }, + }, + { + label: '验证时间', + field: 'verifyTime', + 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: '保养人id', + field: 'maintenancer', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '保养人联系电话', + field: 'maintenancePhone', + sort: 'custom', + isSearch: true, + }, + { + label: '结果枚举临时措施、完成', + field: 'completeResult', + sort: 'custom', + isSearch: 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: 'maintenanceTime', + 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: 'status', + sort: 'custom', + isSearch: true, + form: { + component: 'Radio' + }, + }, + { + 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: 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: '是否可用默认TRUE', + field: 'available', + sort: 'custom', + isSearch: true, + }, + { + 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/equipmentMaintenanceMain/index.vue b/src/views/eam/equipmentMaintenanceMain/index.vue new file mode 100644 index 000000000..248f1de3f --- /dev/null +++ b/src/views/eam/equipmentMaintenanceMain/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/eam/maintenance/index.vue b/src/views/eam/maintenance/index.vue index 9409b27b2..2c4ff5eb7 100644 --- a/src/views/eam/maintenance/index.vue +++ b/src/views/eam/maintenance/index.vue @@ -48,6 +48,7 @@ :apiCreate="MaintenanceApi.createMaintenance" @searchTableSuccess="searchTableSuccess" :isBusiness="false" + @onChange="onChange" /> @@ -65,7 +66,10 @@ 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 * as BasicInspectionOptionApi from "@/api/eam/basicInspectionOption"; +import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data"; +import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; +import { ToolAccounts } from "@/views/eam/toolAccounts/ToolAccounts.data"; +import * as ToolItemApi from "@/api/eam/toolAccounts"; defineOptions({ name: 'Maintenance' }) @@ -243,6 +247,35 @@ const handleDisable = async (id: number) => { } catch {} } +const onChange = (field, item) => { + console.log(field) + console.log(item) + //设备 + if(field == 'type' && item == 'DEVICE'){ + Maintenance.allSchemas.formSchema.forEach((items) => { + if (items.field == 'equipmentCode') { + basicFormRef.value.formRef.setValues({ + equipmentCode:'' + }) + items.componentProps.searchAllSchemas = EquipmentAccounts.allSchemas + items.componentProps.searchPage = EquipmentItemApi.getEquipmentAccountsPage + } + }) + } + //工装 + if(field == 'type' && item == 'EQUIPMENT'){ + Maintenance.allSchemas.formSchema.forEach((items) => { + if (items.field == 'equipmentCode') { + basicFormRef.value.formRef.setValues({ + equipmentCode:'' + }) + items.componentProps.searchAllSchemas = ToolAccounts.allSchemas + items.componentProps.searchPage = ToolItemApi.getToolAccountsPage + } + }) + } +} + /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => { diff --git a/src/views/eam/maintenance/maintenance.data.ts b/src/views/eam/maintenance/maintenance.data.ts index d8eacab32..a75cc0886 100644 --- a/src/views/eam/maintenance/maintenance.data.ts +++ b/src/views/eam/maintenance/maintenance.data.ts @@ -1,5 +1,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' +import { EquipmentAccounts } from "@/views/eam/equipmentAccounts/equipmentAccounts.data"; +import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; // 表单校验 export const MaintenanceRules = reactive({ @@ -33,16 +35,37 @@ export const Maintenance = useCrudSchemas(reactive([ isSearch: true, }, { - label: '设备编号', - field: 'equipmentCode', + label: '设备类别', + field: 'type', + dictType: DICT_TYPE.DEVICE_TYPE, + dictClass: 'string', sort: 'custom', isSearch: true, }, { - label: '设备类别枚举', - field: 'type', + label: '设备编号', + field: 'equipmentCode', sort: 'custom', isSearch: true, + isForm: true, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchTitle: '设备信息', // 查询弹窗标题 + searchListPlaceholder: '请选择 设备编号', // 输入框占位文本 + searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类 + searchField: 'code', // 查询弹窗赋值字段 + searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法 + multiple:true, + searchCondition: [{ + key: 'status', + value: 'NORMAL', + action: '==', + isSearch: true, + isMainValue: false + }] + } + } }, { label: '方案编号', @@ -53,6 +76,8 @@ export const Maintenance = useCrudSchemas(reactive([ { label: '周期', field: 'cycle', + dictType: DICT_TYPE.MAINTENANCE_CYCLE, + dictClass: 'string', sort: 'custom', isSearch: true, }, diff --git a/src/views/wms/basicDataManage/labelManage/locationLabel/index.vue b/src/views/wms/basicDataManage/labelManage/locationLabel/index.vue index 1081eec14..04ec8d045 100644 --- a/src/views/wms/basicDataManage/labelManage/locationLabel/index.vue +++ b/src/views/wms/basicDataManage/labelManage/locationLabel/index.vue @@ -16,7 +16,7 @@ -