gatherPrint.vue 43KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156
  1. <template>
  2. <div>
  3. <div class="print_btn">
  4. <el-button type="primary" @click="printtpage">打印</el-button>
  5. </div>
  6. <div id="list-print" class="list-print">
  7. <div class="listTitle">{{$store.getters.xt_user.org.org_name}}费用汇总</div>
  8. <div class="listInfo" style="border-bottom: 2px solid;margin-bottom: 20px;padding-bottom: 10px;">
  9. <div>医疗机构名称:{{$store.getters.xt_user.org.org_name}}</div>
  10. </div>
  11. <div class="listInfo">
  12. <div>科别:{{getDepartment(his_patient.departments)}}</div>
  13. <div>床号:<span v-if="schedule.length > 0">{{getBedName(schedule[0].bed_id)}}</span></div>
  14. <div>门诊号:{{his_patient.number}}</div>
  15. <div>姓名:{{patient.name}}</div>
  16. </div>
  17. <div class="listInfo" style="border-bottom: 2px solid;margin-bottom: 20px;padding-bottom: 20px;">
  18. <div>预交款:</div>
  19. <div>总费用:{{getAllPice()}}</div>
  20. <div>门诊日期:{{this.$route.query.end_time}}</div>
  21. </div>
  22. <div class="listInfo">
  23. <div>西药:{{getWesternMedicineCostTotal()}}</div>
  24. <div>中成药:{{getChineseTraditionalMedicineCostTotal()}}</div>
  25. <div>中草药:{{getChineseTotal()}}</div>
  26. </div>
  27. <div class="listInfo">
  28. <div>检查费:{{getCheckCostTotal()}}</div>
  29. <div>输氧费:{{getOxygen()}}</div>
  30. <div>手术费:{{getOperation()}}</div>
  31. </div>
  32. <div class="listInfo">
  33. <div>化验费:{{getLaboratoryCostTotal()}}</div>
  34. <div>输血费:{{getBlood()}}</div>
  35. <div>诊断费:{{getZhenChaCostTotal()}}</div>
  36. </div>
  37. <div class="listInfo">
  38. <div>治疗费:{{getTreatement()}}</div>
  39. <div>护理费:{{getNursing()}}</div>
  40. <div>床位费:{{getBedCostTotal()}}</div>
  41. </div>
  42. <div class="listInfo" style="margin-bottom: 20px;">
  43. <div>麻醉费:{{getAnesthesia()}}</div>
  44. <div>材料费:{{getMaterialCostTotal()}}</div>
  45. <div>其他:{{getOtherCostTotal()}}</div>
  46. </div>
  47. <table class="listTable" border="1">
  48. <tr>
  49. <td style="text-align:center" >序号</td>
  50. <td style="text-align:center" >费用分类</td>
  51. <td style="text-align:center">项目名称</td>
  52. <td style="text-align:center">规格</td>
  53. <td style="text-align:center">单价</td>
  54. <td style="text-align:center" >数量</td>
  55. <td style="text-align:center">金额</td>
  56. <td style="text-align:center" >医保类型</td>
  57. </tr>
  58. <tr v-for="(item, index) in tableList" :key="index">
  59. <td style="text-align:center" >
  60. <span v-if="item.is_total == 2">{{index+1}}</span>
  61. <span v-if="item.is_total == 1">合计</span>
  62. </td>
  63. <td style="text-align:center" >
  64. <span v-if="item.type == 1">
  65. {{getAdviceMedChrgintmType(item.name)}}
  66. </span>
  67. <span v-if="item.type == 2">
  68. {{getProjectMedChrgintmType(item.project_id)}}
  69. </span>
  70. <span v-if="item.type == 3">
  71. {{getProjectMedChrgintmType(item.project_id)}}
  72. </span>
  73. </td>
  74. <td style="text-align:center" >
  75. <span>{{item.name}}</span>
  76. </td>
  77. <td style="text-align:center" >
  78. {{ item.spec }}
  79. </td>
  80. <td style="text-align:center" >
  81. {{item.price}}
  82. </td>
  83. <td style="text-align:center" >
  84. {{item.count }}{{item.unit }}
  85. </td>
  86. <td style="text-align:center" >
  87. <span v-if="item.is_total == 1">{{ item.total }}</span>
  88. <span v-if="item.is_total == 2">{{ (item.price * item.count).toFixed(2) }}</span>
  89. </td>
  90. <td style="text-align:center" >
  91. <span v-if="balanceAccountsType == 2">{{getChrgitmLv(item.chrgitm_lv)}}</span>
  92. <span v-if="balanceAccountsType != 2">
  93. <span v-if="item.type == 1">
  94. {{getAdviceMedChrgintmLv(item.advice_id)}}
  95. </span>
  96. <span v-if="item.type == 2">
  97. {{getProjectMedChrgintmLv(item.project_id)}}
  98. </span>
  99. <span v-if="item.type == 3">
  100. {{getProjectMedChrgintmLv(item.project_id)}}
  101. </span>
  102. </span>
  103. </td>
  104. </tr>
  105. </table>
  106. </div>
  107. </div>
  108. </template>
  109. <script>
  110. import print from "print-js";
  111. import { uParseTime } from '@/utils/tools'
  112. import { getGatherDetailList } from '@/api/his/his_tools'
  113. export default {
  114. data(){
  115. return{
  116. patient:{},
  117. tableData:[],
  118. list:[],
  119. order:[],
  120. his_patient:{},
  121. hisDepatment:[],
  122. chineseTraditionalMedicineCostTotal:"",//中成药
  123. checkCostTotal:"",//检查费
  124. materialCostTotal:"",//材料费
  125. laboratoryCostTotal:"",//化验费
  126. bedCostTotal:"",//床位费,
  127. operationCostTotal:"",//材料费
  128. zhenChaCostTotal:"",//诊查费
  129. otherCostTotal:"",//其他费用
  130. tableList:[],
  131. order_info_list:[],
  132. balanceAccountsType:0,
  133. medicalInsuranceLevelList:[],
  134. schedule:[],
  135. bedNumber:[],
  136. }
  137. },
  138. methods:{
  139. printtpage() {
  140. const style =
  141. '@media print {.list-print{width:960px;margin:0 auto} .listTitle {font-size: 24px;text-align: center;font-weight: bold;margin-bottom: 10px;}.listInfo {display: flex;font-size: 16px;justify-content: space-between;margin: 10px 0;}.listTable {width: 100%;text-align: center;border-collapse: collapse;line-height: 25px;font-size: 14px;border-color: #000;text-align: left;} .listTable tr td {padding: 0 5px;}.tableBottom {font-size: 16px;display: flex;margin-top: 20px;}.tableBottomOne {margin-right: 40px;}';
  142. printJS({
  143. printable: "list-print",
  144. type: "html",
  145. style: style,
  146. scanStyles: false,
  147. });
  148. },
  149. getNowTime: function () {
  150. let dateTime;
  151. let yy = new Date().getFullYear();
  152. let mm = new Date().getMonth() + 1;
  153. let dd = new Date().getDate();
  154. let hh = new Date().getHours();
  155. let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes()
  156. :
  157. new Date().getMinutes();
  158. let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds()
  159. :
  160. new Date().getSeconds();
  161. dateTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss;
  162. return dateTime
  163. },
  164. getTimes(time) {
  165. return uParseTime(time, '{y}-{m}-{d}')
  166. },
  167. getGatherDetailList() {
  168. let params = {
  169. patient_id:this.$route.query.patient_id,
  170. start_time: this.$route.query.start_time,
  171. end_time: this.$route.query.end_time,
  172. type:this.$route.query.type,
  173. keyword: this.$route.query.keyword
  174. }
  175. getGatherDetailList(params).then(response=>{
  176. if (response.data.state == 0) {
  177. this.$message.error(response.data.msg)
  178. return false
  179. } else {
  180. this.order = response.data.data.order
  181. this.patient = response.data.data.patient
  182. this.admin = response.data.data.admin_info
  183. this.his_hospital = response.data.data.his_hospital
  184. var order_info = response.data.data.order_info
  185. for(let i=0;i<order_info.length;i++){
  186. order_info[i].med_chrgitm_type = this.getType(order_info[i].med_chrgitm_type)
  187. order_info[i].chrgitm_lv = this.getMedicineInsuranceType(order_info[i].chrgitm_lv)
  188. }
  189. this.order_info_list = order_info
  190. var prescription = response.data.data.prescription
  191. this.setMonthPrescription(prescription)
  192. this.balanceAccountsType = response.data.data.balanceAccountsType
  193. this.medicalInsuranceLevelList = response.data.data.medicalInsuranceLevelList
  194. this.schedule = response.data.data.schedule
  195. this.bedNumber = response.data.data.bedNumber
  196. if(order_info!=undefined&&order_info ==null){
  197. this.list = []
  198. return
  199. }
  200. this.his_patient = response.data.data.his_patient
  201. this.hisDepatment = response.data.data.hisDepatment
  202. this.list = []
  203. this.westernMedicineCostTotal = response.data.data.westernMedicineCostTotal
  204. this.chineseTraditionalMedicineCostTotal = response.data.data.chineseTraditionalMedicineCostTotal
  205. this.checkCostTotal = response.data.data.checkCostTotal
  206. this.laboratoryCostTotal = response.data.data.laboratoryCostTotal
  207. this.zhenChaCostTotal = response.data.data.zhenChaCostTotal
  208. this.bedCostTotal = response.data.data.bedCostTotal
  209. this.otherCostTotal = response.data.data.otherCostTotal
  210. this.materialCostTotal = response.data.data.materialCostTotal
  211. if(this.$store.getters.xt_user.org_id == 10215 || this.$store.getters.xt_user.org_id == 0){
  212. //获取所有项目类型进行去重
  213. let med_chrgitm_types = []
  214. for (let i = 0; i < order_info.length; i++) {
  215. med_chrgitm_types.push(order_info[i].med_chrgitm_type)
  216. }
  217. const obj = {}
  218. med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
  219. obj[next] ? '' : obj[next] = true && cur.push(next)
  220. return cur
  221. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  222. let tempOrderInfo = []
  223. for (let i = 0; i < med_chrgitm_types.length; i++) {
  224. let obj = {
  225. total: 0,
  226. details: [],
  227. is_total:0,
  228. }
  229. let tempDetails = []
  230. for (let b = 0; b < order_info.length; b++) {
  231. if (med_chrgitm_types[i] == order_info[b].med_chrgitm_type) {
  232. tempDetails.push(order_info[b])
  233. }
  234. }
  235. obj.details = this.setNewData(tempDetails)
  236. this.list = []
  237. this.list = this.list.concat(obj.details)
  238. for(let i=0;i<this.list.length;i++){
  239. if(this.list[i].is_total == 1){
  240. this.list[i].index = "合计"
  241. }else{
  242. this.list[i].index = i+1
  243. }
  244. }
  245. }
  246. let newobj = {}
  247. newobj['total'] = this.order.medfee_sumamt
  248. newobj['is_total'] = 1
  249. this.list = []
  250. this.list.push(newobj)
  251. }else{
  252. //获取所有项目类型进行去重
  253. let med_chrgitm_types = []
  254. if(order_info!=undefined && order_info.length > 0){
  255. for (let i = 0; i < order_info.length; i++) {
  256. med_chrgitm_types.push(order_info[i].med_chrgitm_type)
  257. }
  258. }
  259. const obj = {}
  260. med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
  261. obj[next] ? '' : obj[next] = true && cur.push(next)
  262. return cur
  263. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  264. let tempOrderInfo = []
  265. for (let i = 0; i < med_chrgitm_types.length; i++) {
  266. let obj = {
  267. total: 0,
  268. details: []
  269. }
  270. let tempDetails = []
  271. for (let b = 0; b < order_info.length; b++) {
  272. if (med_chrgitm_types[i] == order_info[b].med_chrgitm_type) {
  273. tempDetails.push(order_info[b])
  274. }
  275. }
  276. obj.details = this.setNewData(tempDetails)
  277. obj.total = this.getTotal(obj.details)
  278. obj.details.push({
  279. total: obj.total,
  280. is_total: 1,
  281. })
  282. this.list = []
  283. this.list = this.list.concat(obj.details)
  284. for(let i=0;i<this.list.length;i++){
  285. if(this.list[i].is_total == 1){
  286. this.list[i].index = "合计"
  287. }else{
  288. this.list[i].index = i+1
  289. }
  290. }
  291. }
  292. }
  293. }
  294. if(this.$route.query.id == 1){
  295. var new_arr = []
  296. var objOne = {index:"合计",is_total:1,total:0}
  297. objOne.total = this.getTotalPriceTwo(this.tableList)
  298. for(let i=0;i<this.tableList.length;i++){
  299. if(this.tableList[i].is_total != 1){
  300. if(this.tableList[i].type == 1){
  301. new_arr.push(this.tableList[i])
  302. }
  303. }
  304. }
  305. new_arr.push(objOne)
  306. this.tableList = []
  307. this.tableList = new_arr
  308. }
  309. if(this.$route.query.id == 2){
  310. var new_arr = []
  311. var objOne = {index:"合计",is_total:1,total:0}
  312. objOne.total = this.getTotalPriceTwo(this.tableList)
  313. for(let i=0;i<this.tableList.length;i++){
  314. if(this.tableList[i].is_total != 1){
  315. if(this.tableList[i].project_type == 2){
  316. new_arr.push(this.tableList[i])
  317. }
  318. }
  319. }
  320. this.tableList = []
  321. new_arr.push(objOne)
  322. this.tableList = new_arr
  323. }
  324. if(this.$route.query.id == 3){
  325. console.log("2323232332233232322332",this.tableList)
  326. var new_arr = []
  327. var objOne = {index:"合计",is_total:1,total:0}
  328. objOne.total = this.getTotalPriceTwo(this.tableList)
  329. for(let i=0;i<this.tableList.length;i++){
  330. if(this.tableList[i].is_total != 1){
  331. if(this.tableList[i].project_type == 3){
  332. new_arr.push(this.tableList[i])
  333. }
  334. }
  335. }
  336. new_arr.push(objOne)
  337. this.tableList = []
  338. this.tableList = new_arr
  339. }
  340. console.log("keyworde23232322332323232233232",this.$route.query.keyword)
  341. if(this.$route.query.keyword!=""){
  342. var new_arr = []
  343. for(let i=0;i<this.tableList.length;i++){
  344. if(this.tableList[i].is_total!=1){
  345. if(this.tableList[i].name.indexOf(this.$route.query.keyword) >-1){
  346. new_arr.push(this.tableList[i])
  347. }
  348. }
  349. }
  350. var obj ={index:"合计",is_total:1,total:0}
  351. obj.total = this.getTotalPriceTwo(new_arr)
  352. new_arr.push(obj)
  353. this.tableList = []
  354. this.tableList = new_arr
  355. }
  356. })
  357. },
  358. getAdviceName(id){
  359. var drug_name = ""
  360. for(let i= 0;i<this.tableData.length;i++){
  361. if(id == this.tableData[i].advice_id){
  362. drug_name = this.tableData[i].advice.advice_name
  363. }
  364. }
  365. return drug_name
  366. },
  367. getProjectName(id){
  368. var project_name = ""
  369. for(let i=0;i<this.tableData.length;i++){
  370. if(id == this.tableData[i].project_id){
  371. project_name = this.tableData[i].project.project.project_name
  372. }
  373. }
  374. return project_name
  375. },
  376. setNewData(details) {
  377. let drug_ids = []
  378. let project_ids = []
  379. for (let i = 0; i < details.length; i++) {
  380. if (details[i].advice && details[i].advice.id > 0 && details[i].advice.prescription && details[i].advice.prescription.type == 1) { //药品
  381. let obj = {
  382. id: details[i].advice.drug_id,
  383. price: details[i].advice.price,
  384. record_date:details[i].advice.advice_date
  385. }
  386. drug_ids.push(obj)
  387. } else if (details[i].project && details[i].project.id > 0 && details[i].project.prescription && details[i].project.prescription.type == 2) { //项目
  388. let obj = {
  389. id: details[i].project.project_id,
  390. price: details[i].project.price,
  391. record_date:details[i].advice.record_date
  392. }
  393. project_ids.push(obj)
  394. }
  395. }
  396. let new_drug_ids = this.unique(drug_ids)
  397. let new_project_ids = this.unique(project_ids)
  398. let list = []
  399. if (new_drug_ids.length > 0 && new_project_ids.length == 0) {
  400. for (let i = 0; i < new_drug_ids.length; i++) {
  401. let obj = {}
  402. let count = 0
  403. for (let a = 0; a < details.length; a++) {
  404. if (new_drug_ids[i].id == details[a].advice.drug_id && new_drug_ids[i].price == details[a].advice.price) {
  405. obj['name'] = details[a].advice.advice_name
  406. 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
  407. obj['unit'] = details[a].advice.drug.min_unit
  408. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  409. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  410. obj['price'] = parseFloat(details[a].pric)
  411. obj['is_total'] = 2
  412. obj['record_date'] = details[a].advice.record_date
  413. obj['chrgitm_lv'] = details[a].chrgitm_lv
  414. count = count + details[a].cnt
  415. }
  416. }
  417. obj['count'] = count
  418. list.push(obj)
  419. }
  420. }
  421. if (new_drug_ids.length == 0 && new_project_ids.length > 0) {
  422. for (let i = 0; i < new_project_ids.length; i++) {
  423. let obj = {}
  424. let count = 0
  425. for (let a = 0; a < details.length; a++) {
  426. if (new_project_ids[i].id == details[a].project.project_id && new_project_ids[i].price == details[a].project.price) {
  427. if( details[a].project.type == 2){
  428. obj['name'] = details[a].project.project.project_name
  429. obj['spec'] = details[a].project.project.project_name
  430. obj['unit'] = details[a].project.project.unit
  431. obj['record_date'] = details[a].project.record_date
  432. }else if(details[a].project.type == 3){
  433. obj['name'] = details[a].project.good_info.good_name
  434. obj['spec'] = details[a].project.good_info.specification_name
  435. obj['unit'] = details[a].project.good_info.packing_unit
  436. obj['record_date'] = details[a].project.record_date
  437. }
  438. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  439. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  440. obj['price'] = parseFloat(details[a].pric)
  441. obj['is_total'] = 2
  442. obj['chrgitm_lv'] = details[a].chrgitm_lv
  443. count = count + details[a].cnt
  444. }
  445. }
  446. obj['count'] = count
  447. list.push(obj)
  448. }
  449. }
  450. if (new_drug_ids.length > 0 && new_project_ids.length > 0) {
  451. for (let i = 0; i < new_drug_ids.length; i++) {
  452. let obj = {}
  453. let count = 0
  454. for (let a = 0; a < details.length; a++) {
  455. if (new_drug_ids[i].id == details[a].advice.drug_id && new_drug_ids[i].price == details[a].advice.price) {
  456. obj['name'] = details[a].advice.advice_name
  457. 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
  458. obj['unit'] = details[a].advice.drug.min_unit
  459. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  460. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  461. obj['price'] = parseFloat(details[a].pric)
  462. obj['is_total'] = 2
  463. obj['record_date'] = details[a].advice.record_date
  464. obj['chrgitm_lv'] = details[a].chrgitm_lv
  465. count = count + details[a].cnt
  466. }
  467. }
  468. obj['count'] = count
  469. list.push(obj)
  470. }
  471. for (let i = 0; i < new_project_ids.length; i++) {
  472. let obj = {}
  473. let count = 0
  474. for (let a = 0; a < details.length; a++) {
  475. if (new_project_ids[i].id == details[a].project.project_id && new_project_ids[i].price == details[a].project.price) {
  476. if( details[a].project.type == 2){
  477. obj['name'] = details[a].project.project.project_name
  478. obj['spec'] = ''
  479. obj['unit'] = details[a].project.project.unit
  480. }else if(details[a].project.type == 3){
  481. obj['name'] = details[a].project.good_info.good_name
  482. obj['spec'] = ''
  483. obj['unit'] = details[a].project.good_info.packing_unit
  484. }
  485. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  486. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  487. obj['price'] = parseFloat(details[a].pric)
  488. obj['is_total'] = 2
  489. obj['record_date'] = details[a].project.record_date
  490. obj['chrgitm_lv'] = details[a].chrgitm_lv
  491. count = count + details[a].cnt
  492. }
  493. }
  494. obj['count'] = count
  495. list.push(obj)
  496. }
  497. }
  498. console.log("list232332322323332233223232323",list)
  499. return list
  500. },
  501. getMedicineInsuranceType(type) {
  502. switch (type) {
  503. case "01":
  504. return '甲类'
  505. break
  506. case "02":
  507. return '乙类'
  508. break
  509. case "03":
  510. return '自费'
  511. break
  512. }
  513. },
  514. getType(med_chrgitm_type){
  515. switch (med_chrgitm_type) {
  516. case '01':
  517. return '床位费'
  518. break
  519. case '02':
  520. return '诊察费'
  521. break
  522. case '03':
  523. return '检查费'
  524. break
  525. case '04':
  526. return '化验费'
  527. break
  528. case '05':
  529. return '治疗费'
  530. break
  531. case '06':
  532. return '手术费'
  533. break
  534. case '07':
  535. return '护理费'
  536. break
  537. case '08':
  538. return '材料费'
  539. break
  540. case '09':
  541. return '西药费'
  542. break
  543. case '10':
  544. return '中药饮片费'
  545. break
  546. case '11':
  547. return '中成药费'
  548. break
  549. case '12':
  550. return '一般诊疗费'
  551. break
  552. case '13':
  553. return '挂号费'
  554. break
  555. case '14':
  556. return '其他费'
  557. break
  558. }
  559. },
  560. unique(array) {
  561. // res用来存储结果
  562. var res = []
  563. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  564. for (var j = 0, resLen = res.length; j < resLen; j++) {
  565. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  566. break
  567. }
  568. }
  569. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  570. if (j === resLen) {
  571. res.push(array[i])
  572. }
  573. }
  574. return res
  575. },
  576. getTotal:function(items){
  577. let total = 0
  578. for(let i = 0; i < items.length; i++){
  579. total = Number(total) + Number((parseFloat(items[i].count) * parseFloat(items[i].price)).toFixed(2))
  580. }
  581. return total.toFixed(2)
  582. },
  583. getTimes(time) {
  584. if(time < 0){
  585. return ""
  586. }else{
  587. return uParseTime(time, '{y}-{m}-{d}')
  588. }
  589. },
  590. getDepartment(id){
  591. var name = ""
  592. for(let i=0;i<this.hisDepatment.length;i++){
  593. if(id == this.hisDepatment[i].id){
  594. name = this.hisDepatment[i].name
  595. }
  596. }
  597. return name
  598. },
  599. getAllPice(){
  600. var total_price = 0
  601. for(let i=0;i<this.list.length;i++){
  602. if(this.list[i].is_total ==2){
  603. total_price += (this.list[i].price * parseInt(this.list[i].count))
  604. }
  605. }
  606. if(total_price > 0){
  607. return total_price.toFixed(2)
  608. }else{
  609. return total_price
  610. }
  611. },
  612. setMonthPrescription(month_prescriptions) {
  613. let drug_month_prescriptions = {
  614. advices: []
  615. }
  616. let drug_ids = []
  617. let project_month_prescriptions = {
  618. project: []
  619. }
  620. let project_ids = []
  621. for (let i = 0; i < month_prescriptions.length; i++) {
  622. if (month_prescriptions[i].type == 1) { //药品
  623. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  624. let obj = {
  625. id: month_prescriptions[i].advices[a].drug_id,
  626. price: month_prescriptions[i].advices[a].price
  627. }
  628. drug_ids.push(obj)
  629. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  630. }
  631. } else if (month_prescriptions[i].type == 2) { //项目
  632. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  633. let obj = {
  634. id: month_prescriptions[i].project[a].project_id,
  635. price: month_prescriptions[i].project[a].price
  636. }
  637. project_ids.push(obj)
  638. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  639. }
  640. }
  641. }
  642. drug_ids = this.unique(drug_ids)
  643. project_ids= this.unique(project_ids)
  644. for (let i = 0; i < drug_ids.length; i++) {
  645. let obj = {}
  646. let count = 0
  647. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  648. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
  649. obj['advice_id'] = drug_month_prescriptions.advices[a].id
  650. obj['name'] = drug_month_prescriptions.advices[a].advice_name
  651. obj['statistical_classification'] = ''
  652. obj['type'] = 1
  653. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  654. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  655. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  656. obj['day'] = drug_month_prescriptions.advices[a].day
  657. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  658. obj['remark'] = drug_month_prescriptions.advices[a].remark
  659. obj['price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  660. obj['record_date'] = drug_month_prescriptions.advices[a].advice_date
  661. obj['spec'] = drug_month_prescriptions.advices[a].drug.dose + drug_month_prescriptions.advices[a].drug.dose_unit +"*" + drug_month_prescriptions.advices[a].drug.min_number + drug_month_prescriptions.advices[a].drug.min_unit + "/" + drug_month_prescriptions.advices[a].drug.max_unit
  662. obj['is_total'] = 2
  663. obj['chrgitm_lv'] = drug_month_prescriptions.advices[a].drug.medical_insurance_level
  664. obj['unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  665. count = count + drug_month_prescriptions.advices[a].prescribing_number
  666. }
  667. }
  668. obj['count'] = count
  669. this.tableList.push(obj)
  670. }
  671. for (let i = 0; i < project_ids.length; i++) {
  672. let obj = {}
  673. let count = 0
  674. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  675. if (project_ids[i].price == project_month_prescriptions.project[a].price &&project_ids[i].id == project_month_prescriptions.project[a].project_id ) {
  676. if(project_month_prescriptions.project[a].type == 2){
  677. obj['project_id'] = project_month_prescriptions.project[a].id
  678. obj['name'] = project_month_prescriptions.project[a].project.project_name
  679. obj['statistical_classification'] = ''
  680. obj['project_type'] = 2
  681. obj['spec'] = project_month_prescriptions.project[a].project.project_name
  682. obj['unit'] = project_month_prescriptions.project[a].unit
  683. obj['chrgitm_lv'] = project_month_prescriptions.project[a].project.medical_coverage
  684. }else if (project_month_prescriptions.project[a].type == 3){
  685. obj['project_id'] = project_month_prescriptions.project[a].id
  686. obj['name'] = project_month_prescriptions.project[a].good_info.good_name
  687. obj['statistical_classification'] = ''
  688. obj['project_type'] = 3
  689. obj['spec'] = project_month_prescriptions.project[a].good_info.specification_name
  690. obj['unit'] = project_month_prescriptions.project[a].good_info.packing_unit
  691. obj['chrgitm_lv'] = project_month_prescriptions.project[a].good_info.medical_insurance_level
  692. }
  693. obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  694. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  695. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  696. obj['day'] = project_month_prescriptions.project[a].day
  697. obj['single_dose_unit'] = project_month_prescriptions.project[a].unit
  698. obj['prescribing_number_unit'] = project_month_prescriptions.project[a].unit
  699. count = count + parseFloat(project_month_prescriptions.project[a].count)
  700. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  701. obj['remark'] = project_month_prescriptions.project[a].remark
  702. obj['type'] = 2
  703. obj['record_date'] = project_month_prescriptions.project[a].record_date
  704. obj['is_total'] = 2
  705. }
  706. }
  707. obj['count'] = count
  708. this.tableList.push(obj)
  709. }
  710. var objOne = {index:"合计",is_total:1,total:0}
  711. objOne.total = this.getTotalPrice(this.tableList)
  712. for(let i=0;i<this.tableList.length;i++){
  713. this.tableList[i].index = i + 1
  714. }
  715. this.tableList.push(objOne)
  716. },
  717. getTotalPrice(val){
  718. var total_price = 0
  719. for(let i=0;i<val.length;i++){
  720. total_price +=val[i].count * val[i].price
  721. }
  722. return total_price.toFixed(2)
  723. },
  724. getTotalPriceTwo(val){
  725. var total_price = 0
  726. for(let i=0;i<val.length;i++){
  727. if(val[i].is_total!=1){
  728. total_price +=val[i].count * val[i].price
  729. }
  730. }
  731. return total_price.toFixed(2)
  732. },
  733. getAdviceMedChrgintmType(name){
  734. var med_chrgitm_type = ""
  735. for(let i=0;i<this.order_info_list.length;i++){
  736. if(name == this.order_info_list[i].advice.advice_name){
  737. med_chrgitm_type = this.order_info_list[i].med_chrgitm_type
  738. }
  739. }
  740. return med_chrgitm_type
  741. },
  742. getProjectMedChrgintmType(project_id){
  743. var med_chrgitm_type = ""
  744. for(let i=0;i<this.order_info_list.length;i++){
  745. if(project_id == this.order_info_list[i].project_id){
  746. med_chrgitm_type = this.order_info_list[i].med_chrgitm_type
  747. }
  748. }
  749. return med_chrgitm_type
  750. },
  751. getChrgitmLv(value){
  752. var name = ""
  753. for(let i=0;i<this.medicalInsuranceLevelList.length;i++){
  754. if(value == this.medicalInsuranceLevelList[i].value){
  755. name = this.medicalInsuranceLevelList[i].name
  756. }
  757. }
  758. return name
  759. },
  760. getAdviceMedChrgintmLv(advice_id){
  761. var chrgitm_lv = ""
  762. for(let i=0;i<this.order_info_list.length;i++){
  763. if(advice_id == this.order_info_list[i].advice_id){
  764. chrgitm_lv = this.order_info_list[i].chrgitm_lv
  765. }
  766. }
  767. return chrgitm_lv
  768. },
  769. getProjectMedChrgintmLv(advice_id){
  770. var chrgitm_lv = ""
  771. for(let i=0;i<this.order_info_list.length;i++){
  772. if(advice_id == this.order_info_list[i].advice_id){
  773. chrgitm_lv = this.order_info_list[i].chrgitm_lv
  774. }
  775. }
  776. return chrgitm_lv
  777. },
  778. getWesternMedicineCostTotal(){
  779. var total_price = 0
  780. for(let i=0;i<this.tableList.length;i++){
  781. if(this.tableList[i].advice_id > 0){
  782. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].name)
  783. }
  784. if(this.tableList[i].project_id > 0){
  785. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  786. }
  787. if(this.tableList[i].drug_type == "西药费"){
  788. total_price += this.tableList[i].count * this.tableList[i].price
  789. }
  790. }
  791. return total_price.toFixed(2)
  792. },
  793. getChineseTraditionalMedicineCostTotal(){
  794. var total_price = 0
  795. for(let i=0;i<this.tableList.length;i++){
  796. if(this.tableList[i].advice_id > 0){
  797. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  798. }
  799. if(this.tableList[i].project_id > 0){
  800. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  801. }
  802. if(this.tableList[i].drug_type == "中成药费"){
  803. total_price += this.tableList[i].count * this.tableList[i].price
  804. }
  805. }
  806. return total_price.toFixed(2)
  807. },
  808. getChineseTotal(){
  809. var total_price = 0
  810. for(let i=0;i<this.tableList.length;i++){
  811. if(this.tableList[i].advice_id > 0){
  812. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  813. }
  814. if(this.tableList[i].project_id > 0){
  815. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  816. }
  817. if(this.tableList[i].drug_type == "中草药"){
  818. total_price += this.tableList[i].count * this.tableList[i].price
  819. }
  820. }
  821. return total_price.toFixed(2)
  822. },
  823. getCheckCostTotal(){
  824. var total_price = 0
  825. for(let i=0;i<this.tableList.length;i++){
  826. if(this.tableList[i].advice_id > 0){
  827. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  828. }
  829. if(this.tableList.project_id > 0){
  830. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  831. }
  832. if(this.tableList[i].drug_type == "检查费"){
  833. total_price += this.tableList[i].count * this.tableList[i].price
  834. }
  835. }
  836. return total_price.toFixed(2)
  837. },
  838. getOxygen(){
  839. var total_price = 0
  840. for(let i=0;i<this.tableList.length;i++){
  841. if(this.tableList[i].advice_id > 0){
  842. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  843. }
  844. if(this.tableList[i].project_id > 0){
  845. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  846. }
  847. if(this.tableList[i].drug_type == "输氧费"){
  848. total_price += this.tableList[i].count * this.tableList[i].price
  849. }
  850. }
  851. return total_price.toFixed(2)
  852. },
  853. getOperation(){
  854. var total_price = 0
  855. for(let i=0;i<this.tableList.length;i++){
  856. if(this.tableList[i].advice_id > 0){
  857. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  858. }
  859. if(this.tableList.project_id > 0){
  860. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  861. }
  862. if(this.tableList[i].drug_type == "手术费"){
  863. total_price += this.tableList[i].count * this.tableList[i].price
  864. }
  865. }
  866. return total_price.toFixed(2)
  867. },
  868. getLaboratoryCostTotal(){
  869. var total_price = 0
  870. for(let i=0;i<this.tableList.length;i++){
  871. if(this.tableList[i].advice_id > 0){
  872. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  873. }
  874. if(this.tableList[i].project_id > 0){
  875. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  876. }
  877. if(this.tableList[i].drug_type == "化验费"){
  878. total_price += this.tableList[i].count * this.tableList[i].price
  879. }
  880. }
  881. return total_price.toFixed(2)
  882. },
  883. getBlood(){
  884. var total_price = 0
  885. for(let i=0;i<this.tableList.length;i++){
  886. if(this.tableList[i].advice_id > 0){
  887. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  888. }
  889. if(this.tableList[i].project_id > 0){
  890. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  891. }
  892. if(this.tableList[i].drug_type == "输血费"){
  893. total_price += this.tableList[i].count * this.tableList[i].price
  894. }
  895. }
  896. return total_price.toFixed(2)
  897. },
  898. getZhenChaCostTotal(){
  899. var total_price = 0
  900. for(let i=0;i<this.tableList.length;i++){
  901. if(this.tableList[i].advice_id > 0){
  902. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  903. }
  904. if(this.tableList[i].project_id > 0){
  905. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  906. }
  907. if(this.tableList[i].drug_type == "诊察费"){
  908. total_price += this.tableList[i].count * this.tableList[i].price
  909. }
  910. }
  911. return total_price.toFixed(2)
  912. },
  913. getTreatement(){
  914. var total_price = 0
  915. for(let i=0;i<this.tableList.length;i++){
  916. if(this.tableList[i].advice_id > 0){
  917. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  918. }
  919. if(this.tableList[i].project_id > 0){
  920. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  921. }
  922. if(this.tableList[i].drug_type == "治疗费"){
  923. total_price += this.tableList[i].count * this.tableList[i].price
  924. }
  925. }
  926. return total_price.toFixed(2)
  927. },
  928. getNursing(){
  929. var total_price = 0
  930. for(let i=0;i<this.tableList.length;i++){
  931. if(this.tableList[i].advice_id > 0){
  932. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  933. }
  934. if(this.tableList[i].project_id > 0){
  935. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  936. }
  937. if(this.tableList[i].drug_type == "护理费"){
  938. total_price += this.tableList[i].count * this.tableList[i].price
  939. }
  940. }
  941. return total_price.toFixed(2)
  942. },
  943. getBedCostTotal(){
  944. var total_price = 0
  945. for(let i=0;i<this.tableList.length;i++){
  946. if(this.tableList[i].advice_id > 0){
  947. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  948. }
  949. if(this.tableList[i].project_id > 0){
  950. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  951. }
  952. if(this.tableList[i].drug_type == "床位费"){
  953. total_price += this.tableList[i].count * this.tableList[i].price
  954. }
  955. }
  956. return total_price.toFixed(2)
  957. },
  958. getAnesthesia(){
  959. var total_price = 0
  960. for(let i=0;i<this.tableList.length;i++){
  961. if(this.tableList[i].advice_id > 0){
  962. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  963. }
  964. if(this.tableList[i].project_id > 0){
  965. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  966. }
  967. if(this.tableList[i].drug_type == "麻醉费"){
  968. total_price += this.tableList[i].count * this.tableList[i].price
  969. }
  970. }
  971. return total_price.toFixed(2)
  972. },
  973. getMaterialCostTotal(){
  974. var total_price = 0
  975. for(let i=0;i<this.tableList.length;i++){
  976. if(this.tableList[i].advice_id > 0){
  977. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  978. }
  979. if(this.tableList[i].project_id > 0){
  980. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  981. }
  982. if(this.tableList[i].drug_type == "材料费"){
  983. total_price += this.tableList[i].count * this.tableList[i].price
  984. }
  985. }
  986. return total_price.toFixed(2)
  987. },
  988. getOtherCostTotal(){
  989. var total_price = 0
  990. for(let i=0;i<this.tableList.length;i++){
  991. if(this.tableList[i].advice_id > 0){
  992. this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
  993. }
  994. if(this.tableList[i].project_id > 0){
  995. this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
  996. }
  997. if(this.tableList[i].drug_type == "其他费"){
  998. total_price += this.tableList[i].count * this.tableList[i].price
  999. }
  1000. }
  1001. return total_price.toFixed(2)
  1002. },
  1003. getBedName(id){
  1004. var bed_number = ""
  1005. for(let i=0;i<this.bedNumber.length;i++){
  1006. if(id == this.bedNumber[i].id){
  1007. bed_number = this.bedNumber[i].number
  1008. }
  1009. }
  1010. return bed_number
  1011. }
  1012. },
  1013. created(){
  1014. this.getGatherDetailList()
  1015. }
  1016. }
  1017. </script>
  1018. <style lang="scss" scoped>
  1019. .list-print{
  1020. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
  1021. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  1022. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  1023. margin-bottom: 20px;
  1024. padding:20px 10px;
  1025. }
  1026. .listTitle{
  1027. font-size: 24px;
  1028. text-align: center;
  1029. font-weight: bold;
  1030. margin-bottom: 10px;
  1031. }
  1032. .listInfo{
  1033. display: flex;
  1034. font-size: 16px;
  1035. justify-content: space-between;
  1036. margin: 10px 0;
  1037. div{
  1038. width: 200px;
  1039. }
  1040. }
  1041. .listTable{
  1042. width: 100%;
  1043. text-align: center;
  1044. border-collapse: collapse;
  1045. line-height: 40px;
  1046. font-size: 14px;
  1047. border-color: #000;
  1048. text-align: left;
  1049. }
  1050. .listTable tr td {
  1051. padding: 0 5px;
  1052. }
  1053. .tableBottom{
  1054. font-size: 16px;
  1055. display: flex;
  1056. margin-top: 20px;
  1057. }
  1058. .tableBottomOne{
  1059. margin-right: 40px;
  1060. }
  1061. .print_btn {
  1062. display: flex;
  1063. justify-content: flex-end;
  1064. }
  1065. </style>