Compare commits
4 Commits
赵云-bug408
...
develop-赵云
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77374a5889 | ||
|
|
53e5ee331b | ||
|
|
571f254d0e | ||
|
|
560813d009 |
@@ -36,6 +36,9 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -598,6 +601,25 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
|||||||
InfectiousDiseaseReport infectiousDiseaseReport = new InfectiousDiseaseReport();
|
InfectiousDiseaseReport infectiousDiseaseReport = new InfectiousDiseaseReport();
|
||||||
BeanUtils.copyProperties(infectiousDiseaseReportDto, infectiousDiseaseReport);
|
BeanUtils.copyProperties(infectiousDiseaseReportDto, infectiousDiseaseReport);
|
||||||
|
|
||||||
|
// BeanUtils.copyProperties 不支持 LocalDate/LocalDateTime 到 java.util.Date 的类型转换,需手动处理
|
||||||
|
if (infectiousDiseaseReportDto.getOnsetDate() != null) {
|
||||||
|
infectiousDiseaseReport.setOnsetDate(
|
||||||
|
Date.from(infectiousDiseaseReportDto.getOnsetDate().atStartOfDay(ZoneId.systemDefault()).toInstant()));
|
||||||
|
}
|
||||||
|
if (infectiousDiseaseReportDto.getDiagDate() != null) {
|
||||||
|
infectiousDiseaseReport.setDiagDate(
|
||||||
|
Date.from(infectiousDiseaseReportDto.getDiagDate().atZone(ZoneId.systemDefault()).toInstant()));
|
||||||
|
}
|
||||||
|
// deathDate / reportDate 同理
|
||||||
|
if (infectiousDiseaseReportDto.getDeathDate() != null) {
|
||||||
|
infectiousDiseaseReport.setDeathDate(
|
||||||
|
Date.from(infectiousDiseaseReportDto.getDeathDate().atStartOfDay(ZoneId.systemDefault()).toInstant()));
|
||||||
|
}
|
||||||
|
if (infectiousDiseaseReportDto.getReportDate() != null) {
|
||||||
|
infectiousDiseaseReport.setReportDate(
|
||||||
|
Date.from(infectiousDiseaseReportDto.getReportDate().atStartOfDay(ZoneId.systemDefault()).toInstant()));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置创建人、删除状态、租户ID
|
* 设置创建人、删除状态、租户ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -91,13 +91,15 @@
|
|||||||
os.surgery_nature AS surgeryType,
|
os.surgery_nature AS surgeryType,
|
||||||
cs.incision_level AS incisionLevel,
|
cs.incision_level AS incisionLevel,
|
||||||
fc.contract_name AS feeType,
|
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 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 adm_encounter ae ON ae.id = os.visit_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 (
|
LEFT JOIN (
|
||||||
SELECT patient_id, identifier_no
|
SELECT patient_id, identifier_no
|
||||||
FROM (
|
FROM (
|
||||||
|
|||||||
@@ -1226,22 +1226,18 @@ function handleRowClick(row) {
|
|||||||
selectedItems.value = [];
|
selectedItems.value = [];
|
||||||
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 => {
|
||||||
// 响应结构判定:Axios拦截器对 code===200 返回 res.data(AjaxResult体),
|
// 响应结构: Axios拦截器对code===200返回res.data(AjaxResult体)
|
||||||
// 但某些情况下可能返回完整 Axios 响应 {data: AjaxResult}。
|
// 结构为 { code: 200, data: examApply实体, items: [明细数组] }
|
||||||
// 用 res.code 判定是否已是 AjaxResult 体,避免二次解包导致 items 丢失。
|
const items = Array.isArray(res.items) ? res.items : [];
|
||||||
const isAjaxResult = res && typeof res === 'object' && res.code !== undefined;
|
const dataObj = res.data || {};
|
||||||
const ajaxBody = isAjaxResult ? res : (res.data || res);
|
|
||||||
|
|
||||||
// items 在 AjaxResult 顶层,data 字段是 ExamApply 实体
|
// 先填充表单字段
|
||||||
const rawItems = Array.isArray(ajaxBody.items) ? ajaxBody.items : [];
|
if (dataObj && typeof dataObj === 'object') Object.assign(form, dataObj);
|
||||||
const detailData = ajaxBody.data || {};
|
|
||||||
|
|
||||||
if (detailData && typeof detailData === 'object') Object.assign(form, detailData);
|
if (items.length > 0) {
|
||||||
|
|
||||||
if (rawItems.length > 0) {
|
|
||||||
try {
|
try {
|
||||||
// 为每个项目加载检查方法
|
// 为每个项目加载检查方法
|
||||||
const itemsWithMethods = await Promise.all(rawItems.map(async m => {
|
const itemsWithMethods = await Promise.all(items.map(async m => {
|
||||||
const item = {
|
const item = {
|
||||||
id: m.itemCode, name: m.itemName,
|
id: m.itemCode, name: m.itemName,
|
||||||
price: m.itemFee || 0, quantity: 1,
|
price: m.itemFee || 0, quantity: 1,
|
||||||
@@ -1260,7 +1256,7 @@ function handleRowClick(row) {
|
|||||||
if (m.bodyPartCode) {
|
if (m.bodyPartCode) {
|
||||||
try {
|
try {
|
||||||
const methodRes = await searchCheckMethod({ checkType: m.bodyPartCode });
|
const methodRes = await searchCheckMethod({ checkType: m.bodyPartCode });
|
||||||
// Bug #384修复: 正确解析 API 返回结构
|
// 正确解析 API 返回结构
|
||||||
let methodData = methodRes?.data?.data || methodRes?.data || methodRes?.rows || methodRes;
|
let methodData = methodRes?.data?.data || methodRes?.data || methodRes?.rows || methodRes;
|
||||||
if (!Array.isArray(methodData) && methodRes?.data && Array.isArray(methodRes.data.data)) {
|
if (!Array.isArray(methodData) && methodRes?.data && Array.isArray(methodRes.data.data)) {
|
||||||
methodData = methodRes.data.data;
|
methodData = methodRes.data.data;
|
||||||
@@ -1270,16 +1266,15 @@ function handleRowClick(row) {
|
|||||||
id: md.id,
|
id: md.id,
|
||||||
name: md.name,
|
name: md.name,
|
||||||
code: md.code,
|
code: md.code,
|
||||||
price: m.itemFee || 0, // fallback 到已保存的价格
|
price: m.itemFee || 0,
|
||||||
packageName: md.packageName || '',
|
packageName: md.packageName || '',
|
||||||
packageId: md.packageId || null,
|
packageId: md.packageId || null,
|
||||||
packagePrice: md.packagePrice || null, // Bug #384修复: 套餐价格
|
packagePrice: md.packagePrice || null,
|
||||||
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 => String(md.id) === String(m.checkMethodId)) || null;
|
||||||
// 从已保存的方法中获取套餐信息
|
|
||||||
if (item.selectedMethod?.packageId) {
|
if (item.selectedMethod?.packageId) {
|
||||||
item.isPackage = true;
|
item.isPackage = true;
|
||||||
item.packageId = item.selectedMethod.packageId;
|
item.packageId = item.selectedMethod.packageId;
|
||||||
@@ -1295,22 +1290,27 @@ function handleRowClick(row) {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('加载检查方法失败', err);
|
console.error('加载检查方法失败', err);
|
||||||
// 单个项目加载失败不影响其他项目,继续返回 item
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
}));
|
}));
|
||||||
|
// Bug #408修复: 确保明细数据正确加载到selectedItems
|
||||||
selectedItems.value = itemsWithMethods;
|
selectedItems.value = itemsWithMethods;
|
||||||
|
// 加载套餐明细(单个失败不影响其他项目和明细显示)
|
||||||
for (const it of selectedItems.value) {
|
for (const it of selectedItems.value) {
|
||||||
if (getPackageCarrier(it)?.packageId) {
|
if (getPackageCarrier(it)?.packageId) {
|
||||||
await loadPackageDetailsForItem(it);
|
try {
|
||||||
|
await loadPackageDetailsForItem(it);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('加载套餐明细失败:', it.name, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
it.expanded = !!getPackageCarrier(it)?.packageId;
|
it.expanded = !!getPackageCarrier(it)?.packageId;
|
||||||
}
|
}
|
||||||
syncCategoryChecked();
|
syncCategoryChecked();
|
||||||
// Bug #384修复: 回充后更新检查方法显示
|
// Bug #384修复: 回充后更新检查方法显示
|
||||||
updateMethodDisplay();
|
updateMethodDisplay();
|
||||||
// 修复【#408】:加载申请单详情后自动切换到检查明细页签,确保已加载的明细数据可见
|
// Bug #408修复: 加载申请单详情后自动切换到检查明细页签,确保已加载的明细数据可见
|
||||||
activeDetailTab.value = 'applyDetail';
|
activeDetailTab.value = 'applyDetail';
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('加载申请单详情失败', err);
|
console.error('加载申请单详情失败', err);
|
||||||
@@ -1362,8 +1362,9 @@ async function handleMethodSelect(checked, method, cat) {
|
|||||||
existingItem.isPackage = true;
|
existingItem.isPackage = true;
|
||||||
existingItem.packageId = method.packageId;
|
existingItem.packageId = method.packageId;
|
||||||
existingItem.packageName = method.packageName || existingItem.packageName; // #428修复: 确保 packageName 同步
|
existingItem.packageName = method.packageName || existingItem.packageName; // #428修复: 确保 packageName 同步
|
||||||
|
existingItem.expanded = true; // #428修复: 有套餐时默认展开,展示套餐明细
|
||||||
// 预加载套餐明细
|
// 预加载套餐明细
|
||||||
loadPackageDetailsForItem(existingItem);
|
await loadPackageDetailsForItem(existingItem);
|
||||||
}
|
}
|
||||||
updateMethodDisplay();
|
updateMethodDisplay();
|
||||||
return;
|
return;
|
||||||
@@ -1399,9 +1400,10 @@ async function handleMethodSelect(checked, method, cat) {
|
|||||||
};
|
};
|
||||||
selectedItems.value.push(newItem);
|
selectedItems.value.push(newItem);
|
||||||
|
|
||||||
// 如果是套餐,预加载套餐明细
|
// 如果是套餐,预加载套餐明细并默认展开
|
||||||
if (newItem.isPackage && newItem.packageId) {
|
if (newItem.isPackage && newItem.packageId) {
|
||||||
loadPackageDetailsForItem(newItem);
|
newItem.expanded = true;
|
||||||
|
await loadPackageDetailsForItem(newItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自动回填执行科室
|
// 自动回填执行科室
|
||||||
@@ -1523,7 +1525,10 @@ async function handleItemSelect(checked, item, cat) {
|
|||||||
// Bug #384修复 + #426修复: 展开/收起项目卡片
|
// Bug #384修复 + #426修复: 展开/收起项目卡片
|
||||||
async function toggleItemExpand(item) {
|
async function toggleItemExpand(item) {
|
||||||
item.expanded = !item.expanded;
|
item.expanded = !item.expanded;
|
||||||
if (item.expanded && (item.isPackage || item.packageName) && (!item.packageDetails || item.packageDetails.length === 0) && !item.packageDetailsLoading) {
|
const carrier = getPackageCarrier(item);
|
||||||
|
const hasDetails = Array.isArray(item.packageDetailsDisplay) && item.packageDetailsDisplay.length > 0
|
||||||
|
|| Array.isArray(carrier?.packageDetails) && carrier.packageDetails.length > 0;
|
||||||
|
if (item.expanded && (item.isPackage || item.packageName) && !hasDetails && !item.packageDetailsLoading) {
|
||||||
await loadPackageDetailsForItem(item);
|
await loadPackageDetailsForItem(item);
|
||||||
}
|
}
|
||||||
if (item.expanded && shouldShowPackageBody(item)) {
|
if (item.expanded && shouldShowPackageBody(item)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user