Просмотр исходного кода

驳回/专家登陆短信校验

licailing 5 лет назад
Родитель
Сommit
14c7d3610b

+ 43 - 43
src/main/h5/src/views/login.vue

@@ -74,49 +74,49 @@ export default {
         message: "加载中...",
         forbidClick: true
       });
-      //   this.$http
-      //     .get("/sms/verify", {
-      //       phone: this.ruleForm.phone,
-      //       code: this.ruleForm.code
-      //     })
-      //     .then(() => {
-      //       return this.$http.post("/auth/phoneLogin", {
-      //         phone: this.ruleForm.phone
-      //       });
-      //     })
-      //     .catch(e => {
-      //       this.$toast(e.error || "登录失败");
-      //       return Promise.reject();
-      //     })
-      //     .then(res => {
-      //       localStorage.setItem("token", res);
-      //       return this.$store.dispatch("getUserInfo");
-      //     })
-      //     .then(() => {
-      //       this.$toast.clear();
-      //       this.$router.replace({ path: "/" });
-      //     })
-      //     .catch(e => {
-      //       if (e) {
-      //         this.$toast(e.error);
-      //       }
-      //     });
-      this.$http
-        .post("/auth/phoneLogin", {
-          phone: this.ruleForm.phone
-        })
-        .then(res => {
-          localStorage.setItem("token", res);
-          return this.$store.dispatch("getUserInfo");
-        })
-        .then(() => {
-          this.$toast.clear();
-          this.$router.replace({ path: "/" });
-        })
-        .catch(e => {
-          this.$toast.clear();
-          this.$toast(e.error || "登录失败");
-        });
+        this.$http
+          .get("/sms/verify", {
+            phone: this.ruleForm.phone,
+            code: this.ruleForm.code
+          })
+          .then(() => {
+            return this.$http.post("/auth/phoneLogin", {
+              phone: this.ruleForm.phone
+            });
+          })
+          .catch(e => {
+            this.$toast(e.error || "登录失败");
+            return Promise.reject();
+          })
+          .then(res => {
+            localStorage.setItem("token", res);
+            return this.$store.dispatch("getUserInfo");
+          })
+          .then(() => {
+            this.$toast.clear();
+            this.$router.replace({ path: "/" });
+          })
+          .catch(e => {
+            if (e) {
+              this.$toast(e.error);
+            }
+          });
+      // this.$http
+      //   .post("/auth/phoneLogin", {
+      //     phone: this.ruleForm.phone
+      //   })
+      //   .then(res => {
+      //     localStorage.setItem("token", res);
+      //     return this.$store.dispatch("getUserInfo");
+      //   })
+      //   .then(() => {
+      //     this.$toast.clear();
+      //     this.$router.replace({ path: "/" });
+      //   })
+      //   .catch(e => {
+      //     this.$toast.clear();
+      //     this.$toast(e.error || "登录失败");
+      //   });
     },
     sendSms() {
       if (!this.ruleForm.phone || !/^1[3-9]\d{9}$/.test(this.ruleForm.phone)) {

+ 2 - 0
src/main/java/com/izouma/wenlvju/domain/Rate.java

@@ -168,6 +168,8 @@ public class Rate extends BaseEntity {
 
     private String remark;
 
+    private boolean isRejected;
+
     public String getDetailAddress() {
         String str = "江苏省南京市";
         if (StrUtil.isNotBlank(this.address)) {

+ 4 - 0
src/main/java/com/izouma/wenlvju/repo/RateAuditRepo.java

@@ -1,12 +1,14 @@
 package com.izouma.wenlvju.repo;
 
 import com.izouma.wenlvju.domain.RateAudit;
+import com.izouma.wenlvju.enums.RateStatus;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 
 import javax.transaction.Transactional;
+import java.util.List;
 
 public interface RateAuditRepo extends JpaRepository<RateAudit, Long>, JpaSpecificationExecutor<RateAudit> {
     @Query("update RateAudit t set t.del = true where t.id = ?1")
@@ -18,4 +20,6 @@ public interface RateAuditRepo extends JpaRepository<RateAudit, Long>, JpaSpecif
     @Modifying
     @Transactional
     void softDeleteByRateIdIn(Iterable<Long> rateIds);
+
+    List<RateAudit> findAllByStatus(RateStatus status);
 }

+ 5 - 0
src/main/java/com/izouma/wenlvju/service/RateService.java

@@ -109,6 +109,11 @@ public class RateService {
     public void audit(Long id, RateStatus status, String remark, Long userId) {
         Rate rate = rateRepo.findById(id).orElseThrow(new BusinessException("无记录"));
         rate.setStatus(status);
+        if (RateStatus.REVIEW_DENY.equals(status)) {
+            // 市里退回
+            rate.setRejected(true);
+        }
+
         RateAudit rateAudit = RateAudit.builder()
                 .userId(userId)
                 .rateId(id)

+ 2 - 0
src/main/java/com/izouma/wenlvju/web/RateController.java

@@ -21,6 +21,7 @@ import com.izouma.wenlvju.utils.excel.ExcelUtils;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
@@ -58,6 +59,7 @@ public class RateController extends BaseController {
         return rateService.all(pageQuery);
     }
 
+    @PreAuthorize("hasAnyRole('ADMIN','DISTRICT','DISTRICT_STAFF','EXPERT')")
     @PostMapping("/all2")
     public Page<RateDTO> all2(@RequestBody PageQuery pageQuery) {
         pageQuery.setSort("createdAt,desc");

+ 8 - 0
src/main/vue/src/router.js

@@ -367,6 +367,14 @@ const router = new Router({
                         title: '申请完成'
                     }
                 },
+                {
+                    path: '/rateListRejected',
+                    name: 'RateListRejected',
+                    component: () => import(/* webpackChunkName: "rateList" */ '@/views/rate/RateListRejected.vue'),
+                    meta: {
+                        title: '驳回记录'
+                    }
+                },
                 {
                     path: '/organizationInfo',
                     name: 'OrganizationInfo',

+ 27 - 18
src/main/vue/src/views/rate/RateAudit.vue

@@ -199,7 +199,7 @@
                 <div style="margin-top: 10px">
                     <el-button
                         type="success"
-                        v-if="formData.status == 'ACCEPT' || formData.status == 'REVIEW_DENY'"
+                        v-if="(formData.status == 'ACCEPT' || formData.status == 'REVIEW_DENY') && display"
                         @click="completed"
                         >审核完成</el-button
                     >
@@ -214,20 +214,20 @@ import { mapState } from 'vuex';
 export default {
     name: 'RateEdit',
     computed: {
-        ...mapState(['organization']),
-        saveOtherJson() {
-            const collaborates = [...this.collaborates]
-                .filter(item => {
-                    return !!item.gradingOrganizationId || !!item.consent || !!item.artTypeId;
-                })
-                .map(item => {
-                    return {
-                        ...item,
-                        rateId: this.rateId
-                    };
-                });
-            return JSON.stringify(collaborates);
-        }
+        ...mapState(['userInfo'])
+        // saveOtherJson() {
+        //     const collaborates = [...this.collaborates]
+        //         .filter(item => {
+        //             return !!item.gradingOrganizationId || !!item.consent || !!item.artTypeId;
+        //         })
+        //         .map(item => {
+        //             return {
+        //                 ...item,
+        //                 rateId: this.rateId
+        //             };
+        //         });
+        //     return JSON.stringify(collaborates);
+        // }
     },
     created() {
         if (this.$route.query.id) {
@@ -255,10 +255,8 @@ export default {
                     console.log(e);
                     this.$message.error(e.error);
                 });
-            // }
         }
         this.$http
-            // .get('/district/NJ')
             .post('/setting/byFlag', { flag: 2 })
             .then(res => {
                 this.districts = res;
@@ -291,6 +289,7 @@ export default {
             .catch(e => {
                 console.log(e);
             });
+        this.getAdmin();
     },
     data() {
         return {
@@ -352,10 +351,20 @@ export default {
                 emitPath: false,
                 checkStrictly: true,
                 expandTrigger: 'hover'
-            }
+            },
+            display: false
         };
     },
     methods: {
+        getAdmin() {
+            let data = this.userInfo.authorities;
+            data.forEach(element => {
+                if (element.name === 'ROLE_DISTRICT' || element.name === 'ROLE_DISTRICT_STAFF') {
+                    this.display = true;
+                    return;
+                }
+            });
+        },
         onAddOtherForm() {
             this.collaborates.push({
                 gradingOrganizationId: '',

+ 0 - 20
src/main/vue/src/views/rate/RateDistrictList.vue

@@ -247,14 +247,6 @@
                     >
                         退回申请
                     </el-button>
-                    <!-- <el-button
-                        @click="supervision(row.id)"
-                        type="success"
-                        size="mini"
-                        plain
-                        v-if="(row.status === 'ASSIGN_EXPERT') & display"
-                        >分配专家组</el-button
-                    > -->
                     <el-button
                         v-if="row.status === 'SUBMIT_PAPER_MATERIALS'"
                         type="success"
@@ -340,7 +332,6 @@ export default {
             supervisor: [],
             dialogVisible: false,
             rateId: '',
-            display: false,
             gradeOptions: [
                 { label: '优秀', value: 'EXCELLENT' },
                 { label: '合格', value: 'ELIGIBLE' },
@@ -629,17 +620,6 @@ export default {
                     this.$message.error(e.error);
                 });
         },
-        getAdmin() {
-            let data = this.userInfo.authorities;
-            let display = false;
-            data.forEach(element => {
-                if (element.name === 'ROLE_ADMIN') {
-                    display = true;
-                }
-            });
-            this.display = display;
-            return display;
-        },
         saveComplete(row) {
             this.$set(row, 'loading', true);
             this.$confirm('确认已收到承办单位提交的纸质材料?', '提示', {

+ 0 - 12
src/main/vue/src/views/rate/RateDistrictListDone.vue

@@ -340,7 +340,6 @@ export default {
             supervisor: [],
             dialogVisible: false,
             rateId: '',
-            display: false,
             gradeOptions: [
                 { label: '优秀', value: 'EXCELLENT' },
                 { label: '合格', value: 'ELIGIBLE' },
@@ -640,17 +639,6 @@ export default {
                     this.$message.error(e.error);
                 });
         },
-        getAdmin() {
-            let data = this.userInfo.authorities;
-            let display = false;
-            data.forEach(element => {
-                if (element.name === 'ROLE_ADMIN') {
-                    display = true;
-                }
-            });
-            this.display = display;
-            return display;
-        },
         saveComplete(row) {
             this.$set(row, 'loading', true);
             this.$confirm('确认已收到承办单位提交的纸质材料?', '提示', {

+ 2 - 22
src/main/vue/src/views/rate/RateDistrictListPending.vue

@@ -247,14 +247,6 @@
                     >
                         退回申请
                     </el-button>
-                    <!-- <el-button
-                        @click="supervision(row.id)"
-                        type="success"
-                        size="mini"
-                        plain
-                        v-if="(row.status === 'ASSIGN_EXPERT') & display"
-                        >分配专家组</el-button
-                    > -->
                     <el-button
                         v-if="row.status === 'SUBMIT_PAPER_MATERIALS'"
                         type="success"
@@ -340,7 +332,6 @@ export default {
             supervisor: [],
             dialogVisible: false,
             rateId: '',
-            display: false,
             gradeOptions: [
                 { label: '优秀', value: 'EXCELLENT' },
                 { label: '合格', value: 'ELIGIBLE' },
@@ -364,7 +355,7 @@ export default {
         },
         ...mapState(['userInfo']),
         moreWidth() {
-            let larges = ['FIRST_REVIEW_COMPLETED', 'FIRST_REVIEW_COMPLETED', 'ACCEPT'];
+            let larges = ['FIRST_REVIEW_COMPLETED', 'FIRST_REVIEW_COMPLETED', 'ACCEPT', 'REVIEW_DENY'];
             let mendus = ['SUBMIT_PAPER_MATERIALS'];
 
             let list = [...this.tableData];
@@ -414,7 +405,7 @@ export default {
                 query: {
                     submit: true,
                     district: this.userInfo.district,
-                    status: ['FIRST_REVIEW_PENDING', 'ACCEPT', 'FIRST_REVIEW_COMPLETED']
+                    status: ['FIRST_REVIEW_PENDING', 'ACCEPT', 'FIRST_REVIEW_COMPLETED', 'REVIEW_DENY']
                 }
             };
             if (this.search) {
@@ -624,17 +615,6 @@ export default {
                     this.$message.error(e.error);
                 });
         },
-        getAdmin() {
-            let data = this.userInfo.authorities;
-            let display = false;
-            data.forEach(element => {
-                if (element.name === 'ROLE_ADMIN') {
-                    display = true;
-                }
-            });
-            this.display = display;
-            return display;
-        },
         saveComplete(row) {
             this.$set(row, 'loading', true);
             this.$confirm('确认已收到承办单位提交的纸质材料?', '提示', {

+ 0 - 12
src/main/vue/src/views/rate/RateList.vue

@@ -328,7 +328,6 @@ export default {
             supervisor: [],
             dialogVisible: false,
             rateId: '',
-            display: false,
             dialogScore: false,
             gradeOptions: [
                 { label: '优秀', value: 'EXCELLENT' },
@@ -625,17 +624,6 @@ export default {
                     this.$message.error(e.error);
                 });
         },
-        getAdmin() {
-            let data = this.userInfo.authorities;
-            let display = false;
-            data.forEach(element => {
-                if (element.name === 'ROLE_ADMIN') {
-                    display = true;
-                }
-            });
-            this.display = display;
-            return display;
-        },
         openScore(row) {
             this.dialogScore = true;
             this.scoreInfo = row;

+ 0 - 12
src/main/vue/src/views/rate/RateListDone.vue

@@ -266,7 +266,6 @@ export default {
             supervisor: [],
             dialogVisible: false,
             rateId: '',
-            display: false,
             dialogScore: false,
             gradeOptions: [
                 { label: '优秀', value: 'EXCELLENT' },
@@ -549,17 +548,6 @@ export default {
                     this.$message.error(e.error);
                 });
         },
-        getAdmin() {
-            let data = this.userInfo.authorities;
-            let display = false;
-            data.forEach(element => {
-                if (element.name === 'ROLE_ADMIN') {
-                    display = true;
-                }
-            });
-            this.display = display;
-            return display;
-        },
         openScore(row) {
             this.dialogScore = true;
             this.scoreInfo = row;

+ 0 - 12
src/main/vue/src/views/rate/RateListPending.vue

@@ -266,7 +266,6 @@ export default {
             supervisor: [],
             dialogVisible: false,
             rateId: '',
-            display: false,
             dialogScore: false,
             gradeOptions: [
                 { label: '优秀', value: 'EXCELLENT' },
@@ -549,17 +548,6 @@ export default {
                     this.$message.error(e.error);
                 });
         },
-        getAdmin() {
-            let data = this.userInfo.authorities;
-            let display = false;
-            data.forEach(element => {
-                if (element.name === 'ROLE_ADMIN') {
-                    display = true;
-                }
-            });
-            this.display = display;
-            return display;
-        },
         openScore(row) {
             this.dialogScore = true;
             this.scoreInfo = row;

+ 541 - 0
src/main/vue/src/views/rate/RateListRejected.vue

@@ -0,0 +1,541 @@
+<template>
+    <div class="list-view">
+        <div class="filters-container">
+            <div>
+                <el-col :span="7">
+                    <span class="span-size">申请年度</span>
+                    <el-select
+                        v-model="year"
+                        placeholder="请选择年度"
+                        class="filter-item"
+                        clearable
+                        style="width: 220px"
+                        @change="getData"
+                    >
+                        <el-option v-for="item in years" :key="item" :value="item" :label="item + '年'"></el-option>
+                    </el-select>
+                </el-col>
+                <el-col :span="7">
+                    <span class="span-size">承办单位名称</span>
+                    <el-input
+                        placeholder="输入承办单位名称"
+                        v-model="search"
+                        clearable
+                        class="filter-item"
+                        style="width: 220px"
+                        @change="getData"
+                    ></el-input>
+                </el-col>
+                <el-col :span="10">
+                    <label class="span-size">申请时间</label>
+                    <el-date-picker
+                        v-model="dateRange"
+                        type="daterange"
+                        value-format="yyyy-MM-dd HH:mm:ss"
+                        start-placeholder="请选择开始时间"
+                        end-placeholder="请选择结束时间"
+                        range-separator="至"
+                        :default-time="['00:00:00', '23:59:59']"
+                        class="filter-item"
+                        @change="getData"
+                    >
+                    </el-date-picker>
+                </el-col>
+            </div>
+            <div>
+                <el-col :span="7">
+                    <label class="span-size">申请状态</label>
+                    <el-select
+                        class="filter-item"
+                        v-model="status"
+                        clearable
+                        placeholder="请选择状态"
+                        style="width: 220px"
+                        @change="getData"
+                    >
+                        <el-option
+                            v-for="item in statusOptions2"
+                            :key="item.value"
+                            :value="item.value"
+                            :label="item.label"
+                        ></el-option>
+                    </el-select>
+                </el-col>
+                <el-col :span="7">
+                    <label class="span-size">承办单位地址</label>
+                    <el-select v-model="district" style="width: 220px" @change="getData" clearable>
+                        <el-option
+                            v-for="item in districts"
+                            :key="item.id"
+                            :value="item.name"
+                            :label="item.name"
+                        ></el-option>
+                    </el-select>
+                </el-col>
+                <el-col :span="7">
+                    <label class="span-size">评定等级</label>
+                    <el-select
+                        style="width: 220px"
+                        v-model="grade"
+                        placeholder="请选择的等级"
+                        class="filter-item"
+                        multiple
+                        clearable
+                        @change="getData"
+                    >
+                        <el-option
+                            v-for="item in gradeOptions"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value"
+                        ></el-option>
+                    </el-select>
+                </el-col>
+            </div>
+            <div style="padding-left: 10px">
+                <el-col :span="24">
+                    <el-button
+                        @click="download"
+                        type="primary"
+                        icon="el-icon-download"
+                        :loading="downloading"
+                        class="filter-item"
+                        :disabled="totalElements <= 0"
+                        >导出EXCEL
+                    </el-button>
+                </el-col>
+            </div>
+        </div>
+        <el-table
+            :data="tableData"
+            row-key="id"
+            ref="table"
+            header-row-class-name="table-header-row"
+            header-cell-class-name="table-header-cell"
+            row-class-name="table-row"
+            cell-class-name="table-cell"
+            :height="tableHeight"
+        >
+            <el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
+            <!-- <el-table-column prop="id" label="ID" width="100"> </el-table-column> -->
+            <el-table-column prop="name" label="承办单位"> </el-table-column>
+            <el-table-column prop="createdAt" label="申请时间" min-width="100"></el-table-column>
+            <el-table-column prop="year" label="年度" min-width="60"> </el-table-column>
+            <el-table-column prop="gradingOrganization" label="考级机构" min-width="100"> </el-table-column>
+            <el-table-column prop="district" label="地址" min-width="100">
+                <template slot-scope="{ row }"> 江苏省{{ row.district }} </template>
+            </el-table-column>
+            <el-table-column prop="status1" label="状态" min-width="100"> </el-table-column>
+            <el-table-column prop="score" label="分数">
+                <template slot-scope="{ row }">
+                    <span v-if="row.score">{{ row.score }}</span>
+                    <span v-else>暂无</span>
+                </template>
+            </el-table-column>
+            <el-table-column prop="grade" label="等级">
+                <template slot-scope="{ row }">
+                    <span v-if="row.grade == '优秀'"><el-link :underline="false" type="success">优秀</el-link></span>
+                    <span v-else-if="row.grade == '合格'"
+                        ><el-link :underline="false" type="warning">合格</el-link></span
+                    >
+                    <span v-else-if="row.grade == '不合格'"
+                        ><el-link :underline="false" type="danger">不合格</el-link></span
+                    >
+                    <span v-else><el-link :underline="false" type="info">暂无</el-link></span>
+                </template>
+            </el-table-column>
+            <el-table-column label="操作" align="right" fixed="right" min-width="110">
+                <template slot-scope="{ row }">
+                    <el-button @click="editRow(row)" type="primary" size="mini" plain>
+                        查看资料
+                    </el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <!-- <div class="multiple-mode-wrapper">
+                <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button @click="operation1">批量操作1</el-button>
+                    <el-button @click="operation2">批量操作2</el-button>
+                    <el-button @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div> -->
+            <el-pagination
+                background
+                @size-change="onSizeChange"
+                @current-change="onCurrentChange"
+                :current-page="page"
+                :page-sizes="[10, 20, 30, 40, 50]"
+                :page-size="pageSize"
+                layout="total, sizes, prev, pager, next, jumper"
+                :total="totalElements"
+            >
+            </el-pagination>
+        </div>
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex';
+import pageableTable from '@/mixins/pageableTable';
+import rateStatus from '@/mixins/rateStatus';
+
+export default {
+    name: 'RateListRejected',
+    mixins: [pageableTable, rateStatus],
+    data() {
+        return {
+            multipleMode: false,
+            search: '',
+            url: '/rate/all2',
+            downloading: false,
+            supervisor: [],
+            dialogVisible: false,
+            rateId: '',
+            display: false,
+            dialogScore: false,
+            gradeOptions: [
+                { label: '优秀', value: 'EXCELLENT' },
+                { label: '合格', value: 'ELIGIBLE' },
+                { label: '不合格', value: 'NOT_ELIGIBLE' }
+            ],
+            dialogDismiss: false,
+            reason: '',
+            dismissReason: ['资料不全', '缺少附件', '无资格'],
+            form: {},
+            grade: '',
+            status: [],
+            years: [2021, 2022, 2023, 2024, 2025],
+            year: '',
+            districts: [],
+            district: '',
+            dateRange: ''
+        };
+    },
+    created() {
+        this.$http
+            .post('/setting/byFlag', { flag: 2 })
+            .then(res => {
+                this.districts = res;
+            })
+            .catch(e => {
+                console.log(e);
+                this.$message.error(e.error);
+            });
+    },
+    computed: {
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        },
+        ...mapState(['userInfo']),
+        moreWidth() {
+            let info = [...this.tableData].find(item => {
+                return item.status === 'ASSIGN_EXPERT';
+            });
+
+            return !!info;
+        }
+    },
+    mounted() {
+        this.$http
+            .post('/user/authority', { authorityName: 'ROLE_EXPERT' })
+            .then(res => {
+                this.supervisor = res;
+            })
+            .catch(e => {
+                console.log(e);
+                this.$message.error(e.error);
+            });
+    },
+    methods: {
+        gradeFormatter(row, column, cellValue, index) {
+            let selectedOption = this.gradeOptions.find(i => i.value === cellValue);
+            if (selectedOption) {
+                return selectedOption.label;
+            }
+            return '';
+        },
+        beforeGetData() {
+            let data = {
+                query: {
+                    submit: true,
+                    isRejected: true
+                }
+            };
+
+            if (this.search) {
+                data.search = this.search;
+            }
+
+            if (this.status.length > 0) {
+                data.query.status = this.status;
+            }
+            if (this.grade) {
+                data.query.grade = this.grade;
+            }
+            if (this.year) {
+                data.query.year = this.year;
+            }
+            if (this.district) {
+                data.query.district = this.district;
+            }
+            if (this.dateRange && this.dateRange.length > 0) {
+                data.query.createdAt = this.dateRange[0] + ',' + this.dateRange[1];
+            }
+            return data;
+        },
+        toggleMultipleMode(multipleMode) {
+            this.multipleMode = multipleMode;
+            if (!multipleMode) {
+                this.$refs.table.clearSelection();
+            }
+        },
+        addRow() {
+            this.$router.push({
+                path: '/rateEdit',
+                query: {
+                    ...this.$route.query
+                }
+            });
+        },
+        editRow(row) {
+            this.$router.push({
+                // path: '/rateAudit',
+                path: '/organization',
+                query: {
+                    // organId: row.organizationId,
+                    // rateId: row.id
+                    id: row.id,
+                    status: row.status
+                }
+            });
+        },
+        download() {
+            this.downloading = true;
+            let params = { size: 1000, query: { submit: true } };
+            if (this.grade.length > 0) {
+                params.query.grade = this.grade;
+            }
+
+            if (this.status.length > 0) {
+                params.query.status = this.status;
+            }
+
+            this.$axios
+                .post('/rate/excel', params, {
+                    responseType: 'blob'
+                })
+                .then(res => {
+                    console.log(res);
+                    this.downloading = false;
+                    const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
+                    const link = document.createElement('a');
+                    link.href = downloadUrl;
+                    link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
+                    document.body.appendChild(link);
+                    link.click();
+                    link.remove();
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.downloading = false;
+                    this.$message.error(e.error);
+                });
+        },
+        operation1() {
+            this.$notify({
+                title: '提示',
+                message: this.selection
+            });
+        },
+        operation2() {
+            this.$message('操作2');
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+                .then(() => {
+                    return this.$http.post(`/rate/del/${row.id}`);
+                })
+                .then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                })
+                .catch(e => {
+                    if (e !== 'cancel') {
+                        this.$message.error(e.error);
+                    }
+                });
+        },
+        audit(row, status, remark) {
+            this.$set(row, 'loading', true);
+
+            this.$confirm('确认此承办单位同意上报?', '提示', {
+                confirmButtonText: '同意上报',
+                cancelButtonText: '取消',
+                type: 'warning'
+            })
+                .then(() => {
+                    this.$http
+                        .post('/rate/audit', {
+                            id: row.id,
+                            status: status,
+                            score: 0,
+                            remark: remark
+                        })
+                        .then(res => {
+                            this.$set(row, 'loading', false);
+                            this.$message.success('上报成功');
+                            this.getData();
+                        })
+                        .catch(e => {
+                            console.log(e);
+                            this.$set(row, 'loading', false);
+                            this.$message.error(e.error);
+                        });
+                })
+                .catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消'
+                    });
+                    this.$set(row, 'loading', false);
+                });
+        },
+        dismiss(row) {
+            this.dialogDismiss = true;
+            this.form = row;
+        },
+        saveDismiss() {
+            let row = this.form;
+            this.$set(row, 'loading', true);
+            this.$http
+                .post('/rate/audit', {
+                    id: this.form.id,
+                    status: 'REVIEW_DENY',
+                    score: 0,
+                    remark: '复审驳回:' + this.reason
+                })
+                .then(res => {
+                    this.$set(row, 'loading', false);
+                    this.$message.success('退回成功');
+                    this.getData();
+                })
+                .catch(e => {
+                    this.$set(row, 'loading', false);
+                    console.log(e);
+                    this.$message.error(e.error);
+                });
+            this.form = '';
+            this.reason = '';
+            this.dialogDismiss = false;
+        },
+        supervision(id) {
+            this.$router.push({
+                path: '/organizationExpert',
+                query: {
+                    id: id
+                }
+            });
+            // this.dialogVisible = true;
+            // this.rateId = id;
+        },
+        addRegulatory(id) {
+            this.$http
+                .post('/rate/addExpert', {
+                    id: this.rateId,
+                    userId: id
+                })
+                .then(res => {
+                    this.saving = false;
+                    this.$message.success('成功');
+                    this.dialogVisible = false;
+                    this.recordId = '';
+                    this.getData();
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.saving = false;
+                    this.$message.error(e.error);
+                });
+        },
+        openScore(row) {
+            this.dialogScore = true;
+            this.scoreInfo = row;
+        },
+        saveScore() {
+            this.scoreInfo.status = 'SUBMIT_PAPER_MATERIALS';
+            this.$http
+                .post(
+                    '/rate/save',
+                    {
+                        ...this.scoreInfo
+                    },
+                    { body: 'json' }
+                )
+                .then(res => {
+                    this.$message.success('OK');
+                    this.dialogScore = false;
+                    // this.scoreInfo = '';
+                    this.getData();
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.$message.error(e.error);
+                });
+        },
+        saveComplete(row) {
+            this.$confirm('确认已收到区县管理员提交的材料?', '提示', {
+                confirmButtonText: '已收到',
+                cancelButtonText: '暂未收到',
+                type: 'warning'
+            })
+                .then(() => {
+                    this.$http
+                        .post('/rate/paperMaterial', {
+                            id: row.id,
+                            status: 'COMPLETE',
+                            remark: '市政管理员已确认收到区县管理员提交的材料'
+                        })
+                        .then(res => {
+                            this.$message.success('确认成功');
+                            this.getData();
+                        })
+                        .catch(e => {
+                            console.log(e);
+                            this.$message.error(e.error);
+                        });
+                })
+                .catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消'
+                    });
+                    this.$set(row, 'loading', false);
+                });
+        }
+    }
+};
+</script>
+<style lang="less" scoped>
+.el-link {
+    font-size: 12px;
+}
+.span-size {
+    font-size: 14px;
+    color: #565b66;
+    line-height: 15px;
+    padding: 0 10px 0 10px;
+}
+.span-width {
+    width: 330px;
+    // width: 80%;
+    display: inline-block;
+    text-align: right;
+}
+.span-width2 {
+    width: 500px;
+    // float: left;
+    text-align: right;
+    display: inline-block;
+}
+</style>

+ 20 - 2
src/test/java/com/izouma/wenlvju/repo/RepoTest.java

@@ -6,12 +6,16 @@ import com.izouma.wenlvju.ApplicationTests;
 import com.izouma.wenlvju.domain.Collaborate;
 import com.izouma.wenlvju.domain.Organization;
 import com.izouma.wenlvju.domain.Rate;
+import com.izouma.wenlvju.domain.RateAudit;
+import com.izouma.wenlvju.enums.RateStatus;
 import com.izouma.wenlvju.service.storage.StorageService;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 public class RepoTest extends ApplicationTests {
     @Autowired
@@ -22,6 +26,8 @@ public class RepoTest extends ApplicationTests {
     private OrganizationRepo organizationRepo;
     @Autowired
     private RateRepo         rateRepo;
+    @Autowired
+    private RateAuditRepo    rateAuditRepo;
 
     @Test
     public void test() {
@@ -58,7 +64,7 @@ public class RepoTest extends ApplicationTests {
             List<String> strs = new ArrayList<>();
             List<String> strs1 = new ArrayList<>();
             List<String> strs2 = new ArrayList<>();
-            List<String> strs3= new ArrayList<>();
+            List<String> strs3 = new ArrayList<>();
             List<String> strs4 = new ArrayList<>();
             List<String> strs5 = new ArrayList<>();
             List<String> strs6 = new ArrayList<>();
@@ -112,7 +118,7 @@ public class RepoTest extends ApplicationTests {
             });
             user.setFinance(strs6);
 
-            if (CollUtil.isNotEmpty(user.getIntroductionAnnex())){
+            if (CollUtil.isNotEmpty(user.getIntroductionAnnex())) {
                 user.getIntroductionAnnex().forEach(con -> {
                     String path = con.substring(con.lastIndexOf("/", con.lastIndexOf("/") - 1) + 1);
                     String url = storageService.uploadFromUrl(con, path);
@@ -124,4 +130,16 @@ public class RepoTest extends ApplicationTests {
             rateRepo.save(user);
         });
     }
+
+    @Test
+    public void test1() {
+        List<RateAudit> rateAudits = rateAuditRepo.findAllByStatus(RateStatus.REVIEW_DENY);
+        Set<Long> ids = rateAudits.stream().map(RateAudit::getRateId).collect(Collectors.toSet());
+        List<Rate> rates = rateRepo.findAllById(ids);
+        rates.forEach(rate -> {
+            rate.setRejected(true);
+            rateRepo.save(rate);
+        });
+
+    }
 }