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

stockPrint.vue 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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="text-align:right;margin-bottom:20px;font-size: 18px;">
  18. 打印时间:{{time_now}}
  19. </div>
  20. <div class="table_panel">
  21. <table class="table">
  22. <thead>
  23. <tr>
  24. <td width="60">商品编码</td>
  25. <td width="80">耗材名称</td>
  26. <td width="80">耗材类型</td>
  27. <td width="80">规格型号</td>
  28. <td width="80">入库数量</td>
  29. <td width="80">入库退货</td>
  30. <td width="80">实际入库</td>
  31. <td width="80">出库数量</td>
  32. <td width="80">出库退库</td>
  33. <td width="80">实际出库</td>
  34. <td width="80">剩余库存</td>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. <tr v-for='(item,index) in WarehouseInfo.warehouseInfoDate' :key="index">
  39. <td>{{item.good_code}}</td>
  40. <td>{{item.good_name}}</td>
  41. <td>{{item.type.type_name}}</td>
  42. <td>{{item.specification_name}}</td>
  43. <td>{{stockInCount(item)}}</td>
  44. <td>{{salesReturnCount(item)}}</td>
  45. <td> {{ stockInCount(item) - salesReturnCount(item) }}</td>
  46. <td>{{ stockOutCount(item) }}</td>
  47. <td>{{cancelStockCount(item) }}</td>
  48. <td>{{ stockOutCount(item) - cancelStockCount(item)}}</td>
  49. <td>{{stockInCount(item) -salesReturnCount(item) -stockOutCount(item) +cancelStockCount(item)}}</td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  61. import { getAllStockQueryList } from "@/api/stock";
  62. import print from 'print-js'
  63. const moment = require('moment')
  64. export default {
  65. components:{
  66. BreadCrumb
  67. },
  68. data(){
  69. return{
  70. crumbs: [
  71. { path: false, name: '库存管理' },
  72. { path: false, name: '自备药查询' },
  73. { path: false, name: '自备药打印' },
  74. ],
  75. start_time:"",
  76. end_time:"",
  77. drug_name:"",
  78. drug_spec:"",
  79. keyword:"",
  80. tableData:[],
  81. time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  82. type_name:"",
  83. limit:20,
  84. page:1,
  85. WarehouseInfo: {
  86. loading: false,
  87. warehouseInfoDate: []
  88. },
  89. }
  90. },
  91. methods:{
  92. printAction: function() {
  93. 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: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .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; } }'
  94. printJS({
  95. printable: 'print_content',
  96. type: 'html',
  97. documentTitle: ' ',
  98. style: style,
  99. scanStyles: false
  100. })
  101. },
  102. getlist(){
  103. const Params = {
  104. page: this.page,
  105. limit: this.limit,
  106. keyword: this.keywords,
  107. start_time:this.start_time,
  108. end_time:this.end_time,
  109. type_name:this.type_name,
  110. };
  111. this.WarehouseInfo.loading = true;
  112. this.WarehouseInfo.warehouseInfoDate = [];
  113. getAllStockQueryList(Params).then(response => {
  114. if (response.data.state == 0) {
  115. this.WarehouseInfo.loading = false;
  116. this.$message.error(response.data.msg);
  117. return false;
  118. } else {
  119. this.WarehouseInfo.loading = false;
  120. this.total = response.data.data.total;
  121. for (let i = 0; i < response.data.data.list.length; i++) {
  122. this.WarehouseInfo.warehouseInfoDate.push( response.data.data.list[i]);
  123. }
  124. }
  125. console.log("打印数据源头",this.WarehouseInfo.warehouseInfoDate)
  126. });
  127. },
  128. stockInCount: function(row) {
  129. let total = 0;
  130. for (let i = 0; i < row.query_warehousing_info.length; i++) {
  131. total = total + row.query_warehousing_info[i].warehousing_count;
  132. }
  133. return total;
  134. },
  135. salesReturnCount: function(row) {
  136. let total = 0;
  137. for (let i = 0; i < row.query_sales_return_info.length; i++) {
  138. total = total + row.query_sales_return_info[i].count;
  139. }
  140. return total;
  141. },
  142. stockOutCount: function(row) {
  143. let total = 0;
  144. for (let i = 0; i < row.query_warehouseout_info.length; i++) {
  145. total = total + row.query_warehouseout_info[i].count;
  146. }
  147. return total;
  148. },
  149. cancelStockCount: function(row) {
  150. let total = 0;
  151. for (let i = 0; i < row.query_cancel_stock_info.length; i++) {
  152. total = total + row.query_cancel_stock_info[i].count;
  153. }
  154. return total;
  155. },
  156. },
  157. created(){
  158. var starttime = this.$route.query.start_time
  159. this.start_time = starttime
  160. var endtime = this.$route.query.end_time
  161. this.end_time = endtime
  162. var type_name = this.$route.query.type_name
  163. this.type_name = type_name
  164. var keyword = this.$route.query.keyword
  165. this.keyword = keyword
  166. this.getlist()
  167. }
  168. }
  169. </script>
  170. <style rel="stylesheet/scss" lang="scss" scoped>
  171. .print_main_content {
  172. background-color: white;
  173. max-width: 1500px;
  174. margin: 0 auto;
  175. padding: 0 0 20px 0;
  176. .order_title_panl {
  177. text-align: center;
  178. .main_title {
  179. font-size: 18px;
  180. line-height: 40px;
  181. font-weight: 500;
  182. }
  183. }
  184. .table_panel {
  185. .table {
  186. width: 100%;
  187. border: 1px solid;
  188. border-collapse: collapse;
  189. padding: 2px;
  190. thead {
  191. tr {
  192. td {
  193. border: 1px solid;
  194. text-align: center;
  195. font-size: 18px;
  196. padding: 15px 5px;
  197. }
  198. }
  199. }
  200. tbody {
  201. tr {
  202. td {
  203. border: 1px solid;
  204. text-align: center;
  205. font-size: 18px;
  206. padding: 10px 5px;
  207. white-space: pre-line;
  208. .proj {
  209. padding: 5px 0;
  210. text-align: left;
  211. .proj_title {
  212. font-size: 16px;
  213. font-weight: 500;
  214. line-height: 25px;
  215. }
  216. .proj_item {
  217. font-size: 15px;
  218. line-height: 20px;
  219. .zone_name {
  220. font-weight: 500;
  221. }
  222. }
  223. }
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }
  230. </style>