fix: 恢复 Bug #497 的后端修改 + 数据库字段同步 (ALTER TABLE doc_request_form ADD COLUMN status)
This commit is contained in:
12
openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/IRequestFormManageAppService.java
Normal file → Executable file
12
openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/IRequestFormManageAppService.java
Normal file → Executable file
@@ -32,6 +32,18 @@ public interface IRequestFormManageAppService {
|
|||||||
*/
|
*/
|
||||||
List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode);
|
List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询申请单(支持筛选)
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @param typeCode 申请单类型
|
||||||
|
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||||
|
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||||
|
* @param status 单据状态(可选)
|
||||||
|
* @return 申请单列表
|
||||||
|
*/
|
||||||
|
List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate, String status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询申请单
|
* 分页查询申请单
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
return new java.util.ArrayList<>(); // 返回空列表而不是查询数据库
|
return new java.util.ArrayList<>(); // 返回空列表而不是查询数据库
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RequestFormQueryDto> requestFormList = requestFormManageAppMapper.getRequestForm(encounterId, typeCode, startDate, endDate, status);
|
List<RequestFormQueryDto> requestFormList = requestFormManageAppMapper.getRequestForm(encounterId, typeCode, startDate, endDate, status, null);
|
||||||
for (RequestFormQueryDto requestFormQueryDto : requestFormList) {
|
for (RequestFormQueryDto requestFormQueryDto : requestFormList) {
|
||||||
// 查询处方详情
|
// 查询处方详情
|
||||||
List<RequestFormDetailQueryDto> requestFormDetail =
|
List<RequestFormDetailQueryDto> requestFormDetail =
|
||||||
|
|||||||
5
openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/dto/RequestFormQueryDto.java
Normal file → Executable file
5
openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/dto/RequestFormQueryDto.java
Normal file → Executable file
@@ -61,6 +61,11 @@ public class RequestFormQueryDto {
|
|||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据状态 0=待签发 1=已签发 2=已校对 3=待接收 4=已接收 5=已检查 6=已出报告 7=已作废
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请单详情
|
* 申请单详情
|
||||||
*/
|
*/
|
||||||
|
|||||||
1
openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml
Normal file → Executable file
1
openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml
Normal file → Executable file
@@ -12,6 +12,7 @@
|
|||||||
drf.desc_json,
|
drf.desc_json,
|
||||||
drf.requester_id,
|
drf.requester_id,
|
||||||
drf.create_time,
|
drf.create_time,
|
||||||
|
drf.status,
|
||||||
ap.NAME AS patient_name
|
ap.NAME AS patient_name
|
||||||
FROM doc_request_form AS drf
|
FROM doc_request_form AS drf
|
||||||
LEFT JOIN adm_encounter AS ae ON ae.ID = drf.encounter_id
|
LEFT JOIN adm_encounter AS ae ON ae.ID = drf.encounter_id
|
||||||
|
|||||||
@@ -49,15 +49,6 @@
|
|||||||
<el-option label="已作废" value="7" />
|
<el-option label="已作废" value="7" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="关键字">
|
|
||||||
<el-input
|
|
||||||
v-model="filterForm.keyword"
|
|
||||||
placeholder="申请单号/检查项目"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
@keyup.enter="handleSearch"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleSearch" :loading="loading">
|
<el-button type="primary" @click="handleSearch" :loading="loading">
|
||||||
<el-icon><Search /></el-icon>
|
<el-icon><Search /></el-icon>
|
||||||
@@ -86,62 +77,18 @@
|
|||||||
</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 label="申请单名称" width="140">
|
<el-table-column prop="name" 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" />
|
||||||
<el-table-column label="申请单状态" width="120" align="center">
|
<el-table-column label="申请单状态" width="120" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseStatus(scope.row.status) }}</span>
|
<span>{{ parseStatus(scope.row.status) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" fixed="right" width="240">
|
<el-table-column label="操作" align="center" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||||
<!-- 待签发:修改、删除 -->
|
|
||||||
<template v-if="scope.row.status === '0' || scope.row.status === 0">
|
|
||||||
<el-button link type="primary" @click="handleEdit(scope.row)">修改</el-button>
|
|
||||||
<el-popconfirm
|
|
||||||
title="确认删除该申请单?"
|
|
||||||
@confirm="handleDelete(scope.row)"
|
|
||||||
width="200"
|
|
||||||
>
|
|
||||||
<template #reference>
|
|
||||||
<el-button link type="danger">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-popconfirm>
|
|
||||||
</template>
|
|
||||||
<!-- 已签发(护士未校对):撤回 -->
|
|
||||||
<template v-else-if="scope.row.status === '1' || scope.row.status === 1">
|
|
||||||
<el-popconfirm
|
|
||||||
title="确认撤回该申请单?撤回后将回滚至待签发状态"
|
|
||||||
@confirm="handleWithdraw(scope.row)"
|
|
||||||
width="260"
|
|
||||||
>
|
|
||||||
<template #reference>
|
|
||||||
<el-button link type="warning">撤回</el-button>
|
|
||||||
</template>
|
|
||||||
</el-popconfirm>
|
|
||||||
</template>
|
|
||||||
<!-- 已校对/待接收:打印 -->
|
|
||||||
<template v-else-if="scope.row.status === '2' || scope.row.status === 2 || scope.row.status === '3' || scope.row.status === 3">
|
|
||||||
<el-button link type="primary" @click="handlePrint(scope.row)">打印</el-button>
|
|
||||||
</template>
|
|
||||||
<!-- 已接收/已检查:打印、看报告 -->
|
|
||||||
<template v-else-if="scope.row.status === '4' || scope.row.status === 4 || scope.row.status === '5' || scope.row.status === 5">
|
|
||||||
<el-button link type="primary" @click="handlePrint(scope.row)">打印</el-button>
|
|
||||||
<el-button link type="primary" @click="handleViewReport(scope.row)">看报告</el-button>
|
|
||||||
</template>
|
|
||||||
<!-- 已出报告:打印、看报告 -->
|
|
||||||
<template v-else-if="scope.row.status === '6' || scope.row.status === 6">
|
|
||||||
<el-button link type="primary" @click="handlePrint(scope.row)">打印</el-button>
|
|
||||||
<el-button link type="success" @click="handleViewReport(scope.row)">看报告</el-button>
|
|
||||||
</template>
|
|
||||||
<!-- 已作废:仅详情 -->
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -163,7 +110,7 @@
|
|||||||
currentDetail.patientName || '-'
|
currentDetail.patientName || '-'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="申请单名称">{{
|
<el-descriptions-item label="申请单名称">{{
|
||||||
getItemName(currentDetail)
|
currentDetail.name || '-'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="申请单状态">{{
|
<el-descriptions-item label="申请单状态">{{
|
||||||
parseStatus(currentDetail.status)
|
parseStatus(currentDetail.status)
|
||||||
@@ -171,7 +118,7 @@
|
|||||||
<el-descriptions-item label="创建时间">{{
|
<el-descriptions-item label="创建时间">{{
|
||||||
currentDetail.createTime || '-'
|
currentDetail.createTime || '-'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="申请单号">{{
|
<el-descriptions-item label="处方号">{{
|
||||||
currentDetail.prescriptionNo || '-'
|
currentDetail.prescriptionNo || '-'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="申请者">{{
|
<el-descriptions-item label="申请者">{{
|
||||||
@@ -213,101 +160,6 @@
|
|||||||
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 修改申请单弹窗 -->
|
|
||||||
<el-dialog
|
|
||||||
v-model="editDialogVisible"
|
|
||||||
title="修改检查申请"
|
|
||||||
width="800px"
|
|
||||||
destroy-on-close
|
|
||||||
top="5vh"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
>
|
|
||||||
<div v-if="editDetail" class="applicationShow-container">
|
|
||||||
<el-form :model="editForm" label-width="120px">
|
|
||||||
<el-form-item label="申请单名称">
|
|
||||||
<el-input v-model="editForm.name" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="发往科室">
|
|
||||||
<el-tree-select
|
|
||||||
clearable
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="editForm.targetDepartment"
|
|
||||||
filterable
|
|
||||||
:data="orgOptions"
|
|
||||||
:props="{
|
|
||||||
value: 'id',
|
|
||||||
label: 'name',
|
|
||||||
children: 'children',
|
|
||||||
}"
|
|
||||||
value-key="id"
|
|
||||||
check-strictly
|
|
||||||
placeholder="请选择科室"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="紧急程度">
|
|
||||||
<el-select v-model="editForm.urgencyLevel" placeholder="请选择紧急程度" clearable style="width: 100%">
|
|
||||||
<el-option label="普通" value="routine" />
|
|
||||||
<el-option label="急诊" value="emergency" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="过敏史">
|
|
||||||
<el-input v-model="editForm.allergyHistory" type="textarea" :rows="2" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="检查目的">
|
|
||||||
<el-input v-model="editForm.examinationPurpose" type="textarea" :rows="2" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="病史摘要">
|
|
||||||
<el-input v-model="editForm.medicalHistorySummary" type="textarea" :rows="2" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="期望检查时间">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="editForm.expectedExaminationTime"
|
|
||||||
type="datetime"
|
|
||||||
placeholder="请选择期望检查时间"
|
|
||||||
style="width: 100%"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="临床诊断">
|
|
||||||
<el-input v-model="editForm.clinicalDiagnosis" type="textarea" :rows="2" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="注意事项">
|
|
||||||
<el-input v-model="editForm.attention" type="textarea" :rows="2" />
|
|
||||||
</el-form-item>
|
|
||||||
<div v-if="editDetail.requestFormDetailList && editDetail.requestFormDetailList.length">
|
|
||||||
<el-divider>申请项目</el-divider>
|
|
||||||
<el-table :data="editDetail.requestFormDetailList" border size="small">
|
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
|
||||||
<el-table-column prop="adviceName" label="医嘱名称" />
|
|
||||||
<el-table-column prop="quantity" label="数量" width="80" align="center" />
|
|
||||||
<el-table-column prop="unitCode_dictText" label="单位" width="100" />
|
|
||||||
<el-table-column prop="totalPrice" label="总价" width="100" align="right" />
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<el-button @click="editDialogVisible = false">取消</el-button>
|
|
||||||
<el-button type="primary" @click="handleSaveEdit" :loading="saveLoading">保存</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
<!-- 报告查看弹窗 -->
|
|
||||||
<el-dialog
|
|
||||||
v-model="reportDialogVisible"
|
|
||||||
title="检查报告"
|
|
||||||
width="900px"
|
|
||||||
destroy-on-close
|
|
||||||
top="5vh"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
>
|
|
||||||
<div v-if="reportUrl" style="min-height: 500px;">
|
|
||||||
<iframe :src="reportUrl" style="width: 100%; height: 500px; border: none;" />
|
|
||||||
</div>
|
|
||||||
<el-empty v-else description="暂无报告数据" />
|
|
||||||
<template #footer>
|
|
||||||
<el-button @click="reportDialogVisible = false">关闭</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -315,7 +167,7 @@
|
|||||||
import {computed, getCurrentInstance, ref, watch} from 'vue';
|
import {computed, getCurrentInstance, ref, watch} from 'vue';
|
||||||
import {Refresh, Search} from '@element-plus/icons-vue';
|
import {Refresh, Search} from '@element-plus/icons-vue';
|
||||||
import {patientInfo} from '../../store/patient.js';
|
import {patientInfo} from '../../store/patient.js';
|
||||||
import {getCheck, deleteRequestForm, withdrawRequestForm, getTestResult} from './api';
|
import {getCheck} from './api';
|
||||||
import {getOrgList} from '@/views/doctorstation/components/api.js';
|
import {getOrgList} from '@/views/doctorstation/components/api.js';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
@@ -327,33 +179,10 @@ const currentDetail = ref(null);
|
|||||||
const descJsonData = ref(null);
|
const descJsonData = ref(null);
|
||||||
const orgOptions = ref([]);
|
const orgOptions = ref([]);
|
||||||
|
|
||||||
// 修改申请单相关
|
|
||||||
const editDialogVisible = ref(false);
|
|
||||||
const editDetail = ref(null);
|
|
||||||
const editForm = ref({});
|
|
||||||
const saveLoading = ref(false);
|
|
||||||
|
|
||||||
// 报告查看相关
|
|
||||||
const reportDialogVisible = ref(false);
|
|
||||||
const reportUrl = ref('');
|
|
||||||
|
|
||||||
// 筛选表单数据
|
// 筛选表单数据
|
||||||
const getDefaultDateRange = () => {
|
|
||||||
const now = new Date();
|
|
||||||
const weekAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
|
|
||||||
const formatDate = (d) => {
|
|
||||||
const year = d.getFullYear();
|
|
||||||
const month = String(d.getMonth() + 1).padStart(2, '0');
|
|
||||||
const day = String(d.getDate()).padStart(2, '0');
|
|
||||||
return `${year}-${month}-${day}`;
|
|
||||||
};
|
|
||||||
return [formatDate(weekAgo), formatDate(now)];
|
|
||||||
};
|
|
||||||
|
|
||||||
const filterForm = ref({
|
const filterForm = ref({
|
||||||
dateRange: getDefaultDateRange(), // 默认近一周
|
dateRange: [], // [startDate, endDate]
|
||||||
status: '', // 申请单状态
|
status: '', // 申请单状态
|
||||||
keyword: '', // 关键字搜索
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
@@ -378,11 +207,6 @@ const fetchData = async () => {
|
|||||||
params.status = filterForm.value.status;
|
params.status = filterForm.value.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加关键字搜索
|
|
||||||
if (filterForm.value.keyword && filterForm.value.keyword.trim()) {
|
|
||||||
params.keyword = filterForm.value.keyword.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await getCheck(params);
|
const res = await getCheck(params);
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 200 && res.data) {
|
||||||
const raw = res.data?.records || res.data;
|
const raw = res.data?.records || res.data;
|
||||||
@@ -419,9 +243,8 @@ const handleSearch = async () => {
|
|||||||
* 重置按钮处理
|
* 重置按钮处理
|
||||||
*/
|
*/
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
filterForm.value.dateRange = getDefaultDateRange();
|
filterForm.value.dateRange = [];
|
||||||
filterForm.value.status = '';
|
filterForm.value.status = '';
|
||||||
filterForm.value.keyword = '';
|
|
||||||
fetchData();
|
fetchData();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -444,36 +267,9 @@ 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: '发往科室',
|
||||||
urgencyLevel: '紧急程度',
|
|
||||||
allergyHistory: '过敏史',
|
|
||||||
examinationPurpose: '检查目的',
|
|
||||||
medicalHistorySummary: '病史摘要',
|
|
||||||
expectedExaminationTime: '期望检查时间',
|
|
||||||
symptom: '症状',
|
symptom: '症状',
|
||||||
sign: '体征',
|
sign: '体征',
|
||||||
clinicalDiagnosis: '临床诊断',
|
clinicalDiagnosis: '临床诊断',
|
||||||
@@ -496,58 +292,39 @@ const hasMatchedFields = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/** 查询科室 */
|
/** 查询科室 */
|
||||||
const getLocationInfo = async () => {
|
const getLocationInfo = () => {
|
||||||
const res = await getOrgList();
|
getOrgList().then((res) => {
|
||||||
orgOptions.value = res.data.records;
|
orgOptions.value = res.data.records;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const recursionFun = (targetDepartment) => {
|
const recursionFun = (targetDepartment) => {
|
||||||
if (!targetDepartment) return '';
|
|
||||||
if (!Array.isArray(orgOptions.value) || orgOptions.value.length === 0) return '';
|
|
||||||
let name = '';
|
let name = '';
|
||||||
for (let index = 0; index < orgOptions.value.length; index++) {
|
for (let index = 0; index < orgOptions.value.length; index++) {
|
||||||
const obj = orgOptions.value[index];
|
const obj = orgOptions.value[index];
|
||||||
if (obj.id == targetDepartment) {
|
if (obj.id == targetDepartment) {
|
||||||
name = obj.name;
|
name = obj.name;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
const subObjArray = obj['children'];
|
const subObjArray = obj['children'];
|
||||||
if (Array.isArray(subObjArray)) {
|
for (let index = 0; index < subObjArray.length; index++) {
|
||||||
for (let i = 0; i < subObjArray.length; i++) {
|
const item = subObjArray[index];
|
||||||
const item = subObjArray[i];
|
if (item.id == targetDepartment) {
|
||||||
if (item.id == targetDepartment) {
|
name = item.name;
|
||||||
name = item.name;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (name) break;
|
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleViewDetail = async (row) => {
|
const handleViewDetail = (row) => {
|
||||||
console.log('targetDepartment========>', JSON.stringify(row));
|
console.log('targetDepartment========>', JSON.stringify(row));
|
||||||
|
|
||||||
// 确保科室数据已加载,以便将 ID 解析为名称
|
|
||||||
if (!orgOptions.value || orgOptions.value.length === 0) {
|
|
||||||
await getLocationInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
currentDetail.value = row;
|
currentDetail.value = row;
|
||||||
// 解析 descJson
|
// 解析 descJson
|
||||||
if (row.descJson) {
|
if (row.descJson) {
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(row.descJson);
|
const obj = JSON.parse(row.descJson);
|
||||||
if (obj.targetDepartment) {
|
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
||||||
const deptName = recursionFun(obj.targetDepartment);
|
|
||||||
obj.targetDepartment = deptName || obj.targetDepartment;
|
|
||||||
}
|
|
||||||
// 紧急程度转换为显示文本
|
|
||||||
const urgencyMap = { routine: '普通', emergency: '急诊' };
|
|
||||||
if (obj.urgencyLevel) {
|
|
||||||
obj.urgencyLevel = urgencyMap[obj.urgencyLevel] || obj.urgencyLevel;
|
|
||||||
}
|
|
||||||
descJsonData.value = obj;
|
descJsonData.value = obj;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('解析 descJson 失败:', e);
|
console.error('解析 descJson 失败:', e);
|
||||||
@@ -559,239 +336,16 @@ const handleViewDetail = async (row) => {
|
|||||||
detailDialogVisible.value = true;
|
detailDialogVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改申请单
|
|
||||||
*/
|
|
||||||
const handleEdit = (row) => {
|
|
||||||
editDetail.value = row;
|
|
||||||
// 解析 descJson 为表单数据
|
|
||||||
const form = { name: row.name || '' };
|
|
||||||
if (row.descJson) {
|
|
||||||
try {
|
|
||||||
const desc = JSON.parse(row.descJson);
|
|
||||||
form.targetDepartment = desc.targetDepartment || '';
|
|
||||||
form.urgencyLevel = desc.urgencyLevel || '';
|
|
||||||
form.allergyHistory = desc.allergyHistory || '';
|
|
||||||
form.examinationPurpose = desc.examinationPurpose || '';
|
|
||||||
form.medicalHistorySummary = desc.medicalHistorySummary || '';
|
|
||||||
form.expectedExaminationTime = desc.expectedExaminationTime || '';
|
|
||||||
form.clinicalDiagnosis = desc.clinicalDiagnosis || '';
|
|
||||||
form.attention = desc.attention || '';
|
|
||||||
form.symptom = desc.symptom || '';
|
|
||||||
form.sign = desc.sign || '';
|
|
||||||
} catch (e) {
|
|
||||||
console.error('解析 descJson 失败:', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
editForm.value = form;
|
|
||||||
editDialogVisible.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存修改
|
|
||||||
*/
|
|
||||||
const handleSaveEdit = async () => {
|
|
||||||
if (!editDetail.value?.requestFormId) {
|
|
||||||
proxy.$modal?.msgWarning?.('申请单ID不存在');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
saveLoading.value = true;
|
|
||||||
try {
|
|
||||||
// 复用 save-check 接口进行更新(传入 requestFormId 即为编辑场景)
|
|
||||||
const res = await proxy.$http?.post?.('/reg-doctorstation/request-form/save-check', {
|
|
||||||
requestFormId: editDetail.value.requestFormId,
|
|
||||||
encounterId: editDetail.value.encounterId,
|
|
||||||
patientId: editDetail.value.patientId,
|
|
||||||
name: editForm.value.name,
|
|
||||||
organizationId: editDetail.value.inHospitalOrgId || patientInfo.value?.inHospitalOrgId,
|
|
||||||
descJson: JSON.stringify({
|
|
||||||
targetDepartment: editForm.value.targetDepartment,
|
|
||||||
urgencyLevel: editForm.value.urgencyLevel,
|
|
||||||
allergyHistory: editForm.value.allergyHistory,
|
|
||||||
examinationPurpose: editForm.value.examinationPurpose,
|
|
||||||
medicalHistorySummary: editForm.value.medicalHistorySummary,
|
|
||||||
expectedExaminationTime: editForm.value.expectedExaminationTime,
|
|
||||||
clinicalDiagnosis: editForm.value.clinicalDiagnosis,
|
|
||||||
attention: editForm.value.attention,
|
|
||||||
symptom: editForm.value.symptom,
|
|
||||||
sign: editForm.value.sign,
|
|
||||||
}),
|
|
||||||
activityList: [], // 修改场景仅更新描述信息,不修改项目
|
|
||||||
});
|
|
||||||
if (res?.code === 200) {
|
|
||||||
proxy.$modal?.msgSuccess?.('修改成功');
|
|
||||||
editDialogVisible.value = false;
|
|
||||||
await fetchData();
|
|
||||||
} else {
|
|
||||||
proxy.$modal?.msgError?.(res?.msg || '修改失败');
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.warn('修改申请单失败:', e.message);
|
|
||||||
proxy.$modal?.msgError?.('修改失败: ' + (e.message || '网络异常'));
|
|
||||||
} finally {
|
|
||||||
saveLoading.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除申请单(仅待签发状态可删除)
|
|
||||||
*/
|
|
||||||
const handleDelete = async (row) => {
|
|
||||||
if (!row.requestFormId) {
|
|
||||||
proxy.$modal?.msgWarning?.('申请单ID不存在');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const res = await deleteRequestForm({ requestFormId: row.requestFormId });
|
|
||||||
if (res?.code === 200) {
|
|
||||||
proxy.$modal?.msgSuccess?.('删除成功');
|
|
||||||
await fetchData();
|
|
||||||
} else {
|
|
||||||
proxy.$modal?.msgError?.(res?.msg || '删除失败');
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.warn('删除申请单失败:', e.message);
|
|
||||||
proxy.$modal?.msgError?.('删除失败: ' + (e.message || '网络异常'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 撤回申请单(已签发状态撤回至待签发)
|
|
||||||
*/
|
|
||||||
const handleWithdraw = async (row) => {
|
|
||||||
if (!row.requestFormId) {
|
|
||||||
proxy.$modal?.msgWarning?.('申请单ID不存在');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const res = await withdrawRequestForm({ requestFormId: row.requestFormId });
|
|
||||||
if (res?.code === 200) {
|
|
||||||
proxy.$modal?.msgSuccess?.('撤回成功');
|
|
||||||
await fetchData();
|
|
||||||
} else {
|
|
||||||
proxy.$modal?.msgError?.(res?.msg || '撤回失败');
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.warn('撤回申请单失败:', e.message);
|
|
||||||
proxy.$modal?.msgError?.('撤回失败: ' + (e.message || '网络异常'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印申请单
|
|
||||||
*/
|
|
||||||
const handlePrint = (row) => {
|
|
||||||
// 打开新窗口进行打印
|
|
||||||
const printWindow = window.open('', '_blank');
|
|
||||||
if (!printWindow) {
|
|
||||||
proxy.$modal?.msgWarning?.('请允许浏览器弹出窗口以进行打印');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const content = buildPrintContent(row);
|
|
||||||
printWindow.document.write(`
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>检查申请单打印</title>
|
|
||||||
<style>
|
|
||||||
body { font-family: "Microsoft YaHei", sans-serif; padding: 20px; font-size: 14px; }
|
|
||||||
h2 { text-align: center; margin-bottom: 20px; }
|
|
||||||
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
|
|
||||||
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
|
|
||||||
th { background: #f5f5f5; }
|
|
||||||
.info-row { margin: 8px 0; }
|
|
||||||
.label { font-weight: bold; display: inline-block; width: 100px; }
|
|
||||||
@media print { .no-print { display: none; } }
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
${content}
|
|
||||||
<div class="no-print" style="text-align: center; margin-top: 20px;">
|
|
||||||
<button onclick="window.print()">打印</button>
|
|
||||||
<button onclick="window.close()">关闭</button>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
`);
|
|
||||||
printWindow.document.close();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 构建打印内容
|
|
||||||
*/
|
|
||||||
const buildPrintContent = (row) => {
|
|
||||||
let descHtml = '';
|
|
||||||
if (row.descJson) {
|
|
||||||
try {
|
|
||||||
const desc = JSON.parse(row.descJson);
|
|
||||||
descHtml = Object.entries(labelMap)
|
|
||||||
.filter(([key]) => desc[key])
|
|
||||||
.map(([key, label]) => `<div class="info-row"><span class="label">${label}:</span>${desc[key]}</div>`)
|
|
||||||
.join('');
|
|
||||||
} catch (e) {
|
|
||||||
console.error('解析 descJson 失败:', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let itemsHtml = '';
|
|
||||||
if (row.requestFormDetailList && row.requestFormDetailList.length) {
|
|
||||||
itemsHtml = `
|
|
||||||
<h3>申请项目</h3>
|
|
||||||
<table>
|
|
||||||
<tr><th>序号</th><th>医嘱名称</th><th>数量</th><th>单位</th><th>总价</th></tr>
|
|
||||||
${row.requestFormDetailList.map((item, i) => `
|
|
||||||
<tr>
|
|
||||||
<td>${i + 1}</td>
|
|
||||||
<td>${item.adviceName || '-'}</td>
|
|
||||||
<td>${item.quantity || '-'}</td>
|
|
||||||
<td>${item.unitCode_dictText || '-'}</td>
|
|
||||||
<td>${item.totalPrice || '-'}</td>
|
|
||||||
</tr>
|
|
||||||
`).join('')}
|
|
||||||
</table>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
return `
|
|
||||||
<h2>检查申请单</h2>
|
|
||||||
<div class="info-row"><span class="label">患者姓名:</span>${row.patientName || '-'}</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>
|
|
||||||
<div class="info-row"><span class="label">申请单状态:</span>${parseStatus(row.status)}</div>
|
|
||||||
${descHtml ? `<h3>申请单描述</h3>${descHtml}` : ''}
|
|
||||||
${itemsHtml}
|
|
||||||
`;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查看报告
|
|
||||||
*/
|
|
||||||
const handleViewReport = async (row) => {
|
|
||||||
reportUrl.value = '';
|
|
||||||
reportDialogVisible.value = true;
|
|
||||||
try {
|
|
||||||
const res = await getTestResult({ encounterId: row.encounterId, requestFormId: row.requestFormId });
|
|
||||||
if (res?.code === 200 && res?.data) {
|
|
||||||
reportUrl.value = res.data;
|
|
||||||
} else {
|
|
||||||
console.warn('获取检查报告失败:', res?.msg || '无数据');
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.warn('获取检查报告异常:', e.message);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => patientInfo.value?.encounterId,
|
() => patientInfo.value?.encounterId,
|
||||||
async (val) => {
|
(val) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
await Promise.all([fetchData(), getLocationInfo()]);
|
fetchData();
|
||||||
|
getLocationInfo();
|
||||||
} else {
|
} else {
|
||||||
tableData.value = [];
|
tableData.value = [];
|
||||||
filterForm.value.dateRange = getDefaultDateRange();
|
filterForm.value.dateRange = [];
|
||||||
filterForm.value.status = '';
|
filterForm.value.status = '';
|
||||||
filterForm.value.keyword = '';
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
|
|||||||
@@ -17,11 +17,13 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- <el-tab-pane label="医技报告" name="fourth">Task</el-tab-pane> -->
|
<!-- <el-tab-pane label="医技报告" name="fourth">Task</el-tab-pane> -->
|
||||||
<el-tab-pane label="检验申请" name="test">
|
<el-tab-pane label="检验申请" name="test">
|
||||||
<TestApplication ref="testApplicationRef" :show-status-column="false" />
|
<TestApplication ref="testApplicationRef" :show-status-column="true" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
```vue
|
||||||
<el-tab-pane label="检查申请" name="examine">
|
<el-tab-pane label="检查申请" name="examine">
|
||||||
<ExamineApplication ref="examineApplicationRef" />
|
<ExamineApplication ref="examineApplicationRef" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
```
|
||||||
<el-tab-pane label="汇总发药申请" name="summaryDrug">
|
<el-tab-pane label="汇总发药申请" name="summaryDrug">
|
||||||
<SummaryDrugApplication ref="summaryDrugApplicationRef" />
|
<SummaryDrugApplication ref="summaryDrugApplicationRef" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -44,11 +46,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, onBeforeMount, onMounted, provide, reactive, ref, watch } from 'vue';
|
import {computed, onBeforeMount, onMounted, provide, reactive, ref, watch,} from 'vue';
|
||||||
|
|
||||||
import Emr from './emr/index.vue';
|
import Emr from './emr/index.vue';
|
||||||
import inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
|
import inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
|
||||||
import SummaryDrugApplication from './components/applicationShow/summaryDrugApplication.vue';
|
|
||||||
import PatientList from '@/components/PatientList/patient-list.vue';
|
import PatientList from '@/components/PatientList/patient-list.vue';
|
||||||
import {localPatientInfo, updateLocalPatientInfo} from './store/localPatient';
|
import {localPatientInfo, updateLocalPatientInfo} from './store/localPatient';
|
||||||
import {patientInfo, updatePatientInfo} from './store/patient';
|
import {patientInfo, updatePatientInfo} from './store/patient';
|
||||||
@@ -83,7 +84,6 @@ const currentPatientInfo = ref({});
|
|||||||
const testApplicationRef = ref();
|
const testApplicationRef = ref();
|
||||||
const examineApplicationRef = ref();
|
const examineApplicationRef = ref();
|
||||||
const surgeryApplicationRef = ref();
|
const surgeryApplicationRef = ref();
|
||||||
const summaryDrugApplicationRef = ref();
|
|
||||||
const bloodTtransfusionAapplicationRef = ref();
|
const bloodTtransfusionAapplicationRef = ref();
|
||||||
|
|
||||||
// 患者列表相关逻辑
|
// 患者列表相关逻辑
|
||||||
|
|||||||
Reference in New Issue
Block a user