HospitalApproveApply.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div class="layout_display_flex_y">
  3. <div>
  4. <el-input v-model="inputContent" style="width: 230px" prefix-icon="Search" clearable
  5. placeholder="输入院内码/名称进行检索"></el-input>
  6. <el-divider direction="vertical"></el-divider>
  7. <el-button type="primary" icon="Switch" @click="switchSource">切换数据</el-button>
  8. </div>
  9. <el-divider class="el-divider_shorter"></el-divider>
  10. <div class="layout_flex_1-y">
  11. <el-table :data="filterFeeList.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
  12. height="100%"
  13. highlight-current-row>
  14. <el-table-column prop="detailSn" label="流水号" width="80"></el-table-column>
  15. <el-table-column prop="chargeCodeMx" label="院内码" width="100"></el-table-column>
  16. <el-table-column prop="chargeAmount" label="数量" sortable width="80"></el-table-column>
  17. <el-table-column prop="chargeFee" label="金额" width="80"></el-table-column>
  18. <el-table-column prop="chargeDate" label="收费日期"></el-table-column>
  19. <el-table-column prop="chargeName" label="项目名称"></el-table-column>
  20. <el-table-column label="状态">
  21. <template #default="scope">
  22. <span v-html="makeApplyStatusText(scope.row.applyStatus)"></span>
  23. </template>
  24. </el-table-column>
  25. <el-table-column v-if="!fromOriginCharge" prop="handlerName" label="处理人"></el-table-column>
  26. <el-table-column v-if="!fromOriginCharge" prop="handleRemark" label="备注"></el-table-column>
  27. <el-table-column v-if="fromOriginCharge">
  28. <template #default="scope">
  29. <el-button type="success" icon="Money" @click="applyChargeItem(scope.row)">申请</el-button>
  30. </template>
  31. </el-table-column>
  32. </el-table>
  33. </div>
  34. <div>
  35. <el-pagination
  36. small
  37. @current-change="handlePageChange"
  38. :current-page="currentPage"
  39. :page-size="pageSize"
  40. layout="total, prev, pager, next, jumper"
  41. :total="filterFeeList.length"
  42. >
  43. </el-pagination>
  44. </div>
  45. </div>
  46. </template>
  47. <script setup lang="ts">
  48. import {nullPatient} from '@/utils/validate'
  49. import {baseinfo} from '@/data/inpatient'
  50. import {getPatientFeeList, getAppliedItems, applyHospitalApproval} from '@/api/medical-insurance/hospital-approval.js'
  51. import {computed, nextTick, onActivated, onDeactivated, onMounted, Ref, ref, watch} from "vue";
  52. import {ElMessage} from "element-plus";
  53. interface FeeItem {
  54. patNo: string
  55. times: number
  56. ledgerSn: number
  57. detailSn: number
  58. chargeCodeMx: string
  59. chargeName: string
  60. chargeAmount: number
  61. chargeFee: number
  62. chargeDate: string
  63. oriDetailSn: number
  64. staffId: string
  65. staffName: string
  66. applyDatetime: string
  67. applyStatus: number
  68. applyHandler: string
  69. handlerName: string
  70. handleDatetime: string
  71. handleRemark: string
  72. }
  73. const patient: object = computed(() => {
  74. return baseinfo()
  75. })
  76. const inputContent: Ref<string> = ref('')
  77. const fromOriginCharge: Ref<boolean> = ref(true)
  78. const switchSource = (): void => {
  79. if (nullPatient()) return
  80. if (fromOriginCharge.value) {
  81. getAppliedItems(patient.value.inpatientNo, patient.value.admissTimes, patient.value.ledgerSn).then(res => {
  82. feeList.value = res
  83. fromOriginCharge.value = !fromOriginCharge.value
  84. })
  85. } else {
  86. getPatientFeeList(patient.value.inpatientNo, patient.value.admissTimes, patient.value.ledgerSn).then(res => {
  87. feeList.value = res
  88. fromOriginCharge.value = !fromOriginCharge.value
  89. })
  90. }
  91. }
  92. const feeList: Ref<FeeItem[]> = ref([])
  93. const filterFeeList = computed(() => {
  94. return feeList.value.filter(item => {
  95. return item.chargeCodeMx.toUpperCase().indexOf(inputContent.value.toUpperCase()) !== -1 ||
  96. item.chargeName.indexOf(inputContent.value) !== -1
  97. })
  98. })
  99. const pageSize: number = 20
  100. const currentPage: Ref<number> = ref(1)
  101. const handlePageChange = (val): void => {
  102. currentPage.value = val
  103. }
  104. const fetchPatientFees = (): void => {
  105. getPatientFeeList(patient.value.inpatientNo, patient.value.admissTimes, patient.value.ledgerSn).then(res => {
  106. feeList.value = res
  107. })
  108. }
  109. const clearPatientFees = (): void => {
  110. feeList.value = []
  111. currentPage.value = 1
  112. }
  113. const applyChargeItem = (row: FeeItem): void => {
  114. applyHospitalApproval(row).then(res => {
  115. ElMessage({
  116. message: res,
  117. type: 'success',
  118. duration: 2500,
  119. showClose: true
  120. })
  121. row.applyStatus = 0
  122. })
  123. }
  124. const makeApplyStatusText = (status: number):string => {
  125. if (status === 0) {
  126. return '<span style="color: #e08500">未处理</span>'
  127. } else if (status === 1) {
  128. return '<span style="color: green">已通过</span>'
  129. } else if (status === 2) {
  130. return '<span style="color: red">已驳回</span>'
  131. } else {
  132. return '<span style="color: gray">未申请</span>'
  133. }
  134. }
  135. const activated: Ref<boolean> = ref(false)
  136. onActivated((): void => {
  137. activated.value = true
  138. })
  139. onDeactivated((): void => {
  140. activated.value = false
  141. })
  142. watch(
  143. () => patient.value.inpatientNo,
  144. () => {
  145. if (activated.value) {
  146. if (patient.value.inpatientNo) {
  147. fetchPatientFees()
  148. } else {
  149. clearPatientFees()
  150. }
  151. }
  152. }
  153. )
  154. onMounted((): void => {
  155. nextTick((): void => {
  156. if (patient.value.inpatientNo && patient.value.mdtrtId) {
  157. fetchPatientFees()
  158. }
  159. })
  160. })
  161. </script>