See999 4 年 前
コミット
efad800e71
共有2 個のファイルを変更した387 個の追加46 個の削除を含む
  1. 265 2
      src/xt_pages/medicalScheduling/index.vue
  2. 122 44
      src/xt_pages/medicalScheduling/schedulingStatistics.vue

+ 265 - 2
src/xt_pages/medicalScheduling/index.vue ファイルの表示

1316
                 if(response.data.state == 1){
1316
                 if(response.data.state == 1){
1317
                     var  staffList =  response.data.data.staffList
1317
                     var  staffList =  response.data.data.staffList
1318
                     // console.log("staffList",staffList)
1318
                     // console.log("staffList",staffList)
1319
+                    var sevenStr = ""
1320
+                     var oneStr = ""
1321
+                    var twoStr = ""
1322
+                    var threeStr = ""
1323
+                    var fourStr = ""
1324
+                    var fiveStr = ""
1325
+                    var sixStr = ""
1326
+                    this.arrZero = []
1327
+                    this.arrOne = []
1328
+                    this.arrTwo = []
1329
+                    this.arrThree = []
1330
+                    this.arrFour = []
1331
+                    this.arrFive = []
1332
+                    this.arrSix = []
1333
+                  for(let i=0;i<staffList.length;i++){
1334
+                    if(staffList[i].schedule_week == 0){
1335
+                        staffList[i].class_index = 0
1336
+                         var arr = []
1337
+                        this.arrZero.push(staffList[i].class_name)
1338
+                        for(let i=0;i<this.arrZero.length;i++){
1339
+                           if(this.arrZero[i]!=''){
1340
+                              arr.push(this.arrZero[i])
1341
+                           }
1342
+                        }
1343
+                        var countedNames = arr.reduce(function (allNames, name) {
1344
+                            if (name in allNames) {
1345
+                                allNames[name]++;
1346
+                            }
1347
+                            else {
1348
+                                allNames[name] = 1;
1349
+                            }
1350
+                            return allNames;
1351
+                        }, {});
1352
+                        let objKey = Object.keys(countedNames)
1353
+                        let objVal = Object.values(countedNames)
1354
+                        var zeroStr = ''
1355
+                        objKey.map((item,index) => {
1356
+                        let objVal = Object.values(countedNames)
1357
+                            zeroStr += item + objVal[index] + '\n'
1358
+                        })
1359
+                        sevenStr = zeroStr
1360
+                    }
1361
+                    if(staffList[i].schedule_week == 1){
1362
+                        staffList[i].class_index = 1
1363
+                        var arr = []
1364
+                        this.arrOne.push(staffList[i].class_name)
1365
+                        for(let i=0;i<this.arrOne.length;i++){
1366
+                           if(this.arrOne[i]!=''){
1367
+                              arr.push(this.arrOne[i])
1368
+                           }
1369
+                        }
1370
+                        var countedNames = arr.reduce(function (allNames, name) {
1371
+                            if (name in allNames) {
1372
+                                allNames[name]++;
1373
+                            }
1374
+                            else {
1375
+                                allNames[name] = 1;
1376
+                            }
1377
+                            return allNames;
1378
+                        }, {});
1379
+                        let objKey = Object.keys(countedNames)
1380
+                        let objVal = Object.values(countedNames)
1381
+                        let strOne = ''
1382
+                        objKey.map((item,index) => {
1383
+                        let objVal = Object.values(countedNames)
1384
+                            strOne += item + objVal[index] + '\n'
1385
+                        })
1386
+                        oneStr  = strOne
1387
+                    }
1388
+                    if(staffList[i].schedule_week == 2){
1389
+                        staffList[i].class_index = 2
1390
+                         var arr = []
1391
+                        this.arrTwo.push(staffList[i].class_name)
1392
+                        for(let i=0;i<this.arrTwo.length;i++){
1393
+                           if(this.arrTwo[i]!=''){
1394
+                              arr.push(this.arrTwo[i])
1395
+                           }
1396
+                        }
1397
+                        var countedNames = arr.reduce(function (allNames, name) {
1398
+                            if (name in allNames) {
1399
+                                allNames[name]++;
1400
+                            }
1401
+                            else {
1402
+                                allNames[name] = 1;
1403
+                            }
1404
+                            return allNames;
1405
+                        }, {});
1406
+                        let objKey = Object.keys(countedNames)
1407
+                        let objVal = Object.values(countedNames)
1408
+                        let strTwo = ''
1409
+                        objKey.map((item,index) => {
1410
+                        let objVal = Object.values(countedNames)
1411
+                            strTwo += item + objVal[index] + '\n'
1412
+                        })
1413
+                         twoStr = strTwo
1414
+                    }
1415
+                    if(staffList[i].schedule_week == 3){
1416
+                        staffList[i].class_index = 3
1417
+                         var arr = []
1418
+                        this.arrThree.push(staffList[i].class_name)
1419
+                        for(let i=0;i<this.arrThree.length;i++){
1420
+                           if(this.arrThree[i]!=''){
1421
+                              arr.push(this.arrThree[i])
1422
+                           }
1423
+                        }
1424
+                        var countedNames = arr.reduce(function (allNames, name) {
1425
+                            if (name in allNames) {
1426
+                                allNames[name]++;
1427
+                            }
1428
+                            else {
1429
+                                allNames[name] = 1;
1430
+                            }
1431
+                            return allNames;
1432
+                        }, {});
1433
+                        let objKey = Object.keys(countedNames)
1434
+                        let objVal = Object.values(countedNames)
1435
+                        let strThree = ''
1436
+                        objKey.map((item,index) => {
1437
+                        let objVal = Object.values(countedNames)
1438
+                            strThree += item + objVal[index] + '\n'
1439
+                        })
1440
+                        threeStr = strThree
1441
+                    }
1442
+                    if(staffList[i].schedule_week == 4){
1443
+                        staffList[i].class_index = 4
1444
+                        var arr = []
1445
+                        this.arrFour.push(staffList[i].class_name)
1446
+                        for(let i=0;i<this.arrFour.length;i++){
1447
+                           if(this.arrFour[i]!=''){
1448
+                              arr.push(this.arrFour[i])
1449
+                           }
1450
+                        }
1451
+                        var countedNames = arr.reduce(function (allNames, name) {
1452
+                            if (name in allNames) {
1453
+                                allNames[name]++;
1454
+                            }
1455
+                            else {
1456
+                                allNames[name] = 1;
1457
+                            }
1458
+                            return allNames;
1459
+                        }, {});
1460
+                        let objKey = Object.keys(countedNames)
1461
+                        let objVal = Object.values(countedNames)
1462
+                        let strFour = ''
1463
+                        objKey.map((item,index) => {
1464
+                        let objVal = Object.values(countedNames)
1465
+                            strFour += item + objVal[index] + '\n'
1466
+                        })
1467
+                        fourStr = strFour
1468
+                    }
1469
+                    if(staffList[i].schedule_week == 5){
1470
+                        staffList[i].class_index = 5
1319
 
1471
 
1472
+                         var arr = []
1473
+                        this.arrFive.push(staffList[i].class_name)
1474
+                        for(let i=0;i<this.arrFive.length;i++){
1475
+                           if(this.arrFive[i]!=''){
1476
+                              arr.push(this.arrFive[i])
1477
+                           }
1478
+                        }
1479
+                        var countedNames = arr.reduce(function (allNames, name) {
1480
+                            if (name in allNames) {
1481
+                                allNames[name]++;
1482
+                            }
1483
+                            else {
1484
+                                allNames[name] = 1;
1485
+                            }
1486
+                            return allNames;
1487
+                        }, {});
1488
+                        let objKey = Object.keys(countedNames)
1489
+                        let objVal = Object.values(countedNames)
1490
+                        let strFive = ''
1491
+                        objKey.map((item,index) => {
1492
+                        let objVal = Object.values(countedNames)
1493
+                            strFive += item + objVal[index] + '\n'
1494
+                        })
1495
+                         fiveStr = strFive
1496
+                    }
1497
+                    if(staffList[i].schedule_week == 6){
1498
+                        staffList[i].class_index = 6
1499
+                         var arr = []
1500
+                        this.arrSix.push(staffList[i].class_name)
1501
+                        for(let i=0;i<this.arrSix.length;i++){
1502
+                           if(this.arrSix[i]!=''){
1503
+                              arr.push(this.arrSix[i])
1504
+                           }
1505
+                        }
1506
+                        var countedNames = arr.reduce(function (allNames, name) {
1507
+                            if (name in allNames) {
1508
+                                allNames[name]++;
1509
+                            }
1510
+                            else {
1511
+                                allNames[name] = 1;
1512
+                            }
1513
+                            return allNames;
1514
+                        }, {});
1515
+                        let objKey = Object.keys(countedNames)
1516
+                        let objVal = Object.values(countedNames)
1517
+                        let strSix = ''
1518
+                        objKey.map((item,index) => {
1519
+                        let objVal = Object.values(countedNames)
1520
+                            strSix += item + objVal[index] + '\n'
1521
+                        })
1522
+                        sixStr = strSix
1523
+                     }
1524
+                    }
1320
                     let tempArr = [], newArr = []
1525
                     let tempArr = [], newArr = []
1321
                     for (let i = 0; i < staffList.length; i++) {
1526
                     for (let i = 0; i < staffList.length; i++) {
1322
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
1527
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
1387
                         })
1592
                         })
