Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

gatherStatistics.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <div>
  3. <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
  4. <div>
  5. <el-select size="small" v-model="item_type" placeholder="请选择"
  6. style="width:150px;margin-left:10px;" @change="changeItem">
  7. <el-option
  8. label="全部"
  9. value="0">
  10. </el-option>
  11. <el-option
  12. v-for="(item,index) in items"
  13. :key="index"
  14. :label="item.name"
  15. :value="item.id">
  16. </el-option>
  17. </el-select>
  18. <el-input
  19. size="small"
  20. style="width: 150px"
  21. v-model="keywords"
  22. class="filter-item"
  23. />
  24. <el-button
  25. size="small"
  26. style="margin: 0 10px"
  27. class="filter-item"
  28. type="primary"
  29. @click="searchAction"
  30. >搜索
  31. </el-button>
  32. <el-date-picker
  33. v-model="chargeDate"
  34. type="daterange"
  35. value-format="yyyy-MM-dd"
  36. range-separator="至"
  37. start-placeholder="开始日期"
  38. @change="changeDate"
  39. end-placeholder="结束日期">
  40. </el-date-picker>
  41. </div>
  42. <div>
  43. </div>
  44. </div>
  45. <el-table :data="list" border :row-style="{ color: '#303133' }" ref="table"
  46. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  47. show-summary
  48. max-height="600"
  49. v-loading="detail_loading"
  50. highlight-current-row>
  51. <el-table-column type="index" label="序号" width="60px" align="center">
  52. <template slot-scope="scope">{{scope.row.index}}</template>
  53. </el-table-column>
  54. <el-table-column align="center" prop="name" label="处方日期">
  55. <template slot-scope="scope">
  56. {{getTime(scope.row.record_date)}}
  57. </template>
  58. </el-table-column>
  59. <el-table-column align="center" prop="name" label="费用分类">
  60. <template slot-scope="scope">
  61. {{ scope.row.med_chrgitm_type }}
  62. </template>
  63. </el-table-column>
  64. <el-table-column align="center" prop="name" label="项目名称">
  65. <template slot-scope="scope">
  66. <span>{{scope.row.name}}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column align="center" prop="name" label="规格型号">
  70. <template slot-scope="scope">
  71. {{ scope.row.spec }}
  72. </template>
  73. </el-table-column>
  74. <el-table-column align="center" prop="name" label="数量">
  75. <template slot-scope="scope">
  76. {{ scope.row.count }}{{ scope.row.unit }}
  77. </template>
  78. </el-table-column>
  79. <el-table-column align="center" prop="name" label="单价">
  80. <template slot-scope="scope">
  81. {{scope.row.price}}
  82. </template>
  83. </el-table-column>
  84. <el-table-column align="center" prop="name" label="金额">
  85. <template slot-scope="scope">
  86. {{ (scope.row.price * scope.row.count).toFixed(2) }}
  87. </template>
  88. </el-table-column>
  89. <el-table-column align="center" prop="name" label="医保类别">
  90. <template slot-scope="scope"></template>
  91. </el-table-column>
  92. </el-table>
  93. </div>
  94. </template>
  95. <script>
  96. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  97. import { getGatherDetailList } from '@/api/his/his_tools'
  98. import { uParseTime } from '@/utils/tools'
  99. const moment = require('moment')
  100. export default {
  101. components: {
  102. BreadCrumb
  103. },
  104. props: {
  105. patient_id: {
  106. type: Number,
  107. default: 0
  108. }
  109. },
  110. data() {
  111. return {
  112. detail_loading: false,
  113. tempArr: [],
  114. pos: 0,
  115. search_input: '',
  116. sameRowArr: [],
  117. keywords: '',
  118. tableData: [],
  119. tableList:[],
  120. chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
  121. item_type: '0',
  122. items: [
  123. { id: 1, name: '药品' },
  124. { id: 3, name: '耗材' },
  125. { id: 2, name: '项目' }
  126. ],
  127. list:[],
  128. }
  129. },
  130. methods: {
  131. searchAction(){
  132. },
  133. changeDate() {
  134. this.getSummaryDetailList()
  135. },
  136. changeItem() {
  137. this.getSummaryDetailList()
  138. },
  139. getGatherDetailList() {
  140. let start_time = this.chargeDate[0]
  141. let end_time = this.chargeDate[1]
  142. let params = {
  143. patient_id:this.patient_id,
  144. start_time: start_time,
  145. end_time: end_time,
  146. type: this.item_type,
  147. keyword: this.keywords
  148. }
  149. getGatherDetailList(params).then(response=>{
  150. if (response.data.state == 0) {
  151. this.$message.error(response.data.msg)
  152. return false
  153. } else {
  154. this.order = response.data.data.order
  155. this.order['bedCostTotal'] = response.data.data.bedCostTotal
  156. this.order['operationCostTotal'] = response.data.data.operationCostTotal
  157. this.order['otherCostTotal'] = response.data.data.otherCostTotal
  158. this.order['materialCostTotal'] = response.data.data.materialCostTotal
  159. this.order['westernMedicineCostTotal'] = response.data.data.westernMedicineCostTotal
  160. this.order['chineseTraditionalMedicineCostTotal'] = response.data.data.chineseTraditionalMedicineCostTotal
  161. this.order['checkCostTotal'] = response.data.data.checkCostTotal
  162. this.order['zhenChaCostTotal'] = response.data.data.zhenChaCostTotal
  163. this.order['laboratoryCostTotal'] = response.data.data.laboratoryCostTotal
  164. this.order['treatCostTotal'] = response.data.data.treatCostTotal
  165. this.patient = response.data.data.patient
  166. this.admin = response.data.data.admin_info
  167. this.his_hospital = response.data.data.his_hospital
  168. var order_info = response.data.data.order_info
  169. if(this.$store.getters.xt_user.org_id == 10215 || this.$store.getters.xt_user.org_id == 0){
  170. //获取所有项目类型进行去重
  171. let med_chrgitm_types = []
  172. for (let i = 0; i < order_info.length; i++) {
  173. med_chrgitm_types.push(order_info[i].med_chrgitm_type)
  174. }
  175. const obj = {}
  176. med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
  177. obj[next] ? '' : obj[next] = true && cur.push(next)
  178. return cur
  179. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  180. let tempOrderInfo = []
  181. for (let i = 0; i < med_chrgitm_types.length; i++) {
  182. let obj = {
  183. total: 0,
  184. details: [],
  185. is_total:0,
  186. }
  187. let tempDetails = []
  188. for (let b = 0; b < order_info.length; b++) {
  189. if (med_chrgitm_types[i] == order_info[b].med_chrgitm_type) {
  190. tempDetails.push(order_info[b])
  191. }
  192. }
  193. obj.details = this.setNewData(tempDetails)
  194. this.list = this.list.concat(obj.details)
  195. for(let i=0;i<this.list.length;i++){
  196. this.list[i].index = i
  197. }
  198. }
  199. let newobj = {}
  200. newobj['total'] = this.order.medfee_sumamt
  201. newobj['is_total'] = 1
  202. this.list.push(newobj)
  203. }else{
  204. console.log("hh2332322323232332232332",order_info)
  205. //获取所有项目类型进行去重
  206. let med_chrgitm_types = []
  207. for (let i = 0; i < order_info.length; i++) {
  208. med_chrgitm_types.push(order_info[i].med_chrgitm_type)
  209. }
  210. const obj = {}
  211. med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
  212. obj[next] ? '' : obj[next] = true && cur.push(next)
  213. return cur
  214. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  215. let tempOrderInfo = []
  216. for (let i = 0; i < med_chrgitm_types.length; i++) {
  217. let obj = {
  218. total: 0,
  219. details: []
  220. }
  221. let tempDetails = []
  222. for (let b = 0; b < order_info.length; b++) {
  223. if (med_chrgitm_types[i] == order_info[b].med_chrgitm_type) {
  224. tempDetails.push(order_info[b])
  225. }
  226. }
  227. console.log("tempdetail2323323232322332233223",tempDetails)
  228. obj.details = this.setNewData(tempDetails)
  229. obj.total = this.getTotal(obj.details)
  230. obj.details.push({
  231. total: obj.total,
  232. is_total: 1,
  233. })
  234. console.log("obj3232232332323223",obj.details)
  235. this.list = this.list.concat(obj.details)
  236. for(let i=0;i<this.list.length;i++){
  237. this.list[i].index = i+1
  238. }
  239. console.log("list32233223233332232323232323",this.list)
  240. }
  241. }
  242. }
  243. })
  244. },
  245. getAdviceName(id){
  246. var drug_name = ""
  247. for(let i= 0;i<this.tableData.length;i++){
  248. if(id == this.tableData[i].advice_id){
  249. drug_name = this.tableData[i].advice.advice_name
  250. }
  251. }
  252. return drug_name
  253. },
  254. getProjectName(id){
  255. var project_name = ""
  256. for(let i=0;i<this.tableData.length;i++){
  257. if(id == this.tableData[i].project_id){
  258. project_name = this.tableData[i].project.project.project_name
  259. }
  260. }
  261. return project_name
  262. },
  263. setNewData(details) {
  264. console.log("detail233223233223",details)
  265. let drug_ids = []
  266. let project_ids = []
  267. for (let i = 0; i < details.length; i++) {
  268. if (details[i].advice && details[i].advice.id > 0 && details[i].advice.prescription && details[i].advice.prescription.type == 1) { //药品
  269. let obj = {
  270. id: details[i].advice.drug_id,
  271. price: details[i].advice.price,
  272. record_date:details[i].advice.advice_date
  273. }
  274. drug_ids.push(obj)
  275. } else if (details[i].project && details[i].project.id > 0 && details[i].project.prescription && details[i].project.prescription.type == 2) { //项目
  276. let obj = {
  277. id: details[i].project.project_id,
  278. price: details[i].project.price,
  279. record_date:details[i].advice.record_date
  280. }
  281. project_ids.push(obj)
  282. }
  283. }
  284. let new_drug_ids = this.unique(drug_ids)
  285. let new_project_ids = this.unique(project_ids)
  286. let list = []
  287. if (new_drug_ids.length > 0 && new_project_ids.length == 0) {
  288. for (let i = 0; i < new_drug_ids.length; i++) {
  289. let obj = {}
  290. let count = 0
  291. for (let a = 0; a < details.length; a++) {
  292. if (new_drug_ids[i].id == details[a].advice.drug_id && new_drug_ids[i].price == details[a].advice.price) {
  293. obj['name'] = details[a].advice.advice_name
  294. obj['spec'] = details[a].advice.drug.dose + details[a].advice.drug.dose_unit+"*" + details[a].advice.drug.min_number + details[a].advice.drug.min_unit+"/"+ details[a].advice.drug.max_unit
  295. obj['unit'] = details[a].advice.drug.min_unit
  296. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  297. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  298. obj['price'] = parseFloat(details[a].pric)
  299. obj['is_total'] = 2
  300. obj['record_date'] = details[a].advice.record_date
  301. count = count + details[a].cnt
  302. }
  303. }
  304. obj['count'] = count
  305. list.push(obj)
  306. }
  307. }
  308. if (new_drug_ids.length == 0 && new_project_ids.length > 0) {
  309. for (let i = 0; i < new_project_ids.length; i++) {
  310. let obj = {}
  311. let count = 0
  312. for (let a = 0; a < details.length; a++) {
  313. if (new_project_ids[i].id == details[a].project.project_id && new_project_ids[i].price == details[a].project.price) {
  314. if( details[a].project.type == 2){
  315. obj['name'] = details[a].project.project.project_name
  316. obj['spec'] = ''
  317. obj['unit'] = details[a].project.project.unit
  318. }else if(details[a].project.type == 3){
  319. obj['name'] = details[a].project.good_info.good_name
  320. obj['spec'] = ''
  321. obj['unit'] = details[a].project.good_info.packing_unit
  322. }
  323. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  324. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  325. obj['price'] = parseFloat(details[a].pric)
  326. obj['is_total'] = 2
  327. count = count + details[a].cnt
  328. }
  329. }
  330. obj['count'] = count
  331. list.push(obj)
  332. }
  333. }
  334. return list
  335. },
  336. getMedicineInsuranceType(type) {
  337. switch (type) {
  338. case "01":
  339. return '甲类'
  340. break
  341. case "02":
  342. return '乙类'
  343. break
  344. case "03":
  345. return '自费'
  346. break
  347. }
  348. },
  349. getType(med_chrgitm_type){
  350. switch (med_chrgitm_type) {
  351. case '01':
  352. return '床位费'
  353. break
  354. case '02':
  355. return '诊察费'
  356. break
  357. case '03':
  358. return '检查费'
  359. break
  360. case '04':
  361. return '化验费'
  362. break
  363. case '05':
  364. return '治疗费'
  365. break
  366. case '06':
  367. return '手术费'
  368. break
  369. case '07':
  370. return '护理费'
  371. break
  372. case '08':
  373. return '材料费'
  374. break
  375. case '09':
  376. return '西药费'
  377. break
  378. case '10':
  379. return '中药饮片费'
  380. break
  381. case '11':
  382. return '中成药费'
  383. break
  384. case '12':
  385. return '一般诊疗费'
  386. break
  387. case '13':
  388. return '挂号费'
  389. break
  390. case '14':
  391. return '其他费'
  392. break
  393. }
  394. },
  395. unique(array) {
  396. // res用来存储结果
  397. var res = []
  398. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  399. for (var j = 0, resLen = res.length; j < resLen; j++) {
  400. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  401. break
  402. }
  403. }
  404. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  405. if (j === resLen) {
  406. res.push(array[i])
  407. }
  408. }
  409. return res
  410. },
  411. getTotal:function(items){
  412. let total = 0
  413. for(let i = 0; i < items.length; i++){
  414. total = Number(total) + Number((parseFloat(items[i].count) * parseFloat(items[i].price)).toFixed(2))
  415. }
  416. return total.toFixed(2)
  417. },
  418. getTimes(time) {
  419. return uParseTime(time, '{y}-{m}-{d}')
  420. },
  421. },
  422. created() {
  423. this.getGatherDetailList()
  424. }
  425. }
  426. </script>