|
@@ -0,0 +1,305 @@
|
|
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
|
+
|
|
13
|
+ <div id="print_content">
|
|
14
|
+ <div class="print_main_content">
|
|
15
|
+ <div class="order_title_panl">
|
|
16
|
+ <span class="main_title">
|
|
17
|
+ 透析耗材
|
|
18
|
+ </span>
|
|
19
|
+ <span style="float:right;">打印日期:
|
|
20
|
+ {{$route.query.schedule_date}}
|
|
21
|
+ </span>
|
|
22
|
+ </div>
|
|
23
|
+ <div class="table_panel">
|
|
24
|
+
|
|
25
|
+ <table class="table">
|
|
26
|
+ <thead>
|
|
27
|
+ <tr>
|
|
28
|
+ <td width="50">序号</td>
|
|
29
|
+ <td width="100">耗材名称</td>
|
|
30
|
+ <td width="100">规格</td>
|
|
31
|
+ <td width="100">数量</td>
|
|
32
|
+
|
|
33
|
+ </tr>
|
|
34
|
+ </thead>
|
|
35
|
+ <tbody>
|
|
36
|
+ <tr v-for="(item,i) in tableProjectList" :key="i">
|
|
37
|
+ <td>{{i+1}}</td>
|
|
38
|
+ <td>{{item.good_name}}</td>
|
|
39
|
+ <td>{{item.specification_name}}</td>
|
|
40
|
+ <td>
|
|
41
|
+ {{item.count}}
|
|
42
|
+ </td>
|
|
43
|
+ </tr>
|
|
44
|
+ </tbody>
|
|
45
|
+ </table>
|
|
46
|
+ </div>
|
|
47
|
+ </div>
|
|
48
|
+ </div>
|
|
49
|
+ </div>
|
|
50
|
+ </div>
|
|
51
|
+ </template>
|
|
52
|
+
|
|
53
|
+ <script>
|
|
54
|
+ import { getDialysisProject } from '@/api/dialysis'
|
|
55
|
+ import { parseTime } from '@/utils'
|
|
56
|
+ import { uParseTime } from '@/utils/tools'
|
|
57
|
+ import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
|
58
|
+ import print from 'print-js'
|
|
59
|
+ import { getDataConfig } from '@/utils/data'
|
|
60
|
+ export default {
|
|
61
|
+ name: 'SchedulePrint',
|
|
62
|
+ data() {
|
|
63
|
+ return {
|
|
64
|
+ crumbs: [
|
|
65
|
+ { path: false, name: '排班管理' },
|
|
66
|
+ { path: false, name: '排班打印' }
|
|
67
|
+ ],
|
|
68
|
+ td_1_width: '8%',
|
|
69
|
+ td_2_width: '8%',
|
|
70
|
+ td_3_width: '64%',
|
|
71
|
+ td_4_width: '20%',
|
|
72
|
+ month: 1,
|
|
73
|
+ begin_day: 1,
|
|
74
|
+ total:[],
|
|
75
|
+ list:[],
|
|
76
|
+ schedule_date:"",
|
|
77
|
+ schedule_type:0,
|
|
78
|
+ partition_type:0,
|
|
79
|
+ keywords:"",
|
|
80
|
+ loading:false,
|
|
81
|
+ tableData:[],
|
|
82
|
+ numberList:[],
|
|
83
|
+ partitionArr:[],
|
|
84
|
+ his_config:{},
|
|
85
|
+ typeList:[],
|
|
86
|
+ rowList:[],
|
|
87
|
+ dialysate_formulation:[],
|
|
88
|
+ body_fluid_option:[],
|
|
89
|
+ displace_liqui_part_option:[],
|
|
90
|
+ blood_access_option:[],
|
|
91
|
+ hemodialysisPipelinesOptions:[],
|
|
92
|
+ tableList:[],
|
|
93
|
+ druglist:[],
|
|
94
|
+ config:{},
|
|
95
|
+ tableProjectList:[]
|
|
96
|
+ }
|
|
97
|
+ },
|
|
98
|
+ components: {
|
|
99
|
+ BreadCrumb
|
|
100
|
+ },
|
|
101
|
+ created() {
|
|
102
|
+ this.getDialysisProject()
|
|
103
|
+ },
|
|
104
|
+ methods: {
|
|
105
|
+ getDialysisProject(){
|
|
106
|
+ var params = {
|
|
107
|
+ schedule_type:this.$route.query.schedule_type,
|
|
108
|
+ partion_type:this.$route.query.partion_type,
|
|
109
|
+ selected_date:this.$route.query.schedule_date,
|
|
110
|
+ }
|
|
111
|
+ getDialysisProject(params).then(response=>{
|
|
112
|
+ if(response.data.state ==1){
|
|
113
|
+ var list = response.data.data.list
|
|
114
|
+ var newArr = []
|
|
115
|
+ if(list!=null && list.length>0){
|
|
116
|
+ for(let i=0;i<list.length;i++){
|
|
117
|
+ for(let j=0;j<list[i].his_doctor_project.length;j++){
|
|
118
|
+ newArr.push(list[i].his_doctor_project[j])
|
|
119
|
+ }
|
|
120
|
+ }
|
|
121
|
+ }
|
|
122
|
+
|
|
123
|
+ let dataInfo = {}
|
|
124
|
+ newArr.forEach((item, index) => {
|
|
125
|
+ let { project_id } = item
|
|
126
|
+ if (!dataInfo[project_id]) {
|
|
127
|
+ dataInfo[project_id] = {
|
|
128
|
+ project_id:item.project_id,
|
|
129
|
+ good_name:item.good.good_name,
|
|
130
|
+ specification_name:item.good.specification_name,
|
|
131
|
+ child: [],
|
|
132
|
+ count:0,
|
|
133
|
+ }
|
|
134
|
+ }
|
|
135
|
+ })
|
|
136
|
+ let arr = Object.values(dataInfo)
|
|
137
|
+
|
|
138
|
+ if(arr!=null && arr.length >0){
|
|
139
|
+ for(let i =0;i<arr.length;i++){
|
|
140
|
+ for(let j=0;j<newArr.length;j++){
|
|
141
|
+ if(arr[i].project_id == newArr[j].project_id){
|
|
142
|
+ arr[i].child.push(newArr[i])
|
|
143
|
+ }
|
|
144
|
+ }
|
|
145
|
+ }
|
|
146
|
+ for(let i =0;i<arr.length;i++){
|
|
147
|
+ for(let j=0;j<arr[i].child.length;j++){
|
|
148
|
+ arr[i].count += parseInt(arr[i].child[j].count)
|
|
149
|
+ }
|
|
150
|
+ }
|
|
151
|
+
|
|
152
|
+ console.log("arr0000000000000000000000",arr)
|
|
153
|
+ this.tableProjectList = []
|
|
154
|
+ this.tableProjectList = arr
|
|
155
|
+
|
|
156
|
+ }
|
|
157
|
+ }
|
|
158
|
+ })
|
|
159
|
+ },
|
|
160
|
+ getTimeOne(val) {
|
|
161
|
+ if(val == ""){
|
|
162
|
+ return ""
|
|
163
|
+ }else {
|
|
164
|
+ return uParseTime(val, '{y}-{m}-{d}')
|
|
165
|
+ }
|
|
166
|
+ },
|
|
167
|
+ getCount(val){
|
|
168
|
+ var count = 0
|
|
169
|
+ if(val!=null && val.length > 0){
|
|
170
|
+ for(let i=0;i<val.length;i++){
|
|
171
|
+ count += parseInt(val[i].prescribing_number)
|
|
172
|
+ }
|
|
173
|
+ }
|
|
174
|
+ if(count > 0){
|
|
175
|
+ return count
|
|
176
|
+ }else{
|
|
177
|
+ return 0
|
|
178
|
+ }
|
|
179
|
+ },
|
|
180
|
+ printAction: function() {
|
|
181
|
+ 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; } }'
|
|
182
|
+
|
|
183
|
+ printJS({
|
|
184
|
+ printable: 'print_content',
|
|
185
|
+ type: 'html',
|
|
186
|
+ documentTitle: ' ',
|
|
187
|
+ style: style,
|
|
188
|
+ scanStyles: false
|
|
189
|
+ })
|
|
190
|
+ },
|
|
191
|
+ getSpecification(id){
|
|
192
|
+ var specification_name = ""
|
|
193
|
+ for(let i=0;i<this.druglist.length;i++){
|
|
194
|
+ if(id == this.druglist[i].id){
|
|
195
|
+ specification_name = this.druglist[i].dose+this.druglist[i].dose_unit +"*"+this.druglist[i].min_number+this.druglist[i].min_unit +"/"+this.druglist[i].max_unit
|
|
196
|
+ }
|
|
197
|
+ }
|
|
198
|
+ return specification_name
|
|
199
|
+ },
|
|
200
|
+ getHisCount(val,max_unit,min_unit,min_number){
|
|
201
|
+ var total = 0
|
|
202
|
+ var max_str = "";
|
|
203
|
+ var min_str = "";
|
|
204
|
+ for(let i=0;i<val.length;i++){
|
|
205
|
+ total+=parseInt(val[i].prescribing_number)
|
|
206
|
+ }
|
|
207
|
+ if (total < min_number) {
|
|
208
|
+ min_str = total + min_unit;
|
|
209
|
+ }
|
|
210
|
+ if (total == 0) {
|
|
211
|
+ min_str = "";
|
|
212
|
+ max_str = "";
|
|
213
|
+ }
|
|
214
|
+ if (total >= min_number) {
|
|
215
|
+ if (parseInt(total / min_number) != 0) {
|
|
216
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
217
|
+ }
|
|
218
|
+ if (total % min_number != 0) {
|
|
219
|
+ min_str = (total % min_number) + min_unit;
|
|
220
|
+ }
|
|
221
|
+ }
|
|
222
|
+ return max_str + min_str;
|
|
223
|
+
|
|
224
|
+ },
|
|
225
|
+ }
|
|
226
|
+ }
|
|
227
|
+ </script>
|
|
228
|
+
|
|
229
|
+ <style rel="stylesheet/scss" lang="scss" scoped>
|
|
230
|
+ .print_main_content {
|
|
231
|
+ background-color: white;
|
|
232
|
+ width: 960px;
|
|
233
|
+ margin: 0 auto;
|
|
234
|
+ padding: 0 0 20px 0;
|
|
235
|
+
|
|
236
|
+ .order_title_panl {
|
|
237
|
+ text-align: center;
|
|
238
|
+
|
|
239
|
+ .main_title {
|
|
240
|
+ font-size: 18px;
|
|
241
|
+ line-height: 40px;
|
|
242
|
+ font-weight: 500;
|
|
243
|
+ }
|
|
244
|
+
|
|
245
|
+ }
|
|
246
|
+ .table_panel {
|
|
247
|
+
|
|
248
|
+ .table {
|
|
249
|
+ width: 100%;
|
|
250
|
+ border: 1px solid;
|
|
251
|
+ border-collapse: collapse;
|
|
252
|
+ padding: 2px;
|
|
253
|
+
|
|
254
|
+ thead {
|
|
255
|
+
|
|
256
|
+ tr {
|
|
257
|
+
|
|
258
|
+ td {
|
|
259
|
+ border: 1px solid;
|
|
260
|
+ text-align: center;
|
|
261
|
+ font-size: 20px;
|
|
262
|
+ padding: 15px 5px;
|
|
263
|
+ }
|
|
264
|
+
|
|
265
|
+ }
|
|
266
|
+ }
|
|
267
|
+ tbody {
|
|
268
|
+
|
|
269
|
+ tr {
|
|
270
|
+
|
|
271
|
+ td {
|
|
272
|
+ border: 1px solid;
|
|
273
|
+ text-align: center;
|
|
274
|
+ font-size: 18px;
|
|
275
|
+ padding: 10px 5px;
|
|
276
|
+
|
|
277
|
+ .proj {
|
|
278
|
+ padding: 5px 0;
|
|
279
|
+ text-align: left;
|
|
280
|
+
|
|
281
|
+ .proj_title {
|
|
282
|
+ font-size: 16px;
|
|
283
|
+ font-weight: 500;
|
|
284
|
+ line-height: 25px;
|
|
285
|
+ }
|
|
286
|
+
|
|
287
|
+ .proj_item {
|
|
288
|
+ font-size: 15px;
|
|
289
|
+ line-height: 20px;
|
|
290
|
+
|
|
291
|
+ .zone_name {
|
|
292
|
+ font-weight: 500;
|
|
293
|
+ }
|
|
294
|
+
|
|
295
|
+ }
|
|
296
|
+ }
|
|
297
|
+ }
|
|
298
|
+ }
|
|
299
|
+ }
|
|
300
|
+ }
|
|
301
|
+ }
|
|
302
|
+ }
|
|
303
|
+ </style>
|
|
304
|
+
|
|
305
|
+
|