解决合并冲突
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取住院患者列表
|
||||
*/
|
||||
export function getPatientList(queryParams) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/inpatient',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录人管理病区
|
||||
*/
|
||||
export function getWardList(queryParams) {
|
||||
return request({
|
||||
url: '/app-common/practitioner-ward',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前选中患者全部已执行医嘱
|
||||
*/
|
||||
export function getPrescriptionList(queryParams) {
|
||||
return request({
|
||||
url: '/nurse-station/medicine-summary/dispensing-form',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行医嘱
|
||||
*/
|
||||
export function adviceExecute(data) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/advice-execute',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消执行医嘱
|
||||
*/
|
||||
export function adviceCancel(data) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/advice-cancel',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 汇总领药申请
|
||||
*/
|
||||
export function medicineSummary(data) {
|
||||
return request({
|
||||
url: '/nurse-station/medicine-summary/medicine-summary',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询汇总领药单
|
||||
*/
|
||||
export function getMedicineSummary(param) {
|
||||
return request({
|
||||
url: '/nurse-station/medicine-summary/summary-form',
|
||||
method: 'get',
|
||||
params: param
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取汇总单详细信息
|
||||
*/
|
||||
export function getMedicineSummaryDetail(param) {
|
||||
return request({
|
||||
url: '/nurse-station/medicine-summary/summary-form-detail',
|
||||
method: 'get',
|
||||
params: param
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-input placeholder="住院号/姓名">
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="getPatientList" />
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
:load="loadNode"
|
||||
lazy
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
@node-click="handleNodeClick"
|
||||
@check="handleCheckChange"
|
||||
@node-expand="onNodeExpand"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="custom-tree-node" v-if="node.level === 2">
|
||||
<span>{{ data.bedName + ' / ' + node.label }}</span>
|
||||
<span class="tree-node-actions">
|
||||
{{ data.genderEnum_enumText + ' / ' + data.age }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getPatientList, getWardList } from './api';
|
||||
import { updatePatientInfoList } from '../store/patient';
|
||||
import { nextTick, onMounted } from 'vue';
|
||||
|
||||
const treeRef = ref(null);
|
||||
const allNodesLoaded = ref(false);
|
||||
// 树节点加载完成后的回调
|
||||
function onTreeLoaded() {
|
||||
if (!allNodesLoaded.value && treeRef.value) {
|
||||
// 等待DOM更新后设置全选
|
||||
nextTick(() => {
|
||||
// 获取所有节点并设置为选中状态
|
||||
const allNodes = getAllNodes(treeRef.value.store.root.childNodes);
|
||||
const allKeys = allNodes.map((node) => node.key);
|
||||
|
||||
treeRef.value.setCheckedKeys(allKeys, true); // 第二个参数设为true表示级联选中
|
||||
allNodesLoaded.value = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 递归获取所有节点
|
||||
function getAllNodes(nodes) {
|
||||
let result = [];
|
||||
if (nodes && nodes.length > 0) {
|
||||
nodes.forEach((node) => {
|
||||
result.push(node);
|
||||
if (node.childNodes && node.childNodes.length > 0) {
|
||||
result = result.concat(getAllNodes(node.childNodes));
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function loadNode(node, resolve) {
|
||||
// 初始加载:获取所有病区(父级节点)
|
||||
if (node.level === 0) {
|
||||
getWardList().then((res) => {
|
||||
// 确保病区节点不是叶子节点
|
||||
const wards = res.map((ward) => ({
|
||||
...ward,
|
||||
leaf: false,
|
||||
}));
|
||||
return resolve(wards);
|
||||
});
|
||||
}
|
||||
// 展开病区节点时:获取该病区下的患者列表
|
||||
else if (node.level === 1) {
|
||||
const wardId = node.data.id;
|
||||
getPatientList({ wardId: wardId }).then((res) => {
|
||||
let children = res.data.records.map((item) => {
|
||||
return {
|
||||
leaf: true, // 患者节点为叶子节点
|
||||
...item,
|
||||
name: item.patientName,
|
||||
};
|
||||
});
|
||||
return resolve(children);
|
||||
});
|
||||
}
|
||||
// 更深层级直接返回空数组
|
||||
else {
|
||||
return resolve([]);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取所有选中的子节点(叶子节点)
|
||||
function getCheckedLeafNodes() {
|
||||
if (!treeRef.value) return [];
|
||||
|
||||
// 获取所有选中的节点key
|
||||
const checkedKeys = treeRef.value.getCheckedKeys();
|
||||
// 获取所有半选中的节点key(父节点)
|
||||
const halfCheckedKeys = treeRef.value.getHalfCheckedKeys();
|
||||
|
||||
// 获取所有选中的节点数据
|
||||
const checkedNodes = treeRef.value.getCheckedNodes();
|
||||
|
||||
// 只返回叶子节点(患者节点)
|
||||
return checkedNodes.filter((node) => node.leaf === true);
|
||||
}
|
||||
|
||||
// 处理节点选中状态变化
|
||||
function handleCheckChange(data, checked) {
|
||||
// 可以在这里处理选中状态变化的逻辑
|
||||
let list = getCheckedLeafNodes();
|
||||
console.log(list, '2345678');
|
||||
|
||||
updatePatientInfoList(list);
|
||||
handleGetPrescription();
|
||||
}
|
||||
const handleGetPrescription = inject('handleGetPrescription');
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.custom-tree-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tree-node-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
:deep(.el-tree-node__content) {
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,327 @@
|
||||
<template>
|
||||
<div style="height: calc(100vh - 176px)">
|
||||
<div
|
||||
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-collapse
|
||||
v-model="activeNames"
|
||||
expand-icon-position="left"
|
||||
v-if="prescriptionList.length > 0"
|
||||
style="
|
||||
border-bottom: 0px;
|
||||
border-top: 0px;
|
||||
border-radius: 0px;
|
||||
overflow-y: auto;
|
||||
max-height: calc(100vh - 200px);
|
||||
"
|
||||
>
|
||||
<el-collapse-item
|
||||
v-for="(item, index) in prescriptionList"
|
||||
:key="index"
|
||||
:name="item[0].encounterId"
|
||||
style="
|
||||
border: 2px solid #e4e7ed;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 10px;
|
||||
overflow: hidden;
|
||||
"
|
||||
>
|
||||
<template #title>
|
||||
<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
|
||||
: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">
|
||||
<span :style="scope.row.therapyEnum == '1' ? 'color: #a6745c' : 'color: #3787a5'">
|
||||
{{ scope.row.therapyEnum_enumText }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="医嘱内容" prop="adviceName">
|
||||
<template #default="scope">
|
||||
<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="requestTime" width="150">
|
||||
<template #default="scope">
|
||||
{{ '1支' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="取药科室" prop="requestTime" width="150">
|
||||
<template #default="scope">
|
||||
{{ scope.row.positionName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领药时间" prop="times">
|
||||
<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[item]"
|
||||
style="display: inline-block; margin-left: 15px"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="(rateItem, rateIndex) in scope.row.rate[item]"
|
||||
:key="rateIndex"
|
||||
:value="rateItem.rate"
|
||||
@change="(value) => handleRateChange(value, rateItem, scope.row)"
|
||||
border
|
||||
size="small"
|
||||
style="margin-right: 15px"
|
||||
>
|
||||
{{ rateItem.rate }}
|
||||
<template v-if="rateItem.practitionerName">
|
||||
{{ rateItem.practitionerName }}
|
||||
</template>
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<el-empty v-else description="点击查询获取患者医嘱信息"></el-empty>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getPrescriptionList, adviceExecute, adviceCancel, medicineSummary } from './api';
|
||||
import { patientInfoList } from '../store/patient.js';
|
||||
import { formatDate, formatDateStr } from '@/utils/index';
|
||||
import { ref, getCurrentInstance } from 'vue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
|
||||
const activeNames = ref([]);
|
||||
|
||||
const userStore = useUserStore();
|
||||
const prescriptionList = ref([]);
|
||||
const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
|
||||
const therapyEnum = ref(undefined);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(false);
|
||||
const chooseAll = ref(false);
|
||||
const props = defineProps({
|
||||
exeStatus: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
requestStatus: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
deadline: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
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,
|
||||
therapyEnum: therapyEnum.value,
|
||||
exeStatus: props.exeStatus,
|
||||
requestStatus: props.requestStatus,
|
||||
}).then((res) => {
|
||||
// try {
|
||||
// 根据encounterId分组
|
||||
const groupedPrescriptions = res.data.records.reduce((groups, prescription) => {
|
||||
let times = new Set();
|
||||
let rate = {};
|
||||
let checkedRates = {};
|
||||
// 汇总时间点 默认全部汇总
|
||||
prescription.dispenseIds = [];
|
||||
prescription.medicineSummaryParamList.forEach((item) => {
|
||||
// 已汇总的时间点不需要显示
|
||||
if (item.dispenseStatus != 8) {
|
||||
prescription.dispenseIds.push({
|
||||
dispenseId: item.dispenseId,
|
||||
receiverId: userStore.id,
|
||||
});
|
||||
|
||||
// 将全部的时间点拆分 把日期去重,页面显示示例 05-15 [01:30 02:30 03:30]
|
||||
let time = item.dispenseTime.substring(5, 10);
|
||||
let rateTime = item.dispenseTime.substring(11, 16);
|
||||
times.add(time);
|
||||
rate[time] = rate[time] || [];
|
||||
rate[time].push({ rate: rateTime, dispenseId: item.dispenseId });
|
||||
checkedRates[time] = checkedRates[time] || [];
|
||||
checkedRates[time].push(rateTime);
|
||||
}
|
||||
});
|
||||
|
||||
prescription.times = Array.from(times);
|
||||
prescription.rate = rate;
|
||||
prescription.checkedRates = checkedRates;
|
||||
// 把相同encounterId的医嘱放在同一个数组中
|
||||
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);
|
||||
loading.value = false;
|
||||
// } catch {
|
||||
// loading.value = false;
|
||||
// }
|
||||
});
|
||||
chooseAll.value = false;
|
||||
} else {
|
||||
prescriptionList.value = [];
|
||||
// proxy.$message.warning('请选择患者');
|
||||
}
|
||||
}
|
||||
|
||||
function handleMedicineSummary() {
|
||||
let paramList = getSelectRows();
|
||||
let ids = [];
|
||||
paramList = paramList.forEach((item) => {
|
||||
ids.push(...item.dispenseIds);
|
||||
});
|
||||
medicineSummary(ids).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$message.success('操作成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getSelectRows() {
|
||||
// 获取选中的医嘱信息
|
||||
let list = [];
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
|
||||
});
|
||||
return list;
|
||||
}
|
||||
function handleRateChange(value, item, row) {
|
||||
// 拼接当前选中时间
|
||||
if (value) {
|
||||
row.dispenseIds.push({ dispenseId: item.dispenseId, receiverId: userStore.id });
|
||||
} else {
|
||||
row.dispenseIds.splice(
|
||||
row.dispenseIds.findIndex((k) => {
|
||||
return k.dispenseId === item.dispenseId;
|
||||
}),
|
||||
1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleGetPrescription,
|
||||
handleMedicineSummary,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-collapse-icon-position-left :deep(.el-collapse-item__header) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__wrap) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* 表头背景色 */
|
||||
:deep(.prescription-table .el-table__header th) {
|
||||
background-color: #eef9fd !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__row:hover > td) {
|
||||
background-color: #eef9fd !important;
|
||||
}
|
||||
|
||||
.item-value {
|
||||
color: #606266;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div style="height: calc(100vh - 176px)">
|
||||
<div
|
||||
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-table
|
||||
:data="medicineSummaryFormList"
|
||||
border
|
||||
:ref="'tableRef' + index"
|
||||
:header-cell-style="{ background: '#eef9fd !important' }"
|
||||
>
|
||||
<el-table-column label="单据号" prop="busNo" align="center" width="180" />
|
||||
<el-table-column label="申请时间" align="center" prop="applyTime" />
|
||||
<el-table-column label="发药时间" align="center" prop="dispenseTime" />
|
||||
<el-table-column label="药房" align="center" prop="locationName" />
|
||||
<el-table-column label="申请人" align="center" prop="applicantName" />
|
||||
<el-table-column label="领药人" align="center" prop="receiverName" />
|
||||
<el-table-column label="发药状态" align="center" prop="statusEnum_enumText" />
|
||||
<el-table-column label="操作" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="getDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible" title="汇总单详情" width="900">
|
||||
<el-table
|
||||
:data="medicineSummaryFormDetails"
|
||||
border
|
||||
:header-cell-style="{ background: '#eef9fd !important' }"
|
||||
>
|
||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column label="药品名称" prop="itemName" align="center" />
|
||||
<el-table-column label="规格" prop="totalVolume" align="center" width="180" />
|
||||
<el-table-column label="批次号" prop="lotNumber" align="center" width="180" />
|
||||
<el-table-column label="数量" prop="itemQuantity" align="center" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.itemQuantity + ' ' + scope.row.minUnitCode_dictText }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getMedicineSummary, getMedicineSummaryDetail } from './api';
|
||||
import { patientInfoList } from '../store/patient.js';
|
||||
import { ref, getCurrentInstance } from 'vue';
|
||||
|
||||
const medicineSummaryFormList = ref([]);
|
||||
const medicineSummaryFormDetails = ref([]);
|
||||
const dialogVisible = ref(false);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(false);
|
||||
const props = defineProps({
|
||||
exeStatus: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
requestStatus: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
});
|
||||
|
||||
handleGetPrescription();
|
||||
function handleGetPrescription() {
|
||||
loading.value = true;
|
||||
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
|
||||
getMedicineSummary({}).then((res) => {
|
||||
medicineSummaryFormList.value = res.data.records;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 获取发药单详情
|
||||
function getDetail(row) {
|
||||
getMedicineSummaryDetail({ summaryNo: row.busNo }).then((res) => {
|
||||
medicineSummaryFormDetails.value = res.data;
|
||||
dialogVisible.value = true;
|
||||
});
|
||||
}
|
||||
|
||||
function handleExecute() {
|
||||
let list = getSelectRows();
|
||||
list = list.map((item) => {
|
||||
return {
|
||||
requestId: item.requestId,
|
||||
accountId: item.accountId,
|
||||
adviceTable: item.adviceTable,
|
||||
executeTimes: item.executeTimes,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function handleCancel() {
|
||||
let list = getSelectRows();
|
||||
console.log(list, 'list');
|
||||
list = list.map((item) => {
|
||||
return {
|
||||
procedureId: item.procedureId,
|
||||
executeTimes: item.cancelTimes,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function getSelectRows() {
|
||||
// 获取选中的医嘱信息
|
||||
let list = [];
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个日期之间的所有日期(包含起始和结束日期)
|
||||
* @param {string|Date} startDate - 开始日期
|
||||
* @param {string|Date} endDate - 结束日期
|
||||
* @returns {Array<string>} 格式为MM-DD的日期数组
|
||||
*/
|
||||
function getDateRange(startDate, endDate) {
|
||||
const start = new Date(startDate);
|
||||
const end = new Date(endDate);
|
||||
|
||||
// 重置时间部分,只保留日期
|
||||
start.setHours(0, 0, 0, 0);
|
||||
end.setHours(0, 0, 0, 0);
|
||||
|
||||
const dates = [];
|
||||
const current = new Date(start);
|
||||
|
||||
// 循环添加日期直到结束日期
|
||||
while (current <= end) {
|
||||
// 格式化为MM-DD
|
||||
const month = String(current.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(current.getDate()).padStart(2, '0');
|
||||
dates.push(`${month}-${day}`);
|
||||
|
||||
// 移动到下一天
|
||||
current.setDate(current.getDate() + 1);
|
||||
}
|
||||
return dates;
|
||||
}
|
||||
|
||||
function handleRateChange(value, date, time, row) {
|
||||
// 拼接当前选中时间
|
||||
let tiemStr = row.year + '-' + date + ' ' + time + ':00';
|
||||
if (value) {
|
||||
row.executeTimes.push(tiemStr);
|
||||
} else {
|
||||
row.executeTimes.splice(row.executeTimes.indexOf(tiemStr), 1);
|
||||
}
|
||||
console.log(row.executeTimes, 'row.executeTimes');
|
||||
}
|
||||
|
||||
function handelSwicthChange(value) {
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
proxy.$refs['tableRef' + index][0].toggleAllSelection();
|
||||
});
|
||||
}
|
||||
|
||||
// 处理后端返回的时间集合
|
||||
function handleTime() {}
|
||||
|
||||
defineExpose({
|
||||
handleGetPrescription,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-collapse-icon-position-left :deep(.el-collapse-item__header) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__wrap) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* 表头背景色 */
|
||||
:deep(.prescription-table .el-table__header th) {
|
||||
background-color: #eef9fd !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__row:hover > td) {
|
||||
background-color: #eef9fd !important;
|
||||
}
|
||||
|
||||
.item-value {
|
||||
color: #606266;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
@@ -1,26 +1,296 @@
|
||||
<template>
|
||||
<div class="drugDistribution-container">
|
||||
<patientList />
|
||||
<DrugDistributionList />
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 20%; height: 90vh; border-right: solid 2px #e4e7ed">
|
||||
<div
|
||||
style="
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
border-bottom: solid 2px #e4e7ed;
|
||||
"
|
||||
>
|
||||
<el-icon
|
||||
@click="refresh"
|
||||
class="refresh-icon"
|
||||
style="cursor: pointer; font-size: 20px; margin-right: 10px"
|
||||
>
|
||||
<Refresh />
|
||||
</el-icon>
|
||||
</div>
|
||||
<el-tabs v-model="active" class="demo-tabs centered-tabs tab-header" @tab-click="handleClick">
|
||||
<el-tab-pane label="在科" name="first" style="padding: 15px 10px">
|
||||
<PatientList />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="转科" name="second" style="padding: 0 10px">
|
||||
<PatientList />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div style="width: 100%">
|
||||
<div
|
||||
style="
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: solid 2px #e4e7ed;
|
||||
padding: 0 15px;
|
||||
background: linear-gradient(90deg, #f0f8ff, #e6f7ff);
|
||||
"
|
||||
>
|
||||
<div class="nav-button-group">
|
||||
<el-button
|
||||
v-for="nav in navigationButtons"
|
||||
:key="nav.path"
|
||||
:type="currentRoute.path === nav.path ? 'primary' : 'default'"
|
||||
size="small"
|
||||
@click="navigateTo(nav.path)"
|
||||
class="nav-button"
|
||||
:class="{ 'active-nav': currentRoute.path === nav.path }"
|
||||
>
|
||||
<el-icon v-if="nav.icon"><component :is="nav.icon" /></el-icon>
|
||||
<span>{{ nav.label }}</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
height: 50px;
|
||||
border-bottom: 2px solid #e4e7ed;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
"
|
||||
>
|
||||
<div>
|
||||
<el-radio-group class="ml10" v-model="drugType">
|
||||
<el-radio-button label="西药" value="1" />
|
||||
<el-radio-button label="中药" value="2" />
|
||||
</el-radio-group>
|
||||
<el-radio-group class="ml20" v-model="isDetails" @change="handleRadioChange">
|
||||
<el-radio-button label="明细" value="1" />
|
||||
<el-radio-button label="汇总" value="2" />
|
||||
</el-radio-group>
|
||||
<span class="descriptions-item-label">截止时间:</span>
|
||||
<el-date-picker
|
||||
v-model="deadline"
|
||||
type="datetime"
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
value-format="YYYY/MM/DD HH:mm:ss"
|
||||
:clearable="false"
|
||||
@change="handleGetPrescription"
|
||||
/>
|
||||
<el-radio-group v-model="therapyEnum" class="ml20" @change="handleRadioChange">
|
||||
<el-radio :value="undefined">全部</el-radio>
|
||||
<el-radio :value="1">长期</el-radio>
|
||||
<el-radio :value="2">临时</el-radio>
|
||||
</el-radio-group>
|
||||
<el-button class="ml20" type="primary" plain @click="handleGetPrescription">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<span class="descriptions-item-label">全选:</span>
|
||||
<el-switch v-model="chooseAll" @change="handelSwicthChange" />
|
||||
<el-button class="ml20 mr20" type="primary" @click="handleExecute"> 汇总领药 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
<PrescriptionList
|
||||
v-if="isDetails == 1"
|
||||
ref="prescriptionRefs"
|
||||
:exeStatus="exeStatus"
|
||||
:requestStatus="requestStatus"
|
||||
:deadline="deadline"
|
||||
/>
|
||||
<SummaryMedicineList v-else />
|
||||
<!-- <el-tabs v-model="activeName" class="demo-tabs centered-tabs" @tab-change="handleClick">
|
||||
<el-tab-pane
|
||||
v-for="tab in prescriptionTabs"
|
||||
:key="tab.name"
|
||||
:lazy="true"
|
||||
:label="tab.label"
|
||||
:name="tab.name"
|
||||
>
|
||||
<PrescriptionList
|
||||
:exeStatus="exeStatus"
|
||||
:requestStatus="requestStatus"
|
||||
:ref="(el) => setPrescriptionRef(el, tab.name)"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup >
|
||||
import patientList from './patientList.vue'
|
||||
import DrugDistributionList from './drugDistributionList.vue'
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.drugDistribution-container {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
.patientList-container {
|
||||
flex: none;
|
||||
width: 240px;
|
||||
}
|
||||
<script setup>
|
||||
import { getCurrentInstance, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import PatientList from './components/patientList.vue';
|
||||
import PrescriptionList from './components/prescriptionList.vue';
|
||||
import SummaryMedicineList from './components/summaryMedicineList.vue';
|
||||
|
||||
.medicalOrderList-container {
|
||||
flex: 1;
|
||||
const { proxy } = getCurrentInstance();
|
||||
const router = useRouter();
|
||||
const currentRoute = useRoute();
|
||||
|
||||
const activeName = ref('preparation');
|
||||
const active = ref('first');
|
||||
const exeStatus = ref(1);
|
||||
const deadline = ref(proxy.formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
|
||||
const requestStatus = ref(3);
|
||||
const chooseAll = ref(false);
|
||||
const drugType = ref('1');
|
||||
const isDetails = ref('1');
|
||||
|
||||
// 存储子组件引用的对象
|
||||
const prescriptionRefs = ref();
|
||||
|
||||
// 导航按钮配置
|
||||
const navigationButtons = ref([
|
||||
{
|
||||
label: '入出转',
|
||||
path: '/inHospital/statistics/inOut',
|
||||
icon: 'Document',
|
||||
},
|
||||
{
|
||||
label: '护理记录',
|
||||
path: '/inHospital/statistics/nursingRecord',
|
||||
icon: 'MedicineBox',
|
||||
},
|
||||
{
|
||||
label: '三测单',
|
||||
path: '/inHospital/statistics/tprChart',
|
||||
icon: 'List',
|
||||
},
|
||||
{
|
||||
label: '医嘱执行',
|
||||
path: '/inHospital/statistics/medicalOrderExecution',
|
||||
icon: 'Back',
|
||||
},
|
||||
{
|
||||
label: '医嘱校对',
|
||||
path: '/inHospital/statistics/medicalOrderProofread',
|
||||
icon: 'Back',
|
||||
},
|
||||
{
|
||||
label: '汇总发药申请',
|
||||
path: '/inHospital/statistics/drugDistribution',
|
||||
icon: 'Back',
|
||||
},
|
||||
{
|
||||
label: '住院记账',
|
||||
path: '/inHospital/statistics/InpatientBilling',
|
||||
icon: 'Back',
|
||||
},
|
||||
]);
|
||||
|
||||
// 页面导航方法
|
||||
const navigateTo = (path) => {
|
||||
router.push(path);
|
||||
};
|
||||
|
||||
// 定义处方列表tabs配置
|
||||
const prescriptionTabs = [
|
||||
{ label: '待执行', name: 'preparation' },
|
||||
{ label: '已执行', name: 'completed' },
|
||||
{ label: '不执行', name: 'stopped' },
|
||||
{ label: '取消执行', name: 'cancel' },
|
||||
];
|
||||
|
||||
function handleClick(tabName) {
|
||||
// tabName是tab的name属性值
|
||||
const activeTabName = tabName || activeName.value;
|
||||
|
||||
switch (activeTabName) {
|
||||
case 'preparation':
|
||||
// 执行状态待执行
|
||||
exeStatus.value = 1;
|
||||
// 请求状态已校对
|
||||
requestStatus.value = 3;
|
||||
break;
|
||||
case 'completed':
|
||||
exeStatus.value = 6;
|
||||
break;
|
||||
case 'stopped':
|
||||
exeStatus.value = 5;
|
||||
break;
|
||||
case 'cancel':
|
||||
exeStatus.value = 9;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function handleGetPrescription() {
|
||||
prescriptionRefs.value.handleGetPrescription();
|
||||
}
|
||||
|
||||
function handelSwicthChange() {
|
||||
if (chooseAll.value) {
|
||||
proxy.$refs['prescriptionRefs'].selectAllRows();
|
||||
} else {
|
||||
proxy.$refs['prescriptionRefs'].clearSelection();
|
||||
}
|
||||
}
|
||||
|
||||
function handleRadioChange(value) {
|
||||
if (value == '1') {
|
||||
handleGetPrescription();
|
||||
}
|
||||
}
|
||||
|
||||
function handleExecute() {
|
||||
proxy.$refs['prescriptionRefs'].handleMedicineSummary();
|
||||
}
|
||||
|
||||
provide('handleGetPrescription', (value) => {
|
||||
prescriptionRefs.value.handleGetPrescription();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.centered-tabs :deep(.el-tabs__nav-wrap) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.centered-tabs :deep(.el-tabs__nav-scroll) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.tab-header :deep(.el-tabs__item) {
|
||||
height: 50px !important;
|
||||
}
|
||||
|
||||
.centered-tabs :deep(.el-tabs__nav) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
:deep(.el-tabs__header) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.nav-button-group {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.nav-button {
|
||||
transition: all 0.3s ease;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.nav-button:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.nav-button.active-nav {
|
||||
box-shadow: 0 4px 8px rgba(64, 158, 255, 0.3);
|
||||
}
|
||||
|
||||
.nav-button :deep(.el-icon) {
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,12 @@
|
||||
// 选择患者信息
|
||||
export const patientInfo = ref()
|
||||
export function updatePatientInfo(info) {
|
||||
patientInfo.value = info
|
||||
}
|
||||
|
||||
// 多选患者
|
||||
export const patientInfoList = ref([])
|
||||
export function updatePatientInfoList(info) {
|
||||
patientInfoList.value = info
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user