licailing 4 лет назад
Родитель
Сommit
d5579c15e0

+ 1 - 1
src/main/h5/src/components/rateInfo.vue

@@ -23,7 +23,7 @@
               <img
                 v-for="(item, index) in getImg(k.value)"
                 :key="index"
-                :src="item"
+                :src="item + '?x-oss-process=image/resize,h_100,m_lfit'"
                 alt=""
                 @click="preview(getImg(k.value), index)"
               />

+ 1 - 0
src/main/java/com/izouma/wenlvju/config/DateConfig.java

@@ -35,6 +35,7 @@ public class DateConfig {
      * 默认日期格式
      */
     public static final String DEFAULT_DATE_FORMAT      = "yyyy-MM-dd";
+    public static final String DEFAULT_DATE_FORMAT1      = "yyyy/MM/dd";
     /**
      * 默认时间格式
      */

+ 5 - 0
src/main/java/com/izouma/wenlvju/dto/RateDTO.java

@@ -53,6 +53,7 @@ public class RateDTO {
     @ApiModelProperty(value = "是否提交")
     private boolean submit;
 
+    @ExcelProperty(value = "是否承办考级活动")
     @ApiModelProperty(value = "是否承办考级活动")
     private boolean undertakeExamination;
 
@@ -79,6 +80,10 @@ public class RateDTO {
     @ApiModelProperty(value = "分数")
     private int score;
 
+    @ExcelIgnore
+    @ApiModelProperty(value = "参考分")
+    private int expertScore;
+
     @ExcelProperty(value = "等级")
     @ApiModelProperty(value = "等级")
     private String grade;

+ 3 - 0
src/main/java/com/izouma/wenlvju/repo/RateExpertAuditRepo.java

@@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 
 import javax.transaction.Transactional;
+import java.util.Collection;
 import java.util.List;
 
 public interface RateExpertAuditRepo extends JpaRepository<RateExpertAudit, Long>, JpaSpecificationExecutor<RateExpertAudit> {
@@ -17,6 +18,8 @@ public interface RateExpertAuditRepo extends JpaRepository<RateExpertAudit, Long
 
     List<RateExpertAudit> findAllByRateId(Long rateId);
 
+    List<RateExpertAudit> findAllByRateIdIn(Collection<Long> rateId);
+
     @Query("update RateExpertAudit t set t.del = true where t.rateId in ?1")
     @Modifying
     @Transactional

+ 30 - 16
src/main/java/com/izouma/wenlvju/service/performance/ProgrammeService.java

@@ -251,16 +251,18 @@ public class ProgrammeService {
         File destDir = TempFile.createTempDirectory("import");
         ZipUtil.unzip(file.getInputStream(), destDir, StandardCharsets.UTF_8);
 
-        File xlsxFile = FileUtils.findExcel1(destDir);
+//        File xlsxFile = FileUtils.findExcel1(destDir);
+//        if (xlsxFile == null) {
+//            Map<String, File> map = FileUtils.findExcel(destDir);
+//            if (map == null) return;
+//
+//            xlsxFile = map.get("file");
+//            destDir = map.get("destDir");
+//        }
+        File xlsxFile = FileUtils.folderMethod1(destDir, null);
         if (xlsxFile == null) {
-            Map<String, File> map = FileUtils.findExcel(destDir);
-            if (map == null) return;
-
-            xlsxFile = map.get("file");
-            destDir = map.get("destDir");
+            return;
         }
-
-
         InputStream indicatorStream = new FileInputStream(xlsxFile);
         UploadDataListener<ProgUploadDTO> listener = new UploadDataListener<>();
         List<ProgUploadDTO> dtos = EasyExcel.read(indicatorStream, ProgUploadDTO.class, listener).sheet().doReadSync();
@@ -302,10 +304,10 @@ public class ProgrammeService {
                     programme.setLevelSettingId(mapMap.get(4).get(level));
                 }
 
-                File uploadFile = FileUtils.findByName(destDir, dto.getName());
+                File uploadFile = FileUtils.folderMethod1(destDir, dto.getName());
                 if (dto.getVideo() != null) {
 //                    File uploadFile = new File(destDir, dto.getVideo());
-                    uploadFile = FileUtils.findByName(destDir, dto.getVideo());
+                    uploadFile = FileUtils.folderMethod1(destDir, dto.getVideo());
                 }
                 if (ObjectUtil.isNotNull(uploadFile) && uploadFile.exists()) {
                     // 视频
@@ -329,16 +331,28 @@ public class ProgrammeService {
             }
 
             Participant participant = new Participant(dto);
-            LocalDate birthday = LocalDate.parse(dto.getParticipantBirthday(), DateTimeFormatter.ofPattern(DateConfig.DEFAULT_DATE_FORMAT));
-            participant.setBirthday(birthday);
+            if (ObjectUtil.isNotNull(dto.getParticipantBirthday())) {
+                if (dto.getParticipantBirthday().contains("/")) {
+                    LocalDate birthday = LocalDate.parse(dto.getParticipantBirthday(), DateTimeFormatter.ofPattern(DateConfig.DEFAULT_DATE_FORMAT1));
+                    participant.setBirthday(birthday);
+                } else if (dto.getParticipantBirthday().contains("-")) {
+                    LocalDate birthday = LocalDate.parse(dto.getParticipantBirthday(), DateTimeFormatter.ofPattern(DateConfig.DEFAULT_DATE_FORMAT));
+                    participant.setBirthday(birthday);
+                } else {
+                    throw new BusinessException("日期格式错误!");
+                }
+
+
+            }
+
             participant.setProgrammeId(pid);
             participants.add(participant);
             File uploadImg;
             if (dto.getImg() != null) {
 //                File uploadFile = new File(destDir, dto.getImg());
-                uploadImg = FileUtils.findByName(destDir, dto.getImg());
+                uploadImg = FileUtils.folderMethod1(destDir, dto.getImg());
             } else {
-                uploadImg = FileUtils.findByName(destDir, dto.getIdNo() + "证件照");
+                uploadImg = FileUtils.folderMethod1(destDir, dto.getIdNo() + "证件照");
             }
             if (ObjectUtil.isNotNull(uploadImg) && uploadImg.exists()) {
                 participant.setImg(this.saveImg(uploadImg));
@@ -346,9 +360,9 @@ public class ProgrammeService {
 
             File uploadCertificate;
             if (dto.getCertificate() != null) {
-                uploadCertificate = FileUtils.findByName(destDir, dto.getCertificate());
+                uploadCertificate = FileUtils.folderMethod1(destDir, dto.getCertificate());
             } else {
-                uploadCertificate = FileUtils.findByName(destDir, dto.getIdNo() + "证书");
+                uploadCertificate = FileUtils.folderMethod1(destDir, dto.getIdNo() + "证书");
             }
             if (ObjectUtil.isNotNull(uploadCertificate) && uploadCertificate.exists()) {
                 participant.setCertificate(this.saveImg(uploadCertificate));

+ 37 - 2
src/main/java/com/izouma/wenlvju/utils/FileUtils.java

@@ -1,6 +1,7 @@
 package com.izouma.wenlvju.utils;
 
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import org.apache.commons.lang3.StringUtils;
 
 import java.io.*;
@@ -218,11 +219,11 @@ public class FileUtils {
         return null;
     }
 
-    public static File findByName(File dir,String fileName) {
+    public static File findByName(File dir, String fileName) {
         if (!(dir.exists() && dir.isDirectory())) return null;
         for (File file : dir.listFiles()) {
             String name = file.getName().toLowerCase();
-            if (name.contains(fileName)){
+            if (name.contains(fileName)) {
                 return file;
             }
         }
@@ -240,4 +241,38 @@ public class FileUtils {
         return null;
     }
 
+    public static File folderMethod1(File file, String fileName) {
+        LinkedList<File> list = new LinkedList<>();
+
+        if (file.exists()) {
+            if (null == file.listFiles()) {
+                return null;
+            }
+            list.addAll(Arrays.asList(file.listFiles()));
+            while (!list.isEmpty()) {
+                File[] files = list.removeFirst().listFiles();
+                if (null == files) {
+                    continue;
+                }
+                for (File f : files) {
+                    if (f.isDirectory()) {
+                        list.add(f);
+                    } else {
+                        String name = f.getName().toLowerCase();
+                        if (StrUtil.isNotEmpty(fileName)) {
+                            if (name.contains(fileName)) {
+                                return f;
+                            }
+                        } else {
+                            if ((name.endsWith(".xlsx") || name.endsWith(".xls")) && !name.startsWith(".") && !file.isHidden()) {
+                                return f;
+                            }
+                        }
+
+                    }
+                }
+            }
+        }
+        return null;
+    }
 }

+ 12 - 3
src/main/java/com/izouma/wenlvju/web/RateController.java

@@ -38,6 +38,7 @@ public class RateController extends BaseController {
     private final OrganizationRepo        organizationRepo;
     private final UserRepo                userRepo;
     private final GradingOrganizationRepo gradingOrganizationRepo;
+    private final RateExpertAuditRepo     rateExpertAuditRepo;
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
@@ -53,7 +54,7 @@ public class RateController extends BaseController {
         return rateService.all(pageQuery);
     }
 
-    @PreAuthorize("hasAnyRole('ADMIN','DISTRICT','DISTRICT_STAFF','EXPERT')")
+    //    @PreAuthorize("hasAnyRole('ADMIN','DISTRICT','DISTRICT_STAFF','EXPERT')")
     @PostMapping("/all2")
     public Page<RateDTO> all2(@RequestBody PageQuery pageQuery) {
 //        pageQuery.setSort("createdAt,desc");
@@ -64,13 +65,21 @@ public class RateController extends BaseController {
                 .stream()
                 .collect(Collectors.toMap(GradingOrganization::getId, GradingOrganization::getName));
 
-        return rateService.all(pageQuery).map(rate -> {
+        Page<Rate> all = rateService.all(pageQuery);
+        List<Long> ids = all.map(Rate::getId).stream().collect(Collectors.toList());
+        Map<Long, Integer> scoreMap = rateExpertAuditRepo.findAllByRateIdIn(ids)
+                .stream()
+                .collect(Collectors.groupingBy(RateExpertAudit::getRateId, Collectors.summingInt(RateExpertAudit::getScore)));
+
+        return all.map(rate -> {
             Organization organization = organizationMap.get(rate.getOrganizationId());
             String names = organization.getGradingOrganizationId()
                     .stream()
                     .map(gradeMap::get)
                     .collect(Collectors.joining(","));
-            return new RateDTO(rate, organization, names);
+            RateDTO dto = new RateDTO(rate, organization, names);
+            dto.setExpertScore(scoreMap.get(rate.getId()) != null ? scoreMap.get(rate.getId()) : 0);
+            return dto;
         });
     }
 

+ 3 - 0
src/main/resources/application.yaml

@@ -15,6 +15,9 @@ spring:
         active: dev
     datasource:
         url: jdbc:mysql://mysql.izouma.com/exam_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8
+#        url: jdbc:mysql://localhost:3306/exam_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8
+#        username: root
+#        password: 123456
         username: microball
         password: 2wsx@WSX#EDC
         hikari:

+ 140 - 0
src/main/vue/src/components/SingleUpload2.vue

@@ -0,0 +1,140 @@
+<template>
+    <el-upload
+        class="single-upload"
+        :action="uploadUrl"
+        :headers="headers"
+        :show-file-list="false"
+        :on-success="onSuccess"
+        :before-upload="beforeUpload"
+    >
+        <div></div>
+        <div class="wrapper">
+            <img v-if="imageUrl" :src="imageUrl" class="upload-image" />
+            <i v-else class="el-icon-plus single-uploader-icon"></i>
+            <div v-if="loading" class="loading">
+                <i class="el-icon-loading"></i>
+            </div>
+        </div>
+        <div slot="tip" class="el-upload__tip">
+            <slot></slot>
+        </div>
+    </el-upload>
+</template>
+<script>
+import resolveUrl from 'resolve-url';
+export default {
+    created() {
+        this.uploadUrl = resolveUrl(this.$baseUrl, 'upload/file');
+        this.updateImageUrl(this.value);
+    },
+    props: {
+        value: String,
+        usePrefix: {
+            type: Boolean,
+            default: true
+        },
+        url: {
+            type: String
+        }
+    },
+    data() {
+        return {
+            imageUrl: '',
+            loading: false,
+            uploadUrl: ''
+        };
+    },
+    computed: {
+        headers() {
+            return {
+                Authorization: 'Bearer ' + sessionStorage.getItem('token')
+            };
+        }
+    },
+    methods: {
+        onSuccess(res, file) {
+            this.loading = false;
+            this.imageUrl = URL.createObjectURL(file.raw);
+            var newVal = '';
+            if (res instanceof Array) {
+                newVal = res[0];
+            } else {
+                newVal = res;
+            }
+            this.$emit('input', newVal);
+        },
+        onError(err, file, fileList) {
+            this.loading = false;
+        },
+        beforeUpload(file) {
+            this.loading = true;
+            return true;
+        },
+        updateImageUrl(url) {
+            this.imageUrl = url;
+        }
+    },
+    watch: {
+        value(val) {
+            this.updateImageUrl(val);
+        }
+    }
+};
+</script>
+<style lang="less" scoped>
+.single-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 60px;
+    height: 60px;
+    line-height: 56px;
+    text-align: center;
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    background-color: #fbfdff;
+
+    &:hover {
+        border-color: #409eff;
+    }
+}
+
+.upload-image {
+    height: 200px;
+    display: block;
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+
+    &:hover {
+        border-color: #409eff;
+    }
+}
+
+.wrapper {
+    position: relative;
+}
+
+.single-upload .el-upload {
+    position: relative;
+}
+
+.loading {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    margin: auto;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: rgba(255, 255, 255, 0.6);
+    color: #333;
+    font-size: 24px;
+}
+</style>

+ 2 - 0
src/main/vue/src/main.js

@@ -8,6 +8,7 @@ import dataExport from '@/plugins/dataExport';
 import SortableHeader from '@/components/SortableHeader';
 import MultiUpload from '@/components/MultiUpload';
 import SingleUpload from '@/components/SingleUpload';
+import SingleUpload2 from '@/components/SingleUpload2';
 import FileUpload from '@/components/FileUpload';
 import VideoUpload from '@/components/VideoUpload';
 import RichText from '@/components/RichText';
@@ -48,6 +49,7 @@ Vue.use(dataExport);
 Vue.component('sortable-header', SortableHeader);
 Vue.component('multi-upload', MultiUpload);
 Vue.component('single-upload', SingleUpload);
+Vue.component('single-upload2', SingleUpload2);
 Vue.component('file-upload', FileUpload);
 Vue.component('video-upload', VideoUpload);
 Vue.component('rich-text', RichText);

+ 1 - 1
src/main/vue/src/views/organization/OrganizationInfo.vue

@@ -88,7 +88,7 @@
                     ></el-input>
                 </el-form-item>
                 <el-form-item label="营业执照" prop="businessLicense" class="address">
-                    <single-upload v-model="formData.businessLicense"></single-upload>
+                    <single-upload2 v-model="formData.businessLicense"></single-upload2>
                 </el-form-item>
             </div>
             <!-- <el-form-item class="fixed-btn"> -->

+ 1 - 1
src/main/vue/src/views/performance/ProgrammeEdit.vue

@@ -218,7 +218,7 @@
                                     formData.specialtyId == 605
                             "
                         >
-                            <single-upload v-model="formData.annex"></single-upload>
+                            <single-upload2 v-model="formData.annex"></single-upload2>
                         </el-form-item>
                         <el-form-item prop="video" label="作品视频" v-else>
                             <video-upload v-model="formData.video" class="width"></video-upload>

+ 18 - 4
src/main/vue/src/views/performance/ProgrammeOrgList.vue

@@ -192,10 +192,17 @@
                 :formatter="programmeStatusFormatter"
             ></el-table-column>
             <!-- <el-table-column prop="examPoint" label="考级点" min-width="160"> </el-table-column> -->
-            <el-table-column label="操作" align="center" fixed="right" min-width="270">
+            <el-table-column label="操作" align="center" fixed="right" min-width="300">
                 <template slot-scope="{ row }">
-                    <el-button @click="showRow(row)" size="mini" plain v-if="row.status != 0">查看</el-button>
-                    <el-button type="success" @click="editRow(row)" size="mini" plain v-else>编辑</el-button>
+                    <el-button @click="showRow(row)" size="mini" plain>查看</el-button>
+                    <el-button
+                        type="success"
+                        @click="editRow(row)"
+                        size="mini"
+                        plain
+                        v-if="row.programmeStatus == 'INITIAL'"
+                        >编辑</el-button
+                    >
                     <el-button
                         type="warning"
                         @click="playImg(row)"
@@ -231,7 +238,14 @@
                         >浏览图片</el-button
                     >
                     <el-button type="warning" @click="playVideo(row)" v-else size="mini" plain>浏览视频</el-button>
-                    <el-button @click="showCode(row)" type="primary" size="mini" plain>查看二维码</el-button>
+                    <el-button
+                        @click="showCode(row)"
+                        type="primary"
+                        size="mini"
+                        plain
+                        v-if="row.programmeStatus != 'INITIAL'"
+                        >查看二维码</el-button
+                    >
                     <!-- <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button> -->
                 </template>
             </el-table-column>

+ 155 - 40
src/main/vue/src/views/rate/GradeList.vue

@@ -22,9 +22,20 @@
             <el-table-column prop="label" label="二级指标" min-width="35" align="center"> </el-table-column>
             <el-table-column prop="sub" label="评定项目和要求" min-width="120" show-overflow-tooltip> </el-table-column>
             <el-table-column prop="score" label="分值" min-width="20" align="center"> </el-table-column>
-            <el-table-column prop="score" label="参考分" min-width="20" align="center">
+            <el-table-column label="参考分" align="center" width="120">
                 <template slot-scope="{ row }">
-                    {{ getValue(row.value) }}
+                    <span v-if="!canEdit">{{ getValue(row.value) }}</span>
+                    <div v-else>
+                        <el-input-number
+                            style="width:100%"
+                            v-model="referenceForm[row.value]"
+                            size="mini"
+                            :min="0"
+                            :max="row.score"
+                            :step="1"
+                        >
+                        </el-input-number>
+                    </div>
                 </template>
             </el-table-column>
             <el-table-column prop="img" label="图片" min-width="90" width="90" align="center">
@@ -34,7 +45,7 @@
                             <el-image
                                 :key="index"
                                 style="width: 30px; height: 30px;"
-                                :src="item"
+                                :src="item + '?x-oss-process=image/resize,h_100,m_lfit'"
                                 fit="cover"
                                 :preview-src-list="getImg(row.value)"
                             ></el-image>
@@ -45,8 +56,7 @@
 
             <el-table-column label="最终评分" align="center" width="120">
                 <template slot-scope="{ row }">
-                    <span v-if="getExpertScore(row.value)">{{ getExpertScore(row.value) }}</span>
-                    <div v-else>
+                    <div v-if="final">
                         <el-input-number
                             style="width:100%"
                             v-model="form[row.value]"
@@ -57,23 +67,62 @@
                         >
                         </el-input-number>
                     </div>
+                    <span v-else-if="$route.query.status == 'SUBMIT_GRADE'">暂无</span>
+                    <span v-else-if="getExpertScore(row.value) > -1">{{ getExpertScore(row.value) }}</span>
                 </template>
             </el-table-column>
         </el-table>
-        <div style="margin: 15px 12px 0 0; font-size: 14px">
+        <div style="margin: 8px 12px 0 0; font-size: 14px">
             <el-card shadow="never">
                 {{ remark }}
             </el-card>
         </div>
         <div style="padding:20px 50px;display:flex" class="fixed-btn">
             <el-button @click="$router.go(-1)">返回</el-button>
-            <div style="flex-grow:1"></div>
-            <el-button type="danger" v-if="submitList.length !== 0" @click="saveDismiss" :loading="loading">
+            <el-button
+                type="danger"
+                v-if="submitList.length !== 0 && $route.query.status == 'SUBMIT_GRADE'"
+                @click="saveDismiss"
+                :loading="loading"
+            >
                 退回
             </el-button>
-            <el-button type="primary" v-if="submitList.length !== 0" @click="saveExpertScore" :loading="loading">
+            <div style="flex-grow:1"></div>
+
+            <el-button
+                type="success"
+                @click="canEdit = true"
+                v-if="!canEdit && !final && $route.query.status == 'SUBMIT_GRADE'"
+                :loading="loading"
+            >
+                修改参考分
+            </el-button>
+            <el-button type="success" @click="saveReferenceScore" v-if="canEdit && !final" :loading="loading">
+                保存参考分
+            </el-button>
+            <el-button @click="cancelScore" v-if="canEdit && !final" :loading="loading">
+                取消
+            </el-button>
+
+            <el-button
+                type="primary"
+                @click="final = true"
+                v-if="!final && !canEdit && $route.query.status == 'SUBMIT_GRADE'"
+                :loading="loading"
+            >
                 最终评分
             </el-button>
+            <el-button
+                type="primary"
+                v-if="submitList.length !== 0 && final"
+                @click="saveExpertScore"
+                :loading="loading"
+            >
+                保存最终评分
+            </el-button>
+            <el-button @click="final = false && !canEdit" v-if="final" :loading="loading">
+                取消
+            </el-button>
         </div>
     </div>
 </template>
@@ -91,11 +140,14 @@ export default {
             loading: false,
             downloading: false,
             spanArr: [],
-            tableHeight1: 730,
+            tableHeight1: 600,
             rateList: [],
             info: {},
             form: {},
-            remark: ''
+            remark: '',
+            canEdit: false,
+            final: false,
+            referenceForm: {}
         };
     },
     computed: {
@@ -111,16 +163,20 @@ export default {
             return !!info;
         },
         submitList() {
-            return [...this.rateList]
-                .filter(item => {
-                    return !item.expertScore;
-                })
-                .map(item => {
-                    return {
-                        ...item,
-                        expertScore: this.form[item.type]
-                    };
-                });
+            return [...this.rateList].map(item => {
+                return {
+                    ...item,
+                    expertScore: this.form[item.type]
+                };
+            });
+        },
+        referenceList() {
+            return [...this.rateList].map(item => {
+                return {
+                    ...item,
+                    score: this.referenceForm[item.type]
+                };
+            });
         }
     },
     mounted() {
@@ -129,20 +185,39 @@ export default {
     },
     methods: {
         saveExpertScore() {
+            console.log(this.submitList);
             this.loading = true;
-            this.$http
-                .post('/rateExpertAudit/batchSave', {
-                    audits: JSON.stringify(this.submitList)
-                })
-                .then(res => {
-                    return this.$http.post('/rateExpertAudit/grade', {
-                        rateId: this.$route.query.id
-                    });
+            this.$alert('提交后评分将不能修改,确认提交吗?', '警告', { type: 'error' })
+                .then(() => {
+                    this.$http
+                        .post('/rateExpertAudit/batchSave', {
+                            audits: JSON.stringify(this.submitList)
+                        })
+                        .then(res => {
+                            return this.$http.post('/rateExpertAudit/grade', {
+                                rateId: this.$route.query.id
+                            });
+                        })
+                        .then(res => {
+                            this.$message.success('评审完成');
+                            this.loading = false;
+                            this.getGride();
+                            this.final = false;
+                            this.$router
+                                .replace({
+                                    query: {
+                                        ...this.$route.query,
+                                        status: 'SUBMIT_PAPER_MATERIALS'
+                                    }
+                                })
+                                .catch(_ => {});
+                        });
                 })
-                .then(res => {
-                    this.$message.success('评审完成');
+                .catch(e => {
                     this.loading = false;
-                    this.getGride();
+                    if (e !== 'cancel') {
+                        console.log(e.error);
+                    }
                 });
         },
         getGride() {
@@ -160,7 +235,6 @@ export default {
                 .then(res => {
                     if (!res.empty) {
                         this.rateList = res.content;
-
                         let form = {};
                         // console.log(this.categories);
 
@@ -168,7 +242,7 @@ export default {
                             form[item.value] = this.getValue(item.value);
                         });
                         // console.log(form);
-
+                        this.referenceForm = form;
                         this.form = form;
                     }
                 });
@@ -324,18 +398,27 @@ export default {
                     }, 0);
                     return;
                 } else if (index === 4) {
-                    sums[index] = data.reduce((total, currentValue) => {
-                        return total + this.getValue(currentValue.value);
-                    }, 0);
+                    if (this.canEdit) {
+                        sums[index] = data.reduce((total, currentValue) => {
+                            return total + this.referenceForm[currentValue.value];
+                        }, 0);
+                    } else {
+                        sums[index] = data.reduce((total, currentValue) => {
+                            return total + this.getValue(currentValue.value);
+                        }, 0);
+                    }
                     return;
                 } else if (index === 6) {
-                    if (this.$route.status == '') {
+                    if (this.$route.query.status == 'SUBMIT_GRADE' && !this.final) {
+                        sums[index] = '暂无';
+                        return;
+                    } else if (this.final) {
                         sums[index] = data.reduce((total, currentValue) => {
-                            return total + this.getExpertScore(currentValue.value);
+                            return total + this.form[currentValue.value];
                         }, 0);
                     } else {
                         sums[index] = data.reduce((total, currentValue) => {
-                            return total + this.form[currentValue.value];
+                            return total + this.getExpertScore(currentValue.value);
                         }, 0);
                     }
 
@@ -395,6 +478,35 @@ export default {
                     console.log(e);
                     this.$message.error(e.error);
                 });
+        },
+        saveReferenceScore() {
+            this.loading = true;
+            this.$alert('提交后评分将覆盖专家的分数,确认提交吗?', '提示', { type: 'primary' })
+                .then(() => {
+                    this.$http
+                        .post('/rateExpertAudit/batchSave', {
+                            audits: JSON.stringify(this.referenceList)
+                        })
+                        .then(res => {
+                            this.$message.success('评审完成');
+                            this.loading = false;
+                            this.getGride();
+                            this.canEdit = false;
+                        });
+                })
+                .catch(e => {
+                    this.loading = false;
+                    if (e !== 'cancel') {
+                        console.log(e.error);
+                    }
+                });
+        },
+        cancelScore() {
+            this.canEdit = false;
+            [...this.categories].forEach(item => {
+                this.referenceForm[item.value] = this.getValue(item.value);
+            });
+            this.loading = false;
         }
     }
 };
@@ -417,4 +529,7 @@ export default {
         content: none;
     }
 }
+// /deep/ .el-table .cell {
+//     white-space: pre-line !important;
+// }
 </style>

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

@@ -23,7 +23,7 @@
                         clearable
                         class="filter-item"
                         style="width: 220px"
-                        @keyup.enter.native="getData"
+                        @change="getData"
                     ></el-input>
                 </el-col>
                 <el-col :span="10">
@@ -137,14 +137,23 @@
         >
             <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="name" label="承办单位" min-width="120"> </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="gradingOrganization" label="考级机构" min-width="120"> </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="expertScore" label="参考分">
+                <!-- <template slot="header" slot-scope="{ column }">
+                    <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
+                </template> -->
+                <template slot-scope="{ row }">
+                    <span v-if="row.expertScore">{{ row.expertScore }}</span>
+                    <span v-else>暂无</span>
+                </template>
+            </el-table-column>
             <el-table-column prop="score" label="分数">
                 <template slot-scope="{ row }">
                     <span v-if="row.score">{{ row.score }}</span>

+ 1 - 1
src/test/java/com/izouma/wenlvju/repo/UserRepoTest.java

@@ -74,7 +74,7 @@ public class UserRepoTest {
 
     @Test
     public void test3() {
-        System.out.println(jwtTokenUtil.generateToken(JwtUserFactory.create(userRepo.findById(281L)
+        System.out.println(jwtTokenUtil.generateToken(JwtUserFactory.create(userRepo.findById(15132L)
                 .orElseThrow(new BusinessException("用户不存在")))));
     }