|
@@ -46,11 +46,12 @@
|
46
|
46
|
<el-button size="small" icon="el-icon-printer" @click="toSett" type="primary" v-if="his_config.is_open == 1">设置</el-button>
|
47
|
47
|
<el-button size="small" icon="el-icon-printer" @click="exportList" type="primary">打印</el-button>
|
48
|
48
|
<el-button size="small" icon="el-icon-printer" @click="exportList" type="primary">导出</el-button>
|
49
|
|
- <el-button size="small" type="primary" @click="statistics">统计表</el-button>
|
|
49
|
+ <el-button size="small" type="primary" v-if="his_config.is_open != 1" @click="statistics">统计表</el-button>
|
|
50
|
+ <el-button size="small" type="primary" v-if="his_config.is_open == 1" @click="toStatistics">统计表</el-button>
|
50
|
51
|
</div>
|
51
|
52
|
</div>
|
52
|
53
|
|
53
|
|
- <div v-if="his_config.is_open == 0">
|
|
54
|
+ <div v-if="his_config.is_open != 1">
|
54
|
55
|
<el-table
|
55
|
56
|
:data="list"
|
56
|
57
|
border
|
|
@@ -167,7 +168,7 @@
|
167
|
168
|
:label="item.type_name"
|
168
|
169
|
>
|
169
|
170
|
<template slot-scope="scope">
|
170
|
|
- {{getStr(scope.row.typeList[index].id,getTypeName(scope.row.his_prescription_template,scope.row.patient_id))}}
|
|
171
|
+ {{getStr(scope.row.typeList[index].id,scope.row.projectList,scope.row.patient_id)}}
|
171
|
172
|
</template>
|
172
|
173
|
|
173
|
174
|
</el-table-column>
|
|
@@ -294,12 +295,80 @@
|
294
|
295
|
</span>
|
295
|
296
|
</el-dialog>
|
296
|
297
|
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+ <el-dialog
|
|
301
|
+ title="耗材统计表"
|
|
302
|
+ :visible.sync="startHisDialogVisible"
|
|
303
|
+ width="70%">
|
|
304
|
+ <span>
|
|
305
|
+ <div class="cell clearfix">
|
|
306
|
+ <label class="title"> <span class="name">排班班次</span> : </label>
|
|
307
|
+ <el-select v-model="schedule_type" placeholder="请选择">
|
|
308
|
+ <el-option
|
|
309
|
+ v-for="item in schedulArr"
|
|
310
|
+ :key="item.value"
|
|
311
|
+ :label="item.label"
|
|
312
|
+ :value="item.value">
|
|
313
|
+ </el-option>
|
|
314
|
+ </el-select>
|
|
315
|
+ <label class="title"> <span class="name">病区选择</span> : </label>
|
|
316
|
+ <el-select v-model="partion_type" placeholder="请选择">
|
|
317
|
+ <el-option
|
|
318
|
+ v-for="item in partitionArr"
|
|
319
|
+ :key="item.id"
|
|
320
|
+ :label="item.name"
|
|
321
|
+ :value="item.id">
|
|
322
|
+ </el-option>
|
|
323
|
+ </el-select>
|
|
324
|
+ </div>
|
|
325
|
+ <el-table
|
|
326
|
+ :data="tableList"
|
|
327
|
+ border
|
|
328
|
+ :row-style="{ color: '#303133' }"
|
|
329
|
+ :header-cell-style="{
|
|
330
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
331
|
+ color: '#606266'
|
|
332
|
+ }"
|
|
333
|
+ >
|
|
334
|
+ <el-table-column align="center" label="序号">
|
|
335
|
+ <template slot-scope="scope">
|
|
336
|
+ {{scope.$index+1}}
|
|
337
|
+ </template>
|
|
338
|
+ </el-table-column>
|
|
339
|
+ <el-table-column align="center" label="耗材名称">
|
|
340
|
+ <template slot-scope="scope">
|
|
341
|
+ {{scope.row.good_name}}
|
|
342
|
+ </template>
|
|
343
|
+ </el-table-column>
|
|
344
|
+ <el-table-column align="center" label="规格">
|
|
345
|
+ <template slot-scope="scope">
|
|
346
|
+ {{scope.row.specification_name}}
|
|
347
|
+ </template>
|
|
348
|
+ </el-table-column>
|
|
349
|
+
|
|
350
|
+ <el-table-column align="center" label="数量">
|
|
351
|
+ <template slot-scope="scope">
|
|
352
|
+ {{scope.row.count}}
|
|
353
|
+ </template>
|
|
354
|
+ </el-table-column>
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+ </el-table>
|
|
359
|
+ </span>
|
|
360
|
+ <span slot="footer" class="dialog-footer">
|
|
361
|
+ <el-button @click="startHisDialogVisible = false">取 消</el-button>
|
|
362
|
+ <el-button type="primary" @click="startHisDialogVisible = false">确 定</el-button>
|
|
363
|
+ </span>
|
|
364
|
+ </el-dialog>
|
|
365
|
+
|
297
|
366
|
</div>
|
298
|
367
|
</template>
|
299
|
368
|
|
300
|
369
|
|
301
|
370
|
<script>
|
302
|
|
- import { GetAllZone,getPatientDialysisSolutionGroupList,getDialysisGoodTotalCount,saveHisDialysis } from '@/api/dialysis'
|
|
371
|
+ import { GetAllZone,getPatientDialysisSolutionGroupList,getDialysisGoodTotalCount,saveHisDialysis,getHisDialysisGoodCount } from '@/api/dialysis'
|
303
|
372
|
import {GetAllGoodType} from '@/api/stock'
|
304
|
373
|
import { uParseTime } from "@/utils/tools";
|
305
|
374
|
import { getDataConfig } from '@/utils/data'
|
|
@@ -392,6 +461,7 @@
|
392
|
461
|
checkedTwentySeven:false,
|
393
|
462
|
checkedTwentyEight:false,
|
394
|
463
|
checkedTwentyNight:false,
|
|
464
|
+ startHisDialogVisible:false,
|
395
|
465
|
typeList:[],
|
396
|
466
|
}
|
397
|
467
|
},
|
|
@@ -439,7 +509,7 @@
|
439
|
509
|
getPatientDialysisSolutionGroupList(this.query).then(response=>{
|
440
|
510
|
if(response.data.state == 1){
|
441
|
511
|
var list = response.data.data.list
|
442
|
|
-
|
|
512
|
+
|
443
|
513
|
var total = response.data.data.total
|
444
|
514
|
this.total = total
|
445
|
515
|
var goodType = response.data.data.goodType
|
|
@@ -465,11 +535,19 @@
|
465
|
535
|
}
|
466
|
536
|
}
|
467
|
537
|
for(let i=0;i<list.length;i++){
|
|
538
|
+ list[i].projectList = []
|
468
|
539
|
list[i].typeList = []
|
469
|
540
|
list[i].typeList = this.typeList
|
470
|
541
|
}
|
471
|
542
|
|
472
|
|
- console.log("list列表",list)
|
|
543
|
+ for(let i=0;i<list.length;i++){
|
|
544
|
+ for(let j=0;j<list[i].his_prescription_template.his_prescription_info.length;j++){
|
|
545
|
+ for(let z=0;z<list[i].his_prescription_template.his_prescription_info[j].project.length;z++){
|
|
546
|
+ list[i].projectList.push(list[i].his_prescription_template.his_prescription_info[j].project[z])
|
|
547
|
+ }
|
|
548
|
+ }
|
|
549
|
+ }
|
|
550
|
+ console.log("list列表",list)
|
473
|
551
|
this.list = list
|
474
|
552
|
}
|
475
|
553
|
}
|
|
@@ -544,7 +622,6 @@
|
544
|
622
|
partion_type:this.partion_type,
|
545
|
623
|
selected_date:this.query.schedule_date,
|
546
|
624
|
}
|
547
|
|
- // console.log("params2332232wo",params)
|
548
|
625
|
getDialysisGoodTotalCount(params).then(response=>{
|
549
|
626
|
if(response.data.state == 1){
|
550
|
627
|
this.startDialogVisible = true
|
|
@@ -703,6 +780,67 @@
|
703
|
780
|
})
|
704
|
781
|
|
705
|
782
|
},
|
|
783
|
+ toStatistics(){
|
|
784
|
+ var params = {
|
|
785
|
+ schedule_type:this.schedule_type,
|
|
786
|
+ partion_type:this.partion_type,
|
|
787
|
+ selected_date:this.query.schedule_date,
|
|
788
|
+ }
|
|
789
|
+ getHisDialysisGoodCount(params).then(response=>{
|
|
790
|
+ if(response.data.state == 1){
|
|
791
|
+ var list = response.data.data.list
|
|
792
|
+ console.log("list23233223232wode",list)
|
|
793
|
+ this.startHisDialogVisible = true
|
|
794
|
+ var projectList = []
|
|
795
|
+ for(let i=0;i<list.length;i++){
|
|
796
|
+ for(let j=0;j<list[i].his_prescription_template.his_prescription_info.length;j++){
|
|
797
|
+ for(let z=0;z<list[i].his_prescription_template.his_prescription_info[j].project.length;z++){
|
|
798
|
+ projectList.push(list[i].his_prescription_template.his_prescription_info[j].project[z])
|
|
799
|
+ }
|
|
800
|
+ }
|
|
801
|
+ }
|
|
802
|
+ console.log("projectList",projectList)
|
|
803
|
+
|
|
804
|
+ if(projectList!=null && projectList.length > 0){
|
|
805
|
+ for(let i=0;i<projectList.length;i++){
|
|
806
|
+ projectList[i].good_id = 0
|
|
807
|
+ projectList[i].good_id = projectList[i].good_info.id
|
|
808
|
+ }
|
|
809
|
+ }
|
|
810
|
+
|
|
811
|
+ let dataInfo = {}
|
|
812
|
+ projectList.forEach((item, index) => {
|
|
813
|
+ let { good_id } = item
|
|
814
|
+ if (!dataInfo[good_id]) {
|
|
815
|
+ dataInfo[good_id] = {
|
|
816
|
+ good_id:item.good_info.id,
|
|
817
|
+ child: [],
|
|
818
|
+ count:0,
|
|
819
|
+ specification_name:item.good_info.specification_name,
|
|
820
|
+ good_name:item.good_info.good_name
|
|
821
|
+ }
|
|
822
|
+ }
|
|
823
|
+ })
|
|
824
|
+ let newArr = Object.values(dataInfo)
|
|
825
|
+
|
|
826
|
+ for(let i=0;i<projectList.length;i++){
|
|
827
|
+ for(let j=0;j<newArr.length;j++){
|
|
828
|
+ if(projectList[i].good_id == newArr[j].good_id){
|
|
829
|
+ newArr[j].child.push(projectList[i])
|
|
830
|
+ }
|
|
831
|
+ }
|
|
832
|
+ }
|
|
833
|
+
|
|
834
|
+ for(let i=0;i<newArr.length;i++){
|
|
835
|
+ for(let j=0;j<newArr[i].child.length;j++){
|
|
836
|
+ newArr[i].count += parseInt(newArr[i].child[j].count)
|
|
837
|
+ }
|
|
838
|
+ }
|
|
839
|
+ console.log("newArr32323233223wo",newArr)
|
|
840
|
+ this.tableList = newArr
|
|
841
|
+ }
|
|
842
|
+ })
|
|
843
|
+ },
|
706
|
844
|
handleScheduleDateChange(val) {
|
707
|
845
|
this.query.schedule_date = val
|
708
|
846
|
this.query.page = 1
|
|
@@ -1455,9 +1593,58 @@
|
1455
|
1593
|
}
|
1456
|
1594
|
|
1457
|
1595
|
},
|
1458
|
|
- getStr(good_type_id,arrNew){
|
1459
|
|
- console.log("good_type_id",good_type_id)
|
1460
|
|
- console.log("arrNew",arrNew)
|
|
1596
|
+ getStr(good_type_id,arrNew,patient_id){
|
|
1597
|
+ // console.log("ARR233323",arrNew)
|
|
1598
|
+ var arr= []
|
|
1599
|
+ var str = ""
|
|
1600
|
+ if(arrNew!=null && arrNew.length > 0){
|
|
1601
|
+ for(let i=0;i<arrNew.length;i++){
|
|
1602
|
+ arrNew[i].good_type_id = 0
|
|
1603
|
+ arrNew[i].good_type_id = arrNew[i].good_info.good_type_id
|
|
1604
|
+ arrNew[i].good_id = 0
|
|
1605
|
+ arrNew[i].good_id = arrNew[i].good_info.id
|
|
1606
|
+ if(arrNew[i].patient_id == patient_id && arrNew[i].good_info.good_type_id == good_type_id){
|
|
1607
|
+ arr.push(arrNew[i])
|
|
1608
|
+ }
|
|
1609
|
+ }
|
|
1610
|
+ }
|
|
1611
|
+
|
|
1612
|
+ let dataInfo = {}
|
|
1613
|
+ if(arr!=null && arr.length > 0){
|
|
1614
|
+ arr.forEach((item, index) => {
|
|
1615
|
+ let { good_id } = item
|
|
1616
|
+ if (!dataInfo[good_id]) {
|
|
1617
|
+ dataInfo[good_id] = {
|
|
1618
|
+ good_id:item.good_id,
|
|
1619
|
+ child: [],
|
|
1620
|
+ count:0,
|
|
1621
|
+ specification_name:item.good_info.specification_name
|
|
1622
|
+ }
|
|
1623
|
+ }
|
|
1624
|
+ })
|
|
1625
|
+ let newArr = Object.values(dataInfo)
|
|
1626
|
+ console.log("newArr",newArr)
|
|
1627
|
+ for(let i=0;i<arr.length;i++){
|
|
1628
|
+ for(let j=0;j<newArr.length;j++){
|
|
1629
|
+ if( arr[i].good_info.id == newArr[j].good_id){
|
|
1630
|
+ newArr[j].child.push(arr[i])
|
|
1631
|
+ }
|
|
1632
|
+ }
|
|
1633
|
+ }
|
|
1634
|
+
|
|
1635
|
+ if(newArr!=null && newArr.length > 0){
|
|
1636
|
+ for(let j=0;j<newArr.length;j++){
|
|
1637
|
+ for(let z=0;z<newArr[j].child.length;z++){
|
|
1638
|
+ newArr[j].count += parseInt(newArr[j].child[z].count)
|
|
1639
|
+ }
|
|
1640
|
+ }
|
|
1641
|
+ for(let j=0;j<newArr.length;j++){
|
|
1642
|
+ str += newArr[j].specification_name + "*" + newArr[j].count + " "
|
|
1643
|
+ }
|
|
1644
|
+ }
|
|
1645
|
+ }
|
|
1646
|
+
|
|
1647
|
+ return str
|
1461
|
1648
|
}
|
1462
|
1649
|
}
|
1463
|
1650
|
}
|