1388
                         newDoctor.sort(this.compare('sort'))
1593
                         newDoctor.sort(this.compare('sort'))
1389
                         
1594
                         
1595
+                        // let data = []
1596
+                        // data.push(...newNurse)
1597
+                        // data.push(...newDoctor)
1598
+                        // this.tableData = data
1599
+                        let arr2 = []
1600
+                        arr2.push({class_name:oneStr,schedule_week:1})
1601
+                        arr2.push({class_name:twoStr,schedule_week:2})
1602
+                        arr2.push({class_name:threeStr,schedule_week:3})
1603
+                        arr2.push({class_name:fourStr,schedule_week:4})
1604
+                        arr2.push({class_name:fiveStr,schedule_week:5})
1605
+                        arr2.push({class_name:sixStr,schedule_week:6})
1606
+                        arr2.push({class_name:zeroStr,schedule_week:0})
1607
+                        var obj = {}
1608
+                        obj.admin_user_id = "1000000"
1609
+                        obj.user_name = "合计"
1610
+                        obj.user_type = 10
1611
+                        obj.list = arr2
1612
+                        arr.push(obj)
1613
+
1390
                         let data = []
1614
                         let data = []
1391
                         data.push(...newNurse)
1615
                         data.push(...newNurse)
1392
                         data.push(...newDoctor)
