|
@@ -105,13 +105,79 @@
|
105
|
105
|
>
|
106
|
106
|
</el-pagination>
|
107
|
107
|
|
108
|
|
-
|
|
108
|
+
|
|
109
|
+ <el-dialog
|
|
110
|
+ title="药品统计表"
|
|
111
|
+ :visible.sync="startdialogVisible"
|
|
112
|
+ width="70%">
|
|
113
|
+ <span>
|
|
114
|
+ <div class="cell clearfix">
|
|
115
|
+ <label class="title"> <span class="name">排班班次</span> : </label>
|
|
116
|
+ <el-select v-model="schedule_type" placeholder="请选择">
|
|
117
|
+ <el-option
|
|
118
|
+ v-for="item in schedulArr"
|
|
119
|
+ :key="item.value"
|
|
120
|
+ :label="item.label"
|
|
121
|
+ :value="item.value">
|
|
122
|
+ </el-option>
|
|
123
|
+ </el-select>
|
|
124
|
+ <label class="title"> <span class="name">病区选择</span> : </label>
|
|
125
|
+ <el-select v-model="partion_type" placeholder="请选择">
|
|
126
|
+ <el-option
|
|
127
|
+ v-for="item in partitionArr"
|
|
128
|
+ :key="item.id"
|
|
129
|
+ :label="item.name"
|
|
130
|
+ :value="item.id">
|
|
131
|
+ </el-option>
|
|
132
|
+ </el-select>
|
|
133
|
+ </div>
|
|
134
|
+ <el-table
|
|
135
|
+ :data="tableList"
|
|
136
|
+ border
|
|
137
|
+ :row-style="{ color: '#303133' }"
|
|
138
|
+ :header-cell-style="{
|
|
139
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
140
|
+ color: '#606266'
|
|
141
|
+ }"
|
|
142
|
+ >
|
|
143
|
+ <el-table-column align="center" label="序号">
|
|
144
|
+ <template slot-scope="scope">
|
|
145
|
+ {{scope.$index+1}}
|
|
146
|
+ </template>
|
|
147
|
+ </el-table-column>
|
|
148
|
+ <el-table-column align="center" label="药品名称">
|
|
149
|
+ <template slot-scope="scope">
|
|
150
|
+ {{scope.row.advice_name}}
|
|
151
|
+ </template>
|
|
152
|
+ </el-table-column>
|
|
153
|
+ <el-table-column align="center" label="规格">
|
|
154
|
+ <template slot-scope="scope">
|
|
155
|
+ {{scope.row.specification_name}}
|
|
156
|
+ </template>
|
|
157
|
+ </el-table-column>
|
|
158
|
+
|
|
159
|
+ <el-table-column align="center" label="数量">
|
|
160
|
+ <template slot-scope="scope">
|
|
161
|
+ {{getCount(scope.row.child)}}
|
|
162
|
+ </template>
|
|
163
|
+ </el-table-column>
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+ </el-table>
|
|
168
|
+ </span>
|
|
169
|
+ <span slot="footer" class="dialog-footer">
|
|
170
|
+ <el-button @click="startdialogVisible = false">取 消</el-button>
|
|
171
|
+ <el-button type="primary" @click="startdialogVisible = false">确 定</el-button>
|
|
172
|
+ </span>
|
|
173
|
+ </el-dialog>
|
|
174
|
+
|
109
|
175
|
</div>
|
110
|
176
|
</template>
|
111
|
177
|
|
112
|
178
|
|
113
|
179
|
<script>
|
114
|
|
- import { GetAllZone,getDialysisAdviceTemplateList } from '@/api/dialysis'
|
|
180
|
+ import { GetAllZone,getDialysisAdviceTemplateList,getDialysisAdviceSchedudeList } from '@/api/dialysis'
|
115
|
181
|
|
116
|
182
|
import { uParseTime } from "@/utils/tools";
|
117
|
183
|
|
|
@@ -125,6 +191,7 @@
|
125
|
191
|
total:"",
|
126
|
192
|
schedule_date:"",
|
127
|
193
|
schedule_type:0,
|
|
194
|
+
|
128
|
195
|
partition_id:0,
|
129
|
196
|
page:1,
|
130
|
197
|
limit:10,
|
|
@@ -164,7 +231,12 @@
|
164
|
231
|
arrList:[],
|
165
|
232
|
total:0,
|
166
|
233
|
adviceList:[],
|
167
|
|
- templateList:[]
|
|
234
|
+ templateList:[],
|
|
235
|
+ startdialogVisible:false,
|
|
236
|
+ schedule_type:"",
|
|
237
|
+ partion_type:"",
|
|
238
|
+ druglist:[],
|
|
239
|
+ tableList:[],
|
168
|
240
|
}
|
169
|
241
|
},
|
170
|
242
|
created() {
|
|
@@ -265,7 +337,92 @@
|
265
|
337
|
})
|
266
|
338
|
},
|
267
|
339
|
statistics() {
|
268
|
|
- this.$refs.consumables.show()
|
|
340
|
+ var params = {
|
|
341
|
+ schedule_type:this.schedule_type,
|
|
342
|
+ partion_type:this.partion_type,
|
|
343
|
+ selected_date:this.query.schedule_date,
|
|
344
|
+ }
|
|
345
|
+ console.log("params2332232wo",params)
|
|
346
|
+ getDialysisAdviceSchedudeList(params).then(response=>{
|
|
347
|
+ if(response.data.state == 1){
|
|
348
|
+ var doctorList = []
|
|
349
|
+ var hisDoctorList = []
|
|
350
|
+ var druglist = response.data.data.drug
|
|
351
|
+ console.log("druglsit",druglist)
|
|
352
|
+ this.druglist = druglist
|
|
353
|
+ this.startdialogVisible = true
|
|
354
|
+ var list = response.data.data.list
|
|
355
|
+ console.log("listwo222222",list)
|
|
356
|
+ var adviceList = response.data.data.adviceList
|
|
357
|
+ console.log("adviceList",adviceList)
|
|
358
|
+ if(adviceList!=null && adviceList.length > 0){
|
|
359
|
+ let dataInfo = {}
|
|
360
|
+ adviceList.forEach((item, index) => {
|
|
361
|
+ let { advice_name } = item
|
|
362
|
+ if (!dataInfo[advice_name]) {
|
|
363
|
+ dataInfo[advice_name] = {
|
|
364
|
+ advice_name:item.advice_name,
|
|
365
|
+ child: [],
|
|
366
|
+ count:0,
|
|
367
|
+ drug_id:item.drug_id,
|
|
368
|
+ specification_name:item.advice_desc,
|
|
369
|
+ }
|
|
370
|
+ }
|
|
371
|
+ })
|
|
372
|
+ let arr = Object.values(dataInfo)
|
|
373
|
+ if(arr.length > 0){
|
|
374
|
+ for(let i=0;i<adviceList.length;i++){
|
|
375
|
+ for(let j=0;j<arr.length;j++){
|
|
376
|
+ if(adviceList[i].advice_name == arr[j].advice_name){
|
|
377
|
+ arr[j].child.push(adviceList[i])
|
|
378
|
+ }
|
|
379
|
+ }
|
|
380
|
+ }
|
|
381
|
+ }
|
|
382
|
+ console.log("xinar232323232",arr)
|
|
383
|
+ this.tableList = []
|
|
384
|
+ this.tableList = arr
|
|
385
|
+ }
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+ var templateList = response.data.data.templateList
|
|
390
|
+
|
|
391
|
+ console.log("templateList",templateList)
|
|
392
|
+ if(templateList!=null && templateList.length > 0){
|
|
393
|
+ let dataInfoOne = {}
|
|
394
|
+ adviceList.forEach((item, index) => {
|
|
395
|
+ let { advice_name } = item
|
|
396
|
+ if (!dataInfoOne[advice_name]) {
|
|
397
|
+ dataInfoOne[advice_name] = {
|
|
398
|
+ advice_name:item.advice_name,
|
|
399
|
+ child: [],
|
|
400
|
+ count:0,
|
|
401
|
+ specification_name:this.getSpecification(item.drug_id),
|
|
402
|
+ drug_id:item.drug_id,
|
|
403
|
+ }
|
|
404
|
+ }
|
|
405
|
+ })
|
|
406
|
+ let hisarr = Object.values(dataInfoOne)
|
|
407
|
+ if(hisarr.length > 0){
|
|
408
|
+ for(let i=0;i<templateList.length;i++){
|
|
409
|
+ for(let j=0;j<hisarr.length;j++){
|
|
410
|
+ if(templateList[i].advice_name == hisarr[j].advice_name){
|
|
411
|
+ hisarr[j].child.push(templateList[i])
|
|
412
|
+ }
|
|
413
|
+ }
|
|
414
|
+ }
|
|
415
|
+ }
|
|
416
|
+ this.tableList = []
|
|
417
|
+ console.log("hisarrw22222222",hisarr)
|
|
418
|
+ this.tableList = hisarr
|
|
419
|
+ }
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+ }
|
|
424
|
+ })
|
|
425
|
+
|
269
|
426
|
},
|
270
|
427
|
handleScheduleDateChange(val) {
|
271
|
428
|
this.query.schedule_date = val
|
|
@@ -339,6 +496,28 @@
|
339
|
496
|
}
|
340
|
497
|
}
|
341
|
498
|
return str
|
|
499
|
+ },
|
|
500
|
+ getSpecification(id){
|
|
501
|
+ var specification_name = ""
|
|
502
|
+ for(let i=0;i<this.druglist.length;i++){
|
|
503
|
+ if(id == this.druglist[i].id){
|
|
504
|
+ specification_name = this.druglist[i].dose+this.druglist[i].dose_unit +"*"+this.druglist[i].min_nubmer +this.druglist[i].min_unit +"/"+this.druglist[i].max_unt
|
|
505
|
+ }
|
|
506
|
+ }
|
|
507
|
+ return specification_name
|
|
508
|
+ },
|
|
509
|
+ getCount(val){
|
|
510
|
+ var count = 0
|
|
511
|
+ if(val!=null && val.length > 0){
|
|
512
|
+ for(let i=0;i<val.length;i++){
|
|
513
|
+ count += parseInt(val[i].prescribing_number)
|
|
514
|
+ }
|
|
515
|
+ }
|
|
516
|
+ if(count > 0){
|
|
517
|
+ return count
|
|
518
|
+ }else{
|
|
519
|
+ return 0
|
|
520
|
+ }
|
342
|
521
|
}
|
343
|
522
|
}
|
344
|
523
|
}
|