Browse Source

医护管理

XMLWAN 4 years ago
parent
commit
9fd6db0c74
1 changed files with 54 additions and 6 deletions
  1. 54 6
      src/xt_pages/medicalScheduling/schedulingStatistics.vue

+ 54 - 6
src/xt_pages/medicalScheduling/schedulingStatistics.vue View File

@@ -260,7 +260,8 @@ export default {
260 260
 
261 261
             doctorlist:[],
262 262
             doctorArr:[],
263
-            nurseArr:[]
263
+            nurseArr:[],
264
+            downloadLoading: false,
264 265
 
265 266
         }
266 267
     },
@@ -769,12 +770,59 @@ export default {
769 770
                 return Count
770 771
             }   
771 772
         },
772
-        toPrint(){
773
-            this.$router.push({
774
-                path: '/medicalScheduling/statistics/print',
775
-                // query: { date: date }
776
-            }) 
773
+        // toPrint(){
774
+        //     this.$router.push({
775
+        //         path: '/medicalScheduling/statistics/print',
776
+        //         // query: { date: date }
777
+        //     }) 
778
+        // },
779
+        toPrint: function() {
780
+            this.downloadLoading = true
781
+            import('@/vendor/Export2Excel').then(excel => {
782
+            const filterVal = ['医护姓名','早班','中班','晚班','夜班','全班']
783
+            const multiHeader = []
784
+            const header = []
785
+            const merges = []
786
+            let obj = {"name":"李四"}
787
+            let obj2 = {"name":"李四"}
788
+            let obj3 = {"name":"李四"}
789
+            var list = []
790
+            list.push(obj)
791
+            list.push(obj2)
792
+            list.push(obj3)
793
+            let i = 0
794
+            console.log("list",list)
795
+            const data = this.formatJson(filterVal, list)
796
+            console.log("data",data)
797
+            const filename = '排班模版'
798
+            return false
799
+            excel.export_json_to_excel({
800
+                multiHeader,
801
+                header,
802
+                merges,
803
+                data,
804
+                filename
805
+            })
806
+            this.downloadLoading = false
807
+            })
808
+
777 809
         },
810
+        formatJson(filterVal, jsonData) {
811
+            return jsonData.map(v =>
812
+            filterVal.map(j => {
813
+                console.log(v)
814
+                console.log(j)
815
+                console.log(v[j])
816
+
817
+                if (j === 'timestamp') {
818
+                return parseTime(v[j])
819
+                } else {
820
+                return v[j]
821
+                }
822
+            })
823
+            )
824
+        },
825
+
778 826
         //获取统计图数据
779 827
         getchartlist(){
780 828
              if(this.timeSlot == 1){