|
@@ -20,17 +20,6 @@
|
|
|
<span><b>性别:</b> {{ getDictLabel(DICT_TYPE.SYSTEM_USER_SEX, dataForm.elderSex) }}</span>
|
|
<span><b>性别:</b> {{ getDictLabel(DICT_TYPE.SYSTEM_USER_SEX, dataForm.elderSex) }}</span>
|
|
|
<span><b>经手人:</b> {{ dataForm.createdBy }}</span>
|
|
<span><b>经手人:</b> {{ dataForm.createdBy }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- <div class="info-wrap">-->
|
|
|
|
|
- <!-- <span><b>账单月:</b> {{ dataForm.billingMonth }}</span>-->
|
|
|
|
|
- <!-- <span><b>账单总额:</b> {{ billTotalPrice }}元</span> -->
|
|
|
|
|
- <!-- <span><b>长护险:</b> {{ formatNum(longTermAmount) }}元</span> -->
|
|
|
|
|
- <!-- <span><b>应缴:</b> {{ formatNum(unPayTotal) }}元</span>-->
|
|
|
|
|
- <!-- <span><b>发票号:</b> {{ dataForm.invoiceNumber }}</span>-->
|
|
|
|
|
- <!-- </div>-->
|
|
|
|
|
- <!-- <div class="info-wrap">-->
|
|
|
|
|
- <!-- <span><b>已缴费用:</b> {{ formatNum(payTotal) }}元</span> -->
|
|
|
|
|
- <!-- <span><b>打印时间:</b> {{ dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss') }}</span>-->
|
|
|
|
|
- <!-- </div>-->
|
|
|
|
|
</div>
|
|
</div>
|
|
|
<el-divider style="margin-top: 0px" />
|
|
<el-divider style="margin-top: 0px" />
|
|
|
<div class="content">
|
|
<div class="content">
|
|
@@ -47,28 +36,20 @@
|
|
|
<td>序号</td>
|
|
<td>序号</td>
|
|
|
<td>费用分类</td>
|
|
<td>费用分类</td>
|
|
|
<td>费用名称</td>
|
|
<td>费用名称</td>
|
|
|
- <!-- <td>单价(元/月)</td>
|
|
|
|
|
- <td>数量</td> -->
|
|
|
|
|
<td>金额(元)</td>
|
|
<td>金额(元)</td>
|
|
|
<td>缴费状态</td>
|
|
<td>缴费状态</td>
|
|
|
<td>已缴金额(元)</td>
|
|
<td>已缴金额(元)</td>
|
|
|
<td>费用发生时间</td>
|
|
<td>费用发生时间</td>
|
|
|
- <!-- <td>缴费时间</td>-->
|
|
|
|
|
- <!-- <td>缴费状态</td>-->
|
|
|
|
|
<td>备注</td>
|
|
<td>备注</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr v-for="(item, index) in dataForm.items" :key="index" align="center">
|
|
<tr v-for="(item, index) in dataForm.items" :key="index" align="center">
|
|
|
<td>{{ index + 1 }}</td>
|
|
<td>{{ index + 1 }}</td>
|
|
|
<td>{{ item.itemCategoryName }}</td>
|
|
<td>{{ item.itemCategoryName }}</td>
|
|
|
<td>{{ item.itemName }}</td>
|
|
<td>{{ item.itemName }}</td>
|
|
|
- <!-- <td>{{ calcActualPrice(item) }}</td>
|
|
|
|
|
- <td>{{ item.count }}</td> -->
|
|
|
|
|
<td>{{ calcTotalPrice(item) }}</td>
|
|
<td>{{ calcTotalPrice(item) }}</td>
|
|
|
<td>{{ getDictLabel(DICT_TYPE.PAY_TYPE, item.payStatus) }}</td>
|
|
<td>{{ getDictLabel(DICT_TYPE.PAY_TYPE, item.payStatus) }}</td>
|
|
|
<td>{{ item.payAmount ?? 0 }}元</td>
|
|
<td>{{ item.payAmount ?? 0 }}元</td>
|
|
|
<td>{{ formatStartDate(item) }}</td>
|
|
<td>{{ formatStartDate(item) }}</td>
|
|
|
- <!-- <td>{{ formatTime(item.payTime, 'yyyy-MM-dd HH:mm:ss') }}</td>-->
|
|
|
|
|
- <!-- <td>{{ getDictLabel(DICT_TYPE.PAY_TYPE, item.payStatus) }}</td>-->
|
|
|
|
|
<td>{{ item.description }}</td>
|
|
<td>{{ item.description }}</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr align="center">
|
|
<tr align="center">
|
|
@@ -76,8 +57,6 @@
|
|
|
<td :colspan="8">
|
|
<td :colspan="8">
|
|
|
金额:{{ billTotalPrice }}元;已缴费 {{ formatNum(payTotal) }} 元;剩余未缴费 {{ formatNum(unPayTotal) }} 元
|
|
金额:{{ billTotalPrice }}元;已缴费 {{ formatNum(payTotal) }} 元;剩余未缴费 {{ formatNum(unPayTotal) }} 元
|
|
|
</td>
|
|
</td>
|
|
|
- <!-- <td>合计未缴总额</td>
|
|
|
|
|
- <td :colspan="8">{{ formatNum(unPayTotal) }}元</td> -->
|
|
|
|
|
</tr>
|
|
</tr>
|
|
|
</table>
|
|
</table>
|
|
|
</div>
|
|
</div>
|
|
@@ -90,10 +69,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { getExpenseOrderDetail } from '@/api/elderly/fee/bill-pay'
|
|
import { getExpenseOrderDetail } from '@/api/elderly/fee/bill-pay'
|
|
|
-import dayjs from 'dayjs'
|
|
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
import { formatNum, formatCeil, formatRound } from '@/utils/formatter'
|
|
import { formatNum, formatCeil, formatRound } from '@/utils/formatter'
|
|
|
-import { formatTime } from '@/utils'
|
|
|
|
|
import { DICT_TYPE, getDictLabel } from '@/utils/dict'
|
|
import { DICT_TYPE, getDictLabel } from '@/utils/dict'
|
|
|
import { useSettingStore } from '@/store/modules/setting'
|
|
import { useSettingStore } from '@/store/modules/setting'
|
|
|
defineOptions({ name: 'BillPayPreview' })
|
|
defineOptions({ name: 'BillPayPreview' })
|
|
@@ -135,6 +112,36 @@ const fixed2Num = computed(() => {
|
|
|
|
|
|
|
|
const tempResValue = ref({})
|
|
const tempResValue = ref({})
|
|
|
|
|
|
|
|
|
|
+const getItemPreviewAmount = (item) => {
|
|
|
|
|
+ if (item.expenseSource == 'consumer_voucher') {
|
|
|
|
|
+ const ruleValue = settingStore.getCouponRuleValue
|
|
|
|
|
+ if (ruleValue == 2 || ruleValue == '2') {
|
|
|
|
|
+ return Number(formatRound(item.totalAmount))
|
|
|
|
|
+ }
|
|
|
|
|
+ return Number(formatNum(item.totalAmount))
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (dataForm.value.type == '1' && item.isMonthlyExpense == 1) {
|
|
|
|
|
+ if (settingStore.getAdmissionBill == 2) {
|
|
|
|
|
+ return Number(formatCeil(item.totalAmount))
|
|
|
|
|
+ } else if (settingStore.getAdmissionBill == 3) {
|
|
|
|
|
+ return Number(item.roundTwoDecimalAmount)
|
|
|
|
|
+ } else if (settingStore.getAdmissionBill == 4) {
|
|
|
|
|
+ return Number(item.roundAmount)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Number(formatNum(item.totalAmount))
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (item.expenseSource == 'long_term_care_insurance') {
|
|
|
|
|
+ return Number(formatNum(item.totalAmount))
|
|
|
|
|
+ } else if (rounding.value) {
|
|
|
|
|
+ return Number(item.roundAmount)
|
|
|
|
|
+ } else if (fixed2Num.value) {
|
|
|
|
|
+ return Number(item.roundTwoDecimalAmount)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Number(formatNum(item.totalAmount))
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/** 打开弹窗 */
|
|
/** 打开弹窗 */
|
|
|
const open = async (id) => {
|
|
const open = async (id) => {
|
|
|
dialogVisible.value = true
|
|
dialogVisible.value = true
|
|
@@ -174,63 +181,21 @@ const open = async (id) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (hasPartialPay) {
|
|
if (hasPartialPay) {
|
|
|
- total.value += item.roundAmount
|
|
|
|
|
- totalDecimal.value += item.roundTwoDecimalAmount
|
|
|
|
|
|
|
+ total.value +=
|
|
|
|
|
+ item.expenseSource == 'consumer_voucher'
|
|
|
|
|
+ ? getItemPreviewAmount(item)
|
|
|
|
|
+ : item.roundAmount
|
|
|
|
|
+ totalDecimal.value +=
|
|
|
|
|
+ item.expenseSource == 'consumer_voucher'
|
|
|
|
|
+ ? getItemPreviewAmount(item)
|
|
|
|
|
+ : item.roundTwoDecimalAmount
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (item.payStatus == 0) {
|
|
if (item.payStatus == 0) {
|
|
|
- // 入院账单且isMonthlyExpense=1且入院向上取整
|
|
|
|
|
- if (dataForm.value.type == '1' && item.isMonthlyExpense == 1) {
|
|
|
|
|
- if (settingStore.getAdmissionBill == 2) {
|
|
|
|
|
- // 向上取整
|
|
|
|
|
- unPayTotal.value += Number(formatCeil(item.totalAmount))
|
|
|
|
|
- } else if (settingStore.getAdmissionBill == 3) {
|
|
|
|
|
- // 四舍五入保留两位
|
|
|
|
|
- unPayTotal.value += Number(item.roundTwoDecimalAmount)
|
|
|
|
|
- } else if (settingStore.getAdmissionBill == 4) {
|
|
|
|
|
- // 四舍五入保留整数
|
|
|
|
|
- unPayTotal.value += Number(item.roundAmount)
|
|
|
|
|
- } else {
|
|
|
|
|
- // 应收
|
|
|
|
|
- unPayTotal.value += Number(formatNum(item.totalAmount))
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- if (rounding.value) {
|
|
|
|
|
- // 取整
|
|
|
|
|
- unPayTotal.value += item.roundAmount
|
|
|
|
|
- } else if (fixed2Num.value) {
|
|
|
|
|
- unPayTotal.value += item.roundTwoDecimalAmount
|
|
|
|
|
- } else {
|
|
|
|
|
- unPayTotal.value += Number(formatNum(item.totalAmount))
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ unPayTotal.value += getItemPreviewAmount(item)
|
|
|
} else if (item.payStatus == 1) {
|
|
} else if (item.payStatus == 1) {
|
|
|
- // 判断入院账单且isMonthlyExpense=1且是否有做其他设置
|
|
|
|
|
- if (dataForm.value.type == '1' && item.isMonthlyExpense == 1) {
|
|
|
|
|
- if (settingStore.getAdmissionBill == 2) {
|
|
|
|
|
- // 向上取整
|
|
|
|
|
- payTotal.value += Number(formatCeil(item.totalAmount))
|
|
|
|
|
- } else if (settingStore.getAdmissionBill == 3) {
|
|
|
|
|
- // 四舍五入保留两位
|
|
|
|
|
- payTotal.value += Number(item.roundTwoDecimalAmount)
|
|
|
|
|
- } else if (settingStore.getAdmissionBill == 4) {
|
|
|
|
|
- // 四舍五入取整
|
|
|
|
|
- payTotal.value += Number(item.roundAmount)
|
|
|
|
|
- } else {
|
|
|
|
|
- // 应收
|
|
|
|
|
- payTotal.value += Number(formatNum(item.totalAmount))
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- if (rounding.value) {
|
|
|
|
|
- // 取整
|
|
|
|
|
- payTotal.value += item.roundAmount
|
|
|
|
|
- } else if (fixed2Num.value) {
|
|
|
|
|
- payTotal.value += item.roundTwoDecimalAmount
|
|
|
|
|
- } else {
|
|
|
|
|
- payTotal.value += Number(formatNum(item.totalAmount))
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ payTotal.value += getItemPreviewAmount(item)
|
|
|
} else if (item.payStatus == 2) {
|
|
} else if (item.payStatus == 2) {
|
|
|
hasPartialPay = true
|
|
hasPartialPay = true
|
|
|
try {
|
|
try {
|
|
@@ -238,8 +203,14 @@ const open = async (id) => {
|
|
|
unPayTotal.value = (tempResValue.value.actualAmount - tempResValue.value.payableAmount) || 0
|
|
unPayTotal.value = (tempResValue.value.actualAmount - tempResValue.value.payableAmount) || 0
|
|
|
} catch (e) {}
|
|
} catch (e) {}
|
|
|
}
|
|
}
|
|
|
- total.value += item.roundAmount
|
|
|
|
|
- totalDecimal.value += item.roundTwoDecimalAmount
|
|
|
|
|
|
|
+ total.value +=
|
|
|
|
|
+ item.expenseSource == 'consumer_voucher'
|
|
|
|
|
+ ? getItemPreviewAmount(item)
|
|
|
|
|
+ : item.roundAmount
|
|
|
|
|
+ totalDecimal.value +=
|
|
|
|
|
+ item.expenseSource == 'consumer_voucher'
|
|
|
|
|
+ ? getItemPreviewAmount(item)
|
|
|
|
|
+ : item.roundTwoDecimalAmount
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 有长护险
|
|
// 有长护险
|
|
@@ -289,20 +260,6 @@ const tTitle = computed(() => {
|
|
|
return ''
|
|
return ''
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const getLastDayOfMonth = (monthStr) => {
|
|
|
|
|
- // 将输入的字符串分割为年和月
|
|
|
|
|
- const [year, month] = monthStr.split('-').map(Number)
|
|
|
|
|
-
|
|
|
|
|
- // 创建下个月的第一天(月份从0开始计数,所以+1)
|
|
|
|
|
- const nextMonthFirstDay = new Date(year, month, 1)
|
|
|
|
|
-
|
|
|
|
|
- // 减去一天,得到当前月的最后一天
|
|
|
|
|
- const lastDay = new Date(nextMonthFirstDay - 24 * 60 * 60 * 1000)
|
|
|
|
|
-
|
|
|
|
|
- // 格式化返回结果为 'YYYY-MM-DD' 格式
|
|
|
|
|
- return lastDay.toISOString().split('T')[0]
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const bTitle = computed(() => {
|
|
const bTitle = computed(() => {
|
|
|
const arr = dataForm.value.billingMonth ? dataForm.value.billingMonth.split('-') : ''
|
|
const arr = dataForm.value.billingMonth ? dataForm.value.billingMonth.split('-') : ''
|
|
|
if (arr.length) {
|
|
if (arr.length) {
|
|
@@ -313,53 +270,24 @@ const bTitle = computed(() => {
|
|
|
return ''
|
|
return ''
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-// 单价(元/月)
|
|
|
|
|
-const calcActualPrice = (item) => {
|
|
|
|
|
- if (
|
|
|
|
|
- dataForm.value.type == '1' &&
|
|
|
|
|
- item.isMonthlyExpense == 1 &&
|
|
|
|
|
- settingStore.getAdmissionBillRoundUp
|
|
|
|
|
- ) {
|
|
|
|
|
- return formatCeil(item.actualAmount)
|
|
|
|
|
- } else {
|
|
|
|
|
- return formatNum(item.actualPrice)
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// 入院账单费用计算
|
|
// 入院账单费用计算
|
|
|
const caclAdminssionTotalPrice = computed(() => {
|
|
const caclAdminssionTotalPrice = computed(() => {
|
|
|
let num = 0
|
|
let num = 0
|
|
|
dataForm.value.items.map((item) => {
|
|
dataForm.value.items.map((item) => {
|
|
|
- if (item.isMonthlyExpense == 1) {
|
|
|
|
|
- if (settingStore.getAdmissionBill == 2) {
|
|
|
|
|
- // 向上取整
|
|
|
|
|
- num += Number(formatCeil(item.totalAmount))
|
|
|
|
|
- } else if (settingStore.getAdmissionBill == 3) {
|
|
|
|
|
- // 四舍五入保留两位
|
|
|
|
|
- num += Number(formatNum(item.roundTwoDecimalAmount))
|
|
|
|
|
- } else if (settingStore.getAdmissionBill == 4) {
|
|
|
|
|
- // 四舍五入去哼
|
|
|
|
|
- num += Number(formatNum(item.roundAmount))
|
|
|
|
|
- } else {
|
|
|
|
|
- // 应收
|
|
|
|
|
- num += Number(formatNum(item.totalAmount))
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- if (rounding.value) {
|
|
|
|
|
- num += Number(formatNum(item.roundAmount))
|
|
|
|
|
- } else if (fixed2Num.value) {
|
|
|
|
|
- num += Number(formatNum(item.roundTwoDecimalAmount))
|
|
|
|
|
- } else {
|
|
|
|
|
- num += Number(formatNum(item.totalAmount))
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ num += getItemPreviewAmount(item)
|
|
|
})
|
|
})
|
|
|
return num + longTermAmount.value
|
|
return num + longTermAmount.value
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 总额
|
|
// 总额
|
|
|
const calcTotalPrice = (item) => {
|
|
const calcTotalPrice = (item) => {
|
|
|
- if (dataForm.value.type == '1' && item.isMonthlyExpense == 1) {
|
|
|
|
|
|
|
+ if (item.expenseSource == 'consumer_voucher') {
|
|
|
|
|
+ const ruleValue = settingStore.getCouponRuleValue
|
|
|
|
|
+ if (ruleValue == 2 || ruleValue == '2') {
|
|
|
|
|
+ return formatRound(item.totalAmount)
|
|
|
|
|
+ }
|
|
|
|
|
+ return formatNum(item.totalAmount)
|
|
|
|
|
+ } else if (dataForm.value.type == '1' && item.isMonthlyExpense == 1) {
|
|
|
if (settingStore.getAdmissionBill == 2) {
|
|
if (settingStore.getAdmissionBill == 2) {
|
|
|
// 向上取整
|
|
// 向上取整
|
|
|
return formatCeil(item.totalAmount)
|
|
return formatCeil(item.totalAmount)
|
|
@@ -403,17 +331,7 @@ const formatStartDate = (item) => {
|
|
|
if (item.itemName == '长护险护理补贴费用' || item.expenseSource == 'long_term_care_insurance') {
|
|
if (item.itemName == '长护险护理补贴费用' || item.expenseSource == 'long_term_care_insurance') {
|
|
|
// 长护险
|
|
// 长护险
|
|
|
return item.createdTime
|
|
return item.createdTime
|
|
|
- // let dataStr = item.startDate??"--"
|
|
|
|
|
- // if(dataStr.length>=10){
|
|
|
|
|
- // dataStr = dataStr.substring(0,7)
|
|
|
|
|
- // }
|
|
|
|
|
- // return dataStr
|
|
|
|
|
} else if (item.expenseSource == 'expense_item') {
|
|
} else if (item.expenseSource == 'expense_item') {
|
|
|
- // if(dataForm.value.description){
|
|
|
|
|
- // return dataForm.value.description
|
|
|
|
|
- // }else{
|
|
|
|
|
- // return bTitle
|
|
|
|
|
- // }
|
|
|
|
|
if (item.description && item.description.includes('的')) {
|
|
if (item.description && item.description.includes('的')) {
|
|
|
return item.description.split('的')[0]
|
|
return item.description.split('的')[0]
|
|
|
} else if (item.startDate != null && item.endDate != null) {
|
|
} else if (item.startDate != null && item.endDate != null) {
|
|
@@ -432,17 +350,6 @@ const formatStartDate = (item) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const formatStr = (dateStr) => {
|
|
|
|
|
- if (dateStr) {
|
|
|
|
|
- // 2. 按 "-" 拆分字符串,得到 [年, 月, 日] 数组
|
|
|
|
|
- const [year, month, day] = dateStr.split('-')
|
|
|
|
|
-
|
|
|
|
|
- // 3. 按目标格式拼接
|
|
|
|
|
- return `${year}年${month}月${day}日`
|
|
|
|
|
- }
|
|
|
|
|
- return ''
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// 打印
|
|
// 打印
|
|
|
const printTab = {
|
|
const printTab = {
|
|
|
id: 'printTab1',
|
|
id: 'printTab1',
|