From 2241b6873f7ab9327a33d54a61d111b90ee8aa55 Mon Sep 17 00:00:00 2001 From: lianlonggang Date: Thu, 30 Apr 2026 16:50:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(healthMonitor):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=81=A5=E5=BA=B7=E7=9B=91=E6=B5=8B=E6=A8=A1=E5=9D=97=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E7=BB=87=E6=9C=BA=E6=9E=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=92=8C=E7=BB=91=E5=AE=9A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在sectoralData.data.ts中添加单位名称列的颜色渲染,三级单位显示为红色 - 在sectoralDataList.vue中添加组织代码长度限制,小于6位时禁用明细和导出功能 - 修复toolManagement组件中bindModal.vue的参数传递问题 - 修改toolManagement.data.ts中部门选择器的默认值和禁用状态 - 移除重复的单位名称表单项并优化搜索表单的组织机构选择逻辑 - 添加单位名称列到员工表格中并调整搜索表单的字段映射 --- .../sectoralData/sectoralData.data.ts | 5 + .../sectoralData/sectoralDataList.vue | 5 +- .../toolManagement/components/bindModal.vue | 2 +- .../toolManagement/toolManagement.data.ts | 143 +++++++++++------- 4 files changed, 98 insertions(+), 57 deletions(-) diff --git a/src/views/healthMonitor/healMonitorManage/monitorToll/sectoralData/sectoralData.data.ts b/src/views/healthMonitor/healMonitorManage/monitorToll/sectoralData/sectoralData.data.ts index edeb860..ce6a9bf 100644 --- a/src/views/healthMonitor/healMonitorManage/monitorToll/sectoralData/sectoralData.data.ts +++ b/src/views/healthMonitor/healMonitorManage/monitorToll/sectoralData/sectoralData.data.ts @@ -3,6 +3,7 @@ import { message } from 'ant-design-vue'; import { allSecondaryDepartsNew, getThirdDepartsNew } from '/@/utils/system/api'; import moment from 'moment'; import dayjs from 'dayjs'; +import { h } from 'vue'; export const columns: BasicColumn[] = [ { @@ -133,6 +134,10 @@ export const columnsNew: BasicColumn[] = [ { title: '单位名称', dataIndex: ['orgCodeName'], + customRender: ({ text, record }) => { + const isRed = record?.orgCode?.length === 3; + return h('span', { style: isRed ? { color: 'red' } : {} }, text); + }, }, { title: '部门名称', diff --git a/src/views/healthMonitor/healMonitorManage/monitorToll/sectoralData/sectoralDataList.vue b/src/views/healthMonitor/healMonitorManage/monitorToll/sectoralData/sectoralDataList.vue index d3288ab..32d0c0c 100644 --- a/src/views/healthMonitor/healMonitorManage/monitorToll/sectoralData/sectoralDataList.vue +++ b/src/views/healthMonitor/healMonitorManage/monitorToll/sectoralData/sectoralDataList.vue @@ -88,20 +88,23 @@ const [registerTable, { reload, getForm }] = tableContext; function getTableAction(record: any) { + let orgCodeLenth = record?.orgCode?.length; let flag = record?.orgCodeLeafName == '-'; return [ { label: '明细', onClick: handleDetail.bind(null, record), + disabled: orgCodeLenth < 6, }, { label: '明细导出', onClick: handleExport.bind(null, record), + disabled: orgCodeLenth < 6, }, { label: '周报', onClick: handleWeekReport.bind(null, record), - disabled: !flag, + disabled: !flag || orgCodeLenth < 6, }, ]; } diff --git a/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/components/bindModal.vue b/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/components/bindModal.vue index 9286135..3bad1a4 100644 --- a/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/components/bindModal.vue +++ b/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/components/bindModal.vue @@ -105,7 +105,7 @@ // orgCodeSecond:data.record?.orgCode }); bindUserId.value = data.record?.bindUserId; - paramsInfo.value = { orgCode: data.record?.orgCode }; + paramsInfo.value = { orgCode: 'A01' }; await clearValidate(); // 隐藏底部时禁用整个表单 await setProps({ disabled: !data?.showFooter }); diff --git a/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolManagement.data.ts b/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolManagement.data.ts index ce6186e..bf6aaa6 100644 --- a/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolManagement.data.ts +++ b/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolManagement.data.ts @@ -211,21 +211,16 @@ export const formSchema: FormSchema[] = [ field: 'deptId', required: true, component: 'ApiSelect', - componentProps: ({ formModel }) => { - const { getVal: getVal1, disabled: disabled1 } = initD(); - getVal1('id'); + defaultValue: '1683768826307096578', + show: false, + componentProps: () => { return { api: allSecondaryDepartsNew, resultField: 'result', labelField: 'departName', immediate: true, valueField: 'id', - disabled: disabled1, - afterFetch: (res: any) => { - if (res.length === 1) { - formModel.deptId = res[0].id; - } - }, + disabled: true, getPopupContainer: () => document.body, showSearch: true, filterOption: (input: string, option: any): boolean => { @@ -326,40 +321,40 @@ export const rkFormSchema: FormSchema[] = [ required: true, slot: 'file', }, - { - label: '单位名称', - field: 'deptId', - component: 'ApiSelect', - required: true, - componentProps: ({ formModel, schema }) => { - const { getVal, disabled } = initD(); - getVal('id'); - return { - api: allSecondaryDepartsNew, - resultField: 'list', - labelField: 'departName', - valueField: 'id', - immediate: true, - onChange: (val: any) => { - if (val) { - formModel['orgId'] = ''; - } - }, - onDeselect: () => { - formModel.deptId = ''; - formModel['orgId'] = ''; - }, - showSearch: true, - filterOption: (input: string, option: any): boolean => { - const str: string = input.toLowerCase(); - return option.label.toLowerCase().indexOf(str) >= 0; - }, - disabled: disabled, - getPopupContainer: () => document.body, - }; - }, - }, - { + // { + // label: '单位名称', + // field: 'deptId', + // component: 'ApiSelect', + // required: true, + // componentProps: ({ formModel, schema }) => { + // const { getVal, disabled } = initD(); + // getVal('id'); + // return { + // api: allSecondaryDepartsNew, + // resultField: 'list', + // labelField: 'departName', + // valueField: 'id', + // immediate: true, + // onChange: (val: any) => { + // if (val) { + // formModel['orgId'] = ''; + // } + // }, + // onDeselect: () => { + // formModel.deptId = ''; + // formModel['orgId'] = ''; + // }, + // showSearch: true, + // filterOption: (input: string, option: any): boolean => { + // const str: string = input.toLowerCase(); + // return option.label.toLowerCase().indexOf(str) >= 0; + // }, + // disabled: disabled, + // getPopupContainer: () => document.body, + // }; + // }, + // }, + /*{ label: '部门名称', field: 'orgId', component: 'ApiSelect', @@ -390,7 +385,7 @@ export const rkFormSchema: FormSchema[] = [ }; }, show: false, - }, + },*/ ]; // 绑定导入 export const bindUserFormSchema: FormSchema[] = [ @@ -726,6 +721,11 @@ export const mColumns: BasicColumn[] = [ dataIndex: 'realname', align: 'center', }, + { + title: '单位名称', + dataIndex: ['secondDepart', 'departName'], + align: 'center', + }, { title: '部门名称', dataIndex: ['depart', 'departName'], @@ -737,7 +737,7 @@ export const mColumns: BasicColumn[] = [ align: 'center', }, ]; -export const mSearchFormSchema = (orgCode) => { +export const mSearchFormSchema = (orgCode = 'orgCode', orgCode1 = 'orgCode1', threeOrgCode = 'threeOrgCode') => { const schemaInfo: FormSchema[] = [ { label: '员工姓名', @@ -746,33 +746,66 @@ export const mSearchFormSchema = (orgCode) => { }, { - label: '单位', - field: 'orgCode', - component: 'Input', - defaultValue: orgCode, - show: false, + label: '单位名称', + field: orgCode1, + component: 'ApiSelect', + componentProps: ({ formModel, schema }) => { + return { + api: allSecondaryDepartsNew, + resultField: 'list', + labelField: 'departName', + valueField: 'orgCode', + placeholder: '请选择单位', + showSearch: true, + filterOption: (input: string, option: any): boolean => { + const str: string = input.trim().toLowerCase(); + return option.departName.toLowerCase().indexOf(str) >= 0; + }, + onChange: (val) => { + // 选中单位时,orgCode 赋值为单位的 orgCode,并清空部门 + formModel[orgCode] = val || ''; + formModel[threeOrgCode] = ''; + }, + onDeselect: () => { + formModel[orgCode] = ''; + formModel[orgCode1] = ''; + formModel[threeOrgCode] = ''; + }, + }; + }, }, { label: '部门名称', - field: 'threeOrgCode', + field: threeOrgCode, component: 'ApiSelect', componentProps: ({ formModel }) => { - console.log(formModel, '11111111111'); return { api: getThirdDepartsNew, resultField: 'list', labelField: 'departName', - params: { - idOrCode: formModel?.orgCode || '12313', - }, valueField: 'orgCode', + placeholder: '请选择部门', + showSearch: true, + params: { + idOrCode: formModel[orgCode1] || '12313', + }, immediate: true, style: { width: '195px', }, + onChange: (val) => { + // 选中部门时覆盖 orgCode,清空时回退到单位的 orgCode + formModel[orgCode] = val || formModel[orgCode1] || ''; + }, }; }, }, + { + label: '', + field: orgCode, + component: 'Input', + show: false, + }, { label: '员工编号', field: 'workNo',