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> </template>
</BasicTable> </BasicTable>
</template> </template>
<script setup lang="ts"> <script setup lang="ts" name="bindRecords-name">
import BasicTable from '/@/components/Table/src/BasicTable.vue'; import BasicTable from '/@/components/Table/src/BasicTable.vue';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { bindRecordColumns, bindRecordSchema } from '/@/views/healthMonitor/healMonitorManage/monitorToll/bindRecords/bindRecords.data'; import { bindRecordColumns, bindRecordSchema } from '/@/views/healthMonitor/healMonitorManage/monitorToll/bindRecords/bindRecords.data';
@@ -19,7 +19,7 @@
<notification-news-modal @register="registerModal" @success="handleSuccess" /> <notification-news-modal @register="registerModal" @success="handleSuccess" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts" name="healthMonitor-notificationNews">
import { BasicTable, TableAction } from '/@/components/Table'; import { BasicTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { list, deleteOne, batchDelete, queryByID, reSend } from './notificationNews.api'; import { list, deleteOne, batchDelete, queryByID, reSend } from './notificationNews.api';
@@ -10,7 +10,8 @@
<!-- <div>数据日期{{ userInfo.dataDate }}</div>--> <!-- <div>数据日期{{ userInfo.dataDate }}</div>-->
</div> </div>
<div style="width: 75%"> <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"> <div style="display: flex; font-size: 20px; align-items: center">
<a-button size="small" @click="changeDate('0')"> <a-button size="small" @click="changeDate('0')">
<LeftOutlined /> <LeftOutlined />
@@ -53,13 +54,14 @@
import AllLook from '/@/views/healthMonitor/healMonitorManage/monitorToll/userInfo/componets/allLook.vue'; import AllLook from '/@/views/healthMonitor/healMonitorManage/monitorToll/userInfo/componets/allLook.vue';
import { getDetail, userDataDayByMonth } from '/@/views/healthMonitor/healMonitorManage/monitorToll/personalData/personalData.api'; import { getDetail, userDataDayByMonth } from '/@/views/healthMonitor/healMonitorManage/monitorToll/personalData/personalData.api';
import dayjs from 'dayjs'; 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'; import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue';
const userInfo = ref({}); const userInfo = ref({});
const infoData = ref({}); const infoData = ref({});
const userId = ref(''); const userId = ref('');
const haveInfo = ref(''); const haveInfo = ref('');
const nowDate = ref(dayjs()); const nowDate = ref(dayjs());
const noDataTip = ref('');
const loadedYear = ref(dayjs().format('YYYY')); const loadedYear = ref(dayjs().format('YYYY'));
const isRight = computed(() => dayjs(nowDate.value).format('YYYY-MM-DD') != dayjs().format('YYYY-MM-DD')); const isRight = computed(() => dayjs(nowDate.value).format('YYYY-MM-DD') != dayjs().format('YYYY-MM-DD'));
//表单赋值 //表单赋值
@@ -115,15 +117,18 @@
} }
async function getInfo() { async function getInfo() {
const dateStr = dayjs(nowDate.value).format('YYYY-MM-DD');
await getDetail({ await getDetail({
userId: userId.value, userId: userId.value,
dataDate: dayjs(nowDate.value).format('YYYY-MM-DD'), dataDate: dateStr,
}).then((res) => { }).then((res) => {
// openModal(true, {
// record,
// dataInfo: res,
// });
infoData.value = 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)) { if (getDisabled(nowDate.value)) {
getInfo(); getInfo();
} else { } 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 { allSecondaryDepartsNew, getThirdDepartsNew } from '/@/utils/system/api';
import moment from 'moment'; import moment from 'moment';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { h } from 'vue';
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
@@ -134,10 +133,6 @@ export const columnsNew: BasicColumn[] = [
{ {
title: '单位名称', title: '单位名称',
dataIndex: ['orgCodeName'], dataIndex: ['orgCodeName'],
customRender: ({ text, record }) => {
const isRed = record?.orgCode?.length === 3;
return h('span', { style: isRed ? { color: 'red' } : {} }, text);
},
}, },
{ {
title: '部门名称', title: '部门名称',
@@ -156,13 +151,39 @@ export const columnsNew: BasicColumn[] = [
}, },
}, },
{ {
title: '分配设备数', title: '分配设备数',
dataIndex: ['assignedDeviceNums'], dataIndex: ['assignedDeviceNums'],
customRender: ({ text }) => { customRender: ({ text }) => {
if (!text) return 0; if (!text) return 0;
return text; 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: '佩戴人员数', title: '佩戴人员数',
dataIndex: ['assignedUserNums'], dataIndex: ['assignedUserNums'],
@@ -171,6 +192,15 @@ export const columnsNew: BasicColumn[] = [
return text; return text;
}, },
}, },
{
title: '关爱人员佩戴人数',
dataIndex: ['careWearNums'],
width: 150,
customRender: ({ text }) => {
if (!text) return 0;
return text;
},
},
{ {
title: '未佩戴人员数', title: '未佩戴人员数',
dataIndex: ['undistributedUserNums'], dataIndex: ['undistributedUserNums'],
@@ -179,6 +209,47 @@ export const columnsNew: BasicColumn[] = [
return text; 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: '心率异常人数', title: '心率异常人数',
dataIndex: ['heartRateNums'], dataIndex: ['heartRateNums'],
@@ -211,6 +282,7 @@ export const columnsNew: BasicColumn[] = [
return text; return text;
}, },
}, },
]; ];
const startTime = dayjs().subtract(6, 'day').format('YYYY-MM-DD'); const startTime = dayjs().subtract(6, 'day').format('YYYY-MM-DD');
@@ -355,6 +427,16 @@ export const detailColumns = (arr: BasicColumn[] = []) => {
title: '手表所属单位', title: '手表所属单位',
dataIndex: 'watchOrgName', dataIndex: 'watchOrgName',
}, },
{
title: '非关爱人员',
dataIndex: 'nonCareFlag',
width: 100,
customRender: ({ text }) => {
if (text === 1) return '是';
if (text === 0) return '否';
return '';
},
},
...arr, ...arr,
{ {
title: '应佩戴天数', title: '应佩戴天数',
@@ -88,23 +88,20 @@
const [registerTable, { reload, getForm }] = tableContext; const [registerTable, { reload, getForm }] = tableContext;
function getTableAction(record: any) { function getTableAction(record: any) {
let orgCodeLenth = record?.orgCode?.length;
let flag = record?.orgCodeLeafName == '-'; let flag = record?.orgCodeLeafName == '-';
return [ return [
{ {
label: '明细', label: '明细',
onClick: handleDetail.bind(null, record), onClick: handleDetail.bind(null, record),
disabled: orgCodeLenth < 6,
}, },
{ {
label: '明细导出', label: '明细导出',
onClick: handleExport.bind(null, record), onClick: handleExport.bind(null, record),
disabled: orgCodeLenth < 6,
}, },
{ {
label: '周报', label: '周报',
onClick: handleWeekReport.bind(null, record), onClick: handleWeekReport.bind(null, record),
disabled: !flag || orgCodeLenth < 6, disabled: !flag,
}, },
]; ];
} }
@@ -105,7 +105,7 @@
// orgCodeSecond:data.record?.orgCode // orgCodeSecond:data.record?.orgCode
}); });
bindUserId.value = data.record?.bindUserId; bindUserId.value = data.record?.bindUserId;
paramsInfo.value = { orgCode: 'A01' }; paramsInfo.value = { orgCode: data.record?.orgCode };
await clearValidate(); await clearValidate();
// 隐藏底部时禁用整个表单 // 隐藏底部时禁用整个表单
await setProps({ disabled: !data?.showFooter }); await setProps({ disabled: !data?.showFooter });
@@ -211,16 +211,21 @@ export const formSchema: FormSchema[] = [
field: 'deptId', field: 'deptId',
required: true, required: true,
component: 'ApiSelect', component: 'ApiSelect',
defaultValue: '1683768826307096578', componentProps: ({ formModel }) => {
show: false, const { getVal: getVal1, disabled: disabled1 } = initD();
componentProps: () => { getVal1('id');
return { return {
api: allSecondaryDepartsNew, api: allSecondaryDepartsNew,
resultField: 'result', resultField: 'result',
labelField: 'departName', labelField: 'departName',
immediate: true, immediate: true,
valueField: 'id', valueField: 'id',
disabled: true, disabled: disabled1,
afterFetch: (res: any) => {
if (res.length === 1) {
formModel.deptId = res[0].id;
}
},
getPopupContainer: () => document.body, getPopupContainer: () => document.body,
showSearch: true, showSearch: true,
filterOption: (input: string, option: any): boolean => { filterOption: (input: string, option: any): boolean => {
@@ -321,40 +326,40 @@ export const rkFormSchema: FormSchema[] = [
required: true, required: true,
slot: 'file', slot: 'file',
}, },
// { {
// label: '单位名称', label: '单位名称',
// field: 'deptId', field: 'deptId',
// component: 'ApiSelect', component: 'ApiSelect',
// required: true, required: true,
// componentProps: ({ formModel, schema }) => { componentProps: ({ formModel, schema }) => {
// const { getVal, disabled } = initD(); const { getVal, disabled } = initD();
// getVal('id'); getVal('id');
// return { return {
// api: allSecondaryDepartsNew, api: allSecondaryDepartsNew,
// resultField: 'list', resultField: 'list',
// labelField: 'departName', labelField: 'departName',
// valueField: 'id', valueField: 'id',
// immediate: true, immediate: true,
// onChange: (val: any) => { onChange: (val: any) => {
// if (val) { if (val) {
// formModel['orgId'] = ''; formModel['orgId'] = '';
// } }
// }, },
// onDeselect: () => { onDeselect: () => {
// formModel.deptId = ''; formModel.deptId = '';
// formModel['orgId'] = ''; formModel['orgId'] = '';
// }, },
// showSearch: true, showSearch: true,
// filterOption: (input: string, option: any): boolean => { filterOption: (input: string, option: any): boolean => {
// const str: string = input.toLowerCase(); const str: string = input.toLowerCase();
// return option.label.toLowerCase().indexOf(str) >= 0; return option.label.toLowerCase().indexOf(str) >= 0;
// }, },
// disabled: disabled, disabled: disabled,
// getPopupContainer: () => document.body, getPopupContainer: () => document.body,
// }; };
// }, },
// }, },
/*{ {
label: '部门名称', label: '部门名称',
field: 'orgId', field: 'orgId',
component: 'ApiSelect', component: 'ApiSelect',
@@ -385,7 +390,7 @@ export const rkFormSchema: FormSchema[] = [
}; };
}, },
show: false, show: false,
},*/ },
]; ];
// 绑定导入 // 绑定导入
export const bindUserFormSchema: FormSchema[] = [ export const bindUserFormSchema: FormSchema[] = [
@@ -721,11 +726,6 @@ export const mColumns: BasicColumn[] = [
dataIndex: 'realname', dataIndex: 'realname',
align: 'center', align: 'center',
}, },
{
title: '单位名称',
dataIndex: ['secondDepart', 'departName'],
align: 'center',
},
{ {
title: '部门名称', title: '部门名称',
dataIndex: ['depart', 'departName'], dataIndex: ['depart', 'departName'],
@@ -737,7 +737,7 @@ export const mColumns: BasicColumn[] = [
align: 'center', align: 'center',
}, },
]; ];
export const mSearchFormSchema = (orgCode = 'orgCode', orgCode1 = 'orgCode1', threeOrgCode = 'threeOrgCode') => { export const mSearchFormSchema = (orgCode) => {
const schemaInfo: FormSchema[] = [ const schemaInfo: FormSchema[] = [
{ {
label: '员工姓名', label: '员工姓名',
@@ -746,66 +746,33 @@ export const mSearchFormSchema = (orgCode = 'orgCode', orgCode1 = 'orgCode1', th
}, },
{ {
label: '单位名称', label: '单位',
field: orgCode1, field: 'orgCode',
component: 'ApiSelect', component: 'Input',
componentProps: ({ formModel, schema }) => { defaultValue: orgCode,
return { show: false,
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: '部门名称', label: '部门名称',
field: threeOrgCode, field: 'threeOrgCode',
component: 'ApiSelect', component: 'ApiSelect',
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
console.log(formModel, '11111111111');
return { return {
api: getThirdDepartsNew, api: getThirdDepartsNew,
resultField: 'list', resultField: 'list',
labelField: 'departName', labelField: 'departName',
valueField: 'orgCode',
placeholder: '请选择部门',
showSearch: true,
params: { params: {
idOrCode: formModel[orgCode1] || '12313', idOrCode: formModel?.orgCode || '12313',
}, },
valueField: 'orgCode',
immediate: true, immediate: true,
style: { style: {
width: '195px', width: '195px',
}, },
onChange: (val) => {
// 选中部门时覆盖 orgCode,清空时回退到单位的 orgCode
formModel[orgCode] = val || formModel[orgCode1] || '';
},
}; };
}, },
}, },
{
label: '',
field: orgCode,
component: 'Input',
show: false,
},
{ {
label: '员工编号', label: '员工编号',
field: 'workNo', field: 'workNo',
@@ -8,7 +8,7 @@
<user-info-modal @register="registerModal" /> <user-info-modal @register="registerModal" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts" name="userInfoList-name">
import BasicTable from '/@/components/Table/src/BasicTable.vue'; import BasicTable from '/@/components/Table/src/BasicTable.vue';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchSchema } from '/@/views/healthMonitor/healMonitorManage/monitorToll/userInfo/userInfo.data'; import { columns, searchSchema } from '/@/views/healthMonitor/healMonitorManage/monitorToll/userInfo/userInfo.data';
@@ -85,6 +85,13 @@ export const columns: BasicColumn[] = [
dataIndex: ['departTree', '3'], dataIndex: ['departTree', '3'],
width: 180, width: 180,
}, },
{
title: '非关爱人员',
align: 'center',
dataIndex: ['extension', 'nonCareFlag'],
width: 100,
slots: { customRender: 'nonCareTag' },
},
{ {
title: '出生日期', title: '出生日期',
align: 'center', align: 'center',
@@ -160,6 +167,17 @@ export const searchFormSchema: FormSchema[] = [
field: 'phone', field: 'phone',
component: 'Input', component: 'Input',
}, },
{
label: '非关爱人员',
field: 'nonCareFlag',
component: 'Select',
componentProps: {
options: [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
],
},
},
{ {
label: '单位名称', label: '单位名称',
field: 'orgCode', field: 'orgCode',
@@ -676,28 +694,44 @@ export const formSchema: (isUpdate: boolean) => FormSchema[] = (isUpdate) => {
label: '关爱联络员姓名', label: '关爱联络员姓名',
field: 'careLiaisonName', field: 'careLiaisonName',
component: 'Input', component: 'Input',
show: false,
}, },
{ {
label: '关爱联络员职务', label: '关爱联络员职务',
field: 'careLiaisonJob', field: 'careLiaisonJob',
component: 'Input', component: 'Input',
show: false,
}, },
{ {
label: '关爱联络员电话', label: '关爱联络员电话',
field: 'careLiaisonPhone', field: 'careLiaisonPhone',
component: 'Input', 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: '急救人员姓名', label: '急救人员姓名',
field: 'lifeguardName', field: 'lifeguardName',
component: 'Input', component: 'Input',
show: false,
}, },
{ {
label: '急救人员电话', label: '急救人员电话',
field: 'lifeguardPhone', field: 'lifeguardPhone',
component: 'Input', 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: '', label: '',
@@ -109,6 +109,10 @@
{{ record.status_dictText }} {{ record.status_dictText }}
</Tag> </Tag>
</template> </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> </BasicTable>
<!-- 表单区域 --> <!-- 表单区域 -->
<HealthUserEmployeeExDrawer :showFooter="showFooter" @register="registerDrawer" @success="handleSuccess" /> <HealthUserEmployeeExDrawer :showFooter="showFooter" @register="registerDrawer" @success="handleSuccess" />