-
所有药品总价和: {{ totalPriceSum }} 元
+
+
+ 应收金额:{{ form.isInsured === 0 ? patientPay : ceilPrice(totalPriceSum) }} 元
+
+
+ 处方总金额:{{ ceilPrice(totalPriceSum) }} 元
+
+
+ 预计报销:{{ Number(currentReimbursement).toFixed(2) }} 元
+
@@ -321,6 +335,16 @@
//
const { proxy } = getCurrentInstance()
+// 价格向上取整到小数点后两位(进一法)
+// 先缩放到整数避免浮点精度问题
+function ceilPrice(value) {
+ const num = Number(value)
+ if (isNaN(num)) return '0.00'
+ const scaled = Math.round(num * 10000)
+ const cents = Math.ceil(scaled / 100)
+ return (cents / 100).toFixed(2)
+}
+
// 患者类型
const { healthcare_os_patient_type } = proxy.useDict('healthcare_os_patient_type')
// os_patient_type
@@ -348,6 +372,8 @@ const form = ref({})
const checkId = ref(0)
const totalPriceSum = ref(0) //所有药品总价和
+const currentReimbursement = ref(0)
+const patientPay = ref(0)
//
const props = defineProps({
@@ -593,7 +619,7 @@ const props = defineProps({
{
id: 5,
name: 'el-row',
- description: '6 是否医保 医保率 ',
+ description: '6 是否医保 报销比率 ',
display: true,
colList: [
{
@@ -614,12 +640,12 @@ const props = defineProps({
{
id: 1,
name: 'el-col',
- description: '6 医保率 col',
+ description: '6 报销比率 col',
display: true,
data: [
{
id: 0,
- name: '医保率',
+ name: '报销比率',
display: true,
prohibit: false
}
@@ -844,11 +870,24 @@ watch(
// title.value = '患者诊断信息'
// console.log('获取数据111111111111:', form.value)
// 更新总价和
- totalPriceSum.value = form.value.prescriptionDetailsList
+ totalPriceSum.value = ceilPrice(form.value.prescriptionDetailsList
.reduce((sum, prescription) => {
return sum + prescription.reduce((innerSum, drug) => innerSum + parseFloat(drug.totalPrice || 0), 0)
- }, 0)
- .toFixed(2)
+ }, 0))
+ const insured = form.value?.isInsured
+ const sumNum = Number(totalPriceSum.value || 0)
+ if (insured === 0) {
+ const rate = Number(form.value?.value || 0) / 100
+ const r = isNaN(rate) ? 0 : rate
+ // 先计算个人应付(向上取整)
+ const pay = ceilPrice(sumNum * (1 - r))
+ patientPay.value = pay
+ // 预计报销 = 总价 - 个人应付
+ currentReimbursement.value = (sumNum - Number(pay)).toFixed(2)
+ } else {
+ currentReimbursement.value = '0.00'
+ patientPay.value = ceilPrice(sumNum)
+ }
})
}
)
diff --git a/src/components/Healthcare/OutpatientService/DiagnosisInformation/use.ts b/src/components/Healthcare/OutpatientService/DiagnosisInformation/use.ts
index cfd21e4..cbe2624 100644
--- a/src/components/Healthcare/OutpatientService/DiagnosisInformation/use.ts
+++ b/src/components/Healthcare/OutpatientService/DiagnosisInformation/use.ts
@@ -238,7 +238,7 @@ export default function () {
{
id: 5,
name: "el-row",
- description: "6 是否医保 医保率 ",
+ description: "6 是否医保 报销比率 ",
display: true,
colList: [
{
@@ -259,12 +259,12 @@ export default function () {
{
id: 1,
name: "el-col",
- description: "6 医保率 col",
+ description: "6 报销比率 col",
display: true,
data: [
{
id: 0,
- name: "医保率",
+ name: "报销比率",
display: true,
prohibit: true,
},
@@ -679,7 +679,7 @@ export default function () {
{
id: 5,
name: "el-row",
- description: "6 是否医保 医保率 ",
+ description: "6 是否医保 报销比率 ",
display: true,
colList: [
{
@@ -700,12 +700,12 @@ export default function () {
{
id: 1,
name: "el-col",
- description: "6 医保率 col",
+ description: "6 报销比率 col",
display: true,
data: [
{
id: 0,
- name: "医保率",
+ name: "报销比率",
display: true,
prohibit: false,
},
diff --git a/src/components/Healthcare/OutpatientService/PatientDossier/index.vue b/src/components/Healthcare/OutpatientService/PatientDossier/index.vue
index e5abcaf..38a11a6 100644
--- a/src/components/Healthcare/OutpatientService/PatientDossier/index.vue
+++ b/src/components/Healthcare/OutpatientService/PatientDossier/index.vue
@@ -183,6 +183,7 @@ function selectValue(row) {
if (row != null) {
console.log('获取患者信息', row)
const data = {
+ id: row.id,
patientType: row.patientType,
studentId: row.studentId,
name: row.name,
diff --git a/src/components/Healthcare/OutpatientService/PrescriptionList/index.vue b/src/components/Healthcare/OutpatientService/PrescriptionList/index.vue
index 68e0ba6..d60d311 100644
--- a/src/components/Healthcare/OutpatientService/PrescriptionList/index.vue
+++ b/src/components/Healthcare/OutpatientService/PrescriptionList/index.vue
@@ -274,7 +274,7 @@
},
]">
- {{ prescription[scope.$index].unitPrice.toFixed(2) }}
+ {{ Number(prescription[scope.$index].unitPrice || 0).toFixed(2) }}
@@ -289,7 +289,13 @@
trigger: controlData[9].check[0].trigger,
},
]">
- {{ prescription[scope.$index].totalPrice.toFixed(2) }}元
+ {{
+ Number(isInsured) === 0
+ ? ceilPrice(
+ (parseFloat(prescription[scope.$index].totalPrice || 0) * (1 - (parseFloat(reimbursementRate || 0) / 100)))
+ )
+ : ceilPrice(prescription[scope.$index].totalPrice || 0)
+ }}元
@@ -339,6 +345,16 @@ import { listCommonUsage, listEatingTime, listFrequency } from '@/api/healthcare
const { proxy } = getCurrentInstance()
+// 价格向上取整到小数点后两位(进一法)
+// 先缩放到整数避免浮点精度问题
+function ceilPrice(value) {
+ const num = Number(value)
+ if (isNaN(num)) return '0.00'
+ const scaled = Math.round(num * 10000)
+ const cents = Math.ceil(scaled / 100)
+ return (cents / 100).toFixed(2)
+}
+
const { os_patient_type } = proxy.useDict('os_patient_type')
// os_patient_type
const { os_diagnosis_type } = proxy.useDict('os_diagnosis_type')
@@ -390,6 +406,14 @@ const props = defineProps({
prescriptionData: {
type: Array
},
+ isInsured: {
+ type: [Number, String],
+ default: 1
+ },
+ reimbursementRate: {
+ type: [Number, String],
+ default: 0
+ },
// 控制 纽约 的 显示 隐藏
controlButton: {
type: Array,
@@ -891,11 +915,10 @@ function calculationTotal(index) {
}
console.log('totalPrice11111:', form.value.prescription)
// 更新总价和
- totalPriceSum.value = form.value.prescription
+ totalPriceSum.value = ceilPrice(form.value.prescription
.reduce((sum, prescri) => {
return sum + prescri.reduce((innerSum, drug) => innerSum + parseFloat(drug.totalPrice || 0), 0)
- }, 0)
- .toFixed(2)
+ }, 0))
}
// 药品 档案 弹框
diff --git a/src/components/ReportAnalytics/CircularDiagram.vue b/src/components/ReportAnalytics/CircularDiagram.vue
index f4d7d0e..c4e174e 100644
--- a/src/components/ReportAnalytics/CircularDiagram.vue
+++ b/src/components/ReportAnalytics/CircularDiagram.vue
@@ -4,7 +4,7 @@
+
+
diff --git a/src/views/fire/report/index.vue b/src/views/fire/report/index.vue
index cb615f7..57e1244 100644
--- a/src/views/fire/report/index.vue
+++ b/src/views/fire/report/index.vue
@@ -76,7 +76,7 @@
-
+
-
+