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

drugPrint.vue 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <el-dialog
  3. title="打印"
  4. :visible.sync="visibility"
  5. :close-on-click-modal="isClose"
  6. :close-on-press-escape="isClose"
  7. >
  8. <el-button type="primary" @click="print" class="print_style"
  9. >打印</el-button
  10. >
  11. <div id="dialysis-print-box-1" class="dialysis-print-box-1">
  12. <div class="list_title" style="border-bottom:none;"><div style="width:100%;text-align:center;font-size:16px;font-weight:bold;">{{org_name}} <span v-if="state_name=='待发药'">发药单</span> <span v-if="state_name=='已发药'">领药单</span></div></div>
  13. <div class="list_title">
  14. <div>药品名称:{{name}}</div>
  15. <div>规格:{{specifications}}</div>
  16. <div>发药状态:{{state_name}}</div>
  17. <div>日期:{{times}}</div>
  18. <!-- <div v-if="state==2">领药人:</div>-->
  19. </div>
  20. <el-table
  21. style="width: 940px; margin: 0 auto"
  22. :data="tableData"
  23. border
  24. max-height="450"
  25. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  26. >
  27. <el-table-column type="index" prop="index" label="序号" width="60" align="center">
  28. </el-table-column>
  29. <el-table-column prop="name" label="患者姓名" width="160" align="center">
  30. <template slot-scope="scope">
  31. {{scope.row.name}}
  32. </template>
  33. </el-table-column>
  34. <el-table-column prop="single_dosage" label="单次用量" width="120" align="center">
  35. <template slot-scope="scope">
  36. {{scope.row.single_dosage}}
  37. </template>
  38. </el-table-column>
  39. <el-table-column prop="usage" label="用法" width="120" align="center">
  40. <template slot-scope="scope">
  41. {{scope.row.usage}}
  42. </template>
  43. </el-table-column>
  44. <el-table-column prop="frequency" label="频率" width="120" align="center">
  45. <template slot-scope="scope">
  46. {{scope.row.frequency}}
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="days" label="天数" width="120" align="center">
  50. <template slot-scope="scope">
  51. {{scope.row.days}}
  52. </template>
  53. </el-table-column>
  54. <el-table-column prop="total" label="总量" width="120" align="center">
  55. <template slot-scope="scope">
  56. {{scope.row.total}}
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="data_sources" label="数据来源" width="120" align="center">
  60. <template slot-scope="scope">
  61. {{scope.row.data_sources}}
  62. </template>
  63. </el-table-column>
  64. <el-table-column prop="people" label="领药人" width="120" align="center">
  65. <template slot-scope="scope">
  66. {{scope.row.people}}
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. </div>
  71. </el-dialog>
  72. </template>
  73. <script>
  74. import Vue from "vue";
  75. import print from "print-js";
  76. import printutils from "./print.js";
  77. export default {
  78. data() {
  79. return {
  80. visibility: false,
  81. tableData: [],
  82. isClose:false,
  83. name:"",
  84. times:"",
  85. specifications:"",
  86. state_name:"",
  87. org_name: this.$store.getters.xt_user.org.org_name,
  88. };
  89. },
  90. props: {
  91. propForm: {
  92. type: Object,
  93. },
  94. state:{
  95. type:Number
  96. }
  97. },
  98. created(){
  99. this.init();
  100. },
  101. methods: {
  102. init(){
  103. // let year = new Date().getFullYear();
  104. // let month = new Date().getMonth() +1;
  105. // let day = new Date().getDate();
  106. // let hour = new Date().getHours();
  107. // let minute = new Date().getMinutes();
  108. // this.times = year + "年" + month + "月" + day + "日" + hour + "时" + minute + "分"
  109. // console.log("times:",this.times)
  110. },
  111. // isClose() {
  112. // this.visibility = false;
  113. // },
  114. hide: function () {
  115. this.visibility = false;
  116. for (let i = 0; i < this.propForm.goods.length; i++) {
  117. for (let key in this.propForm.goods[i]) {
  118. if (key != "index") {
  119. this.propForm.goods[i][key].isSelected = false;
  120. }
  121. }
  122. }
  123. },
  124. show: function (val,data,state,ids,times) {
  125. this.times = times
  126. this.visibility = true;
  127. this.name = data.name
  128. this.specifications = data.specifications
  129. console.log("this.multipleSelection",ids)
  130. console.log("this.val",val)
  131. if (state == 1){
  132. this.state_name = "待发药"
  133. this.tableData = ids
  134. }
  135. if (state == 2){
  136. this.state_name = "已发药"
  137. this.tableData = val
  138. }
  139. },
  140. comfirm: function (formName) {
  141. this.goodInfo = [];
  142. this.goodInfoTableData = [];
  143. this.$emit("dialog-comfirm", this.getValue());
  144. this.$refs.multipleTable.clearSelection();
  145. this.$refs.table.setCurrentRow(null);
  146. },
  147. getValue() {},
  148. // 打印
  149. print() {
  150. console.log(this.org_name,'this.org_name')
  151. Vue.prototype.printJson = printutils.printJson;
  152. this.printJson({
  153. title: `
  154. <div>
  155. <div style="width: 940px;text-align:center;font-size:16px;font-weight:bold;">${this.org_name} 领药单</div>
  156. <div style="width: 940px;border-bottom: 1px solid;display: flex;margin: 30px auto;font-size:14px;">
  157. <div style="width: 230px;padding: 10px 0;">药品名称:${this.name}</div>
  158. <div style="width: 230px;padding: 10px 0;">规格:${this.specifications}</div>
  159. <div style="width: 230px;padding: 10px 0;">发药状态:${this.state_name}</div>
  160. <div style="width: 230px;padding: 10px 0;">日期:${this.times}</div>
  161. </div></div>`, // 打印出来的标题
  162. data: this.tableData, // 需要打印的数据
  163. serial: true, // 是否需要打印序列号
  164. fields: [
  165. // 需要打印的字段
  166. "name",
  167. "single_dosage",
  168. "usage",
  169. "frequency",
  170. "days",
  171. "total",
  172. "data_sources",
  173. "people",
  174. ],
  175. properties: [
  176. // 需要打印的字段对应的表头名
  177. {
  178. field: "name",
  179. displayName: "姓名",
  180. },
  181. {
  182. field: "single_dosage",
  183. displayName: "单次用量",
  184. },
  185. {
  186. field: "usage",
  187. displayName: "用法",
  188. },
  189. {
  190. field: "frequency",
  191. displayName: "频率",
  192. },
  193. {
  194. field: "days",
  195. displayName: "天数",
  196. },
  197. {
  198. field: "total",
  199. displayName: "总量",
  200. },
  201. {
  202. field: "data_sources",
  203. displayName: "数据来源",
  204. },
  205. {
  206. field: "people",
  207. displayName: "领药人",
  208. },
  209. ],
  210. });
  211. },
  212. },
  213. };
  214. </script>
  215. <style lang="scss" scoped>
  216. /deep/ .el-dialog{
  217. width: 60%;
  218. }
  219. .print_style {
  220. position: absolute;
  221. right: 65px;
  222. top: 50px;
  223. }
  224. .list_title {
  225. width: 940px;
  226. border-bottom: 1px solid;
  227. display: flex;
  228. margin: 30px auto;
  229. div {
  230. width: 230px;
  231. padding: 10px 0;
  232. }
  233. }
  234. </style>