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

consumables_print.vue 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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. <div class="print_main_content">
  14. <div class="order_title_panl">
  15. <span class="main_title">耗材统计表</span>
  16. </div>
  17. <div style="display:flex;justify-content: space-between;margin-bottom:10px;">
  18. <p>统计时间:{{query.start_time}} - {{query.end_time}}</p>
  19. <p>印单日期:{{print_time}}</p>
  20. </div>
  21. <div class="table_panel">
  22. <table class="table">
  23. <thead>
  24. <tr>
  25. <td width="50">序号</td>
  26. <td width="50">商品类型</td>
  27. <td width="50">规格名称</td>
  28. <td width="50">耗材数量</td>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. <tr v-for='(item,index) in this.tableData' :key="index">
  33. <td>{{index + 1}}</td>
  34. <td>{{item.good_type_name}}</td>
  35. <td>{{item.good_name}}</td>
  36. <td>{{item.count}}</td>
  37. </tr>
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </template>
  46. <script>
  47. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  48. import print from 'print-js'
  49. const moment = require('moment')
  50. import {getWareHouseOutList} from "@/api/consumable"
  51. import { parseTime } from "@/utils";
  52. import { GetDialysisGoodStatistics } from '@/api/dialysis'
  53. export default {
  54. components:{
  55. BreadCrumb
  56. },
  57. data(){
  58. return{
  59. query:{
  60. start_time:0,
  61. end_time:0
  62. },
  63. crumbs: [
  64. { path: false, name: '耗材药品' },
  65. { path: false, name: '打印' }
  66. ],
  67. start_time:"",
  68. end_time:"",
  69. tableData:[],
  70. print_time:moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  71. }
  72. },
  73. methods:{
  74. calCount(query_warehouseout_info) {
  75. let total = 0
  76. var array = []
  77. array = query_warehouseout_info
  78. for (let i = 0; i < array.length; i++) {
  79. total = total + array[i].count
  80. }
  81. return total
  82. },
  83. GetDialysisGoodStatistics(){
  84. GetDialysisGoodStatistics(this.query).then(response => {
  85. if (response.data.state == 0) {
  86. this.$message.error(response.data.msg)
  87. return false
  88. } else {
  89. this.tableData = []
  90. for (let i = 0; i < response.data.data.stock_out.length; i++) {
  91. if (this.calCount(response.data.data.stock_out[i].query_warehouseout_info) > 0) {
  92. let obj = {
  93. good_name: response.data.data.stock_out[i].specification_name,
  94. good_type_name: response.data.data.stock_out[i].type.type_name,
  95. count: this.calCount(response.data.data.stock_out[i].query_warehouseout_info)
  96. }
  97. this.tableData.push(obj)
  98. }
  99. }
  100. }
  101. })
  102. },
  103. printAction: function() {
  104. const style = '@media print { .print_main_content { background-color: white; width:960px; margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 20px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 18px; padding: 10px 5px; } .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
  105. printJS({
  106. printable: 'print_content',
  107. type: 'html',
  108. documentTitle: ' ',
  109. style: style,
  110. scanStyles: false
  111. })
  112. },
  113. getlist(){
  114. var params = {
  115. start_time:this.start_time,
  116. end_time:this.end_time
  117. }
  118. getWareHouseOutList(params).then(response=>{
  119. if(response.data.state == 1){
  120. var wareoutlist = response.data.data.wareoutlist
  121. console.log("wareoutlist",wareoutlist)
  122. this.tableData = wareoutlist
  123. }
  124. })
  125. },
  126. },
  127. created(){
  128. var startime = this.$route.query.startime
  129. this.query.start_time = startime
  130. var endtime = this.$route.query.endtime
  131. this.query.end_time = endtime
  132. this.GetDialysisGoodStatistics()
  133. }
  134. }
  135. </script>
  136. <style rel="stylesheet/scss" lang="scss" scoped>
  137. .print_main_content {
  138. background-color: white;
  139. max-width: 1500px;
  140. margin: 0 auto;
  141. padding: 0 0 20px 0;
  142. .order_title_panl {
  143. text-align: center;
  144. .main_title {
  145. font-size: 18px;
  146. line-height: 40px;
  147. font-weight: 500;
  148. }
  149. }
  150. .table_panel {
  151. .table {
  152. width: 100%;
  153. border: 1px solid;
  154. border-collapse: collapse;
  155. padding: 2px;
  156. thead {
  157. tr {
  158. td {
  159. border: 1px solid;
  160. text-align: center;
  161. font-size: 20px;
  162. padding: 15px 5px;
  163. }
  164. }
  165. }
  166. tbody {
  167. tr {
  168. td {
  169. border: 1px solid;
  170. text-align: center;
  171. font-size: 18px;
  172. padding: 10px 5px;
  173. .proj {
  174. padding: 5px 0;
  175. text-align: left;
  176. .proj_title {
  177. font-size: 16px;
  178. font-weight: 500;
  179. line-height: 25px;
  180. }
  181. .proj_item {
  182. font-size: 15px;
  183. line-height: 20px;
  184. .zone_name {
  185. font-weight: 500;
  186. }
  187. }
  188. }
  189. }
  190. }
  191. }
  192. }
  193. }
  194. }
  195. </style>