1616
                         data.push(...newDoctor)
1617
+                        data.push(obj)
1393
                         this.tableData = data
1618
                         this.tableData = data
1394
                     }
1619
                     }
1395
                     if(id == 2){
1620
                     if(id == 2){
1409
                             }
1634
                             }
1410
                         })
1635
                         })
1411
                         newDoctor.sort(this.compare('sort'))
1636
                         newDoctor.sort(this.compare('sort'))
1412
-                        this.tableData = newDoctor
1637
+                        // this.tableData = newDoctor
1638
+                        let arr2 = []
1639
+                        arr2.push({class_name:oneStr,schedule_week:1})
1640
+                        arr2.push({class_name:twoStr,schedule_week:2})
1641
+                        arr2.push({class_name:threeStr,schedule_week:3})
1642
+                        arr2.push({class_name:fourStr,schedule_week:4})
1643
+                        arr2.push({class_name:fiveStr,schedule_week:5})
1644
+                        arr2.push({class_name:sixStr,schedule_week:6})
1645
+                        arr2.push({class_name:zeroStr,schedule_week:0})
1646
+                        var obj = {}
1647
+                        obj.admin_user_id = "1000000"
1648
+                        obj.user_name = "合计"
1649
+                        obj.user_type = 10
1650
+                        obj.list = arr2
1651
+                        arr.push(obj)
1652
+
1653
+                        let data = []
1654
+                        data.push(...newDoctor)
1655
+                        data.push(obj)
1656
+                        this.tableData = data
1413
                     }
