Kaynağa Gözat

医护排班

XMLWAN 4 yıl önce
ebeveyn
işleme
6665085620
1 değiştirilmiş dosya ile 39 ekleme ve 39 silme
  1. 39 39
      src/xt_pages/medicalScheduling/index.vue

+ 39 - 39
src/xt_pages/medicalScheduling/index.vue Dosyayı Görüntüle

214
         getDoctorList().then(response=>{
214
         getDoctorList().then(response=>{
215
             if(response.data.state == 1){
215
             if(response.data.state == 1){
216
                 var list =  response.data.data.list
216
                 var list =  response.data.data.list
217
-                console.log("医护列表",list)
217
+                // console.log("医护列表",list)
218
                 this.tableData = list
218
                 this.tableData = list
219
                 this.doctorlist = list
219
                 this.doctorlist = list
220
                 //获取班种列表
220
                 //获取班种列表
243
              }
243
              }
244
              this.schedulelist = schedulelist
244
              this.schedulelist = schedulelist
245
           }
245
           }
246
-       }) 
246
+       })
247
      },
247
      },
248
      hangdleClick(val,index){
248
      hangdleClick(val,index){
249
       this.docobj = val
249
       this.docobj = val
319
            }
319
            }
320
        })
320
        })
321
      },
321
      },
322
-     formatDate(date){      
323
-          var year = date.getFullYear()+'.'       
322
+     formatDate(date){
323
+          var year = date.getFullYear()+'.'
324
           var month = (date.getMonth()+1)+'.';
324
           var month = (date.getMonth()+1)+'.';
325
           var day = date.getDate();
325
           var day = date.getDate();
326
           return year+month+day
326
           return year+month+day
327
-        }, 
328
-    formatDateTwo(date){      
329
-          var year = date.getFullYear()+'.'       
327
+        },
328
+    formatDateTwo(date){
329
+          var year = date.getFullYear()+'.'
330
           var month = (date.getMonth()+1)+'.';
330
           var month = (date.getMonth()+1)+'.';
331
           var day = date.getDate();
331
           var day = date.getDate();
332
           return year+month+day
332
           return year+month+day
333
-       }, 
334
-     addDate(date,n){        
335
-        date.setDate(date.getDate()+n);        
333
+       },
334
+     addDate(date,n){
335
+        date.setDate(date.getDate()+n);
336
         return date;
336
         return date;
337
-      },  
337
+      },
338
         //
338
         //
339
-      setDate(date){           
339
+      setDate(date){
340
         var week = date.getDay()-1;
340
         var week = date.getDay()-1;
341
         date = this.addDate(date,week*-1);
341
         date = this.addDate(date,week*-1);
342
         this.currentFirstDate = new Date(date);
342
         this.currentFirstDate = new Date(date);
343
-        for(var i = 0;i<this.clen; i++){     
343
+        for(var i = 0;i<this.clen; i++){
344
             this.weekDayArr.push(this.formatDate(i==0 ? date : this.addDate(date,1)))
344
             this.weekDayArr.push(this.formatDate(i==0 ? date : this.addDate(date,1)))
345
-            
346
-         }         
345
+
346
+         }
347
      },
347
      },
