Compare commits
21 Commits
cec8a44bd9
...
陈琳
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cedcefacb | ||
|
|
4feac503a0 | ||
|
|
d747b0b380 | ||
|
|
af0a0957d0 | ||
|
|
6964f4f0a0 | ||
|
|
b8d663d5fa | ||
|
|
e32ef40f48 | ||
|
|
04903dc0b9 | ||
|
|
cd9dddb948 | ||
|
|
14ebcea2e6 | ||
|
|
7694122409 | ||
|
|
dd0cdf0af3 | ||
|
|
c6a29aa7f4 | ||
|
|
19b3bf5f3a | ||
|
|
51a75a6787 | ||
|
|
79a91f0a77 | ||
|
|
f1e30bb3a7 | ||
|
|
49a2313d7a | ||
|
|
677106afc2 | ||
|
|
925f3dde41 | ||
|
|
ae805eb89c |
@@ -63,20 +63,4 @@ 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);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,14 +92,10 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
return R.fail("无待签发的医嘱,该申请单不可编辑");
|
return R.fail("无待签发的医嘱,该申请单不可编辑");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 诊疗处方号 - 按申请单类型生成不同规则的单号
|
// 检查申请单号:JC(检查)+ Z(住院标识)+ yyMMdd(日期)+ 5位顺序号
|
||||||
if (ActivityDefCategory.TEST.getCode().equals(typeCode)) {
|
String dateStr = new java.text.SimpleDateFormat("yyMMdd").format(new Date());
|
||||||
// 检查申请单:JC(检查)+ Z(住院标识)+ yyMMdd(日期)+ 5位顺序号
|
int seq = assignSeqUtil.getSeqNoByDay(AssignSeqEnum.CHECK_APPLY_NO.getPrefix());
|
||||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
prescriptionNo = "JCZ" + dateStr + String.format("%05d", seq);
|
||||||
prescriptionNo = "JCZ" + dateStr + assignSeqUtil.getSeq("JCZ_" + dateStr, 5);
|
|
||||||
} else {
|
|
||||||
prescriptionNo = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_PSYCHOTROPIC_NO.getPrefix(), 8);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当前时间
|
// 当前时间
|
||||||
@@ -478,68 +474,4 @@ 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, "撤回成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,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")
|
||||||
|
|||||||
@@ -280,17 +280,9 @@
|
|||||||
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 (
|
LEFT JOIN med_medication_dispense mmd
|
||||||
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}
|
||||||
|
|||||||
@@ -270,6 +270,10 @@ public enum AssignSeqEnum {
|
|||||||
* 诊疗处方号
|
* 诊疗处方号
|
||||||
*/
|
*/
|
||||||
ACTIVITY_PSYCHOTROPIC_NO("62", "诊疗处方号", "PAR"),
|
ACTIVITY_PSYCHOTROPIC_NO("62", "诊疗处方号", "PAR"),
|
||||||
|
/**
|
||||||
|
* 检查申请单号(住院)
|
||||||
|
*/
|
||||||
|
CHECK_APPLY_NO("72", "检查申请单号", "JCZ"),
|
||||||
/**
|
/**
|
||||||
* b 病历文书
|
* b 病历文书
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -59,9 +59,4 @@ public class RequestForm extends HisBaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String typeCode;
|
private String typeCode;
|
||||||
|
|
||||||
/**
|
|
||||||
* 单据状态 0=待签发 1=已签发 2=已校对 3=待接收 4=已接收 5=已检查 6=已出报告 7=已作废
|
|
||||||
*/
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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 = 1
|
AND tcm_flag = 0
|
||||||
</delete>
|
</delete>
|
||||||
<select id="getEncounterDiagnosisByEncounterConDefId"
|
<select id="getEncounterDiagnosisByEncounterConDefId"
|
||||||
resultType="com.openhis.administration.domain.EncounterDiagnosis">
|
resultType="com.openhis.administration.domain.EncounterDiagnosis">
|
||||||
|
|||||||
@@ -682,6 +682,7 @@ 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
|
||||||
}));
|
}));
|
||||||
@@ -1025,12 +1026,18 @@ 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) {
|
||||||
@@ -1091,6 +1098,13 @@ 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;
|
||||||
}
|
}
|
||||||
@@ -1105,7 +1119,7 @@ async function handleMethodSelect(checked, method, cat) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedItems.value.push({
|
const newItem = {
|
||||||
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,
|
||||||
@@ -1117,9 +1131,16 @@ async function handleMethodSelect(checked, method, cat) {
|
|||||||
methods: [method],
|
methods: [method],
|
||||||
selectedMethod: method,
|
selectedMethod: method,
|
||||||
expanded: false,
|
expanded: false,
|
||||||
isPackage: !!targetItem.packageName,
|
// 从方法中获取套餐信息(优先级高于项目本身的 packageName)
|
||||||
packageId: targetItem.packageId || null
|
isPackage: !!method.packageId || !!targetItem.packageName,
|
||||||
});
|
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) {
|
||||||
@@ -1164,6 +1185,7 @@ 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,7 +169,6 @@
|
|||||||
<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,
|
||||||
@@ -287,22 +286,10 @@ 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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -318,16 +305,13 @@ 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: item.diagnosisTime || getCurrentDate(),
|
diagnosisTime: new Date().toLocaleString('zh-CN')
|
||||||
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;
|
||||||
@@ -338,7 +322,7 @@ function getList() {
|
|||||||
emits('diagnosisSave', false);
|
emits('diagnosisSave', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
getTree();
|
getTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,12 +339,11 @@ 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,
|
||||||
@@ -372,10 +355,7 @@ 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: currentDate,
|
diagnosisTime: new Date().toLocaleString('zh-CN'),
|
||||||
onsetDate: currentDate,
|
|
||||||
classification: '西医',
|
|
||||||
longTermFlag: 0,
|
|
||||||
//添加 patientId
|
//添加 patientId
|
||||||
patientId: props.patientInfo.patientId
|
patientId: props.patientInfo.patientId
|
||||||
},
|
},
|
||||||
@@ -490,7 +470,6 @@ 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,
|
||||||
@@ -500,10 +479,9 @@ 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: currentDate,
|
diagnosisTime: new Date().toLocaleString('zh-CN'),
|
||||||
classification: '西医',
|
|
||||||
onsetDate: currentDate,
|
// 新增这一行:为每个诊断项添加 patientId
|
||||||
longTermFlag: 0,
|
|
||||||
patientId: props.patientInfo.patientId
|
patientId: props.patientInfo.patientId
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -580,7 +558,16 @@ 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) {
|
||||||
@@ -591,7 +578,7 @@ async function handleSaveDiagnosis() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
proxy.$refs.formRef.validate(async (valid) => {
|
proxy.$refs.formRef.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (form.value.diagnosisList.length === 0) {
|
if (form.value.diagnosisList.length === 0) {
|
||||||
proxy.$modal.msgWarning('诊断不能为空');
|
proxy.$modal.msgWarning('诊断不能为空');
|
||||||
@@ -604,51 +591,43 @@ async function handleSaveDiagnosis() {
|
|||||||
// 设置保存标志,避免触发watch监听器
|
// 设置保存标志,避免触发watch监听器
|
||||||
isSaving.value = true;
|
isSaving.value = true;
|
||||||
|
|
||||||
try {
|
// 步骤1:深拷贝并按 diagSrtNo 排序
|
||||||
// 步骤1:深拷贝并按 diagSrtNo 排序
|
const sortedList = [...form.value.diagnosisList].sort((a, b) => {
|
||||||
const sortedList = [...form.value.diagnosisList].sort((a, b) => {
|
const aNo = typeof a.diagSrtNo === 'number' ? a.diagSrtNo : 9999;
|
||||||
const aNo = typeof a.diagSrtNo === 'number' ? a.diagSrtNo : 9999;
|
const bNo = typeof b.diagSrtNo === 'number' ? b.diagSrtNo : 9999;
|
||||||
const bNo = typeof b.diagSrtNo === 'number' ? b.diagSrtNo : 9999;
|
return aNo - bNo;
|
||||||
return aNo - bNo;
|
});
|
||||||
});
|
|
||||||
|
|
||||||
// 步骤2:转换日期格式为后端期望的格式
|
// 步骤2:重新分配连续的序号(从1开始)
|
||||||
const diagnosisChildList = sortedList.map(item => ({
|
sortedList.forEach((item, index) => {
|
||||||
...item,
|
item.diagSrtNo = index + 1; // 这里是关键!把“诊断排序”改成新顺序
|
||||||
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:更新本地数据,使用全新对象防止响应式问题
|
||||||
await getList();
|
form.value.diagnosisList = sortedList.map(item => ({ ...item }));
|
||||||
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 === 200 && res2.data) {
|
if (res2.code === 20 && res2.data) {
|
||||||
window.open(res2.data, '_blank');
|
window.open(res2.data, '_blank');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
}).finally(() => {
|
||||||
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);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -708,7 +687,6 @@ 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,
|
||||||
@@ -716,12 +694,9 @@ 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: currentDate,
|
diagnosisTime: new Date().toLocaleString('zh-CN'),
|
||||||
longTermFlag: 0,
|
// 添加 patientId
|
||||||
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) => {
|
const projectWithDepartment = (selectProjectIds, type) => {
|
||||||
//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: '检查申请单',
|
name: applicationListAllFilter.map(item => item.adviceName).join('、'),
|
||||||
descJson: JSON.stringify(submitForm),
|
descJson: JSON.stringify(submitForm),
|
||||||
categoryEnum: '2',
|
categoryEnum: '2',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user