HuanZheFeiYong.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <el-container>
  3. <el-main>
  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. <el-table :data="cptTableDataHuanZheFeiYong" :height="windowHeigth / 1.35"
  8. @selection-change="handleSelectionChange" highlight-current-row stripe>
  9. <el-table-column type="selection"></el-table-column>
  10. <el-table-column label="流水号" prop="detailSn" width="70px"></el-table-column>
  11. <el-table-column label="医嘱号" prop="orderNo" width="70px"></el-table-column>
  12. <el-table-column prop="chargeDate" label="录入日期" width="80px"></el-table-column>
  13. <el-table-column prop="chargeCodeMx" label="项目编码"></el-table-column>
  14. <el-table-column prop="chargeName" label="项目名称"></el-table-column>
  15. <el-table-column prop="drugname" label="药品名称" v-if="patient.feiYongLeiXingCode === 1"></el-table-column>
  16. <el-table-column prop="genTime" label="执行时间" width="80px"></el-table-column>
  17. <el-table-column prop="execDept" label="执行科室"></el-table-column>
  18. <el-table-column prop="deptCode" label="申请科室"></el-table-column>
  19. <el-table-column prop="chargeFee" label="金额"></el-table-column>
  20. <el-table-column label="数量" prop="chargeAmount"></el-table-column>
  21. <el-table-column label="状态" prop="chargeStatus">
  22. <template #default="scope">
  23. {{ costState(scope.row.chargeStatus) }}
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="录入人" prop="opName"></el-table-column>
  27. <el-table-column label="账单码" prop="billItemName"></el-table-column>
  28. <el-table-column label="是否退费" prop="tuiFeiFlag">
  29. <template #default="scope">
  30. <span v-if="scope.row.oriDetailSn === -1" style="color: red">已退费 <br/> </span>
  31. <span v-if="scope.row.oriDetailSn > 0"
  32. ><span style="color: #e6a23c">退费数据</span> <br/>
  33. <span style="color: teal">
  34. 原流水号为 <br/>
  35. 【 {{ scope.row.oriDetailSn }} 】
  36. </span>
  37. </span>
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. <el-pagination
  42. @size-change="handleSizeChange"
  43. @current-change="handleCurrentChange"
  44. :current-page="fenYe.currentPage"
  45. :page-sizes="[20, 30, 40, 50, 100]"
  46. :page-size="fenYe.pageSize"
  47. layout="total, sizes, prev, pager, next, jumper"
  48. :total="fenYe.total"
  49. style="margin-top: 5px"
  50. ></el-pagination>
  51. </el-main>
  52. <el-dialog v-model="weiGuiTuiFeiFenXiDialog" title="违规费用分析" :fullscreen="true">
  53. <wei-gui-fei-yong-fen-xi :init="weiGuiTuiFeiInit" @open="weiGuiTuiFeiOpenDialog"
  54. :patient="weiGuiJiBenXinXi"></wei-gui-fei-yong-fen-xi>
  55. </el-dialog>
  56. </el-container>
  57. </template>
  58. <script>
  59. import {ref, watch} from 'vue'
  60. import {costState} from '../../utils/computed'
  61. import store from '@/store'
  62. import {getChargeCode, xiangMuTuiFei} from '@/api/yibao/xiang-mu-lu-ru'
  63. import WeiGuiFeiYongFenXi from '@/components/inpatient/WeiGuiFeiYongFenXi.vue'
  64. import {ElMessage, ElMessageBox} from 'element-plus'
  65. export default {
  66. components: {WeiGuiFeiYongFenXi},
  67. name: 'huanZheFeiYong',
  68. props: {
  69. init: {
  70. type: Object,
  71. },
  72. patient: {
  73. type: Object,
  74. },
  75. },
  76. setup(props, ctx) {
  77. const windowSize = store.state.app.windowSize
  78. const windowHeigth = windowSize.h
  79. const cptTableDataHuanZheFeiYong = ref([])
  80. const fenYe = ref({
  81. pageSize: 30,
  82. currentPage: 1,
  83. total: 0,
  84. })
  85. watch(
  86. () => props.init,
  87. () => {
  88. cptTableDataHuanZheFeiYong.value = props.init.records
  89. fenYe.value.total = typeof props.init.total === 'undefined' ? 0 : props.init.total
  90. }
  91. )
  92. // 分页
  93. const handleSizeChange = (val) => {
  94. fenYe.value.pageSize = val
  95. fenYe.value.currentPage = 1
  96. ctx.emit('size', {val})
  97. }
  98. const handleCurrentChange = (val) => {
  99. fenYe.value.currentPage = val
  100. ctx.emit('current', {val})
  101. }
  102. /**
  103. * 获取的项目名称保存的位置
  104. */
  105. const chargeCodeNameData = ref([])
  106. /**
  107. * 远程搜索
  108. */
  109. const remoteMethodChargeCode = (val) => {
  110. if (val.length >= 2) {
  111. getChargeCode(val).then((res) => {
  112. chargeCodeNameData.value = res
  113. })
  114. }
  115. }
  116. // 获取选择到的项目
  117. const handleSelectionChange = (val) => {
  118. props.patient.list = val
  119. }
  120. const xiangMuTuiFeiClick = () => {
  121. props.patient.deptCode = store.state.user.info.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. ElMessageBox.confirm(
  130. `退费数量为:<span style='color:red'>【${chargeAmount}】</span> ,总价格为:<span style='color:#E6A23C'>【${chargeFee.toFixed(2)}】</span>`,
  131. '请认真核对',
  132. {
  133. confirmButtonText: '确定',
  134. cancelButtonText: '取消',
  135. type: 'warning',
  136. dangerouslyUseHTMLString: true,
  137. }
  138. )
  139. .then(() => {
  140. xiangMuTuiFei(props.patient).then((res) => {
  141. ctx.emit('query-fei-yong')
  142. })
  143. })
  144. .catch(() => {
  145. })
  146. } catch (e) {
  147. ElMessage.error({
  148. message: '请选择退费数据',
  149. showClose: true,
  150. })
  151. }
  152. }
  153. ///////////////////////////////////////////// 违规退费分析 /////////////////////////////////////////////////////////////////////////
  154. const weiGuiTuiFeiInit = ref(0)
  155. const weiGuiTuiFeiFenXiDialog = ref(true)
  156. const weiGuiJiBenXinXi = ref({})
  157. const weiGuiTuiFeiFenXiDialogOpen = (val) => {
  158. // 014912
  159. weiGuiTuiFeiInit.value += 1
  160. weiGuiJiBenXinXi.value.openDialog = val
  161. weiGuiJiBenXinXi.value.deptCode = store.state.user.info.deptCode
  162. weiGuiJiBenXinXi.value.inpatientNo = typeof props.patient.inpatientNo === 'undefined' ? '' : props.patient.inpatientNo
  163. }
  164. const weiGuiTuiFeiOpenDialog = (val) => {
  165. weiGuiTuiFeiFenXiDialog.value = val
  166. }
  167. const exportExecl = () => {
  168. ctx.emit('execl')
  169. }
  170. return {
  171. cptTableDataHuanZheFeiYong,
  172. costState,
  173. fenYe,
  174. windowHeigth,
  175. handleSizeChange,
  176. handleCurrentChange,
  177. remoteMethodChargeCode,
  178. chargeCodeNameData,
  179. xiangMuTuiFeiClick,
  180. handleSelectionChange,
  181. weiGuiTuiFeiFenXiDialogOpen,
  182. weiGuiTuiFeiFenXiDialog,
  183. weiGuiJiBenXinXi,
  184. weiGuiTuiFeiInit,
  185. weiGuiTuiFeiOpenDialog,
  186. exportExecl,
  187. }
  188. },
  189. }
  190. </script>
  191. <style></style>