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

print_all.vue 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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="0" cellspacing="0" align="center">
  14. <thead class="print_head">
  15. <tr><td colspan="11">{{org_name}}</td></tr>
  16. <tr><td colspan="11">耗材盘点</td></tr>
  17. </thead>
  18. <tbody class="print_body">
  19. <tr>
  20. <td>耗材名称</td>
  21. <td>规格</td>
  22. <td>单位</td>
  23. <td>批号</td>
  24. <td>生产厂商</td>
  25. <td>仓库名称</td>
  26. <td>盘点前数量</td>
  27. <td>盘点后数量</td>
  28. <td>盈亏类型</td>
  29. <td>进货单价</td>
  30. <td width="60">总额</td>
  31. </tr>
  32. <tr v-for="(item,index) in tableData" :key="index">
  33. <td>{{item.good_name}}</td>
  34. <td>{{item.specification_name}}</td>
  35. <td>{{item.packing_unit}}</td>
  36. <td>{{item.number}}</td>
  37. <td>{{item.manufacturer}}</td>
  38. <td>{{getHouseName(item.storehouse_id)}}</td>
  39. <td>{{item.stock_count}}</td>
  40. <td>{{item.last_stock_count}}</td>
  41. <td>
  42. <span v-if="item.stock_count > item.last_stock_count">盘亏</span>
  43. <span v-if="item.stock_count < item.last_stock_count">盘盈</span>
  44. </td>
  45. <td>{{item.buy_price}}</td>
  46. <td>
  47. <span v-if="item.stock_count > item.last_stock_count">{{((item.stock_count - item.last_stock_count) * item.buy_price).toFixed(2)}}</span>
  48. </td>
  49. </tr>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  58. const moment = require('moment');
  59. import { uParseTime } from '@/utils/tools'
  60. import { getPrintList } from "@/api/stock"
  61. import print from "print-js";
  62. export default {
  63. components:{
  64. BreadCrumb
  65. },
  66. data(){
  67. return{
  68. crumbs: [
  69. { path: false, name: '库存管理' },
  70. { path: false, name: '耗材管理' },
  71. { path: false, name: '耗材盘点打印' },
  72. ],
  73. org_name: this.$store.getters.xt_user.org.org_name,
  74. ids:"",
  75. tableData:[],
  76. manufacturerList:[],
  77. houseList:[],
  78. }
  79. },
  80. methods:{
  81. printAction: function() {
  82. const style = '@page{size:landscape;margin: 10mm;} @media print { print_content{width:960px;margin:0} .flex{display: flex;justify-content: space-between;} .printTable{width:100%;border-collapse: collapse;border:0px;margin:10px 0;} .printTable thead{text-align:center}.printTable td{padding:5px;} .print_body tr td{border: 1px solid;font-size:12px;border-collapse:collapse;} }';
  83. printJS({
  84. printable: 'print_content',
  85. type: 'html',
  86. documentTitle: ' ',
  87. style: style,
  88. scanStyles: false
  89. })
  90. },
  91. getTime(val) {
  92. if(val < 0){
  93. return ""
  94. }
  95. if(val == ""){
  96. return ""
  97. }else {
  98. return uParseTime(val, '{y}-{m}-{d}')
  99. }
  100. },
  101. getlist(){
  102. var params = {
  103. storehouse_id:this.$route.query.storehouse_id,
  104. good_name:this.$route.query.good_name,
  105. limit:this.$route.query.limit,
  106. page:this.$route.query.page,
  107. }
  108. getPrintList(params).then(response=>{
  109. if(response.data.state == 1){
  110. var list = response.data.data.list
  111. console.log("list233233232323",list)
  112. this.tableData = list
  113. this.houseList = response.data.data.houseList
  114. }
  115. })
  116. },
  117. getManufacturerName(id){
  118. var name = ""
  119. for(let i=0;i<this.manufacturerList.length;i++){
  120. if(id == this.manufacturerList[i].id){
  121. name = this.manufacturerList[i].manufacturer_name
  122. }
  123. }
  124. return name
  125. },
  126. getHouseName(id){
  127. var storehouse_name = ""
  128. for(let i=0;i<this.houseList.length;i++){
  129. if(id == this.houseList[i].id){
  130. storehouse_name = this.houseList[i].storehouse_name
  131. }
  132. }
  133. if(storehouse_name == "全部"){
  134. return ""
  135. }else{
  136. return storehouse_name
  137. }
  138. }
  139. },
  140. created(){
  141. this.getlist()
  142. }
  143. }
  144. </script>
  145. <style rel="stylesheet/scss" lang="scss" scoped>
  146. .printTitle{font-size: 22px;text-align: center;}
  147. .flex{display: flex;justify-content: space-between;}
  148. .tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
  149. .tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
  150. .tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
  151. .printTable{width:100%;border-collapse: collapse;}
  152. .printTable td{padding:5px;}
  153. .print_head{border: none;display: table-header-group;}
  154. .print_head tr td{text-align: center;border: none;}
  155. .print_body tr td{border:1px solid}
  156. </style>