Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39796189eb | ||
|
|
3301343fd5 | ||
|
|
fd8319204f | ||
|
|
637c7efd94 | ||
|
|
973b61bc28 | ||
|
|
fb33353962 | ||
|
|
ad69578cc3 | ||
|
|
c39c8faa5c | ||
|
|
659db997fd |
@@ -147,8 +147,8 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
|||||||
for (OrganizationLocation organizationLocation : organizationLocationList)
|
for (OrganizationLocation organizationLocation : organizationLocationList)
|
||||||
if (DateTimeUtils.isOverlap(organizationLocation.getStartTime(), organizationLocation.getEndTime(),
|
if (DateTimeUtils.isOverlap(organizationLocation.getStartTime(), organizationLocation.getEndTime(),
|
||||||
orgLoc.getStartTime(), orgLoc.getEndTime())) {
|
orgLoc.getStartTime(), orgLoc.getEndTime())) {
|
||||||
String organizationName =
|
Organization org = organizationService.getById(organizationLocation.getOrganizationId());
|
||||||
organizationService.getById(organizationLocation.getOrganizationId()).getName();
|
String organizationName = org != null ? org.getName() : "未知科室";
|
||||||
return R.fail("当前诊疗:" + activityName + CommonConstants.Common.DASH + orgLoc.getStartTime()
|
return R.fail("当前诊疗:" + activityName + CommonConstants.Common.DASH + orgLoc.getStartTime()
|
||||||
+ CommonConstants.Common.DASH + orgLoc.getEndTime() + "与" + organizationName + "时间冲突");
|
+ CommonConstants.Common.DASH + orgLoc.getEndTime() + "与" + organizationName + "时间冲突");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,6 +132,10 @@ function onCancel() {
|
|||||||
|
|
||||||
// 批量添加
|
// 批量添加
|
||||||
async function onConfirm() {
|
async function onConfirm() {
|
||||||
|
if (!props.organizationId) {
|
||||||
|
proxy.$message.error('请先在左侧选择科室');
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!formEl) return;
|
if (!formEl) return;
|
||||||
formEl.value.validate(async (valid) => {
|
formEl.value.validate(async (valid) => {
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
|
|||||||
@@ -366,6 +366,10 @@ function handleBlur(row, index) {
|
|||||||
|
|
||||||
// 编辑或 保存当前行
|
// 编辑或 保存当前行
|
||||||
function openSaveImplementDepartment(row) {
|
function openSaveImplementDepartment(row) {
|
||||||
|
if (!organizationId.value) {
|
||||||
|
proxy.$message.error('请先在左侧选择科室');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const params = {
|
const params = {
|
||||||
// 科室id
|
// 科室id
|
||||||
organizationId: organizationId.value,
|
organizationId: organizationId.value,
|
||||||
@@ -452,13 +456,12 @@ function handleNodeClick(res, node) {
|
|||||||
|
|
||||||
// 实际的节点点击处理逻辑
|
// 实际的节点点击处理逻辑
|
||||||
function continueHandleNodeClick(node) {
|
function continueHandleNodeClick(node) {
|
||||||
// 新增按钮是否 disable
|
|
||||||
isAddDisable.value = false;
|
|
||||||
// 检查节点是否有子节点
|
// 检查节点是否有子节点
|
||||||
if (node.data.children && node.data.children.length > 0) {
|
if (node.data.children && node.data.children.length > 0) {
|
||||||
// proxy.$message.warning("不能选择父节点");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 新增按钮是否 disable
|
||||||
|
isAddDisable.value = false;
|
||||||
// 选中科室id
|
// 选中科室id
|
||||||
organizationId.value = node.data.id;
|
organizationId.value = node.data.id;
|
||||||
// 获取 右侧 table 信息
|
// 获取 右侧 table 信息
|
||||||
|
|||||||
@@ -313,6 +313,7 @@
|
|||||||
data-prop="dispensePerDuration">
|
data-prop="dispensePerDuration">
|
||||||
<el-input-number v-model="scope.row.dispensePerDuration" style="width: 80px" :min="1"
|
<el-input-number v-model="scope.row.dispensePerDuration" style="width: 80px" :min="1"
|
||||||
controls-position="right" :controls="false" :ref="(el) => (inputRefs.dispensePerDuration = el)"
|
controls-position="right" :controls="false" :ref="(el) => (inputRefs.dispensePerDuration = el)"
|
||||||
|
@change="calculateTotalAmount(scope.row, scope.$index)"
|
||||||
@keyup.enter.prevent="
|
@keyup.enter.prevent="
|
||||||
handleEnter('dispensePerDuration', scope.row, scope.$index)
|
handleEnter('dispensePerDuration', scope.row, scope.$index)
|
||||||
">
|
">
|
||||||
|
|||||||
@@ -86,7 +86,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
||||||
<el-table-column prop="name" label="申请单名称" width="140" />
|
<el-table-column label="申请单名称" width="140">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ getItemName(scope.row) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="createTime" label="创建时间" width="160" />
|
<el-table-column prop="createTime" label="创建时间" width="160" />
|
||||||
<el-table-column prop="prescriptionNo" label="处方号" width="140" />
|
<el-table-column prop="prescriptionNo" label="处方号" width="140" />
|
||||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||||
@@ -159,7 +163,7 @@
|
|||||||
currentDetail.patientName || '-'
|
currentDetail.patientName || '-'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="申请单名称">{{
|
<el-descriptions-item label="申请单名称">{{
|
||||||
currentDetail.name || '-'
|
getItemName(currentDetail)
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="申请单状态">{{
|
<el-descriptions-item label="申请单状态">{{
|
||||||
parseStatus(currentDetail.status)
|
parseStatus(currentDetail.status)
|
||||||
@@ -399,6 +403,28 @@ const parseStatus = (status) => {
|
|||||||
return statusMap[String(status)] || '-';
|
return statusMap[String(status)] || '-';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取申请单展示名称:优先使用具体医嘱名称列表
|
||||||
|
*/
|
||||||
|
const getItemName = (row) => {
|
||||||
|
const items = row?.requestFormDetailList;
|
||||||
|
if (items && items.length > 0) {
|
||||||
|
return items.map(item => item.adviceName).filter(Boolean).join('、') || row.name || '-';
|
||||||
|
}
|
||||||
|
return row.name || '-';
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建打印用项目名称字符串(同步函数,用于模板字符串)
|
||||||
|
*/
|
||||||
|
const buildItemNames = (row) => {
|
||||||
|
const items = row?.requestFormDetailList;
|
||||||
|
if (items && items.length > 0) {
|
||||||
|
return items.map(item => item.adviceName).filter(Boolean).join('、') || row.name || '';
|
||||||
|
}
|
||||||
|
return row.name || '';
|
||||||
|
};
|
||||||
|
|
||||||
const labelMap = {
|
const labelMap = {
|
||||||
categoryType: '项目类别',
|
categoryType: '项目类别',
|
||||||
targetDepartment: '发往科室',
|
targetDepartment: '发往科室',
|
||||||
@@ -651,7 +677,7 @@ const buildPrintContent = (row) => {
|
|||||||
return `
|
return `
|
||||||
<h2>检查申请单</h2>
|
<h2>检查申请单</h2>
|
||||||
<div class="info-row"><span class="label">患者姓名:</span>${row.patientName || '-'}</div>
|
<div class="info-row"><span class="label">患者姓名:</span>${row.patientName || '-'}</div>
|
||||||
<div class="info-row"><span class="label">申请单名称:</span>${row.name || '-'}</div>
|
<div class="info-row"><span class="label">申请单名称:</span>${buildItemNames(row) || '-'}</div>
|
||||||
<div class="info-row"><span class="label">创建时间:</span>${row.createTime || '-'}</div>
|
<div class="info-row"><span class="label">创建时间:</span>${row.createTime || '-'}</div>
|
||||||
<div class="info-row"><span class="label">处方号:</span>${row.prescriptionNo || '-'}</div>
|
<div class="info-row"><span class="label">处方号:</span>${row.prescriptionNo || '-'}</div>
|
||||||
<div class="info-row"><span class="label">申请者:</span>${row.requesterId_dictText || '-'}</div>
|
<div class="info-row"><span class="label">申请者:</span>${row.requesterId_dictText || '-'}</div>
|
||||||
|
|||||||
@@ -122,7 +122,6 @@
|
|||||||
|
|
||||||
<el-table-column label="类型" align="center" prop="" width="120">
|
<el-table-column label="类型" align="center" prop="" width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ console.log(scope.row, 1111) }}
|
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
v-model="scope.row.therapyEnum"
|
v-model="scope.row.therapyEnum"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -270,7 +269,6 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="频次/用法" align="center" prop="" width="180">
|
<el-table-column label="频次/用法" align="center" prop="" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ console.log(scope.row) }}
|
|
||||||
<span v-if="!scope.row.isEdit && scope.row.adviceType == 1" style="text-align: right">
|
<span v-if="!scope.row.isEdit && scope.row.adviceType == 1" style="text-align: right">
|
||||||
{{
|
{{
|
||||||
[
|
[
|
||||||
@@ -879,14 +877,12 @@ function handleDiagnosisChange(item) {
|
|||||||
function handleFocus(row, index) {
|
function handleFocus(row, index) {
|
||||||
rowIndex.value = index;
|
rowIndex.value = index;
|
||||||
row.showPopover = true;
|
row.showPopover = true;
|
||||||
// el-popover 懒渲染,需要等两帧组件才会挂载
|
|
||||||
const adviceType = row.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType;
|
const adviceType = row.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType;
|
||||||
// 用 adviceType + categoryCode 组合查找匹配的选项
|
// 用 adviceType + categoryCode 组合查找匹配的选项
|
||||||
const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
||||||
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
||||||
// 诊疗(3)和手术(6)没有categoryCode,传空字符串给refresh,由子组件转为undefined不发送
|
// 修复Bug #486:当行没有显式选择医嘱类型时,不传categoryCode,让搜索在全药库中进行
|
||||||
// 药品(1)才有categoryCode(如'1'=中成药,'2'=西药,'4'=中草药)
|
const categoryCode = selectedItem ? selectedItem.categoryCode : (row.adviceType !== undefined ? (adviceQueryParams.value.categoryCode || '') : '');
|
||||||
const categoryCode = selectedItem ? selectedItem.categoryCode : (adviceQueryParams.value.categoryCode || '');
|
|
||||||
const searchKey = row.adviceName || '';
|
const searchKey = row.adviceName || '';
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@@ -923,8 +919,8 @@ function handleChange(value) {
|
|||||||
// 用 adviceType + categoryCode 组合查找匹配的选项
|
// 用 adviceType + categoryCode 组合查找匹配的选项
|
||||||
const selectValue = (adviceType == 1 && row?.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
const selectValue = (adviceType == 1 && row?.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
||||||
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
||||||
// 诊疗/手术的categoryCode为空字符串,由子组件转为undefined不发送
|
// 修复Bug #486:当行没有显式选择医嘱类型时,不传categoryCode,让搜索在全药库中进行
|
||||||
const categoryCode = selectedItem ? selectedItem.categoryCode : (adviceQueryParams.value.categoryCode || '');
|
const categoryCode = selectedItem ? selectedItem.categoryCode : (row?.adviceType !== undefined ? (adviceQueryParams.value.categoryCode || '') : '');
|
||||||
tableRef.refresh(adviceType, categoryCode, value);
|
tableRef.refresh(adviceType, categoryCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1214,12 +1210,8 @@ function handleSave() {
|
|||||||
getListInfo(false);
|
getListInfo(false);
|
||||||
bindMethod.value = {};
|
bindMethod.value = {};
|
||||||
nextId.value == 1;
|
nextId.value == 1;
|
||||||
|
|
||||||
// 处方保存成功后,自动将医嘱信息同步至患者处置记录
|
|
||||||
// handleEmrTreatment();
|
|
||||||
} else {
|
} else {
|
||||||
proxy.$modal.msgError(res.message);
|
proxy.$modal.msgError(res.message);
|
||||||
conso;
|
|
||||||
isSaving.value = false;
|
isSaving.value = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1319,22 +1311,26 @@ function handleCancelEdit(row, index) {
|
|||||||
function handleSaveSign(row, index) {
|
function handleSaveSign(row, index) {
|
||||||
if (row.adviceType != 2) {
|
if (row.adviceType != 2) {
|
||||||
let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId;
|
let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId;
|
||||||
getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => {
|
if (!itemNo) {
|
||||||
if (res.data.length == 0) {
|
console.warn('绑定设备检查跳过:itemNo为空(adviceType=' + row.adviceType + ', adviceName=' + row.adviceName + ')');
|
||||||
return;
|
} else {
|
||||||
}
|
getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => {
|
||||||
let openBindDialog = localStorage.getItem('doctor' + userStore.id);
|
if (res.data.length == 0) {
|
||||||
if (!JSON.parse(openBindDialog)) {
|
return;
|
||||||
proxy.$refs['orderBindInfoRef'].open(res.data);
|
|
||||||
} else {
|
|
||||||
// 如果弹窗不提示带出的项目,自动带出
|
|
||||||
// 如果有未签发的项目,并且当前的项目没有带出过绑定项目,则自动带出
|
|
||||||
if (!bindMethod.value[itemNo]) {
|
|
||||||
handleOrderBindInfo(res.data);
|
|
||||||
bindMethod.value[itemNo] = true;
|
|
||||||
}
|
}
|
||||||
}
|
let openBindDialog = localStorage.getItem('doctor' + userStore.id);
|
||||||
});
|
if (!JSON.parse(openBindDialog)) {
|
||||||
|
proxy.$refs['orderBindInfoRef'].open(res.data);
|
||||||
|
} else {
|
||||||
|
// 如果弹窗不提示带出的项目,自动带出
|
||||||
|
// 如果有未签发的项目,并且当前的项目没有带出过绑定项目,则自动带出
|
||||||
|
if (!bindMethod.value[itemNo]) {
|
||||||
|
handleOrderBindInfo(res.data);
|
||||||
|
bindMethod.value[itemNo] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新UI状态
|
// 更新UI状态
|
||||||
|
|||||||
@@ -273,8 +273,9 @@ function handleSearch() {
|
|||||||
// 清除缓存(搜索时需要重新加载)
|
// 清除缓存(搜索时需要重新加载)
|
||||||
patientDataCache.value.clear();
|
patientDataCache.value.clear();
|
||||||
|
|
||||||
// 重新加载所有已展开病区的患者列表
|
// 通过递增 key 强制重新渲染树组件,触发重新加载所有病区患者列表
|
||||||
reloadAllPatients();
|
// 此时 searchKey 已有值,loadPatientList 会将 searchKey 传给后端进行过滤
|
||||||
|
treeKey.value += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 暴露方法供外部调用
|
// 暴露方法供外部调用
|
||||||
|
|||||||
@@ -68,9 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<div
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
>
|
>
|
||||||
@@ -232,7 +230,7 @@ import {adviceCancel, adviceExecute, adviceNoExecute, getPrescriptionList} from
|
|||||||
import {patientInfoList} from '../../components/store/patient.js';
|
import {patientInfoList} from '../../components/store/patient.js';
|
||||||
import {lotNumberMatch} from '@/api/public';
|
import {lotNumberMatch} from '@/api/public';
|
||||||
import {formatDateStr} from '@/utils/index';
|
import {formatDateStr} from '@/utils/index';
|
||||||
import {getCurrentInstance, nextTick, ref} from 'vue';
|
import {getCurrentInstance, nextTick, ref, provide} from 'vue';
|
||||||
|
|
||||||
const activeNames = ref([]);
|
const activeNames = ref([]);
|
||||||
const prescriptionList = ref([]);
|
const prescriptionList = ref([]);
|
||||||
@@ -242,6 +240,8 @@ const therapyEnum = ref(undefined);
|
|||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const chooseAll = ref(false);
|
const chooseAll = ref(false);
|
||||||
|
// 独立维护选中行ID集合,避免el-table内部selection状态异常导致联动全选
|
||||||
|
const selectedRowIds = ref(new Set());
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
exeStatus: {
|
exeStatus: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -442,6 +442,7 @@ function handleGetPrescription() {
|
|||||||
chooseAll.value = false;
|
chooseAll.value = false;
|
||||||
} else {
|
} else {
|
||||||
prescriptionList.value = [];
|
prescriptionList.value = [];
|
||||||
|
selectedRowIds.value.clear();
|
||||||
// proxy.$message.warning('请选择患者');
|
// proxy.$message.warning('请选择患者');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -530,10 +531,14 @@ function handleCancel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getSelectRows() {
|
function getSelectRows() {
|
||||||
// 获取选中的医嘱信息
|
// 优先从独立维护的selectedRowIds集合中获取选中行,避免el-table内部selection状态异常
|
||||||
let list = [];
|
const list = [];
|
||||||
prescriptionList.value.forEach((item, index) => {
|
prescriptionList.value.forEach((item) => {
|
||||||
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
|
item.forEach((row) => {
|
||||||
|
if (selectedRowIds.value.has(row.requestId)) {
|
||||||
|
list.push(row);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@@ -609,12 +614,14 @@ function handelSwicthChange(value) {
|
|||||||
if (value) {
|
if (value) {
|
||||||
// 全选:选中所有行并联动checkbox
|
// 全选:选中所有行并联动checkbox
|
||||||
item.forEach((row) => {
|
item.forEach((row) => {
|
||||||
|
selectedRowIds.value.add(row.requestId);
|
||||||
tableRef[0].toggleRowSelection(row, true);
|
tableRef[0].toggleRowSelection(row, true);
|
||||||
selectAllCheckboxesInRow(row);
|
selectAllCheckboxesInRow(row);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 取消全选:取消选中所有行并联动checkbox
|
// 取消全选:取消选中所有行并联动checkbox
|
||||||
item.forEach((row) => {
|
item.forEach((row) => {
|
||||||
|
selectedRowIds.value.delete(row.requestId);
|
||||||
tableRef[0].toggleRowSelection(row, false);
|
tableRef[0].toggleRowSelection(row, false);
|
||||||
unselectAllCheckboxesInRow(row);
|
unselectAllCheckboxesInRow(row);
|
||||||
});
|
});
|
||||||
@@ -625,11 +632,14 @@ function handelSwicthChange(value) {
|
|||||||
|
|
||||||
// 默认选中全部行
|
// 默认选中全部行
|
||||||
function defaultSelectAllRows() {
|
function defaultSelectAllRows() {
|
||||||
|
// 清空并重建选中集合
|
||||||
|
selectedRowIds.value.clear();
|
||||||
prescriptionList.value.forEach((item, index) => {
|
prescriptionList.value.forEach((item, index) => {
|
||||||
const tableRef = proxy.$refs['tableRef' + index];
|
const tableRef = proxy.$refs['tableRef' + index];
|
||||||
if (tableRef && tableRef[0]) {
|
if (tableRef && tableRef[0]) {
|
||||||
// 选中该表格的所有行
|
// 选中该表格的所有行
|
||||||
item.forEach((row) => {
|
item.forEach((row) => {
|
||||||
|
selectedRowIds.value.add(row.requestId);
|
||||||
tableRef[0].toggleRowSelection(row, true);
|
tableRef[0].toggleRowSelection(row, true);
|
||||||
// 同时选中该行内部的所有checkbox
|
// 同时选中该行内部的所有checkbox
|
||||||
selectAllCheckboxesInRow(row);
|
selectAllCheckboxesInRow(row);
|
||||||
@@ -709,13 +719,14 @@ function checkAndToggleRowSelection(row) {
|
|||||||
const tableRef = proxy.$refs['tableRef' + tableIndex];
|
const tableRef = proxy.$refs['tableRef' + tableIndex];
|
||||||
if (tableRef && tableRef[0]) {
|
if (tableRef && tableRef[0]) {
|
||||||
const isAllSelected = isAllCheckboxesSelected(row);
|
const isAllSelected = isAllCheckboxesSelected(row);
|
||||||
const selectedRows = tableRef[0].getSelectionRows();
|
const isCurrentlySelected = selectedRowIds.value.has(row.requestId);
|
||||||
const isCurrentlySelected = selectedRows.some((r) => r.requestId === row.requestId);
|
|
||||||
|
|
||||||
// 根据checkbox状态更新表格行选中状态
|
// 根据checkbox状态更新表格行选中状态
|
||||||
if (isAllSelected && !isCurrentlySelected) {
|
if (isAllSelected && !isCurrentlySelected) {
|
||||||
|
selectedRowIds.value.add(row.requestId);
|
||||||
tableRef[0].toggleRowSelection(row, true);
|
tableRef[0].toggleRowSelection(row, true);
|
||||||
} else if (!isAllSelected && isCurrentlySelected) {
|
} else if (!isAllSelected && isCurrentlySelected) {
|
||||||
|
selectedRowIds.value.delete(row.requestId);
|
||||||
tableRef[0].toggleRowSelection(row, false);
|
tableRef[0].toggleRowSelection(row, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -728,9 +739,11 @@ function handleRowSelect(selection, row, tableIndex) {
|
|||||||
const isSelected = selection.some((item) => item.requestId === row.requestId);
|
const isSelected = selection.some((item) => item.requestId === row.requestId);
|
||||||
|
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
|
selectedRowIds.value.add(row.requestId);
|
||||||
// 选中行时,选中该行内部的所有checkbox
|
// 选中行时,选中该行内部的所有checkbox
|
||||||
selectAllCheckboxesInRow(row);
|
selectAllCheckboxesInRow(row);
|
||||||
} else {
|
} else {
|
||||||
|
selectedRowIds.value.delete(row.requestId);
|
||||||
// 取消选中行时,取消选中该行内部的所有checkbox
|
// 取消选中行时,取消选中该行内部的所有checkbox
|
||||||
unselectAllCheckboxesInRow(row);
|
unselectAllCheckboxesInRow(row);
|
||||||
}
|
}
|
||||||
@@ -747,11 +760,13 @@ function handleSelectAll(selection, tableIndex) {
|
|||||||
if (selection.length > 0) {
|
if (selection.length > 0) {
|
||||||
// 全选时,选中所有行内部的所有checkbox
|
// 全选时,选中所有行内部的所有checkbox
|
||||||
tableData.forEach((row) => {
|
tableData.forEach((row) => {
|
||||||
|
selectedRowIds.value.add(row.requestId);
|
||||||
selectAllCheckboxesInRow(row);
|
selectAllCheckboxesInRow(row);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 取消全选时,取消选中所有行内部的所有checkbox
|
// 取消全选时,取消选中所有行内部的所有checkbox
|
||||||
tableData.forEach((row) => {
|
tableData.forEach((row) => {
|
||||||
|
selectedRowIds.value.delete(row.requestId);
|
||||||
unselectAllCheckboxesInRow(row);
|
unselectAllCheckboxesInRow(row);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -763,16 +778,12 @@ function handleSelectAll(selection, tableIndex) {
|
|||||||
// 更新全选开关状态
|
// 更新全选开关状态
|
||||||
function updateChooseAllStatus() {
|
function updateChooseAllStatus() {
|
||||||
let allSelected = true;
|
let allSelected = true;
|
||||||
prescriptionList.value.forEach((item, index) => {
|
prescriptionList.value.forEach((item) => {
|
||||||
const tableRef = proxy.$refs['tableRef' + index];
|
item.forEach((row) => {
|
||||||
if (tableRef && tableRef[0]) {
|
if (!selectedRowIds.value.has(row.requestId)) {
|
||||||
const selectedRows = tableRef[0].getSelectionRows();
|
|
||||||
if (selectedRows.length !== item.length) {
|
|
||||||
allSelected = false;
|
allSelected = false;
|
||||||
}
|
}
|
||||||
} else {
|
});
|
||||||
allSelected = false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
chooseAll.value = allSelected;
|
chooseAll.value = allSelected;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {getCurrentInstance} from 'vue';
|
import {getCurrentInstance, ref, nextTick, provide} from 'vue';
|
||||||
import PatientList from '../components/patientList.vue';
|
import PatientList from '../components/patientList.vue';
|
||||||
import PrescriptionList from './components/prescriptionList.vue';
|
import PrescriptionList from './components/prescriptionList.vue';
|
||||||
import { RequestStatus } from '@/utils/medicalConstants';
|
import { RequestStatus } from '@/utils/medicalConstants';
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ function handleGetPrescription() {
|
|||||||
getPrescriptionList({
|
getPrescriptionList({
|
||||||
encounterIds: encounterIds,
|
encounterIds: encounterIds,
|
||||||
requestStatus: props.requestStatus,
|
requestStatus: props.requestStatus,
|
||||||
therapyEnum: type.value === 1 ? undefined : type.value === 2 ? 1 : 2, // 1=全部(不传), 2=长期(1), 3=临时(2)
|
...(type.value !== undefined ? { therapyEnum: type.value } : {}),
|
||||||
pageSize: 10000,
|
pageSize: 10000,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user