Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0a035204e | ||
|
|
349b0453c8 | ||
|
|
3ddd74d679 | ||
|
|
9829843b3e | ||
|
|
0d95cc1341 | ||
|
|
1dfceeaf46 | ||
|
|
1b79df4f93 | ||
|
|
f62a280dfc | ||
|
|
e5d949a740 | ||
|
|
6451c308c2 | ||
|
|
772ec5537c | ||
|
|
af6494c806 | ||
|
|
2901dafe10 | ||
|
|
ffc2562aea | ||
|
|
5da537f863 | ||
|
|
facbe7cd44 | ||
|
|
283d25642a | ||
|
|
7b17a66214 |
@@ -511,6 +511,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
// 签发操作
|
||||
boolean is_sign = AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType);
|
||||
|
||||
// 收集已处理的requestId,用于批量更新状态
|
||||
List<Long> processedRequestIds = new ArrayList<>();
|
||||
|
||||
// 声明长期医嘱诊疗请求
|
||||
ServiceRequest longServiceRequest;
|
||||
// 新增 + 修改 (长期医嘱)
|
||||
@@ -555,6 +558,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
}
|
||||
iServiceRequestService.saveOrUpdate(longServiceRequest);
|
||||
if (longServiceRequest.getId() != null) {
|
||||
processedRequestIds.add(longServiceRequest.getId());
|
||||
}
|
||||
}
|
||||
|
||||
// 声明临时医嘱诊疗请求
|
||||
@@ -603,6 +609,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
}
|
||||
iServiceRequestService.saveOrUpdate(tempServiceRequest);
|
||||
if (tempServiceRequest.getId() != null) {
|
||||
processedRequestIds.add(tempServiceRequest.getId());
|
||||
}
|
||||
|
||||
// 保存时,保存诊疗费用项
|
||||
if (is_save) {
|
||||
@@ -654,6 +663,14 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
}
|
||||
|
||||
// 批量更新诊疗医嘱状态(使用 update 确保状态字段必定更新)
|
||||
if (!processedRequestIds.isEmpty()) {
|
||||
iServiceRequestService.update(null,
|
||||
new LambdaUpdateWrapper<ServiceRequest>()
|
||||
.set(ServiceRequest::getStatusEnum,
|
||||
is_save ? RequestStatus.DRAFT.getValue() : RequestStatus.ACTIVE.getValue())
|
||||
.in(ServiceRequest::getId, processedRequestIds));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,22 +96,14 @@
|
||||
INNER JOIN med_medication_request AS T5
|
||||
ON T4.med_req_id = T5.id
|
||||
AND T5.delete_flag = '0'
|
||||
WHERE EXISTS (
|
||||
SELECT 1 FROM wor_supply_request wsr
|
||||
WHERE wsr.type_enum = 3
|
||||
AND wsr.delete_flag = '0'
|
||||
AND wsr.bus_no = T4.summary_no
|
||||
AND T4.summary_no IS NOT NULL
|
||||
AND T4.summary_no != ''
|
||||
)
|
||||
AND <if test="statusEnum == null">
|
||||
T4.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared},8)
|
||||
WHERE <if test="statusEnum == null">
|
||||
T4.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared})
|
||||
</if>
|
||||
<if test="statusEnum == 3">
|
||||
T4.status_enum IN (#{inProgress},#{preparation},#{prepared},8)
|
||||
T4.status_enum IN (#{inProgress},#{preparation},#{prepared})
|
||||
</if>
|
||||
<if test="statusEnum == 4">
|
||||
T4.status_enum IN (#{completed},8)
|
||||
T4.status_enum = #{completed}
|
||||
</if>
|
||||
AND T4.summary_no IS NOT NULL
|
||||
AND T4.summary_no != ''
|
||||
|
||||
@@ -313,6 +313,7 @@
|
||||
data-prop="dispensePerDuration">
|
||||
<el-input-number v-model="scope.row.dispensePerDuration" style="width: 80px" :min="1"
|
||||
controls-position="right" :controls="false" :ref="(el) => (inputRefs.dispensePerDuration = el)"
|
||||
@change="calculateTotalAmount(scope.row, scope.$index)"
|
||||
@keyup.enter.prevent="
|
||||
handleEnter('dispensePerDuration', scope.row, scope.$index)
|
||||
">
|
||||
|
||||
@@ -86,7 +86,11 @@
|
||||
</template>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<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="prescriptionNo" label="处方号" width="140" />
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
@@ -159,7 +163,7 @@
|
||||
currentDetail.patientName || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单名称">{{
|
||||
currentDetail.name || '-'
|
||||
getItemName(currentDetail)
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单状态">{{
|
||||
parseStatus(currentDetail.status)
|
||||
@@ -399,6 +403,28 @@ const parseStatus = (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 = {
|
||||
categoryType: '项目类别',
|
||||
targetDepartment: '发往科室',
|
||||
@@ -651,7 +677,7 @@ const buildPrintContent = (row) => {
|
||||
return `
|
||||
<h2>检查申请单</h2>
|
||||
<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.prescriptionNo || '-'}</div>
|
||||
<div class="info-row"><span class="label">申请者:</span>${row.requesterId_dictText || '-'}</div>
|
||||
|
||||
@@ -68,9 +68,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div
|
||||
<div
|
||||
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
||||
v-loading="loading"
|
||||
>
|
||||
@@ -232,7 +230,7 @@ import {adviceCancel, adviceExecute, adviceNoExecute, getPrescriptionList} from
|
||||
import {patientInfoList} from '../../components/store/patient.js';
|
||||
import {lotNumberMatch} from '@/api/public';
|
||||
import {formatDateStr} from '@/utils/index';
|
||||
import {getCurrentInstance, nextTick, ref} from 'vue';
|
||||
import {getCurrentInstance, nextTick, ref, provide} from 'vue';
|
||||
|
||||
const activeNames = ref([]);
|
||||
const prescriptionList = ref([]);
|
||||
@@ -242,6 +240,8 @@ const therapyEnum = ref(undefined);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(false);
|
||||
const chooseAll = ref(false);
|
||||
// 独立维护选中行ID集合,避免el-table内部selection状态异常导致联动全选
|
||||
const selectedRowIds = ref(new Set());
|
||||
const props = defineProps({
|
||||
exeStatus: {
|
||||
type: Number,
|
||||
@@ -442,6 +442,7 @@ function handleGetPrescription() {
|
||||
chooseAll.value = false;
|
||||
} else {
|
||||
prescriptionList.value = [];
|
||||
selectedRowIds.value.clear();
|
||||
// proxy.$message.warning('请选择患者');
|
||||
}
|
||||
}
|
||||
@@ -530,10 +531,14 @@ function handleCancel() {
|
||||
}
|
||||
|
||||
function getSelectRows() {
|
||||
// 获取选中的医嘱信息
|
||||
let list = [];
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
|
||||
// 优先从独立维护的selectedRowIds集合中获取选中行,避免el-table内部selection状态异常
|
||||
const list = [];
|
||||
prescriptionList.value.forEach((item) => {
|
||||
item.forEach((row) => {
|
||||
if (selectedRowIds.value.has(row.requestId)) {
|
||||
list.push(row);
|
||||
}
|
||||
});
|
||||
});
|
||||
return list;
|
||||
}
|
||||
@@ -609,12 +614,14 @@ function handelSwicthChange(value) {
|
||||
if (value) {
|
||||
// 全选:选中所有行并联动checkbox
|
||||
item.forEach((row) => {
|
||||
selectedRowIds.value.add(row.requestId);
|
||||
tableRef[0].toggleRowSelection(row, true);
|
||||
selectAllCheckboxesInRow(row);
|
||||
});
|
||||
} else {
|
||||
// 取消全选:取消选中所有行并联动checkbox
|
||||
item.forEach((row) => {
|
||||
selectedRowIds.value.delete(row.requestId);
|
||||
tableRef[0].toggleRowSelection(row, false);
|
||||
unselectAllCheckboxesInRow(row);
|
||||
});
|
||||
@@ -625,11 +632,14 @@ function handelSwicthChange(value) {
|
||||
|
||||
// 默认选中全部行
|
||||
function defaultSelectAllRows() {
|
||||
// 清空并重建选中集合
|
||||
selectedRowIds.value.clear();
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
const tableRef = proxy.$refs['tableRef' + index];
|
||||
if (tableRef && tableRef[0]) {
|
||||
// 选中该表格的所有行
|
||||
item.forEach((row) => {
|
||||
selectedRowIds.value.add(row.requestId);
|
||||
tableRef[0].toggleRowSelection(row, true);
|
||||
// 同时选中该行内部的所有checkbox
|
||||
selectAllCheckboxesInRow(row);
|
||||
@@ -709,13 +719,14 @@ function checkAndToggleRowSelection(row) {
|
||||
const tableRef = proxy.$refs['tableRef' + tableIndex];
|
||||
if (tableRef && tableRef[0]) {
|
||||
const isAllSelected = isAllCheckboxesSelected(row);
|
||||
const selectedRows = tableRef[0].getSelectionRows();
|
||||
const isCurrentlySelected = selectedRows.some((r) => r.requestId === row.requestId);
|
||||
const isCurrentlySelected = selectedRowIds.value.has(row.requestId);
|
||||
|
||||
// 根据checkbox状态更新表格行选中状态
|
||||
if (isAllSelected && !isCurrentlySelected) {
|
||||
selectedRowIds.value.add(row.requestId);
|
||||
tableRef[0].toggleRowSelection(row, true);
|
||||
} else if (!isAllSelected && isCurrentlySelected) {
|
||||
selectedRowIds.value.delete(row.requestId);
|
||||
tableRef[0].toggleRowSelection(row, false);
|
||||
}
|
||||
}
|
||||
@@ -728,9 +739,11 @@ function handleRowSelect(selection, row, tableIndex) {
|
||||
const isSelected = selection.some((item) => item.requestId === row.requestId);
|
||||
|
||||
if (isSelected) {
|
||||
selectedRowIds.value.add(row.requestId);
|
||||
// 选中行时,选中该行内部的所有checkbox
|
||||
selectAllCheckboxesInRow(row);
|
||||
} else {
|
||||
selectedRowIds.value.delete(row.requestId);
|
||||
// 取消选中行时,取消选中该行内部的所有checkbox
|
||||
unselectAllCheckboxesInRow(row);
|
||||
}
|
||||
@@ -747,11 +760,13 @@ function handleSelectAll(selection, tableIndex) {
|
||||
if (selection.length > 0) {
|
||||
// 全选时,选中所有行内部的所有checkbox
|
||||
tableData.forEach((row) => {
|
||||
selectedRowIds.value.add(row.requestId);
|
||||
selectAllCheckboxesInRow(row);
|
||||
});
|
||||
} else {
|
||||
// 取消全选时,取消选中所有行内部的所有checkbox
|
||||
tableData.forEach((row) => {
|
||||
selectedRowIds.value.delete(row.requestId);
|
||||
unselectAllCheckboxesInRow(row);
|
||||
});
|
||||
}
|
||||
@@ -763,16 +778,12 @@ function handleSelectAll(selection, tableIndex) {
|
||||
// 更新全选开关状态
|
||||
function updateChooseAllStatus() {
|
||||
let allSelected = true;
|
||||
prescriptionList.value.forEach((item, index) => {
|
||||
const tableRef = proxy.$refs['tableRef' + index];
|
||||
if (tableRef && tableRef[0]) {
|
||||
const selectedRows = tableRef[0].getSelectionRows();
|
||||
if (selectedRows.length !== item.length) {
|
||||
prescriptionList.value.forEach((item) => {
|
||||
item.forEach((row) => {
|
||||
if (!selectedRowIds.value.has(row.requestId)) {
|
||||
allSelected = false;
|
||||
}
|
||||
} else {
|
||||
allSelected = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
chooseAll.value = allSelected;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getCurrentInstance} from 'vue';
|
||||
import {getCurrentInstance, ref, nextTick, provide} from 'vue';
|
||||
import PatientList from '../components/patientList.vue';
|
||||
import PrescriptionList from './components/prescriptionList.vue';
|
||||
import { RequestStatus } from '@/utils/medicalConstants';
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
>
|
||||
<div>
|
||||
<el-radio-group v-model="type" class="ml20" @change="handleRadioChange">
|
||||
<el-radio :value="undefined">全部</el-radio>
|
||||
<el-radio :value="1">长期</el-radio>
|
||||
<el-radio :value="2">临时</el-radio>
|
||||
<el-radio :label="1">全部</el-radio>
|
||||
<el-radio :label="2">长期</el-radio>
|
||||
<el-radio :label="3">临时</el-radio>
|
||||
</el-radio-group>
|
||||
<el-button class="ml20" type="primary" plain @click="handleGetPrescription">
|
||||
查询
|
||||
@@ -159,7 +159,7 @@ import {formatDateStr} from '@/utils/index';
|
||||
const activeNames = ref([]);
|
||||
const prescriptionList = ref([]);
|
||||
const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
|
||||
const type = ref(undefined);
|
||||
const type = ref(1);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = ref(false);
|
||||
const chooseAll = ref(false);
|
||||
|
||||
Reference in New Issue
Block a user