gatherPrint.vue 40KB

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