1657
                     }
1414
                     if(id == 3){
1658
                     if(id == 3){
1415
                         newNurse.sort(this.compare('admin_user_id'))
1659
                         newNurse.sort(this.compare('admin_user_id'))
1428
                             }
1672
                             }
1429
                         })
1673
                         })
1430
                         newNurse.sort(this.compare('sort'))
1674
                         newNurse.sort(this.compare('sort'))
1431
-                        this.tableData = newNurse
1675
+                        // this.tableData = newNurse
1676
+                        let arr2 = []
1677
+                        arr2.push({class_name:oneStr,schedule_week:1})
1678
+                        arr2.push({class_name:twoStr,schedule_week:2})
1679
+                        arr2.push({class_name:threeStr,schedule_week:3})
1680
+                        arr2.push({class_name:fourStr,schedule_week:4})
1681
+                        arr2.push({class_name:fiveStr,schedule_week:5})
1682
+                        arr2.push({class_name:sixStr,schedule_week:6})
1683
+                        arr2.push({class_name:zeroStr,schedule_week:0})
1684
+                        var obj = {}
1685
+                        obj.admin_user_id = "1000000"
1686
+                        obj.user_name = "合计"
1687
+                        obj.user_type = 10
1688
+                        obj.list = arr2
1689
+                        arr.push(obj)
1690
+
1691
+                        let data = []
1692
+                        data.push(...newNurse)
1693
+                        data.push(obj)
1694
+                        this.tableData = data
1432
                     }
1695
                     }
1433
 
1696
 
1434
             }
1697
             }

+ 122 - 44
src/xt_pages/medicalScheduling/schedulingStatistics.vue ファイルの表示

2
     <div class="main-contain">
2
     <div class="main-contain">
3
         <div class="position">
3
         <div class="position">
4
             <bread-crumb :crumbs="crumbs"></bread-crumb>
4
             <bread-crumb :crumbs="crumbs"></bread-crumb>
5
-            <div style="display:flex;align-items:center">
5
+            <!-- <div style="display:flex;align-items:center">
6
                 <el-button type="primary" icon="el-icon-printer" @click='toPrint'>打印</el-button>
6
                 <el-button type="primary" icon="el-icon-printer" @click='toPrint'>打印</el-button>
7
-            </div>
7
+            </div> -->
8
         </div>
8
         </div>
9
         <div class="app-container">
9
         <div class="app-container">
10
             <div class="cell clearfix">
10
             <div class="cell clearfix">
32
                         :value="item.value">
32
                         :value="item.value">
33
                     </el-option>
33
                     </el-option>
34
                 </el-select>
34
                 </el-select>
35
-                <el-radio v-model="timeSlot" label="1">周</el-radio>
35
+                <!-- <el-radio v-model="timeSlot" label="1">周</el-radio>
36
                 <el-radio v-model="timeSlot" label="2">月</el-radio>
36
                 <el-radio v-model="timeSlot" label="2">月</el-radio>
37
-                <el-radio v-model="timeSlot" label="3">自定义</el-radio>
37
+                <el-radio v-model="timeSlot" label="3">自定义</el-radio> -->
38
+                <el-radio-group v-model="timeSlot" @change="changeRadio">
39
+                <el-radio
40
+                  :label="gender.id"
41
+                  :value="gender.id"
42
+                  v-for="(gender, index) in faultPhase"
43
+                  :key="index"
44
+                  >{{ gender.name }}</el-radio
45
+                >
46
+               </el-radio-group>
38
                 <div style="display:flex;" v-if="timeSlot == '1'">
47
                 <div style="display:flex;" v-if="timeSlot == '1'">
39
                     <el-button @click="lastclick" type="text" style="margin:0 10px;">&lt;上一周({{ weekNum - 1 }})</el-button>
48
                     <el-button @click="lastclick" type="text" style="margin:0 10px;">&lt;上一周({{ weekNum - 1 }})</el-button>
