Browse Source

分页获取时,有审核的情况下,刷新数据

seyason 1 năm trước cách đây
mục cha
commit
c423ed333f

+ 5 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -259,6 +259,11 @@ public class ReportController {
         return reportService.getReportById(reportId, request);
     }
 
+    @RequestMapping("/getDetailReportById")
+    public HttpRespMsg getDetailReportById(@RequestParam Integer reportId) {
+        return reportService.getDetailReportById(reportId, request);
+    }
+
     /**
      * AI智能填报
      * @return

+ 4 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportMapper.java

@@ -59,8 +59,7 @@ public interface ReportMapper extends BaseMapper<Report> {
                                                              @Param("deptIds") List<Integer> deptIds,
                                                              @Param("endDate") String endDate, @Param("projectId") Integer projectId,@Param("stateKey")Integer stateKey,@Param("branchDepartment")List<Integer> branchDepartment);
 
-    //按当前人员获取本人报告
-    List<Map<String, Object>> getReportByDate(@Param("date") String date, @Param("id") String id);
+
     //获取项目经理所管理的人员的报告
     List<Map<String, Object>> getInchargeReportByDate(@Param("date") String date, @Param("id") String id, @Param("state") Integer state);
 
@@ -81,8 +80,10 @@ public interface ReportMapper extends BaseMapper<Report> {
                                                                 @Param("id") String id,
                                                                 @Param("state") Integer state
                                                                 );
+    //按当前人员获取本人报告
+//    List<Map<String, Object>> getReportByDate(@Param("date") String date, @Param("id") String id);
 
-    List<Map<String, Object>> getUserReportByDate(@Param("date") String date, @Param("userIds") List<String> userIds);
+    List<Map<String, Object>> getUserReportByDateOrId(@Param("date") String date, @Param("userIds") List<String> userIds, @Param("id") Integer id);
 
     List<Map<String, Object>> getReportByTask(@Param("taskId") Integer taskId);
 

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ReportService.java

@@ -149,4 +149,6 @@ public interface ReportService extends IService<Report> {
     HttpRespMsg getHasPushForSap(String startDate, String endDate, String employeeID);
 
     HttpRespMsg getCustomDataWithDate(String startDate, String endDate, HttpServletRequest request);
+
+    HttpRespMsg getDetailReportById(Integer reportId, HttpServletRequest request);
 }

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

@@ -523,7 +523,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id, create_date, project_id, working_time").in("project_id",projectIds).and(wrapper -> wrapper.eq("state", 0).or().eq("state", 1).or().eq("state", 3)));
                 }
             }
-            System.out.println("开始处理项目内数据");
             for (Project project : projectList) {
                 //todo:计算项目预算工时
                 if(project.getManDay()!=null){

+ 22 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -27,7 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.*;
 import org.springframework.http.client.ClientHttpResponse;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
@@ -37,7 +36,6 @@ import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
-import javax.print.DocFlavor;
 import javax.servlet.http.HttpServletRequest;
 import java.io.*;
 import java.math.BigDecimal;
@@ -253,7 +251,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         Map<String, Object> map = new HashMap<>();
                         map.put("id", user.getId());
                         map.put("name", user.getName());
-                        list = reportMapper.getReportByDate(date, (String) map.get("id"));
+                        List<String> uids = new ArrayList<>();
+                        uids.add(user.getId());
+                        list = reportMapper.getUserReportByDateOrId(date, uids, null);
                         if (list.size() > 0) {
                             //个人日报
                             nameList.add(map);
@@ -312,7 +312,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                             String id = (String) n.get("id");
                             userIds.add(id);
                         });
-                        List<Map<String, Object>> reportList = reportMapper.getUserReportByDate(date, userIds);
+                        List<Map<String, Object>> reportList = reportMapper.getUserReportByDateOrId(date, userIds, null);
                         for (Map<String, Object> memb : nameList) {
                             //再根据人分别获取当天的报告
                             List<Map<String, Object>> rList = new ArrayList<Map<String, Object>>();
@@ -463,7 +463,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         String id = (String) n.get("id");
                         userIds.add(id);
                     });
-                    List<Map<String, Object>> reportList = reportMapper.getUserReportByDate(date, userIds);
+                    List<Map<String, Object>> reportList = reportMapper.getUserReportByDateOrId(date, userIds, null);
                     for (Map<String, Object> map : nameList) {
                         //再根据人分别获取当天的报告
                         List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
@@ -4152,13 +4152,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 n.put("dateStr",sdf.format((java.sql.Date)n.get("date")));
             });
 
-            List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
+//            List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
             List<Profession> professions = professionMapper.selectList(new QueryWrapper<Profession>().eq("company_id", curUser.getCompanyId()));
             for (int index=0;index<nameList.size(); index++) {
                 Map<String, Object> map2 = nameList.get(index);
                 java.sql.Date createDate = (java.sql.Date)map2.get("date");
                 List<Map<String, Object>> list2 = null;
-                list2 = reportMapper.getReportByDate(createDate.toString(), (String)map2.get("id"));
+                String uid = (String)map2.get("id");
+                List<String> uids = new ArrayList<>();
+                uids.add(uid);
+                list2 = reportMapper.getUserReportByDateOrId(createDate.toString(),uids, null);
                 //按项目过滤
                 if (projectId != null) {
                     list2 = list2.stream().filter(report->(((Integer)report.get("projectId")).equals(projectId))).collect(Collectors.toList());
@@ -8810,4 +8813,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         httpRespMsg.data = finalMap;
         return httpRespMsg;
     }
+
+    @Override
+    public HttpRespMsg getDetailReportById(Integer reportId, HttpServletRequest request) {
+        HttpRespMsg msg = new HttpRespMsg();
+        List list = reportMapper.getUserReportByDateOrId(null, null, reportId);
+        if (list.size() > 0) {
+            msg.data = list.get(0);
+        } else {
+            msg.setError("该日报已不存在");
+        }
+        return msg;
+    }
 }

+ 45 - 41
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -396,14 +396,41 @@
 
 
     <!--根据员工id,日期获取当天全部报告信息-->
-    <select id="getReportByDate" resultType="java.util.Map">
-        SELECT a.id, a.project_id as projectId,b.project_name AS project, a.working_time AS time, a.content, a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
-        a.end_time as endTime, b.incharger_id as inchargerId,b.project_code as projectCode,
-        a.creator_id as creatorId, d.name as subProjectName,d.code as subProjectCode,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
+<!--    <select id="getReportByDate" resultType="java.util.Map">-->
+<!--        SELECT a.id, a.project_id as projectId,b.project_name AS project, a.working_time AS time, a.content, a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,-->
+<!--        a.end_time as endTime, b.incharger_id as inchargerId,b.project_code as projectCode,-->
+<!--        a.creator_id as creatorId, d.name as subProjectName,d.code as subProjectCode,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,-->
+<!--        a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime-->
+<!--        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,-->
+<!--        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData-->
+<!--        ,u.name as projectAuditorName, a.project_auditor_id as projectAuditorId,dp2.department_name as buDepartmentName,a.overtime_hours as overtimeHours, a.custom_text as customText,a.evaluate as evaluate,a.report_auto_approve as reportAutoApprove,-->
+<!--        a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3, a.batch_id as batchId,a.sap_service_id as sapServiceId, multi_degr_id as multiDegrId-->
+<!--        FROM report AS a-->
+<!--        JOIN project AS b ON a.project_id=b.id-->
+<!--        left join sub_project as d on d.id = a.sub_project_id-->
+<!--        left join task on task.id = a.task_id-->
+<!--        left join report_extra_degree on report_extra_degree.id = a.degree_id-->
+<!--        left join department on department.department_id = a.audit_deptid-->
+<!--        left join department dp2 on dp2.department_id = b.bu_id-->
+<!--        left join task_group on task_group.id = a.group_id-->
+<!--        left join user u on u.id = a.project_auditor_id-->
+<!--        WHERE 1=1-->
+<!--        <if test="date != null and date != ''">-->
+<!--            AND a.create_date=#{date}-->
+<!--        </if>-->
+<!--        AND a.creator_id=#{id}-->
+<!--        ORDER BY a.creator_id ASC-->
+<!--    </select>-->
+    <!-- 批量获取员工某天的报告 -->
+    <select id="getUserReportByDateOrId" resultType="java.util.Map">
+        SELECT a.id, b.project_name AS project, a.working_time AS time, a.content, a.state, a.time_type as timeType, a.creator_id as creatorId, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
+        a.end_time as endTime, d.name as subProjectName,d.code as subProjectCode,a.task_id as taskId, task.name as taskName,
+        b.incharger_id as inchargerId,b.project_code as projectCode,
+        a.is_overtime as isOvertime,a.progress as progress,audit_dept_managerid as auditDeptManagerid,audit_deptid as auditDeptid,
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
         department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
-        ,u.name as projectAuditorName, a.project_auditor_id as projectAuditorId,dp2.department_name as buDepartmentName,a.overtime_hours as overtimeHours, a.custom_text as customText,a.evaluate as evaluate,a.report_auto_approve as reportAutoApprove,
+        ,u.name as projectAuditorName, a.project_auditor_id as projectAuditorId,dp2.department_name as buDepartmentName, a.overtime_hours as overtimeHours, a.custom_text as customText, dept_manager.name as deptAuditorName,a.evaluate as evaluate,a.report_auto_approve as reportAutoApprove,
         a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3, a.batch_id as batchId,a.sap_service_id as sapServiceId, multi_degr_id as multiDegrId
         FROM report AS a
         JOIN project AS b ON a.project_id=b.id
@@ -412,16 +439,24 @@
         left join report_extra_degree on report_extra_degree.id = a.degree_id
         left join department on department.department_id = a.audit_deptid
         left join department dp2 on dp2.department_id = b.bu_id
+        left join user dept_manager on dept_manager.id = a.audit_dept_managerid
         left join task_group on task_group.id = a.group_id
         left join user u on u.id = a.project_auditor_id
         WHERE 1=1
-        <if test="date != null and date != ''">
-            AND a.create_date=#{date}
+        <if test="id == null">
+            <if test="date != null and date != ''">
+                AND a.create_date=#{date}
+            </if>
+            AND a.creator_id in
+            <foreach item="item" collection="userIds" separator="," open="(" close=")" index="">
+                #{item, jdbcType=VARCHAR}
+            </foreach>
+            ORDER BY a.creator_id ASC
+        </if>
+        <if test="id != null" >
+            AND a.id=#{id}
         </if>
-        AND a.creator_id=#{id}
-        ORDER BY a.creator_id ASC
     </select>
-
     <!--根据任务id,全部报告信息-->
     <select id="getReportByTask" resultType="java.util.Map">
         SELECT a.id,date_format(a.create_date, '%Y-%m-%d') as createDate,  my.id as userId, my.name as userName, a.project_id as projectId,b.project_name AS project, a.working_time AS time, a.content, a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
@@ -592,37 +627,6 @@
         ORDER BY a.creator_id ASC
     </select>
 
-    <!-- 批量获取员工某天的报告 -->
-    <select id="getUserReportByDate" resultType="java.util.Map">
-        SELECT a.id, b.project_name AS project, a.working_time AS time, a.content, a.state, a.time_type as timeType, a.creator_id as creatorId, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
-        a.end_time as endTime, d.name as subProjectName,d.code as subProjectCode,a.task_id as taskId, task.name as taskName,
-        b.incharger_id as inchargerId,b.project_code as projectCode,
-        a.is_overtime as isOvertime,a.progress as progress,audit_dept_managerid as auditDeptManagerid,audit_deptid as auditDeptid,
-        a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
-        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
-        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
-        ,u.name as projectAuditorName, a.project_auditor_id as projectAuditorId,dp2.department_name as buDepartmentName, a.overtime_hours as overtimeHours, a.custom_text as customText, dept_manager.name as deptAuditorName,a.evaluate as evaluate,a.report_auto_approve as reportAutoApprove,
-        a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3, a.batch_id as batchId,a.sap_service_id as sapServiceId, multi_degr_id as multiDegrId
-        FROM report AS a
-        JOIN project AS b ON a.project_id=b.id
-        left join sub_project as d on d.id = a.sub_project_id
-        left join task on task.id = a.task_id
-        left join report_extra_degree on report_extra_degree.id = a.degree_id
-        left join department on department.department_id = a.audit_deptid
-        left join department dp2 on dp2.department_id = b.bu_id
-        left join user dept_manager on dept_manager.id = a.audit_dept_managerid
-        left join task_group on task_group.id = a.group_id
-        left join user u on u.id = a.project_auditor_id
-        WHERE 1=1
-        <if test="date != null and date != ''">
-            AND a.create_date=#{date}
-        </if>
-        AND a.creator_id in
-        <foreach item="item" collection="userIds" separator="," open="(" close=")" index="">
-            #{item, jdbcType=VARCHAR}
-        </foreach>
-        ORDER BY a.creator_id ASC
-    </select>
 
     <!--根据日期获取报告上传人-->
     <select id="getReportNameByDate" resultType="java.util.Map">

+ 43 - 27
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -5340,31 +5340,47 @@
                 this.reportList = [];
                 this.requestHttpReports();
             },
-            // 处理数据
-            // dealWith() {
-            //     var tianxie = 0
-            //     var weixtianxie = 0
-            //     if(this.selectState == -1) {
-
-            //     } else {
-            //         var arr = []
-            //         for (var i in this.reportList) {
-            //             arr.push(this.reportList[i].id)
-            //         }
-            //         this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
-            //     }
-            // },
-            // getDealWith(item, tx, wtx, arr) {
-            //     for(var i in item) {
-            //         if(item[i].children) {
-            //             this.getDealWith(item[i].children, tx, wtx, arr)
-            //         } else {
-            //             if(arr.indexOf(item[i].id) != '-1') {
-            //                 tx = +tx + 1
-            //             }
-            //         }
-            //     }
-            // },
+            //刷新日报状态,用于审核后更新
+            refreshReportData(reportId) {
+                this.http.post('/report/getDetailReportById', {reportId:reportId},
+                res => {
+                    if (res.code == "ok") {
+                        for (var m=0;m<this.reportList.length; m++) {
+                            var d = this.reportList[m].data;
+                            var find = d.filter(r=>r.id == reportId);
+                            if (find.length > 0) {
+                                find[0].state = res.data.state;
+                                if (find[0].state == 2) {//被驳回,要可以编辑
+                                    this.reportList[m].state = 2;
+                                }
+                                find[0].isDeptAudit = res.data.isDeptAudit;
+                                find[0].departmentAuditState = res.data.departmentAuditState;
+                                find[0].projectAuditorName = res.data.projectAuditorName;
+                                find[0].projectAuditorId = res.data.projectAuditorId;
+                                find[0].projectAuditState = res.data.projectAuditState;
+                                find[0].rejectUserid = res.data.rejectUserid;
+                                find[0].rejectUsername = res.data.rejectUsername;
+                                find[0].rejectReason = res.data.rejectReason;
+                                this.$forceUpdate();
+                                break;
+                            }
+                        }
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    }); 
+                });
+            },
+            
             //导出员工工时统计
             exportUserTime() {
                 this.listLoading = true;
@@ -7789,7 +7805,7 @@
                             message: this.$t('message.Reviewsucceeded'),
                             type: "success"
                         });
-                        this.getReportList();
+                        this.refreshReportData(this.approveinData.reportIds);
                         this.getDepartment();
                     } else {
                         this.$message({
@@ -7869,7 +7885,7 @@
                             message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
                             type: "success"
                         });
-                        this.getReportList();
+                        this.refreshReportData(this.denyForm.reportIds);
                         this.getDepartment();
                         this.denyReasonDialog = false;
                     } else {

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet_h5/src/views/my/children/center.vue

@@ -182,9 +182,9 @@
             if(localStorage.userInfo) {
                 // 日期
                 let userss = JSON.parse(localStorage.userInfo)
-                userss.company.expirationDate[2] >= 10 ? userss.company.expirationDate[2] : userss.company.expirationDate[1] = '0' + userss.company.expirationDate[2]
-                userss.company.expirationDate[1] >= 10 ? userss.company.expirationDate[1] : userss.company.expirationDate[1] = '0' + userss.company.expirationDate[1]
-                this.expirationDate = userss.company.expirationDate[0] + '-' + userss.company.expirationDate[1] + '-' + userss.company.expirationDate[2]
+                this.expirationDate = userss.company.expirationDate[0] + '-' + 
+                (userss.company.expirationDate[1] >= 10 ? userss.company.expirationDate[1] : ('0' + userss.company.expirationDate[1]))
+                 + '-' + (userss.company.expirationDate[2] >= 10 ? userss.company.expirationDate[2] : ('0' + userss.company.expirationDate[2]))
 
                 // 版本
                 userss.company.packageWorktime == 1 ? this.version = '基础版' : ''

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/index.vue

@@ -164,7 +164,7 @@
                 ause: [],
                 projectAdd: false, // 新增项目
                 projectManagement: false, // 管理项目
-                 isDownLoading: false, // 下拉刷新
+                isDownLoading: false, // 下拉刷新
                 isUpLoading: false, // 上拉加载
                 upFinished: false, // 上拉加载完毕
                 offset: 100, // 滚动条与底部距离小于 offset 时触发load事件

+ 195 - 165
fhKeeper/formulahousekeeper/timesheet_h5/src/views/view/index.vue

@@ -3,11 +3,11 @@
         <van-nav-bar title="查看日报" left-text="返回" @click-left="back" fixed left-arrow />
 
         <div class="login_form">
-            <van-sticky :offset-top="46">
+            <van-sticky :offset-top="43">
                 <van-cell title="时间选择" clickable :value="nowTime" @click="showPicker = true" />
             </van-sticky>
             <div v-if="user.manageDeptId != 0 || reportsCompany || reportsDept">
-                <van-sticky :offset-top="90">
+                <van-sticky :offset-top="85">
                     <van-cell title="选择部门" clickable :value="departmentText" @click="selectDepartmentShow = true">
                         <template #extra>
                             <van-icon v-if="departmentText" name="close" class="clearSeach"
@@ -23,7 +23,7 @@
                         </template>
                     </van-cell>
                 </van-sticky>
-                <van-sticky :offset-top="134" class="one_report_select">
+                <van-sticky :offset-top="127" class="one_report_select">
                     <van-cell title="选择人员" clickable :value="userNameValue" @click="showUserPopu()"
                         value-class="userNameValue">
                         <template #extra>
@@ -47,145 +47,152 @@
                 <van-datetime-picker v-model="currentDate" type="date" :min-date="minDate" :max-date="maxDate"
                     @confirm="changeTime" @cancel="showPicker = false" />
             </van-popup>
-            <van-skeleton :v-if="report.length != 0" v-for="(item, index) in report" title avatar :row="3" :loading="false"
-                :key="index">
-                <van-panel class="one_report" :title="item.name" :status="statusTxt[item.state]">
-                    <template #header>
-                        <div class="van-cell van-panel__header">
-                            <div class="van-cell__title">
-                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName'
-                                        :openid='item.name'></ww-open-data></span>
-                                <span v-else>{{ item.name }}</span>
-                            </div>
-                            <div class="van-cell__value van-panel__header-value">
-                                <span>{{ statusTxt[item.state] }}</span>
+            <!--分页,加载更多-->
+            <van-pull-refresh v-model="isDownloading" @refresh="onDownRefresh">
+                <van-list v-model="isUpLoading" :finished="upFinished" :immediate-check="false" :offset="100" finished-text="没有更多了" @load="onLoadList">
+                    <van-skeleton :v-if="report.length != 0" v-for="(item, index) in report" title avatar :row="3" :loading="false"
+                        :key="index">
+                        <van-panel class="one_report" :title="item.name" :status="statusTxt[item.state]">
+                            <template #header>
+                                <div class="van-cell van-panel__header">
+                                    <div class="van-cell__title">
+                                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName'
+                                                :openid='item.name'></ww-open-data></span>
+                                        <span v-else>{{ item.name }}</span>
+                                    </div>
+                                    <div class="van-cell__value van-panel__header-value">
+                                        <span>{{ statusTxt[item.state] }}</span>
+                                    </div>
+                                </div>
+                            </template>
+                            <div class="form_text">
+                                <span style="margin-right:20px;margin-left:5px;font-size:14px;">
+                                    总填报:
+                                    <span>{{ parseFloat(item.reportTime).toFixed(1) }}h</span>
+                                </span>
                             </div>
-                        </div>
-                    </template>
-                    <div class="form_text">
-                        <span style="margin-right:20px;margin-left:5px;font-size:14px;">
-                            总填报:
-                            <span>{{ parseFloat(item.reportTime).toFixed(1) }}h</span>
-                        </span>
-                    </div>
-                    <div v-if="user.timeType.enableNewWeeklyfill == 1 && item.summary != null" style="margin-left:20px;"
-                        v-html="'<b>' + item.summaryTitle + '</b><br>' + item.summary.replace(/\r\n/g, '<br>')">
+                            <div v-if="user.timeType.enableNewWeeklyfill == 1 && item.summary != null" style="margin-left:20px;"
+                                v-html="'<b>' + item.summaryTitle + '</b><br>' + item.summary.replace(/\r\n/g, '<br>')">
 
-                    </div>
-                    <div v-for="(item1, index1) in item.data" class="one_report_data" :key="index1">
-                        <div class="project_title" style="font-weight:bold;">项目:{{ item1.project }} <span
-                                :style="'color:' + statusColor[item1.state]">[
-                                <span v-if="item1.state == 0">
-                                    <span v-if="item1.isDeptAudit == 0">
-                                        <span v-if="item1.projectAuditState == 0">
-                                            待项目审核人<span v-if="item1.projectAuditorName != null">(
-                                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName'
-                                                        :openid='item1.projectAuditorName'></ww-open-data></span>
-                                                <span v-else>{{ item1.projectAuditorName }}</span>
-                                                )</span>审核
+                            </div>
+                            <div v-for="(item1, index1) in item.data" class="one_report_data" :key="index1">
+                                <div class="project_title" style="font-weight:bold;">项目:{{ item1.project }} <span
+                                        :style="'color:' + statusColor[item1.state]">[
+                                        <span v-if="item1.state == 0">
+                                            <span v-if="item1.isDeptAudit == 0">
+                                                <span v-if="item1.projectAuditState == 0">
+                                                    待项目审核人<span v-if="item1.projectAuditorName != null">(
+                                                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName'
+                                                                :openid='item1.projectAuditorName'></ww-open-data></span>
+                                                        <span v-else>{{ item1.projectAuditorName }}</span>
+                                                        )</span>审核
+                                                </span>
+                                                <span style="color:#32CD32;" v-else-if="item1.projectAuditState == 1">
+                                                    项目审核人<span v-if="item1.projectAuditorName != null">(
+                                                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName'
+                                                                :openid='item1.projectAuditorName'></ww-open-data></span>
+                                                        <span v-else>{{ item1.projectAuditorName }}</span>
+                                                        )</span>审核通过
+                                                </span>
+                                            </span>
+                                            <span v-else-if="item1.isDeptAudit == 1">
+                                                待
+                                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName'
+                                                        :openid='item1.auditDeptName'></ww-open-data></span>
+                                                <span v-else>{{ item1.auditDeptName }}</span>
+                                                审核
+                                            </span>
                                         </span>
-                                        <span style="color:#32CD32;" v-else-if="item1.projectAuditState == 1">
-                                            项目审核人<span v-if="item1.projectAuditorName != null">(
-                                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName'
-                                                        :openid='item1.projectAuditorName'></ww-open-data></span>
-                                                <span v-else>{{ item1.projectAuditorName }}</span>
-                                                )</span>审核通过
+                                        <span v-else>
+                                            {{ statusTxt[item1.state] }}
                                         </span>
-                                    </span>
-                                    <span v-else-if="item1.isDeptAudit == 1">
-                                        待
-                                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName'
-                                                :openid='item1.auditDeptName'></ww-open-data></span>
-                                        <span v-else>{{ item1.auditDeptName }}</span>
-                                        审核
-                                    </span>
-                                </span>
-                                <span v-else>
-                                    {{ statusTxt[item1.state] }}
-                                </span>
-                                <!-- {{statusTxt[item1.state]}} -->
+                                        <!-- {{statusTxt[item1.state]}} -->
 
-                                ] </span></div>
-                        <div style="color:red;" v-if="item1.state == 2 && item1.rejectReason != null">原因:{{
-                            item1.rejectReason }}
-                        </div>
-                        <div class="project_title" v-if="item1.subProjectName != null && user.companyId != yuzhongCompId">
-                            子项目:{{ item1.subProjectName }}</div>
-                        <div class="project_title" v-if="user.companyId == yuzhongCompId">
-                            角色:{{ item1.extraField1 ? roleList.find(r => r.value == item1.extraField1).label : '' }}</div>
-                        <div class="project_title" v-if="user.company.packageProject == 1 && item1.groupName != null">
-                            任务分组:{{ item1.groupName }}</div>
-                        <div class="project_title" v-if="user.companyId == yuzhongCompId">
-                            工作职责:{{ item1.extraField2 ? item1.extraField2Name : '' }}</div>
-                        <div class="project_title" v-if="user.companyId == yuzhongCompId">
-                            工作内容:{{ item1.extraField3 ? item1.extraField3Name : '' }}</div>
-                        <div class="project_title" v-if="user.company.packageProject == 1 && item1.stage != '-'">
-                            投入阶段:{{ item1.stage }}</div>
-                        <!--自定义维度 -->
-                        <div class="project_title" v-if="user.timeType.customDegreeActive == 1">
-                            {{ user.timeType.customDegreeName }}:{{ item1.degreeName }}</div>
-                        <div class="project_title" v-if="user.timeType.customDataActive == 1">
-                            {{ user.timeType.customDataName }}:{{ item1.customData }}</div>
-                        <div class="project_title" v-if="user.timeType.customTextActive == 1">
-                            {{ user.timeType.customTextName }}:{{ item1.customText }}</div>
-                        <div class="project_title" v-if="user.company.packageEngineering == 1">
-                            专业进度:
-                            <span style="margin-right:10px;" v-for="progressItem in item1.professionProgress"
-                                :key="progressItem.id">{{ progressItem.professionName }}({{ progressItem.progress }}%)
-                            </span>
-                        </div>
+                                        ] </span></div>
+                                <div style="color:red;" v-if="item1.state == 2 && item1.rejectReason != null">原因:{{
+                                    item1.rejectReason }}
+                                </div>
+                                <div class="project_title" v-if="item1.subProjectName != null && user.companyId != yuzhongCompId">
+                                    子项目:{{ item1.subProjectName }}</div>
+                                <div class="project_title" v-if="user.companyId == yuzhongCompId">
+                                    角色:{{ item1.extraField1 ? roleList.find(r => r.value == item1.extraField1).label : '' }}</div>
+                                <div class="project_title" v-if="user.company.packageProject == 1 && item1.groupName != null">
+                                    任务分组:{{ item1.groupName }}</div>
+                                <div class="project_title" v-if="user.companyId == yuzhongCompId">
+                                    工作职责:{{ item1.extraField2 ? item1.extraField2Name : '' }}</div>
+                                <div class="project_title" v-if="user.companyId == yuzhongCompId">
+                                    工作内容:{{ item1.extraField3 ? item1.extraField3Name : '' }}</div>
+                                <div class="project_title" v-if="user.company.packageProject == 1 && item1.stage != '-'">
+                                    投入阶段:{{ item1.stage }}</div>
+                                <!--自定义维度 -->
+                                <div class="project_title" v-if="user.timeType.customDegreeActive == 1">
+                                    {{ user.timeType.customDegreeName }}:{{ item1.degreeName }}</div>
+                                <div class="project_title" v-if="user.timeType.customDataActive == 1">
+                                    {{ user.timeType.customDataName }}:{{ item1.customData }}</div>
+                                <div class="project_title" v-if="user.timeType.customTextActive == 1">
+                                    {{ user.timeType.customTextName }}:{{ item1.customText }}</div>
+                                <div class="project_title" v-if="user.company.packageEngineering == 1">
+                                    专业进度:
+                                    <span style="margin-right:10px;" v-for="progressItem in item1.professionProgress"
+                                        :key="progressItem.id">{{ progressItem.professionName }}({{ progressItem.progress }}%)
+                                    </span>
+                                </div>
 
-                        <div class="project_title" v-if="item1.taskId">任务:{{ item1.taskName }}</div>
-                        <!--根据类型选择使用的模板 -->
-                        <div v-if="item1.multiWorktime == 0">
-                            <div class="project_time">时长:
-                                <span v-if="item1.reportTimeType == 0" style="margin-right:10px;">{{
-                                    fullDayTxt[item1.timeType] }}</span>
-                                <span v-if="item1.reportTimeType == 2" style="margin-right:10px;">{{ item1.startTime + '-' +
-                                    item1.endTime }}</span>{{ item1.time.toFixed(1) }}h
-                                <div class="button" v-if="item1.isOvertime == 1">加班<span v-if="item1.overtimeHours">{{
-                                    item1.overtimeHours.toFixed(1) }}h</span></div>
-                            </div>
-                            <div class="project_content">事项:<span v-html="item1.content"></span></div>
+                                <div class="project_title" v-if="item1.taskId">任务:{{ item1.taskName }}</div>
+                                <!--根据类型选择使用的模板 -->
+                                <div v-if="item1.multiWorktime == 0">
+                                    <div class="project_time">时长:
+                                        <span v-if="item1.reportTimeType == 0" style="margin-right:10px;">{{
+                                            fullDayTxt[item1.timeType] }}</span>
+                                        <span v-if="item1.reportTimeType == 2" style="margin-right:10px;">{{ item1.startTime + '-' +
+                                            item1.endTime }}</span>{{ item1.time.toFixed(1) }}h
+                                        <div class="button" v-if="item1.isOvertime == 1">加班<span v-if="item1.overtimeHours">{{
+                                            item1.overtimeHours.toFixed(1) }}h</span></div>
+                                    </div>
+                                    <div class="project_content">事项:<span v-html="item1.content"></span></div>
 
-                        </div>
-                        <div v-if="item1.multiWorktime == 1">
-                            <div>项目时长:<span style="margin-right:10px;">{{ item1.time.toFixed(1) }}h</span>
-                                <div class="button" v-if="item1.isOvertime == 1">加班<span v-if="item1.overtimeHours">{{
-                                    item1.overtimeHours.toFixed(1) }}h</span></div>
-                            </div>
-                            <div style="position:relative;border:#ccc 0.5px solid;padding:3px;margin:5px 0px;"
-                                v-for="(timeItem, index) in item1.worktimeList" :key="index">
-                                <div class="project_time">时长:
-                                    <!-- <span v-if="timeItem.reportTimeType == 0" style="margin-right:10px;">{{fullDayTxt[item1.timeType]}}</span> -->
-                                    <span style="margin-right:10px;">{{ timeItem.startTime + '-' + timeItem.endTime
-                                    }}</span>{{ timeItem.time.toFixed(1) }}h
                                 </div>
-                                <div class="project_content">事项:<span v-html="timeItem.content"></span></div>
+                                <div v-if="item1.multiWorktime == 1">
+                                    <div>项目时长:<span style="margin-right:10px;">{{ item1.time.toFixed(1) }}h</span>
+                                        <div class="button" v-if="item1.isOvertime == 1">加班<span v-if="item1.overtimeHours">{{
+                                            item1.overtimeHours.toFixed(1) }}h</span></div>
+                                    </div>
+                                    <div style="position:relative;border:#ccc 0.5px solid;padding:3px;margin:5px 0px;"
+                                        v-for="(timeItem, index) in item1.worktimeList" :key="index">
+                                        <div class="project_time">时长:
+                                            <!-- <span v-if="timeItem.reportTimeType == 0" style="margin-right:10px;">{{fullDayTxt[item1.timeType]}}</span> -->
+                                            <span style="margin-right:10px;">{{ timeItem.startTime + '-' + timeItem.endTime
+                                            }}</span>{{ timeItem.time.toFixed(1) }}h
+                                        </div>
+                                        <div class="project_content">事项:<span v-html="timeItem.content"></span></div>
+                                    </div>
+                                </div>
+                                <div style="padding:5px;text-align:center;" v-if="item1.pics != null && item1.pics.length > 0">
+                                    <span v-for="(p, index) in item1.pics" :key="p" style="margin-right:10px;">
+                                        <img :src="p" style="width:80px; height:80px;" @click="showLargeImg(item1.pics, index)" />
+                                    </span>
+                                </div>
+                                <van-divider />
                             </div>
-                        </div>
-                        <div style="padding:5px;text-align:center;" v-if="item1.pics != null && item1.pics.length > 0">
-                            <span v-for="(p, index) in item1.pics" :key="p" style="margin-right:10px;">
-                                <img :src="p" style="width:80px; height:80px;" @click="showLargeImg(item1.pics, index)" />
-                            </span>
-                        </div>
-                        <van-divider />
-                    </div>
-                    <van-popup v-model="imgShow" position="bottom" closeable>
-                        <van-swipe class="my-swipe" indicator-color="white">
-                            <van-swipe-item v-for="(picItem, index) in tmpPics" :key="index">
-                                <img :src="picItem" style="width:100%;" />
-                            </van-swipe-item>
-                        </van-swipe>
-                    </van-popup>
-
-                    <!-- 编辑 -->
-                    <div slot="footer" class="foot">
-                        <van-button size="small" type="primary" @click="editor(item)"
-                            v-if="item.id == user.id && (item.state == 2 || item.state == 3)">编辑日报</van-button>
-                    </div>
-                </van-panel>
-            </van-skeleton>
+                            <van-popup v-model="imgShow" position="bottom" closeable>
+                                <van-swipe class="my-swipe" indicator-color="white">
+                                    <van-swipe-item v-for="(picItem, index) in tmpPics" :key="index">
+                                        <img :src="picItem" style="width:100%;" />
+                                    </van-swipe-item>
+                                </van-swipe>
+                            </van-popup>
+
+                            <!-- 编辑 -->
+                            <div slot="footer" class="foot">
+                                <van-button size="small" type="primary" @click="editor(item)"
+                                    v-if="item.id == user.id && (item.state == 2 || item.state == 3)">编辑日报</van-button>
+                            </div>
+                        </van-panel>
+                    </van-skeleton>
+                </van-list>
+            </van-pull-refresh>
+
+            
             <van-empty v-if="report.length == 0" description="暂无日报">
                 <van-button round type="primary" class="bottom-button" @click="toWriteReport()">去填写</van-button>
             </van-empty>
@@ -262,6 +269,11 @@ export default {
     components: {},
     data() {
         return {
+            isDownloading: false,
+            isUpLoading: false, // 上拉加载
+            upFinished: false, // 上拉加载完毕
+            pageIndex: 0,
+            hasMore: true,
             yuzhongCompId: 3385,
             roleList: [{ value: 1, label: 'CRC&LM' }, { value: 2, label: 'PM' }],
             tmpPics: [],
@@ -302,6 +314,52 @@ export default {
     created() {
     },
     methods: {
+        onDownRefresh() {
+            this.pageIndex = 1
+            this.upFinished = false // 不写这句会导致你上拉到底过后在下拉刷新将不能触发下拉加载事件
+            this.getReport();
+        },
+        onLoadList() {
+            if(!this.hasMore) {
+                this.upFinished = true
+                this.isUpLoading = false
+                return
+            }
+            this.pageIndex++;
+            this.requestHttpReports();
+        },
+        requestHttpReports() {
+            this.hasWaiting = false;
+            let pames = {
+                date: this.nowTime,
+            }
+            if (this.selectPeopleVal.id) {
+                pames.userId = this.selectPeopleVal.id
+            }
+            if (this.departmentText && this.selectDepartmentText.length > 0) {
+                pames.deptId = this.selectDepartmentText[0].id
+            }
+            pames.pageIndex = this.pageIndex;
+            this.$axios.post("/report/getReportList", pames)
+                .then(res => {
+                    if (res.code == "ok") {
+                        this.report = this.report.concat(res.data.data);
+                        this.hasMore = res.data.hasMore;
+                        this.isUpLoading = false;
+                        this.isDownloading = false;
+                        //计算状态
+                        for (var i = 0; i < this.report.length; i++) {
+                            var item = this.report[i];
+                            if (item.state == 0) {
+                                this.hasWaiting = true;
+                            }
+                        }
+                    } else {
+                        this.$toast.clear();
+                        this.$toast.fail('获取失败:' + res.msg);
+                    }
+                }).catch(err => { this.$toast.clear(); });
+        },
         showLargeImg(item, index) {
             this.imgShow = true;
             this.tmpPics = item;
@@ -446,38 +504,10 @@ export default {
 
         // 获取日报
         getReport() {
-            this.hasWaiting = false;
-            const toast = this.$toast.loading({
-                forbidClick: true,
-                duration: 0
-            });
-            // this.nowTime = '2023-04-13'
-            let pames = {
-                date: this.nowTime,
-            }
-            if (this.selectPeopleVal.id) {
-                pames.userId = this.selectPeopleVal.id
-            }
-            if (this.departmentText && this.selectDepartmentText.length > 0) {
-                pames.deptId = this.selectDepartmentText[0].id
-            }
-            this.$axios.post("/report/getReportList", pames)
-                .then(res => {
-                    if (res.code == "ok") {
-                        this.$toast.clear();
-                        this.report = res.data;
-                        //计算状态
-                        for (var i = 0; i < this.report.length; i++) {
-                            var item = this.report[i];
-                            if (item.state == 0) {
-                                this.hasWaiting = true;
-                            }
-                        }
-                    } else {
-                        this.$toast.clear();
-                        this.$toast.fail('获取失败:' + res.msg);
-                    }
-                }).catch(err => { this.$toast.clear(); });
+            this.pageIndex = 0;
+            this.isUpLoading = false;
+            this.report = [];
+            this.requestHttpReports();
         },
         // 点击编辑
         editor(item) {