YiJiFeiYongLuRu.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <el-container>
  3. <el-main style="margin-top: 10px">
  4. <el-row>
  5. <el-col>
  6. <el-tag effect="dark" size="small">住院号: {{ patient.inpatientNo }}</el-tag>
  7. <el-tag effect="dark" size="small" type="warning">患者姓名: {{ patient.name }}</el-tag>
  8. <el-tag effect="dark" size="small"> 床号: {{ patient.bedNo }}</el-tag>
  9. <el-tag effect="dark" size="small" type="warning">住院次数: {{ patient.admissTimes }}</el-tag>
  10. <el-tag effect="dark" size="small">性别: {{ cptSex(patient.sex) }}</el-tag>
  11. <el-tag effect="dark" size="small" type="warning">病房: {{ patient.wardName }}</el-tag>
  12. <el-tag effect="dark" size="small">入院日期: {{ patient.admissDate }}</el-tag>
  13. <el-tag effect="dark" size="small" type="warning">医保身份: {{ patient.responceTypeName }}</el-tag>
  14. <el-tag effect="dark" size="small">总费用: {{ patient.totalCharge }}</el-tag>
  15. </el-col>
  16. <el-col>
  17. 住院号:
  18. <el-input style="width: 80px" v-model="queryTerm.inpatientNo"
  19. @keyup.enter="getHuanZheXinXiClick"></el-input>
  20. <span v-show="queryTerm.zaiHuanChuYuan === 1">
  21. 住院次数:<el-input-number :min="0" :precision="0" style="width: 60px" v-model="queryTerm.admissTimes"
  22. :controls="false"></el-input-number>
  23. </span>
  24. <el-divider direction="vertical"></el-divider>
  25. <el-switch active-color="#ff4949" inactive-color="#13ce66" active-text="出院" inactive-text="在院"
  26. :active-value="1"
  27. :inactive-value="0" v-model="queryTerm.zaiHuanChuYuan">
  28. </el-switch>
  29. <el-divider direction="vertical"></el-divider>
  30. 项目名称:
  31. <el-select v-model="queryTerm.chargeCode" remote filterable clearable
  32. :remote-method="remoteMethodChargeCode">
  33. <el-option v-for="item in chargeCodeNameData" :key="item.code" :label="item.name"
  34. :value="item.code">
  35. <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
  36. <el-divider direction="vertical"></el-divider>
  37. <span>{{ item.name }}</span>
  38. </el-option>
  39. </el-select>
  40. 录入日期:
  41. <el-date-picker
  42. type="daterange"
  43. v-model="queryTerm.dateRange"
  44. placeholder="选择日期"
  45. style="width: 200px"
  46. range-separator="至"
  47. start-placeholder="开始日期"
  48. end-placeholder="结束日期"
  49. :shortcuts="shortcuts"
  50. ></el-date-picker>
  51. <el-button
  52. @click="queryTerm.riQiPaiXu === 'DESC' ? (queryTerm.riQiPaiXu = 'ASC') : (queryTerm.riQiPaiXu = 'DESC')"
  53. type="success"
  54. :icon="queryTerm.riQiPaiXu === 'DESC' ? 'CaretBottom' : 'CaretTop'"
  55. >{{ queryTerm.riQiPaiXu === 'DESC' ? '降序' : '升序' }}
  56. </el-button>
  57. <el-select style="width: 70px" v-model="queryTerm.feiYongLeiXingCode">
  58. <el-option v-for="item in feiYongLeiXing" :key="item.code" :label="item.name"
  59. :value="item.code">
  60. <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
  61. <el-divider direction="vertical"></el-divider>
  62. <span>{{ item.name }}</span>
  63. </el-option>
  64. </el-select>
  65. <el-select v-model="queryTerm.orderNo" style="width: 70px" @change="queryHuanZheFeiYong">
  66. <el-option v-for="item in yiZhuTuiFeiLeiXing" :key="item.code" :label="item.name"
  67. :value="item.code">
  68. <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
  69. <el-divider direction="vertical"></el-divider>
  70. <span>{{ item.name }}</span>
  71. </el-option>
  72. </el-select>
  73. <el-select v-model="queryTerm.tuiFeiFlag" style="width: 70px" @change="queryHuanZheFeiYong">
  74. <el-option v-for="item in tuiFeiLeiXin" :key="item.code" :label="item.name" :value="item.code">
  75. <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
  76. <el-divider direction="vertical"></el-divider>
  77. <span>{{ item.name }}</span>
  78. </el-option>
  79. </el-select>
  80. <el-select v-model="queryTerm.dept" style="width: 100px">
  81. <el-option v-for="(value,key) in deptList"
  82. :value="key" :label="value"/>
  83. </el-select>
  84. <el-button type="primary" @click="getHuanZheXinXiClick">查询</el-button>
  85. </el-col>
  86. </el-row>
  87. <el-tabs v-model="elTabPane">
  88. <el-tab-pane label="已录入费用" name="ylrfy">
  89. <huan-zhe-fei-yong
  90. :init="tableDataHuanZheFeiYong"
  91. :patient="patient"
  92. @queryFeiYong="getHuanZheXinXiClick"
  93. @size="handleSizeChange"
  94. @current="handleCurrentChange"
  95. @execl="exportExecl"
  96. ></huan-zhe-fei-yong>
  97. </el-tab-pane>
  98. <el-tab-pane label="费用录入" name="fylr">
  99. <xiang-mu-lu-ru :patient="patient"></xiang-mu-lu-ru>
  100. </el-tab-pane>
  101. </el-tabs>
  102. </el-main>
  103. </el-container>
  104. </template>
  105. <script>
  106. import {ref} from 'vue'
  107. import store from '@/store'
  108. import {getHuanZheXinXi} from '@/api/zhu-yuan-yi-ji/yi-ji-fei-yong-lu-ru'
  109. import {cptSex} from '@/utils/computed'
  110. import {getChargeCode} from '@/api/inpatient/xiang-mu-lu-ru'
  111. import {getHuanZheFeiYong} from '@/api/inpatient/xiang-mu-lu-ru'
  112. import HuanZheFeiYong from '@/components/med-tec-mod/HuanZheFeiYong.vue'
  113. import XiangMuLuRu from '@/components/med-tec-mod/YiJiXiangMuLuRu.vue'
  114. import {yiZhuTuiFeiLeiXing, feiYongLeiXing, tuiFeiLeiXin} from '@/data'
  115. import {shortcuts} from '@/data/shortcuts'
  116. import {getDateRangeFormatDate} from '@/utils/date'
  117. import {ElMessage, ElMessageBox} from 'element-plus'
  118. import {downloadExcel} from '@/utils/excel'
  119. export default {
  120. components: {HuanZheFeiYong, XiangMuLuRu},
  121. name: 'yiJiFeiYongLuRu',
  122. setup() {
  123. const windowSize = store.state.app.windowSize
  124. const windowHeigth = windowSize.h
  125. const dangQianShiJian = new Date()
  126. const deptList = store.state.user.info.partTimeDeptMap
  127. const queryTerm = ref({
  128. inpatientNo: '',
  129. admissTimes: 0,
  130. zaiHuanChuYuan: '',
  131. dateRange: [dangQianShiJian, dangQianShiJian],
  132. riQiPaiXu: 'DESC',
  133. chargeCode: '',
  134. orderNo: 2,
  135. feiYongLeiXingCode: 0,
  136. dept: store.state.user.info.deptCode === '3100000' ? '' : store.state.user.info.deptCode,
  137. currentPage: 1,
  138. pageSize: 30,
  139. total: 0,
  140. tuiFeiFlag: 0,
  141. })
  142. const total = ref(0)
  143. const elTabPane = ref('ylrfy')
  144. const patient = ref({})
  145. const tableDataHuanZheFeiYong = ref([])
  146. const getHuanZheXinXiClick = () => {
  147. if (queryTerm.value.zaiHuanChuYuan === 0) {
  148. queryTerm.value.admissTimes = 0
  149. }
  150. if (patient.inpatientNo === queryTerm.value.inpatientNo) {
  151. queryHuanZheFeiYong()
  152. } else {
  153. getHuanZheXinXi(queryTerm.value.inpatientNo, queryTerm.value.zaiHuanChuYuan, queryTerm.value.admissTimes)
  154. .then((res) => {
  155. patient.value = res
  156. patient.value.feiYongLeiXingCode = queryTerm.value.feiYongLeiXingCode
  157. queryTerm.value.admissTimes = res.admissTimes
  158. queryHuanZheFeiYong()
  159. })
  160. .catch(() => {
  161. patient.value = {}
  162. tableDataHuanZheFeiYong.value = []
  163. })
  164. }
  165. }
  166. const queryHuanZheFeiYong = () => {
  167. if (elTabPane.value !== 'ylrfy') return
  168. let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
  169. queryTerm.value.startTime = dateRangeS.startTime
  170. queryTerm.value.endTime = dateRangeS.endTime
  171. queryTerm.value.currentPage = 1
  172. queryTerm.value.total = 0
  173. getHuanZheFeiYong(queryTerm.value)
  174. .then((res) => {
  175. total.value = res.total
  176. patient.value.total = total.value
  177. tableDataHuanZheFeiYong.value = res
  178. })
  179. .catch(() => {
  180. tableDataHuanZheFeiYong.value = []
  181. })
  182. }
  183. const handleHuanZheFeiYong = () => {
  184. if (elTabPane.value !== 'ylrfy') return
  185. let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
  186. queryTerm.value.startTime = dateRangeS.startTime
  187. queryTerm.value.endTime = dateRangeS.endTime
  188. queryTerm.value.total = total.value
  189. getHuanZheFeiYong(queryTerm.value)
  190. .then((res) => {
  191. res.total = total.value
  192. tableDataHuanZheFeiYong.value = res
  193. })
  194. .catch(() => {
  195. tableDataHuanZheFeiYong.value = []
  196. })
  197. }
  198. // 根据项目名称来查询
  199. const chargeCodeNameData = ref([])
  200. /**
  201. * 远程搜索
  202. */
  203. const remoteMethodChargeCode = (val) => {
  204. if (val.length >= 2) {
  205. getChargeCode(val).then((res) => {
  206. chargeCodeNameData.value = res
  207. })
  208. }
  209. }
  210. // 分页
  211. const handleSizeChange = (val) => {
  212. queryTerm.value.pageSize = val.val
  213. patient.value.pageSize = val.val
  214. queryHuanZheFeiYong()
  215. }
  216. const handleCurrentChange = (val) => {
  217. queryTerm.value.currentPage = val.val
  218. handleHuanZheFeiYong()
  219. }
  220. // 导出excel 表格
  221. const exportExecl = () => {
  222. if (total.value > 0) {
  223. ElMessageBox.prompt('导出文件名字', '提示', {
  224. confirmButtonText: '确定',
  225. cancelButtonText: '取消',
  226. inputPattern: /\S/,
  227. inputErrorMessage: '文件名不能为空 (∩•̀ω•́)⊃-*⋆',
  228. })
  229. .then(({value}) => {
  230. queryTerm.value.total = total.value
  231. const data = {
  232. param: queryTerm.value,
  233. url: '/xmlr/exportExcel',
  234. fileName: `${value}.xlsx`,
  235. }
  236. setTimeout(() => {
  237. downloadExcel(data)
  238. }, 500)
  239. })
  240. .catch((e) => {
  241. })
  242. } else {
  243. ElMessage.error('请先查询出数据')
  244. }
  245. }
  246. return {
  247. windowHeigth,
  248. queryTerm,
  249. getHuanZheXinXiClick,
  250. tableDataHuanZheFeiYong,
  251. patient,
  252. cptSex,
  253. queryHuanZheFeiYong,
  254. chargeCodeNameData,
  255. remoteMethodChargeCode,
  256. elTabPane,
  257. yiZhuTuiFeiLeiXing,
  258. tuiFeiLeiXin,
  259. shortcuts,
  260. feiYongLeiXing,
  261. handleSizeChange,
  262. handleCurrentChange,
  263. exportExecl,
  264. deptList,
  265. }
  266. },
  267. }
  268. </script>
  269. <style></style>