uo
This commit is contained in:
@@ -1,120 +1,255 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
<el-form
|
||||||
<el-form-item label="医嘱执行时间">
|
:model="queryParams"
|
||||||
<!-- <el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
ref="queryRef"
|
||||||
start-placeholder="开始日期" end-placeholder="结束日期" style="width: auto;"></el-date-picker> -->
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
>
|
||||||
|
<el-form-item label="医嘱执行时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
type="datetimerange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
style="width: auto"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="" prop="searchKey">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.searchKey"
|
||||||
|
placeholder="门诊号/病人/ID"
|
||||||
|
clearable
|
||||||
|
style="width: 150px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-date-picker v-model="dateRange" type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期"
|
<el-form-item>
|
||||||
style="width: auto;" value-format="YYYY-MM-DD HH:mm:ss"/>
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
</el-form-item>
|
>搜索</el-button
|
||||||
<el-form-item label="" prop="searchKey">
|
>
|
||||||
<el-input v-model="queryParams.searchKey" placeholder="门诊号/病人/ID" clearable style="width: 180px"
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
@keyup.enter="handleQuery" />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-form>
|
||||||
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-table :data="patientList" border style="width: 100%" highlight-current-row @current-change="handleCurrentChange" >
|
<el-table
|
||||||
<el-table-column prop="prescriptionNo" label="处方号" width="120" />
|
:data="patientList"
|
||||||
<el-table-column prop="patientName" label="姓名" width="100" />
|
border
|
||||||
<el-table-column prop="genderEnum_enumText" label="性别" width="80" />
|
style="width: 100%; height: 73%"
|
||||||
<el-table-column prop="ageString" label="年龄" width="80" />
|
highlight-current-row
|
||||||
<el-table-column prop="idCard" label="身份证号" width="140" />
|
@current-change="handleCurrentChange"
|
||||||
</el-table>
|
>
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNo"
|
<el-table-column prop="prescriptionNo" label="处方号" width="120" />
|
||||||
v-model:limit="queryParams.pageSize" @pagination="getList"/>
|
<el-table-column prop="patientName" label="姓名" width="100" />
|
||||||
</div>
|
<el-table-column prop="genderEnum_enumText" label="性别" width="80" />
|
||||||
|
<el-table-column prop="ageString" label="年龄" width="80" />
|
||||||
<div class="right">
|
<el-table-column prop="idCard" label="身份证号" width="140" />
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
</el-table>
|
||||||
<el-form-item label="执行时间">
|
<pagination
|
||||||
<el-date-picker v-model="dateRangeRight" type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期"
|
v-show="total > 0"
|
||||||
style="width: auto;" value-format="YYYY-MM-DD HH:mm:ss"/>
|
:total="total"
|
||||||
</el-form-item>
|
v-model:page="queryParams.pageNo"
|
||||||
<el-form-item>
|
v-model:limit="queryParams.pageSize"
|
||||||
<el-button type="primary" icon="Search" @click="handleQueryRight" style="margin-left: 10px;">搜索</el-button>
|
@pagination="getList"
|
||||||
<el-button icon="Refresh" @click="resetQueryRight">重置</el-button>
|
/>
|
||||||
<el-button type="primary" icon="SuccessFilled" @click="handleSubmit">确认执行</el-button>
|
|
||||||
<el-button type="primary" plain icon="Printer" @click="resetQuery">打印患者卡</el-button>
|
|
||||||
<el-button type="primary" plain icon="Printer" @click="resetQuery">打印瓶签</el-button>
|
|
||||||
<el-button type="primary" plain icon="Printer" @click="resetQuery">打印输液单</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div>
|
|
||||||
<p style="margin: 0px 0px 10px 0px;">院注医嘱</p>
|
|
||||||
<el-table :data="infusionList" border style="width: 100%;height: 300px;" :row-style="rowStyle"
|
|
||||||
@selection-change="handleSelectionChange" ref="tableRef" >
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="组" width="50">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ markers[scope.$index] }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<!-- <el-table-column prop="groupId" label="组" width="60" /> -->
|
|
||||||
<el-table-column prop="executeNum" label="总执行次数" width="90" />
|
|
||||||
<el-table-column prop="doneNum" label="已执行次数" width="90" />
|
|
||||||
<el-table-column prop="doctorId_dictText" label="开单医生" width="100" />
|
|
||||||
<el-table-column prop="patientName" label="患者姓名" width="100" />
|
|
||||||
<el-table-column prop="genderEnum_enumText" label="性别" width="80" />
|
|
||||||
<el-table-column prop="prescriptionNo" label="处方号" width="140" />
|
|
||||||
<el-table-column prop="medicationInformation" label="药品信息" width="180" />
|
|
||||||
<el-table-column prop="medicationQuantity" label="药品数量" width="80" />
|
|
||||||
<el-table-column prop="rateCode" label="用药频次" width="80" />
|
|
||||||
<el-table-column prop="dose" label="单次剂量" width="160" />
|
|
||||||
<el-table-column prop="speed" label="输液速度" width="80" />
|
|
||||||
<el-table-column prop="performOrg_dictText" label="发放科室" width="120" />
|
|
||||||
<el-table-column prop="medicationStatusEnum_enumText" label="药品状态" width="100" />
|
|
||||||
<el-table-column prop="skinTestFlag_enumText" label="是否皮试" width="60" />
|
|
||||||
<!-- <el-table-column prop="clinicalStatusEnum_enumText" label="皮试结果" width="70" /> -->
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p style="margin: 13px 0px 10px 0px;">院注执行历史</p>
|
|
||||||
<el-table :data="historyRecordsList" border style="width: 100%;height: 300px;">
|
|
||||||
<el-table-column prop="occurrenceEndTime" label="执行时间" width="180" >
|
|
||||||
<template #default="scope">
|
|
||||||
<el-date-picker v-model="scope.row.occurrenceEndTime" type="datetime"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 170px;"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="performerId_dictText" label="执行人" width="80" />
|
|
||||||
<el-table-column prop="patientName" label="患者姓名" width="100" />
|
|
||||||
<el-table-column prop="prescriptionNo" label="处方号" width="100" />
|
|
||||||
<el-table-column prop="doctorId_dictText" label="开单医生" width="100" />
|
|
||||||
<el-table-column prop="medicationInformation" label="药品信息" width="180" />
|
|
||||||
<el-table-column prop="medicationQuantity" label="药品数量" width="80" />
|
|
||||||
<el-table-column prop="rateCode" label="用药频次" width="80" />
|
|
||||||
<el-table-column prop="dose" label="单词剂量" width="160" />
|
|
||||||
<el-table-column prop="speed" label="输液速度" width="80" />
|
|
||||||
<el-table-column prop="orgId_dictText" label="发放科室" width="120" />
|
|
||||||
<el-table-column prop="medicationStatusEnum_enumText" label="药品状态" width="100" />
|
|
||||||
<el-table-column label="操作" align="center" width="90" fixed="right" class-name="small-padding fixed-width">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdateTime(scope.row)">确认</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-dialog title="处方信息" v-model="showPrescription" width="60vw" :before-close="handleClose">
|
|
||||||
<prescriptioncard></prescriptioncard>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="right">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
>
|
||||||
|
<el-form-item label="执行时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRangeRight"
|
||||||
|
type="datetimerange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
style="width: auto"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="Search"
|
||||||
|
@click="handleQueryRight"
|
||||||
|
style="margin-left: 10px"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQueryRight">重置</el-button>
|
||||||
|
<el-button type="primary" icon="SuccessFilled" @click="handleSubmit"
|
||||||
|
>确认执行</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" plain icon="Printer" @click="resetQuery"
|
||||||
|
>打印患者卡</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" plain icon="Printer" @click="resetQuery"
|
||||||
|
>打印瓶签</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" plain icon="Printer" @click="resetQuery"
|
||||||
|
>打印输液单</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div>
|
||||||
|
<p style="margin: 0px 0px 10px 0px">院注医嘱</p>
|
||||||
|
<el-table
|
||||||
|
:data="infusionList"
|
||||||
|
border
|
||||||
|
style="width: 100%; height: 300px"
|
||||||
|
:row-style="rowStyle"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
ref="tableRef"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="组" width="50">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ markers[scope.$index] }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column prop="groupId" label="组" width="60" /> -->
|
||||||
|
<el-table-column prop="executeNum" label="总执行次数" width="90" />
|
||||||
|
<el-table-column prop="doneNum" label="已执行次数" width="90" />
|
||||||
|
<el-table-column
|
||||||
|
prop="doctorId_dictText"
|
||||||
|
label="开单医生"
|
||||||
|
width="100"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="patientName" label="患者姓名" width="100" />
|
||||||
|
<el-table-column prop="genderEnum_enumText" label="性别" width="80" />
|
||||||
|
<el-table-column prop="prescriptionNo" label="处方号" width="140" />
|
||||||
|
<el-table-column
|
||||||
|
prop="medicationInformation"
|
||||||
|
label="药品信息"
|
||||||
|
width="180"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="medicationQuantity"
|
||||||
|
label="药品数量"
|
||||||
|
width="80"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="rateCode" label="用药频次" width="80" />
|
||||||
|
<el-table-column prop="dose" label="单次剂量" width="160" />
|
||||||
|
<el-table-column prop="speed" label="输液速度" width="80" />
|
||||||
|
<el-table-column
|
||||||
|
prop="performOrg_dictText"
|
||||||
|
label="发放科室"
|
||||||
|
width="120"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="medicationStatusEnum_enumText"
|
||||||
|
label="药品状态"
|
||||||
|
width="100"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="skinTestFlag_enumText"
|
||||||
|
label="是否皮试"
|
||||||
|
width="60"
|
||||||
|
/>
|
||||||
|
<!-- <el-table-column prop="clinicalStatusEnum_enumText" label="皮试结果" width="70" /> -->
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p style="margin: 13px 0px 10px 0px">院注执行历史</p>
|
||||||
|
<el-table
|
||||||
|
:data="historyRecordsList"
|
||||||
|
border
|
||||||
|
style="width: 100%; height: 300px"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
prop="occurrenceEndTime"
|
||||||
|
label="执行时间"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="scope.row.occurrenceEndTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
style="width: 170px"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="performerId_dictText"
|
||||||
|
label="执行人"
|
||||||
|
width="80"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="patientName" label="患者姓名" width="100" />
|
||||||
|
<el-table-column prop="prescriptionNo" label="处方号" width="100" />
|
||||||
|
<el-table-column
|
||||||
|
prop="doctorId_dictText"
|
||||||
|
label="开单医生"
|
||||||
|
width="100"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="medicationInformation"
|
||||||
|
label="药品信息"
|
||||||
|
width="180"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="medicationQuantity"
|
||||||
|
label="药品数量"
|
||||||
|
width="80"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="rateCode" label="用药频次" width="80" />
|
||||||
|
<el-table-column prop="dose" label="单词剂量" width="160" />
|
||||||
|
<el-table-column prop="speed" label="输液速度" width="80" />
|
||||||
|
<el-table-column prop="orgId_dictText" label="发放科室" width="120" />
|
||||||
|
<el-table-column
|
||||||
|
prop="medicationStatusEnum_enumText"
|
||||||
|
label="药品状态"
|
||||||
|
width="100"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
width="90"
|
||||||
|
fixed="right"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdateTime(scope.row)"
|
||||||
|
>确认</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-dialog
|
||||||
|
title="处方信息"
|
||||||
|
v-model="showPrescription"
|
||||||
|
width="60vw"
|
||||||
|
:before-close="handleClose"
|
||||||
|
>
|
||||||
|
<prescriptioncard></prescriptioncard>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="InfusionRecord">
|
<script setup name="InfusionRecord">
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from "vue";
|
||||||
import { listPatients,updateInfusionRecord,listInfusionRecord,editPatientInfusionTime,
|
import {
|
||||||
listPatientInfusionRecord,listPatientInfusionPerformRecord } from './component/api';
|
listPatients,
|
||||||
|
updateInfusionRecord,
|
||||||
|
listInfusionRecord,
|
||||||
|
editPatientInfusionTime,
|
||||||
|
listPatientInfusionRecord,
|
||||||
|
listPatientInfusionPerformRecord,
|
||||||
|
} from "./component/api";
|
||||||
|
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
const showPrescription = ref(false);
|
const showPrescription = ref(false);
|
||||||
@@ -123,7 +258,7 @@ const selectedItems = ref(new Set());
|
|||||||
|
|
||||||
const tableRef = ref(null);
|
const tableRef = ref(null);
|
||||||
const selectedGroupIds = ref(new Set());
|
const selectedGroupIds = ref(new Set());
|
||||||
const selectedPrescriptionNos = ref(new Set());
|
const selectedPrescriptionNos = ref(new Set());
|
||||||
|
|
||||||
const currentRow = ref(null);
|
const currentRow = ref(null);
|
||||||
const dateRange = ref([]);
|
const dateRange = ref([]);
|
||||||
@@ -134,7 +269,7 @@ const infusionList = ref([]);
|
|||||||
const timeRightStart = ref([]);
|
const timeRightStart = ref([]);
|
||||||
const timeRightEnd = ref([]);
|
const timeRightEnd = ref([]);
|
||||||
|
|
||||||
const groupColors = ['#C6E2FF', '#FFFFFF'];
|
const groupColors = ["#C6E2FF", "#FFFFFF"];
|
||||||
const markers = ref([]);
|
const markers = ref([]);
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
@@ -142,189 +277,192 @@ const { proxy } = getCurrentInstance();
|
|||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
searchKey: undefined
|
searchKey: undefined,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const { queryParams } = toRefs(data);
|
const { queryParams } = toRefs(data);
|
||||||
|
|
||||||
/** 查询门诊输液列表 */
|
/** 查询门诊输液列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
listInfusionRecord(queryParams.value).then(response => {
|
listInfusionRecord(queryParams.value).then((response) => {
|
||||||
console.log('Full response1:', response);
|
console.log("Full response1:", response);
|
||||||
infusionList.value = response.data;
|
infusionList.value = response.data;
|
||||||
// 为每个 groupId 分配固定颜色
|
// 为每个 groupId 分配固定颜色
|
||||||
response.data.forEach(item => {
|
response.data.forEach((item) => {
|
||||||
const colorIndex = item.groupId % 2; // 奇偶性决定颜色索引
|
const colorIndex = item.groupId % 2; // 奇偶性决定颜色索引
|
||||||
item.color = groupColors[colorIndex];
|
item.color = groupColors[colorIndex];
|
||||||
});
|
|
||||||
|
|
||||||
// 更新表格行的样式
|
|
||||||
updateTableRowStyles();
|
|
||||||
|
|
||||||
// 统计每个 groupId 的行数
|
|
||||||
const groupCounts = countGroupRows(infusionList.value);
|
|
||||||
// 设置每行的标记
|
|
||||||
markers.value = getRowMarkers(groupCounts, infusionList.value);
|
|
||||||
});
|
});
|
||||||
listPatients().then(response => {
|
// 更新表格行的样式
|
||||||
patientList.value = response.data.records;
|
updateTableRowStyles();
|
||||||
});
|
// 统计每个 groupId 的行数
|
||||||
|
const groupCounts = countGroupRows(infusionList.value);
|
||||||
|
// 设置每行的标记
|
||||||
|
markers.value = getRowMarkers(groupCounts, infusionList.value);
|
||||||
|
});
|
||||||
|
listPatients().then((response) => {
|
||||||
|
patientList.value = response.data.records;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function updateTableRowStyles() {
|
function updateTableRowStyles() {
|
||||||
const tableRows = document.querySelectorAll(".infusion-table-row");
|
const tableRows = document.querySelectorAll(".infusion-table-row");
|
||||||
|
tableRows.forEach((row) => {
|
||||||
tableRows.forEach(row => {
|
const groupId = row.getAttribute("data-group-id");
|
||||||
const groupId = row.getAttribute("data-group-id");
|
const color = groupColors[groupId % 2]; // 奇偶性决定颜色
|
||||||
const color = groupColors[groupId % 2]; // 奇偶性决定颜色
|
if (color) {
|
||||||
|
row.style.backgroundColor = color;
|
||||||
if (color) {
|
}
|
||||||
row.style.backgroundColor = color;
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
if (dateRange.value) {
|
if (dateRange.value) {
|
||||||
queryParams.value.createTimeSTime = dateRange.value[0];
|
queryParams.value.createTimeSTime = dateRange.value[0];
|
||||||
queryParams.value.createTimeETime = dateRange.value[1];
|
queryParams.value.createTimeETime = dateRange.value[1];
|
||||||
} else {
|
} else {
|
||||||
queryParams.value.createTimeSTime = null;
|
queryParams.value.createTimeSTime = null;
|
||||||
queryParams.value.createTimeETime = null;
|
queryParams.value.createTimeETime = null;
|
||||||
}
|
}
|
||||||
queryParams.value.pageNo = 1;
|
queryParams.value.pageNo = 1;
|
||||||
listPatients(queryParams.value).then(response => {
|
listPatients(queryParams.value).then((response) => {
|
||||||
patientList.value = response.data.records;
|
patientList.value = response.data.records;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 右边搜索按钮操作 */
|
/** 右边搜索按钮操作 */
|
||||||
function handleQueryRight() {
|
function handleQueryRight() {
|
||||||
const createTimeSTime = dateRangeRight.value[0];
|
const createTimeSTime = dateRangeRight.value[0];
|
||||||
const createTimeETime = dateRangeRight.value[1];
|
const createTimeETime = dateRangeRight.value[1];
|
||||||
timeRightStart.value = createTimeSTime;
|
timeRightStart.value = createTimeSTime;
|
||||||
timeRightEnd.value = createTimeETime;
|
timeRightEnd.value = createTimeETime;
|
||||||
listInfusionRecord(createTimeSTime,createTimeETime).then(response => {
|
listInfusionRecord(createTimeSTime, createTimeETime).then((response) => {
|
||||||
infusionList.value = response.data;
|
infusionList.value = response.data;
|
||||||
});
|
|
||||||
listPatientInfusionPerformRecord(createTimeSTime,createTimeETime).then(response => {
|
|
||||||
historyRecordsList.value = response.data;
|
|
||||||
});
|
});
|
||||||
|
listPatientInfusionPerformRecord(createTimeSTime, createTimeETime).then(
|
||||||
|
(response) => {
|
||||||
|
historyRecordsList.value = response.data;
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
getList();
|
getList();
|
||||||
|
listPatientInfusionPerformRecord().then((response) => {
|
||||||
|
historyRecordsList.value = response.data;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 右边重置按钮操作 */
|
/** 右边重置按钮操作 */
|
||||||
function resetQueryRight() {
|
function resetQueryRight() {
|
||||||
if(historyRecordsList.value.length>0){
|
if (historyRecordsList.value.length > 0) {
|
||||||
dateRangeRight.value = [];
|
dateRangeRight.value = [];
|
||||||
listInfusionRecord().then(response => {
|
listInfusionRecord().then((response) => {
|
||||||
infusionList.value = response.data;
|
infusionList.value = response.data;
|
||||||
});
|
});
|
||||||
listPatientInfusionPerformRecord().then(response => {
|
listPatientInfusionPerformRecord().then((response) => {
|
||||||
historyRecordsList.value = response.data;
|
historyRecordsList.value = response.data;
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
// 清空选中状态
|
// 清空选中状态
|
||||||
selectedItems.value.clear();
|
selectedItems.value.clear();
|
||||||
selectedGroupIds.value.clear();
|
selectedGroupIds.value.clear();
|
||||||
dateRangeRight.value = [];
|
dateRangeRight.value = [];
|
||||||
// 取消表格所有行的选中状态
|
// 取消表格所有行的选中状态
|
||||||
infusionList.value.forEach(row => {
|
infusionList.value.forEach((row) => {
|
||||||
tableRef.value.toggleRowSelection(row, false);
|
tableRef.value.toggleRowSelection(row, false);
|
||||||
});
|
});
|
||||||
listPatientInfusionRecord(currentRow.value).then(response => {
|
listPatientInfusionRecord(currentRow.value).then((response) => {
|
||||||
infusionList.value = response.data;
|
infusionList.value = response.data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getRowMarkers(groupCounts, data) {
|
function getRowMarkers(groupCounts, data) {
|
||||||
const markers = new Array(data.length).fill('');
|
const markers = new Array(data.length).fill("");
|
||||||
|
|
||||||
groupCounts.forEach((groupInfo, groupId) => {
|
groupCounts.forEach((groupInfo, groupId) => {
|
||||||
const { count, indices } = groupInfo;
|
const { count, indices } = groupInfo;
|
||||||
if (count === 1) {
|
if (count === 1) {
|
||||||
// 如果只有一行,不显示标记
|
// 如果只有一行,不显示标记
|
||||||
return;
|
return;
|
||||||
} else if (count === 2) {
|
} else if (count === 2) {
|
||||||
// 如果有两行,分别显示左右括号
|
// 如果有两行,分别显示左右括号
|
||||||
markers[indices[0]] = '┏';
|
markers[indices[0]] = "┏";
|
||||||
markers[indices[1]] = '┗ ';
|
markers[indices[1]] = "┗ ";
|
||||||
} else {
|
} else {
|
||||||
// 如果有两行以上,第一条显示左括号,中间用竖线,最后一条显示右括号
|
// 如果有两行以上,第一条显示左括号,中间用竖线,最后一条显示右括号
|
||||||
markers[indices[0]] = '┏';
|
markers[indices[0]] = "┏";
|
||||||
for (let i = 1; i < indices.length - 1; i++) {
|
for (let i = 1; i < indices.length - 1; i++) {
|
||||||
markers[indices[i]] = '┃';
|
markers[indices[i]] = "┃";
|
||||||
}
|
}
|
||||||
markers[indices[indices.length - 1]] = '┗ ';
|
markers[indices[indices.length - 1]] = "┗ ";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return markers;
|
return markers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生成行数
|
||||||
function countGroupRows(data) {
|
function countGroupRows(data) {
|
||||||
const groupCounts = new Map();
|
const groupCounts = new Map();
|
||||||
data.forEach((item, index) => {
|
data.forEach((item, index) => {
|
||||||
if (!groupCounts.has(item.groupId)) {
|
if (!groupCounts.has(item.groupId)) {
|
||||||
groupCounts.set(item.groupId, { count: 0, indices: [] });
|
groupCounts.set(item.groupId, { count: 0, indices: [] });
|
||||||
}
|
}
|
||||||
const groupInfo = groupCounts.get(item.groupId);
|
const groupInfo = groupCounts.get(item.groupId);
|
||||||
groupInfo.count++;
|
groupInfo.count++;
|
||||||
groupInfo.indices.push(index);
|
groupInfo.indices.push(index);
|
||||||
});
|
});
|
||||||
return groupCounts;
|
return groupCounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行输液
|
// 执行输液
|
||||||
function handleSubmit(){
|
function handleSubmit() {
|
||||||
// 将 Set 转换为数组
|
const itemsList = Array.from(selectedItems.value);
|
||||||
const itemsList = Array.from(selectedItems.value);
|
// 如果没有有效数据,直接返回
|
||||||
// 如果没有有效数据,直接返回
|
if (itemsList.length === 0) {
|
||||||
if (itemsList.length === 0) {
|
proxy.$modal.msgError("没有有效的数据可供提交");
|
||||||
proxy.$modal.msgError("没有有效的数据可供提交");
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
const allCompleted = itemsList.every(item => item.medicationStatusEnum_enumText === "已完成");
|
|
||||||
|
|
||||||
if (!allCompleted) {
|
const allCompleted = itemsList.every(
|
||||||
// 如果存在未完成的药品,提示用户
|
(item) => item.medicationStatusEnum_enumText === "已完成"
|
||||||
proxy.$modal.msgError("存在未完成的药品,请检查后再提交");
|
);
|
||||||
return;
|
if (!allCompleted) {
|
||||||
}
|
// 如果存在未完成的药品,提示用户
|
||||||
const allExecuted = itemsList.every(item => item.executeNum === item.doneNum);
|
proxy.$modal.msgError("存在未完成的药品,请检查后再提交");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (allExecuted) {
|
const allExecuted = itemsList.every(
|
||||||
// 如果所有药品的 executeNum 和 doneNum 都相等,提示用户
|
(item) => item.executeNum === item.doneNum
|
||||||
proxy.$modal.msgError("已执行完总次数");
|
);
|
||||||
return;
|
if (allExecuted) {
|
||||||
}
|
// 如果所有药品的 executeNum 和 doneNum 都相等,提示用户
|
||||||
updateInfusionRecord(itemsList).then(response => {
|
proxy.$modal.msgError("已执行完总次数");
|
||||||
proxy.$modal.msgSuccess("执行成功");
|
return;
|
||||||
clearSelections();
|
}
|
||||||
});
|
updateInfusionRecord(itemsList).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("执行成功");
|
||||||
|
clearSelections();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
// 清空之前选中的数据
|
// 清空之前选中的数据
|
||||||
selectedItems.value.clear();
|
selectedItems.value.clear();
|
||||||
// 将当前选中的数据存到 selectedItems 中
|
// 将当前选中的数据存到 selectedItems 中
|
||||||
selection.forEach(item => {
|
selection.forEach((item) => {
|
||||||
selectedItems.value.add(item);
|
selectedItems.value.add(item);
|
||||||
});
|
});
|
||||||
// 更新 selectedGroupIds 和 selectedPrescriptionNos
|
// 更新 selectedGroupIds 和 selectedPrescriptionNos
|
||||||
selection.forEach(item => {
|
selection.forEach((item) => {
|
||||||
const groupId = item.groupId;
|
const groupId = item.groupId;
|
||||||
const prescriptionNo = item.prescriptionNo;
|
const prescriptionNo = item.prescriptionNo;
|
||||||
// 检查 groupId 是否同时存在
|
// 检查 groupId 是否同时存在
|
||||||
if ( selectedGroupIds.value.has(groupId)) {
|
if (selectedGroupIds.value.has(groupId)) {
|
||||||
// 如果都存在,则移除它们
|
// 如果都存在,则移除它们
|
||||||
selectedGroupIds.value.delete(groupId);
|
selectedGroupIds.value.delete(groupId);
|
||||||
} else {
|
} else {
|
||||||
@@ -333,82 +471,80 @@ function handleSelectionChange(selection) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 动态更新表格行的选中状态
|
// 动态更新表格行的选中状态
|
||||||
infusionList.value.forEach(row => {
|
infusionList.value.forEach((row) => {
|
||||||
// 检查当前行的 groupId 是否同时在 selectedGroupIds 中
|
const isSelected = selectedGroupIds.value.has(row.groupId);
|
||||||
const isSelected = selectedGroupIds.value.has(row.groupId);
|
|
||||||
tableRef.value.toggleRowSelection(row, isSelected);
|
tableRef.value.toggleRowSelection(row, isSelected);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function clearSelections() {
|
function clearSelections() {
|
||||||
// 清空选中状态
|
// // 清空选中状态
|
||||||
selectedItems.value.clear();
|
// selectedItems.value.clear();
|
||||||
selectedGroupIds.value.clear();
|
// selectedGroupIds.value.clear();
|
||||||
selectedPrescriptionNos.value.clear();
|
// selectedPrescriptionNos.value.clear();
|
||||||
// 取消表格所有行的选中状态
|
// // 取消表格所有行的选中状态
|
||||||
infusionList.value.forEach(row => {
|
// infusionList.value.forEach(row => {
|
||||||
tableRef.value.toggleRowSelection(row, false);
|
// tableRef.value.toggleRowSelection(row, false);
|
||||||
});
|
// });
|
||||||
dateRangeRight.value = [];
|
dateRangeRight.value = [];
|
||||||
|
|
||||||
// 检查 currentRow.value 是否存在
|
// 检查 currentRow.value 是否存在
|
||||||
if (!currentRow.value) {
|
if (!currentRow.value) {
|
||||||
const createTimeSTime = timeRightStart.value || null;
|
const createTimeSTime = timeRightStart.value || null;
|
||||||
const createTimeETime = timeRightEnd.value || null;
|
const createTimeETime = timeRightEnd.value || null;
|
||||||
listInfusionRecord(createTimeSTime,createTimeETime).then(response => {
|
listInfusionRecord(createTimeSTime, createTimeETime).then((response) => {
|
||||||
infusionList.value = response.data;
|
infusionList.value = response.data;
|
||||||
})
|
});
|
||||||
}else{
|
} else {
|
||||||
listPatientInfusionRecord(currentRow.value).then(response => {
|
listPatientInfusionRecord(currentRow.value).then((response) => {
|
||||||
infusionList.value = response.data;
|
infusionList.value = response.data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
listPatientInfusionPerformRecord().then((response) => {
|
||||||
listPatientInfusionPerformRecord().then(response => {
|
historyRecordsList.value = response.data;
|
||||||
historyRecordsList.value = response.data;
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function rowStyle({ row }) {
|
function rowStyle({ row }) {
|
||||||
const colorIndex = row.groupId % 2; // 奇偶性决定颜色索引
|
const colorIndex = row.groupId % 2; // 奇偶性决定颜色索引
|
||||||
return { backgroundColor: groupColors[colorIndex] };
|
return { backgroundColor: groupColors[colorIndex] };
|
||||||
}
|
}
|
||||||
function handleUpdateTime(row){
|
function handleUpdateTime(row) {
|
||||||
console.log("row",row)
|
console.log("row", row);
|
||||||
editPatientInfusionTime(row).then(response => {
|
editPatientInfusionTime(row).then((response) => {
|
||||||
proxy.$modal.msgSuccess("执行成功");
|
proxy.$modal.msgSuccess("执行成功");
|
||||||
open.value = false;
|
open.value = false;
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleCurrentChange(row) {
|
function handleCurrentChange(row) {
|
||||||
currentRow.value = row; // 更新当前选中行的数据
|
currentRow.value = row; // 更新当前选中行的数据
|
||||||
console.log("当前选中行的数据:", currentRow.value);
|
console.log("当前选中行的数据:", currentRow.value);
|
||||||
listPatientInfusionRecord(currentRow.value).then(response => {
|
listPatientInfusionRecord(currentRow.value).then((response) => {
|
||||||
infusionList.value = response.data;
|
infusionList.value = response.data;
|
||||||
});
|
});
|
||||||
listPatientInfusionPerformRecord(currentRow.value).then(response => {
|
listPatientInfusionPerformRecord(currentRow.value).then((response) => {
|
||||||
historyRecordsList.value = response.data;
|
historyRecordsList.value = response.data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getList();
|
getList();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.app-container{
|
.app-container {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
|
||||||
.left {
|
|
||||||
width: 28%;
|
|
||||||
}
|
|
||||||
.right {
|
|
||||||
margin-left: 2%;
|
|
||||||
width: 70%;
|
|
||||||
}
|
|
||||||
::v-deep .el-table tbody tr:hover > td {
|
|
||||||
background-color: unset !important
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: 28%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
margin-left: 2%;
|
||||||
|
width: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-table tbody tr:hover > td) {
|
||||||
|
background-color: unset !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user