HuanZheFeiYong.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div class="layout_display_flex_y">
  3. <div>
  4. <el-button type="danger" @click="xiangMuTuiFeiClick" icon="Delete">退费</el-button>
  5. <el-button type="primary" @click="weiGuiTuiFeiFenXiDialogOpen(true)">违规费用分析</el-button>
  6. <el-button type="primary" @click="exportExecl" icon="Download">导出 Excel</el-button>
  7. </div>
  8. <div class="layout_flex_1-y layout_display_flex_y">
  9. <div class="layout_flex_1-y">
  10. <el-table :data="cptTableDataHuanZheFeiYong"
  11. height="100%"
  12. @selection-change="handleSelectionChange" highlight-current-row stripe>
  13. <el-table-column type="selection"></el-table-column>
  14. <el-table-column label="流水号" prop="detailSn" width="70px"></el-table-column>
  15. <el-table-column label="医嘱号" prop="orderNo" width="70px"></el-table-column>
  16. <el-table-column prop="chargeDate" label="录入日期" width="80px"></el-table-column>
  17. <el-table-column prop="chargeCodeMx" label="项目编码"></el-table-column>
  18. <el-table-column prop="chargeName" label="项目名称"></el-table-column>
  19. <el-table-column prop="drugname" label="药品名称"
  20. v-if="patient.feiYongLeiXingCode === 1"></el-table-column>
  21. <el-table-column prop="genTime" label="执行时间" width="80px"></el-table-column>
  22. <el-table-column prop="execDept" label="执行科室"></el-table-column>
  23. <el-table-column prop="deptCode" label="申请科室"></el-table-column>
  24. <el-table-column prop="chargeFee" label="金额"></el-table-column>
  25. <el-table-column label="数量" prop="chargeAmount"></el-table-column>
  26. <el-table-column label="状态" prop="chargeStatus">
  27. <template #default="scope">
  28. {{ costState(scope.row.chargeStatus) }}
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="录入人" prop="opName"></el-table-column>
  32. <el-table-column label="账单码" prop="billItemName"></el-table-column>
  33. <el-table-column label="是否退费" prop="tuiFeiFlag">
  34. <template #default="scope">
  35. <span v-if="scope.row.oriDetailSn === -1" style="color: red">已退费 <br/> </span>
  36. <span v-if="scope.row.oriDetailSn > 0"
  37. ><span style="color: #e6a23c">退费数据</span> <br/>
  38. <span style="color: teal">
  39. 原流水号为 <br/>
  40. 【 {{ scope.row.oriDetailSn }} 】
  41. </span>
  42. </span>
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. </div>
  47. <div>
  48. <el-pagination
  49. @size-change="handleSizeChange"
  50. @current-change="handleCurrentChange"
  51. :current-page="fenYe.currentPage"
  52. :page-sizes="[20, 30, 40, 50, 100]"
  53. :page-size="fenYe.pageSize"
  54. layout="total, sizes, prev, pager, next, jumper"
  55. :total="fenYe.total"
  56. style="margin-top: 5px"
  57. ></el-pagination>
  58. </div>
  59. </div>
  60. </div>
  61. <el-dialog
  62. v-model="weiGuiTuiFeiFenXiDialog"
  63. title="违规费用分析"
  64. :fullscreen="true">
  65. <wei-gui-fei-yong-fen-xi
  66. :init="weiGuiTuiFeiInit"
  67. @open="weiGuiTuiFeiOpenDialog"
  68. :patient="weiGuiJiBenXinXi"/>
  69. </el-dialog>
  70. </template>
  71. <script lang="ts" setup>
  72. import {ref, watch} from 'vue'
  73. import {costState} from '@/utils/computed'
  74. import WeiGuiFeiYongFenXi from '@/components/inpatient/WeiGuiFeiYongFenXi.vue'
  75. import {ElMessage, ElMessageBox} from 'element-plus'
  76. import {refund} from "@/api/hospitalization-costs/hospitalization-costs-api";
  77. import {useUserStore} from "@/pinia/user-store";
  78. const props = defineProps({
  79. init: {
  80. type: Object,
  81. },
  82. patient: {
  83. type: Object,
  84. },
  85. })
  86. const emits = defineEmits<{
  87. (e: 'size', value: any)
  88. (e: 'current', value: any)
  89. (e: 'query-fei-yong')
  90. (e: 'execl')
  91. }>()
  92. const cptTableDataHuanZheFeiYong = ref([])
  93. const fenYe = ref({
  94. pageSize: 30,
  95. currentPage: 1,
  96. total: 0,
  97. })
  98. const userStore = useUserStore().userInfo
  99. watch(
  100. () => props.init,
  101. () => {
  102. cptTableDataHuanZheFeiYong.value = props.init.records
  103. fenYe.value.total = typeof props.init.total === 'undefined' ? 0 : props.init.total
  104. }
  105. )
  106. // 分页
  107. const handleSizeChange = (val) => {
  108. fenYe.value.pageSize = val
  109. fenYe.value.currentPage = 1
  110. emits('size', {val})
  111. }
  112. const handleCurrentChange = (val) => {
  113. fenYe.value.currentPage = val
  114. emits('current', {val})
  115. }
  116. // 获取选择到的项目
  117. const handleSelectionChange = (val) => {
  118. props.patient.list = val
  119. }
  120. const xiangMuTuiFeiClick = () => {
  121. props.patient.deptCode = userStore.deptCode
  122. try {
  123. let chargeFee = 0
  124. let chargeAmount = 0
  125. for (let i = 0; i < props.patient.list.length; i++) {
  126. chargeFee += props.patient.list[i].chargeFee
  127. chargeAmount += props.patient.list[i].chargeAmount
  128. }
  129. // @ts-ignore
  130. ElMessageBox.confirm(
  131. `退费数量为:<span style='color:red'>【${chargeAmount}】</span> ,总价格为:<span style='color:#E6A23C'>【${chargeFee.toFixed(2)}】</span>`,
  132. '请认真核对',
  133. {
  134. confirmButtonText: '确定',
  135. cancelButtonText: '取消',
  136. type: 'warning',
  137. dangerouslyUseHTMLString: true
  138. }
  139. ).then(async () => {
  140. let data = {
  141. inpatientNo: props.patient.inpatientNo,
  142. admissTimes: props.patient.admissTimes,
  143. groupNo: null,
  144. list: props.patient.list,
  145. refundFlag: 'refundOnly'
  146. }
  147. await refund(data)
  148. emits('query-fei-yong')
  149. })
  150. .catch(() => {
  151. })
  152. } catch (e) {
  153. ElMessage.error({
  154. message: '请选择退费数据',
  155. showClose: true,
  156. })
  157. }
  158. }
  159. ///////////////////////////////////////////// 违规退费分析 /////////////////////////////////////////////////////////////////////////
  160. const weiGuiTuiFeiInit = ref(0)
  161. const weiGuiTuiFeiFenXiDialog = ref(true)
  162. const weiGuiJiBenXinXi = ref({})
  163. const weiGuiTuiFeiFenXiDialogOpen = (val) => {
  164. // 014912
  165. weiGuiTuiFeiInit.value += 1
  166. weiGuiJiBenXinXi.value.openDialog = val
  167. weiGuiJiBenXinXi.value.deptCode = userStore.deptCode
  168. weiGuiJiBenXinXi.value.inpatientNo = typeof props.patient.inpatientNo === 'undefined' ? '' : props.patient.inpatientNo
  169. }
  170. const weiGuiTuiFeiOpenDialog = (val) => {
  171. weiGuiTuiFeiFenXiDialog.value = val
  172. }
  173. const exportExecl = () => {
  174. emits('execl')
  175. }
  176. </script>
  177. <style></style>