40
                     <div class="dateBox">{{ weekDayArr[0] }}-{{ weekDayArr[6] }}({{ weekNum }})</div>
49
                     <div class="dateBox">{{ weekDayArr[0] }}-{{ weekDayArr[6] }}({{ weekNum }})</div>
80
                 <line-chart :options="chart"></line-chart>
89
                 <line-chart :options="chart"></line-chart>
81
             </div>
90
             </div>
82
             <div class="tableTitle">统计表</div>
91
             <div class="tableTitle">统计表</div>
83
-            <el-table class='statisticsTable' :data="tableData" height="250" border>
92
+            <el-table class='statisticsTable' :data="tableData" height="250" border ref="tab">
84
                 <el-table-column fixed align="center" prop="date" label="医护姓名" width="100">
93
                 <el-table-column fixed align="center" prop="date" label="医护姓名" width="100">
85
                     <template slot-scope="scope">
94
                     <template slot-scope="scope">
86
                         <span>{{scope.row.user_name}}</span>
95
                         <span>{{scope.row.user_name}}</span>
120
     },
129
     },
121
     data(){
130
     data(){
122
         return{
131
         return{
132
+          faultPhase: [
133
+              { id: "1", name: "周" },
134
+              { id: "2", name: "月" },
135
+              { id: "3", name: "自定义" },
136
+             ],
123
             pickerOptions: {
137
             pickerOptions: {
124
                 disabledDate(time) {
138
                 disabledDate(time) {
125
                     let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
139
                     let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
284
                 this.doctorlist.push(...nurselist)
298
                 this.doctorlist.push(...nurselist)
285
                 this.doctorlist.push(...doctorlist)
299
                 this.doctorlist.push(...doctorlist)
286
                 
300
                 
287
-                console.log("医护列表",this.doctorlist)
288
                 //获取统计图数据
301
                 //获取统计图数据
289
                 this.getchartlist()
302
                 this.getchartlist()
290
              }
303
              }
299
             }
312
             }
300
             const params = {
313
             const params = {
301
               keyword:this.keywords, 
314
               keyword:this.keywords, 
315
+              start_time:this.start_time,
316
+              end_time:this.end_time
302
             }
317
             }
303
-            console.log("params",params)
318
+            // console.log("params",params)
304
             toSearchTotal(params).then(response=>{
319
             toSearchTotal(params).then(response=>{
305
              if(response.data.state == 1){
320
              if(response.data.state == 1){
306
                 var scheudleTotal = response.data.data.scheduletotal 
321
                 var scheudleTotal = response.data.data.scheduletotal 
307
-                console.log("scheduletotal",scheudleTotal) 
322
+                // console.log("scheduletotal",scheudleTotal) 
308
                 var list = response.data.data.list
323
                 var list = response.data.data.list
309
-                console.log("list",list)
324
+                // console.log("list",list)
310
                 var workday = response.data.data.workDay
325
                 var workday = response.data.data.workDay
311
-                console.log("workday",workday)
326
+                // console.log("workday",workday)
312
                 var noWorkDay = response.data.data.noWorkDay
327
                 var noWorkDay = response.data.data.noWorkDay
313
-                console.log("noworkday",noWorkDay)
314
-
328
+                // console.log("noworkday",noWorkDay)
329
+                  
330
+            //     var workdaylist = response.data.data.chartWorkDayMinute
331
+
332
+            //    let arrtwo = [...workdaylist]
333
+            //     arrtwo.sort(this.compare('doctor_id'))
334
+            //     this.doctorlist.sort(this.compare('admin_user_id'))
335
+            //     this.doctorlist.forEach((item, index) => {
336
+            //      if (arrtwo[index] && item.admin_user_id ==arrtwo[index].doctor_id) {
337
+                        
338
+            //         }else{
339
+            //         arrtwo.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id,workminute: 0})
340
+            //         }
341
+            //      })
342
+                   
343
+            //      let chartX = []
344
+            //      let chartY = []
345
+            //      arrtwo.map(item => {
346
+            //        chartX.push(item.user_name)
347
+            //        chartY.push(item.workminute / 60)
348
+            //      })
349
+            //      this.chart.xAxis.data = chartX
350
+            //      this.chart.series[0].data = chartY
351
+
352
+            //      this.getArrLength(this.chart.xAxis.data)                
315
 
353
 
316
                 let tempArr = [], newArr = []
354
                 let tempArr = [], newArr = []
317
                 for (let i = 0; i < scheudleTotal.length; i++) {
355
                 for (let i = 0; i < scheudleTotal.length; i++) {
367
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
405
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
368
                       }
406
                       }
369
                     })
407
                     })
370
-                    console.log('newArr',arr)
408
+                   
371
                     this.tableData = arr
409
                     this.tableData = arr
410
+                    this.$nextTick(() => {
411
+                      this.$refs.tab.doLayout()
412
+                    }) 
372
                 }
413
                 }
373
               }
414
               }
374
           })  
