401
门诊完诊审计日志错误:div_log 表中 pool_id 与 slot_id 存值与设计规范不符 400 门诊医生站点击【完诊】后,triage_queue_item 表 status 字段未按规范更新为 30 393 疾病报告管理-报告卡管理:状态为“审核失败”的报卡操作列缺失“审核”按钮 369 【住院管理】进入护理记录模块报错 361 三测单(体温单)住院第一日显示 1970-01-01,未正确获取入院日期
This commit is contained in:
@@ -18,34 +18,33 @@ export const TOP_KEYS = [
|
||||
const timeNew = new Date((tieml / 1000 + 86400) * 1000);
|
||||
const todayDate = dayjs(timeNew).format('YYYY-MM-DD');
|
||||
const endDate = dayjs(outdate).format('YYYY-MM-DD');
|
||||
const startDate = dayjs(hospDate).format('YYYY-MM-DD');
|
||||
let eachTime = dayjs(beginDate).add(i, 'day').format('YYYY-MM-DD');
|
||||
let eachDate = dayjs(beginDate).add(i, 'day');
|
||||
const eachTime = eachDate.format('YYYY-MM-DD');
|
||||
if (eachTime === endDate || eachTime === todayDate) {
|
||||
dateClosed.stopTime = true;
|
||||
}
|
||||
if ((startDate === eachTime && i === 0) || dayjs(eachTime).format('MM-DD') === '01-01') {
|
||||
eachTime = dayjs(eachTime).format('YYYY年MM月DD日');
|
||||
} else if (i === 0 || dayjs(eachTime).format('DD') === '01') {
|
||||
eachTime = dayjs(eachTime).format('MM月DD日');
|
||||
} else {
|
||||
eachTime = dayjs(eachTime).format('DD日');
|
||||
}
|
||||
return dateClosed.stopTime ? eachTime : '';
|
||||
// 统一补零格式:月份和日期都始终两位补零
|
||||
const month = eachDate.format('MM'); // 月份始终两位补零
|
||||
const date = eachDate.format('DD'); // 日期始终两位补零
|
||||
// 每月1号显示 MM月DD日,其他日期只显示 DD日
|
||||
return `${month}月${date}日`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '住院日数',
|
||||
getValue: (i, renderData) => {
|
||||
const { beginDate, hospDays, outdate = '', dateClosed } = renderData.infoData;
|
||||
const tieml = new Date();
|
||||
const timeNew = new Date((tieml / 1000 + 86400) * 1000);
|
||||
const todayDate = dayjs(timeNew).format('YYYY-MM-DD');
|
||||
const endDate = dayjs(outdate).add(1, 'day').format('YYYY-MM-DD');
|
||||
const eachTime = dayjs(beginDate).add(i, 'day').format('YYYY-MM-DD');
|
||||
if (eachTime === endDate || todayDate === eachTime) {
|
||||
dateClosed.stopNumber = false;
|
||||
const beginDayjs = dayjs(beginDate);
|
||||
let num = '';
|
||||
// 只要 beginDate 有效,每一天都计算显示住院日数
|
||||
if (beginDayjs.isValid()) {
|
||||
if (hospDays !== undefined && hospDays !== null) {
|
||||
num = hospDays + i + 1;
|
||||
} else {
|
||||
// hospDays 不存在时,从入院开始直接计算
|
||||
num = i + 1;
|
||||
}
|
||||
}
|
||||
const num = dateClosed.stopNumber ? hospDays + i + 1 : '';
|
||||
let hosNum = '';
|
||||
if (num !== '') {
|
||||
hosNum = '第' + '\xa0\xa0\xa0' + num + '\xa0\xa0\xa0' + '日';
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
<el-table-column label="操作" width="180" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-if="row.status === 1"
|
||||
v-if="row.status === 1 || row.status === 5"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleAudit(row)"
|
||||
@@ -944,10 +944,10 @@ async function handleReturnCard() {
|
||||
|
||||
// 批量审核
|
||||
function handleBatchAudit() {
|
||||
// 检查是否包含非待审核状态的报卡
|
||||
const nonPendingCards = selectedRows.value.filter(row => row.status !== 1);
|
||||
// 检查是否包含非可审核状态的报卡(只有待审核和审核失败可以批量审核)
|
||||
const nonPendingCards = selectedRows.value.filter(row => row.status !== 1 && row.status !== 5);
|
||||
if (nonPendingCards.length > 0) {
|
||||
ElMessage.warning('只能选择待审核状态的报卡');
|
||||
ElMessage.warning('只能选择待审核或审核失败状态的报卡');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -992,10 +992,10 @@ async function confirmBatchAudit() {
|
||||
|
||||
// 批量退回
|
||||
function handleBatchReturn() {
|
||||
// 检查是否包含非待审核状态的报卡
|
||||
const nonPendingCards = selectedRows.value.filter(row => row.status !== 1);
|
||||
// 检查是否包含非可审核状态的报卡(只有待审核和审核失败可以批量退回)
|
||||
const nonPendingCards = selectedRows.value.filter(row => row.status !== 1 && row.status !== 5);
|
||||
if (nonPendingCards.length > 0) {
|
||||
ElMessage.warning('只能选择待审核状态的报卡');
|
||||
ElMessage.warning('只能选择待审核或审核失败状态的报卡');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -329,11 +329,53 @@ function getSignsCharts() {
|
||||
getVitalSignsInfo(params).then((response) => {
|
||||
console.log('体温单返回值', response);
|
||||
if (response.code === 200) {
|
||||
// data1.grParamBOS.hospDate = data1.grParamBOS.inDate.substring(0, 10)
|
||||
data1.grParamBOS.hospDate =
|
||||
response.data.hospDate && response.data.hospDate.length > 10
|
||||
? response.data.hospDate.substring(0, 10)
|
||||
: response.data.hospDate;
|
||||
// 计算最终住院起始日期,多级 fallback
|
||||
let finalHospDate = null;
|
||||
|
||||
// 1. 优先用后端返回的入院日期
|
||||
if (response.data.hospDate) {
|
||||
if (typeof response.data.hospDate === 'string' && response.data.hospDate.length > 0) {
|
||||
let dateStr = String(response.data.hospDate).replace(/\//g, '-');
|
||||
// 解析年月日补零,得到 YYYY-MM-DD
|
||||
const parts = dateStr.split(/[ -]/);
|
||||
if (parts.length >= 3) {
|
||||
const year = parts[0].padStart(4, '0');
|
||||
const month = parts[1].padStart(2, '0');
|
||||
const day = parts[2].padStart(2, '0');
|
||||
finalHospDate = `${year}-${month}-${day}`;
|
||||
} else {
|
||||
finalHospDate = dateStr.substring(0, 10);
|
||||
}
|
||||
} else if (response.data.hospDate instanceof Date) {
|
||||
finalHospDate = new Date(response.data.hospDate).toISOString().substring(0, 10);
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 如果后端为空,使用从患者列表获取的入院日期
|
||||
if ((!finalHospDate || finalHospDate === 'null') && data1.grParamBOS.inDate) {
|
||||
if (typeof data1.grParamBOS.inDate === 'string' && data1.grParamBOS.inDate.length > 0) {
|
||||
let dateStr = String(data1.grParamBOS.inDate).replace(/\//g, '-');
|
||||
// 解析年月日补零,得到 YYYY-MM-DD
|
||||
const parts = dateStr.split(/[ -]/);
|
||||
if (parts.length >= 3) {
|
||||
const year = parts[0].padStart(4, '0');
|
||||
const month = parts[1].padStart(2, '0');
|
||||
const day = parts[2].padStart(2, '0');
|
||||
finalHospDate = `${year}-${month}-${day}`;
|
||||
} else {
|
||||
finalHospDate = dateStr.substring(0, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 如果都为空,使用今天日期作为默认值(绝对不会出现 Invalid Date)
|
||||
if (!finalHospDate || finalHospDate === 'null' || finalHospDate === 'undefined' || finalHospDate === '') {
|
||||
finalHospDate = getCurrentDate();
|
||||
console.warn('入院日期为空,使用今天日期作为默认值:', finalHospDate);
|
||||
}
|
||||
|
||||
console.log('最终住院起始日期:', finalHospDate);
|
||||
data1.grParamBOS.hospDate = finalHospDate;
|
||||
data1.grParamBOS.operaDate = response.data.operaDate;
|
||||
data1.grParamBOS.outdate = response.data.outdate;
|
||||
data1.rows = response.data.temperaturePulses.map((item) => ({
|
||||
@@ -381,9 +423,18 @@ function setTemperatureComp(data) {
|
||||
if (data !== undefined) {
|
||||
inputData.value = data;
|
||||
}
|
||||
const inDate = inputData.value.grParamBOS.hospDate;
|
||||
const outdate = inputData.value.grParamBOS.outdate;
|
||||
const begin = moment(new Date(inDate))
|
||||
let inDate = inputData.value.grParamBOS.hospDate;
|
||||
let outdate = inputData.value.grParamBOS.outdate;
|
||||
// 统一格式化日期:将 / 替换为 -,确保 moment 能正确解析
|
||||
if (inDate) {
|
||||
inDate = String(inDate).replace(/\//g, '-').substring(0, 10);
|
||||
inputData.value.grParamBOS.hospDate = inDate;
|
||||
}
|
||||
if (outdate) {
|
||||
outdate = String(outdate).replace(/\//g, '-').substring(0, 10);
|
||||
inputData.value.grParamBOS.outdate = outdate;
|
||||
}
|
||||
const begin = moment(inDate)
|
||||
.add(week.value * 7, 'day')
|
||||
.format('YYYY-MM-DD HH:mm:ss');
|
||||
inputData.value.grParamBOS.weekNo = week.value;
|
||||
@@ -442,16 +493,38 @@ function sliceData(data) {
|
||||
}
|
||||
// 计算时间差
|
||||
function dateDiff(start, end) {
|
||||
let diffTime = start ? moment(new Date()).diff(moment(start.substring(0, 10))) / 1000 : start;
|
||||
if (end) {
|
||||
diffTime = moment(end.substring(0, 10)).diff(moment(start.substring(0, 10))) / 1000;
|
||||
console.log('dateDiff start:', start, 'end:', end);
|
||||
// 如果开始日期无效,返回 0
|
||||
if (!start || start === 'null' || start === 'undefined') {
|
||||
console.log('start is null, return 0');
|
||||
return 0;
|
||||
}
|
||||
// 统一格式化日期:将 / 替换为 -,截取前10位
|
||||
let startStr = String(start).replace(/\//g, '-').substring(0, 10);
|
||||
const startMoment = moment(startStr);
|
||||
if (!startMoment.isValid()) {
|
||||
console.log('start is invalid, return 0');
|
||||
return 0;
|
||||
}
|
||||
let diffTime;
|
||||
if (end && end !== 'null' && end !== 'undefined') {
|
||||
let endStr = String(end).replace(/\//g, '-').substring(0, 10);
|
||||
const endMoment = moment(endStr);
|
||||
if (!endMoment.isValid()) {
|
||||
diffTime = moment(new Date()).diff(startMoment) / 1000;
|
||||
} else {
|
||||
diffTime = endMoment.diff(startMoment) / 1000;
|
||||
}
|
||||
} else {
|
||||
diffTime = moment(new Date()).diff(startMoment) / 1000;
|
||||
}
|
||||
console.log('diffTime:', diffTime);
|
||||
if (diffTime > 24 * 3600) {
|
||||
return Math.floor(diffTime / (24 * 3600));
|
||||
} else if (diffTime > 3600) {
|
||||
return '0';
|
||||
return 0;
|
||||
} else {
|
||||
return '0';
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
// 打印体温单 - 使用 hiprint
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<el-drawer v-model="isOpenDraw" :direction="direction" size="100%" :with-header="false">
|
||||
<el-drawer v-model="isOpenDraw" :direction="direction" size="100%" :with-header="false" :destroy-on-close="false">
|
||||
<template #default>
|
||||
<AddAttr ref="attrRef" @onSearcTem="onSearch"></AddAttr>
|
||||
</template>
|
||||
@@ -576,16 +576,19 @@ function setTemperatureComp(data) {
|
||||
init(sliceData(inputData.value));
|
||||
}
|
||||
function dateDiff(start, end) {
|
||||
let diffTime = start ? moment(new Date()).diff(moment(start.substring(0, 10))) / 1000 : start;
|
||||
if (!start) {
|
||||
return 0;
|
||||
}
|
||||
const startStr = start.substring(0, 10);
|
||||
let diffTime = start ? moment(new Date()).diff(moment(startStr)) / 1000 : 0;
|
||||
if (end) {
|
||||
diffTime = moment(end.substring(0, 10)).diff(moment(start.substring(0, 10))) / 1000;
|
||||
const endStr = end.substring(0, 10);
|
||||
diffTime = moment(endStr).diff(moment(startStr)) / 1000;
|
||||
}
|
||||
if (diffTime > 24 * 3600) {
|
||||
return Math.floor(diffTime / (24 * 3600));
|
||||
} else if (diffTime > 3600) {
|
||||
return '0';
|
||||
} else {
|
||||
return '0';
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
function getCurrentDate() {
|
||||
|
||||
@@ -817,7 +817,10 @@ const loadDataFromApi = async () => {
|
||||
doctor: item.practitionerName ?? '-',
|
||||
// 当前接口返回的是 practitionerUserId,保存为 practitionerId 供入队使用
|
||||
practitionerId: item.practitionerUserId ?? null,
|
||||
matchingRule: '-' // 这里先不做智能规则匹配
|
||||
matchingRule: '-', // 这里先不做智能规则匹配
|
||||
// 号源池和槽位信息(用于分诊队列)
|
||||
poolId: item.poolId ?? null,
|
||||
slotId: item.slotId ?? null
|
||||
}))
|
||||
console.log('【心内科】候选池已加载', originalCandidatePoolList.value.length, '条今天的数据')
|
||||
} else {
|
||||
@@ -1035,7 +1038,9 @@ const handleAddToQueue = async () => {
|
||||
healthcareName: c.appointmentType,
|
||||
practitionerName: c.doctor,
|
||||
practitionerId: c.practitionerId ?? null,
|
||||
roomNo: c.roomNo ?? c.room ?? null
|
||||
roomNo: c.roomNo ?? c.room ?? null,
|
||||
poolId: c.poolId ?? null,
|
||||
slotId: c.slotId ?? null
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1150,7 +1155,9 @@ const handleAddAllToQueue = async () => {
|
||||
healthcareName: c.appointmentType,
|
||||
practitionerName: c.doctor,
|
||||
practitionerId: c.practitionerId ?? null,
|
||||
roomNo: c.roomNo ?? c.room ?? null
|
||||
roomNo: c.roomNo ?? c.room ?? null,
|
||||
poolId: c.poolId ?? null,
|
||||
slotId: c.slotId ?? null
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user