Browse Source

EAM ——> 定时任务 生成保养计划 保养工单

master_hella_20240701
gaojs 6 months ago
parent
commit
15a80b17b4
  1. 34
      src/api/eam/maintenance/index.ts
  2. 4
      src/views/eam/basicMaintenanceOption/basicMaintenanceOption.data.ts
  3. 4
      src/views/eam/maintenance/index.vue
  4. 127
      src/views/eam/maintenance/maintenance.data.ts
  5. 9
      src/views/eam/maintenanceItem/maintenanceItem.data.ts

34
src/api/eam/maintenance/index.ts

@ -4,14 +4,20 @@ import {InspectionItemSelectSetVO} from "@/api/eam/inspectionItemSelectSet";
export interface MaintenanceVO {
id: number
number: string
describing: string
name: string
equipmentCode: string
type: string
optionCode: string
cycle: string
classes: string
peoples: number
estimatedMinutes: number
startTime: Date
endTime: Date
status: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
factoryAreaCode: string
workshopCode: string
workshopSectionCode: string
@ -29,43 +35,43 @@ export const getMaintenancePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/basic/maintenance/senior', data })
return await request.post({ url: '/eam/maintenance/senior', data })
} else {
return await request.get({ url: `/eam/basic/maintenance/page`, params })
return await request.get({ url: `/eam/maintenance/page`, params })
}
}
// 查询保养计划详情
export const getMaintenance = async (id: number) => {
return await request.get({ url: `/eam/basic/maintenance/get?id=` + id })
return await request.get({ url: `/eam/maintenance/get?id=` + id })
}
// 新增保养计划
export const createMaintenance = async (data: MaintenanceVO) => {
return await request.post({ url: `/eam/basic/maintenance/create`, data })
return await request.post({ url: `/eam/maintenance/create`, data })
}
// 修改保养计划
export const updateMaintenance = async (data: MaintenanceVO) => {
return await request.put({ url: `/eam/basic/maintenance/update`, data })
return await request.put({ url: `/eam/maintenance/update`, data })
}
// 删除保养计划
export const deleteMaintenance = async (id: number) => {
return await request.delete({ url: `/eam/basic/maintenance/delete?id=` + id })
return await request.delete({ url: `/eam/maintenance/delete?id=` + id })
}
// 导出保养计划 Excel
export const exportMaintenance = async (params) => {
return await request.download({ url: `/eam/basic/maintenance/export-excel`, params })
return await request.download({ url: `/eam/maintenance/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/basic/maintenance/get-import-template' })
return request.download({ url: '/eam/maintenance/get-import-template' })
}
// 启用 / 禁用
export const updateEnableCode = async (data: InspectionItemSelectSetVO) => {
return await request.post({ url: `/eam/basic/maintenance/ables` , data })
export const updateEnableCode = async (data: MaintenanceVO) => {
return await request.post({ url: `/eam/maintenance/ables` , data })
}

4
src/views/eam/basicMaintenanceOption/basicMaintenanceOption.data.ts

@ -36,7 +36,7 @@ export const BasicMaintenanceOption = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
},
{
label: '选择集',
label: '选择集ID',
field: 'selectId',
sort: 'custom',
isDetail: true,
@ -45,7 +45,7 @@ export const BasicMaintenanceOption = useCrudSchemas(reactive<CrudSchema[]>([
isSearchList: true, // 开启查询弹窗
searchTitle: '保养选择集信息', // 查询弹窗标题
searchAllSchemas: BasicMaintenanceItemSelectSet.allSchemas, // 查询弹窗所需类
searchField: 'name', // 查询弹窗赋值字段
searchField: 'id', // 查询弹窗赋值字段
searchPage: ItemApi.getBasicMaintenanceItemSelectSetPage, // 查询弹窗所需分页方法
multiple:true,
searchCondition: [{

4
src/views/eam/maintenance/index.vue

@ -66,9 +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 { ToolAccounts } from "@/views/eam/toolAccounts/ToolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts";
defineOptions({ name: 'Maintenance' })
@ -322,3 +323,4 @@ onMounted(async () => {
})
</script>

127
src/views/eam/maintenance/maintenance.data.ts

@ -1,15 +1,17 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
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({
number: [required],
name: [required],
equipmentCode: [required],
optionCode: [required],
factoryAreaCode: [required],
concurrencyStamp: [required],
cycle: [required],
startTime: [required],
endTime: [required],
})
export const Maintenance = useCrudSchemas(reactive<CrudSchema[]>([
@ -29,8 +31,8 @@ export const Maintenance = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
},
{
label: '描述',
field: 'describing',
label: '计划名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
@ -43,7 +45,7 @@ export const Maintenance = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
},
{
label: '设备编号',
label: '设备工装编号',
field: 'equipmentCode',
sort: 'custom',
isSearch: true,
@ -82,30 +84,114 @@ export const Maintenance = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
},
{
label: '班次',
field: 'classes',
label: '计划开始时间',
field: 'startTime',
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: 'peoples',
label: '计划结束时间',
field: 'endTime',
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: 'InputNumber',
value: 0
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '预计所需时间',
field: 'estimatedMinutes',
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: true,
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
},
},
{
label: '审核时间',
field: 'approveTime',
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: 'autoExamine',
sort: 'custom',
isSearch: true,
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: true,
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: true,
},
{
label: '所属厂区编号',
@ -130,10 +216,7 @@ export const Maintenance = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
@ -157,7 +240,7 @@ export const Maintenance = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isSearch: true,
},
{
label: '地点ID',

9
src/views/eam/maintenanceItem/maintenanceItem.data.ts

@ -1,5 +1,4 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { handleTreeToComponentOptions } from '@/utils/tree'
import * as DeptApi from '@/api/system/dept'
const deptList = ref<Tree[]>([]) // 树形结构
@ -27,7 +26,13 @@ export const MaintenanceItem = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '保养内容',
label: '保养名称',
field: 'name',
sort: 'custom',
isSearch: true
},
{
label: '保养要求',
field: 'content',
sort: 'custom',
isSearch: true,

Loading…
Cancel
Save