415
           })  
404
                 this.nowYear = this.nowYear - 1
445
                 this.nowYear = this.nowYear - 1
405
             }
446
             }
406
             this.weekNum = this.weekNum - 1
447
             this.weekNum = this.weekNum - 1
448
+            this.getlist()
449
+            this.getchartlist()
407
         },
450
         },
408
         //下一周
451
         //下一周
409
         nextclick(){
452
         nextclick(){
417
                 this.weekNum = this.getYearWeek(year, month, date)
460
                 this.weekNum = this.getYearWeek(year, month, date)
418
                 this.nowYear = this.nowYear + 1
461
                 this.nowYear = this.nowYear + 1
419
             }
462
             }
463
+            this.getlist()
464
+            this.getchartlist()
420
         },
465
         },
421
         getYearWeek(year,month,date){
466
         getYearWeek(year,month,date){
422
             /*
467
             /*
436
 
481
 
437
         changeMonth(value){
482
         changeMonth(value){
438
             // console.log(value)
483
             // console.log(value)
439
-            console.log('monthStartTime',value.getTime() / 1000)
484
+            // console.log('monthStartTime',value.getTime() / 1000)
440
             let monthStartTime = value.getTime() / 1000
485
             let monthStartTime = value.getTime() / 1000
441
             var nowDate = new Date(value);
486
             var nowDate = new Date(value);
442
             var cloneNowDate = new Date(value);
487
             var cloneNowDate = new Date(value);
446
             let monthEndTime = this.getFullDate(cloneNowDate.setDate(endOfMonth))
491
             let monthEndTime = this.getFullDate(cloneNowDate.setDate(endOfMonth))
447
             this.start_time = monthStartTime
492
             this.start_time = monthStartTime
448
             this.end_time = this.getTimestamp(monthEndTime)
493
             this.end_time = this.getTimestamp(monthEndTime)
449
-            console.log('monthEndTime',this.getTimestamp(monthEndTime))
494
+            // console.log('monthEndTime',this.getTimestamp(monthEndTime))
450
             this.getlist()
495
             this.getlist()
496
+            this.getchartlist()
451
         },
497
         },
452
         getFullDate(targetDate) {
498
         getFullDate(targetDate) {
453
             var D, y, m, d;
499
             var D, y, m, d;
474
           getScheduleList().then(response=>{
520
           getScheduleList().then(response=>{
475
              if(response.data.state == 1){
521
              if(response.data.state == 1){
476
                 var schedulelist = response.data.data.scheduleList
522
                 var schedulelist = response.data.data.scheduleList
477
-                console.log("schedulelist",schedulelist)
523
+                // console.log("schedulelist",schedulelist)
478
                 this.scheduleList = schedulelist
524
                 this.scheduleList = schedulelist
479
              }
525
              }
480
           })
526
           })
490
                 start_time:this.start_time,
536
                 start_time:this.start_time,
491
                 end_time:this.end_time,
537
                 end_time:this.end_time,
492
             }
538
             }
493
-            console.log("params",params)
539
+            // console.log("params",params)
494
             getScheduleListTotal(params).then(response=>{
540
             getScheduleListTotal(params).then(response=>{
495
                 if(response.data.state == 1){
541
                 if(response.data.state == 1){
496
                     //获取每个班次对应的次数
542
                     //获取每个班次对应的次数
497
                     var scheudleTotal =  response.data.data.scheudletotal
543
                     var scheudleTotal =  response.data.data.scheudletotal
498
-                    console.log("scheudletotal",scheudleTotal)
544
+                    // console.log("scheudletotal",scheudleTotal)
499
                     //获取总分钟数
545
                     //获取总分钟数
500
                     var list = response.data.data.list
546
                     var list = response.data.data.list
501
-                    console.log("list",list)
547
+                    // console.log("list",list)
502
                     var workday = response.data.data.workDay
548
                     var workday = response.data.data.workDay
503
-                    console.log("workday",workday)
549
+                    // console.log("workday",workday)
504
                     var noWorkDay = response.data.data.noWorkDay
550
                     var noWorkDay = response.data.data.noWorkDay
505
-                    console.log("noWorkDay",noWorkDay)
551
+                    // console.log("noWorkDay",noWorkDay)
506
 
552
 
507
                     let tempArr = [], newArr = []
553
                     let tempArr = [], newArr = []
508
                     for (let i = 0; i < scheudleTotal.length; i++) {
554
                     for (let i = 0; i < scheudleTotal.length; i++) {
559
 
605
 
560
                     // console.log('newArr',arr)
606
                     // console.log('newArr',arr)
561
                     this.tableData = arr
607
                     this.tableData = arr
608
+                    this.$nextTick(() => {
609
+                      this.$refs.tab.doLayout()
610
+                    }) 
562
                 }
611
                 }
563
             })
612
             })
564
         },
613
         },
570
             const params = {
619
             const params = {
571
               doctor_type: parseInt(val),
620
               doctor_type: parseInt(val),
572
             }
621
             }
573
-            console.log("params",params)
622
+            // console.log("params",params)
574
             changeOption(params).then(response=>{
623
             changeOption(params).then(response=>{
575
               if(response.data.state == 1){
624
               if(response.data.state == 1){
576
                 var scheudleTotal =  response.data.data.scheduletotal
625
                 var scheudleTotal =  response.data.data.scheduletotal
577
-                console.log("scheduletotal",scheudleTotal)
626
+                // console.log("scheduletotal",scheudleTotal)
578
                 var list = response.data.data.list
627
                 var list = response.data.data.list
579
-                console.log("list",list)
628
+                // console.log("list",list)
580
                 var workday = response.data.data.workday
629
                 var workday = response.data.data.workday
581
-                console.log("workday",workday)
630
+                // console.log("workday",workday)
582
                 var noWorkDay = response.data.data.workday
631
                 var noWorkDay = response.data.data.workday
583
-                console.log("worknoday",noWorkDay)
632
+                // console.log("worknoday",noWorkDay)
584
 
633
 
634
+            //    var workdaylist = response.data.data.chartworkdayminute
585
 
635
 
636
+            //    let arrtwo = [...workdaylist]
637
+            //     arrtwo.sort(this.compare('doctor_id'))
638
+            //     this.doctorlist.sort(this.compare('admin_user_id'))
639
+            //     this.doctorlist.forEach((item, index) => {
640
+            //      if (arrtwo[index] && item.admin_user_id ==arrtwo[index].doctor_id) {
641
+                        
642
+            //         }else{
643
+            //         arrtwo.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id,workminute: 0})
644
+            //         }
645
+            //      })
646
+                   
647
+            //      let chartX = []
648
+            //      let chartY = []
649
+            //      arrtwo.map(item => {
650
+            //        chartX.push(item.user_name)
651
+            //        chartY.push(item.workminute / 60)
652
+            //      })
653
+            //      this.chart.xAxis.data = chartX
654
+            //      this.chart.series[0].data = chartY
655
+
656
+            //      this.getArrLength(this.chart.xAxis.data)    
586
                 let tempArr = [], newArr = []
657
                 let tempArr = [], newArr = []
587
                 for (let i = 0; i < scheudleTotal.length; i++) {
658
                 for (let i = 0; i < scheudleTotal.length; i++) {
588
                     if (tempArr.indexOf(scheudleTotal[i].user_name) === -1) {
659
                     if (tempArr.indexOf(scheudleTotal[i].user_name) === -1) {
634
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
705
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
635
                       }
706
                       }
636
                     })
707
                     })
637
-                    
638
-
639
-                    console.log('newArr',arr)
640
                     this.tableData = arr
708
                     this.tableData = arr
709
+                    this.$nextTick(() => {
710
+                        this.$refs.tab.doLayout()
711
+                    }) 
641
                 }else if(val == 2){
712
                 }else if(val == 2){
642
                     arr.sort(this.compare('doctor_id'))
713
                     arr.sort(this.compare('doctor_id'))
643
                     this.doctorArr.sort(this.compare('admin_user_id'))
714
                     this.doctorArr.sort(this.compare('admin_user_id'))
648
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
719
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
649
                       }
720
                       }
650
                     })
721
                     })
651
-                    
652
-
653
-                    console.log('newArr',arr)
654
                     this.tableData = arr
722
                     this.tableData = arr
723
+                    this.$nextTick(() => {
724
+                        this.$refs.tab.doLayout()
725
+                    }) 
655
                 }else if(val == 3){
726
                 }else if(val == 3){
656
                     arr.sort(this.compare('doctor_id'))
727
                     arr.sort(this.compare('doctor_id'))
657
                     this.nurseArr.sort(this.compare('admin_user_id'))
728
                     this.nurseArr.sort(this.compare('admin_user_id'))
662
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
733
                         arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
663
                       }
734
                       }
664
                     })
735
                     })
665
-                    
666
-
667
-                    console.log('newArr',arr)
668
                     this.tableData = arr
736
                     this.tableData = arr
669
-                }
670
-                    
737
+                    this.$nextTick(() => {
738
+                        this.$refs.tab.doLayout()
739
+                    }) 
740
+                }   
671
               }
741
               }
672
             })
742
             })
673
         },
743
         },
712
         },
782
         },
713
         //获取统计图数据
783
         //获取统计图数据
714
         getchartlist(){
784
         getchartlist(){
715
-           getchartlist().then(response=>{
785
+             if(this.timeSlot == 1){
786
+               this.start_time = this.getTimestamp(this.weekDayArr[0]),
787
+               this.end_time = this.getTimestamp(this.weekDayArr[6])
788
+            }
789
+             const params = {
790
+                start_time:this.start_time,
791
+                end_time:this.end_time
792
+             }
793
+            //  console.log("params",params)
794
+           getchartlist(params).then(response=>{
716
                 if(response.data.state == 1){
795
                 if(response.data.state == 1){
717
                     var workdaylist =  response.data.data.workDaylist
796
                     var workdaylist =  response.data.data.workDaylist
718
-                    console.log("早年公共",workdaylist)
719
-
720
-
721
                     let arr = [...workdaylist]
797
                     let arr = [...workdaylist]
722
-
723
                     arr.sort(this.compare('doctor_id'))
798
                     arr.sort(this.compare('doctor_id'))
724
                     this.doctorlist.sort(this.compare('admin_user_id'))
799
                     this.doctorlist.sort(this.compare('admin_user_id'))
725
                     this.doctorlist.forEach((item, index) => {
800
                     this.doctorlist.forEach((item, index) => {
729
                           arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id,workminute: 0})
804
                           arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id,workminute: 0})
730
                         }
805
                         }
731
                     })
806
                     })
732
-                    console.log('arrrrrrrrrrrrrrr',arr)
733
-
807
+                   
734
                     let chartX = []
808
                     let chartX = []
735
                     let chartY = []
809
                     let chartY = []
736
                     arr.map(item => {
810
                     arr.map(item => {
752
                 var dataZoom_end = 100;
826
                 var dataZoom_end = 100;
753
                 this.chart.dataZoom[0].end = dataZoom_end
827
                 this.chart.dataZoom[0].end = dataZoom_end
754
             }
828
             }
829
+        },
830
+        changeRadio(){
831
+          this.getlist()
832
+          this.getchartlist()
755
         }
833
         }
756
     }
834
     }
757
 }
835
 }