gatherPrint.vue 40KB

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