1 Commits
Author SHA1 Message Date
lianlonggang 2241b6873f fix(healthMonitor): 修复健康监测模块中的组织机构数据显示和绑定功能
- 在sectoralData.data.ts中添加单位名称列的颜色渲染,三级单位显示为红色
- 在sectoralDataList.vue中添加组织代码长度限制,小于6位时禁用明细和导出功能
- 修复toolManagement组件中bindModal.vue的参数传递问题
- 修改toolManagement.data.ts中部门选择器的默认值和禁用状态
- 移除重复的单位名称表单项并优化搜索表单的组织机构选择逻辑
- 添加单位名称列到员工表格中并调整搜索表单的字段映射
2026-05-06 15:04:28 +08:00
10 changed files with 112 additions and 203 deletions
@@ -8,7 +8,7 @@
</template>
</BasicTable>
</template>
<script setup lang="ts" name="bindRecords-name">
<script setup lang="ts">
import BasicTable from '/@/components/Table/src/BasicTable.vue';
import { useListPage } from '/@/hooks/system/useListPage';
import { bindRecordColumns, bindRecordSchema } from '/@/views/healthMonitor/healMonitorManage/monitorToll/bindRecords/bindRecords.data';
@@ -19,7 +19,7 @@
<notification-news-modal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script setup lang="ts" name="healthMonitor-notificationNews">
<script setup lang="ts">
import { BasicTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { list, deleteOne, batchDelete, queryByID, reSend } from './notificationNews.api';
@@ -10,8 +10,7 @@
<!-- <div>数据日期{{ userInfo.dataDate }}</div>-->
</div>
<div style="width: 75%">
<div style="display: flex; justify-content: space-between; align-items: center; padding-right: 30px">
<div style="color: #faad14; font-size: 13px; padding-left: 4px">{{ noDataTip }}</div>
<div style="display: flex; justify-content: flex-end; padding-right: 30px">
<div style="display: flex; font-size: 20px; align-items: center">
<a-button size="small" @click="changeDate('0')">
<LeftOutlined />
@@ -54,14 +53,13 @@
import AllLook from '/@/views/healthMonitor/healMonitorManage/monitorToll/userInfo/componets/allLook.vue';
import { getDetail, userDataDayByMonth } from '/@/views/healthMonitor/healMonitorManage/monitorToll/personalData/personalData.api';
import dayjs from 'dayjs';
import { Menu } from 'ant-design-vue';
import { Menu, message } from 'ant-design-vue';
import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue';
const userInfo = ref({});
const infoData = ref({});
const userId = ref('');
const haveInfo = ref('');
const nowDate = ref(dayjs());
const noDataTip = ref('');
const loadedYear = ref(dayjs().format('YYYY'));
const isRight = computed(() => dayjs(nowDate.value).format('YYYY-MM-DD') != dayjs().format('YYYY-MM-DD'));
//表单赋值
@@ -117,18 +115,15 @@
}
async function getInfo() {
const dateStr = dayjs(nowDate.value).format('YYYY-MM-DD');
await getDetail({
userId: userId.value,
dataDate: dateStr,
dataDate: dayjs(nowDate.value).format('YYYY-MM-DD'),
}).then((res) => {
// openModal(true, {
// record,
// dataInfo: res,
// });
infoData.value = res;
// API 返回空数据时行内提示,否则清空提示
if (!res || Object.keys(res).length === 0) {
noDataTip.value = `${dateStr}】暂无监测数据`;
} else {
noDataTip.value = '';
}
});
}
@@ -143,9 +138,7 @@
if (getDisabled(nowDate.value)) {
getInfo();
} else {
// 本地记录无数据:清空展示数据并行内提示具体日期
infoData.value = {};
noDataTip.value = `${dayjs(nowDate.value).format('YYYY-MM-DD')}】暂无监测数据`;
message.info('当日暂无监测数据');
}
}
@@ -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: '部门名称',
@@ -151,39 +156,13 @@ export const columnsNew: BasicColumn[] = [
},
},
{
title: '分配设备数',
title: '分配设备数',
dataIndex: ['assignedDeviceNums'],
customRender: ({ text }) => {
if (!text) return 0;
return text;
},
},
{
title: '未分配设备数',
dataIndex: 'undistributedDeviceNums',
customRender: ({ record }) => {
const total = record.totalAssignedDeviceNums ?? 0;
const assigned = record.assignedDeviceNums ?? 0;
return Math.max(0, total - assigned);
},
},
{
title: '已绑定设备数',
dataIndex: ['assignedDeviceNums'],
customRender: ({ text }) => {
if (!text) return 0;
return text;
},
},
{
title: '未绑定设备数',
dataIndex: 'undistributedDeviceNums',
customRender: ({ record }) => {
const total = record.totalAssignedDeviceNums ?? 0;
const assigned = record.assignedDeviceNums ?? 0;
return Math.max(0, total - assigned);
},
},
{
title: '佩戴人员数',
dataIndex: ['assignedUserNums'],
@@ -192,15 +171,6 @@ export const columnsNew: BasicColumn[] = [
return text;
},
},
{
title: '关爱人员佩戴人数',
dataIndex: ['careWearNums'],
width: 150,
customRender: ({ text }) => {
if (!text) return 0;
return text;
},
},
{
title: '未佩戴人员数',
dataIndex: ['undistributedUserNums'],
@@ -209,47 +179,6 @@ export const columnsNew: BasicColumn[] = [
return text;
},
},
{
title: '关爱人员未佩戴人数',
dataIndex: ['careUnwearNums'],
width: 160,
customRender: ({ text }) => {
if (!text) return 0;
return text;
},
},
{
title: '关爱人员未佩戴人数\n(仅计入统计日期起期已绑定的人数)',
dataIndex: ['careUnwearAtStartNums'],
width: 180,
customHeaderCell: () => {
return {
style: {
whiteSpace: 'pre-wrap',
},
};
},
customRender: ({ text }) => {
if (!text) return 0;
return text;
},
},
{
title: '非关爱人员数量',
dataIndex: ['nonCareNums'],
customRender: ({ text }) => {
if (!text) return 0;
return text;
},
},
{
title: '关爱人员数量',
dataIndex: ['careNums'],
customRender: ({ text }) => {
if (!text) return 0;
return text;
},
},
{
title: '心率异常人数',
dataIndex: ['heartRateNums'],
@@ -282,7 +211,6 @@ export const columnsNew: BasicColumn[] = [
return text;
},
},
];
const startTime = dayjs().subtract(6, 'day').format('YYYY-MM-DD');
@@ -427,16 +355,6 @@ export const detailColumns = (arr: BasicColumn[] = []) => {
title: '手表所属单位',
dataIndex: 'watchOrgName',
},
{
title: '非关爱人员',
dataIndex: 'nonCareFlag',
width: 100,
customRender: ({ text }) => {
if (text === 1) return '是';
if (text === 0) return '否';
return '';
},
},
...arr,
{
title: '应佩戴天数',
@@ -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,
},
];
}
@@ -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 });
@@ -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',
@@ -8,7 +8,7 @@
<user-info-modal @register="registerModal" />
</div>
</template>
<script setup lang="ts" name="userInfoList-name">
<script setup lang="ts">
import BasicTable from '/@/components/Table/src/BasicTable.vue';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchSchema } from '/@/views/healthMonitor/healMonitorManage/monitorToll/userInfo/userInfo.data';
@@ -85,13 +85,6 @@ export const columns: BasicColumn[] = [
dataIndex: ['departTree', '3'],
width: 180,
},
{
title: '非关爱人员',
align: 'center',
dataIndex: ['extension', 'nonCareFlag'],
width: 100,
slots: { customRender: 'nonCareTag' },
},
{
title: '出生日期',
align: 'center',
@@ -167,17 +160,6 @@ export const searchFormSchema: FormSchema[] = [
field: 'phone',
component: 'Input',
},
{
label: '非关爱人员',
field: 'nonCareFlag',
component: 'Select',
componentProps: {
options: [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
],
},
},
{
label: '单位名称',
field: 'orgCode',
@@ -694,44 +676,28 @@ export const formSchema: (isUpdate: boolean) => FormSchema[] = (isUpdate) => {
label: '关爱联络员姓名',
field: 'careLiaisonName',
component: 'Input',
show: false,
},
{
label: '关爱联络员职务',
field: 'careLiaisonJob',
component: 'Input',
show: false,
},
{
label: '关爱联络员电话',
field: 'careLiaisonPhone',
component: 'Input',
// rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }],
show: false,
rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }],
},
{
label: '急救人员姓名',
field: 'lifeguardName',
component: 'Input',
show: false,
},
{
label: '急救人员电话',
field: 'lifeguardPhone',
component: 'Input',
// rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }],
show: false,
},
{
label: '非关爱人员',
field: 'nonCareFlag',
component: 'RadioButtonGroup',
componentProps: {
options: [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
],
},
rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }],
},
{
label: '',
@@ -109,10 +109,6 @@
{{ record.status_dictText }}
</Tag>
</template>
<template #nonCareTag="{ record }">
<Tag v-if="record.extension?.nonCareFlag === 1" color="orange"></Tag>
<Tag v-else-if="record.extension?.nonCareFlag === 0" color="blue"></Tag>
</template>
</BasicTable>
<!-- 表单区域 -->
<HealthUserEmployeeExDrawer :showFooter="showFooter" @register="registerDrawer" @success="handleSuccess" />