Browse Source

补全工时

cs 2 years ago
parent
commit
cc23bbed17
1 changed files with 82 additions and 5 deletions
  1. 82 5
      fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

+ 82 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -59,7 +59,7 @@
     <div class="headine headConCon" ref="headine" :style="'width:'+(windowWidth - 400)+'px'">
       <h3 ref="headHe" style="padding-left: 10px;float:left;width:15%">{{shuz[ins]}}</h3>
       <div class="headScreen" :style="ins == 9 ? 'width:60%' : 'width:72%'">
-      <!-- 客户项目利润表的筛选 -->
+      <!-- 客户项目利润表的筛选 -->  
         <template v-if="ins == 4">
           <el-select v-model="customerId" :placeholder="$t('pleaseelectcustomers')" clearable filterable size="small" @change="selcts(4)" style="margin-right:20px">
             <el-option v-for="(item) in customerList" :key="item.id" :label="item.customerName" :value="item.id">
@@ -118,14 +118,14 @@
             <el-option :label="$t('state.no')" value="0"></el-option>
             <el-option :label="$t('state.yes')" value="1"></el-option>
           </el-select>
-
+          
           <!-- 地区筛选 -->
-          <el-select v-if="ins == 19" v-model="areaName" :placeholder="customNameChoose" @change="selcts()" clearable filterable size="small" style="margin-left:10px;width:150px">
+          <el-select v-if="ins == 19" v-model="areaName" :placeholder="customNameChoose" @change="selcts()" clearable filterable size="small" style="margin-left:2px;width:150px">
             <el-option :label="item" :value="item" v-for="item,index in areaList" :key="index"></el-option>
           </el-select>
 
           <!-- 人员筛选 -->
-          <el-select v-if="(ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 14 || ins == 18)  && user.userNameNeedTranslate != '1'" v-model="userId" :placeholder="$t('pleaseselectpersonnel')" @change="selcts()" clearable filterable size="small" style="margin-left:10px;width:150px">
+          <el-select v-if="(ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 14 || ins == 18)  && user.userNameNeedTranslate != '1'" v-model="userId" :placeholder="$t('pleaseselectpersonnel')" @change="selcts()" clearable filterable size="small" style="width:100px">
             <el-option v-for="(item, index) in selUserList" :key="index" :label="item.name" :value="item.id"></el-option>
           </el-select>
 
@@ -142,8 +142,10 @@
             <el-option v-for="item in firstStages" :key="item" :label="item" :value="item"></el-option>
           </el-select>
       </div>
-      <p :style="ins == 9 ? 'float: right;margin-right: 25px;width:20%' : 'float: right;margin-right: 25px;width:10%'" >
+      <!-- <p :style="ins == 9 ? 'float: right;margin-right: 25px;width:20%' : 'float: right;margin-right: 25px;width:10%'" > -->
+      <p :style="`${ins == 9 ? 'width:20%' : ins == 14 ? 'width: 20%' : 'width: 10%'}`" class="tableRightBtn">
         <el-button type="primary" @click="exportExcel" size="mini">{{ $t('reporderived') }}</el-button>
+        <el-button type="primary" @click="fillAll" size="mini" v-if="ins == 14">全部补足</el-button>
         <el-button type="primary" @click="exportExcelByQuarter" size="mini" v-if="ins == 9 && user.companyId == 876">{{ $t('an-ji-du-dao-chu') }}</el-button>
       </p>
       
@@ -767,6 +769,17 @@
                     </div>
                   </template>
                 </el-table-column>
+                <el-table-column align="center" prop="whether" :label="补足工时" min-width="180">
+                  <template slot-scope="scope">
+                    <div>
+                      <el-button
+                      type="primary" 
+                      v-if="scope.row.whether == 0"
+                      size="mini"
+                      @click="fillWorkingHours(scope.row)">补足工时</el-button>
+                    </div>
+                  </template>
+                </el-table-column>
             </el-table>
 
             <!-- 部门参与项目情况表 -->
@@ -2820,11 +2833,75 @@ export default {
         this.departmentIdArray = arr
         this.selcts(9)
       }
+    },
+    //为单个人补足工时
+    fillWorkingHours(data){
+      this.http.post('/report/fillWorkingHours', {
+        leaveTime:data.leaveTime,
+        allday:data.allday,
+        standardHours:data.standardHours,
+        whether:data.whether,
+        name:data.name,
+        workingTime:data.workingTime,
+        userId:data.userId,
+        jobNumber:data.jobNumber,
+        yearMonth: this.monthPersonnel + '-01',
+      },
+      res => {
+          if (res.code == "ok") {
+              this.getMonthlyPersonnel();
+          } else {
+              this.$message({
+                message: res.msg,
+                type: "error"
+              });
+          }
+      },
+      error => {
+          this.listLoading = false
+          this.$message({
+              message: error,
+              type: "error"
+          });
+      });
+    },
+    //补足所有人的工时
+    fillAll(){
+      let parameter = {
+        userId: this.userId,
+        departmentId: this.departmentIdArray.length > 0 ? this.departmentIdArray[this.departmentIdArray.length - 1] : '',
+        // departmentId: '',
+        month: this.monthPersonnel + '-01',
+        whether: this.whether
+      }
+      this.listLoading = true
+      this.http.post('/report/fillAll',parameter,
+      res => {
+      this.listLoading = false
+        if(res.code == 'ok'){
+          this.getMonthlyPersonnel();
+        }else {
+          this.$message({
+            message: res.msg,
+            type: 'error'
+          })
+        }
+      },err => {
+        this.listLoading = false
+        this.$message({
+          message: err,
+          type: 'error'
+        })
+      })
     }
   },
 };
 </script>
 <style scoped>
+.tableRightBtn {
+  float: right;
+  margin-left: 15px !important;
+}
 .headConCon {
   position: fixed;
   /* width: 99%; */