Compare commits
2 Commits
6d87b7c445
...
b4e13e1305
| Author | SHA1 | Date | |
|---|---|---|---|
| b4e13e1305 | |||
| dd1cd17801 |
@@ -238,7 +238,11 @@
|
||||
AND T3.organization_id = #{organizationId}
|
||||
</if>
|
||||
WHERE t1.delete_flag = '0'
|
||||
AND (t1.pricing_flag = 1 OR t1.pricing_flag IS NULL)
|
||||
<!-- 🔧 Bug #215 修复:当 pricingFlag 为 null 时不添加过滤条件,
|
||||
避免门诊划价场景查询诊疗项目 (adviceType=3) 返回空结果 -->
|
||||
<if test="pricingFlag != null">
|
||||
AND (t1.pricing_flag = #{pricingFlag} OR t1.pricing_flag IS NULL)
|
||||
</if>
|
||||
<if test="searchKey != null and searchKey != ''">
|
||||
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||
</if>
|
||||
|
||||
@@ -567,6 +567,9 @@ function selectAdviceBase(key, row) {
|
||||
prescriptionList.value[rowIndex.value].locationId = stock.locationId;
|
||||
prescriptionList.value[rowIndex.value].unitPrice = stock.price;
|
||||
prescriptionList.value[rowIndex.value].positionName = stock.locationName;
|
||||
// 设置默认数量为1,并计算总金额
|
||||
prescriptionList.value[rowIndex.value].quantity = 1;
|
||||
calculateTotalPrice(prescriptionList.value[rowIndex.value], rowIndex.value);
|
||||
}
|
||||
} else {
|
||||
// 诊疗:设置执行科室和价格
|
||||
@@ -576,6 +579,9 @@ function selectAdviceBase(key, row) {
|
||||
} else {
|
||||
prescriptionList.value[rowIndex.value].unitPrice = 0;
|
||||
}
|
||||
// 设置默认执行次数为1,并计算总金额
|
||||
prescriptionList.value[rowIndex.value].quantity = 1;
|
||||
calculateTotalPrice(prescriptionList.value[rowIndex.value], rowIndex.value);
|
||||
}
|
||||
|
||||
expandOrder.value = [key];
|
||||
@@ -804,6 +810,37 @@ function handleSingOut() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 计算总价
|
||||
function calculateTotalPrice(row, index) {
|
||||
nextTick(() => {
|
||||
// 对于诊疗(adviceType=3)和耗材(adviceType=2),使用unitPrice * quantity计算总价
|
||||
if (row.adviceType == 3 || row.adviceType == 2) {
|
||||
// 检查价格是否为有效数字
|
||||
if (row.unitPrice !== undefined && row.unitPrice !== null && !isNaN(row.unitPrice) && isFinite(row.unitPrice)) {
|
||||
row.totalPrice = (row.unitPrice * row.quantity).toFixed(2);
|
||||
} else {
|
||||
row.totalPrice = '0.00';
|
||||
}
|
||||
} else {
|
||||
// 其他类型(如药品)
|
||||
if (row.unitCode == row.minUnitCode) {
|
||||
if (row.minUnitPrice !== undefined && row.minUnitPrice !== null && !isNaN(row.minUnitPrice) && isFinite(row.minUnitPrice)) {
|
||||
row.totalPrice = (row.minUnitPrice * row.quantity).toFixed(2);
|
||||
} else {
|
||||
row.totalPrice = '0.00';
|
||||
}
|
||||
} else {
|
||||
if (row.unitPrice !== undefined && row.unitPrice !== null && !isNaN(row.unitPrice) && isFinite(row.unitPrice)) {
|
||||
row.totalPrice = (row.unitPrice * row.quantity).toFixed(2);
|
||||
} else {
|
||||
row.totalPrice = '0.00';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
defineExpose({ getListInfo });
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user