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

allListPrint.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. <template>
  2. <div>
  3. <template>
  4. <el-button
  5. style="position:fixed;right:25px;z-index:999"
  6. size="small"
  7. icon="el-icon-printer"
  8. @click="printThisPage"
  9. type="primary"
  10. >打印
  11. </el-button
  12. >
  13. </template>
  14. <div class='dialysisPage' style="padding-top:40px;">
  15. <printOne v-if="org_id != 10215 && org_id != 0 && org_id !=9671&&org_id !=9675" :list="list" :patient="patient" :order="order" :admin="admin" :hospital="his_hospital"></printOne>
  16. <summary-print v-if="org_id == 10215|| org_id == 0 || org_id ==9671 ||org_id ==9675" :list="list" :patient="patient" :order="order" :admin="admin" :hospital="his_hospital"></summary-print>
  17. <!-- <list-print-two :list="list" :patient="patient" :order="order" :admin="admin" :hospital="his_hospital"></list-print-two>-->
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import { getHisOrderDetailCollect } from '@/api/his/his'
  23. import { uParseTime } from '@/utils/tools'
  24. import printOne from './allListTemplate/printOne'
  25. import ListPrintTwo from './listTemplate/listPrintTwo'
  26. import SummaryPrint from './allListTemplate/summaryPrint'
  27. export default {
  28. name: 'allListPrint',
  29. components: {
  30. SummaryPrint,
  31. ListPrintTwo,
  32. printOne
  33. },
  34. props: {
  35. paramsObj: Object
  36. },
  37. data() {
  38. return {
  39. list: [],
  40. patient: {},
  41. order: {},
  42. admin: {},
  43. his_hospital:{},
  44. org_id:0,
  45. }
  46. },
  47. created() {
  48. this.getInfo(this.paramsObj.id)
  49. this.org_id = this.$store.getters.xt_user.org_id
  50. },
  51. methods: {
  52. getTimes(time) {
  53. return uParseTime(time, '{y}-{m}-{d} {h}:{i}')
  54. }, getInfo(order_id) {
  55. let params = {
  56. id: order_id
  57. }
  58. getHisOrderDetailCollect(params).then(response => {
  59. if (response.data.state == 0) {
  60. this.$message.error(response.data.msg)
  61. return false
  62. } else {
  63. this.order = response.data.data.order
  64. this.order['bedCostTotal'] = response.data.data.bedCostTotal
  65. this.order['operationCostTotal'] = response.data.data.operationCostTotal
  66. this.order['otherCostTotal'] = response.data.data.otherCostTotal
  67. this.order['materialCostTotal'] = response.data.data.materialCostTotal
  68. this.order['westernMedicineCostTotal'] = response.data.data.westernMedicineCostTotal
  69. this.order['chineseTraditionalMedicineCostTotal'] = response.data.data.chineseTraditionalMedicineCostTotal
  70. this.order['checkCostTotal'] = response.data.data.checkCostTotal
  71. this.order['zhenChaCostTotal'] = response.data.data.zhenChaCostTotal
  72. this.order['laboratoryCostTotal'] = response.data.data.laboratoryCostTotal
  73. this.order['treatCostTotal'] = response.data.data.treatCostTotal
  74. console.log("~~~~~")
  75. this.patient = response.data.data.patient
  76. this.admin = response.data.data.admin_info
  77. this.his_hospital = response.data.data.his_hospital
  78. var order_info = response.data.data.order_info
  79. if(this.$store.getters.xt_user.org_id == 10215 || this.$store.getters.xt_user.org_id == 0){
  80. //获取所有项目类型进行去重
  81. let med_chrgitm_types = []
  82. for (let i = 0; i < order_info.length; i++) {
  83. med_chrgitm_types.push(order_info[i].med_chrgitm_type)
  84. }
  85. const obj = {}
  86. med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
  87. obj[next] ? '' : obj[next] = true && cur.push(next)
  88. return cur
  89. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  90. let tempOrderInfo = []
  91. for (let i = 0; i < med_chrgitm_types.length; i++) {
  92. let obj = {
  93. total: 0,
  94. details: [],
  95. is_total:0,
  96. }
  97. let tempDetails = []
  98. for (let b = 0; b < order_info.length; b++) {
  99. if (med_chrgitm_types[i] == order_info[b].med_chrgitm_type) {
  100. tempDetails.push(order_info[b])
  101. }
  102. }
  103. console.log("~~~~~~~~")
  104. console.log(tempDetails)
  105. console.log("1111="+tempDetails)
  106. obj.details = this.setNewData(tempDetails)
  107. console.log("22222="+obj.details)
  108. this.list = this.list.concat(obj.details)
  109. console.log("222233332="+ this.list)
  110. }
  111. let newobj = {}
  112. newobj['total'] = this.order.medfee_sumamt
  113. newobj['is_total'] = 1
  114. this.list.push(newobj)
  115. }else{
  116. //获取所有项目类型进行去重
  117. let med_chrgitm_types = []
  118. for (let i = 0; i < order_info.length; i++) {
  119. med_chrgitm_types.push(order_info[i].med_chrgitm_type)
  120. }
  121. const obj = {}
  122. med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
  123. obj[next] ? '' : obj[next] = true && cur.push(next)
  124. return cur
  125. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  126. let tempOrderInfo = []
  127. for (let i = 0; i < med_chrgitm_types.length; i++) {
  128. let obj = {
  129. total: 0,
  130. details: []
  131. }
  132. let tempDetails = []
  133. for (let b = 0; b < order_info.length; b++) {
  134. if (med_chrgitm_types[i] == order_info[b].med_chrgitm_type) {
  135. tempDetails.push(order_info[b])
  136. }
  137. }
  138. obj.details = this.setNewData(tempDetails)
  139. obj.total = this.getTotal(obj.details)
  140. obj.details.push({
  141. total: obj.total,
  142. is_total: 1,
  143. })
  144. console.log("23323223323232332323322332",obj.details)
  145. this.list = this.list.concat(obj.details)
  146. }
  147. }
  148. }
  149. })
  150. }, getTotal:function(items){
  151. let total = 0
  152. for(let i = 0; i < items.length; i++){
  153. total = Number(total) + Number((parseFloat(items[i].count) * parseFloat(items[i].price)).toFixed(2))
  154. }
  155. return total.toFixed(2)
  156. },setNewData(details) {
  157. let drug_ids = []
  158. let project_ids = []
  159. for (let i = 0; i < details.length; i++) {
  160. if (details[i].advice && details[i].advice.id > 0 && details[i].advice.prescription && details[i].advice.prescription.type == 1) { //药品
  161. let obj = {
  162. id: details[i].advice.drug_id,
  163. price: details[i].advice.price
  164. }
  165. drug_ids.push(obj)
  166. } else if (details[i].project && details[i].project.id > 0 && details[i].project.prescription && details[i].project.prescription.type == 2) { //项目
  167. let obj = {
  168. id: details[i].project.project_id,
  169. price: details[i].project.price
  170. }
  171. project_ids.push(obj)
  172. }
  173. }
  174. //
  175. // console.log('old ids')
  176. // console.log(drug_ids)
  177. // console.log(project_ids)
  178. // console.log('old ids')
  179. let new_drug_ids = this.unique(drug_ids)
  180. let new_project_ids = this.unique(project_ids)
  181. let list = []
  182. // console.log('ids')
  183. // console.log(new_drug_ids)
  184. // console.log(new_project_ids)
  185. // console.log('ids')
  186. if (new_drug_ids.length > 0 && new_project_ids.length == 0) {
  187. for (let i = 0; i < new_drug_ids.length; i++) {
  188. let obj = {}
  189. let count = 0
  190. for (let a = 0; a < details.length; a++) {
  191. if (new_drug_ids[i].id == details[a].advice.drug_id && new_drug_ids[i].price == details[a].advice.price) {
  192. obj['name'] = details[a].advice.advice_name
  193. // obj['spec'] = details[a].advice.drug.drug_spec
  194. 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
  195. obj['unit'] = details[a].advice.drug.min_unit
  196. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  197. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  198. obj['price'] = parseFloat(details[a].pric)
  199. obj['is_total'] = 2
  200. count = count + details[a].cnt
  201. }
  202. }
  203. obj['count'] = count
  204. list.push(obj)
  205. }
  206. }
  207. if (new_drug_ids.length == 0 && new_project_ids.length > 0) {
  208. for (let i = 0; i < new_project_ids.length; i++) {
  209. let obj = {}
  210. let count = 0
  211. for (let a = 0; a < details.length; a++) {
  212. if (new_project_ids[i].id == details[a].project.project_id && new_project_ids[i].price == details[a].project.price) {
  213. if( details[a].project.type == 2){
  214. obj['name'] = details[a].project.project.project_name
  215. obj['spec'] = ''
  216. obj['unit'] = details[a].project.project.unit
  217. }else if(details[a].project.type == 3){
  218. obj['name'] = details[a].project.good_info.good_name
  219. obj['spec'] = ''
  220. obj['unit'] = details[a].project.good_info.packing_unit
  221. }
  222. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  223. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  224. obj['price'] = parseFloat(details[a].pric)
  225. obj['is_total'] = 2
  226. count = count + details[a].cnt
  227. }
  228. }
  229. obj['count'] = count
  230. list.push(obj)
  231. }
  232. }
  233. return list
  234. }, getGoodUnit(id) {
  235. var goodUnit = this.$store.getters.good_unit
  236. for (let i = 0; i < goodUnit.length; i++) {
  237. if (goodUnit[i].id == id) {
  238. return goodUnit[i].name
  239. }
  240. }
  241. },
  242. unique(array) {
  243. // res用来存储结果
  244. var res = []
  245. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  246. for (var j = 0, resLen = res.length; j < resLen; j++) {
  247. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  248. break
  249. }
  250. }
  251. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  252. if (j === resLen) {
  253. res.push(array[i])
  254. }
  255. }
  256. return res
  257. },
  258. getType(med_chrgitm_type){
  259. switch (med_chrgitm_type) {
  260. case '01':
  261. return '床位费'
  262. break
  263. case '02':
  264. return '诊察费'
  265. break
  266. case '03':
  267. return '检查费'
  268. break
  269. case '04':
  270. return '化验费'
  271. break
  272. case '05':
  273. return '治疗费'
  274. break
  275. case '06':
  276. return '手术费'
  277. break
  278. case '07':
  279. return '护理费'
  280. break
  281. case '08':
  282. return '材料费'
  283. break
  284. case '09':
  285. return '西药费'
  286. break
  287. case '10':
  288. return '中药饮片费'
  289. break
  290. case '11':
  291. return '中成药费'
  292. break
  293. case '12':
  294. return '一般诊疗费'
  295. break
  296. case '13':
  297. return '挂号费'
  298. break
  299. case '14':
  300. return '其他费'
  301. break
  302. }
  303. },
  304. getMedicineInsuranceType(type) {
  305. switch (type) {
  306. case "01":
  307. return '甲类'
  308. break
  309. case "02":
  310. return '乙类'
  311. break
  312. case "03":
  313. return '自费'
  314. break
  315. }
  316. },
  317. printThisPage() {
  318. const style =
  319. '@media print {.allListTitle{font-size: 24px;text-align: center;font-weight: bold;margin-bottom: 10px;}.allListInfo{display: flex;font-size: 16px;justify-content: space-between;margin: 10px 0;} .allListTable{width: 100%;text-align: center;border-collapse: collapse;line-height: 20px;font-size: 14px;border-color: #000;text-align:left;}.allListTable tr td {padding: 0 5px;}.tableBottom{font-size: 16px;display: flex;margin-top: 20px;}.tableBottomOne{margin-right: 40px;}}'
  320. const style1 =
  321. '@media print {.allListTitle{font-size: 24px;text-align: center;font-weight: bold;margin-bottom: 10px;}.allListInfo{display: flex;font-size: 16px;justify-content: space-between;margin: 10px 0;} .allListTable{width: 100%;text-align: center;border-collapse: collapse;line-height: 20px;font-size: 14px;border-color: #000;text-align:left;} .allListTable tr td {padding: 0 5px;} .allListTable .allListTable_1{border: none;width: 100%;text-align: center;border-collapse: collapse;line-height: 20px;font-size: 14px;border-color: #000;text-align:left;} .allListTable_1 tr{page-break-inside:avoid;} .allListTable_1 tr td {padding: 0 5px;border: 1px solid #000;} .tableBottom{font-size: 16px;display: flex;margin-top: 20px;}.tableBottomOne{margin-right: 40px;}}'
  322. if(this.org_id == 10215 || this.org_id == 0 ||this.org_id == 9675){
  323. printJS({
  324. printable: 'allList-print',
  325. type: 'html',
  326. style: style1,
  327. scanStyles: false
  328. })
  329. }else{
  330. printJS({
  331. printable: 'allList-print',
  332. type: 'html',
  333. style: style,
  334. scanStyles: false
  335. })
  336. }
  337. // if (this.org_template_info.template_id == 1) {
  338. // printJS({
  339. // printable: "dialysis-print-box",
  340. // type: "html",
  341. // style: style,
  342. // scanStyles: false
  343. // });
  344. // }
  345. }
  346. }
  347. }
  348. </script>
  349. <style>
  350. .dialysis-print-order {
  351. width: 960px;
  352. margin: 0 auto;
  353. }
  354. .dialysis-print-order .order-yy-name {
  355. margin: auto;
  356. text-align: center;
  357. font-size: 20px;
  358. letter-spacing: 5px;
  359. }
  360. .dialysis-print-order .order-title {
  361. margin: auto;
  362. font-weight: 600;
  363. text-align: center;
  364. font-size: 22px;
  365. padding: 10px;
  366. }
  367. .dialysis-print-order .table-box {
  368. width: 100%;
  369. line-height: 23px;
  370. font-size: 14px;
  371. }
  372. .dialysis-print-order .print-table {
  373. width: 100%;
  374. text-align: center;
  375. border-collapse: collapse;
  376. line-height: 40px;
  377. font-size: 14px;
  378. border-color: #000;
  379. }
  380. .dialysis-print-order .print-table-no {
  381. width: 100%;
  382. text-align: center;
  383. border-collapse: collapse;
  384. font-size: 14px;
  385. }
  386. .dialysis-print-order .under-line {
  387. border-bottom: 1px solid #999;
  388. width: 95%;
  389. text-align: center;
  390. margin-left: 2px;
  391. }
  392. .dialysis-print-order .title-box {
  393. text-align: center;
  394. font-size: 16px;
  395. }
  396. .dialysis-print-order .radio-lebel-box {
  397. font-weight: 400;
  398. cursor: pointer;
  399. }
  400. .dialysis-print-order .radio-no {
  401. opacity: 0;
  402. outline: none;
  403. position: absolute;
  404. margin: 0;
  405. width: 0;
  406. height: 0;
  407. z-index: -1;
  408. }
  409. .dialysis-print-order .radio-inner {
  410. white-space: nowrap;
  411. cursor: pointer;
  412. outline: none;
  413. display: inline-block;
  414. line-height: 1;
  415. position: relative;
  416. vertical-align: middle;
  417. }
  418. .dialysis-print-order .radio-fang {
  419. display: inline-block;
  420. position: relative;
  421. border: 1px solid #000;
  422. box-sizing: border-box;
  423. width: 14px;
  424. height: 14px;
  425. background-color: #fff;
  426. z-index: 1;
  427. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  428. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  429. }
  430. .dialysis-print-order .is-checked-radio::after {
  431. content: "√";
  432. font-size: 15px;
  433. }
  434. .dialysis-print-order .print-table-no tr td {
  435. padding: 8px 5px;
  436. line-height: 25px;
  437. }
  438. .dialysis-print-order .print-table tr td {
  439. padding: 1px 1px;
  440. /*line-height: 25px;*/
  441. }
  442. .es-img {
  443. height: 30px;
  444. }
  445. .advice-name {
  446. text-align: left;
  447. }
  448. .advice-children {
  449. display: flex;
  450. }
  451. .title-box-pro {
  452. border: 0 #fff;
  453. line-height: 25px;
  454. height: 25px;
  455. text-align: left;
  456. padding-left: 10px !important;
  457. }
  458. .title-box-pro-tr {
  459. border: 0 #fff;
  460. }
  461. .text-align-left {
  462. text-align: left !important;
  463. padding-left: 10px !important;
  464. font-size: 14px !important;
  465. line-height: 25px;
  466. }
  467. .print-table-tr-new td {
  468. line-height: 20px !important;
  469. }
  470. .border-top-solid {
  471. border: solid 1px #000;
  472. }
  473. .print-template-two tr {
  474. line-height: 30px;
  475. }
  476. .table-box1 {
  477. border: 1px solid #000;
  478. width: 100%;
  479. line-height: 30px;
  480. font-size: 14px;
  481. border-collapse: collapse;
  482. }
  483. .table-box1 tr {
  484. border-bottom: 1px solid #000;
  485. }
  486. </style>
  487. <style lang="scss">
  488. .newContainer {
  489. .dialysisPage::-webkit-scrollbar {
  490. height: 15px;
  491. }
  492. .el-date-editor {
  493. .el-input__inner {
  494. padding-right: 0px;
  495. }
  496. }
  497. .el-table td, .el-table th {
  498. text-align: center;
  499. }
  500. }
  501. .newContainer::-webkit-scrollbar {
  502. height: 15px !important;
  503. }
  504. </style>