|
@@ -0,0 +1,244 @@
|
|
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
|
+
|
|
14
|
+ <table class="printTable" border="0" cellspacing="0" align="center">
|
|
15
|
+ <thead class="print_head">
|
|
16
|
+ <tr><td colspan="11">{{org_name}}</td></tr>
|
|
17
|
+ <tr><td colspan="11">药品盘点</td></tr>
|
|
18
|
+ </thead>
|
|
19
|
+ <tbody class="print_body">
|
|
20
|
+ <tr>
|
|
21
|
+ <td>报损日期</td>
|
|
22
|
+ <td>药品名称</td>
|
|
23
|
+ <td>规格</td>
|
|
24
|
+ <td>总损耗数量</td>
|
|
25
|
+ <td>总报损金额</td>
|
|
26
|
+ <td>仓库名称</td>
|
|
27
|
+ <td>操作人</td>
|
|
28
|
+
|
|
29
|
+ </tr>
|
|
30
|
+ <tr v-for="(item,index) in tableList" :key="index">
|
|
31
|
+ <td>
|
|
32
|
+ {{getTime(item.start_time)}}
|
|
33
|
+ </td>
|
|
34
|
+ <td>
|
|
35
|
+ {{item.drug_name}}
|
|
36
|
+ </td>
|
|
37
|
+ <td>
|
|
38
|
+ {{item.specification_name}}
|
|
39
|
+ </td>
|
|
40
|
+ <td>
|
|
41
|
+ {{getTotalCount(item.drug_id,item.max_unit,item.min_unit,item.min_number)}}
|
|
42
|
+ </td>
|
|
43
|
+ <td>
|
|
44
|
+ {{getTotalPrice(item.drug_id,item.min_price)}}
|
|
45
|
+ </td>
|
|
46
|
+ <td>
|
|
47
|
+ {{getHouseName(item.storehouse_id)}}
|
|
48
|
+ </td>
|
|
49
|
+ <td>
|
|
50
|
+ {{getDoctorName(item.creater)}}
|
|
51
|
+ </td>
|
|
52
|
+
|
|
53
|
+ </tr>
|
|
54
|
+ </tbody>
|
|
55
|
+ </table>
|
|
56
|
+ </div>
|
|
57
|
+ </div>
|
|
58
|
+ </div>
|
|
59
|
+</template>
|
|
60
|
+
|
|
61
|
+<script>
|
|
62
|
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
|
63
|
+const moment = require('moment');
|
|
64
|
+import { uParseTime } from '@/utils/tools'
|
|
65
|
+import { getDrugDamageList } from "@/api/drug/drug"
|
|
66
|
+import print from "print-js";
|
|
67
|
+export default {
|
|
68
|
+ components:{
|
|
69
|
+ BreadCrumb
|
|
70
|
+ },
|
|
71
|
+ data(){
|
|
72
|
+ return{
|
|
73
|
+ crumbs: [
|
|
74
|
+ { path: false, name: '库存管理' },
|
|
75
|
+ { path: false, name: '耗材管理' },
|
|
76
|
+ { path: false, name: '耗材盘点打印' },
|
|
77
|
+ ],
|
|
78
|
+ org_name: this.$store.getters.xt_user.org.org_name,
|
|
79
|
+ ids:"",
|
|
80
|
+ tableList:[],
|
|
81
|
+ manufacturerList:[],
|
|
82
|
+ houseList:[],
|
|
83
|
+ datamageList:[],
|
|
84
|
+ doctorList:[]
|
|
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
|
+ limit:this.$route.query.limit,
|
|
111
|
+ page:this.$route.query.page,
|
|
112
|
+ start_time:this.$route.query.start_time,
|
|
113
|
+ end_time:this.$route.query.end_time,
|
|
114
|
+ keyword:this.$route.query.keyword,
|
|
115
|
+ storehouse_id:this.$route.query.storehouse_id,
|
|
116
|
+ }
|
|
117
|
+
|
|
118
|
+ getDrugDamageList(params).then(response=>{
|
|
119
|
+ if(response.data.state == 1){
|
|
120
|
+ this.tableList = response.data.data.list
|
|
121
|
+ this.total = response.data.data.total
|
|
122
|
+ this.doctorList = response.data.data.doctorList
|
|
123
|
+ var datamagelist = response.data.data.damagelist
|
|
124
|
+ this.datamageList = datamagelist
|
|
125
|
+ var obj = {id:0,storehouse_name:"全部"}
|
|
126
|
+ this.houseList = []
|
|
127
|
+ this.houseList.push(obj)
|
|
128
|
+ for(let i=0;i<response.data.data.houseList.length;i++){
|
|
129
|
+ this.houseList.push(response.data.data.houseList[i])
|
|
130
|
+ }
|
|
131
|
+ }
|
|
132
|
+ })
|
|
133
|
+ },
|
|
134
|
+ getManufacturerName(id){
|
|
135
|
+ var name = ""
|
|
136
|
+ for(let i=0;i<this.manufacturerList.length;i++){
|
|
137
|
+ if(id == this.manufacturerList[i].id){
|
|
138
|
+ name = this.manufacturerList[i].manufacturer_name
|
|
139
|
+ }
|
|
140
|
+ }
|
|
141
|
+ return name
|
|
142
|
+ },
|
|
143
|
+ getHouseName(id){
|
|
144
|
+ var storehouse_name = ""
|
|
145
|
+ for(let i=0;i<this.houseList.length;i++){
|
|
146
|
+ if(id == this.houseList[i].id){
|
|
147
|
+ storehouse_name = this.houseList[i].storehouse_name
|
|
148
|
+ }
|
|
149
|
+ }
|
|
150
|
+ if(storehouse_name == "全部"){
|
|
151
|
+ return ""
|
|
152
|
+ }else{
|
|
153
|
+ return storehouse_name
|
|
154
|
+ }
|
|
155
|
+ },
|
|
156
|
+ getDamageCount(good_id){
|
|
157
|
+ var count = 0
|
|
158
|
+ for(let i=0;i<this.damageList.length;i++){
|
|
159
|
+ if(good_id == this.damageList[i].good_id){
|
|
160
|
+ count = this.damageList[i].count
|
|
161
|
+ }
|
|
162
|
+ }
|
|
163
|
+ return count
|
|
164
|
+ },
|
|
165
|
+ getAllDamageCount(good_id,price){
|
|
166
|
+ var count = 0
|
|
167
|
+ for(let i=0;i<this.damageList.length;i++){
|
|
168
|
+ if(good_id == this.damageList[i].good_id){
|
|
169
|
+ count = this.damageList[i].count
|
|
170
|
+ }
|
|
171
|
+ }
|
|
172
|
+ return (count * price).toFixed(2)
|
|
173
|
+ },
|
|
174
|
+ getStorehouseName(id){
|
|
175
|
+ var storehouse_name = ""
|
|
176
|
+ for(let i=0;i<this.houseList.length;i++){
|
|
177
|
+ if(id == this.houseList[i].id){
|
|
178
|
+ storehouse_name = this.houseList[i].storehouse_name
|
|
179
|
+ }
|
|
180
|
+ }
|
|
181
|
+ if(storehouse_name == "全部"){
|
|
182
|
+ return ""
|
|
183
|
+ }else{
|
|
184
|
+ return storehouse_name
|
|
185
|
+ }
|
|
186
|
+ },
|
|
187
|
+
|
|
188
|
+ getTotalCount(drugid,max_unit,min_unit,min_number){
|
|
189
|
+
|
|
190
|
+ var total = 0
|
|
191
|
+ var str = ""
|
|
192
|
+ var str_min = ""
|
|
193
|
+ for(let i=0;i<this.datamageList.length;i++){
|
|
194
|
+ if(drugid == this.datamageList[i].drug_id){
|
|
195
|
+ total +=this.datamageList[i].count
|
|
196
|
+ }
|
|
197
|
+ }
|
|
198
|
+ if(parseInt(total/min_number)!=0){
|
|
199
|
+ str = parseInt(total/min_number) + max_unit
|
|
200
|
+ }
|
|
201
|
+ if((total%min_number)!=0){
|
|
202
|
+ str_min = total%min_number + min_unit
|
|
203
|
+ }
|
|
204
|
+ return str+str_min
|
|
205
|
+ },
|
|
206
|
+ getTotalPrice(drugid,minprice){
|
|
207
|
+ var total = 0
|
|
208
|
+ for(let i=0;i<this.datamageList.length;i++){
|
|
209
|
+ if(drugid == this.datamageList[i].drug_id){
|
|
210
|
+ total+=this.datamageList[i].count
|
|
211
|
+ }
|
|
212
|
+ }
|
|
213
|
+ return (total*minprice).toFixed(2)
|
|
214
|
+ },
|
|
215
|
+ getDoctorName(id){
|
|
216
|
+ var user_name = ""
|
|
217
|
+ for(let i=0;i<this.doctorList.length;i++){
|
|
218
|
+ if(id == this.doctorList[i].admin_user_id){
|
|
219
|
+ user_name = this.doctorList[i].user_name
|
|
220
|
+ }
|
|
221
|
+ }
|
|
222
|
+ return user_name
|
|
223
|
+ },
|
|
224
|
+ },
|
|
225
|
+ created(){
|
|
226
|
+
|
|
227
|
+ this.getlist()
|
|
228
|
+ }
|
|
229
|
+}
|
|
230
|
+</script>
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+<style rel="stylesheet/scss" lang="scss" scoped>
|
|
234
|
+.printTitle{font-size: 22px;text-align: center;}
|
|
235
|
+.flex{display: flex;justify-content: space-between;}
|
|
236
|
+.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
|
|
237
|
+.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
|
|
238
|
+.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
|
|
239
|
+.printTable{width:100%;border-collapse: collapse;}
|
|
240
|
+.printTable td{padding:5px;}
|
|
241
|
+.print_head{border: none;display: table-header-group;}
|
|
242
|
+.print_head tr td{text-align: center;border: none;}
|
|
243
|
+.print_body tr td{border:1px solid}
|
|
244
|
+</style>
|