版本更新

This commit is contained in:
Zhang.WH
2025-10-16 17:38:08 +08:00
parent f515bb8fbb
commit e4c5f36f2e
488 changed files with 41436 additions and 2901 deletions

View File

@@ -21,9 +21,9 @@
</div>
<div>
<span class="descriptions-item-label">全选</span>
<el-switch/>
<el-button class="ml20" type="primary"> 核对通过 </el-button>
<el-button class="ml20 mr20" type="danger"> 退回 </el-button>
<el-switch v-model="chooseAll" @change="handelSwicthChange" />
<el-button class="ml20" type="primary" @click="handleCheck"> 核对通过 </el-button>
<el-button class="ml20 mr20" type="danger" @click="handleCancel"> 退回 </el-button>
</div>
</div>
<div
@@ -54,11 +54,60 @@
"
>
<template #title>
<span>11202501010101</span>
<span>张先生//20</span>
<span>自费</span>
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<span>{{ item[0].bedName + '【' + item[0].busNo + '】' }}</span>
<span>
{{
item[0].patientName + ' / ' + item[0].genderEnum_enumText + ' / ' + item[0].age
}}
</span>
<el-tag style="margin-left: 10px">{{ item[0].contractName }}</el-tag>
<span style="margin-left: 30px; font-weight: 600">
{{ item[0].conditionNames }}
</span>
</div>
<div
style="
display: flex;
justify-content: space-between;
gap: 20px;
align-items: center;
margin-right: 20px;
"
>
<div style="display: inline-block; margin-right: 10px">
<span class="descriptions-item-label">住院医生</span>
<span>{{ item[0].requesterId_dictText }}</span>
</div>
<div style="display: inline-block; margin-right: 10px">
<div
class="descriptions-item-label"
style="height: 20px; line-height: 20px; text-align: center; margin: 0"
>
预交金额
</div>
<div
style="
height: 20px;
line-height: 20px;
text-align: center;
font-size: 15px;
color: #ec8c43;
"
>
{{ item[0].balanceAmount?.toFixed(2) }}
</div>
</div>
</div>
</div>
</template>
<el-table :data="item" border :header-cell-style="{ background: '#eef9fd !important' }">
<el-table
:data="item"
border
:ref="'tableRef' + index"
:header-cell-style="{ background: '#eef9fd !important' }"
>
<el-table-column type="selection" align="center" width="50" />
<el-table-column label="类型" align="center" prop="therapyEnum_enumText" width="80">
<template #default="scope">
@@ -67,34 +116,32 @@
</span>
</template>
</el-table-column>
<el-table-column label="医嘱内容" prop="adviceName" />
<el-table-column label="开始/终止" prop="requestTime" width="230" />
<el-table-column label="预计执行" prop="times">
<el-table-column label="医嘱内容" prop="adviceName">
<template #default="scope">
<div
v-for="(item, timeIndex) in scope.row.times"
:key="timeIndex"
style="padding-bottom: 5px"
>
<span>{{ item }}</span>
<el-checkbox-group
v-model="scope.row.checkedRates[timeIndex]"
style="display: inline-block; margin-left: 15px"
>
<el-checkbox
v-for="(rateItem, rateIndex) in scope.row.rate"
:key="rateIndex"
:value="rateItem"
border
size="small"
style="margin-right: 15px"
>
{{ rateItem }}
</el-checkbox>
</el-checkbox-group>
</div>
<span>
{{ scope.row.adviceName }}
</span>
<template v-if="scope.row.adviceTable == 'med_medication_request'">
<span>
{{ ' 【' + scope.row.volume + '】' }}
</span>
<span style="color: #447c95 !important">
{{
'(' +
scope.row.methodCode_dictText +
' ' +
scope.row.dose +
scope.row.doseUnitCode_dictText +
' ' +
scope.row.rateCode_dictText +
')'
}}
</span>
</template>
</template>
</el-table-column>
<el-table-column label="执行科室" prop="positionName" width="230" />
<el-table-column label="签发时间" prop="requestTime" width="230" />
</el-table>
</el-collapse-item>
</el-collapse>
@@ -102,11 +149,10 @@
</div>
</div>
</template>
<script setup>
import { getPrescriptionList } from './api';
import { getPrescriptionList, adviceVerify, cancel } from './api';
import { patientInfoList } from '../store/patient.js';
import { formatDate, formatDateStr } from '@/utils/index';
import { formatDateStr } from '@/utils/index';
const activeNames = ref([]);
const prescriptionList = ref([]);
@@ -114,54 +160,109 @@ const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
const type = ref(1);
const { proxy } = getCurrentInstance();
const loading = ref(false);
const chooseAll = ref(false);
const props = defineProps({
requestStatus: {
type: Number,
default: 2,
},
});
function handleRadioChange() {
handleGetPrescription();
}
function handleGetPrescription() {
if (patientInfoList.value.length > 0) {
loading.value = true;
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
getPrescriptionList({ encounterIds: encounterIds, pageSize: 10000, pageNo: 1 }).then((res) => {
getPrescriptionList({
encounterIds: encounterIds,
requestStatus: props.requestStatus,
pageSize: 10000,
pageNo: 1,
}).then((res) => {
// try {
// 根据encounterId分组
const groupedPrescriptions = res.data.records.reduce((groups, prescription) => {
// 获取当前医嘱全部执行频次
let rate = prescription.dayTimes?.split(',');
let times = getDateRange(prescription.requestTime, deadline.value);
prescription.times = times;
prescription.rate = rate;
// 根据encounterId分组
const groupedPrescriptions = res.data.records.reduce((groups, prescription) => {
const encounterId = prescription.encounterId;
if (!groups[encounterId]) {
groups[encounterId] = [];
}
if (!activeNames.value.includes(encounterId)) {
activeNames.value.push(encounterId);
}
groups[encounterId].push(prescription);
return groups;
}, {});
// 添加复选框状态管理
prescription.checkedRates = {};
if (rate) {
times.forEach((time, index) => {
// 默认选中所有执行频次
prescription.checkedRates[index] = [...rate];
});
}
const encounterId = prescription.encounterId;
if (!groups[encounterId]) {
groups[encounterId] = [];
}
if (!activeNames.value.includes(encounterId)) {
activeNames.value.push(encounterId);
}
groups[encounterId].push(prescription);
return groups;
}, {});
// 将分组结果转换为数组形式
prescriptionList.value = Object.values(groupedPrescriptions);
console.log(prescriptionList.value, '1111');
loading.value = false;
// } catch {
// loading.value = false;
// }
// 将分组结果转换为数组形式
prescriptionList.value = Object.values(groupedPrescriptions);
console.log(prescriptionList.value, '1111');
loading.value = false;
});
chooseAll.value = false;
} else {
proxy.$message.warning('请选择患者');
}
}
/**
* 核对通过
*/
function handleCheck() {
let list = getSelectRows();
if (list.length > 0) {
adviceVerify(list).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess(res.msg);
handleGetPrescription();
}
});
console.log(list, 'list');
} else {
proxy.$message.warning('请先选择医嘱信息');
}
}
/**
* 退回
*/
function handleCancel() {
let list = getSelectRows();
if (list.length > 0) {
cancel(list).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess(res.msg);
handleGetPrescription();
}
});
console.log(list, 'list');
} else {
proxy.$message.warning('请先选择医嘱信息');
}
}
function getSelectRows() {
// 获取选中的医嘱信息
let list = [];
prescriptionList.value.forEach((item, index) => {
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
});
return list.map((item) => {
return {
requestId: item.requestId,
requestTable: item.adviceTable,
};
});
}
function handelSwicthChange(value) {
prescriptionList.value.forEach((item, index) => {
proxy.$refs['tableRef' + index][0].toggleAllSelection();
});
}
/**
* 计算两个日期之间的所有日期(包含起始和结束日期)
* @param {string|Date} startDate - 开始日期
@@ -194,6 +295,10 @@ function getDateRange(startDate, endDate) {
// 处理后端返回的时间集合
function handleTime() {}
defineExpose({
handleGetPrescription,
});
</script>
<style scoped>
@@ -211,6 +316,6 @@ function handleTime() {}
}
:deep(.el-table__row:hover > td) {
background-color: #eef9fd !important;
background-color: #eef9fd !important;
}
</style>