|
@@ -0,0 +1,415 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="main-contain">
|
|
3
|
+ <div class="position">
|
|
4
|
+ <bread-crumb :crumbs='crumbs'></bread-crumb>
|
|
5
|
+ <el-button :loading="loading" size="small" icon="el-icon-printer" @click="printThisPage" type="primary">打印
|
|
6
|
+ </el-button>
|
|
7
|
+ </div>
|
|
8
|
+ <div class="app-container ">
|
|
9
|
+ <div id="dialysis-print-box">
|
|
10
|
+ <div class="dialysis-print-order">
|
|
11
|
+ <div class="order-yy-name">{{orgname}}</div>
|
|
12
|
+ <div class="order-title" v-if="type == 1">入库单</div>
|
|
13
|
+
|
|
14
|
+ <div class="order-title" v-if="type == 2">出库单</div>
|
|
15
|
+ <div class="order-title" v-if="type == 4">退库单</div>
|
|
16
|
+
|
|
17
|
+ <div style="float: left;margin-bottom: 10px;">{{getDateOne()}}</div>
|
|
18
|
+ <div style="float: right;margin-bottom: 10px;">{{getDateTwo()}}</div>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+ <table class="print-table" border="1">
|
|
23
|
+ <tbody>
|
|
24
|
+ <tr>
|
|
25
|
+ <td style="line-height: 50px" width="50">序号</td>
|
|
26
|
+ <td style="line-height: 50px" width="200">耗材名称</td>
|
|
27
|
+ <td style="line-height: 50px" width="200">规格型号</td>
|
|
28
|
+ <td style="line-height: 50px" width="200">仓库名称</td>
|
|
29
|
+ <td style="line-height: 50px" width="80">数量</td>
|
|
30
|
+ <td style="line-height: 50px" width="50">单位</td>
|
|
31
|
+
|
|
32
|
+ <td style="line-height:50px" width="80">
|
|
33
|
+ 出货价
|
|
34
|
+ </td>
|
|
35
|
+ <td style="line-height: 50px" width="80">总价</td>
|
|
36
|
+ </tr>
|
|
37
|
+
|
|
38
|
+ <tr v-for="(item,index) in stockDatas" :key="item.id">
|
|
39
|
+ <td style="line-height: 50px">
|
|
40
|
+ {{index+1}}
|
|
41
|
+ </td>
|
|
42
|
+ <td style="line-height: 50px">
|
|
43
|
+ {{item.good_name}}
|
|
44
|
+ </td>
|
|
45
|
+ <td style="line-height: 50px">
|
|
46
|
+ {{item.specification_name}}
|
|
47
|
+ </td>
|
|
48
|
+ <td style="line-height: 50px" width="200">
|
|
49
|
+ {{getStorehouseId(item.storehouse_id)}}
|
|
50
|
+ </td>
|
|
51
|
+ <td style="line-height: 50px">
|
|
52
|
+ {{getCount(item.child)}}
|
|
53
|
+ </td>
|
|
54
|
+ <td style="line-height: 50px">
|
|
55
|
+ {{item.packing_unit}}
|
|
56
|
+ </td>
|
|
57
|
+ <td style="line-height:50px">
|
|
58
|
+ {{item.price}}
|
|
59
|
+ </td>
|
|
60
|
+ <td style="line-height:50px">
|
|
61
|
+ {{(getCount(item.child)*item.price).toFixed(2)}}
|
|
62
|
+ </td>
|
|
63
|
+ </tr>
|
|
64
|
+ </tbody>
|
|
65
|
+ </table>
|
|
66
|
+ <table class="print-table" border="1">
|
|
67
|
+ <tr>
|
|
68
|
+ <td style="line-height: 50px" width="50">合计</td>
|
|
69
|
+ <td style="line-height: 50px" width="200"></td>
|
|
70
|
+ <td style="line-height: 50px" width="200"></td>
|
|
71
|
+ <td style="line-height: 50px" width="80"></td>
|
|
72
|
+ <td style="line-height: 50px" width="50"></td>
|
|
73
|
+ <td style="line-height: 50px" width="80"></td>
|
|
74
|
+ <td style="line-height: 50px" width="80">
|
|
75
|
+
|
|
76
|
+ </td>
|
|
77
|
+ <td style="line-height: 50px" width="80">
|
|
78
|
+ {{getSum()}}
|
|
79
|
+ </td>
|
|
80
|
+ </tr>
|
|
81
|
+ </table>
|
|
82
|
+
|
|
83
|
+ <div style="display:flex;margin-top:20px;float:right;">
|
|
84
|
+ <div style="width:50px;">审批:</div><div style="width:100px;"></div>
|
|
85
|
+ <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
|
|
86
|
+ <div style="width:50px;">会计:</div><div style="width:100px;"></div>
|
|
87
|
+ <div style="width:50px;">审核:</div><div style="width:100px;"></div>
|
|
88
|
+ <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
|
|
89
|
+ </div>
|
|
90
|
+
|
|
91
|
+ </div>
|
|
92
|
+
|
|
93
|
+ </div>
|
|
94
|
+
|
|
95
|
+ </div>
|
|
96
|
+ </div>
|
|
97
|
+
|
|
98
|
+</template>
|
|
99
|
+
|
|
100
|
+<script>
|
|
101
|
+ import { getNewWarehouseOutInfoList } from '@/api/stock'
|
|
102
|
+ import { getDataConfig } from '@/utils/data'
|
|
103
|
+ import { jsGetAge, uParseTime } from '@/utils/tools'
|
|
104
|
+ import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
|
105
|
+ import print from 'print-js'
|
|
106
|
+
|
|
107
|
+ export default {
|
|
108
|
+ name: 'dialysisPrintOrder',
|
|
109
|
+ components: {
|
|
110
|
+ BreadCrumb
|
|
111
|
+
|
|
112
|
+ },
|
|
113
|
+ data() {
|
|
114
|
+ return {
|
|
115
|
+ crumbs: [
|
|
116
|
+ { path: false, name: '出入库明细' },
|
|
117
|
+ { path: false, name: '打印单' }
|
|
118
|
+ ],
|
|
119
|
+ loading: false,
|
|
120
|
+ orgname: '',
|
|
121
|
+ queryParams: {
|
|
122
|
+ start_time: this.$route.query.start_time,
|
|
123
|
+ end_time: this.$route.query.end_time,
|
|
124
|
+ type: this.$route.query.type,
|
|
125
|
+ limit:this.$route.query.limit,
|
|
126
|
+ page:this.$route.query.page,
|
|
127
|
+ storehouse_id:this.$route.query.storehouse_id,
|
|
128
|
+ keyword:this.$route.query.keyword,
|
|
129
|
+ },
|
|
130
|
+ totalPrice: 0,
|
|
131
|
+ stockDatas: [],
|
|
132
|
+ goodUnit: [],
|
|
133
|
+ type: this.$route.query.type,
|
|
134
|
+ start_time: this.$route.query.start_time,
|
|
135
|
+ end_time: this.$route.query.end_time,
|
|
136
|
+ stockTotal:[],
|
|
137
|
+ wareOutInfo:[],
|
|
138
|
+ org_id:this.$store.getters.xt_user.org.id,
|
|
139
|
+ informationList:[],
|
|
140
|
+ wareOutList:[],
|
|
141
|
+ storeHouseList:[],
|
|
142
|
+ }
|
|
143
|
+ },
|
|
144
|
+ methods: {
|
|
145
|
+ getDateOne(){
|
|
146
|
+
|
|
147
|
+ return "出库日期: "+this.start_time +"~"+this.end_time
|
|
148
|
+
|
|
149
|
+ },
|
|
150
|
+ getDateTwo(){
|
|
151
|
+ var ptime = Math.round(new Date().getTime() / 1000)
|
|
152
|
+ return "打印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
|
|
153
|
+ },
|
|
154
|
+ getTime(value, temp) {
|
|
155
|
+ if (value == 0) {
|
|
156
|
+ return ''
|
|
157
|
+ }
|
|
158
|
+ if (value != undefined) {
|
|
159
|
+ return uParseTime(value, temp)
|
|
160
|
+ }
|
|
161
|
+ return ''
|
|
162
|
+ },
|
|
163
|
+ printThisPage() {
|
|
164
|
+ var ptime = Math.round(new Date().getTime() / 1000)
|
|
165
|
+ this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
|
|
166
|
+ const style = '@media print {.dialysis-print-order{width:960px;margin:0 auto}.dialysis-print-order .order-yy-name{margin:auto;text-align:center;font-size:20px;letter-spacing:5px}.dialysis-print-order .order-title{margin:auto;font-weight:600;text-align:center;font-size:22px;padding:10px 20px 20px 20px}.dialysis-print-order .table-box{width:100%;line-height:23px;font-size:14px}.dialysis-print-order .print-table{width:100%;text-align:center;border-collapse:collapse;line-height:25px;font-size:14px}.dialysis-print-order .print-table-no{width:100%;text-align:center;border-collapse:collapse;font-size:14px}.dialysis-print-order .under-line{border-bottom:1px solid #999;width:95%;text-align:center;margin-left:2px}.dialysis-print-order .title-box{text-align:center;font-size:16px;border:1px solid #666}.dialysis-print-order .radio-lebel-box{font-weight:400;cursor:pointer}.dialysis-print-order .radio-no{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.dialysis-print-order .radio-inner{white-space:nowrap;cursor:pointer;outline:0;display:inline-block;line-height:1;position:relative;vertical-align:middle}.dialysis-print-order .radio-fang{display:inline-block;position:relative;border:1px solid #000;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.dialysis-print-order .is-checked-radio::after{content:"√";font-size:15px}}.dialysis-print-order .print-table-no tr td { padding: 8px 5px; line-height: 25px; }.es-img{height: 20px; }.advice-name{text-align: left;}.advice-children{display:flex;} .dialysis-print-order .print-table tr td{padding: 0px 0px;} .print-template-two tr {line-height: 30px;} .title-box-pro{border: 0 #fff;line-height: 40px;height: 40px;text-align: left;padding-left: 10px !important;} .text-align-left{text-align: left !important;padding-left:10px !important;font-size: 14px !important;line-height: 25px;}'
|
|
167
|
+ printJS({
|
|
168
|
+ printable: 'dialysis-print-box',
|
|
169
|
+ type: 'html',
|
|
170
|
+ style: style,
|
|
171
|
+ scanStyles: false
|
|
172
|
+ })
|
|
173
|
+ },
|
|
174
|
+ getlist(){
|
|
175
|
+ getNewWarehouseOutInfoList(this.queryParams).then(response=>{
|
|
176
|
+ if(response.data.state == 1){
|
|
177
|
+ var list = response.data.data.list
|
|
178
|
+ console.log("list列表",list)
|
|
179
|
+
|
|
180
|
+ if(list!=null && list.length >0){
|
|
181
|
+ for(let i=0;i<list.length;i++){
|
|
182
|
+ list[i].good_store_id = list[i].good_id+list[i].storehouse_id
|
|
183
|
+ }
|
|
184
|
+ }
|
|
185
|
+ console.log("list23323223wo",list)
|
|
186
|
+
|
|
187
|
+ let dataInfo = {}
|
|
188
|
+ list.forEach((item, index) => {
|
|
189
|
+ let { good_store_id } = item
|
|
190
|
+ if (!dataInfo[good_store_id]) {
|
|
191
|
+ dataInfo[good_store_id] = {
|
|
192
|
+ good_store_id,
|
|
193
|
+ child: [],
|
|
194
|
+ good_name:item.GoodInfo.good_name,
|
|
195
|
+ specification_name:item.GoodInfo.specification_name,
|
|
196
|
+ price:item.price,
|
|
197
|
+ packing_unit:item.GoodInfo.packing_unit,
|
|
198
|
+ storehouse_id:item.storehouse_id,
|
|
199
|
+ remark:item.remark,
|
|
200
|
+ }
|
|
201
|
+ }
|
|
202
|
+ })
|
|
203
|
+ let arr = Object.values(dataInfo)
|
|
204
|
+
|
|
205
|
+ for(let j=0;j<arr.length;j++){
|
|
206
|
+ for(let i=0;i<list.length;i++){
|
|
207
|
+ if(arr[j].good_store_id == list[i].good_store_id){
|
|
208
|
+ arr[j].child.push(list[i])
|
|
209
|
+ }
|
|
210
|
+ }
|
|
211
|
+ }
|
|
212
|
+
|
|
213
|
+ console.log("arr2333232wo",arr)
|
|
214
|
+ this.stockDatas = arr
|
|
215
|
+ var manufacturerList = response.data.data.manufacturerList
|
|
216
|
+ var dealerList = response.data.data.dealerList
|
|
217
|
+ this.storeHouseList = response.data.data.storeHouseList
|
|
218
|
+ }
|
|
219
|
+ })
|
|
220
|
+ },
|
|
221
|
+ getStorehouseId(id){
|
|
222
|
+ var storehouse_name = ""
|
|
223
|
+ for(let i=0;i<this.storeHouseList.length;i++){
|
|
224
|
+ if(id == this.storeHouseList[i].id){
|
|
225
|
+ storehouse_name = this.storeHouseList[i].storehouse_name
|
|
226
|
+ }
|
|
227
|
+ }
|
|
228
|
+ return storehouse_name
|
|
229
|
+ },
|
|
230
|
+ getCount(val){
|
|
231
|
+ var total = 0
|
|
232
|
+ if(val!=null && val.length >0){
|
|
233
|
+ for(let i=0;i<val.length;i++){
|
|
234
|
+ total +=val[i].count
|
|
235
|
+ }
|
|
236
|
+ }
|
|
237
|
+ return total
|
|
238
|
+ },
|
|
239
|
+ getSum(){
|
|
240
|
+ var sum = 0
|
|
241
|
+ for(let i=0;i<this.stockDatas.length;i++){
|
|
242
|
+ for(let j=0;j<this.stockDatas[i].child.length;j++){
|
|
243
|
+ sum += this.stockDatas[i].child[j].count * this.stockDatas[i].child[j].price
|
|
244
|
+ }
|
|
245
|
+ }
|
|
246
|
+ if (sum > 0) {
|
|
247
|
+ return sum.toFixed(2)
|
|
248
|
+ }else{
|
|
249
|
+ return ""
|
|
250
|
+ }
|
|
251
|
+ },
|
|
252
|
+ },
|
|
253
|
+ created() {
|
|
254
|
+ var xtuser = this.$store.getters.xt_user
|
|
255
|
+ this.orgname = xtuser.org.org_name
|
|
256
|
+ this.goodUnit = this.$store.getters.good_unit
|
|
257
|
+ this.getlist()
|
|
258
|
+ }
|
|
259
|
+
|
|
260
|
+ }
|
|
261
|
+</script>
|
|
262
|
+
|
|
263
|
+<style>
|
|
264
|
+ .dialysis-print-order {
|
|
265
|
+ width: 960px;
|
|
266
|
+ margin: 0 auto
|
|
267
|
+ }
|
|
268
|
+
|
|
269
|
+ .dialysis-print-order .order-yy-name {
|
|
270
|
+ margin: auto;
|
|
271
|
+ text-align: center;
|
|
272
|
+ font-size: 20px;
|
|
273
|
+ letter-spacing: 5px;
|
|
274
|
+ }
|
|
275
|
+
|
|
276
|
+ .dialysis-print-order .order-title {
|
|
277
|
+ margin: auto;
|
|
278
|
+ font-weight: 600;
|
|
279
|
+ text-align: center;
|
|
280
|
+ font-size: 22px;
|
|
281
|
+ padding: 10px 20px 20px 20px;
|
|
282
|
+ }
|
|
283
|
+
|
|
284
|
+ .dialysis-print-order .table-box {
|
|
285
|
+
|
|
286
|
+ width: 100%;
|
|
287
|
+ line-height: 23px;
|
|
288
|
+ font-size: 14px;
|
|
289
|
+ }
|
|
290
|
+
|
|
291
|
+ .dialysis-print-order .print-table {
|
|
292
|
+ width: 100%;
|
|
293
|
+ text-align: center;
|
|
294
|
+ border-collapse: collapse;
|
|
295
|
+ line-height: 40px;
|
|
296
|
+ font-size: 14px;
|
|
297
|
+ }
|
|
298
|
+
|
|
299
|
+ .dialysis-print-order .print-table-no {
|
|
300
|
+ width: 100%;
|
|
301
|
+ text-align: center;
|
|
302
|
+ border-collapse: collapse;
|
|
303
|
+ font-size: 14px;
|
|
304
|
+ }
|
|
305
|
+
|
|
306
|
+ .dialysis-print-order .under-line {
|
|
307
|
+ border-bottom: 1px solid #999;
|
|
308
|
+ width: 95%;
|
|
309
|
+ text-align: center;
|
|
310
|
+ margin-left: 2px;
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+ }
|
|
314
|
+
|
|
315
|
+ .dialysis-print-order .title-box {
|
|
316
|
+ text-align: center;
|
|
317
|
+ font-size: 16px;
|
|
318
|
+ }
|
|
319
|
+
|
|
320
|
+ .dialysis-print-order .radio-lebel-box {
|
|
321
|
+ font-weight: 400;
|
|
322
|
+ cursor: pointer;
|
|
323
|
+ }
|
|
324
|
+
|
|
325
|
+ .dialysis-print-order .radio-no {
|
|
326
|
+ opacity: 0;
|
|
327
|
+ outline: none;
|
|
328
|
+ position: absolute;
|
|
329
|
+ margin: 0;
|
|
330
|
+ width: 0;
|
|
331
|
+ height: 0;
|
|
332
|
+ z-index: -1;
|
|
333
|
+ }
|
|
334
|
+
|
|
335
|
+ .dialysis-print-order .radio-inner {
|
|
336
|
+ white-space: nowrap;
|
|
337
|
+ cursor: pointer;
|
|
338
|
+ outline: none;
|
|
339
|
+ display: inline-block;
|
|
340
|
+ line-height: 1;
|
|
341
|
+ position: relative;
|
|
342
|
+ vertical-align: middle;
|
|
343
|
+ }
|
|
344
|
+
|
|
345
|
+ .dialysis-print-order .radio-fang {
|
|
346
|
+ display: inline-block;
|
|
347
|
+ position: relative;
|
|
348
|
+ border: 1px solid #000;
|
|
349
|
+ box-sizing: border-box;
|
|
350
|
+ width: 14px;
|
|
351
|
+ height: 14px;
|
|
352
|
+ background-color: #fff;
|
|
353
|
+ z-index: 1;
|
|
354
|
+ transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
|
|
355
|
+ }
|
|
356
|
+
|
|
357
|
+ .dialysis-print-order .is-checked-radio::after {
|
|
358
|
+ content: "√";
|
|
359
|
+ font-size: 15px;
|
|
360
|
+ }
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+ .dialysis-print-order .print-table-no tr td {
|
|
364
|
+ padding: 8px 5px;
|
|
365
|
+ line-height: 25px;
|
|
366
|
+ }
|
|
367
|
+
|
|
368
|
+ .dialysis-print-order .print-table tr td {
|
|
369
|
+ padding: 1px 1px;
|
|
370
|
+ /*line-height: 25px;*/
|
|
371
|
+ }
|
|
372
|
+
|
|
373
|
+ .es-img {
|
|
374
|
+ height: 25px;
|
|
375
|
+ }
|
|
376
|
+
|
|
377
|
+ .advice-name {
|
|
378
|
+ text-align: left;
|
|
379
|
+ }
|
|
380
|
+
|
|
381
|
+ .advice-children {
|
|
382
|
+ display: flex;
|
|
383
|
+ }
|
|
384
|
+
|
|
385
|
+ .title-box-pro {
|
|
386
|
+ border: 0 #fff;
|
|
387
|
+ line-height: 25px;
|
|
388
|
+ height: 25px;
|
|
389
|
+ text-align: left;
|
|
390
|
+ padding-left: 10px !important;
|
|
391
|
+ }
|
|
392
|
+
|
|
393
|
+ .title-box-pro-tr {
|
|
394
|
+ border: 0 #fff;
|
|
395
|
+ }
|
|
396
|
+
|
|
397
|
+ .text-align-left {
|
|
398
|
+ text-align: left !important;
|
|
399
|
+ padding-left: 10px !important;
|
|
400
|
+ font-size: 14px !important;
|
|
401
|
+ line-height: 25px;
|
|
402
|
+ }
|
|
403
|
+
|
|
404
|
+ .print-table-tr-new td {
|
|
405
|
+ line-height: 20px !important;
|
|
406
|
+ }
|
|
407
|
+
|
|
408
|
+ .border-top-solid {
|
|
409
|
+ border: solid 1px #000;
|
|
410
|
+ }
|
|
411
|
+
|
|
412
|
+ .print-template-two tr {
|
|
413
|
+ line-height: 30px;
|
|
414
|
+ }
|
|
415
|
+</style>
|