Compare commits
63 Commits
develop
...
6a0e596f84
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a0e596f84 | ||
|
|
1f679d68df | ||
|
|
c012974fd0 | ||
|
|
5a83ff2aca | ||
|
|
92ce2d10a1 | ||
|
|
420a5a977a | ||
|
|
6e0e78cd8d | ||
|
|
763c822574 | ||
|
|
9bec956b4f | ||
|
|
65a772c7b2 | ||
| 994fd9bacc | |||
|
|
cec8a44bd9 | ||
|
|
8157063749 | ||
|
|
41562c5bbd | ||
|
|
51fba4488e | ||
|
|
00ff4158a1 | ||
|
|
a09020a4fd | ||
|
|
f7a3f658fb | ||
|
|
dd36dc49ea | ||
|
|
1c9bb92663 | ||
|
|
6ddd9bb2dc | ||
|
|
c8ed4e5856 | ||
|
|
253ceaffc6 | ||
|
|
ed7c388d11 | ||
|
|
f581f72693 | ||
|
|
55b517c8c6 | ||
|
|
0c36230158 | ||
|
|
351a2fba2e | ||
|
|
09e5825dab | ||
|
|
1f94efa1d2 | ||
|
|
d4d9ede5d7 | ||
|
|
876e46bfea | ||
|
|
7388e01b5d | ||
|
|
4af2fc5f54 | ||
|
|
c04432e39a | ||
|
|
21e68da15e | ||
|
|
6fdf96edab | ||
|
|
2ef1ce9f35 | ||
|
|
11fd9b839c | ||
|
|
5357ddb220 | ||
|
|
79bd7c0281 | ||
|
|
4c4f01abd1 | ||
|
|
b4d452995f | ||
|
|
23c75b147e | ||
|
|
1e431d096d | ||
|
|
e1de467b68 | ||
| 53a3460092 | |||
|
|
084d04d518 | ||
|
|
d7f8a20d76 | ||
| 331fc532fc | |||
|
|
dafa5961c4 | ||
|
|
f223192ec5 | ||
|
|
c7956a116b | ||
|
|
845354e863 | ||
|
|
56ea4b6af1 | ||
|
|
703e9ead43 | ||
|
|
a43f98cc5a | ||
|
|
9215c288d3 | ||
|
|
777ba71c7d | ||
|
|
c3dfd3eb21 | ||
|
|
8093f8acda | ||
|
|
8fae6fe3d5 | ||
|
|
5af86494dd |
@@ -106,9 +106,4 @@ public class OpScheduleDto extends OpSchedule {
|
|||||||
* 创建人名称
|
* 创建人名称
|
||||||
*/
|
*/
|
||||||
private String createByName;
|
private String createByName;
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用类别
|
|
||||||
*/
|
|
||||||
private String feeType;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,4 +63,20 @@ public interface IRequestFormManageAppService {
|
|||||||
* @return 申请单
|
* @return 申请单
|
||||||
*/
|
*/
|
||||||
IPage<RequestFormPageDto> getRequestFormPage(RequestFormDto requestFormDto);
|
IPage<RequestFormPageDto> getRequestFormPage(RequestFormDto requestFormDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除申请单(仅待签发状态可删除)
|
||||||
|
*
|
||||||
|
* @param requestFormId 申请单ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> deleteRequestForm(Long requestFormId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤回申请单(已签发状态撤回至待签发)
|
||||||
|
*
|
||||||
|
* @param requestFormId 申请单ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> withdrawRequestForm(Long requestFormId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -474,4 +474,68 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
return requestFormManageAppMapper.getRequestFormPage(requestFormDto, page);
|
return requestFormManageAppMapper.getRequestFormPage(requestFormDto, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除申请单(仅待签发状态可删除)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public R<?> deleteRequestForm(Long requestFormId) {
|
||||||
|
if (requestFormId == null) {
|
||||||
|
return R.fail("申请单ID不能为空");
|
||||||
|
}
|
||||||
|
RequestForm requestForm = iRequestFormService.getById(requestFormId);
|
||||||
|
if (requestForm == null) {
|
||||||
|
return R.fail("申请单不存在");
|
||||||
|
}
|
||||||
|
if (!Integer.valueOf(0).equals(requestForm.getStatus())) {
|
||||||
|
return R.fail("仅待签发状态的申请单可删除");
|
||||||
|
}
|
||||||
|
// 删除申请单
|
||||||
|
iRequestFormService.removeById(requestFormId);
|
||||||
|
// 删除关联的诊疗项目及账单
|
||||||
|
String prescriptionNo = requestForm.getPrescriptionNo();
|
||||||
|
List<Long> serviceRequestIds = iServiceRequestService
|
||||||
|
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getPrescriptionNo, prescriptionNo))
|
||||||
|
.stream().map(ServiceRequest::getId).collect(Collectors.toList());
|
||||||
|
for (Long serviceRequestId : serviceRequestIds) {
|
||||||
|
iServiceRequestService.removeById(serviceRequestId);
|
||||||
|
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_SERVICE_REQUEST, serviceRequestId);
|
||||||
|
}
|
||||||
|
return R.ok(null, "删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤回申请单(已签发状态撤回至待签发)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public R<?> withdrawRequestForm(Long requestFormId) {
|
||||||
|
if (requestFormId == null) {
|
||||||
|
return R.fail("申请单ID不能为空");
|
||||||
|
}
|
||||||
|
RequestForm requestForm = iRequestFormService.getById(requestFormId);
|
||||||
|
if (requestForm == null) {
|
||||||
|
return R.fail("申请单不存在");
|
||||||
|
}
|
||||||
|
if (!Integer.valueOf(1).equals(requestForm.getStatus())) {
|
||||||
|
return R.fail("仅已签发状态的申请单可撤回");
|
||||||
|
}
|
||||||
|
// 将申请单状态回滚至待签发
|
||||||
|
RequestForm updateForm = new RequestForm();
|
||||||
|
updateForm.setId(requestFormId);
|
||||||
|
updateForm.setStatus(0);
|
||||||
|
iRequestFormService.updateById(updateForm);
|
||||||
|
// 将关联的诊疗项目状态回滚至DRAFT
|
||||||
|
String prescriptionNo = requestForm.getPrescriptionNo();
|
||||||
|
List<ServiceRequest> serviceRequests = iServiceRequestService
|
||||||
|
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getPrescriptionNo, prescriptionNo));
|
||||||
|
for (ServiceRequest serviceRequest : serviceRequests) {
|
||||||
|
ServiceRequest updateService = new ServiceRequest();
|
||||||
|
updateService.setId(serviceRequest.getId());
|
||||||
|
updateService.setStatusEnum(RequestStatus.DRAFT.getValue());
|
||||||
|
iServiceRequestService.updateById(updateService);
|
||||||
|
}
|
||||||
|
return R.ok(null, "撤回成功");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public class RequestFormManageController {
|
|||||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||||
* @param status 单据状态(可选)
|
* @param status 单据状态(可选)
|
||||||
* @param keyword 关键字(可选,申请单号/检验项目模糊匹配)
|
* @param keyword 关键字(可选,申请单号/检验项目名称模糊匹配)
|
||||||
* @return 检验申请单
|
* @return 检验申请单
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/get-inspection")
|
@GetMapping(value = "/get-inspection")
|
||||||
|
|||||||
@@ -89,15 +89,12 @@
|
|||||||
cs.apply_doctor_name AS apply_doctor_name,
|
cs.apply_doctor_name AS apply_doctor_name,
|
||||||
drf.create_time AS apply_time,
|
drf.create_time AS apply_time,
|
||||||
os.surgery_nature AS surgeryType,
|
os.surgery_nature AS surgeryType,
|
||||||
fc.contract_name AS feeType,
|
os.fee_type AS feeType,
|
||||||
COALESCE(pi.identifier_no, ap.bus_no, '') AS identifierNo
|
COALESCE(pi.identifier_no, ap.bus_no, '') AS identifierNo
|
||||||
FROM op_schedule os
|
FROM op_schedule os
|
||||||
LEFT JOIN adm_patient ap ON os.patient_id = ap.id
|
LEFT JOIN adm_patient ap ON os.patient_id = ap.id
|
||||||
INNER JOIN cli_surgery cs ON os.oper_code = cs.surgery_no AND cs.delete_flag = '0'
|
INNER JOIN cli_surgery cs ON os.oper_code = cs.surgery_no AND cs.delete_flag = '0'
|
||||||
LEFT JOIN adm_organization o ON cs.org_id = o.id
|
LEFT JOIN adm_organization o ON cs.org_id = o.id
|
||||||
LEFT JOIN adm_encounter ae ON ae.id = cs.encounter_id AND ae.delete_flag = '0'
|
|
||||||
LEFT JOIN adm_account aa ON aa.encounter_id = ae.id AND aa.delete_flag = '0'
|
|
||||||
LEFT JOIN fin_contract fc ON fc.bus_no = aa.contract_no AND fc.delete_flag = '0'
|
|
||||||
LEFT JOIN doc_request_form drf ON drf.prescription_no=cs.surgery_no
|
LEFT JOIN doc_request_form drf ON drf.prescription_no=cs.surgery_no
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT patient_id, identifier_no
|
SELECT patient_id, identifier_no
|
||||||
|
|||||||
@@ -280,9 +280,17 @@
|
|||||||
aa.balance_amount
|
aa.balance_amount
|
||||||
) AS personal_account
|
) AS personal_account
|
||||||
ON personal_account.encounter_id = ae.id
|
ON personal_account.encounter_id = ae.id
|
||||||
LEFT JOIN med_medication_dispense mmd
|
LEFT JOIN (
|
||||||
|
SELECT med_req_id, status_enum
|
||||||
|
FROM (
|
||||||
|
SELECT med_req_id, status_enum,
|
||||||
|
ROW_NUMBER() OVER (PARTITION BY med_req_id ORDER BY id DESC) AS rn
|
||||||
|
FROM med_medication_dispense
|
||||||
|
WHERE delete_flag = '0'
|
||||||
|
) t
|
||||||
|
WHERE rn = 1
|
||||||
|
) mmd
|
||||||
ON mmd.med_req_id = T1.id
|
ON mmd.med_req_id = T1.id
|
||||||
AND mmd.delete_flag = '0'
|
|
||||||
WHERE T1.delete_flag = '0'
|
WHERE T1.delete_flag = '0'
|
||||||
AND T1.refund_medicine_id IS NULL
|
AND T1.refund_medicine_id IS NULL
|
||||||
AND T1.generate_source_enum = #{doctorPrescription}
|
AND T1.generate_source_enum = #{doctorPrescription}
|
||||||
|
|||||||
@@ -59,4 +59,9 @@ public class RequestForm extends HisBaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String typeCode;
|
private String typeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据状态 0=待签发 1=已签发 2=已校对 3=待接收 4=已接收 5=已检查 6=已出报告 7=已作废
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -193,6 +193,9 @@ public class OpSchedule extends HisBaseEntity {
|
|||||||
/** 外请专家姓名 */
|
/** 外请专家姓名 */
|
||||||
private String externalExpertName;
|
private String externalExpertName;
|
||||||
|
|
||||||
|
/** 费用类别 */
|
||||||
|
private String feeType;
|
||||||
|
|
||||||
/** 备注信息 */
|
/** 备注信息 */
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
DELETE
|
DELETE
|
||||||
FROM adm_encounter_diagnosis
|
FROM adm_encounter_diagnosis
|
||||||
WHERE encounter_id = #{encounterId}
|
WHERE encounter_id = #{encounterId}
|
||||||
AND tcm_flag = 0
|
AND tcm_flag = 1
|
||||||
</delete>
|
</delete>
|
||||||
<select id="getEncounterDiagnosisByEncounterConDefId"
|
<select id="getEncounterDiagnosisByEncounterConDefId"
|
||||||
resultType="com.openhis.administration.domain.EncounterDiagnosis">
|
resultType="com.openhis.administration.domain.EncounterDiagnosis">
|
||||||
|
|||||||
@@ -697,7 +697,6 @@ async function handleCategoryExpand(cat) {
|
|||||||
code: m.code,
|
code: m.code,
|
||||||
price: m.price || 0,
|
price: m.price || 0,
|
||||||
packageName: m.packageName || '',
|
packageName: m.packageName || '',
|
||||||
packageId: m.packageId || null,
|
|
||||||
packagePrice: m.packagePrice || null,
|
packagePrice: m.packagePrice || null,
|
||||||
serviceFee: m.serviceFee || null
|
serviceFee: m.serviceFee || null
|
||||||
}));
|
}));
|
||||||
@@ -1009,16 +1008,11 @@ function handleRowClick(row) {
|
|||||||
activeDetailTab.value = 'applyForm';
|
activeDetailTab.value = 'applyForm';
|
||||||
request({ url: `/exam/apply/${row.applyNo}`, method: 'get' }).then(async res => {
|
request({ url: `/exam/apply/${row.applyNo}`, method: 'get' }).then(async res => {
|
||||||
const resp = res.data || res;
|
const resp = res.data || res;
|
||||||
// Bug #408修复: items 在 AjaxResult 顶层(res.items / resp.items),不在 ExamApply 对象内
|
// 保存 items 在顶层响应中,避免后面 d.data 赋值后丢失
|
||||||
// 防御性提取:优先取顶层 items,兼容嵌套在 resp.data.items 的情况
|
const rawItems = resp.items;
|
||||||
let rawItems = res.items || resp.items;
|
|
||||||
if (!rawItems && resp.data && typeof resp.data === 'object') {
|
|
||||||
rawItems = resp.data.items;
|
|
||||||
}
|
|
||||||
rawItems = rawItems || [];
|
|
||||||
const d = resp.data || resp;
|
const d = resp.data || resp;
|
||||||
if (d) Object.assign(form, d);
|
if (d) Object.assign(form, d);
|
||||||
if (Array.isArray(rawItems) && rawItems.length > 0) {
|
if (rawItems && Array.isArray(rawItems)) {
|
||||||
try {
|
try {
|
||||||
// 为每个项目加载检查方法
|
// 为每个项目加载检查方法
|
||||||
const itemsWithMethods = await Promise.all(rawItems.map(async m => {
|
const itemsWithMethods = await Promise.all(rawItems.map(async m => {
|
||||||
@@ -1049,18 +1043,12 @@ function handleRowClick(row) {
|
|||||||
code: md.code,
|
code: md.code,
|
||||||
price: m.itemFee || 0, // fallback 到已保存的价格
|
price: m.itemFee || 0, // fallback 到已保存的价格
|
||||||
packageName: md.packageName || '',
|
packageName: md.packageName || '',
|
||||||
packageId: md.packageId || null,
|
|
||||||
packagePrice: md.packagePrice || null, // Bug #384修复: 套餐价格
|
packagePrice: md.packagePrice || null, // Bug #384修复: 套餐价格
|
||||||
serviceFee: md.serviceFee || null
|
serviceFee: md.serviceFee || null
|
||||||
}));
|
}));
|
||||||
// 如果有已保存的检查方法信息,尝试匹配
|
// 如果有已保存的检查方法信息,尝试匹配
|
||||||
if (m.checkMethodId) {
|
if (m.checkMethodId) {
|
||||||
item.selectedMethod = item.methods.find(md => md.id === m.checkMethodId) || null;
|
item.selectedMethod = item.methods.find(md => md.id === m.checkMethodId) || null;
|
||||||
// 从已保存的方法中获取套餐信息
|
|
||||||
if (item.selectedMethod?.packageId) {
|
|
||||||
item.isPackage = true;
|
|
||||||
item.packageId = item.selectedMethod.packageId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -1121,13 +1109,6 @@ async function handleMethodSelect(checked, method, cat) {
|
|||||||
const existingItem = selectedItems.value.find(s => s.id === targetItem.id);
|
const existingItem = selectedItems.value.find(s => s.id === targetItem.id);
|
||||||
if (existingItem) {
|
if (existingItem) {
|
||||||
existingItem.selectedMethod = method;
|
existingItem.selectedMethod = method;
|
||||||
// 从方法中获取套餐信息
|
|
||||||
if (method.packageId) {
|
|
||||||
existingItem.isPackage = true;
|
|
||||||
existingItem.packageId = method.packageId;
|
|
||||||
// 预加载套餐明细
|
|
||||||
loadPackageDetailsForItem(existingItem);
|
|
||||||
}
|
|
||||||
updateMethodDisplay();
|
updateMethodDisplay();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1142,7 +1123,7 @@ async function handleMethodSelect(checked, method, cat) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const newItem = {
|
selectedItems.value.push({
|
||||||
id: targetItem.id, name: targetItem.name,
|
id: targetItem.id, name: targetItem.name,
|
||||||
price: targetItem.price, quantity: 1,
|
price: targetItem.price, quantity: 1,
|
||||||
serviceFee: targetItem.serviceFee || 0,
|
serviceFee: targetItem.serviceFee || 0,
|
||||||
@@ -1154,16 +1135,9 @@ async function handleMethodSelect(checked, method, cat) {
|
|||||||
methods: [method],
|
methods: [method],
|
||||||
selectedMethod: method,
|
selectedMethod: method,
|
||||||
expanded: false,
|
expanded: false,
|
||||||
// 从方法中获取套餐信息(优先级高于项目本身的 packageName)
|
isPackage: !!targetItem.packageName,
|
||||||
isPackage: !!method.packageId || !!targetItem.packageName,
|
packageId: targetItem.packageId || null
|
||||||
packageId: method.packageId || targetItem.packageId || null
|
});
|
||||||
};
|
|
||||||
selectedItems.value.push(newItem);
|
|
||||||
|
|
||||||
// 如果是套餐,预加载套餐明细
|
|
||||||
if (newItem.isPackage && newItem.packageId) {
|
|
||||||
loadPackageDetailsForItem(newItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 自动回填执行科室
|
// 自动回填执行科室
|
||||||
if (selectedItems.value.length === 1 && cat?.performDeptName) {
|
if (selectedItems.value.length === 1 && cat?.performDeptName) {
|
||||||
@@ -1208,7 +1182,6 @@ async function handleItemSelect(checked, item, cat) {
|
|||||||
code: m.code,
|
code: m.code,
|
||||||
price: m.price || item.price, // fallback 到项目价格
|
price: m.price || item.price, // fallback 到项目价格
|
||||||
packageName: m.packageName || '',
|
packageName: m.packageName || '',
|
||||||
packageId: m.packageId || null,
|
|
||||||
packagePrice: m.packagePrice || null, // Bug #384修复: 套餐价格
|
packagePrice: m.packagePrice || null, // Bug #384修复: 套餐价格
|
||||||
serviceFee: m.serviceFee || null // Bug #384修复: 服务费
|
serviceFee: m.serviceFee || null // Bug #384修复: 服务费
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -169,6 +169,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {getCurrentInstance} from 'vue'; // 添加 nextTick 导入
|
import {getCurrentInstance} from 'vue'; // 添加 nextTick 导入
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
|
import { formatDateStr } from '@/utils';
|
||||||
import {
|
import {
|
||||||
delEncounterDiagnosis,
|
delEncounterDiagnosis,
|
||||||
deleteDiagnosisBind,
|
deleteDiagnosisBind,
|
||||||
@@ -286,10 +287,22 @@ function getList() {
|
|||||||
if (obj.diagSrtNo == null) {
|
if (obj.diagSrtNo == null) {
|
||||||
obj.diagSrtNo = '1';
|
obj.diagSrtNo = '1';
|
||||||
}
|
}
|
||||||
|
// 补充缺失的元数据字段
|
||||||
|
if (!obj.diagnosisDoctor) {
|
||||||
|
obj.diagnosisDoctor = props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name;
|
||||||
|
}
|
||||||
|
if (!obj.diagnosisTime) {
|
||||||
|
obj.diagnosisTime = item.diagnosisTime || getCurrentDate();
|
||||||
|
}
|
||||||
|
if (!obj.classification) {
|
||||||
|
obj.classification = item.typeName === '中医诊断' ? '中医' : '西医';
|
||||||
|
}
|
||||||
|
if (obj.longTermFlag == null) {
|
||||||
|
obj.longTermFlag = 0;
|
||||||
|
}
|
||||||
return obj;
|
return obj;
|
||||||
});
|
});
|
||||||
form.value.diagnosisList = datas;
|
form.value.diagnosisList = datas;
|
||||||
// form.value.diagnosisList = res.data;
|
|
||||||
emits('diagnosisSave', false);
|
emits('diagnosisSave', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -305,13 +318,16 @@ function getList() {
|
|||||||
ybNo: item.ybNo,
|
ybNo: item.ybNo,
|
||||||
medTypeCode: item.medTypeCode,
|
medTypeCode: item.medTypeCode,
|
||||||
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
||||||
diagnosisTime: new Date().toLocaleString('zh-CN')
|
diagnosisTime: item.diagnosisTime || getCurrentDate(),
|
||||||
|
diagSrtNo: item.diagSrtNo,
|
||||||
|
classification: '中医',
|
||||||
|
longTermFlag: item.longTermFlag || 0
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 将新数据添加到现有列表中
|
// 将新数据添加到现有列表中
|
||||||
form.value.diagnosisList.push(...newList);
|
form.value.diagnosisList.push(...newList);
|
||||||
|
|
||||||
// 重新排序整个列表
|
// 重新排序整个列表
|
||||||
form.value.diagnosisList.sort((a, b) => {
|
form.value.diagnosisList.sort((a, b) => {
|
||||||
const aNo = typeof a.diagSrtNo === 'number' ? a.diagSrtNo : 9999;
|
const aNo = typeof a.diagSrtNo === 'number' ? a.diagSrtNo : 9999;
|
||||||
@@ -322,7 +338,7 @@ function getList() {
|
|||||||
emits('diagnosisSave', false);
|
emits('diagnosisSave', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
getTree();
|
getTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,11 +355,12 @@ function handleImport() {
|
|||||||
if (!props.patientInfo || !props.patientInfo.encounterId) {
|
if (!props.patientInfo || !props.patientInfo.encounterId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.patientInfo.contractName != '自费') {
|
if (props.patientInfo.contractName != '自费') {
|
||||||
// 获取患者慢性病信息
|
// 获取患者慢性病信息
|
||||||
getChronicDisease({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
getChronicDisease({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
||||||
if (res.data && res.data.length > 0) {
|
if (res.data && res.data.length > 0) {
|
||||||
|
const currentDate = getCurrentDate();
|
||||||
res.data.forEach((item, index) => {
|
res.data.forEach((item, index) => {
|
||||||
form.value.diagnosisList.push({
|
form.value.diagnosisList.push({
|
||||||
...item,
|
...item,
|
||||||
@@ -355,7 +372,10 @@ function handleImport() {
|
|||||||
iptDiseTypeCode: 2,
|
iptDiseTypeCode: 2,
|
||||||
diagnosisDesc: '',
|
diagnosisDesc: '',
|
||||||
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
||||||
diagnosisTime: new Date().toLocaleString('zh-CN'),
|
diagnosisTime: currentDate,
|
||||||
|
onsetDate: currentDate,
|
||||||
|
classification: '西医',
|
||||||
|
longTermFlag: 0,
|
||||||
//添加 patientId
|
//添加 patientId
|
||||||
patientId: props.patientInfo.patientId
|
patientId: props.patientInfo.patientId
|
||||||
},
|
},
|
||||||
@@ -470,6 +490,7 @@ function handleAddDiagnosis() {
|
|||||||
* 添加诊断项
|
* 添加诊断项
|
||||||
*/
|
*/
|
||||||
function addDiagnosisItem() {
|
function addDiagnosisItem() {
|
||||||
|
const currentDate = getCurrentDate();
|
||||||
form.value.diagnosisList.push({
|
form.value.diagnosisList.push({
|
||||||
showPopover: false,
|
showPopover: false,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
@@ -479,9 +500,10 @@ function addDiagnosisItem() {
|
|||||||
iptDiseTypeCode: 2,
|
iptDiseTypeCode: 2,
|
||||||
diagnosisDesc: '',
|
diagnosisDesc: '',
|
||||||
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
||||||
diagnosisTime: new Date().toLocaleString('zh-CN'),
|
diagnosisTime: currentDate,
|
||||||
|
classification: '西医',
|
||||||
// 新增这一行:为每个诊断项添加 patientId
|
onsetDate: currentDate,
|
||||||
|
longTermFlag: 0,
|
||||||
patientId: props.patientInfo.patientId
|
patientId: props.patientInfo.patientId
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -558,16 +580,7 @@ function handleMaindise(value, index) {
|
|||||||
/**
|
/**
|
||||||
* 保存诊断
|
* 保存诊断
|
||||||
*/
|
*/
|
||||||
/**
|
async function handleSaveDiagnosis() {
|
||||||
* 保存诊断
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 保存诊断
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 保存诊断
|
|
||||||
*/
|
|
||||||
function handleSaveDiagnosis() {
|
|
||||||
for (let index = 0; index < (form.value.diagnosisList || []).length; index++) {
|
for (let index = 0; index < (form.value.diagnosisList || []).length; index++) {
|
||||||
const item = form.value.diagnosisList[index];
|
const item = form.value.diagnosisList[index];
|
||||||
if (!item.diagSrtNo) {
|
if (!item.diagSrtNo) {
|
||||||
@@ -578,7 +591,7 @@ function handleSaveDiagnosis() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
proxy.$refs.formRef.validate((valid) => {
|
proxy.$refs.formRef.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (form.value.diagnosisList.length === 0) {
|
if (form.value.diagnosisList.length === 0) {
|
||||||
proxy.$modal.msgWarning('诊断不能为空');
|
proxy.$modal.msgWarning('诊断不能为空');
|
||||||
@@ -591,43 +604,51 @@ function handleSaveDiagnosis() {
|
|||||||
// 设置保存标志,避免触发watch监听器
|
// 设置保存标志,避免触发watch监听器
|
||||||
isSaving.value = true;
|
isSaving.value = true;
|
||||||
|
|
||||||
// 步骤1:深拷贝并按 diagSrtNo 排序
|
try {
|
||||||
const sortedList = [...form.value.diagnosisList].sort((a, b) => {
|
// 步骤1:深拷贝并按 diagSrtNo 排序
|
||||||
const aNo = typeof a.diagSrtNo === 'number' ? a.diagSrtNo : 9999;
|
const sortedList = [...form.value.diagnosisList].sort((a, b) => {
|
||||||
const bNo = typeof b.diagSrtNo === 'number' ? b.diagSrtNo : 9999;
|
const aNo = typeof a.diagSrtNo === 'number' ? a.diagSrtNo : 9999;
|
||||||
return aNo - bNo;
|
const bNo = typeof b.diagSrtNo === 'number' ? b.diagSrtNo : 9999;
|
||||||
});
|
return aNo - bNo;
|
||||||
|
});
|
||||||
|
|
||||||
// 步骤2:重新分配连续的序号(从1开始)
|
// 步骤2:转换日期格式为后端期望的格式
|
||||||
sortedList.forEach((item, index) => {
|
const diagnosisChildList = sortedList.map(item => ({
|
||||||
item.diagSrtNo = index + 1; // 这里是关键!把“诊断排序”改成新顺序
|
...item,
|
||||||
});
|
onsetDate: item.onsetDate ? formatDateStr(item.onsetDate, 'YYYY/M/D HH:mm:ss') : null,
|
||||||
|
diagnosisTime: item.diagnosisTime ? formatDateStr(item.diagnosisTime, 'YYYY/M/D HH:mm:ss') : null
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 步骤3:提交排序后的数据
|
||||||
|
const res = await saveDiagnosis({
|
||||||
|
patientId: props.patientInfo.patientId,
|
||||||
|
encounterId: props.patientInfo.encounterId,
|
||||||
|
diagnosisChildList: diagnosisChildList,
|
||||||
|
});
|
||||||
|
|
||||||
// 步骤3:提交排序后的数据
|
|
||||||
saveDiagnosis({
|
|
||||||
patientId: props.patientInfo.patientId,
|
|
||||||
encounterId: props.patientInfo.encounterId,
|
|
||||||
diagnosisChildList: sortedList,
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
// 步骤4:更新本地数据,使用全新对象防止响应式问题
|
// 步骤4:从服务器刷新数据,确保获取最新的诊断信息(避免重复记录)
|
||||||
form.value.diagnosisList = sortedList.map(item => ({ ...item }));
|
await getList();
|
||||||
|
getTree();
|
||||||
emits('diagnosisSave', false);
|
emits('diagnosisSave', false);
|
||||||
proxy.$modal.msgSuccess('诊断已保存');
|
proxy.$modal.msgSuccess('诊断已保存');
|
||||||
|
|
||||||
// 食源性疾病逻辑
|
// 食源性疾病逻辑
|
||||||
isFoodDiseasesNew({ encounterId: props.patientInfo.encounterId }).then((res2) => {
|
isFoodDiseasesNew({ encounterId: props.patientInfo.encounterId }).then((res2) => {
|
||||||
if (res2.code === 20 && res2.data) {
|
if (res2.code === 200 && res2.data) {
|
||||||
window.open(res2.data, '_blank');
|
window.open(res2.data, '_blank');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
} catch (error) {
|
||||||
|
console.error('保存诊断失败:', error);
|
||||||
|
const errorMsg = error?.response?.data?.msg || error?.message || '保存诊断失败,请稍后重试';
|
||||||
|
proxy.$modal.msgError(errorMsg);
|
||||||
|
} finally {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
isSaving.value = false;
|
isSaving.value = false;
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -687,6 +708,7 @@ function handleNodeClick(data) {
|
|||||||
proxy.$modal.msgWarning('该诊断项已存在');
|
proxy.$modal.msgWarning('该诊断项已存在');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const currentDate = getCurrentDate();
|
||||||
form.value.diagnosisList.push({
|
form.value.diagnosisList.push({
|
||||||
ybNo: data.ybNo,
|
ybNo: data.ybNo,
|
||||||
name: data.name,
|
name: data.name,
|
||||||
@@ -694,9 +716,12 @@ function handleNodeClick(data) {
|
|||||||
medTypeCode: undefined,
|
medTypeCode: undefined,
|
||||||
diagSrtNo: form.value.diagnosisList.length + 1,
|
diagSrtNo: form.value.diagnosisList.length + 1,
|
||||||
definitionId: data.definitionId,
|
definitionId: data.definitionId,
|
||||||
|
classification: '西医',
|
||||||
|
onsetDate: currentDate,
|
||||||
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
||||||
diagnosisTime: new Date().toLocaleString('zh-CN'),
|
diagnosisTime: currentDate,
|
||||||
// 添加 patientId
|
longTermFlag: 0,
|
||||||
|
selectedDiseases: data.ybNo ? [data.ybNo] : [],
|
||||||
patientId: props.patientInfo.patientId
|
patientId: props.patientInfo.patientId
|
||||||
});
|
});
|
||||||
if (form.value.diagnosisList.length == 1) {
|
if (form.value.diagnosisList.length == 1) {
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ onMounted(() => {
|
|||||||
* type(1:watch监听类型 2:点击保存类型)
|
* type(1:watch监听类型 2:点击保存类型)
|
||||||
* selectProjectIds(选中项目的id数组)
|
* selectProjectIds(选中项目的id数组)
|
||||||
* */
|
* */
|
||||||
const projectWithDepartment = (selectProjectIds, type) => {
|
const projectWithDepartment = (selectProjectIds) => {
|
||||||
//1.获取选中的项目 2.判断项目的执行科室是否相同 3.判断执行科室是否配置 4.将项目的执行科室复值到执行科室下拉选位置
|
//1.获取选中的项目 2.判断项目的执行科室是否相同 3.判断执行科室是否配置 4.将项目的执行科室复值到执行科室下拉选位置
|
||||||
let isRelease = true;
|
let isRelease = true;
|
||||||
// 选中项目的数组
|
// 选中项目的数组
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ const submit = () => {
|
|||||||
encounterId: patientInfo.value.encounterId,
|
encounterId: patientInfo.value.encounterId,
|
||||||
organizationId: patientInfo.value.inHospitalOrgId,
|
organizationId: patientInfo.value.inHospitalOrgId,
|
||||||
requestFormId: '',
|
requestFormId: '',
|
||||||
name: applicationListAllFilter.map(item => item.adviceName).join('、'),
|
name: '检查申请单',
|
||||||
descJson: JSON.stringify(submitForm),
|
descJson: JSON.stringify(submitForm),
|
||||||
categoryEnum: '2',
|
categoryEnum: '2',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
@@ -631,6 +631,12 @@ function getListInfo(addNewRow) {
|
|||||||
handleAddPrescription();
|
handleAddPrescription();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error('处方列表加载失败:', err);
|
||||||
|
// 🔧 Bug #405 修复:列表加载失败时,确保所有行被锁定(isEdit=false)
|
||||||
|
// 防止行永久处于可编辑状态
|
||||||
|
prescriptionList.value.forEach(item => { item.isEdit = false; });
|
||||||
|
loadingInstance.close();
|
||||||
});
|
});
|
||||||
getContract({ encounterId: patientInfo.value.encounterId }).then((res) => {
|
getContract({ encounterId: patientInfo.value.encounterId }).then((res) => {
|
||||||
contractList.value = res.data;
|
contractList.value = res.data;
|
||||||
@@ -1443,6 +1449,12 @@ function handleSaveBatch() {
|
|||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
isSaving.value = false;
|
isSaving.value = false;
|
||||||
|
// 🔧 Bug #405 修复:保存失败时也锁定行,防止行永久处于可编辑状态
|
||||||
|
filterPrescriptionList.value.forEach(item => {
|
||||||
|
if (item.statusEnum == 1 && !item.requestId) {
|
||||||
|
item.isEdit = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
proxy.$modal.msgError(error?.msg || '保存失败,请重试');
|
proxy.$modal.msgError(error?.msg || '保存失败,请重试');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
10
sql/迁移记录-DB变更记录/20260513_add_fee_type_to_op_schedule.sql
Normal file
10
sql/迁移记录-DB变更记录/20260513_add_fee_type_to_op_schedule.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
-- Bug #435: 门诊手术安排编辑弹窗中"费用类别"字段数据未回显
|
||||||
|
-- 原因:op_schedule 表缺少 fee_type 字段,导致手术安排创建时费用类别未被持久化
|
||||||
|
ALTER TABLE op_schedule ADD COLUMN IF NOT EXISTS fee_type VARCHAR(50);
|
||||||
|
COMMENT ON COLUMN op_schedule.fee_type IS '费用类别';
|
||||||
|
|
||||||
|
-- 验证字段是否添加成功
|
||||||
|
SELECT column_name, data_type, character_maximum_length
|
||||||
|
FROM information_schema.columns
|
||||||
|
WHERE table_name = 'op_schedule'
|
||||||
|
AND column_name = 'fee_type';
|
||||||
Reference in New Issue
Block a user