348
-        //上一周 
348
+        //上一周
349
      lastclick(){
349
      lastclick(){
350
         this.weekDayArr=[]
350
         this.weekDayArr=[]
351
-        this.setDate(this.addDate(this.currentFirstDate,-7));   
351
+        this.setDate(this.addDate(this.currentFirstDate,-7));
352
         this.weekNum = this.weekNum - 1
352
         this.weekNum = this.weekNum - 1
353
        if(this.weekNum - 1 == 0){
353
        if(this.weekNum - 1 == 0){
354
          let year = this.nowYear - 1
354
          let year = this.nowYear - 1
360
         this.getNextWeekList()
360
         this.getNextWeekList()
361
       },
361
       },
362
         //下一周
362
         //下一周
363
-     nextclick(){ 
364
-        this.weekDayArr=[]                
363
+     nextclick(){
364
+        this.weekDayArr=[]
365
         this.setDate(this.addDate(this.currentFirstDate,7));
365
         this.setDate(this.addDate(this.currentFirstDate,7));
366
         this.weekNum = this.weekNum + 1
366
         this.weekNum = this.weekNum + 1
367
         if(this.weekNum + 1 == 54){
367
         if(this.weekNum + 1 == 54){
375
      },
375
      },
376
 
376
 
377
     getYearWeek(year,month,date){
377
     getYearWeek(year,month,date){
378
-       /*  
379
-        dateNow是当前日期 
380
-        dateFirst是当年第一天  
381
-        dataNumber是当前日期是今年第多少天  
382
-        用dataNumber + 当前年的第一天的周差距的和在除以7就是本年第几周  
383
-      */      
378
+       /*
379
+        dateNow是当前日期
380
+        dateFirst是当年第一天
381
+        dataNumber是当前日期是今年第多少天
382
+        用dataNumber + 当前年的第一天的周差距的和在除以7就是本年第几周
383
+      */
384
       let dateNow = new Date(year, parseInt(month) - 1, date);
384
       let dateNow = new Date(year, parseInt(month) - 1, date);
385
       let dateFirst = new Date(year, 0, 1);
385
       let dateFirst = new Date(year, 0, 1);
386
       let dataNumber = Math.round((dateNow.valueOf() - dateFirst.valueOf()) / 86400000);
386
       let dataNumber = Math.round((dateNow.valueOf() - dateFirst.valueOf()) / 86400000);
387
-      return Math.ceil((dataNumber + ((dateFirst.getDay() + 1) - 1)) / 7);        
387
+      return Math.ceil((dataNumber + ((dateFirst.getDay() + 1) - 1)) / 7);
388
      },
388
      },
389
      getTimestamp(time) { //把时间日期转成时间戳
389
      getTimestamp(time) { //把时间日期转成时间戳
390
         return (new Date(time)).getTime() / 1000
390
         return (new Date(time)).getTime() / 1000
435
         //      this.tableData = []
435
         //      this.tableData = []
436
         //      this.tableData = staffList
436
         //      this.tableData = staffList
437
         //    }
437
         //    }
438
-           
438
+
439
          }
439
          }
440
       })
440
       })
441
     },
441
     },
442
-    
442
+
443
     //获取上一周下一周的排班数据
443
     //获取上一周下一周的排班数据
444
     getNextWeekList(){
444
     getNextWeekList(){
445
       const params = {
445
       const params = {
458
         const params = {
458
         const params = {
459
            start_time:this.getTimestamp(this.weekDayArr[0]),
459
            start_time:this.getTimestamp(this.weekDayArr[0]),
460
            end_time:this.getTimestamp(this.weekDayArr[6]),
460
            end_time:this.getTimestamp(this.weekDayArr[6]),
461
-           doctor_id:id 
461
+           doctor_id:id
462
         }
462
         }
463
        getScheduleByDoctorId(params).then(response=>{
463
        getScheduleByDoctorId(params).then(response=>{
464
            if(response.data.state == 1){
464
            if(response.data.state == 1){
469
        })
469
        })
470
     },
470
     },
471
     toSearch(){
471
     toSearch(){
472
-      console.log("医护人员姓名",this.keywords)
473
-      var id = 0
474
-      for(let i = 0 ;i<this.doctorlist.length;i++){
475
-         if(this.keywords == this.doctorlist[i].user_name){
476
-            id = this.doctorlist[i].admin_user_id
477
-         }
478
-      }
472
+    //   console.log("医护人员姓名",this.keywords)
473
+    //   var id = 0
474
+    //   for(let i = 0 ;i<this.doctorlist.length;i++){
475
+    //      if(this.keywords == this.doctorlist[i].user_name){
476
+    //         id = this.doctorlist[i].admin_user_id
477
+    //      }
478
+    //   }
479
       const params = {
479
       const params = {
480
-        doctor_id:id,
480
+        user_name:this.keywords,
481
         start_time:this.getTimestamp(this.weekDayArr[0]),
481
         start_time:this.getTimestamp(this.weekDayArr[0]),
482
         end_time:this.getTimestamp(this.weekDayArr[6])
482
         end_time:this.getTimestamp(this.weekDayArr[6])
483
       }
483
       }
528
           }else{
528
           }else{
529
             this.$message.error("排班已存在")
529
             this.$message.error("排班已存在")
530
           }
530
           }
531
-       }) 
531
+       })
532
     },
532
     },
533
     toContinuous(){
533
     toContinuous(){
534
         var is_status = 0
534
         var is_status = 0
586
         background-color: rgb(245, 247, 250);
586
         background-color: rgb(245, 247, 250);
587
         color: rgb(96, 98, 102);
587
         color: rgb(96, 98, 102);
588
         font-weight:bold;
588
         font-weight:bold;
589
-        
589
+
590
     }
590
     }
591
     .classMain{
591
     .classMain{
592
         height: 400px;
592
         height: 400px;