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

invoicePrint.vue 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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="app-container" style="padding-top: 40px">
  15. <div class="dialysisPage">
  16. <printOne
  17. v-if="
  18. org_id != 10215 && org_id != 10265 && org_id != 4 && org_id != 0 && org_id != 9675
  19. "
  20. :paramsObj="invoiceParams"
  21. ></printOne>
  22. <printTwo v-if="org_id == 10215 || org_id == 0 " :paramsObj="invoiceParams"></printTwo>
  23. <printThree
  24. v-if="org_id == 10265|| org_id == 4 || org_id == 9675"
  25. :paramsObj="invoiceParams"
  26. ></printThree>
  27. </div>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import printOne from "./invoiceTemplate/printOne";
  33. import printTwo from "./invoiceTemplate/printTwo";
  34. import printThree from "./invoiceTemplate/printThree";
  35. export default {
  36. name: "invoicePrint",
  37. components: {
  38. printOne,
  39. printTwo,
  40. printThree,
  41. },
  42. props: {
  43. invoiceParams: Object,
  44. },
  45. data() {
  46. return {
  47. childResponse: {},
  48. // invoiceParams:{}
  49. org_id: "",
  50. };
  51. },
  52. methods: {
  53. getAdminUser(id) {
  54. if (id == 0) {
  55. return "";
  56. }
  57. if (id == undefined) {
  58. return "";
  59. }
  60. for (let i = 0; i < this.adminUser.length; i++) {
  61. if (this.adminUser[i].id == id) {
  62. return this.adminUser[i].name;
  63. }
  64. }
  65. },
  66. getTime(value, temp) {
  67. if (value == 0) {
  68. return "";
  69. }
  70. if (value != undefined) {
  71. return uParseTime(value, temp);
  72. }
  73. return "";
  74. },
  75. printThisPage() {
  76. if (this.org_id == 10265 || this.org_id == 0 || this.org_id == 4) {
  77. const style1 =
  78. "@page{size:landscape ; margin: 20mm;} @media print {#invoice-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;}.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}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar div{width:150px;}}";
  79. printJS({
  80. printable: "invoice-print",
  81. type: "html",
  82. style: style1,
  83. scanStyles: false,
  84. });
  85. } else {
  86. const style =
  87. "@media print {#invoice-print{font-size:12px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;}.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}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar div{width:150px;}}";
  88. printJS({
  89. printable: "invoice-print",
  90. type: "html",
  91. style: style,
  92. scanStyles: false,
  93. });
  94. }
  95. // if (this.org_template_info.template_id == 1) {
  96. // printJS({
  97. // printable: "dialysis-print-box",
  98. // type: "html",
  99. // style: style,
  100. // scanStyles: false
  101. // });
  102. // }
  103. },
  104. },
  105. created() {
  106. console.log("this.invoiceParams", this.invoiceParams);
  107. this.org_id = this.$store.getters.xt_user.org_id;
  108. console.log(this.org_id, "this.org_id");
  109. },
  110. watch: {
  111. paramsObj: {
  112. //深度监听,可监听到对象、数组的变化
  113. handler(val, oldVal) {
  114. this.invoiceParams = val;
  115. },
  116. deep: true,
  117. },
  118. },
  119. };
  120. </script>
  121. <style lang="scss" scoped>
  122. .printTitle {
  123. font-size: 22px;
  124. text-align: center;
  125. font-weight: bold;
  126. }
  127. .infoMain {
  128. display: flex;
  129. flex-wrap: wrap;
  130. border-bottom: 2px solid #000;
  131. padding: 0 10px;
  132. }
  133. .infoMain .infoP {
  134. width: 33%;
  135. line-height: 24px;
  136. }
  137. .prescriptionBox {
  138. padding: 0 10px;
  139. height: 600px;
  140. }
  141. .Rp {
  142. font-size: 22px;
  143. font-weight: bold;
  144. }
  145. .drugsBox {
  146. padding-left: 40px;
  147. margin-bottom: 10px;
  148. }
  149. .drugsBox p {
  150. line-height: 30px;
  151. }
  152. .drugsOne {
  153. line-height: 24px;
  154. }
  155. .drugsOne span {
  156. margin-right: 20px;
  157. }
  158. .doctorBox {
  159. display: flex;
  160. justify-content: space-between;
  161. padding: 0 10px;
  162. line-height: 24px;
  163. border-bottom: 2px solid #000;
  164. }
  165. .actionBar {
  166. display: flex;
  167. justify-content: space-between;
  168. line-height: 24px;
  169. padding: 0 10px;
  170. }
  171. .actionBar p {
  172. width: 150px;
  173. }
  174. </style>