gatherPrint.vue 42KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195
  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>科别:
  13. <span v-if="org_id!=10215"> {{getDepartment(his_patient.departments)}}</span>
  14. {{getDepartment(his_record_patient.departments)}}
  15. </div>
  16. <div>床号:<span v-if="schedule.length > 0">{{getBedName(schedule[0].bed_id)}}</span></div>
  17. <div>门诊号:
  18. <span v-if="org_id!=10215">{{his_patient.number}}</span>
  19. {{his_record_patient.ipt_otp_no}}
  20. </div>
  21. <div>姓名:{{patient.name}}</div>
  22. </div>
  23. <div class="listInfo" style="border-bottom: 2px solid;margin-bottom: 20px;padding-bottom: 20px;">
  24. <div>预交款:</div>
  25. <div>总费用:{{getAllPice()}}</div>
  26. <div>门诊日期:{{this.$route.query.end_time}}</div>
  27. </div>
  28. <div class="listInfo">
  29. <div>西药:{{getWesternMedicineCostTotal()}}</div>
  30. <div>中成药:{{getChineseTraditionalMedicineCostTotal()}}</div>
  31. <div>中草药:{{getChineseTotal()}}</div>
  32. </div>
  33. <div class="listInfo">
  34. <div>检查费:{{getCheckCostTotal()}}</div>
  35. <div>输氧费:{{getOxygen()}}</div>
  36. <div>手术费:{{getOperation()}}</div>
  37. </div>
  38. <div class="listInfo">
  39. <div>化验费:{{getLaboratoryCostTotal()}}</div>
  40. <div>输血费:{{getBlood()}}</div>
  41. <div>诊断费:{{getZhenChaCostTotal()}}</div>
  42. </div>
  43. <div class="listInfo">
  44. <div>治疗费:{{getTreatement()}}</div>
  45. <div>护理费:{{getNursing()}}</div>
  46. <div>床位费:{{getBedCostTotal()}}</div>
  47. </div>
  48. <div class="listInfo" style="margin-bottom: 10px;">
  49. <div>麻醉费:{{getAnesthesia()}}</div>
  50. <div>材料费:{{getMaterialCostTotal()}}</div>
  51. <div>其他:{{getOtherCostTotal()}}</div>
  52. </div>
  53. <div class="listInfo" style="margin-bottom: 20px;">
  54. <div>记账支付:{{getFundPaySumamt()}}</div>
  55. <div>个人账号:{{getAcctPay()}}</div>
  56. <div>现金支付:{{getActPay()}}</div>
  57. </div>
  58. <table class="listTable" border="1">
  59. <tr>
  60. <td style="text-align:center" >序号</td>
  61. <td style="text-align:center" >费用分类</td>
  62. <td style="text-align:center">项目名称</td>
  63. <td style="text-align:center">规格</td>
  64. <td style="text-align:center">单价</td>
  65. <td style="text-align:center" >数量</td>
  66. <td style="text-align:center">金额</td>
  67. <td style="text-align:center" >医保类别</td>
  68. </tr>
  69. <tr v-for="(item, index) in tableList" :key="index">
  70. <td style="text-align:center" >
  71. <span v-if="item.is_total == 2">{{index+1}}</span>
  72. <span v-if="item.is_total == 1">合计</span>
  73. </td>
  74. <td style="text-align:center" >
  75. <span v-if="item.type == 1">
  76. {{item.cost_type}}
  77. </span>
  78. <span v-if="item.type == 2">
  79. {{item.cost_type}}
  80. </span>
  81. <span v-if="item.type == 3">
  82. 材料费
  83. </span>
  84. </td>
  85. <td style="text-align:center" >
  86. <span>{{item.name}}</span>
  87. </td>
  88. <td style="text-align:center" >
  89. {{ item.spec }}
  90. </td>
  91. <td style="text-align:center" >
  92. {{item.pric}}
  93. </td>
  94. <td style="text-align:center" >
  95. {{item.count_number }}{{item.unit }}
  96. </td>
  97. <td style="text-align:center" >
  98. <span v-if="item.is_total == 1">{{ item.total }}</span>
  99. <span v-if="item.is_total == 2">{{ (item.pric * item.count_number).toFixed(2) }}</span>
  100. </td>
  101. <td style="text-align:center" >
  102. {{getChrgitmLv(item.medical_insurance_level)}}
  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. order_info_list:[],
  137. balanceAccountsType:0,
  138. medicalInsuranceLevelList:[],
  139. drugTypeList:[],
  140. costClassifyList:[],
  141. id:0,
  142. start_time:"",
  143. end_time:"",
  144. his_record_patient:{},
  145. orderList:[],
  146. org_id:0,
  147. list:[],
  148. }
  149. },
  150. methods:{
  151. printtpage() {
  152. const style =
  153. '@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;} .listInfo div{width:400px;} .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;}';
  154. printJS({
  155. printable: "list-print",
  156. type: "html",
  157. style: style,
  158. scanStyles: false,
  159. });
  160. },
  161. getNowTime: function () {
  162. let dateTime;
  163. let yy = new Date().getFullYear();
  164. let mm = new Date().getMonth() + 1;
  165. let dd = new Date().getDate();
  166. let hh = new Date().getHours();
  167. let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes()
  168. :
  169. new Date().getMinutes();
  170. let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds()
  171. :
  172. new Date().getSeconds();
  173. dateTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss;
  174. return dateTime
  175. },
  176. getTimes(time) {
  177. return uParseTime(time, '{y}-{m}-{d}')
  178. },
  179. getGatherDetailList() {
  180. let start_time = this.$route.query.start_time
  181. let end_time = this.$route.query.end_time
  182. let params = {
  183. patient_id:this.$route.query.patient_id,
  184. start_time: start_time,
  185. end_time: end_time,
  186. type: this.$route.query.type,
  187. keyword: this.$route.query.keyword
  188. }
  189. getGatherDetailList(params).then(response=>{
  190. if (response.data.state == 0) {
  191. this.$message.error(response.data.msg)
  192. return false
  193. } else {
  194. this.drugTypeList =response.data.data.drugTypeList
  195. this.costClassifyList = response.data.data.costClassifyList
  196. var list = response.data.data.list
  197. this.list = list
  198. this.orderList = response.data.data.orderList
  199. console.log("orderlist23323223",this.orderList)
  200. var new_arr = []
  201. for(let i=0;i<list.length;i++){
  202. for(let j=0;j<list[i].orders.length;j++){
  203. new_arr.push(list[i].orders[j])
  204. }
  205. }
  206. var order_info = []
  207. for(let i=0;i<new_arr.length;i++){
  208. for(let j=0;j<new_arr[i].order_info.length;j++){
  209. order_info.push(new_arr[i].order_info[j])
  210. }
  211. }
  212. for(let i=0;i<order_info.length;i++){
  213. if(order_info[i].advice_id > 0){
  214. order_info[i].item_id = order_info[i].advice.drug.id +"_" + order_info[i].pric
  215. }
  216. if(order_info[i].project_id > 0){
  217. if(order_info[i].project.type == 2){
  218. order_info[i].item_id = order_info[i].project.project.id + "_"+order_info[i].pric
  219. }
  220. if(order_info[i].project.type == 3){
  221. order_info[i].item_id = order_info[i].project.good_info.id + "_"+order_info[i].pric
  222. }
  223. }
  224. }
  225. //合并,相同的合并在一起
  226. let dataInfo = {}
  227. order_info.forEach((item, index) => {
  228. let { item_id } = item
  229. if (!dataInfo[item_id]) {
  230. dataInfo[item_id] = {
  231. item_id,
  232. child: [],
  233. count_number:0,
  234. record_date:"",
  235. cost_type:"",
  236. name:"",
  237. pric:item.pric,
  238. chrgitm_lv:"",
  239. advice_id:item.advice_id,
  240. project_id:item.project_id,
  241. type:0,
  242. spec:"",
  243. unit:"",
  244. medical_insurance_level:"",
  245. cost_type:"",
  246. is_total:2,
  247. }
  248. }
  249. dataInfo[item_id].child.push(item)
  250. })
  251. let arr = Object.values(dataInfo)
  252. for(let i=0;i<arr.length;i++){
  253. for(let j=0;j<arr[i].child.length;j++){
  254. if(arr[i].advice_id >0){
  255. arr[i].record_date = arr[i].child[0].advice.advice_date
  256. arr[i].type = 1
  257. arr[i].name = arr[i].child[0].advice.advice_name
  258. arr[i].spec = arr[i].child[0].advice.drug.dose + arr[i].child[0].advice.drug.dose_unit + "*"+arr[i].child[0].advice.drug.min_number + arr[i].child[0].advice.drug.min_unit+"/"+arr[i].child[0].advice.drug.max_unit
  259. arr[i].unit = arr[i].child[0].advice.prescribing_number_unit
  260. arr[i].cost_type = arr[i].child[0].advice.drug.drug_type
  261. arr[i].medical_insurance_level = arr[i].child[0].advice.drug.medical_insurance_level
  262. }
  263. if(arr[i].project_id > 0){
  264. arr[i].record_date = arr[i].child[0].project.record_date
  265. arr[i].type = arr[i].child[0].project.type
  266. if(arr[i].child[0].project.type == 2){
  267. arr[i].name = arr[i].child[0].project.project.project_name
  268. arr[i].spec = arr[i].child[0].project.project.project_name
  269. arr[i].unit = arr[i].child[0].project.project.unit
  270. arr[i].medical_insurance_level = arr[i].child[0].project.project.medical_coverage
  271. arr[i].cost_type = arr[i].child[0].project.project.cost_classify
  272. }
  273. if(arr[i].child[0].project.type == 3){
  274. arr[i].name = arr[i].child[0].project.good_info.good_name
  275. arr[i].spec = arr[i].child[0].project.good_info.specification_name
  276. arr[i].unit = arr[i].child[0].project.good_info.packing_unit
  277. arr[i].medical_insurance_level = arr[i].child[0].project.good_info.medical_insurance_level
  278. arr[i].cost_type = "材料费"
  279. }
  280. }
  281. arr[i].count_number +=arr[i].child[j].cnt
  282. }
  283. }
  284. var obj = {is_total:1,total:0}
  285. obj.total = this.getAllPiceTwo(arr)
  286. for(let i=0;i<arr.length;i++){
  287. if(arr[i].advice_id >0){
  288. arr[i].cost_type = this.getDrugType(arr[i].cost_type)
  289. }
  290. if(arr[i].type ==2){
  291. arr[i].cost_type = this.getCostType(arr[i].cost_type)
  292. }
  293. }
  294. arr.push(obj)
  295. this.tableList = arr
  296. this.patient = response.data.data.patient
  297. this.his_patient = response.data.data.his_patient
  298. this.hisDepatment = response.data.data.hisDepatment
  299. this.order = response.data.data.order
  300. this.his_record_patient = response.data.data.his_record_patient
  301. this.medicalInsuranceLevelList = response.data.data.medicalInsuranceLevelList
  302. this.schedule = response.data.data.schedule
  303. this.bedNumber = response.data.data.bedNumber
  304. if(this.$route.query.keyword !=""){
  305. var new_arr = []
  306. for(let i=0;i<this.tableList.length;i++){
  307. if(this.tableList[i].is_total!=1){
  308. if(this.tableList[i].name.indexOf(this.$route.query.keyword) >-1){
  309. new_arr.push(this.tableList[i])
  310. }
  311. }
  312. }
  313. var obj ={index:"合计",is_total:1,total:0}
  314. obj.total = this.getAllPiceTwo(new_arr)
  315. new_arr.push(obj)
  316. this.tableList = []
  317. this.tableList = new_arr
  318. }
  319. if(this.$route.query.id == 1){
  320. var new_arr = []
  321. for(let i=0;i<this.tableList.length;i++){
  322. if(this.tableList[i].is_total!=1){
  323. if(this.tableList[i].type == 1){
  324. new_arr.push(this.tableList[i])
  325. }
  326. }
  327. }
  328. this.tableList = []
  329. this.tableList = new_arr
  330. }
  331. if(this.$route.query.id == 2){
  332. var new_arr = []
  333. for(let i=0;i<this.tableList.length;i++){
  334. if(this.tableList[i].is_total!=1){
  335. if(this.tableList[i].type == 2){
  336. new_arr.push(this.tableList[i])
  337. }
  338. }
  339. }
  340. this.tableList = []
  341. this.tableList = new_arr
  342. }
  343. if(this.$route.query.id == 3){
  344. var new_arr = []
  345. for(let i=0;i<this.tableList.length;i++){
  346. if(this.tableList[i].is_total!=1){
  347. if(this.tableList[i].type == 3){
  348. new_arr.push(this.tableList[i])
  349. }
  350. }
  351. }
  352. this.tableList = []
  353. this.tableList = new_arr
  354. }
  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. return list
  499. },
  500. getMedicineInsuranceType(type) {
  501. switch (type) {
  502. case "01":
  503. return '甲类'
  504. break
  505. case "02":
  506. return '乙类'
  507. break
  508. case "03":
  509. return '自费'
  510. break
  511. }
  512. },
  513. getType(med_chrgitm_type){
  514. switch (med_chrgitm_type) {
  515. case '01':
  516. return '床位费'
  517. break
  518. case '02':
  519. return '诊察费'
  520. break
  521. case '03':
  522. return '检查费'
  523. break
  524. case '04':
  525. return '化验费'
  526. break
  527. case '05':
  528. return '治疗费'
  529. break
  530. case '06':
  531. return '手术费'
  532. break
  533. case '07':
  534. return '护理费'
  535. break
  536. case '08':
  537. return '材料费'
  538. break
  539. case '09':
  540. return '西药费'
  541. break
  542. case '10':
  543. return '中药饮片费'
  544. break
  545. case '11':
  546. return '中成药费'
  547. break
  548. case '12':
  549. return '一般诊疗费'
  550. break
  551. case '13':
  552. return '挂号费'
  553. break
  554. case '14':
  555. return '其他费'
  556. break
  557. }
  558. },
  559. unique(array) {
  560. // res用来存储结果
  561. var res = []
  562. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  563. for (var j = 0, resLen = res.length; j < resLen; j++) {
  564. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  565. break
  566. }
  567. }
  568. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  569. if (j === resLen) {
  570. res.push(array[i])
  571. }
  572. }
  573. return res
  574. },
  575. getTotal:function(items){
  576. let total = 0
  577. for(let i = 0; i < items.length; i++){
  578. total = Number(total) + Number((parseFloat(items[i].count) * parseFloat(items[i].price)).toFixed(2))
  579. }
  580. return total.toFixed(2)
  581. },
  582. getTimes(time) {
  583. if(time < 0){
  584. return ""
  585. }else{
  586. return uParseTime(time, '{y}-{m}-{d}')
  587. }
  588. },
  589. getDepartment(id){
  590. var name = ""
  591. for(let i=0;i<this.hisDepatment.length;i++){
  592. if(id == this.hisDepatment[i].id){
  593. name = this.hisDepatment[i].name
  594. }
  595. }
  596. return name
  597. },
  598. getAllPice(){
  599. var total_price = 0
  600. for(let i=0;i<this.tableList.length;i++){
  601. if(this.tableList[i].is_total ==2){
  602. total_price += (this.tableList[i].pric * parseInt(this.tableList[i].count_number))
  603. }
  604. }
  605. if(total_price > 0){
  606. return total_price.toFixed(2)
  607. }else{
  608. return "0.00"
  609. }
  610. },
  611. getAllPiceTwo(arr){
  612. var total_price = 0
  613. for(let i=0;i<arr.length;i++){
  614. if(arr[i].is_total ==2){
  615. total_price += (arr[i].pric * parseInt(arr[i].count_number))
  616. }
  617. }
  618. if(total_price > 0){
  619. return total_price.toFixed(2)
  620. }else{
  621. return total_price
  622. }
  623. },
  624. setMonthPrescription(month_prescriptions) {
  625. let drug_month_prescriptions = {
  626. advices: []
  627. }
  628. let drug_ids = []
  629. let project_month_prescriptions = {
  630. project: []
  631. }
  632. let project_ids = []
  633. for (let i = 0; i < month_prescriptions.length; i++) {
  634. if (month_prescriptions[i].type == 1) { //药品
  635. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  636. let obj = {
  637. id: month_prescriptions[i].advices[a].drug_id,
  638. price: month_prescriptions[i].advices[a].price
  639. }
  640. drug_ids.push(obj)
  641. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  642. }
  643. } else if (month_prescriptions[i].type == 2) { //项目
  644. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  645. let obj = {
  646. id: month_prescriptions[i].project[a].project_id,
  647. price: month_prescriptions[i].project[a].price
  648. }
  649. project_ids.push(obj)
  650. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  651. }
  652. }
  653. }
  654. drug_ids = this.unique(drug_ids)
  655. project_ids= this.unique(project_ids)
  656. for (let i = 0; i < drug_ids.length; i++) {
  657. let obj = {}
  658. let count = 0
  659. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  660. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
  661. obj['advice_id'] = drug_month_prescriptions.advices[a].id
  662. obj['name'] = drug_month_prescriptions.advices[a].advice_name
  663. obj['statistical_classification'] = ''
  664. obj['type'] = 1
  665. obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
  666. obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
  667. obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
  668. obj['day'] = drug_month_prescriptions.advices[a].day
  669. obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  670. obj['remark'] = drug_month_prescriptions.advices[a].remark
  671. obj['price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  672. obj['record_date'] = drug_month_prescriptions.advices[a].advice_date
  673. 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
  674. obj['is_total'] = 2
  675. obj['chrgitm_lv'] = drug_month_prescriptions.advices[a].drug.medical_insurance_level
  676. obj['unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
  677. count = count + drug_month_prescriptions.advices[a].prescribing_number
  678. }
  679. }
  680. obj['count'] = count
  681. this.tableList.push(obj)
  682. }
  683. for (let i = 0; i < project_ids.length; i++) {
  684. let obj = {}
  685. let count = 0
  686. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  687. if (project_ids[i].price == project_month_prescriptions.project[a].price &&project_ids[i].id == project_month_prescriptions.project[a].project_id ) {
  688. if(project_month_prescriptions.project[a].type == 2){
  689. obj['project_id'] = project_month_prescriptions.project[a].id
  690. obj['name'] = project_month_prescriptions.project[a].project.project_name
  691. obj['statistical_classification'] = ''
  692. obj['project_type'] = 2
  693. obj['spec'] = project_month_prescriptions.project[a].project.project_name
  694. obj['unit'] = project_month_prescriptions.project[a].unit
  695. obj['chrgitm_lv'] = project_month_prescriptions.project[a].project.medical_coverage
  696. }else if (project_month_prescriptions.project[a].type == 3){
  697. obj['project_id'] = project_month_prescriptions.project[a].id
  698. obj['name'] = project_month_prescriptions.project[a].good_info.good_name
  699. obj['statistical_classification'] = ''
  700. obj['project_type'] = 3
  701. obj['spec'] = project_month_prescriptions.project[a].good_info.specification_name
  702. obj['unit'] = project_month_prescriptions.project[a].good_info.packing_unit
  703. obj['chrgitm_lv'] = project_month_prescriptions.project[a].good_info.medical_insurance_level
  704. }
  705. obj['single_dose'] = project_month_prescriptions.project[a].single_dose
  706. obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
  707. obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
  708. obj['day'] = project_month_prescriptions.project[a].day
  709. obj['single_dose_unit'] = project_month_prescriptions.project[a].unit
  710. obj['prescribing_number_unit'] = project_month_prescriptions.project[a].unit
  711. count = count + parseFloat(project_month_prescriptions.project[a].count)
  712. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  713. obj['remark'] = project_month_prescriptions.project[a].remark
  714. obj['type'] = 2
  715. obj['record_date'] = project_month_prescriptions.project[a].record_date
  716. obj['is_total'] = 2
  717. }
  718. }
  719. obj['count'] = count
  720. this.tableList.push(obj)
  721. }
  722. var objOne = {index:"合计",is_total:1,total:0}
  723. objOne.total = this.getTotalPrice(this.tableList)
  724. for(let i=0;i<this.tableList.length;i++){
  725. this.tableList[i].index = i + 1
  726. }
  727. this.tableList.push(objOne)
  728. },
  729. getTotalPrice(val){
  730. var total_price = 0
  731. for(let i=0;i<val.length;i++){
  732. total_price +=val[i].count * val[i].price
  733. }
  734. return total_price.toFixed(2)
  735. },
  736. getTotalPriceTwo(val){
  737. var total_price = 0
  738. for(let i=0;i<val.length;i++){
  739. if(val[i].is_total!=1){
  740. total_price +=val[i].count * val[i].price
  741. }
  742. }
  743. return total_price.toFixed(2)
  744. },
  745. getAdviceMedChrgintmType(name){
  746. var med_chrgitm_type = ""
  747. for(let i=0;i<this.order_info_list.length;i++){
  748. if(name == this.order_info_list[i].advice.advice_name){
  749. med_chrgitm_type = this.order_info_list[i].med_chrgitm_type
  750. }
  751. }
  752. return med_chrgitm_type
  753. },
  754. getProjectMedChrgintmType(project_id){
  755. var med_chrgitm_type = ""
  756. for(let i=0;i<this.order_info_list.length;i++){
  757. if(project_id == this.order_info_list[i].project_id){
  758. med_chrgitm_type = this.order_info_list[i].med_chrgitm_type
  759. }
  760. }
  761. return med_chrgitm_type
  762. },
  763. getChrgitmLv(value){
  764. var name = ""
  765. for(let i=0;i<this.medicalInsuranceLevelList.length;i++){
  766. if(value == this.medicalInsuranceLevelList[i].value){
  767. name = this.medicalInsuranceLevelList[i].name
  768. }
  769. }
  770. return name
  771. },
  772. getAdviceMedChrgintmLv(advice_id){
  773. var chrgitm_lv = ""
  774. for(let i=0;i<this.order_info_list.length;i++){
  775. if(advice_id == this.order_info_list[i].advice_id){
  776. chrgitm_lv = this.order_info_list[i].chrgitm_lv
  777. }
  778. }
  779. return chrgitm_lv
  780. },
  781. getProjectMedChrgintmLv(advice_id){
  782. var chrgitm_lv = ""
  783. for(let i=0;i<this.order_info_list.length;i++){
  784. if(advice_id == this.order_info_list[i].advice_id){
  785. chrgitm_lv = this.order_info_list[i].chrgitm_lv
  786. }
  787. }
  788. return chrgitm_lv
  789. },
  790. getAdviceMedChrgintmType(name){
  791. var med_chrgitm_type = ""
  792. for(let i=0;i<this.order_info_list.length;i++){
  793. if(name == this.order_info_list[i].advice.advice_name){
  794. med_chrgitm_type = this.order_info_list[i].med_chrgitm_type
  795. }
  796. }
  797. return med_chrgitm_type
  798. },
  799. getProjectMedChrgintmType(project_id){
  800. var med_chrgitm_type = ""
  801. for(let i=0;i<this.order_info_list.length;i++){
  802. if(project_id == this.order_info_list[i].project_id){
  803. med_chrgitm_type = this.order_info_list[i].med_chrgitm_type
  804. }
  805. }
  806. return med_chrgitm_type
  807. },
  808. getChrgitmLv(value){
  809. var name = ""
  810. for(let i=0;i<this.medicalInsuranceLevelList.length;i++){
  811. if(value == this.medicalInsuranceLevelList[i].value){
  812. name = this.medicalInsuranceLevelList[i].name
  813. }
  814. }
  815. return name
  816. },
  817. getAdviceMedChrgintmLv(advice_id){
  818. var chrgitm_lv = ""
  819. for(let i=0;i<this.order_info_list.length;i++){
  820. if(advice_id == this.order_info_list[i].advice_id){
  821. chrgitm_lv = this.order_info_list[i].chrgitm_lv
  822. }
  823. }
  824. return chrgitm_lv
  825. },
  826. getProjectMedChrgintmLv(advice_id){
  827. var chrgitm_lv = ""
  828. for(let i=0;i<this.order_info_list.length;i++){
  829. if(advice_id == this.order_info_list[i].advice_id){
  830. chrgitm_lv = this.order_info_list[i].chrgitm_lv
  831. }
  832. }
  833. return chrgitm_lv
  834. },
  835. getWesternMedicineCostTotal(){
  836. var total_price = 0
  837. for(let i=0;i<this.tableList.length;i++){
  838. if(this.tableList[i].cost_type == "西药"){
  839. total_price += this.tableList[i].count_number * this.tableList[i].pric
  840. }
  841. }
  842. return total_price.toFixed(2)
  843. },
  844. getChineseTraditionalMedicineCostTotal(){
  845. var total_price = 0
  846. for(let i=0;i<this.tableList.length;i++){
  847. if(this.tableList[i].cost_type == "中成药"){
  848. total_price += this.tableList[i].count_number * this.tableList[i].pric
  849. }
  850. }
  851. return total_price.toFixed(2)
  852. },
  853. getChineseTotal(){
  854. var total_price = 0
  855. for(let i=0;i<this.tableList.length;i++){
  856. if(this.tableList[i].cost_type == "中草药"){
  857. total_price += this.tableList[i].count_number * this.tableList[i].pric
  858. }
  859. }
  860. return total_price.toFixed(2)
  861. },
  862. getCheckCostTotal(){
  863. var total_price = 0
  864. for(let i=0;i<this.tableList.length;i++){
  865. if(this.tableList[i].cost_type == "检验费"){
  866. total_price += this.tableList[i].count_number * this.tableList[i].pric
  867. }
  868. }
  869. return total_price.toFixed(2)
  870. },
  871. getOxygen(){
  872. var total_price = 0
  873. for(let i=0;i<this.tableList.length;i++){
  874. if(this.tableList[i].cost_type == "输氧费"){
  875. total_price += this.tableList[i].count_number * this.tableList[i].pric
  876. }
  877. }
  878. return total_price.toFixed(2)
  879. },
  880. getOperation(){
  881. var total_price = 0
  882. for(let i=0;i<this.tableList.length;i++){
  883. if(this.tableList[i].cost_type == "手术费"){
  884. total_price += this.tableList[i].count_number * this.tableList[i].pric
  885. }
  886. }
  887. return total_price.toFixed(2)
  888. },
  889. getLaboratoryCostTotal(){
  890. var total_price = 0
  891. for(let i=0;i<this.tableList.length;i++){
  892. if(this.tableList[i].cost_type == "化验费"){
  893. total_price += this.tableList[i].count_number * this.tableList[i].pric
  894. }
  895. }
  896. return total_price.toFixed(2)
  897. },
  898. getBlood(){
  899. var total_price = 0
  900. for(let i=0;i<this.tableList.length;i++){
  901. if(this.tableList[i].cost_type == "输血费"){
  902. total_price += this.tableList[i].count_number * this.tableList[i].pric
  903. }
  904. }
  905. return total_price.toFixed(2)
  906. },
  907. getZhenChaCostTotal(){
  908. var total_price = 0
  909. for(let i=0;i<this.tableList.length;i++){
  910. if(this.tableList[i].cost_type == "诊断费"){
  911. total_price += this.tableList[i].count_number * this.tableList[i].pric
  912. }
  913. }
  914. return total_price.toFixed(2)
  915. },
  916. getTreatement(){
  917. var total_price = 0
  918. for(let i=0;i<this.tableList.length;i++){
  919. if(this.tableList[i].cost_type == "治疗费"){
  920. total_price += this.tableList[i].count_number * this.tableList[i].pric
  921. }
  922. }
  923. return total_price.toFixed(2)
  924. },
  925. getNursing(){
  926. var total_price = 0
  927. for(let i=0;i<this.tableList.length;i++){
  928. if(this.tableList[i].cost_type == "护理费"){
  929. total_price += this.tableList[i].count_number * this.tableList[i].pric
  930. }
  931. }
  932. return total_price.toFixed(2)
  933. },
  934. getBedCostTotal(){
  935. var total_price = 0
  936. for(let i=0;i<this.tableList.length;i++){
  937. if(this.tableList[i].cost_type == "床位费"){
  938. total_price += this.tableList[i].count_number * this.tableList[i].pric
  939. }
  940. }
  941. return total_price.toFixed(2)
  942. },
  943. getAnesthesia(){
  944. var total_price = 0
  945. for(let i=0;i<this.tableList.length;i++){
  946. if(this.tableList[i].cost_type == "麻醉费"){
  947. total_price += this.tableList[i].count_number * this.tableList[i].pric
  948. }
  949. }
  950. return total_price.toFixed(2)
  951. },
  952. getMaterialCostTotal(){
  953. var total_price = 0
  954. for(let i=0;i<this.tableList.length;i++){
  955. if(this.tableList[i].cost_type == "材料费"){
  956. total_price += this.tableList[i].count_number * this.tableList[i].pric
  957. }
  958. }
  959. return total_price.toFixed(2)
  960. },
  961. getOtherCostTotal(){
  962. var total_price = 0
  963. for(let i=0;i<this.tableList.length;i++){
  964. if(this.tableList[i].cost_type == "其他"){
  965. total_price += this.tableList[i].count_number * this.tableList[i].pric
  966. }
  967. }
  968. return total_price.toFixed(2)
  969. },
  970. getDrugType(id){
  971. var name = ""
  972. for(let i=0;i<this.drugTypeList.length;i++){
  973. if(id == this.drugTypeList[i].value){
  974. name = this.drugTypeList[i].name
  975. }
  976. }
  977. return name
  978. },
  979. getCostType(id){
  980. var name = ""
  981. for(let i=0;i<this.costClassifyList.length;i++){
  982. if(id == this.costClassifyList[i].value){
  983. name = this.costClassifyList[i].name
  984. }
  985. }
  986. return name
  987. },
  988. getBedName(id){
  989. var number = ""
  990. for(let i=0;i<this.bedNumber.length;i++){
  991. if(id == this.bedNumber[i].id){
  992. number = this.bedNumber[i].number
  993. }
  994. }
  995. return number
  996. },
  997. getTotalCountPrice(){
  998. var total_price = 0
  999. for(let i=0;i<this.tableList.length;i++){
  1000. if(this.tableList[i].is_total == 2){
  1001. total_price += this.tableList[i].pric * this.tableList[i].count_number
  1002. }
  1003. }
  1004. if(total_price > 0){
  1005. return total_price.toFixed(2)
  1006. }else{
  1007. return ""
  1008. }
  1009. },
  1010. getPsnCashPay(){
  1011. var psn_cash_pay = 0.00
  1012. for(let i=0;i<this.orderList.length;i++){
  1013. psn_cash_pay += this.orderList[i].psn_cash_pay
  1014. }
  1015. if(psn_cash_pay > 0){
  1016. return psn_cash_pay.toFixed(2)
  1017. }else{
  1018. return "0.00"
  1019. }
  1020. },
  1021. getAcctPay(){
  1022. var acct_pay = 0.00
  1023. for(let i=0;i<this.orderList.length;i++){
  1024. acct_pay +=this.orderList[i].acct_pay
  1025. }
  1026. if(acct_pay > 0){
  1027. return acct_pay.toFixed(2)
  1028. }else{
  1029. return "0.00"
  1030. }
  1031. },
  1032. getFundPaySumamt(){
  1033. var fund_pay_sumamt = 0.00
  1034. for(let i=0;i<this.orderList.length;i++){
  1035. fund_pay_sumamt +=this.orderList[i].fund_pay_sumamt
  1036. }
  1037. if(fund_pay_sumamt >0){
  1038. return fund_pay_sumamt.toFixed(2)
  1039. }else{
  1040. return "0.00"
  1041. }
  1042. },
  1043. getActPay() {
  1044. var act_pay = 0;
  1045. for (let i = 0; i < this.list.length; i++) {
  1046. for (let j = 0; j < this.list[i].orders.length; j++) {
  1047. if(this.list[i].orders[j].is_medicine_insurance == 1){
  1048. act_pay = act_pay + this.list[i].orders[j].psn_cash_pay
  1049. }else{
  1050. act_pay= act_pay + this.list[i].orders[j].medfee_sumamt
  1051. }
  1052. }
  1053. }
  1054. return act_pay.toFixed(2);
  1055. },
  1056. },
  1057. created(){
  1058. this.org_id = this.$store.getters.xt_user.org.id;
  1059. this.getGatherDetailList()
  1060. }
  1061. }
  1062. </script>
  1063. <style lang="scss" scoped>
  1064. .list-print{
  1065. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
  1066. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  1067. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  1068. margin-bottom: 20px;
  1069. padding:20px 10px;
  1070. }
  1071. .listTitle{
  1072. font-size: 24px;
  1073. text-align: center;
  1074. font-weight: bold;
  1075. margin-bottom: 10px;
  1076. }
  1077. .listInfo{
  1078. display: flex;
  1079. font-size: 16px;
  1080. justify-content: space-between;
  1081. margin: 10px 0;
  1082. div{
  1083. width: 400px;
  1084. }
  1085. }
  1086. .listTable{
  1087. width: 100%;
  1088. text-align: center;
  1089. border-collapse: collapse;
  1090. line-height: 40px;
  1091. font-size: 14px;
  1092. border-color: #000;
  1093. text-align: left;
  1094. }
  1095. .listTable tr td {
  1096. padding: 0 5px;
  1097. }
  1098. .tableBottom{
  1099. font-size: 16px;
  1100. display: flex;
  1101. margin-top: 20px;
  1102. }
  1103. .tableBottomOne{
  1104. margin-right: 40px;
  1105. }
  1106. .print_btn {
  1107. display: flex;
  1108. justify-content: flex-end;
  1109. }
  1110. </style>