Explorar o código

修改出差相关的填报,审批bug

seyason %!s(int64=2) %!d(string=hai) anos
pai
achega
9160b1dc20

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -1836,6 +1836,22 @@ public class WeiXinCorpController {
         return wxCorpInfoService.getUserCheckInDayData(companyId, userId, start, end, true);
     }
 
+    //手动获取打卡记录
+    @RequestMapping("/getPunchRecord")
+    public HttpRespMsg getPunchRecord(Integer companyId, String userId, String startDate, String endDate) {
+        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+        LocalDateTime start = LocalDateTime.parse(startDate + " 00:00:00", dtf);
+        LocalDateTime end = null;
+        if (!StringUtils.isEmpty(endDate)) {
+            end = LocalDateTime.parse(endDate + " 23:59:59", dtf);
+        } else {
+            end = LocalDateTime.parse(startDate + " 23:59:59", dtf);
+        }
+
+        return wxCorpInfoService.getUserPunchRecord(companyId, userId, start, end, true);
+    }
+
     @RequestMapping("/getCurMonthDayData")
     public HttpRespMsg getCurMonthDayData(int companyId) {
         LocalDate now = LocalDate.now();

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/BusinessTripServiceImpl.java

@@ -165,7 +165,7 @@ public class BusinessTripServiceImpl extends ServiceImpl<BusinessTripMapper, Bus
         User user = userMapper.selectById(userId);
         sheet.setOwnerName(user.getName());
         sheet.setCompanyId(user.getCompanyId());
-
+        sheet.setStatus(1);//填报时是待审核状态
         if (isNew) {
             //检查该时间段是否已经有按天请假
             QueryWrapper<BusinessTrip> queryWrapper = new QueryWrapper<>();
@@ -319,7 +319,7 @@ public class BusinessTripServiceImpl extends ServiceImpl<BusinessTripMapper, Bus
     public HttpRespMsg summaryData(String keyword, String startDate, String endDate, String userId) {
         Integer companyId = userMapper.selectById(userId).getCompanyId();
         HttpRespMsg msg = new HttpRespMsg();
-//        msg.data = businessTripMapper.summaryData(keyword, startDate, endDate, companyId);
+        msg.data = businessTripMapper.summaryData(keyword, startDate, endDate, companyId);
         return msg;
     }
 }

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveSheetServiceImpl.java

@@ -77,6 +77,7 @@ public class LeaveSheetServiceImpl extends ServiceImpl<LeaveSheetMapper, LeaveSh
         User user = userMapper.selectById(userId);
         sheet.setOwnerName(userMapper.selectById(sheet.getOwnerId()).getName());
         sheet.setCompanyId(user.getCompanyId());
+        sheet.setStatus(1);//待审核状态
         TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
         if (sheet.getTimeType() == 0) {
             //按天请假时,计算小时数

+ 1 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -810,8 +810,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         }
         if (httpRespMsg.code.equals("ok")) {
             //编辑关系
-            participationMapper.dele
-        te(new QueryWrapper<Participation>().eq("project_id", id));
+            participationMapper.delete(new QueryWrapper<Participation>().eq("project_id", id));
             if (userIds != null) {
                 for (String userId : userIds) {
                     participationMapper.insert(new Participation().setProjectId(id).setUserId(userId));

+ 63 - 46
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -28,12 +28,12 @@
                         <span slot="title">{{ $t('businessstatistics') }}</span>
                     </template>
                 </el-menu-item>
-                <el-menu-item index="5" v-if="permissions.awayOfficeProcess">
+                <!-- <el-menu-item index="5" v-if="permissions.awayOfficeProcess">
                     <template slot="title">
                         <i class="iconfont firerock-iconliucheng"></i>
                         <span slot="title">{{ $t('businesstriApprovalProcess') }}</span>
                     </template>
-                </el-menu-item>
+                </el-menu-item> -->
             </el-menu>
         </el-col>
     </div>
@@ -51,7 +51,7 @@
                         <el-input v-model="addform.reason" style="width: 555px" maxlength="25" type="text" show-word-limit></el-input>
                     </el-form-item>
                     <!-- 维度选择添加 -->
-                        <el-form-item :label="$t('screening.inputProject')" style="width:300px;margin-right:30px" prop="projectId">
+                        <!-- <el-form-item :label="$t('screening.inputProject')" style="width:300px;margin-right:30px" prop="projectId">
                             <el-select style="width:100%" @change="getwuduList(1)" v-model="addform.projectId" filterable clearable :placeholder="$t('defaultText.pleaseChoose')" >
                                 <el-option
                                 v-for="item in projectList"
@@ -60,7 +60,7 @@
                                 :value="item.id">
                                 </el-option>
                             </el-select>
-                        </el-form-item>
+                        </el-form-item> -->
                         <el-form-item :label="wuduData.customDegreeName"
                         v-if="addform.projectId != null && wuduData.customDegreeActive == 1"
                         style="width:300px;margin-right:30px"
@@ -182,7 +182,7 @@
                             <el-option :label="$t('state.approved')" :value="0"></el-option>
                             <el-option :label="$t('state.WaitingAudit')" :value="1"></el-option>
                             <el-option :label="$t('btn.rejected')" :value="2"></el-option>
-                            <el-option :label="$t('state.undone')" :value="3"></el-option>
+                            <!-- <el-option :label="$t('state.undone')" :value="3"></el-option> -->
                         </el-select>
                         
                     </div>
@@ -244,14 +244,7 @@
                     
                     <el-table-column prop="startDate" :label="$t('starttimeofbusinessrip')" width="150"></el-table-column>
                     <el-table-column prop="endDate" :label="$t('endtimeofbusinesstrip')" width="150"></el-table-column>
-                    <el-table-column prop="status" :label="$t('state.states')" width="100">
-                        <template slot-scope="scope">
-                            <span v-if="scope.row.status == 0">{{ $t('state.approved') }}</span>
-                            <span v-if="scope.row.status == 1" style="color: orange">{{ $t('state.WaitingAudit') }}</span>
-                            <span v-if="scope.row.status == 2" style="color: red">{{ $t('btn.rejected') }}</span>
-                            <span v-if="scope.row.status == 3" style="color: #666666">{{ $t('btn.undo') }}</span>
-                        </template>
-                    </el-table-column>
+                    
                     <el-table-column prop="remark" :label="$t('bei-zhu')" width="200">
                         <template slot-scope="scope">
                             <el-popover placement="top-start" :title="$t('biao-ti')" width="200" trigger="hover" :content="scope.row.remark">
@@ -259,6 +252,14 @@
                             </el-popover>
                         </template>
                     </el-table-column>
+                    <el-table-column prop="status" :label="$t('state.states')" width="100" fixed="right">
+                        <template slot-scope="scope">
+                            <span v-if="scope.row.status == 0">{{ $t('state.approved') }}</span>
+                            <span v-if="scope.row.status == 1" style="color: orange">{{ $t('state.WaitingAudit') }}</span>
+                            <span v-if="scope.row.status == 2" style="color: red">{{ $t('btn.rejected') }}</span>
+                            <span v-if="scope.row.status == 3" style="color: #666666">{{ $t('btn.undo') }}</span>
+                        </template>
+                    </el-table-column>
                     <el-table-column v-if="!isDingding" :label="isAuditList ? $t('other.audit') : $t('operation')" width="180" fixed="right" >
                         <template slot-scope="scope">
                             <div v-if="isAuditList">
@@ -319,7 +320,7 @@
             </div>
             <!-- <div style="margin-top: 30px"> -->
             <div>
-                <el-table key="apk2is4" v-loading="loading" :data="statisticalList" height="780px" style="width: 99%">
+                <el-table key="apk2is4" v-loading="summaryLoading" :data="statisticalList" height="780px" style="width: 99%">
                     <el-table-column prop="ownerName" :label="$t('lable.name')" width="300">
                         <template slot-scope="scope">
                             <div v-if="scope.row.ownerName">
@@ -431,7 +432,7 @@
                     <el-radio :label="4">{{ $t('leave.other') }}</el-radio>
                 </el-radio-group>
             </el-form-item>
-            <el-form-item :label="$t('screening.inputProject')" style="width:300px;margin-right:30px;display:inline-block;" prop="projectId">
+            <!-- <el-form-item :label="$t('screening.inputProject')" style="width:300px;margin-right:30px;display:inline-block;" prop="projectId">
                 <el-select style="width:100%" @change="getwuduList(0)" v-model="editItemForm.projectId" filterable clearable :placeholder="$t('defaultText.pleaseChoose')" >
                     <el-option
                     v-for="item in projectList"
@@ -440,7 +441,7 @@
                     :value="item.id">
                     </el-option>
                 </el-select>
-            </el-form-item>
+            </el-form-item> -->
             <el-form-item :label="wuduData.customDegreeName"
             v-if="editItemForm.projectId != null && wuduData.customDegreeActive == 1"
             style="width:300px;margin-right:30px;display:inline-block;"
@@ -686,6 +687,7 @@ export default {
         //         }
         //     };
         return {
+            summaryLoading: false,
             displayTable: false,
             formloading: false,
             apk: 0,
@@ -1292,32 +1294,6 @@ export default {
         // 获取出差列表
         getTableList(){
             this.billss()
-            // this.http.post('/business-trip/list', {
-            //     pageIndex: 1,
-            //     pageSize: 20,
-            //     status: '',  // 全部/已审核
-            //     startDate: '',  // start  end
-            //     endDate: '',
-            //     ownerId: '',
-            //     leaveType: '', // way
-            // },
-            // res => {
-            //     if (res.code == "ok") {
-            //         this.tableList = res.data.records
-            //         // console.log("getlist",res.data);
-            //     } else {
-            //         this.$message({
-            //             message: res.msg,
-            //             type: "error"
-            //         });
-            //     }
-            // },
-            // error => {
-            //     this.$message({
-            //         message: error,
-            //         type: "error"
-            //     });
-            // });
         },
         // 筛选刷新
         billss(e) {
@@ -1361,7 +1337,48 @@ export default {
                 });
             });
         },
-
+        approve(item) {
+            //审核通过
+            this.http.post('/business-trip/approve', {id:item.id
+            },
+            res => {
+                if (res.code == "ok") {
+                    this.billss(true);
+                } else {
+                    this.$message({
+                    message: res.msg,
+                    type: "error"
+                    });
+                }
+            },
+            error => {
+                this.$message({
+                    message: error,
+                    type: "error"
+                });
+            });
+        },
+        deny(item) {
+            //审核驳回
+            this.http.post('/business-trip/deny', {id:item.id
+            },
+            res => {
+                if (res.code == "ok") {
+                    this.billss(true);
+                } else {
+                    this.$message({
+                    message: res.msg,
+                    type: "error"
+                    });
+                }
+            },
+            error => {
+                this.$message({
+                    message: error,
+                    type: "error"
+                });
+            });
+        },
         // 操作 - 删除
         deletes(e) {
             this.$confirm(this.$t('deleteit'), this.$t('other.prompts'), {}).then(() => {
@@ -1449,7 +1466,7 @@ export default {
     // 出差统计
         statistical() {
             // console.log("date",this.searchDates);
-            this.loading = true
+            this.summaryLoading = true
             this.http.post('/business-trip/summaryData', {
                 keyword: this.searchWord,
                 startDate: this.searchDates[0],
@@ -1459,9 +1476,9 @@ export default {
                 if (res.code == "ok") {
                     // console.log("出差统计",res.data);
                     this.statisticalList = res.data
-                    this.loading = false
+                    this.summaryLoading = false
                 } else {
-                    this.loading = false
+                    this.summaryLoading = false
                     this.$message({
                         message: res.msg,
                         type: "error"