From 8c4a962208d9654cba3e74e8e30323a6ca432496 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Wed, 31 Jan 2024 21:12:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E5=92=8C=E6=A3=80=E4=BF=AE?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/dict.ts | 1 + src/utils/disposition/defaultButtons.ts | 35 +++- .../deviceInspectionMain.data.ts | 188 ++++++++++++++---- .../eam/device/deviceInspectionMain/index.vue | 103 +++++----- .../deviceMaintenanceMain.data.ts | 42 +++- .../device/deviceMaintenanceMain/index.vue | 91 ++++----- .../device/deviceRepair/deviceRepair.data.ts | 31 ++- src/views/eam/device/deviceRepair/index.vue | 61 ++---- 8 files changed, 343 insertions(+), 209 deletions(-) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 736e193..e1b5b4f 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -282,4 +282,5 @@ export enum DICT_TYPE { CLASS_TYPE = 'class_type', // 班组类型 INVENTORY_ACTION = 'inventory_action', //库存动作 MAINTENANCE_TYPE = 'maintenance_type', //保养类型 + JX_STATUS = 'JX_STATUS', //检修状态 } \ No newline at end of file diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index c1389b1..3354de4 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -814,13 +814,13 @@ export function turnOrderBtn(option:any) { }) } -// 主列表-完成 -export function finishOrderBtn(option:any) { +//主列表-维修 +export function repairBtn(option:any) { return __defaultBtnOption(option,{ - label: '完成', - name: 'finishOrder', + label: '维修', + name: 'repair', hide: false, - type: 'success', + type: 'primary', color: '', link: true, // 文本展现按钮 hasPermi: '' @@ -840,11 +840,11 @@ export function verifyOrderBtn(option:any) { }) } -//主列表-维修 -export function repairBtn(option:any) { +// 主列表-检修 +export function maintenanceOrderBtn(option:any) { return __defaultBtnOption(option,{ - label: '维修', - name: 'repair', + label: '检修', + name: 'maintenanceOrder', hide: false, type: 'primary', color: '', @@ -853,6 +853,23 @@ export function repairBtn(option:any) { }) } +// 主列表-完成 +export function finishOrderBtn(option:any) { + return __defaultBtnOption(option,{ + label: '完成', + name: 'finishOrder', + hide: false, + type: 'success', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + + + + + // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts b/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts index c8a7210..11d68fc 100644 --- a/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts +++ b/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts @@ -1,5 +1,12 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' -import { dateFormatter } from '@/utils/formatTime' +import { selectAllFactoryArea } from '@/api/system/dept' +import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' +import { useUserStore } from '@/store/modules/user' +import { selecUserByType } from '@/api/system/dept' +const userStore = useUserStore() +const factoryList = await selectAllFactoryArea() +const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) +const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) // 表单校验 export const DeviceInspectionMainRules = reactive({ @@ -14,90 +21,187 @@ export const DeviceInspectionMainRules = reactive({ export const DeviceInspectionMain = useCrudSchemas(reactive([ { - label: '编号唯一标识', + label: '检修编号', field: 'number', sort: 'custom', + table: { + width: '150', + }, isSearch: true, + isForm: false, }, { label: '维修工单号', field: 'maintenanceNumber', sort: 'custom', + isSearch: true, + table: { + width: '150', + }, }, { - label: '设备模具', + label: '设备', field: 'deviceNumber', sort: 'custom', isSearch: true, + table: { + width: '150', + }, + api: () => deviceList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return deviceList.find((account) => account.number == cellValue)?.name + }, + search: { + show: true, + component: 'Select', + api: () => deviceList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'number' + } + } + }, + form: { + component: 'Select', + api: () => deviceList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + }, + } }, { label: '厂区编号', field: 'factoryAreaNumber', sort: 'custom', - }, - { - label: '描述', - field: 'describe', - sort: 'custom', + isSearch: 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: 'maintenance', sort: 'custom', - form: { - component: 'InputNumber', - value: 0 + isSearch: false, + table: { + width: '150', + }, + api: () => userList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userList.find((account) => account.id == cellValue)?.name + }, + search: { + show: true, + component: 'Select', + api: () => userList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + } }, + form: { + component: 'Select', + api: () => userList, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + placeholder: "请先选择设备" + }, + } }, { - label: '维修人联系电话', - field: 'maintenancePhone', + label: '描述', + field: 'describe', sort: 'custom', + isSearch: false, + table: { + width: '230', + }, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + } + }, }, + // { + // label: '维修人联系电话', + // field: 'maintenancePhone', + // sort: 'custom', + // }, { label: '状态', field: 'status', sort: 'custom', isSearch: true, + table: { + width: '150', + }, + isSearch: true, + dictType: DICT_TYPE.JX_STATUS, + dictClass: 'string', form: { - component: 'Radio' + component: 'Select' }, }, { label: '类型', field: 'type', sort: 'custom', - isSearch: true, - form: { - component: 'Select' - }, - }, - { - label: '创建时间', - field: 'createTime', - sort: 'custom', - formatter: dateFormatter, - isForm: false, - }, - { - label: '地点ID', - field: 'siteId', - sort: 'custom', - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - }, - { - label: '并发乐观锁', - field: 'concurrencyStamp', - sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + dictType: DICT_TYPE.DEVICE_MOLD_TYPE, + dictClass: 'string', form: { - component: 'InputNumber', - value: 0 + component: 'Select' }, }, + // { + // label: '创建时间', + // field: 'createTime', + // sort: 'custom', + // formatter: dateFormatter, + // isForm: false, + // }, + { label: '操作', field: 'action', diff --git a/src/views/eam/device/deviceInspectionMain/index.vue b/src/views/eam/device/deviceInspectionMain/index.vue index d298d79..40dbe9e 100644 --- a/src/views/eam/device/deviceInspectionMain/index.vue +++ b/src/views/eam/device/deviceInspectionMain/index.vue @@ -4,64 +4,48 @@ - - + + - -