From f5775367b606f2d802d6f436b4a6090c958d4551 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Mon, 18 Mar 2024 11:17:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=B4=E4=BF=AE=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E4=B8=8D=E6=88=90=E5=8A=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deviceMaintenanceMain.data.ts | 304 +++++++++++++++++- .../eam/device/devicemaintenancejob/index.vue | 40 ++- .../moldMaintenanceMain.data.ts | 245 +++++++++++++- 3 files changed, 562 insertions(+), 27 deletions(-) diff --git a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts index 03f0284..3bc9fb2 100644 --- a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts @@ -50,22 +50,6 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ isSearch: false, isTable: true, }, - { - label: '转办类型', - field: 'turnType', - sort: 'custom', - isDetail: false, - isTable: false, - isSearch: false, - isForm: true, - dictType: DICT_TYPE.TURN_TYPE, - dictClass: 'string', - form: { - component: 'Select', - componentProps: { - } - } - }, { label: '设备模具编号', field: 'deviceNumber', @@ -469,4 +453,290 @@ export const DeviceMaintenanceDetailRules = reactive({ { max: 200, message: '不得超过200个字符', trigger: 'blur' }, ], maintenances: [required], -}) \ No newline at end of file +}) + + + +// 表单校验 +export const DeviceMaintenanceMainSecRules = reactive({ + number: [required], + requestNumber: [required], + deviceNumber: [required], + factoryAreaNumber: [required], + maintenance: [required], + type: [required], + classes: [required], + faultType: [required], + describes : [ + required, + { max: 200, message: '不得超过200个字符', trigger: 'blur' }, + ], +}) + +export const DeviceMaintenanceMainSec = useCrudSchemas(reactive([ + { + label: '维修工单编号', + field: 'number', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isForm: false, + }, + { + label: '报修工单编号', + field: 'requestNumber', + sort: 'custom', + table: { + width: '150', + }, + isForm: false, + isSearch: false, + isTable: true, + }, + { + label: '转办类型', + field: 'turnType', + sort: 'custom', + isDetail: false, + isTable: false, + isSearch: false, + isForm: true, + dictType: DICT_TYPE.TURN_TYPE, + dictClass: 'string', + form: { + component: 'Select', + value: 0, + } + }, + { + label: '设备模具编号', + field: 'deviceNumber', + sort: 'custom', + table: { + width: '150', + }, + api: () => deviceList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return deviceList.find((account) => account.number == cellValue)?.name + }, + search: { + show: false, + component: 'Input', + api: () => deviceList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'number' + } + } + }, + form: { + component: 'Select', + api: () => deviceList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + }, + } + }, + { + label: '厂区编号', + field: 'factoryAreaNumber', + sort: 'custom', + isDetail: false, + table: { + width: '150', + }, + api: () => factoryList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return factoryList.find((account) => account.id == cellValue)?.name + }, + search: { + show: true, + component: 'Select', + api: () => factoryList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + } + }, + form: { + component: 'Select', + api: () => factoryList, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + placeholder: "请先选择设备" + }, + } + }, + { + label: '厂区编号', + field: 'factoryAreaNumber1', + sort: 'custom', + isDetail: true, + isSearch: false, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '维修人', + field: 'maintenance', + sort: 'custom', + isDetail: false, + table: { + width: '150', + }, + api: () => userListAll, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userListAll.find((account) => account.id == cellValue)?.nickname + }, + form: { + component: 'Select', + api: () => userListAll, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + placeholder: "请先选择设备" + }, + } + }, + { + label: '维修人', + field: 'maintenance1', + sort: 'custom', + isDetail: true, + isSearch: false, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '类型', + field: 'type', + sort: 'custom', + table: { + width: '150', + }, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return deviceMoldTypeList.find((account) => account.value == cellValue)?.label + }, + isSearch: true, + search: { + component: 'Select', + componentProps: { + options: deviceTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + }, + }, + form: { + component: 'Select', + componentProps: { + options: deviceTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + placeholder: "请选择设备" + } + }, + }, + { + label: '班次', + field: 'classes', + sort: 'custom', + table: { + width: '150', + }, + isSearch: true, + dictType: DICT_TYPE.MAINTENANCE_SHIFT, + dictClass: 'number', + form: { + component: 'Select' + }, + }, + { + label: '故障类型', + field: 'faultType', + sort: 'custom', + table: { + width: '150', + }, + isSearch: true, + dictType: DICT_TYPE.FAULT_TYPE, + dictClass: 'string', + form: { + component: 'Select' + }, + }, + { + label: '描述', + field: 'describes', + sort: 'custom', + table: { + width: '150', + }, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + } + + }, + }, + { + label: '是否完成', + field: 'status', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isTable: true, + isForm: false, + dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, + dictClass: 'string', + form: { + component: 'Select', + componentProps: { + disabled: false, + } + }, + tableForm: { + type: 'Select', + componentProps: { + disabled: false, + } + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 300, + fixed: 'right' + }, + isDetail:false + } +])) \ No newline at end of file diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index 70a38d5..37876ee 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -64,6 +64,26 @@ @success="submitForm" :isSearchTableItem="true" /> + + + @@ -113,7 +133,9 @@ import { DeviceMaintenanceMain, DeviceMaintenanceMainRules, DeviceMaintenanceDetail, - DeviceMaintenanceDetailRules + DeviceMaintenanceDetailRules, + DeviceMaintenanceMainSec, + DeviceMaintenanceMainSecRules, } from './deviceMaintenanceMain.data' import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' import * as DeviceMaintenanceDetailApi from '@/api/eam/device/deviceMaintenanceDetail' @@ -130,6 +152,7 @@ const userStore = useUserStore() // 用户信息 const route = useRoute() // 路由信息 const routeName = ref() const formRef = ref() +const formRefSec = ref() routeName.value = route.name const tableColumns = ref(DeviceMaintenanceMain.allSchemas.tableColumns) const tableData = ref([]) @@ -295,14 +318,8 @@ const buttonTableClick = async (val, row) => { } else if (val == 'repair') { openDetail(row, '代码', row.number) } else if (val == 'turnOrder') { - DeviceMaintenanceMain.allSchemas.formSchema.find(item => { - return item.field == 'turnType' - }).show = true - DeviceMaintenanceMain.allSchemas.formSchema.find(item => { - return item.field == 'type' - }).componentProps.options = deviceMoldTypeList - openForm('turnOrder', row) - } else if (val == 'finish') { + openFormSec('turnOrder', row) + } else if (val == 'finishOrder') { finishOrder(row) } else if (val == 'verifyOrder') { verifyOrder(row) @@ -317,8 +334,13 @@ const buttonTableClick = async (val, row) => { const openForm = (type: string, row?: any) => { tableData.value = [] // 重置明细数据 + debugger formRef.value.open(type, row) } +const openFormSec = (type: string, row?: any) => { + tableData.value = [] // 重置明细数据 + formRefSec.value.open(type, row) +} /** 详情操作 */ const detailRef = ref() diff --git a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts index 173f448..a3ef9d9 100644 --- a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts +++ b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts @@ -364,4 +364,247 @@ export const MoldMaintenanceDetailRules = reactive({ workOut: [required], maintenance: [required], itemNumbers: [required], -}) \ No newline at end of file +}) + + +// 表单校验 +export const MoldMaintenanceMainSecRules = reactive({ + number: [required], + requestNumber: [required], + deviceNumber: [required], + factoryAreaNumber: [required], + maintenance: [required], + type: [required], + classes: [required], + faultType: [required], + describes : [required], +}) + + +export const MoldMaintenanceMainSec = useCrudSchemas(reactive([ + { + label: '维修工单编号', + field: 'number', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isForm: false, + }, + { + label: '报修工单编号', + field: 'requestNumber', + sort: 'custom', + table: { + width: '150', + }, + isForm: false, + isSearch: false, + isTable: true, + }, + { + label: '类型', + field: 'type', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isForm: true, + dictType: DICT_TYPE.DEVICE_MOLD_TYPE, + dictClass: 'string', + form: { + component: 'Select', + componentProps: { + disabled: true, + } + }, + search: { + value: 'MOLD' + } + }, + { + label: '转办类型', + field: 'turnType', + sort: 'custom', + isDetail: false, + isTable: false, + isSearch: false, + isForm: true, + dictType: DICT_TYPE.TURN_TYPE, + dictClass: 'string', + form: { + component: 'Select', + componentProps: { + } + } + }, + { + label: '设备模具编号', + field: 'deviceNumber', + sort: 'custom', + table: { + width: '150', + }, + api: () => moldList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return moldList.find((account) => account.number == cellValue)?.name + }, + search: { + show: true, + component: 'Input', + // api: () => moldList, + // componentProps: { + // optionsAlias: { + // labelField: 'name', + // valueField: 'number' + // } + // } + }, + form: { + component: 'Select', + api: () => moldList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + }, + } + }, + { + label: '厂区编号', + field: 'factoryAreaNumber', + sort: 'custom', + table: { + width: '150', + }, + api: () => factoryList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return factoryList.find((account) => account.id == cellValue)?.name + }, + search: { + show: true, + component: 'Select', + api: () => factoryList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + } + }, + form: { + component: 'Select', + api: () => factoryList, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + placeholder: "请先选择设备" + }, + } + }, + { + label: '维修人', + field: 'maintenance', + sort: 'custom', + table: { + width: '150', + }, + isSearch: true, + form: { + component: 'Select', + api: () => userList, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + placeholder: "请先选择模具" + }, + } + }, + + { + label: '班次', + field: 'classes', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + dictType: DICT_TYPE.MAINTENANCE_SHIFT, + dictClass: 'number', + form: { + component: 'Select' + }, + }, + { + label: '故障类型', + field: 'faultType', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + dictType: DICT_TYPE.FAULT_TYPE, + dictClass: 'string', + form: { + component: 'Select' + }, + }, + { + label: '描述', + field: 'describes', + sort: 'custom', + table: { + width: '150', + }, + form: { + component: 'Input', + componentProps:{ + type:'textarea' + } + }, + }, + { + label: '是否完成', + field: 'status', + sort: 'custom', + table: { + width: '150', + }, + isForm: false, + isSearch: false, + isTable: true, + dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, + dictClass: 'string', + form: { + component: 'Select', + componentProps: { + disabled: false, + } + }, + tableForm: { + type: 'Select', + componentProps: { + disabled: false, + } + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 300, + fixed: 'right' + }, + isDetail:false + } +])) \ No newline at end of file