Browse Source

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

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

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

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

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

@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
<template #recordNo="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.recordNo)">
<span>{{ row.recordNo }}</span>
</el-button>
</template>
<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" />
@ -60,7 +70,9 @@
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } from './equipmentMaintenanceRecordMain.data'
import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data'
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain'
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -99,9 +111,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:export'}), //
defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:create'}), //
//defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -133,8 +145,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:delete'}), //
//defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:update'}), //
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:delete'}), //
]
// -

Loading…
Cancel
Save