```
docs(release-notes): 添加住院护士站划价功能说明和发版记录 - 新增住院护士站划价服务流程说明文档,详细描述了从参数预处理到结果响应的五大阶段流程 - 包含耗材类医嘱和诊疗活动类医嘱的差异化处理逻辑 - 添加完整的发版内容记录,涵盖新增菜单功能和各模块优化点 - 记录了住院相关功能的新增和门诊业务流程的修复 ```
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,256 @@
|
||||
<template>
|
||||
<div class="med-summary-container">
|
||||
<div style="width: 40%">
|
||||
<el-card style="height: 80vh">
|
||||
<template #header>
|
||||
{{ '汇总单' }}
|
||||
</template>
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px">
|
||||
<div>
|
||||
<el-input style="width: 250px" v-model="queryParams.searchKey" placeholder="单据号">
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="getSummaryList" />
|
||||
</template>
|
||||
</el-input>
|
||||
<el-select
|
||||
placeholder="发放状态"
|
||||
style="width: 250px; margin-left: 10px"
|
||||
v-model="queryParams.statusEnum"
|
||||
@change="getSummaryList"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusEnumOptions"
|
||||
:key="item.value"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px">
|
||||
<div>
|
||||
<el-date-picker
|
||||
v-model="queryParams.applyTime"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 510px"
|
||||
value-format="YYYY-MM-DD"
|
||||
:clearable="false"
|
||||
@change="getSummaryList"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" plain @click="handleSend">批量发药</el-button>
|
||||
<el-button type="warning" plain>批量作废</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="summaryList"
|
||||
max-height="85vh"
|
||||
border
|
||||
ref="summaryTableRef"
|
||||
highlight-current-row
|
||||
@row-click="getDetails"
|
||||
>
|
||||
<el-table-column type="selection" align="center" width="50" />
|
||||
<el-table-column prop="busNo" label="单据号" align="center" width="150" />
|
||||
<el-table-column prop="applicantName" label="申请人" align="center" width="100" />
|
||||
<el-table-column prop="locationName" label="发药药房" align="center" />
|
||||
<el-table-column prop="statusEnum_enumText" label="状态" align="center" />
|
||||
<el-table-column prop="applyTime" label="汇总日期" align="center" width="140">
|
||||
<template #default="scope">
|
||||
{{ scope.row.applyTime ? parseTime(scope.row.applyTime, '{y}-{m}-{d}') : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click="handleSend(scope.row)">发药</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
<!-- <el-row :gutter="10" justify="end" align="middle" style="margin-bottom: 10px">
|
||||
<el-button type="danger" plain icon="Refresh" @click="handleSendDrug" :disabled="!busNo">
|
||||
发药
|
||||
</el-button>
|
||||
<el-button type="primary" plain icon="Download" @click="handleExport" :disabled="!busNo">
|
||||
导出
|
||||
</el-button>
|
||||
</el-row> -->
|
||||
<div style="width: 59%">
|
||||
<el-card style="height: 80vh">
|
||||
<template #header>
|
||||
{{ '汇总单详情' }}
|
||||
</template>
|
||||
<el-table
|
||||
:data="summaryDetailsData"
|
||||
style="width: 100%"
|
||||
border
|
||||
v-loading="loading"
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
>
|
||||
<el-table-column type="index" label="序号" min-width="50" />
|
||||
<el-table-column prop="itemName" label="项目名称" min-width="150">
|
||||
<template #default="scope">
|
||||
{{ scope.row.itemName || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalVolume" label="规格" min-width="120">
|
||||
<template #default="scope">
|
||||
{{ scope.row.totalVolume || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lotNumber" label="批次号" min-width="100">
|
||||
<template #default="scope">
|
||||
{{ scope.row.lotNumber || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="quantity" label="数量" min-width="80" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.itemQuantity + ' ' + scope.row.minUnitCode_dictText }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="categoryCode_dictText" label="药品类型" min-width="100">
|
||||
<template #default="scope">
|
||||
{{ scope.row.categoryCode_dictText || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="manufacturerText"
|
||||
label="生产厂家"
|
||||
min-width="120"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.manufacturerText || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import {
|
||||
totalSendDrug,
|
||||
getFromSummaryList,
|
||||
getFromSummaryDetails,
|
||||
getFromSummaryInit,
|
||||
} from './api.js';
|
||||
import { getCurrentInstance } from 'vue';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const statusEnumOptions = ref([]);
|
||||
const summaryList = ref([]);
|
||||
const queryParams = ref({
|
||||
applyTime: [
|
||||
proxy.formatDateStr(new Date().setMonth(new Date().getMonth() - 1), 'YYYY-MM-DD'),
|
||||
proxy.formatDateStr(new Date(), 'YYYY-MM-DD'),
|
||||
],
|
||||
});
|
||||
|
||||
// 定义组件属性
|
||||
const props = defineProps({
|
||||
tableData: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
selectedId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
busNo: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
const selectedRows = ref([]);
|
||||
const summaryDetailsData = ref([]);
|
||||
// 定义loading状态
|
||||
const loading = ref(false);
|
||||
|
||||
getSummaryList();
|
||||
// 获取汇总单信息
|
||||
function getSummaryList() {
|
||||
queryParams.value.applyTimeSTime = queryParams.value.applyTime[0] + ' 00:00:00';
|
||||
queryParams.value.applyTimeETime = queryParams.value.applyTime[1] + ' 23:59:59';
|
||||
getFromSummaryList(queryParams.value).then((res) => {
|
||||
summaryList.value = res.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
function getDetails(row) {
|
||||
loading.value = true;
|
||||
getFromSummaryDetails({ summaryNo: row.busNo }).then((res) => {
|
||||
summaryDetailsData.value = res.data;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 发药
|
||||
function handleSend(row) {
|
||||
let sendList = [];
|
||||
if (row.busNo) {
|
||||
sendList.push(row.busNo);
|
||||
} else {
|
||||
proxy.$refs['summaryTableRef'].getSelectionRows().forEach((item) => {
|
||||
sendList.push(item.busNo);
|
||||
});
|
||||
}
|
||||
console.log(sendList);
|
||||
|
||||
totalSendDrug(sendList).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
getSummaryList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 获取发药状态
|
||||
const getStatusOption = async () => {
|
||||
try {
|
||||
const res = await getFromSummaryInit();
|
||||
statusEnumOptions.value = res.data.dispenseStatusOptions;
|
||||
} catch (error) {}
|
||||
};
|
||||
getStatusOption();
|
||||
|
||||
// 定义暴露给父组件的数据和方法
|
||||
defineExpose({
|
||||
selectedRows,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.med-summary-container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.medicationTableDetail {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.buttonGroup {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 10px 0;
|
||||
gap: 10px;
|
||||
margin-right: 20px;
|
||||
|
||||
:deep(.el-button) {
|
||||
padding: 6px 16px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,481 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<!-- 左侧患者列表 -->
|
||||
<el-card class="patient-list">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>患者列表</span>
|
||||
</div>
|
||||
</template>
|
||||
<div style="width: 100%">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="搜索患者"
|
||||
style="width: 48%; margin-bottom: 10px; margin-right: 15px"
|
||||
@keyup.enter="getEncounterList"
|
||||
>
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="getEncounterList" />
|
||||
</template>
|
||||
</el-input>
|
||||
<el-select
|
||||
v-model="queryParams.refundEnum"
|
||||
style="width: 48%; margin-bottom: 10px"
|
||||
placeholder="收费状态"
|
||||
@change="getEncounterList"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 85%; margin-bottom: 10px"
|
||||
value-format="YYYY-MM-DD"
|
||||
placement="bottom"
|
||||
@change="getEncounterList"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="getEncounterList"
|
||||
style="margin-bottom: 10px; margin-left: 18px"
|
||||
>
|
||||
搜索
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="encounterList"
|
||||
border
|
||||
style="width: 100%"
|
||||
height="calc(100vh - 300px)"
|
||||
highlight-current-row
|
||||
@cell-click="handleGetReturnDrugList"
|
||||
>
|
||||
<el-table-column
|
||||
prop="patientName"
|
||||
align="center"
|
||||
label="姓名"
|
||||
width="130"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="genderEnum_enumText"
|
||||
align="center"
|
||||
label="性别"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column align="center" width="140" label="就诊日期" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{
|
||||
scope.row.receptionTime ? formatDateStr(scope.row.receptionTime, 'YYYY-MM-DD') : '-'
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="状态" align="center" prop="refundEnum_enumText" /> -->
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<!-- 右侧退药列表 -->
|
||||
<el-card class="refund-list">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>退药单</span>
|
||||
<!-- <div v-if="selectedPatient">
|
||||
<span class="patient-info">{{ selectedPatient.name }}</span>
|
||||
<el-tag type="info">{{ selectedPatient.visitNo }}</el-tag>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!selectedMedicines.length"
|
||||
@click="handleReturnDrug(undefined)"
|
||||
style="margin-bottom: 10px"
|
||||
>
|
||||
确认退药
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handleScan()" style="margin-bottom: 10px"> 扫码 </el-button>
|
||||
<el-table
|
||||
ref="returnDrugRef"
|
||||
:data="returDrugList"
|
||||
style="width: 100%"
|
||||
height="calc(100vh - 300px)"
|
||||
border
|
||||
@select="handleSelection"
|
||||
@selection-change="handelSelectRows"
|
||||
:span-method="handelSpanMethod"
|
||||
class="no-hover-table"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column prop="itemName" label="药品名称" show-overflow-tooltip align="center" />
|
||||
<el-table-column
|
||||
prop="totalPrice"
|
||||
label="总价"
|
||||
width="100"
|
||||
align="right"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.totalPrice ? scope.row.totalPrice.toFixed(2) + ' 元' : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lotNumber" label="批号" width="180" align="center" />
|
||||
<el-table-column prop="traceNo" label="追溯码" width="180" align="center">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.traceNo" placeholder="请输入追溯码" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reqStatus_enumText" label="退药状态" width="100" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.refundEnum_enumText }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="waitingQuantity" label="退药数量" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{
|
||||
scope.row.quantity
|
||||
? Math.abs(scope.row.quantity) + ' ' + scope.row.unitCode_dictText
|
||||
: '0' + ' ' + scope.row.unitCode_dictText
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="doctorName" label="开单医生" align="center" width="180" />
|
||||
<el-table-column label="操作" width="100" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-popconfirm
|
||||
width="150"
|
||||
hide-after="10"
|
||||
title="操作确认"
|
||||
placement="top-start"
|
||||
@confirm="handleReturnDrug(scope.row)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="primary" link :disabled="scope.row.refundEnum != 16">
|
||||
退药
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<div class="footer">
|
||||
<div class="statistics">
|
||||
<span>已选 {{ selectedMedicines.length }} 种药品</span>
|
||||
<span class="total">合计金额:¥ {{ totalAmount.toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<TraceNoDialog
|
||||
:ypName="ypName"
|
||||
:openDialog="openTraceNoDialog"
|
||||
@submit="submit"
|
||||
@cancel="openTraceNoDialog = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ReturnDrug">
|
||||
import { getCurrentInstance, nextTick } from 'vue';
|
||||
import { getList, getReturnDrugList, returnDrug, init, itemTraceNo } from './api';
|
||||
import { formatDateStr } from '@/utils/index';
|
||||
import { debounce } from 'lodash-es';
|
||||
import TraceNoDialog from '@/components/OpenHis/TraceNoDialog/index.vue';
|
||||
|
||||
const queryParams = ref({
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
refundEnum: 16,
|
||||
classEnum: 1,
|
||||
});
|
||||
const openTraceNo = ref(false);
|
||||
const traceNoList = ref([]);
|
||||
const traceNo = ref('');
|
||||
const encounterList = ref([]);
|
||||
const encounterId = ref('');
|
||||
const returDrugList = ref([]);
|
||||
const selectedMedicines = ref([]);
|
||||
const statusOptions = ref([]);
|
||||
const dateRange = ref([
|
||||
formatDateStr(new Date(), 'YYYY-MM-DD'),
|
||||
formatDateStr(new Date(), 'YYYY-MM-DD'),
|
||||
]);
|
||||
const traceNoTemp = ref('');
|
||||
const traceNoTempRef = ref();
|
||||
const totalAmount = ref(0);
|
||||
const openTraceNoDialog = ref(false);
|
||||
const ypName = ref('');
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
getEncounterList();
|
||||
function getEncounterList() {
|
||||
queryParams.value.startTimeSTime = dateRange.value[0] + ' 00:00:00';
|
||||
queryParams.value.startTimeETime = dateRange.value[1] + ' 23:59:59';
|
||||
getList(queryParams.value).then((res) => {
|
||||
encounterList.value = res.data.records;
|
||||
});
|
||||
}
|
||||
initOptions();
|
||||
function initOptions() {
|
||||
init().then((res) => {
|
||||
statusOptions.value = res.data.refundStatusOptions;
|
||||
});
|
||||
}
|
||||
|
||||
function handleGetReturnDrugList(row) {
|
||||
encounterId.value = row.encounterId;
|
||||
getReturnDrugList({
|
||||
encounterId: row.encounterId,
|
||||
refundStatus: queryParams.value.refundEnum,
|
||||
}).then((res) => {
|
||||
returDrugList.value = res.data;
|
||||
});
|
||||
}
|
||||
function handleScan() {
|
||||
openTraceNoDialog.value = true;
|
||||
}
|
||||
function submit(value) {
|
||||
let list = [];
|
||||
if (value) {
|
||||
list = value.split(',');
|
||||
}
|
||||
itemTraceNo(list).then((res) => {
|
||||
if (res.code === 200) {
|
||||
returDrugList.value.forEach((item, index) => {
|
||||
if (res.data[item.itemId] && res.data[item.itemId].split(',') > item.quantity) {
|
||||
proxy.$modal.msgWarning('操作失败');
|
||||
return;
|
||||
}
|
||||
returDrugList.value[index].traceNo = res.data[item.itemId];
|
||||
});
|
||||
openTraceNoDialog.value = false;
|
||||
// proxy.$modal.msgSuccess('退药成功');
|
||||
// getReturnDrugList(encounterId.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const throttledGetList = debounce(handelTraceNo, 500);
|
||||
|
||||
let inputValue = '';
|
||||
function handelTraceNo(value) {
|
||||
traceNoList.value.push(value);
|
||||
traceNo.value = traceNo.value + '[' + traceNoList.value.length + ']' + ' ' + value + '\n';
|
||||
traceNoTemp.value = '';
|
||||
// let saveValue = value.substring(inputValue.length + 5, value.length);
|
||||
// inputValue = value;
|
||||
// console.log(value);
|
||||
// console.log(saveValue);
|
||||
// traceNoList.value.push(saveValue);
|
||||
// traceNo.value = value + '[' + (traceNoList.value.length + 1) + ']' + ' ';
|
||||
}
|
||||
|
||||
function handleClear() {
|
||||
traceNo.value = '';
|
||||
traceNoList.value = [];
|
||||
}
|
||||
function cancel() {
|
||||
openTraceNo.value = false;
|
||||
traceNoList.value = [];
|
||||
traceNo.value = '';
|
||||
}
|
||||
/**
|
||||
* 退药
|
||||
*/
|
||||
function handleReturnDrug(row) {
|
||||
console.log(row);
|
||||
let saveList = [];
|
||||
if (row) {
|
||||
saveList = returDrugList.value
|
||||
.filter((item) => item.requestId == row.requestId)
|
||||
.map((item) => {
|
||||
return {
|
||||
requestId: item.requestId,
|
||||
dispenseId: item.dispenseId,
|
||||
tableName: item.serviceTable,
|
||||
traceNo: item.traceNo,
|
||||
};
|
||||
});
|
||||
} else {
|
||||
saveList = proxy.$refs.returnDrugRef.getSelectionRows().map((item) => {
|
||||
return {
|
||||
requestId: item.requestId,
|
||||
dispenseId: item.dispenseId,
|
||||
tableName: item.serviceTable,
|
||||
traceNo: item.traceNo,
|
||||
};
|
||||
});
|
||||
console.log(saveList);
|
||||
}
|
||||
returnDrug(saveList).then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$modal.msgSuccess('退药成功');
|
||||
getEncounterList();
|
||||
getReturnDrugList({
|
||||
encounterId: encounterId.value,
|
||||
refundStatus: queryParams.value.refundEnum,
|
||||
}).then((res) => {
|
||||
returDrugList.value = res.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 选择框改变时的处理
|
||||
function handleSelection(selection, row) {
|
||||
const isSelected = selection.some((item) => item.dispenseId === row.dispenseId);
|
||||
returDrugList.value
|
||||
.filter((item) => {
|
||||
return item.requestId == row.requestId;
|
||||
})
|
||||
.forEach((row) => {
|
||||
proxy.$refs['returnDrugRef'].toggleRowSelection(row, isSelected);
|
||||
});
|
||||
nextTick(() => {
|
||||
selectedMedicines.value = proxy.$refs['returnDrugRef'].getSelectionRows();
|
||||
totalAmount.value = selectedMedicines.value.reduce((accumulator, currentRow) => {
|
||||
return accumulator + (currentRow.totalPrice || 0);
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
|
||||
function handelSelectRows(selection) {
|
||||
selectedMedicines.value = selection;
|
||||
totalAmount.value = selectedMedicines.value.reduce((accumulator, currentRow) => {
|
||||
return accumulator + (currentRow.totalPrice || 0);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
// 根据 requestId 合并相同行的方法(只合并药品名称和总价列)
|
||||
function handelSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
// 定义需要合并的列索引
|
||||
// 1: 药品名称列, 2: 总价列
|
||||
const mergeColumns = [1, 2, 5, 7, 8];
|
||||
|
||||
// 检查当前列是否需要合并
|
||||
if (!mergeColumns.includes(columnIndex)) {
|
||||
return [1, 1];
|
||||
}
|
||||
|
||||
// 获取当前行的 requestId
|
||||
const currentRequestId = row.requestId;
|
||||
|
||||
// 如果没有 requestId,不进行合并
|
||||
if (!currentRequestId) {
|
||||
return [1, 1];
|
||||
}
|
||||
|
||||
// 查找具有相同 requestId 的连续行
|
||||
let rowspan = 1;
|
||||
let colspan = 1;
|
||||
|
||||
// 向上查找相同 requestId 的行
|
||||
let startIndex = rowIndex;
|
||||
while (startIndex > 0 && returDrugList.value[startIndex - 1].requestId === currentRequestId) {
|
||||
startIndex--;
|
||||
rowspan++;
|
||||
}
|
||||
|
||||
// 如果当前行不是合并组的第一行,则不显示
|
||||
if (startIndex !== rowIndex) {
|
||||
return [0, 0];
|
||||
}
|
||||
|
||||
// 向下查找相同 requestId 的行
|
||||
let endIndex = rowIndex;
|
||||
while (
|
||||
endIndex < returDrugList.value.length - 1 &&
|
||||
returDrugList.value[endIndex + 1].requestId === currentRequestId
|
||||
) {
|
||||
endIndex++;
|
||||
rowspan++;
|
||||
}
|
||||
|
||||
// 只有当 rowspan > 1 时才进行合并
|
||||
return rowspan > 1 ? [rowspan, colspan] : [1, 1];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
display: flex;
|
||||
height: 80vh;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.patient-list {
|
||||
width: 600px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.refund-list {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.patient-item {
|
||||
padding: 12px;
|
||||
margin-bottom: 8px;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: #ecf5ff;
|
||||
border-left: 4px solid #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
.patient-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 8px;
|
||||
|
||||
.name {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.visit-no {
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.visit-time {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
|
||||
.total {
|
||||
margin-left: 20px;
|
||||
color: #f56c6c;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep.el-textarea .el-textarea__inner {
|
||||
resize: none !important;
|
||||
}
|
||||
|
||||
:deep(.no-hover-table) .el-table__body tr:hover > td {
|
||||
background: inherit !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user