goodPrint.vue 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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;">
  13. <div style="width:100%;text-align:center;font-size:16px;font-weight:bold;">
  14. {{org_name}} <span v-if="state=='待发药'">发药单</span> <span v-if="state=='已发药'">领药单</span>
  15. </div>
  16. </div>
  17. <div style="display: flex;">
  18. <div style="margin-right: 20px;">日期:{{times}}</div>
  19. <div>单据号:00013756</div>
  20. </div>
  21. <div>
  22. <table class="table" border="1"
  23. style="border-collapse: collapse;border-left: none;border-right: none;width: 100%;text-align: center;border: 1;">
  24. <tr>
  25. <td>药品名称</td>
  26. <td>规格</td>
  27. <td>用量</td>
  28. <td>用法</td>
  29. <td>天数</td>
  30. <td>总量</td>
  31. <td>单价</td>
  32. <td>金额</td>
  33. <td>执行时间</td>
  34. </tr>
  35. <tr v-for="item in tableData" >
  36. <td></td>
  37. <td></td>
  38. <td></td>
  39. <td></td>
  40. <td></td>
  41. <td></td>
  42. <td></td>
  43. <td></td>
  44. <td></td>
  45. </tr>
  46. </table>
  47. </div>
  48. <div style="display: flex;margin: 10px 0;">
  49. <div style="flex: 1;">数量合计:</div>
  50. <div style="flex: 1;">金额合计:</div>
  51. <div style="flex: 1;">操作人:</div>
  52. <div style="flex: 1;">核对人:</div>
  53. </div>
  54. </div>
  55. </el-dialog>
  56. </template>
  57. <script>
  58. import Vue from "vue";
  59. import print from "print-js";
  60. import printutils from "./print.js";
  61. import{todaynumber} from '@/api/pharmacy'
  62. const moment = require("moment");
  63. import { uParseTime } from "@/utils/tools";
  64. export default {
  65. data() {
  66. return {
  67. visibility: false,
  68. tableData: [],
  69. isClose:false,
  70. name:"",
  71. DialysisNo:'',
  72. state:null,
  73. times:"",
  74. start_time:moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
  75. org_name: this.$store.getters.xt_user.org.org_name,
  76. baseList:[],
  77. Doctor:'',
  78. patients:{},
  79. doctors:[],
  80. Price_zong:0,
  81. diagnosearr:[],
  82. diagnosis:'',
  83. };
  84. },
  85. props: {
  86. propForm: {
  87. type: Object,
  88. },
  89. },
  90. created(){
  91. this.init();
  92. },
  93. methods: {
  94. init(){
  95. },
  96. hide: function () {
  97. this.visibility = false;
  98. for (let i = 0; i < this.propForm.goods.length; i++) {
  99. for (let key in this.propForm.goods[i]) {
  100. if (key != "index") {
  101. this.propForm.goods[i][key].isSelected = false;
  102. }
  103. }
  104. }
  105. },
  106. show: function (val) {
  107. this.tableData = []
  108. this.tableData = val
  109. this.visibility = true;
  110. },
  111. comfirm: function (formName) {
  112. this.goodInfo = [];
  113. this.goodInfoTableData = [];
  114. this.$emit("dialog-comfirm", this.getValue());
  115. this.$refs.multipleTable.clearSelection();
  116. this.$refs.table.setCurrentRow(null);
  117. },
  118. getValue() {},
  119. // 打印
  120. print() {
  121. console.log(this.org_name,'this.org_name')
  122. Vue.prototype.printJson = printutils.printJson;
  123. const style =
  124. '@media print {.list_title{width:940px;border-bottom:1px solid;display:flex;margin:20px auto} .table tr td{border:1px solid black;padding: 5px 0;border-left: none;border-right: none;}}';
  125. printJS({
  126. printable: "dialysis-print-box-1",
  127. type: "html",
  128. style: style,
  129. scanStyles: false,
  130. });
  131. },
  132. getSpecaiName(drug_id){
  133. var spc =""
  134. for(let i=0;i<this.baseList.length;i++){
  135. if(drug_id == this.baseList[i].id){
  136. spc = this.baseList[i].dose + this.baseList[i].dose_unit +"*"+this.baseList[i].min_number+this.baseList[i].min_unit+"/"+this.baseList[i].max_unit
  137. }
  138. }
  139. return spc
  140. },
  141. getTime(val) {
  142. if(val < 0){
  143. return ""
  144. }
  145. if(val == ""){
  146. return ""
  147. }else {
  148. return uParseTime(val, '{y}-{m}-{d} {h}:{i}')
  149. }
  150. },
  151. getdoctors(id){
  152. for(let i in this.doctors){
  153. if(this.doctors[i].id == id){
  154. return this.doctors[i].user_name
  155. }
  156. }
  157. }
  158. },
  159. };
  160. </script>
  161. <style lang="scss" scoped>
  162. /deep/ .el-dialog{
  163. width: 60%;
  164. }
  165. /deep/ .el-table__body-wrapper::-webkit-scrollbar {
  166. width: 10px;
  167. height: 10px;
  168. }
  169. .print_style {
  170. position: absolute;
  171. right: 65px;
  172. top: 50px;
  173. }
  174. .list_title {
  175. width: 940px;
  176. border-bottom: 1px solid;
  177. display: flex;
  178. }
  179. .table tr td{
  180. border:1px solid black;
  181. padding: 5px 0;
  182. border-left: none;
  183. border-right: none;
  184. }
  185. </style>
  186. <style>
  187. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  188. font-size: 12px;
  189. }
  190. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  191. background: #6fb5fa;
  192. }
  193. .count {
  194. color: #bd2c00;
  195. }
  196. .el-table td,
  197. .el-table th.is-leaf,
  198. .el-table--border,
  199. .el-table--group {
  200. border-color: #d0d3da;
  201. }
  202. .el-table--border::after,
  203. .el-table--group::after,
  204. .el-table::before {
  205. background-color: #d0d3da;
  206. }
  207. </style>