Kaynağa Gözat

提交代码

Lijy 11 ay önce
ebeveyn
işleme
bf0f8362e3

+ 15 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/FinancialAuditController.java

@@ -1,6 +1,7 @@
 package com.management.platform.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -25,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -46,14 +48,19 @@ public class FinancialAuditController {
 
     @RequestMapping("/list")
     public HttpRespMsg list(Integer pageIndex, Integer pageSize, String startDate, String endDate, Integer status, HttpServletRequest request) throws ParseException {
-        HttpRespMsg httpRespMsg = new HttpRespMsg(); 
-        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();  
-        QueryWrapper<FinancialAudit> queryWrapper = new QueryWrapper<FinancialAudit>()  
-            .eq("company_id", companyId)  
-            .eq("review_status", status)  
-            .ge("report_yrMnth", startDate)
-            .le("report_yrMnth", endDate);
-        IPage<FinancialAudit> auditIPage = financialAuditService.page(new Page<FinancialAudit>(pageIndex, pageSize), queryWrapper);
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        LambdaQueryWrapper<FinancialAudit> financialAuditLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        financialAuditLambdaQueryWrapper.eq(FinancialAudit::getCompanyId,companyId).between(FinancialAudit::getReportYrmnth,startDate,endDate).eq(status!=0,FinancialAudit::getReviewStatus,status);
+
+//            QueryWrapper<FinancialAudit> queryWrapper = new QueryWrapper<FinancialAudit>()
+//                    .eq("company_id", companyId)
+//                    .eq("review_status", status)
+//                    .ge("report_yrMnth", startDate)
+//                    .le("report_yrMnth", endDate);
+
+        IPage<FinancialAudit> auditIPage = financialAuditService.page(new Page<FinancialAudit>(pageIndex, pageSize), financialAuditLambdaQueryWrapper);
         Map<String, Object> map = new HashMap<>();
         map.put("records", auditIPage.getRecords());
         map.put("total", auditIPage.getTotal());

+ 10 - 9
fhKeeper/formulahousekeeper/timesheet/src/views/financeAudit/financeAudit.vue

@@ -25,7 +25,7 @@
                 v-loading="allLoading.tableLoading">
                 <el-table-column prop="reportYrmnth" label="日报年月" align="center">
                     <template slot-scope="scope">
-                        <el-button type="text" @click="toDetail()">{{ scope.row.reportYrmnth }}</el-button>
+                        <el-button type="text" @click="toDetail(scope.row)">{{ scope.row.reportYrmnth }}</el-button>
                     </template>
                 </el-table-column>
                 <el-table-column prop="reviewerName" label="审核人" align="center"></el-table-column>
@@ -35,10 +35,10 @@
                         {{ scope.row.reviewStatus == 1 ? '未审核' : '已审核' }}
                     </template>
                 </el-table-column>
-                <el-table-column label="操作" align="center" v-if="tableForm.status == 1" fixed="right">
+                <el-table-column label="操作" align="center" fixed="right">
                     <template slot-scope="scope">
-                        <el-button @click="audit(scope.row)" type="text">审核</el-button>
-                        <el-button type="text" @click="toDetail()">查看详情</el-button>
+                        <el-button @click="audit(scope.row)" type="text" v-if="tableForm.status == 1">审核</el-button>
+                        <el-button type="text" @click="toDetail(scope.row)">查看详情</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -61,10 +61,11 @@ export default {
         return {
             tableForm: {
                 dates: [],
-                status: 1,
+                status: 0,
             },
             financeAuditTableData: [],
             statusOptions: [
+                { value: 0, label: '全部' },
                 { value: 1, label: '未审核' },
                 { value: 2, label: '已审核' },
             ],
@@ -88,12 +89,12 @@ export default {
         this.getFinanceAuditTableData()
     },
     methods: {
-        toDetail() {
+        toDetail(item) {
             this.$router.push({
                 path: '/cost',
                 query: {
-                    startDate: this.tableForm.dates[0],
-                    endDate: this.tableForm.dates[1]
+                    startDate: item.reportYrmnth,
+                    endDate: item.reportYrmnth
                 }
             })
         },
@@ -119,7 +120,7 @@ export default {
                 pageIndex: this.paging.pageIndex,
                 startDate: this.tableForm.dates[0] + '-01' || '',
                 endDate: this.tableForm.dates[1] + '-01' || '',
-                status: this.tableForm.status || '',
+                status: this.tableForm.status,
             }
             this.postData('/financial-audit/list', param).then(({ data }) => {
                 const { total, records } = data