5 Commits
Author SHA1 Message Date
lianlonggangandClaude 0fa2e605a5 feat(watch): 部门数据统计表格新增关爱人员期初未佩戴人数列
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-18 17:25:17 +08:00
lianlonggang a47c2c7400 feat(personalData): 去掉部分电话规则校验 2026-05-15 16:46:33 +08:00
lianlonggang 8e7b857dbd feat(personalData): 优化个人数据弹窗布局与无数据提示展示
- 调整顶部操作栏布局为 space-between,增加垂直居中对齐
- 新增无数据提示文字(noDataTip)展示区域,位于日期切换按钮左侧
2026-05-15 09:46:33 +08:00
lianlonggang 8044ce0461 style(healthMonitor,user): 统一代码格式,清理多余空白字符
- 规范 sectoralData.data.ts 文件的代码缩进与空行
- 规范 HealthUserEmployeeEx.data.ts 文件的代码格式
- 规范 HealthUserEmployeeExList.vue 文件的模板格式
2026-05-14 10:03:38 +08:00
lianlonggang 592ffe1f50 fix(healthMonitor): 最后一次更新 2026-05-09 20:37:19 +08:00
10 changed files with 202 additions and 111 deletions
@@ -8,7 +8,7 @@
</template>
</BasicTable>
</template>
<script setup lang="ts">
<script setup lang="ts" name="bindRecords-name">
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">
<script setup lang="ts" name="healthMonitor-notificationNews">
import { BasicTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { list, deleteOne, batchDelete, queryByID, reSend } from './notificationNews.api';
@@ -10,7 +10,8 @@
<!-- <div>数据日期{{ userInfo.dataDate }}</div>-->
</div>
<div style="width: 75%">
<div style="display: flex; justify-content: flex-end; padding-right: 30px">
<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; font-size: 20px; align-items: center">
<a-button size="small" @click="changeDate('0')">
<LeftOutlined />
@@ -53,13 +54,14 @@
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, message } from 'ant-design-vue';
import { Menu } 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'));
//表单赋值
@@ -115,15 +117,18 @@
}
async function getInfo() {
const dateStr = dayjs(nowDate.value).format('YYYY-MM-DD');
await getDetail({
userId: userId.value,
dataDate: dayjs(nowDate.value).format('YYYY-MM-DD'),
dataDate: dateStr,
}).then((res) => {
// openModal(true, {
// record,
// dataInfo: res,
// });
infoData.value = res;
// API 返回空数据时行内提示,否则清空提示
if (!res || Object.keys(res).length === 0) {
noDataTip.value = `${dateStr}】暂无监测数据`;
} else {
noDataTip.value = '';
}
});
}
@@ -138,7 +143,9 @@
if (getDisabled(nowDate.value)) {
getInfo();
} else {
message.info('当日暂无监测数据');
// 本地记录无数据:清空展示数据并行内提示具体日期
infoData.value = {};
noDataTip.value = `${dayjs(nowDate.value).format('YYYY-MM-DD')}】暂无监测数据`;
}
}
@@ -3,7 +3,6 @@ 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[] = [
{
@@ -134,10 +133,6 @@ 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: '部门名称',
@@ -156,13 +151,39 @@ 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'],
@@ -171,6 +192,15 @@ export const columnsNew: BasicColumn[] = [
return text;
},
},
{
title: '关爱人员佩戴人数',
dataIndex: ['careWearNums'],
width: 150,
customRender: ({ text }) => {
if (!text) return 0;
return text;
},
},
{
title: '未佩戴人员数',
dataIndex: ['undistributedUserNums'],
@@ -179,6 +209,47 @@ 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'],
@@ -211,6 +282,7 @@ export const columnsNew: BasicColumn[] = [
return text;
},
},
];
const startTime = dayjs().subtract(6, 'day').format('YYYY-MM-DD');
@@ -355,6 +427,16 @@ 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,23 +88,20 @@
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 || orgCodeLenth < 6,
disabled: !flag,
},
];
}
@@ -105,7 +105,7 @@
// orgCodeSecond:data.record?.orgCode
});
bindUserId.value = data.record?.bindUserId;
paramsInfo.value = { orgCode: 'A01' };
paramsInfo.value = { orgCode: data.record?.orgCode };
await clearValidate();
// 隐藏底部时禁用整个表单
await setProps({ disabled: !data?.showFooter });
@@ -211,16 +211,21 @@ export const formSchema: FormSchema[] = [
field: 'deptId',
required: true,
component: 'ApiSelect',
defaultValue: '1683768826307096578',
show: false,
componentProps: () => {
componentProps: ({ formModel }) => {
const { getVal: getVal1, disabled: disabled1 } = initD();
getVal1('id');
return {
api: allSecondaryDepartsNew,
resultField: 'result',
labelField: 'departName',
immediate: true,
valueField: 'id',
disabled: true,
disabled: disabled1,
afterFetch: (res: any) => {
if (res.length === 1) {
formModel.deptId = res[0].id;
}
},
getPopupContainer: () => document.body,
showSearch: true,
filterOption: (input: string, option: any): boolean => {
@@ -321,40 +326,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',
@@ -385,7 +390,7 @@ export const rkFormSchema: FormSchema[] = [
};
},
show: false,
},*/
},
];
// 绑定导入
export const bindUserFormSchema: FormSchema[] = [
@@ -721,11 +726,6 @@ 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 = 'orgCode', orgCode1 = 'orgCode1', threeOrgCode = 'threeOrgCode') => {
export const mSearchFormSchema = (orgCode) => {
const schemaInfo: FormSchema[] = [
{
label: '员工姓名',
@@ -746,66 +746,33 @@ export const mSearchFormSchema = (orgCode = 'orgCode', orgCode1 = 'orgCode1', th
},
{
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: 'orgCode',
component: 'Input',
defaultValue: orgCode,
show: false,
},
{
label: '部门名称',
field: threeOrgCode,
field: 'threeOrgCode',
component: 'ApiSelect',
componentProps: ({ formModel }) => {
console.log(formModel, '11111111111');
return {
api: getThirdDepartsNew,
resultField: 'list',
labelField: 'departName',
valueField: 'orgCode',
placeholder: '请选择部门',
showSearch: true,
params: {
idOrCode: formModel[orgCode1] || '12313',
idOrCode: formModel?.orgCode || '12313',
},
valueField: 'orgCode',
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">
<script setup lang="ts" name="userInfoList-name">
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,6 +85,13 @@ export const columns: BasicColumn[] = [
dataIndex: ['departTree', '3'],
width: 180,
},
{
title: '非关爱人员',
align: 'center',
dataIndex: ['extension', 'nonCareFlag'],
width: 100,
slots: { customRender: 'nonCareTag' },
},
{
title: '出生日期',
align: 'center',
@@ -160,6 +167,17 @@ export const searchFormSchema: FormSchema[] = [
field: 'phone',
component: 'Input',
},
{
label: '非关爱人员',
field: 'nonCareFlag',
component: 'Select',
componentProps: {
options: [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
],
},
},
{
label: '单位名称',
field: 'orgCode',
@@ -676,28 +694,44 @@ 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' }],
// rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }],
show: false,
},
{
label: '急救人员姓名',
field: 'lifeguardName',
component: 'Input',
show: false,
},
{
label: '急救人员电话',
field: 'lifeguardPhone',
component: 'Input',
rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }],
// 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 },
],
},
},
{
label: '',
@@ -109,6 +109,10 @@
{{ 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" />