UnPaidList.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <window-size>
  3. <van-empty :image="empty" description="您没有待缴费记录" v-if="showEmpty"></van-empty>
  4. <div v-for="item in unpaidFees" :key="item.hisOrdNum">
  5. <van-cell
  6. :title="makeTitle(item)"
  7. :label="item.priceTime"
  8. is-link
  9. center
  10. @click="onClickFeeItem(item)">
  11. <template #default>
  12. <span style="color: orangered">{{ makeMoney(item.totalAmt) }}</span>
  13. </template>
  14. </van-cell>
  15. <div style="height: 5px"></div>
  16. </div>
  17. </window-size>
  18. </template>
  19. <script setup>
  20. import {getFundPayAmt, getUnPaidFee} from '../../../api/pay-mz-fee'
  21. import empty from '../../../assets/empty.png'
  22. import { useRouter } from 'vue-router'
  23. import { computed, onMounted, ref } from 'vue'
  24. const router = useRouter()
  25. const patientId = router.currentRoute.value.params.patientId
  26. const unpaidFees = ref([])
  27. const showEmpty = computed(() => {
  28. return unpaidFees.value.length === 0
  29. })
  30. const onClickFeeItem = (item) => {
  31. getFundPayAmt(item.hisOrdNum).then(res => {
  32. const routeParams = {
  33. patientId: patientId,
  34. hisOrdNum: item.hisOrdNum,
  35. patientName: item.patName,
  36. deptName: item.deptName,
  37. doctorCode: item.doctorCode,
  38. doctorName: item.doctorName,
  39. totalAmt: item.totalAmt,
  40. fundPay: res.fundPaySumamt,
  41. acctPay: res.acctPay,
  42. selfAmt: item.totalAmt - res.fundPaySumamt - res.acctPay
  43. }
  44. if (res.mdtrtId && !res.setlId) {
  45. routeParams.mdtrtId = res.mdtrtId;
  46. toMedinsSettle(routeParams);
  47. } else {
  48. toDetail(routeParams);
  49. }
  50. })
  51. }
  52. const toMedinsSettle = (params) => {
  53. router.push({
  54. name: 'medinsSettle',
  55. params,
  56. })
  57. }
  58. const toDetail = (params) => {
  59. router.push({
  60. name: 'unPaidDetail',
  61. params,
  62. })
  63. }
  64. function makeTitle(item) {
  65. return item.deptName + ' | ' + item.doctorName
  66. }
  67. function makeMoney(money) {
  68. const m = money / 100
  69. return '¥' + m.toFixed(2)
  70. }
  71. onMounted(() => {
  72. getUnPaidFee(patientId).then((res) => {
  73. unpaidFees.value = res
  74. })
  75. })
  76. </script>