Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24c90e9cd7 | ||
|
|
52077c613c | ||
|
|
bd471223a4 | ||
|
|
ed644c4a91 |
@@ -15,20 +15,15 @@
|
||||
WHERE wsr2.prescription_no = drf.prescription_no AND wsr2.delete_flag = '0'),
|
||||
drf.name
|
||||
) AS name,
|
||||
drf.desc_json,
|
||||
CASE
|
||||
WHEN drf.desc_json::jsonb ->> 'targetDepartment' = '' AND MIN(wsr.org_id) IS NOT NULL THEN
|
||||
(drf.desc_json::jsonb || jsonb_build_object('targetDepartment', MIN(wsr.org_id)::text))::text
|
||||
ELSE drf.desc_json
|
||||
END AS desc_json,
|
||||
drf.requester_id,
|
||||
drf.create_time,
|
||||
ap.NAME AS patient_name,
|
||||
CASE
|
||||
WHEN MIN(wsr.status_enum) = 1 THEN 0
|
||||
WHEN MIN(wsr.status_enum) = 2 THEN 1
|
||||
WHEN MIN(wsr.status_enum) = 3 AND MAX(CASE WHEN wsr.performer_check_id IS NOT NULL THEN 1 ELSE 0 END) = 1 THEN 2
|
||||
WHEN MIN(wsr.status_enum) = 3 THEN 4
|
||||
WHEN MIN(wsr.status_enum) = 4 THEN 3
|
||||
WHEN MIN(wsr.status_enum) = 5 OR MIN(wsr.status_enum) = 6 OR MIN(wsr.status_enum) = 7 THEN 7
|
||||
WHEN MIN(wsr.status_enum) = 8 THEN 6
|
||||
ELSE NULL
|
||||
END AS status
|
||||
drf.status
|
||||
FROM doc_request_form AS drf
|
||||
LEFT JOIN adm_encounter AS ae ON ae.ID = drf.encounter_id
|
||||
AND ae.delete_flag = '0'
|
||||
@@ -46,16 +41,7 @@
|
||||
AND drf.create_time <= (#{endDate}::date + INTERVAL '1 day' - INTERVAL '1 second')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND CASE
|
||||
WHEN MIN(wsr.status_enum) = 1 THEN 0
|
||||
WHEN MIN(wsr.status_enum) = 2 THEN 1
|
||||
WHEN MIN(wsr.status_enum) = 3 AND MAX(CASE WHEN wsr.performer_check_id IS NOT NULL THEN 1 ELSE 0 END) = 1 THEN 2
|
||||
WHEN MIN(wsr.status_enum) = 3 THEN 4
|
||||
WHEN MIN(wsr.status_enum) = 4 THEN 3
|
||||
WHEN MIN(wsr.status_enum) = 5 OR MIN(wsr.status_enum) = 6 OR MIN(wsr.status_enum) = 7 THEN 7
|
||||
WHEN MIN(wsr.status_enum) = 8 THEN 6
|
||||
ELSE NULL
|
||||
END = #{status}::integer
|
||||
AND drf.status = #{status}::integer
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (drf.prescription_no ILIKE '%' || #{keyword} || '%'
|
||||
@@ -71,7 +57,7 @@
|
||||
))
|
||||
</if>
|
||||
GROUP BY drf.id, drf.encounter_id, drf.prescription_no, drf.name, drf.desc_json,
|
||||
drf.requester_id, drf.create_time, ap.name
|
||||
drf.requester_id, drf.create_time, ap.name, drf.status
|
||||
</select>
|
||||
|
||||
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
||||
|
||||
@@ -584,20 +584,16 @@ async function loadPackageDetails(row, treeNode, resolve) {
|
||||
url: `/system/check-type/package/${row.packageId}/details`,
|
||||
method: 'get'
|
||||
});
|
||||
if (res.code === 200) {
|
||||
const list = parsePackageDetailsPayload(res);
|
||||
const children = list.map((child) => ({
|
||||
...child,
|
||||
name: child.name || child.itemName,
|
||||
unit: child.unit || '次',
|
||||
price: child.price ?? child.unitPrice ?? child.itemPrice ?? 0,
|
||||
quantity: row.quantity || 1,
|
||||
isPackageDetail: true
|
||||
}));
|
||||
resolve(children);
|
||||
} else {
|
||||
resolve([]);
|
||||
}
|
||||
const list = parsePackageDetailsPayload(res);
|
||||
const children = list.map((child) => ({
|
||||
...child,
|
||||
name: child.name || child.itemName,
|
||||
unit: child.unit || '次',
|
||||
price: child.price ?? child.unitPrice ?? child.itemPrice ?? 0,
|
||||
quantity: row.quantity || 1,
|
||||
isPackageDetail: true
|
||||
}));
|
||||
resolve(children);
|
||||
} catch (err) {
|
||||
console.error('加载套餐明细失败:', err);
|
||||
resolve([]);
|
||||
@@ -1489,7 +1485,7 @@ async function handleItemSelect(checked, item, cat) {
|
||||
packageName: item.packageName || null,
|
||||
packageDetailsLoading: false,
|
||||
packageId: item.packageId || null,
|
||||
hasChildren: !!(item.packageId) // #426修复: 树形表格懒加载展开标记
|
||||
hasChildren: !!(item.packageId || item.packageName) // #426修复: 树形表格懒加载展开标记,支持 packageName 解析
|
||||
};
|
||||
selectedItems.value.push(newRow);
|
||||
// 必须用数组里的响应式行,不能继续改局部 newRow:push 后列表内是 proxy,改 raw 对象不会触发右侧卡片更新(会一直卡在「加载中」)
|
||||
|
||||
@@ -93,7 +93,6 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" width="160" />
|
||||
<el-table-column prop="prescriptionNo" label="申请单号" width="140" />
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="申请单状态" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getStatusTagType(scope.row.status)" effect="plain" round>
|
||||
@@ -101,6 +100,7 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="操作" width="280" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- 详情 - 所有状态都显示 -->
|
||||
|
||||
@@ -1596,36 +1596,39 @@ function handleSaveGroup(orderGroupList) {
|
||||
patientId: patientInfo.value.patientId,
|
||||
encounterId: patientInfo.value.encounterId,
|
||||
accountId: accountId.value,
|
||||
quantity: item.quantity,
|
||||
methodCode: item.methodCode,
|
||||
rateCode: item.rateCode,
|
||||
dispensePerDuration: item.dispensePerDuration,
|
||||
dose: item.dose,
|
||||
doseQuantity: item.doseQuantity,
|
||||
// 🔧 修复 Bug #403:从 mergedDetail 读取明细字段,而非直接从 item 取
|
||||
// item.dose 等字段可能为 null,mergedDetail 已做 ?? 兜底
|
||||
quantity: mergedDetail.quantity ?? item.quantity,
|
||||
methodCode: mergedDetail.methodCode ?? item.methodCode,
|
||||
rateCode: mergedDetail.rateCode ?? item.rateCode,
|
||||
dispensePerDuration: mergedDetail.dispensePerDuration ?? item.dispensePerDuration,
|
||||
dose: mergedDetail.dose ?? item.dose,
|
||||
doseQuantity: mergedDetail.doseQuantity ?? item.doseQuantity,
|
||||
executeNum: 1,
|
||||
unitCode: item.unitCode,
|
||||
unitCode_dictText: item.unitCodeName || '',
|
||||
unitCode: mergedDetail.unitCode ?? item.unitCode,
|
||||
unitCode_dictText: item.unitCodeName || mergedDetail.unitCodeName || '',
|
||||
statusEnum: 1,
|
||||
orgId: resolveOrgId(item.orderDetailInfos?.orgId || mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || '',
|
||||
// 🔧 修复:同时保存 orgName,确保树匹配不到时仍有中文名称可显示
|
||||
orgName: findOrgName(item.orderDetailInfos?.orgId || mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || item.orderDetailInfos?.orgName || mergedDetail.orgName || patientInfo.value?.inHospitalOrgName || '',
|
||||
orgId: resolveOrgId(mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || '',
|
||||
// 🔧 修复:同时存储 orgName,确保树匹配不到时仍有中文名称可显示
|
||||
orgName: findOrgName(mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || mergedDetail.orgName || patientInfo.value?.inHospitalOrgName || '',
|
||||
dbOpType: prescriptionList.value[rowIndex.value].requestId ? '2' : '1',
|
||||
conditionId: conditionId.value,
|
||||
conditionDefinitionId: conditionDefinitionId.value,
|
||||
encounterDiagnosisId: encounterDiagnosisId.value,
|
||||
therapyEnum: prescriptionList.value[rowIndex.value]?.therapyEnum || '1',
|
||||
therapyEnum: prescriptionList.value[rowIndex.value]?.therapyEnum || mergedDetail.therapyEnum || '1',
|
||||
};
|
||||
|
||||
// 计算价格和总量
|
||||
const unitInfo = unitCodeList.value.find((k) => k.value == item.unitCode);
|
||||
const resolvedUnitCode = mergedDetail.unitCode ?? item.unitCode;
|
||||
const unitInfo = unitCodeList.value.find((k) => k.value == resolvedUnitCode);
|
||||
if (unitInfo && unitInfo.type == 'minUnit') {
|
||||
newRow.price = newRow.minUnitPrice;
|
||||
newRow.totalPrice = (item.quantity * newRow.minUnitPrice).toFixed(6);
|
||||
newRow.minUnitQuantity = item.quantity;
|
||||
newRow.totalPrice = (newRow.quantity * newRow.minUnitPrice).toFixed(6);
|
||||
newRow.minUnitQuantity = newRow.quantity;
|
||||
} else {
|
||||
newRow.price = newRow.unitPrice;
|
||||
newRow.totalPrice = (item.quantity * newRow.unitPrice).toFixed(6);
|
||||
newRow.minUnitQuantity = item.quantity * (item.orderDetailInfos?.partPercent || mergedDetail.partPercent || 1);
|
||||
newRow.totalPrice = (newRow.quantity * newRow.unitPrice).toFixed(6);
|
||||
newRow.minUnitQuantity = newRow.quantity * (mergedDetail.partPercent || 1);
|
||||
}
|
||||
|
||||
newRow.contentJson = JSON.stringify(newRow);
|
||||
|
||||
Reference in New Issue
Block a user