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

inventoryPrint.vue 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-row style="float:right;">
  6. <el-col :span="24">
  7. <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
  8. </el-col>
  9. </el-row>
  10. </div>
  11. <div class="app-container" style="background-color: white;">
  12. <div id="print_content">
  13. <table class="printTable" border="1">
  14. <tr>
  15. <td>序号</td>
  16. <td>名称</td>
  17. <td>规格</td>
  18. <td>批号</td>
  19. <td>生产日期</td>
  20. <td>有效日期</td>
  21. <td>生产企业</td>
  22. <td>国药准字</td>
  23. <td>单位</td>
  24. <td>库存量</td>
  25. </tr>
  26. <tr v-for="(item,index) in tableData" :key="index">
  27. <td>{{index+1}}</td>
  28. <td>{{item.drug_name}}</td>
  29. <td>{{item.specification_name}}</td>
  30. <td>{{item.batch_number}}</td>
  31. <td>{{getTime(item.product_date)}}</td>
  32. <td>{{getTime(item.expiry_date)}}</td>
  33. <td>{{getManufacturerName(item.manufacturer)}}</td>
  34. <td>{{item.number}}</td>
  35. <td>{{item.max_unit}}</td>
  36. <td></td>
  37. </tr>
  38. </table>
  39. </div>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  45. const moment = require('moment');
  46. import print from "print-js";
  47. import { uParseTime } from '@/utils/tools'
  48. import { getInventoryModeList } from "@/api/drug/drug"
  49. export default {
  50. components:{
  51. BreadCrumb
  52. },
  53. data(){
  54. return{
  55. crumbs: [
  56. { path: false, name: '库存管理' },
  57. { path: false, name: '药品管理' },
  58. { path: false, name: '药品盘点打印' },
  59. ],
  60. ids:"",
  61. tableData:[],
  62. manufacturerList:[],
  63. }
  64. },
  65. methods:{
  66. printAction: function() {
  67. const style = '@media print { .printTitle{font-size: 22px;text-align: center;}.flex{display: flex;justify-content: space-between;}.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}.printTable td{padding:5px;} }';
  68. printJS({
  69. printable: 'print_content',
  70. type: 'html',
  71. documentTitle: ' ',
  72. style: style,
  73. scanStyles: false
  74. })
  75. },
  76. getlist(){
  77. getInventoryModeList().then(response=>{
  78. if(response.data.state == 1){
  79. var list = response.data.data.list
  80. console.log("list23232323",list)
  81. this.manufacturerList = response.data.data.manufacturerList
  82. for(let i=0;i<list.length;i++){
  83. list[i].specification_name = ""
  84. list[i].specification_name = list[i].dose +list[i].dose_unit+"*"+list[i].min_number+ list[i].min_unit+"/"+list[i].max_unit
  85. }
  86. this.tableData = list
  87. }
  88. })
  89. },
  90. getTime(val) {
  91. if(val < 0){
  92. return ""
  93. }
  94. if(val == ""){
  95. return ""
  96. }else {
  97. return uParseTime(val, '{y}-{m}-{d}')
  98. }
  99. },
  100. getManufacturerName(id){
  101. var name = ""
  102. for(let i=0;i<this.manufacturerList.length;i++){
  103. if(id == this.manufacturerList[i].id){
  104. name = this.manufacturerList[i].manufacturer_name
  105. }
  106. }
  107. return name
  108. }
  109. },
  110. created(){
  111. this.getlist()
  112. }
  113. }
  114. </script>
  115. <style rel="stylesheet/scss" lang="scss" scoped>
  116. .printTitle{font-size: 22px;text-align: center;}
  117. .flex{display: flex;justify-content: space-between;}
  118. .tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
  119. .tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
  120. .tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
  121. .printTable{width:100%;border-collapse: collapse;}
  122. .printTable td{padding:5px;}
  123. </style>