From 6648e74a007254e167c5508de5d25402cd4bb63b Mon Sep 17 00:00:00 2001 From: zhuguifei <zhuguifei@zhuguifeideiMac.local> Date: 星期一, 10 三月 2025 16:39:50 +0800 Subject: [PATCH] 完成保养工单明细 --- eims-ui/apps/web-antd/src/views/eims/repair-res/data.tsx | 117 +++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 71 insertions(+), 46 deletions(-) diff --git a/eims-ui/apps/web-antd/src/views/eims/repair-res/data.tsx b/eims-ui/apps/web-antd/src/views/eims/repair-res/data.tsx index 7056d1a..0913dd9 100644 --- a/eims-ui/apps/web-antd/src/views/eims/repair-res/data.tsx +++ b/eims-ui/apps/web-antd/src/views/eims/repair-res/data.tsx @@ -3,14 +3,10 @@ import { DictEnum } from '@vben/constants'; import { getPopupContainer } from '@vben/utils'; -import dayjs from 'dayjs'; - import { type FormSchemaGetter } from '#/adapter/form'; import { REPAIR_REQ_TYPE } from '#/constants/dict'; import { getDictOptions } from '#/utils/dict'; import { renderDict } from '#/utils/render'; - -const curDateTime = dayjs().format('YYYY-MM-DD HH:mm:ss'); export const querySchema: FormSchemaGetter = () => [ { @@ -54,6 +50,33 @@ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60, fixed: 'left' }, { + title: '璁惧(宸ュ叿)鍚嶇О', + sortable: true, + minWidth: 150, + fixed: 'left', + slots: { + default: ({ row }) => { + if (!row.reqType) { + return ''; + } + + // 鏍规嵁涓嶅悓鐨勮姹傜被鍨嬭繑鍥炵浉搴旂殑鍚嶇О + switch (row.reqType) { + case REPAIR_REQ_TYPE.EQU: { + return row.equName; + } + case REPAIR_REQ_TYPE.FIXTURE: { + return row.fixtureName; + } + default: { + // 濡傛灉璇锋眰绫诲瀷鏃笉鏄� EQU 涔熶笉鏄� FIXTURE锛屽垯杩斿洖绌哄瓧绗︿覆 + return ''; + } + } + } + } + }, + { title: '缁翠慨鍗曞彿', field: 'resCode', minWidth: 160, @@ -76,7 +99,7 @@ { title: '鎶ヤ慨鍗曞彿', field: 'reqCode', - minWidth: 160, + minWidth: 160 }, { title: '缁翠慨閮ㄩ棬', @@ -107,32 +130,6 @@ field: 'reqTime', sortable: true, minWidth: 200 - }, - { - title: '璁惧(宸ュ叿)鍚嶇О', - sortable: true, - minWidth: 150, - slots: { - default: ({ row }) => { - if (!row.reqType) { - return ''; - } - - // 鏍规嵁涓嶅悓鐨勮姹傜被鍨嬭繑鍥炵浉搴旂殑鍚嶇О - switch (row.reqType) { - case REPAIR_REQ_TYPE.EQU: { - return row.equName; - } - case REPAIR_REQ_TYPE.FIXTURE: { - return row.fixtureName; - } - default: { - // 濡傛灉璇锋眰绫诲瀷鏃笉鏄� EQU 涔熶笉鏄� FIXTURE锛屽垯杩斿洖绌哄瓧绗︿覆 - return ''; - } - } - } - } }, { title: '鏁呴殰绫诲埆', @@ -167,7 +164,7 @@ fixed: 'right', slots: { default: 'action' }, title: '鎿嶄綔', - width: 130 + width: 200 } ]; @@ -187,35 +184,61 @@ show: () => false, triggerFields: [''] }, - label: '鎶ヤ慨id' + label: '鎶ヤ慨id', + rules: 'required' + }, + { + component: 'Input', + fieldName: 'reqUser', + dependencies: { + show: () => false, + triggerFields: [''] + }, + label: '鎶ヤ慨浜�', + rules: 'required' + }, + { + component: 'Input', + fieldName: 'reqDept', + dependencies: { + show: () => false, + triggerFields: [''] + }, + label: '鎶ヤ慨閮ㄩ棬', + rules: 'required' }, { component: 'Input', fieldName: 'reqCode', - label: '鎶ヤ慨鍗曞彿' + label: '鎶ヤ慨鍗曞彿', + rules: 'required' }, { component: 'Input', fieldName: 'resCode', - label: '缁翠慨鍗曞彿' + label: '缁翠慨鍗曞彿', + rules: 'required' }, { component: 'Textarea', formItemClass: 'items-baseline', fieldName: 'resReason', - label: '鍘熷洜鍒嗘瀽' + label: '鍘熷洜鍒嗘瀽', + rules: 'required' }, { component: 'Textarea', formItemClass: 'items-baseline', fieldName: 'resHandle', - label: '澶勭悊鎺柦' + label: '澶勭悊鎺柦', + rules: 'required' }, { component: 'Textarea', formItemClass: 'items-baseline', fieldName: 'resPrevent', - label: '棰勯槻鎺柦' + label: '棰勯槻鎺柦', + rules: 'required' }, { component: 'Input', @@ -242,8 +265,9 @@ options: getDictOptions(DictEnum.REPAIR_RES_STATUS) }, fieldName: 'status', - defaultValue: '0', - label: '缁翠慨鐘舵��' + defaultValue: '1', + label: '缁翠慨鐘舵��', + rules: 'required' }, { component: 'DatePicker', @@ -253,9 +277,9 @@ valueFormat: 'YYYY-MM-DD HH:mm:ss', getPopupContainer }, - defaultValue: curDateTime, fieldName: 'startTime', - label: '寮�濮嬫椂闂�' + label: '寮�濮嬫椂闂�', + rules: 'required' }, { component: 'DatePicker', @@ -274,8 +298,8 @@ defaultValue: undefined, fieldName: 'resDept', label: '缁翠慨閮ㄩ棬', - help: `鎶ヤ慨浜哄憳鎵�灞為儴闂╜ - // rules: 'selectRequired', + help: `鎶ヤ慨浜哄憳鎵�灞為儴闂╜, + rules: 'selectRequired' }, { component: 'Select', @@ -285,12 +309,13 @@ getPopupContainer }, fieldName: 'resUser', - label: '缁翠慨浜�' + label: '缁翠慨浜�', + rules: 'selectRequired' }, { component: 'Textarea', formItemClass: 'items-baseline', fieldName: 'remark', label: '澶囨敞' - }, + } ]; -- Gitblit v1.9.3