山水共长天一色 vor 3 Jahren
Ursprung
Commit
0fe69ce135
1 geänderte Dateien mit 53 neuen und 49 gelöschten Zeilen
  1. 53 49
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

+ 53 - 49
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -10,6 +10,7 @@
                          style="width:190px;"
                          @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
                          <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini"  @click="showWorkTime"></el-button>
+                         <!-- <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini"  @click="tiaoshi"></el-button> -->
                     </div>
                 <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
                     <!-- <div class="jjk" style="display:inline-block;position:fixed;top:70px;background:#fff;left:250px;">
@@ -773,7 +774,7 @@
             <div class="selectworktime_export_l">
               <el-date-picker
               class="selecteworktime_datapick"
-              v-model="WorktimeDatepickValue1"
+              v-model="WorktimeDatepickValue"
               value-format="yyyy-MM-dd"
               type="daterange"
               align="right"
@@ -794,7 +795,7 @@
               <!-- 222 -->
             </div>
             <div>
-                <el-input style="float:left;width:22%" v-model="searchKeyword1" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
+                <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
                     <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
                 </el-input>
             </div>
@@ -916,7 +917,7 @@
             <div class="selectworktime_export_l">
               <el-date-picker
               class="selecteworktime_datapick"
-              v-model="WorktimeDatepickValue2"
+              v-model="WorktimeDatepickValue"
               value-format="yyyy-MM-dd"
               type="daterange"
               align="right"
@@ -936,7 +937,7 @@
               
             </div>
             <div>
-                <el-input style="float:left;width:22%" v-model="searchKeyword2" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
+                <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
                     <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
                 </el-input>
             </div>
