出丸 计算公式修改

This commit is contained in:
2026-05-08 16:51:25 +08:00
parent f81a3b5d94
commit ee1b140902
3 changed files with 24 additions and 6 deletions
@@ -2138,6 +2138,22 @@ const rxOutPelletText = computed(() => {
function computeOutPellet(v: any): string {
if (!v) return ''
if ((v.prescription_type || '浓缩水丸') === '浓缩水丸') {
const days = Number(v.medication_days ?? v.usage_days ?? v.dose_count)
const times = Number(v.times_per_day)
const doseG = Number(v.dosage_amount)
const bags = Number(v.dosage_bag_count) > 0 ? Number(v.dosage_bag_count) : 1
if (
Number.isFinite(days) &&
Number.isFinite(times) &&
Number.isFinite(doseG) &&
days > 0 &&
times > 0 &&
doseG > 0
) {
return formatNum(days * times * doseG * bags)
}
}
const explicit = v.out_pellet || v.total_weight
if (explicit && Number(explicit) > 0) return formatNum(Number(explicit))
const list = slipHerbsList.value
@@ -4701,13 +4701,14 @@ const slipPerBagDosageText = computed(() => {
const slipPillGrams = computed(() => {
const d = prescriptionViewData.value
if (!d || (d.prescription_type || '浓缩水丸') !== '浓缩水丸') return null
/** 用药疗程以业务订单 medication_days 为准,缺省时回退处方 usage_days / 剂数 */
/** 用药疗程以业务订单 medication_days 为准,缺省时回退处方 usage_days / 剂数;出丸 = 每袋用量×袋数×每天次数×服用天数 */
const days = Number(d.medication_days ?? d.usage_days ?? d.dose_count)
const times = Number(d.times_per_day)
const doseG = Number(d.dosage_amount)
const bags = Number(d.dosage_bag_count) > 0 ? Number(d.dosage_bag_count) : 1
if (!Number.isFinite(days) || !Number.isFinite(times) || !Number.isFinite(doseG)) return null
if (days <= 0 || times <= 0 || doseG <= 0) return null
return days * times * doseG
return days * times * doseG * bags
})
/* ============================================================
@@ -4818,7 +4819,7 @@ const rxUsageText = computed(() => {
return seg.join(', ')
})
/** 出丸:优先用 slipPillGrams按医嘱天数·次数·每包克数),否则按药材总量×剂数 */
/** 出丸:优先用 slipPillGrams每袋用量×袋数×每天次数×服用天数),否则按药材总量×剂数 */
const rxOutPelletGrams = computed(() => {
const pill = slipPillGrams.value
if (typeof pill === 'number' && isFinite(pill) && pill > 0) return formatNum(pill)
@@ -4653,13 +4653,14 @@ const slipPerBagDosageText = computed(() => {
const slipPillGrams = computed(() => {
const d = prescriptionViewData.value
if (!d || (d.prescription_type || '浓缩水丸') !== '浓缩水丸') return null
/** 用药疗程以业务订单 medication_days 为准,缺省时回退处方 usage_days / 剂数 */
/** 用药疗程以业务订单 medication_days 为准,缺省时回退处方 usage_days / 剂数;出丸 = 每袋用量×袋数×每天次数×服用天数 */
const days = Number(d.medication_days ?? d.usage_days ?? d.dose_count)
const times = Number(d.times_per_day)
const doseG = Number(d.dosage_amount)
const bags = Number(d.dosage_bag_count) > 0 ? Number(d.dosage_bag_count) : 1
if (!Number.isFinite(days) || !Number.isFinite(times) || !Number.isFinite(doseG)) return null
if (days <= 0 || times <= 0 || doseG <= 0) return null
return days * times * doseG
return days * times * doseG * bags
})
/* ============================================================
@@ -4770,7 +4771,7 @@ const rxUsageText = computed(() => {
return seg.join(', ')
})
/** 出丸:优先用 slipPillGrams按医嘱天数·次数·每包克数),否则按药材总量×剂数 */
/** 出丸:优先用 slipPillGrams每袋用量×袋数×每天次数×服用天数),否则按药材总量×剂数 */
const rxOutPelletGrams = computed(() => {
const pill = slipPillGrams.value
if (typeof pill === 'number' && isFinite(pill) && pill > 0) return formatNum(pill)