listPrint.vue 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <div>
  3. <template>
  4. <el-button
  5. style="position:fixed;right:25px;z-index:999"
  6. :loading="loading"
  7. size="small"
  8. icon="el-icon-printer"
  9. @click="printThisPage"
  10. type="primary"
  11. >打印
  12. </el-button
  13. >
  14. </template>
  15. <div class='dialysisPage' style="padding-top:40px;">
  16. <printOne :list="list" :patient="patient" :order="order" :admin="admin"></printOne>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. import printOne from './listTemplate/printOne'
  22. import { getHisOrderDetail } from '@/api/his/his'
  23. import { uParseTime } from '@/utils/tools'
  24. export default {
  25. name: 'listPrint',
  26. components: {
  27. printOne
  28. },
  29. props: {
  30. paramsObj: Object
  31. },
  32. data() {
  33. return {
  34. list: [],
  35. patient:{},
  36. order:{},
  37. admin:{},
  38. }
  39. },
  40. created() {
  41. this.getInfo(this.paramsObj.id)
  42. },
  43. methods: {
  44. getTimes(time) {
  45. return uParseTime(time, '{y}-{m}-{d} {h}:{i}')
  46. },
  47. getInfo(order_id) {
  48. let params = {
  49. id: order_id
  50. }
  51. getHisOrderDetail(params).then(response => {
  52. if (response.data.state == 0) {
  53. this.$message.error(response.data.msg)
  54. return false
  55. } else {
  56. this.order = response.data.data.order
  57. this.patient = response.data.data.patient
  58. console.log(this.patient)
  59. this.admin = response.data.data.admin_info
  60. for (let i = 0; i < response.data.data.order_info.length; i++) {
  61. var infos = response.data.data.order_info[i]
  62. let obj = {
  63. med_chrgitm_type: this.getType(infos.med_chrgitm_type),
  64. price: infos.pric,
  65. count: infos.cnt
  66. }
  67. console.log(infos)
  68. if (infos.advice && infos.advice.id == 0 && infos.project && infos.project.id > 0) {
  69. obj['p_time'] = this.getTimes(infos.project.prescription.ctime)
  70. if(infos.project.type == 2){
  71. obj['name'] = infos.project.project.project_name
  72. }else if (infos.project.type == 3){
  73. obj['name'] = infos.project.good_info.good_name
  74. }
  75. obj['spec'] = 1
  76. obj['unit'] = infos.project.unit
  77. }
  78. if (infos.advice && infos.advice.id > 0 && infos.project && infos.project.id == 0) {
  79. obj['p_time'] = this.getTimes(infos.advice.prescription.ctime)
  80. obj['name'] = infos.advice.advice_name
  81. obj['spec'] = infos.advice.drug.drug_spec
  82. obj['unit'] = infos.advice.drug.max_unit
  83. }
  84. this.list.push(obj)
  85. this.list.sort(function(a, b) {
  86. return b.p_time < a.p_time ? 1 : -1
  87. })
  88. }
  89. }
  90. })
  91. },
  92. getType(med_chrgitm_type) {
  93. switch (med_chrgitm_type) {
  94. case '01':
  95. return '床位费';
  96. break;
  97. case '02':
  98. return '诊察费';
  99. break;
  100. case '03':
  101. return '检查费';
  102. break;
  103. case '04':
  104. return '化验费';
  105. break;
  106. case '05':
  107. return '治疗费';
  108. break;
  109. case '06':
  110. return '手术费';
  111. break;
  112. case '07':
  113. return '护理费';
  114. break;
  115. case '08':
  116. return '材料费';
  117. break;
  118. case '09':
  119. return '西药费';
  120. break;
  121. case '10':
  122. return '中药饮片费';
  123. break;
  124. case '11':
  125. return '中成药费';
  126. break;
  127. case '12':
  128. return '一般诊疗费';
  129. break;
  130. case '13':
  131. return '挂号费';
  132. break;
  133. case '14':
  134. return '其他费';
  135. break
  136. }
  137. },
  138. printThisPage() {
  139. const style =
  140. '@media print {.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: 40px;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;}}';
  141. printJS({
  142. printable: 'list-print',
  143. type: 'html',
  144. style: style,
  145. scanStyles: false
  146. })
  147. // if (this.org_template_info.template_id == 1) {
  148. // printJS({
  149. // printable: "dialysis-print-box",
  150. // type: "html",
  151. // style: style,
  152. // scanStyles: false
  153. // });
  154. // }
  155. }
  156. }
  157. }
  158. </script>
  159. <style>
  160. .dialysis-print-order {
  161. width: 960px;
  162. margin: 0 auto;
  163. }
  164. .dialysis-print-order .order-yy-name {
  165. margin: auto;
  166. text-align: center;
  167. font-size: 20px;
  168. letter-spacing: 5px;
  169. }
  170. .dialysis-print-order .order-title {
  171. margin: auto;
  172. font-weight: 600;
  173. text-align: center;
  174. font-size: 22px;
  175. padding: 10px;
  176. }
  177. .dialysis-print-order .table-box {
  178. width: 100%;
  179. line-height: 23px;
  180. font-size: 14px;
  181. }
  182. .dialysis-print-order .print-table {
  183. width: 100%;
  184. text-align: center;
  185. border-collapse: collapse;
  186. line-height: 40px;
  187. font-size: 14px;
  188. border-color: #000;
  189. }
  190. .dialysis-print-order .print-table-no {
  191. width: 100%;
  192. text-align: center;
  193. border-collapse: collapse;
  194. font-size: 14px;
  195. }
  196. .dialysis-print-order .under-line {
  197. border-bottom: 1px solid #999;
  198. width: 95%;
  199. text-align: center;
  200. margin-left: 2px;
  201. }
  202. .dialysis-print-order .title-box {
  203. text-align: center;
  204. font-size: 16px;
  205. }
  206. .dialysis-print-order .radio-lebel-box {
  207. font-weight: 400;
  208. cursor: pointer;
  209. }
  210. .dialysis-print-order .radio-no {
  211. opacity: 0;
  212. outline: none;
  213. position: absolute;
  214. margin: 0;
  215. width: 0;
  216. height: 0;
  217. z-index: -1;
  218. }
  219. .dialysis-print-order .radio-inner {
  220. white-space: nowrap;
  221. cursor: pointer;
  222. outline: none;
  223. display: inline-block;
  224. line-height: 1;
  225. position: relative;
  226. vertical-align: middle;
  227. }
  228. .dialysis-print-order .radio-fang {
  229. display: inline-block;
  230. position: relative;
  231. border: 1px solid #000;
  232. box-sizing: border-box;
  233. width: 14px;
  234. height: 14px;
  235. background-color: #fff;
  236. z-index: 1;
  237. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  238. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  239. }
  240. .dialysis-print-order .is-checked-radio::after {
  241. content: "√";
  242. font-size: 15px;
  243. }
  244. .dialysis-print-order .print-table-no tr td {
  245. padding: 8px 5px;
  246. line-height: 25px;
  247. }
  248. .dialysis-print-order .print-table tr td {
  249. padding: 1px 1px;
  250. /*line-height: 25px;*/
  251. }
  252. .es-img {
  253. height: 30px;
  254. }
  255. .advice-name {
  256. text-align: left;
  257. }
  258. .advice-children {
  259. display: flex;
  260. }
  261. .title-box-pro {
  262. border: 0 #fff;
  263. line-height: 25px;
  264. height: 25px;
  265. text-align: left;
  266. padding-left: 10px !important;
  267. }
  268. .title-box-pro-tr {
  269. border: 0 #fff;
  270. }
  271. .text-align-left {
  272. text-align: left !important;
  273. padding-left: 10px !important;
  274. font-size: 14px !important;
  275. line-height: 25px;
  276. }
  277. .print-table-tr-new td {
  278. line-height: 20px !important;
  279. }
  280. .border-top-solid {
  281. border: solid 1px #000;
  282. }
  283. .print-template-two tr {
  284. line-height: 30px;
  285. }
  286. .table-box1 {
  287. border: 1px solid #000;
  288. width: 100%;
  289. line-height: 30px;
  290. font-size: 14px;
  291. border-collapse: collapse;
  292. }
  293. .table-box1 tr {
  294. border-bottom: 1px solid #000;
  295. }
  296. </style>
  297. <style lang="scss">
  298. .newContainer {
  299. .dialysisPage::-webkit-scrollbar {
  300. height: 15px;
  301. }
  302. .el-date-editor {
  303. .el-input__inner {
  304. padding-right: 0px;
  305. }
  306. }
  307. .el-table td, .el-table th {
  308. text-align: center;
  309. }
  310. }
  311. .newContainer::-webkit-scrollbar {
  312. height: 15px !important;
  313. }
  314. </style>