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