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

print_all.vue 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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 tableList" :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></td>
  44. <td></td>
  45. <td></td>
  46. <!-- <td>
  47. <span v-if="parseInt(item.stock_count) > parseInt(item.last_stock_count)">盘亏</span>
  48. <span v-if="parseInt(item.stock_count) < parseInt(item.last_stock_count)">盘盈</span>
  49. </td>
  50. <td>{{item.buy_price}}</td>
  51. <td>
  52. <span v-if="item.stock_count > item.last_stock_count">{{((item.stock_count - item.last_stock_count) * item.buy_price).toFixed(2)}}</span>
  53. <span v-if="item.stock_count < item.last_stock_count">{{((item.last_stock_count - item.stock_count) * item.buy_price).toFixed(2)}}</span>
  54. <span v-if="item.stock_count = item.last_stock_count">0</span>
  55. </td> -->
  56. </tr>
  57. </tbody>
  58. </table>
  59. </div>
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  65. const moment = require('moment');
  66. import { uParseTime } from '@/utils/tools'
  67. import { getPrintList } from "@/api/stock"
  68. import print from "print-js";
  69. export default {
  70. components:{
  71. BreadCrumb
  72. },
  73. data(){
  74. return{
  75. crumbs: [
  76. { path: false, name: '库存管理' },
  77. { path: false, name: '耗材管理' },
  78. { path: false, name: '耗材盘点打印' },
  79. ],
  80. org_name: this.$store.getters.xt_user.org.org_name,
  81. ids:"",
  82. tableList:[],
  83. manufacturerList:[],
  84. houseList:[],
  85. }
  86. },
  87. methods:{
  88. printAction: function() {
  89. 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;} }';
  90. printJS({
  91. printable: 'print_content',
  92. type: 'html',
  93. documentTitle: ' ',
  94. style: style,
  95. scanStyles: false
  96. })
  97. },
  98. getTime(val) {
  99. if(val < 0){
  100. return ""
  101. }
  102. if(val == ""){
  103. return ""
  104. }else {
  105. return uParseTime(val, '{y}-{m}-{d}')
  106. }
  107. },
  108. getlist(){
  109. var params = {
  110. storehouse_id:this.$route.query.storehouse_id,
  111. good_name:this.$route.query.good_name,
  112. limit:this.$route.query.limit,
  113. page:this.$route.query.page,
  114. }
  115. getPrintList(params).then(response=>{
  116. if(response.data.state == 1){
  117. var list = response.data.data.list
  118. console.log("list232332232323",response.data.data.list)
  119. this.tableList = list
  120. console.log("list233233232323",this.tableList)
  121. this.houseList = response.data.data.houseList
  122. }
  123. })
  124. },
  125. getManufacturerName(id){
  126. var name = ""
  127. for(let i=0;i<this.manufacturerList.length;i++){
  128. if(id == this.manufacturerList[i].id){
  129. name = this.manufacturerList[i].manufacturer_name
  130. }
  131. }
  132. return name
  133. },
  134. getHouseName(id){
  135. var storehouse_name = ""
  136. for(let i=0;i<this.houseList.length;i++){
  137. if(id == this.houseList[i].id){
  138. storehouse_name = this.houseList[i].storehouse_name
  139. }
  140. }
  141. if(storehouse_name == "全部"){
  142. return ""
  143. }else{
  144. return storehouse_name
  145. }
  146. }
  147. },
  148. created(){
  149. this.getlist()
  150. }
  151. }
  152. </script>
  153. <style rel="stylesheet/scss" lang="scss" scoped>
  154. .printTitle{font-size: 22px;text-align: center;}
  155. .flex{display: flex;justify-content: space-between;}
  156. .tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
  157. .tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
  158. .tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
  159. .printTable{width:100%;border-collapse: collapse;}
  160. .printTable td{padding:5px;}
  161. .print_head{border: none;display: table-header-group;}
  162. .print_head tr td{text-align: center;border: none;}
  163. .print_body tr td{border:1px solid}
  164. </style>