Browse Source

EAM ——> 保养记录 主子更新

master_hella_20240701
gaojs 6 months ago
parent
commit
5f6d993d84
  1. 383
      src/views/eam/equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data.ts
  2. 30
      src/views/eam/equipmentMaintenanceRecordMain/index.vue

383
src/views/eam/equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data.ts

@ -4,138 +4,229 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const EquipmentMaintenanceRecordMainRules = reactive({ export const EquipmentMaintenanceRecordMainRules = reactive({
number: [required], number: [required],
sources: [required],
equipmentCode: [required], equipmentCode: [required],
planNumber: [required], type: [required],
status: [required], planStartTime: [required],
factoryAreaCode: [required], planEndTime: [required],
concurrencyStamp: [required] startTime: [required],
endTime: [required],
}) })
export const EquipmentMaintenanceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ export const EquipmentMaintenanceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '保养编号', label: 'id',
field: 'number', field: 'id',
sort: 'custom',
isForm: false,
},
{
label: '记录编号',
field: 'recordNo',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
}, },
{ {
label: '描述', label: '描述',
field: 'describing', field: 'describing',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
isSearch: false,
},
{
label: '保养工单',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '来源字典',
field: 'sources',
sort: 'custom',
isSearch: true,
isSearch: false,
}, },
{ {
label: '设备编号', label: '设备编号',
field: 'equipmentCode', field: 'equipmentCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
}, },
{ {
label: '设备类别', label: '故障类型枚举',
field: 'category', field: 'faultType',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true, isSearch: true,
form: { isSearch: false,
component: 'SelectV2'
}
}, },
{ {
label: '班次枚举', label: '工装或设备字典',
field: 'classes', field: 'type',
sort: 'custom', sort: 'custom',
// dictType: DICT_TYPE.SHIFT_TYPE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true, isSearch: true,
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string',
}, },
{ {
label: '保养计划工单', label: '保养计划工单',
field: 'planNumber', field: 'planNumber',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
}, },
{ {
label: '故障类型枚举', label: '计划开始时间',
field: 'faultType', field: 'planStartTime',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.FAILURE_REASON, formatter: dateFormatter,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: false,
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: { form: {
component: 'SelectV2' component: 'DatePicker',
} componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
}, },
{ {
label: '保养周期', label: '计划结束时间',
field: 'cycle', field: 'planEndTime',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.MAINTENANCE_CYCLE, formatter: dateFormatter,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: false,
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: '保养次数', label: '保养开始时间',
field: 'times', field: 'startTime',
sort: 'custom', sort: 'custom',
isSearch: true formatter: dateFormatter,
isSearch: 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: '验证人', label: '保养结束时间',
field: 'verifyer2', field: 'endTime',
sort: 'custom', sort: 'custom',
isSearch: true, formatter: dateFormatter,
isSearch: 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: { form: {
component: 'InputNumber', component: 'DatePicker',
value: 0 componentProps: {
} type: 'datetime',
valueFormat: 'x'
}
},
}, },
{ {
label: '验证内容', label: '保养班组',
field: 'verifyContent2', field: 'classType',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: false,
}, },
{ {
label: '验证时间', label: '验证',
field: 'verifyTime2', field: 'verifyer',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: false,
}, },
{ {
label: '保养人', label: '验证内容',
field: 'maintenancer', field: 'verifyContent',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'InputNumber', component: 'Editor',
value: 0 componentProps: {
} valueHtml: '',
height: 200
}
},
}, },
{ {
label: '保养人联系电话', label: '验证时间',
field: 'maintenancePhone', field: 'verifyTime',
sort: 'custom', sort: 'custom',
isSearch: true formatter: dateFormatter,
isSearch: 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: '结果枚举', label: '保养人id',
field: 'completeResult', field: 'maintenancer',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: false,
}, },
{ {
label: '完成时间', label: '保养人联系电话',
field: 'completionTime2', field: 'maintenancePhone',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: false,
}, },
{ {
label: '保养时间', label: '完成时间',
field: 'maintenanceTime', field: 'completionTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -150,58 +241,172 @@ export const EquipmentMaintenanceRecordMain = useCrudSchemas(reactive<CrudSchema
type: 'datetime', type: 'datetime',
valueFormat: 'x' 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: '流程状态枚举', label: '流程状态',
field: 'status', field: 'status',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true, isSearch: true,
form: { dictType: DICT_TYPE.EAM_ORDER_STATUS,
component: 'Radio' dictClass: 'string',
} },
// {
// label: '自动接单',
// field: 'autoOrder',
// sort: 'custom',
// isSearch: true,
// },
// {
// label: '自动执行',
// field: 'autoPerform',
// sort: 'custom',
// isSearch: true,
// },
// {
// label: '自动验证',
// field: 'autoVerify',
// sort: 'custom',
// isSearch: true,
// },
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
}, },
{ {
label: '所属厂区编号', label: '所属厂区编号',
field: 'factoryAreaCode', field: 'factoryAreaCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: false,
}, },
{ {
label: '车间编号', label: '车间编号',
field: 'workshopCode', field: 'workshopCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: false,
}, },
{ {
label: '工段编号', label: '创建时间',
field: 'workshopSectionCode', field: 'createTime',
sort: 'custom', sort: 'custom',
isSearch: true formatter: dateFormatter,
isSearch: 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: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
}, },
{ {
label: '是否可用', label: '是否可用默认TRUE',
field: 'available', field: 'available',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, isSearch: false,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isTable: false,
isSearch: true, 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: { form: {
component: 'Switch', component: 'DatePicker',
value: 'TRUE',
componentProps: { componentProps: {
inactiveValue: 'FALSE', type: 'datetime',
activeValue: 'TRUE' 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: '操作', label: '操作',

30
src/views/eam/equipmentMaintenanceRecordMain/index.vue

@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #recordNo="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.recordNo)">
<span>{{ row.code }}</span> <span>{{ row.recordNo }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
@ -51,7 +51,17 @@
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentMaintenanceRecordMain.allSchemas" /> <Detail ref="detailRef"
:isBasic="false"
:allSchemas="EquipmentMaintenanceRecordMain.allSchemas"
:detailAllSchemasRules="EquipmentMaintenanceRecordDetailRules"
:detailAllSchemas="EquipmentMaintenanceRecordDetail.allSchemas"
:apiPage="EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage"
:detailButtonIsShowAdd=false
:detailButtonIsShowEdit=false
:detailButtonIsShowDelete=false
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-maintenance-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/eam/equipment-maintenance-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -60,7 +70,9 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } from './equipmentMaintenanceRecordMain.data' import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } from './equipmentMaintenanceRecordMain.data'
import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data'
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain' import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain'
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -99,9 +111,9 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:create'}), // defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:import'}), // //defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:export'}), // defaultButtons.defaultExportBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -133,8 +145,8 @@ const buttonBaseClick = (val, item) => {
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:update'}), // //defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:delete'}), // //defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:delete'}), //
] ]
// - // -

Loading…
Cancel
Save