|
@@ -158,6 +158,10 @@
|
158
|
158
|
<el-button type="primary" size="small" @click="toSettle">收费</el-button>
|
159
|
159
|
</div> -->
|
160
|
160
|
|
|
161
|
+ <div style="margin-top: 10px;margin-bottom:10px">
|
|
162
|
+ <el-button type="primary" size="small" @click="toStatic">统计</el-button>
|
|
163
|
+ </div>
|
|
164
|
+
|
161
|
165
|
|
162
|
166
|
<el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
|
163
|
167
|
@selection-change="handleSelectionChange"
|
|
@@ -500,14 +504,86 @@
|
500
|
504
|
</span>
|
501
|
505
|
</el-dialog>
|
502
|
506
|
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+ <el-dialog
|
|
510
|
+ title="药品统计表"
|
|
511
|
+ :visible.sync="startdialogVisible"
|
|
512
|
+ width="70%">
|
|
513
|
+ <span>
|
|
514
|
+ <div class="cell clearfix" style="margin-bottom:10px">
|
|
515
|
+ <label class="title"> <span class="name">排班班次</span> : </label>
|
|
516
|
+ <el-select v-model="schedule_type" placeholder="请选择" @change="changeScheduleType">
|
|
517
|
+ <el-option
|
|
518
|
+ v-for="item in schedulArr"
|
|
519
|
+ :key="item.value"
|
|
520
|
+ :label="item.label"
|
|
521
|
+ :value="item.value">
|
|
522
|
+ </el-option>
|
|
523
|
+ </el-select>
|
|
524
|
+ <label class="title"> <span class="name">病区选择</span> : </label>
|
|
525
|
+ <el-select v-model="partion_type" placeholder="请选择" @change="changePartionType">
|
|
526
|
+ <el-option
|
|
527
|
+ v-for="item in partitionArr"
|
|
528
|
+ :key="item.id"
|
|
529
|
+ :label="item.name"
|
|
530
|
+ :value="item.id">
|
|
531
|
+ </el-option>
|
|
532
|
+ </el-select>
|
|
533
|
+ <el-button size="small" icon="el-icon-printer" @click="toPrintOne" type="primary">打印</el-button>
|
|
534
|
+ <el-button size="small" @click="toExportListOne" type="primary">导出</el-button>
|
|
535
|
+ </div>
|
|
536
|
+
|
|
537
|
+ <el-table
|
|
538
|
+ :data="tableList"
|
|
539
|
+ border
|
|
540
|
+ :row-style="{ color: '#303133' }"
|
|
541
|
+ :header-cell-style="{
|
|
542
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
543
|
+ color: '#606266'
|
|
544
|
+ }"
|
|
545
|
+ >
|
|
546
|
+ <el-table-column align="center" label="序号">
|
|
547
|
+ <template slot-scope="scope">
|
|
548
|
+ {{scope.$index+1}}
|
|
549
|
+ </template>
|
|
550
|
+ </el-table-column>
|
|
551
|
+ <el-table-column align="center" label="药品名称">
|
|
552
|
+ <template slot-scope="scope">
|
|
553
|
+ {{scope.row.advice_name}}
|
|
554
|
+ </template>
|
|
555
|
+ </el-table-column>
|
|
556
|
+ <el-table-column align="center" label="规格">
|
|
557
|
+ <template slot-scope="scope">
|
|
558
|
+ {{scope.row.specification_name}}
|
|
559
|
+ </template>
|
|
560
|
+ </el-table-column>
|
|
561
|
+
|
|
562
|
+ <el-table-column align="center" label="数量">
|
|
563
|
+ <template slot-scope="scope">
|
|
564
|
+ <span v-if="config.is_open!=1">{{getCount(scope.row.child)}}</span>
|
|
565
|
+ <span v-if="config.is_open ==1">{{getHisCount(scope.row.child,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
|
|
566
|
+ </template>
|
|
567
|
+ </el-table-column>
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+ </el-table>
|
|
572
|
+ </span>
|
|
573
|
+ <span slot="footer" class="dialog-footer">
|
|
574
|
+ <el-button @click="startdialogVisible = false">取 消</el-button>
|
|
575
|
+ <el-button type="primary" @click="startdialogVisible = false">确 定</el-button>
|
|
576
|
+ </span>
|
|
577
|
+ </el-dialog>
|
503
|
578
|
</div>
|
504
|
579
|
|
|
580
|
+
|
505
|
581
|
</div>
|
506
|
582
|
</template>
|
507
|
583
|
|
508
|
584
|
<script>
|
509
|
585
|
const moment = require('moment')
|
510
|
|
-import { getSchedualPatient, GetAllZone } from "@/api/dialysis";
|
|
586
|
+import { getSchedualPatient, GetAllZone,getDialysisAdviceToday } from "@/api/dialysis";
|
511
|
587
|
import { parseTime } from "@/utils";
|
512
|
588
|
import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
513
|
589
|
import { getPrintTemplate } from "@/api/data";
|
|
@@ -585,6 +661,12 @@ export default {
|
585
|
661
|
is_status:0,
|
586
|
662
|
execTimeDialogVisibleOne:false,
|
587
|
663
|
current_row:{},
|
|
664
|
+ tableList:[],
|
|
665
|
+ startdialogVisible:false,
|
|
666
|
+ schedule_type:0,
|
|
667
|
+ partion_type:0,
|
|
668
|
+ druglist:[],
|
|
669
|
+ config:{},
|
588
|
670
|
};
|
589
|
671
|
},
|
590
|
672
|
created() {
|
|
@@ -1413,13 +1495,11 @@ export default {
|
1413
|
1495
|
return false
|
1414
|
1496
|
}
|
1415
|
1497
|
var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
|
1416
|
|
- console.log("param2332323",this.current_row)
|
1417
|
1498
|
var params= {
|
1418
|
1499
|
advice_id:this.current_row.id,
|
1419
|
1500
|
advice_date: moment(this.time).format('YYYY-MM-DD'),
|
1420
|
1501
|
exec_time:execTime,
|
1421
|
1502
|
}
|
1422
|
|
- console.log("prams232323",params)
|
1423
|
1503
|
excutionDoctorAdviceById(params).then(response=>{
|
1424
|
1504
|
if(response.data.state == 1){
|
1425
|
1505
|
if(response.data.data.msg == 2){
|
|
@@ -1447,7 +1527,235 @@ export default {
|
1447
|
1527
|
}
|
1448
|
1528
|
}
|
1449
|
1529
|
})
|
1450
|
|
- }
|
|
1530
|
+ },
|
|
1531
|
+
|
|
1532
|
+ toStatic() {
|
|
1533
|
+ this.tableList = []
|
|
1534
|
+ var params = {
|
|
1535
|
+ schedule_type:this.schedule_type,
|
|
1536
|
+ partion_type:this.partion_type,
|
|
1537
|
+ selected_date: moment(this.time).format('YYYY-MM-DD'),
|
|
1538
|
+ }
|
|
1539
|
+ console.log("params2332232wo",params)
|
|
1540
|
+ getDialysisAdviceToday(params).then(response=>{
|
|
1541
|
+ if(response.data.state == 1){
|
|
1542
|
+ var doctorList = []
|
|
1543
|
+ var druglist = response.data.data.drug
|
|
1544
|
+ this.druglist = druglist
|
|
1545
|
+ this.startdialogVisible = true
|
|
1546
|
+ var list = response.data.data.list
|
|
1547
|
+
|
|
1548
|
+ var config = response.data.data.config
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+ if(list!=null && list.length > 0){
|
|
1552
|
+ for(let i=0;i<list.length;i++){
|
|
1553
|
+ for(let j=0;j<list[i].xt_doctor_advice.length;j++){
|
|
1554
|
+ doctorList.push(list[i].xt_doctor_advice[j])
|
|
1555
|
+ }
|
|
1556
|
+ }
|
|
1557
|
+ }
|
|
1558
|
+
|
|
1559
|
+ if(config.is_open!=1){
|
|
1560
|
+ if(doctorList!=null && doctorList.length > 0){
|
|
1561
|
+ let dataInfo = {}
|
|
1562
|
+ doctorList.forEach((item, index) => {
|
|
1563
|
+ let { advice_name } = item
|
|
1564
|
+ if (!dataInfo[advice_name]) {
|
|
1565
|
+ dataInfo[advice_name] = {
|
|
1566
|
+ advice_name:item.advice_name,
|
|
1567
|
+ child: [],
|
|
1568
|
+ count:0,
|
|
1569
|
+ drug_id:item.drug_id,
|
|
1570
|
+ specification_name:item.advice_desc +item.drug_spec_unit,
|
|
1571
|
+ patient_id:item.patient_id,
|
|
1572
|
+ }
|
|
1573
|
+ }
|
|
1574
|
+ })
|
|
1575
|
+ let arr = Object.values(dataInfo)
|
|
1576
|
+ // console.log("arr23332323232",arr)
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+ if(arr.length > 0){
|
|
1580
|
+ for(let i=0;i<doctorList.length;i++){
|
|
1581
|
+ for(let j=0;j<arr.length;j++){
|
|
1582
|
+ if(doctorList[i].advice_name == arr[j].advice_name){
|
|
1583
|
+ arr[j].child.push(doctorList[i])
|
|
1584
|
+ }
|
|
1585
|
+ }
|
|
1586
|
+ }
|
|
1587
|
+ }
|
|
1588
|
+
|
|
1589
|
+ this.tableList = []
|
|
1590
|
+ for(let i=0;i<list.length;i++){
|
|
1591
|
+ for(let j=0;j<arr.length;j++){
|
|
1592
|
+ if(list[i].patient_id == arr[j].patient_id){
|
|
1593
|
+ this.tableList.push(arr[j])
|
|
1594
|
+ }
|
|
1595
|
+ }
|
|
1596
|
+ }
|
|
1597
|
+
|
|
1598
|
+ }
|
|
1599
|
+ }
|
|
1600
|
+
|
|
1601
|
+ var his_doctor_advice = []
|
|
1602
|
+
|
|
1603
|
+ for(let i=0;i<list.length;i++){
|
|
1604
|
+ for(let j=0;j<list[i].his_doctor_advice.length;j++){
|
|
1605
|
+ his_doctor_advice.push(list[i].his_doctor_advice[j])
|
|
1606
|
+ }
|
|
1607
|
+ }
|
|
1608
|
+ console.log("his_doctor_advice",his_doctor_advice)
|
|
1609
|
+
|
|
1610
|
+ var newHisArr = []
|
|
1611
|
+ for(let i=0;i<his_doctor_advice.length;i++){
|
|
1612
|
+ his_doctor_advice[i].count_one = 0
|
|
1613
|
+ if(his_doctor_advice[i].prescribing_number_unit == his_doctor_advice[i].drug.max_unit){
|
|
1614
|
+ his_doctor_advice[i].prescribing_number = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
|
|
1615
|
+ his_doctor_advice[i].count_one = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
|
|
1616
|
+ }
|
|
1617
|
+ }
|
|
1618
|
+
|
|
1619
|
+ for(let i=0;i<his_doctor_advice.length;i++){
|
|
1620
|
+ for(let j=0;j<druglist.length;j++){
|
|
1621
|
+ if(his_doctor_advice[i].drug_id == druglist[j].id){
|
|
1622
|
+ newHisArr.push(his_doctor_advice[i])
|
|
1623
|
+ }
|
|
1624
|
+ }
|
|
1625
|
+ }
|
|
1626
|
+ console.log("下盘子3223323223",newHisArr)
|
|
1627
|
+
|
|
1628
|
+ if(config.is_open == 1){
|
|
1629
|
+ if(newHisArr!=null && newHisArr.length > 0){
|
|
1630
|
+ let dataInfoOne = {}
|
|
1631
|
+ newHisArr.forEach((item, index) => {
|
|
1632
|
+ let { advice_name } = item
|
|
1633
|
+ if (!dataInfoOne[advice_name]) {
|
|
1634
|
+ dataInfoOne[advice_name] = {
|
|
1635
|
+ advice_name:item.advice_name,
|
|
1636
|
+ child: [],
|
|
1637
|
+ count:0,
|
|
1638
|
+ specification_name:this.getSpecification(item.drug_id),
|
|
1639
|
+ drug_id:item.drug_id,
|
|
1640
|
+ patient_id:item.patient_id,
|
|
1641
|
+ min_number:item.drug.min_number,
|
|
1642
|
+ max_unit:item.drug.max_unit,
|
|
1643
|
+ min_unit:item.drug.min_unit
|
|
1644
|
+ }
|
|
1645
|
+ }
|
|
1646
|
+ })
|
|
1647
|
+ let hisarr = Object.values(dataInfoOne)
|
|
1648
|
+ console.log("hisarr233232233232",hisarr)
|
|
1649
|
+ if(hisarr.length > 0){
|
|
1650
|
+ for(let i=0;i<newHisArr.length;i++){
|
|
1651
|
+ for(let j=0;j<hisarr.length;j++){
|
|
1652
|
+ if(newHisArr[i].drug_id == hisarr[j].drug_id){
|
|
1653
|
+ hisarr[j].child.push(newHisArr[i])
|
|
1654
|
+ }
|
|
1655
|
+ }
|
|
1656
|
+ }
|
|
1657
|
+ }
|
|
1658
|
+ console.log("hisarr",hisarr)
|
|
1659
|
+ this.tableList = []
|
|
1660
|
+ this.tableList = hisarr
|
|
1661
|
+ }
|
|
1662
|
+
|
|
1663
|
+ console.log("中国人民解放军",this.tableList)
|
|
1664
|
+ }
|
|
1665
|
+ }
|
|
1666
|
+ })
|
|
1667
|
+
|
|
1668
|
+ },
|
|
1669
|
+
|
|
1670
|
+ getSpecification(id){
|
|
1671
|
+ var specification_name = ""
|
|
1672
|
+ for(let i=0;i<this.druglist.length;i++){
|
|
1673
|
+ if(id == this.druglist[i].id){
|
|
1674
|
+ 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
|
|
1675
|
+ }
|
|
1676
|
+ }
|
|
1677
|
+ return specification_name
|
|
1678
|
+ },
|
|
1679
|
+ getCount(val){
|
|
1680
|
+ var count = 0
|
|
1681
|
+ if(val!=null && val.length > 0){
|
|
1682
|
+ for(let i=0;i<val.length;i++){
|
|
1683
|
+ count += parseInt(val[i].prescribing_number)
|
|
1684
|
+ }
|
|
1685
|
+ }
|
|
1686
|
+ if(count > 0){
|
|
1687
|
+ return count
|
|
1688
|
+ }else{
|
|
1689
|
+ return 0
|
|
1690
|
+ }
|
|
1691
|
+ },
|
|
1692
|
+ getHisCount(val,max_unit,min_unit,min_number){
|
|
1693
|
+ var total = 0
|
|
1694
|
+ var max_str = "";
|
|
1695
|
+ var min_str = "";
|
|
1696
|
+ for(let i=0;i<val.length;i++){
|
|
1697
|
+ total+=parseInt(val[i].prescribing_number)
|
|
1698
|
+ }
|
|
1699
|
+ if (total < min_number) {
|
|
1700
|
+ min_str = total + min_unit;
|
|
1701
|
+ }
|
|
1702
|
+ if (total == 0) {
|
|
1703
|
+ min_str = "";
|
|
1704
|
+ max_str = "";
|
|
1705
|
+ }
|
|
1706
|
+ if (total >= min_number) {
|
|
1707
|
+ if (parseInt(total / min_number) != 0) {
|
|
1708
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
1709
|
+ }
|
|
1710
|
+ if (total % min_number != 0) {
|
|
1711
|
+ min_str = (total % min_number) + min_unit;
|
|
1712
|
+ }
|
|
1713
|
+ }
|
|
1714
|
+ return max_str + min_str;
|
|
1715
|
+
|
|
1716
|
+ },
|
|
1717
|
+ toPrintOne(){
|
|
1718
|
+ var schedule_date = moment(this.time).format('YYYY-MM-DD')
|
|
1719
|
+ this.$router.push({path:"/dialysis/doctorAdviceStaticPrint?schedule_type="+this.schedule_type+"&partion_type="+this.partion_type+"&schedule_date="+schedule_date+"&is_open="+this.config.is_open})
|
|
1720
|
+ },
|
|
1721
|
+ toExportListOne(){
|
|
1722
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
1723
|
+
|
|
1724
|
+ if(this.tableList!=null && this.tableList.length > 0){
|
|
1725
|
+ for(let i=0;i<this.tableList.length;i++){
|
|
1726
|
+ this.tableList[i].index = i+1
|
|
1727
|
+ if(this.config.is_open == 1){
|
|
1728
|
+ this.tableList[i].total_count = this.getHisCount(this.tableList[i].child,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
|
|
1729
|
+ }
|
|
1730
|
+ if(this.config.is_open!=1){
|
|
1731
|
+ this.tableList[i].total_count = this.getCount(this.tableList[i].child)
|
|
1732
|
+ }
|
|
1733
|
+
|
|
1734
|
+ }
|
|
1735
|
+ }
|
|
1736
|
+ const tHeader = ['序号','药品名称','规格','数量']
|
|
1737
|
+ const filterVal = ['index','advice_name','specification_name','total_count']
|
|
1738
|
+
|
|
1739
|
+ const data = this.formatJson(filterVal, this.tableList)
|
|
1740
|
+ excel.export_json_to_excel({
|
|
1741
|
+ header: tHeader,
|
|
1742
|
+ data,
|
|
1743
|
+ filename: '药品统计'
|
|
1744
|
+ })
|
|
1745
|
+ this.downloadLoading = false
|
|
1746
|
+ })
|
|
1747
|
+ },
|
|
1748
|
+ formatJson(filterVal, jsonData) {
|
|
1749
|
+ return jsonData.map(v => filterVal.map(j => v[j]));
|
|
1750
|
+ },
|
|
1751
|
+ changeScheduleType(){
|
|
1752
|
+ this.tableList = []
|
|
1753
|
+ this.toStatic()
|
|
1754
|
+ },
|
|
1755
|
+ changePartionType(){
|
|
1756
|
+ this.tableList = []
|
|
1757
|
+ this.toStatic()
|
|
1758
|
+ }
|
1451
|
1759
|
},
|
1452
|
1760
|
components: {
|
1453
|
1761
|
BreadCrumb
|
|
@@ -1545,3 +1853,12 @@ export default {
|
1545
|
1853
|
height: 20px;
|
1546
|
1854
|
}
|
1547
|
1855
|
</style>
|
|
1856
|
+<style lang="scss" scoped>
|
|
1857
|
+ .page_consumables {
|
|
1858
|
+
|
|
1859
|
+ .clearfix:after {
|
|
1860
|
+ content: none;
|
|
1861
|
+ }
|
|
1862
|
+
|
|
1863
|
+ }
|
|
1864
|
+</style>
|