newStatementPrintTwo.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  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. >打印</el-button
  12. >
  13. </template>
  14. <div class='dialysisPage' style="padding-top:40px;">
  15. <!--<printOne :info="info"></printOne>-->
  16. <print-one v-if="org_id != 10138" :info="info"></print-one>
  17. <print-two v-else :info="info" :paramsObj="paramsObj"></print-two>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import { parseTime } from '@/utils'
  23. import { getDialysisRecord } from '@/api/dialysis'
  24. import { getDataConfig } from '@/utils/data'
  25. import { jsGetAge, uParseTime } from '@/utils/tools'
  26. import axios from 'axios'
  27. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  28. import printOne from './newTreatTemplate/printOne'
  29. import printTwo from './newTreatTemplate/printTwo'
  30. export default {
  31. name: "newStatementPrintTwo",
  32. components: {
  33. BreadCrumb,
  34. printOne,
  35. printTwo
  36. },
  37. props:{
  38. paramsObj:Object
  39. },
  40. data() {
  41. return {
  42. crumbs: [
  43. { path: false, name: '门诊医生站' },
  44. { path: false, name: '打印' }
  45. ],
  46. record_date:"",
  47. patientTableData:[],
  48. advicePrint:[],
  49. hisPatient:{},
  50. patient:{},
  51. search_input:"",
  52. loading:false,
  53. patient_id:0,
  54. prescription_id:0,
  55. ids:'',
  56. info:null,
  57. org_id:''
  58. };
  59. },
  60. methods:{
  61. printThisPage() {
  62. var ptime = Math.round(new Date().getTime() / 1000);
  63. this.print_time = uParseTime(ptime, "{y}-{m}-{d} {h}:{i}");
  64. // const style =
  65. // '@media print {.printTitle{font-size: 20px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;font-size:12px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;font-size:12px;}.chargeUl{display:flex;justify-content: space-between;text-align: center;}.chargeUl p{line-height: 1px;}.chargeP{line-height: 1px;padding-bottom:16px;}.moneyBox{display: flex;justify-content: space-between;padding: 0 10px;background: #eeeeee;-webkit-print-color-adjust:exact;-moz-print-color-adjust:exact;-ms-print-color-adjust:exact;print-color-adjust:exact;height: 40px;align-items: center;border:1px solid #000; border-top:none;font-size:12px;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;font-size:12px;}.actionBar div{width:150px;}}';
  66. // printJS({
  67. // printable: "prescription-print",
  68. // type: "html",
  69. // style: style,
  70. // scanStyles: false
  71. // });
  72. if(this.org_id == 10138){
  73. const style =
  74. '@media print {#prescription-print{font-size:12px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}}';
  75. printJS({
  76. printable: "prescription-print",
  77. type: "html",
  78. style: style,
  79. scanStyles: false
  80. });
  81. }else{
  82. const style =
  83. '@media print {.printTitle{font-size: 20px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;font-size:12px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;font-size:12px;}.chargeUl{display:flex;justify-content: space-between;text-align: center;}.chargeUl p{line-height: 1px;}.chargeP{line-height: 1px;padding-bottom:16px;}.moneyBox{display: flex;justify-content: space-between;padding: 0 10px;background: #eeeeee;-webkit-print-color-adjust:exact;-moz-print-color-adjust:exact;-ms-print-color-adjust:exact;print-color-adjust:exact;height: 40px;align-items: center;border:1px solid #000; border-top:none;font-size:12px;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;font-size:12px;}.actionBar div{width:150px;}}';
  84. printJS({
  85. printable: "prescription-print",
  86. type: "html",
  87. style: style,
  88. scanStyles: false
  89. });
  90. }
  91. // if (this.org_template_info.template_id == 1) {
  92. // printJS({
  93. // printable: "dialysis-print-box",
  94. // type: "html",
  95. // style: style,
  96. // scanStyles: false
  97. // });
  98. // }
  99. },
  100. searchAction(){
  101. },
  102. getInfo(obj) {
  103. if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 10138) {
  104. var that = this;
  105. axios.get('http://127.0.0.1:9532/sz/api/settle/query', {
  106. params: obj
  107. })
  108. .then(function (response) {
  109. if (response.data.state == 0) {
  110. this.$message.error(response.data.msg);
  111. return false
  112. } else {
  113. if (response.data.data.failed_code == -10) {
  114. // that.$message.error(response.data.data.msg)
  115. that.$confirm(response.data.data.msg, '医保错误信息', {
  116. confirmButtonText: '确 定',
  117. type: 'warning'
  118. }).then(() => {
  119. }).catch(() => {
  120. })
  121. } else {
  122. console.log("~~~~");
  123. that.info = response.data.data.result;
  124. console.log(that.info);
  125. that.info['patient_info']= response.data.data.patient_info
  126. that.info['dialysis_no'] = response.data.data.dialysis_no
  127. that.info['org_code'] = response.data.data.org_code;
  128. that.info['patient_name'] = response.data.data.patient_name;
  129. that.info['doctor_code'] = response.data.data.doctor_code;
  130. that.info['doctor_name'] = response.data.data.doctor_name;
  131. if(response.data.data.health_card_no_two.length == 0){
  132. that.info['health_card_no'] = response.data.data.health_card_no
  133. }else{
  134. that.info['health_card_no'] = response.data.data.health_card_no_two
  135. }
  136. that.info['order_number'] = response.data.data.order_number;
  137. that.info['department'] = response.data.data.department;
  138. that.info['yiliao_leibie'] = response.data.data.yiliao_leibie;
  139. that.info['before_money'] = response.data.data.before_money;
  140. that.info['after_money'] = response.data.data.after_money;
  141. that.info['org_name'] = that.$store.getters.xt_user.org.org_name;
  142. console.log("~~~~" + that.info);
  143. var name_arr = [];
  144. var spec_arr = [];
  145. var count_arr = [];
  146. var price_arr = [];
  147. var total_arr = [];
  148. for (let i = 0; i < that.info.transBody.outputlist1.length; i++) {
  149. name_arr.push(that.info.transBody.outputlist1[i].ake006);
  150. spec_arr.push(that.info.transBody.outputlist1[i].aka074);
  151. count_arr.push(that.info.transBody.outputlist1[i].akc226);
  152. price_arr.push(that.info.transBody.outputlist1[i].akc225);
  153. total_arr.push(that.info.transBody.outputlist1[i].akc264)
  154. }
  155. console.log("~~~" + that.info);
  156. that.info['name_arr'] = name_arr;
  157. that.info['spec_arr'] = spec_arr;
  158. that.info['count_arr'] = count_arr;
  159. that.info['price_arr'] = price_arr;
  160. that.info['total_arr'] = total_arr;
  161. that.info['record_date'] = obj.record_time;
  162. console.log("~~" + that.info)
  163. let type_arr = []
  164. for (let i = 0; i < that.info.transBody.outputlist1.length; i++) {
  165. type_arr.push(that.info.transBody.outputlist1[i].aka111)
  166. }
  167. let typeArr = that.unique(type_arr)
  168. that.info['new_detail_list'] = []
  169. for(let i = 0; i < typeArr.length; i++){
  170. let obj = {
  171. aka111:typeArr[i],
  172. details:[],
  173. total:0
  174. }
  175. for(let b = 0; b < that.info.transBody.outputlist1.length;b++){
  176. if(typeArr[i] == that.info.transBody.outputlist1[b].aka111){
  177. obj.details.push(that.info.transBody.outputlist1[b])
  178. obj.total += that.info.transBody.outputlist1[b].akc264
  179. }
  180. }
  181. that.info.new_detail_list.push(obj)
  182. }
  183. }
  184. }
  185. })
  186. .catch(function (error) {
  187. });
  188. }
  189. }, unique(array) {
  190. // res用来存储结果
  191. var res = []
  192. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  193. for (var j = 0, resLen = res.length; j < resLen; j++) {
  194. if (array[i] === res[j] ) {
  195. break
  196. }
  197. }
  198. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  199. if (j === resLen) {
  200. res.push(array[i])
  201. }
  202. }
  203. return res
  204. },
  205. },
  206. created() {
  207. this.org_id = this.$store.getters.xt_user.org_id
  208. this.getInfo(this.paramsObj)
  209. },
  210. watch:{
  211. paramsObj:{//深度监听,可监听到对象、数组的变化
  212. handler(val, oldVal){
  213. this.paramsObj = val;
  214. this.getInfo(this.paramsObj)
  215. },
  216. deep:true
  217. }
  218. }
  219. };
  220. </script>
  221. <style>
  222. .dialysis-print-order {
  223. width: 960px;
  224. margin: 0 auto;
  225. }
  226. .dialysis-print-order .order-yy-name {
  227. margin: auto;
  228. text-align: center;
  229. font-size: 20px;
  230. letter-spacing: 5px;
  231. }
  232. .dialysis-print-order .order-title {
  233. margin: auto;
  234. font-weight: 600;
  235. text-align: center;
  236. font-size: 22px;
  237. padding: 10px;
  238. }
  239. .dialysis-print-order .table-box {
  240. width: 100%;
  241. line-height: 23px;
  242. font-size: 14px;
  243. }
  244. .dialysis-print-order .print-table {
  245. width: 100%;
  246. text-align: center;
  247. border-collapse: collapse;
  248. line-height: 40px;
  249. font-size: 14px;
  250. border-color: #000;
  251. }
  252. .dialysis-print-order .print-table-no {
  253. width: 100%;
  254. text-align: center;
  255. border-collapse: collapse;
  256. font-size: 14px;
  257. }
  258. .dialysis-print-order .under-line {
  259. border-bottom: 1px solid #999;
  260. width: 95%;
  261. text-align: center;
  262. margin-left: 2px;
  263. }
  264. .dialysis-print-order .title-box {
  265. text-align: center;
  266. font-size: 16px;
  267. }
  268. .dialysis-print-order .radio-lebel-box {
  269. font-weight: 400;
  270. cursor: pointer;
  271. }
  272. .dialysis-print-order .radio-no {
  273. opacity: 0;
  274. outline: none;
  275. position: absolute;
  276. margin: 0;
  277. width: 0;
  278. height: 0;
  279. z-index: -1;
  280. }
  281. .dialysis-print-order .radio-inner {
  282. white-space: nowrap;
  283. cursor: pointer;
  284. outline: none;
  285. display: inline-block;
  286. line-height: 1;
  287. position: relative;
  288. vertical-align: middle;
  289. }
  290. .dialysis-print-order .radio-fang {
  291. display: inline-block;
  292. position: relative;
  293. border: 1px solid #000;
  294. box-sizing: border-box;
  295. width: 14px;
  296. height: 14px;
  297. background-color: #fff;
  298. z-index: 1;
  299. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  300. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  301. }
  302. .dialysis-print-order .is-checked-radio::after {
  303. content: "√";
  304. font-size: 15px;
  305. }
  306. .dialysis-print-order .print-table-no tr td {
  307. padding: 8px 5px;
  308. line-height: 25px;
  309. }
  310. .dialysis-print-order .print-table tr td {
  311. padding: 1px 1px;
  312. /*line-height: 25px;*/
  313. }
  314. .es-img {
  315. height: 30px;
  316. }
  317. .advice-name {
  318. text-align: left;
  319. }
  320. .advice-children {
  321. display: flex;
  322. }
  323. .title-box-pro {
  324. border: 0 #fff;
  325. line-height: 25px;
  326. height: 25px;
  327. text-align: left;
  328. padding-left: 10px !important;
  329. }
  330. .title-box-pro-tr {
  331. border: 0 #fff;
  332. }
  333. .text-align-left {
  334. text-align: left !important;
  335. padding-left: 10px !important;
  336. font-size: 14px !important;
  337. line-height: 25px;
  338. }
  339. .print-table-tr-new td {
  340. line-height: 20px !important;
  341. }
  342. .border-top-solid {
  343. border: solid 1px #000;
  344. }
  345. .print-template-two tr {
  346. line-height: 30px;
  347. }
  348. .table-box1 {
  349. border: 1px solid #000;
  350. width: 100%;
  351. line-height: 30px;
  352. font-size: 14px;
  353. border-collapse: collapse;
  354. }
  355. .table-box1 tr {
  356. border-bottom: 1px solid #000;
  357. }
  358. </style>
  359. <style lang="scss">
  360. .newContainer{
  361. .dialysisPage::-webkit-scrollbar {
  362. height: 15px;
  363. }
  364. .el-date-editor{
  365. .el-input__inner{
  366. padding-right:0px;
  367. }
  368. }
  369. .el-table td, .el-table th{
  370. text-align: center;
  371. }
  372. }
  373. .newContainer::-webkit-scrollbar{
  374. height: 15px !important;
  375. }
  376. </style>