@@ -1150,13 +1151,11 @@
         data() {
             return {
                 exportTimeDialog: false,
-                searchKeyword1: '',
-                searchKeyword2: '',
+                searchKeyword: '',
                 monthworkDateS: [],
                 monthNotWorkDateS: [],
                 pickDateArray:[],
-      WorktimeDatepickValue1: [],
-      WorktimeDatepickValue2: [],
+      WorktimeDatepickValue: [],
       activeName:"first",
                 submitingReport: false,
                 importResultMsg:null,
@@ -1345,7 +1344,7 @@
                 if(e){
                     this.monthNotWorkDateS = []
                     for (let i = 0; i < this.monthNotWorkDate.length; i++) {
-                        if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword2) != -1){
+                        if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
                             this.monthNotWorkDateS.push(this.monthNotWorkDate[i])
                         }
                     }
@@ -1355,7 +1354,7 @@
                 }else{
                     this.monthworkDateS = []
                     for (let i = 0; i < this.monthworkDate.length; i++) {
-                        if(this.monthworkDate[i].name.indexOf(this.searchKeyword1) != -1){
+                        if(this.monthworkDate[i].name.indexOf(this.searchKeyword) != -1){
                             this.monthworkDateS.push(this.monthworkDate[i])
                         }
                     }
@@ -1759,14 +1758,17 @@
 
                 this.selectProject(itemDomain, newIndex);
             },
-    // tabupdata(){ 
-    //   if(this.WorktimeDatepickValue2.length == 0){
-    //   this.WorktimeDatepickValue2 = [this.getAutoWeekDate()[0],this.getAutoWeekDate()[6]];
-    //   // this.showMonthNotWorkTime()
-    //  }
-    //  },
+
     showWorkTime(){
       this.monthWorkTimeDialog = true;
+      this.searchKeyword = ''
+      this.WorktimeDatepickValue = this.istoMonth()
+      if(this.WorktimeDatepickValue.length == 0){
+        let newdate = new Date();
+        let nowdate = newdate.toLocaleDateString();
+        let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
+        this.WorktimeDatepickValue = nowwd
+      }
       this.showMonthWorkTime()
     },
 
@@ -1780,13 +1782,13 @@
     },
     //导出员工每日填报工时数
     exportMembWorkHours() {   
-      console.log("exportMembWorkHours",this.WorktimeDatepickValue1);
+      console.log("exportMembWorkHours",this.WorktimeDatepickValue);
       this.http.post(
         "/report/exportUserDailyWorkTime",
         {
           // month: this.date,
-          startDate: this.WorktimeDatepickValue1[0],
-          endDate: this.WorktimeDatepickValue1[1],
+          startDate: this.WorktimeDatepickValue[0],
+          endDate: this.WorktimeDatepickValue[1],
         },
         (res) => {
           if (res.code == "ok") {
@@ -1809,8 +1811,8 @@
         "/report/exportNoReportUserList",
         {
           // month: this.date,
-          startDate: this.WorktimeDatepickValue2[0],
-          endDate: this.WorktimeDatepickValue2[1],
+          startDate: this.WorktimeDatepickValue[0],
+          endDate: this.WorktimeDatepickValue[1],
         },
         (res) => {
           if (res.code == "ok") {
@@ -1838,23 +1840,32 @@
       a.remove();
     },
 
-    // 111
+    // 是否本月判断
+    istoMonth(){
+        let todate = new Date()
+        let tomonth = todate.getMonth() + 1
+        let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
+        if(this.date == adate){
+            return []
+        }else{
+            let sedate = new Date(this.date)
+            let semonth = sedate.getMonth() + 1
+            let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
+            let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
+            let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
+            return [sedates1, sedates2]
+        }
+    },
+
     showMonthWorkTime() {
-      this.searchKeyword1 = ''
-      if(this.WorktimeDatepickValue1.length == 0){
-        let newdate = new Date();
-        let nowdate = newdate.toLocaleDateString();
-        let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
-        this.WorktimeDatepickValue1 = nowwd
-      }
-    //   this.allDate = this.alreadyAllDate(this.WorktimeDatepickValue1[0],this.WorktimeDatepickValue1[1])
+
       this.http.post(
         "/report/getUserDailyWorkTime",
         // "/report/getNoReportUserList",
         {
           // month: this.date,
-          startDate: this.WorktimeDatepickValue1[0],
-          endDate: this.WorktimeDatepickValue1[1],
+          startDate: this.WorktimeDatepickValue[0],
+          endDate: this.WorktimeDatepickValue[1],
         },
         (res) => {
           if (res.code == "ok") {
@@ -1875,21 +1886,14 @@
       );
     },
     showMonthNotWorkTime() {
-        this.searchKeyword2 = ''
-      if(this.WorktimeDatepickValue2.length == 0){
-        let newdate = new Date();
-        let nowdate = newdate.toLocaleDateString();
-        let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
-        this.WorktimeDatepickValue2 = nowwd
-      }
-      console.log("exportMembNotWorkHours",this.WorktimeDatepickValue2);
+      console.log("exportMembNotWorkHours",this.WorktimeDatepickValue);
       this.http.post(
         // "/report/getUserDailyWorkTime",
         "/report/getNoReportUserList",
         {
           // month: this.date,
-          startDate: this.WorktimeDatepickValue2[0],
-          endDate: this.WorktimeDatepickValue2[1],
+          startDate: this.WorktimeDatepickValue[0],
+          endDate: this.WorktimeDatepickValue[1],
         },
         (res) => {
           if (res.code == "ok") {
@@ -1913,11 +1917,11 @@
       let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
       let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
       if(e){
-        this.WorktimeDatepickValue1 = lastwd 
+        this.WorktimeDatepickValue = lastwd 
         this.showMonthWorkTime()
         
       }else{
-        this.WorktimeDatepickValue2 = lastwd 
+        this.WorktimeDatepickValue = lastwd 
         this.showMonthNotWorkTime()
       }
     },
@@ -1926,10 +1930,10 @@
       let nowdate = newdate.toLocaleDateString();
       let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
       if(e){
-        this.WorktimeDatepickValue1 = nowwd 
+        this.WorktimeDatepickValue = nowwd 
         this.showMonthWorkTime()
       }else{
-        this.WorktimeDatepickValue2 = nowwd 
+        this.WorktimeDatepickValue = nowwd 
         this.showMonthNotWorkTime()
       }
     },
@@ -1938,10 +1942,10 @@
       let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
       let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
       if(e){
-        this.WorktimeDatepickValue1 = nextwd 
+        this.WorktimeDatepickValue = nextwd 
         this.showMonthWorkTime()
       }else{
-        this.WorktimeDatepickValue2 = nextwd 
+        this.WorktimeDatepickValue = nextwd 
         this.showMonthNotWorkTime()
       }
     },
@@ -2871,7 +2875,7 @@
                         });
                     });
             },  
-            // 改变月份
+            // 改变月份     -------
             changeMonthOut() {
                 this.getAllDate();
                 this.getReportList();