Преглед изворни кода

考评模块、评级模块修改

songwb пре 9 месеци
родитељ
комит
7ac37d852a

+ 19 - 19
src/api/api.js

@@ -30,8 +30,8 @@ export function apiGetModel(url, params) {
 //获取菜单数据
 export function apiGetMenuData() {
     return httpRequest({
-        // url: 'menu/menuList?parentId=10105', // 测试
-        url: 'menu/menuList?parentId=6802', // 生产
+        url: 'menu/menuList?parentId=10105', // 测试
+        // url: 'menu/menuList?parentId=6802', // 生产
         method: 'post'
     })
 }
@@ -47,20 +47,20 @@ export function apiGetPrivilegesOfCurrentUserAll() {
 // 部门配置测试数据
 export function apievaluationdeptallocationgetDept() {
     return httpRequest({
-      url: `evaluation-dept-allocation/getDept`,
-      method: 'get'
+        url: `evaluation-dept-allocation/getDept`,
+        method: 'get'
     })
 }
 export function apievaluationdeptallocationgetDept2(params) {
     return httpRequest({
-      url: `evaluation-dept-allocation/getSubdepartment/${params}`,
-      method: 'get'
+        url: `evaluation-dept-allocation/getSubdepartment/${params}`,
+        method: 'get'
     })
 }
 export function apievaluationdeptallocationgetUser() {
     return httpRequest({
-      url: `evaluation-dept-allocation/getUser`,
-      method: 'get'
+        url: `evaluation-dept-allocation/getUser`,
+        method: 'get'
     })
 }
 
@@ -70,17 +70,17 @@ export function apievaluationdeptallocationgetUser() {
 export function apigetPublicKey() {
     // MD5 32 位
     return httpRequest({
-      url: `user/publicKey`,
-      method: 'get'
+        url: `user/publicKey`,
+        method: 'get'
     })
 }
 // 登录接口
-export function loginApi(username,password) {
+export function loginApi(username, password) {
     // MD5 32 位
     return httpRequest({
-    //   url: `user/bladeAuth?username=${username}&password=${md5(password)}`,
-      url: `user/bladeAuth?username=${username}&password=${password}`,
-      method: 'post'
+        //   url: `user/bladeAuth?username=${username}&password=${md5(password)}`,
+        url: `user/bladeAuth?username=${username}&password=${password}`,
+        method: 'post'
     })
 }
 // 根据token获取code
@@ -268,7 +268,7 @@ export function apiGetevaluationdeptnoticeSave(params) {
 export function apiGetuploadAttachment(params, datas) {
     return httpRequest({
         // url: `evaluation-dept-notice/save?id=${params.id?params.id: ''}&noticeTitle=${params.noticeTitle}&noticeContent=${params.noticeContent}&sendTo=${params.sendTo}&sendToContent=${params.sendToContent}&releaseState=${params.releaseState}&releaseDept=${params.releaseDept}&releaseDeptName=${params.releaseDeptName}&releasePeople=${params.releasePeople}&releasePeopleName=${params.releasePeopleName}&serialNumber=${params.serialNumber}`,
-        url: `evaluation-dept-notice/uploadAttachment?id=${params.id?params.id: ''}`,
+        url: `evaluation-dept-notice/uploadAttachment?id=${params.id ? params.id : ''}`,
         method: 'post',
         header: { 'Content-Type': 'multipart/form-data' },
         mimeType: 'multipart/form-data',
@@ -421,10 +421,10 @@ export function apiGetaddApprovalLeader(params) {
 }
 //查询审批领导--给出提示
 export function apiGetprocessInformation(params) {
-return httpRequest({
-    url: `evaluation-dept-ad/processInformation/${params.id}`,
-    method: 'get'
-})
+    return httpRequest({
+        url: `evaluation-dept-ad/processInformation/${params.id}`,
+        method: 'get'
+    })
 }
 
 //  获取人数

+ 170 - 142
src/components/assessment/evaluationMonthPage.vue

@@ -13,34 +13,22 @@
                 <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
             </div>
             <div class="PeriodBtn" :style="$utils.PeriodBtnSty()">
-                <btns
-                :showImport="false"
-                :showExport="false"
-                :showSave="false"
-                :showAdd="$utils.havePurview('evaluationMonth:oneLevel:add')"
-                :showDelete="$utils.havePurview('evaluationMonth:oneLevel:delete')"
-                :disDelete="changeDateSelect.length === 0"
-                :disImport="true"
-                :disExport="true"
-                @handleAdd="handleAdd"
-                @handleDelete="handleDelete"
-                @handleExport="handleExport"
-                ></btns>
+                <btns :showImport="false" :showExport="false" :showSave="false"
+                    :showAdd="$utils.havePurview('evaluationMonth:oneLevel:add')"
+                    :showDelete="$utils.havePurview('evaluationMonth:oneLevel:delete')"
+                    :disDelete="changeDateSelect.length === 0" :disImport="true" :disExport="true" @handleAdd="handleAdd"
+                    @handleDelete="handleDelete" @handleExport="handleExport"></btns>
             </div>
             <div class="evaluationMonthTableData">
-                <el-table :data="evaluationMonthData" style="width: 100%" :class="monthTableSty()"
-                 @select="rowClick" @select-all="rowClick" @row-dblclick="getDetail">
+                <el-table :data="evaluationMonthData" style="width: 100%" :class="monthTableSty()" @select="rowClick"
+                    @select-all="rowClick" @row-dblclick="getDetail">
                     <el-table-column type="selection" label="操作" align="center"></el-table-column>
                     <el-table-column label="业务编号" prop="organizationEvaluationCode" width="300" />
                     <el-table-column label="考评单位" width="330">
                         <template #default="scope">
-                            <el-tooltip
-                                class="tooltipName"
-                                effect="customized"
-                                :content="scope.row.createOrgName"
-                                placement="right"
-                            >
-                                <span class="tooltipCC">{{scope.row.createOrgName}}</span>
+                            <el-tooltip class="tooltipName" effect="customized" :content="scope.row.createOrgName"
+                                placement="right">
+                                <span class="tooltipCC">{{ scope.row.createOrgName }}</span>
                             </el-tooltip>
                         </template>
                     </el-table-column>
@@ -49,7 +37,7 @@
                     <el-table-column label="创建人" prop="createName" />
                     <el-table-column label="流程状态" prop="stage">
                         <template #default="scope">
-                            <p class="indicitem" @click="seeStates(scope.row)">{{scope.row.stage}}</p>
+                            <p class="indicitem" @click="seeStates(scope.row)">{{ scope.row.stage }}</p>
                         </template>
                     </el-table-column>
                     <!-- <el-table-column label="业务类别">
@@ -107,36 +95,26 @@
                         </template>
                     </el-table-column>
                 </el-table>
-                <el-pagination
-                    @size-change="handleSizeChange"
-                    @current-change="handleCurrentChange"
-                    :current-page="page.currentPage"
-                    :page-size="page.pagesize"
-                    layout="total, prev, pager, next, jumper"
+                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                    :current-page="page.currentPage" :page-size="page.pagesize" layout="total, prev, pager, next, jumper"
                     :total="page.total">
                 </el-pagination>
             </div>
             <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
                 <div class="periodFrom">
-                    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
+                    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"
+                        :validate-on-rule-change="false">
                         <el-form-item label="考评类别" prop="organizationType">
                             <el-select v-model="ruleForm.organizationType" placeholder="请选择考评类别" disabled>
-                                <el-option
-                                v-for="item in organizationType"
-                                :key="item.code"
-                                :label="item.label"
-                                :value="item.code">
+                                <el-option v-for="item in organizationType" :key="item.code" :label="item.label"
+                                    :value="item.code">
                                 </el-option>
                             </el-select>
-                        </el-form-item>                            
+                        </el-form-item>
                         <el-form-item label="考评周期" prop="evaluationCycle">
                             <el-select v-model="ruleForm.evaluationCycle" placeholder="请选择考评周期" disabled>
-                                <el-option
-                                v-for="item in periodData"
-                                :key="item.keyValue"
-                                :label="item.keyName"
-                                :value="item.keyValue"
-                                :disabled="item.keyValue === 'JDKP' || item.keyValue === 'NDKP'">
+                                <el-option v-for="item in periodData" :key="item.keyValue" :label="item.keyName"
+                                    :value="item.keyValue" :disabled="item.keyValue === 'JDKP' || item.keyValue === 'NDKP'">
                                 </el-option>
                             </el-select>
                         </el-form-item>
@@ -151,12 +129,7 @@
                             </el-select>
                         </el-form-item> -->
                         <el-form-item label="年份" prop="year">
-                            <el-date-picker
-                                v-model="ruleForm.year"
-                                type="year"
-                                value-format="YYYY"
-                                placeholder="请选择年份"
-                                />
+                            <el-date-picker v-model="ruleForm.year" type="year" value-format="YYYY" placeholder="请选择年份" />
                         </el-form-item>
                         <el-form-item label="月份">
                             <el-input-number v-model="ruleForm.month" :min="1" :max="12" />
@@ -175,8 +148,8 @@
             </el-dialog>
             <el-dialog title="流程详情" v-model="statesVisible" :fullscreen="true" :close-on-click-modal="false">
                 <div class="flowSty">
-                    <iframe id="iframeContain" width="100%" height="500px"
-                     frameborder="0" class="iframe" name="iframeContain" seamless scrolling="no" :src="iframeURL">            
+                    <iframe id="iframeContain" width="100%" height="500px" frameborder="0" class="iframe"
+                        name="iframeContain" seamless scrolling="no" :src="iframeURL">
                     </iframe>
                     <el-table :data="stageArr" style="width: 100%">
                         <el-table-column type="index" label="序号" align="center" />
@@ -185,7 +158,7 @@
                         <el-table-column label="任务处理时间" prop="approveTime" />
                         <el-table-column label="候选人" prop="assignInfo" width="300">
                             <template #default="scope">
-                                <span>{{changeAssignInfo(scope.row)}}</span>
+                                <span>{{ changeAssignInfo(scope.row) }}</span>
                             </template>
                         </el-table-column>
                         <el-table-column label="执行人" prop="approverName" />
@@ -212,8 +185,10 @@ import startFromList from './monthQuarterYearFrom.vue'
 import monthQuarterYearReport from './monthQuarterYearReport.vue'
 import btns from '../elbuttonS.vue'
 import seachs from '../seachGroup.vue'
-import {apiGetOrgEvaluationList, apiPostOrgEvaSave,apiPostOrgevaluationDelete,apiGetdoAction,apiGetgenerateEvaluateReport,
-apiGetgenerateUnitMonthEvaluation, apiGetdatadictionaryList, apiGetcalculatorcron, apiGetworkflowgetOpinion} from '../../api/api'
+import {
+    apiGetOrgEvaluationList, apiPostOrgEvaSave, apiPostOrgevaluationDelete, apiGetdoAction, apiGetgenerateEvaluateReport,
+    apiGetgenerateUnitMonthEvaluation, apiGetdatadictionaryList, apiGetcalculatorcron, apiGetworkflowgetOpinion
+} from '../../api/api'
 export default {
     components: {
         startFromList,
@@ -232,8 +207,8 @@ export default {
             windframradio: {},
             deleteSelect: [],
             changeDateSelect: [],
-            evaluationMonthData:[],
-            page:{
+            evaluationMonthData: [],
+            page: {
                 pagesize: 12,
                 currentPage: 1,
                 total: 0
@@ -287,7 +262,7 @@ export default {
         this.getevaluStartList()
         this.getPeriodData()
     },
-    methods:{
+    methods: {
         // 查询列表页面
         getevaluStartList() {
             let that = this
@@ -298,7 +273,7 @@ export default {
                 organizationEvaluationCode: that.rescode,
                 des: that.resDes
             }
-            apiGetOrgEvaluationList(params).then(datas =>{
+            apiGetOrgEvaluationList(params).then(datas => {
                 if (datas && datas.data) {
                     that.evaluationMonthData = datas.data.records
                     that.page.total = datas.data.total
@@ -311,7 +286,7 @@ export default {
             let params = {
                 superKey: 'KPZQ0001'
             }
-            apiGetdatadictionaryList(params).then(datas =>{
+            apiGetdatadictionaryList(params).then(datas => {
                 if (datas && datas.data) {
                     that.periodData = datas.data
                 }
@@ -344,7 +319,7 @@ export default {
             if (that.isSave) {
                 params.id = this.evalradio.id
             }
-            apiPostOrgEvaSave(params).then(datas =>{
+            apiPostOrgEvaSave(params).then(datas => {
                 if (!datas.success) {
                     that.$message({
                         message: datas.message,
@@ -377,7 +352,7 @@ export default {
                 opinion: "月度单位考评",
                 iamCode: window.localStorage.getItem('code')
             }
-            apiGetdoAction(par).then(datas =>{
+            apiGetdoAction(par).then(datas => {
                 if (datas && datas.data) {
                     if (datas.data.isOk) {
                         that.$message({
@@ -399,7 +374,7 @@ export default {
             let params = {
                 evaluationIds: row.id
             }
-            apiGetgenerateUnitMonthEvaluation(params).then(datas =>{
+            apiGetgenerateUnitMonthEvaluation(params).then(datas => {
                 if (datas && datas.data) {
                     if (!datas.success) {
                         that.$message({
@@ -414,12 +389,39 @@ export default {
                     }
                     that.getevaluStartList()
                 }
-            })
+            }).catch(({ message }) => {
+                if (message === "考评明细记录已存在") {
+                    this.$confirm("考评明细记录已存在,是否重新生成数据?", "操作提示", {
+                        confirmButtonText: "是",
+                        cancelButtonText: "否"
+                    }).then(() => {
+                        const load = this.$loading({
+                            lock: true,
+                            text: '生成中...请稍候',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(0, 0, 0, 0.7)'
+                        });
+                        params.mark = true;
+                        apiGetgenerateUnitMonthEvaluation(params).then(reEvaRes => {
+                            if (reEvaRes.code === 200) {
+                                that.$message({
+                                    message: '考评数据已重新生成',
+                                    type: 'success'
+                                });
+                                that.getevaluStartList()
+                                load.close();
+                            }
+                        }).catch(() => {
+                            load.close();
+                        });
+                    });
+                }
+            });
         },
         changeAssignInfo(row) {
             let showStr = ''
             if (row.assignInfo) {
-                showStr = row.assignInfo.substring(row.assignInfo.indexOf('-')+1, row.assignInfo.length).substring(0, row.assignInfo.substring(row.assignInfo.indexOf('-')+1, row.assignInfo.length).indexOf('-'))
+                showStr = row.assignInfo.substring(row.assignInfo.indexOf('-') + 1, row.assignInfo.length).substring(0, row.assignInfo.substring(row.assignInfo.indexOf('-') + 1, row.assignInfo.length).indexOf('-'))
             }
             return showStr
         },
@@ -437,7 +439,7 @@ export default {
                 } else {
                     url = 'http://10.65.78.23:8080'
                 }
-                this.iframeURL = url+'/agilebpm-ui/bpm/instance/instanceImageDialog.html?instanceId='+row.instId+'&iamCode='+window.localStorage.getItem('code')
+                this.iframeURL = url + '/agilebpm-ui/bpm/instance/instanceImageDialog.html?instanceId=' + row.instId + '&iamCode=' + window.localStorage.getItem('code')
                 this.getstageData(row.instId)
             }
         },
@@ -448,9 +450,9 @@ export default {
                 instId: id,
                 iamCode: window.localStorage.getItem('code')
             }
-            apiGetworkflowgetOpinion(params).then(datas =>{
+            apiGetworkflowgetOpinion(params).then(datas => {
                 if (datas && datas.data) {
-                    that.stageArr = datas.data.data                    
+                    that.stageArr = datas.data.data
                 }
             })
         },
@@ -465,7 +467,7 @@ export default {
             let params = {
                 id: row.id
             }
-            apiGetcalculatorcron(params).then(datas =>{
+            apiGetcalculatorcron(params).then(datas => {
                 if (datas) {
                     if (datas.success) {
                         that.$message({
@@ -479,8 +481,8 @@ export default {
                             type: 'error'
                         });
                     }
-                } 
-            }).catch(e =>{
+                }
+            }).catch(e => {
                 that.loading = false
                 that.$message({
                     message: '计算得分失败,请联系管理员',
@@ -496,7 +498,7 @@ export default {
             let params = {
                 organizationEvaluationId: row.id
             }
-            apiGetgenerateEvaluateReport(params).then(datas =>{
+            apiGetgenerateEvaluateReport(params).then(datas => {
                 if (datas) {
                     that.isReportshow = false
                     if (datas.success) {
@@ -511,8 +513,8 @@ export default {
                             type: 'error'
                         });
                     }
-                } 
-            }).catch(e =>{
+                }
+            }).catch(e => {
                 that.loading = false
                 that.$message({
                     message: '生成报表失败,请联系管理员',
@@ -530,12 +532,12 @@ export default {
             this.resDes = ''
             this.getevaluStartList()
         },
-        handleSizeChange(val){
+        handleSizeChange(val) {
             this.page.pagesize = val
             this.getevaluStartList()
         },
-        handleCurrentChange(val){
-            this.page.currentPage =val
+        handleCurrentChange(val) {
+            this.page.currentPage = val
             this.getevaluStartList()
         },
         rowClick(selection, row) {
@@ -546,7 +548,7 @@ export default {
             this.title = '新建表单填报'
             let year = new Date().getFullYear()
             let month = new Date().getMonth()
-            this.$nextTick(() =>{
+            this.$nextTick(() => {
                 this.$refs['ruleForm'].resetFields()
                 this.ruleForm = {
                     organizationType: 'DWKP',
@@ -567,10 +569,10 @@ export default {
             }).then(() => {
                 let that = this
                 let paramsArr = []
-                that.changeDateSelect.forEach(it =>{
+                that.changeDateSelect.forEach(it => {
                     paramsArr.push(it.id)
                 })
-                apiPostOrgevaluationDelete(paramsArr.join(',')).then(datas =>{
+                apiPostOrgevaluationDelete(paramsArr.join(',')).then(datas => {
                     that.$message({
                         type: 'success',
                         message: '删除成功!'
@@ -595,123 +597,149 @@ export default {
 </script>
 
 <style lang="less">
-.evaluationMonth{
-    .evaluationMonthBtn{
-        .collectSeach{
+.evaluationMonth {
+    .evaluationMonthBtn {
+        .collectSeach {
+            display: flex;
+            padding: 24px 20px;
+            border-bottom: 1px solid#D6DBEA;
+
+            .exceed {
                 display: flex;
-                padding: 24px 20px;
-                border-bottom: 1px solid#D6DBEA;
-                .exceed{
-                    display: flex;
-                    .exceedSpan{
-                        width: 100px;
-                        height: 12px;
-                        font-size: 14px;
-                        font-family: Microsoft YaHei;
-                        font-weight: 400;
-                        color: #8991B0;
-                        line-height: 12px;
-                        margin-top: 14px;
-                    }
-                    .el-input{
-                        margin-right:10px;
+
+                .exceedSpan {
+                    width: 100px;
+                    height: 12px;
+                    font-size: 14px;
+                    font-family: Microsoft YaHei;
+                    font-weight: 400;
+                    color: #8991B0;
+                    line-height: 12px;
+                    margin-top: 14px;
+                }
+
+                .el-input {
+                    margin-right: 10px;
+                    height: 40px;
+
+                    .el-input__inner {
                         height: 40px;
-                        .el-input__inner{
-                            height:40px;
-                        }
-                        .el-input__suffix{
-                            .el-select__caret{
-                                line-height:30px;
-                            }
+                    }
+
+                    .el-input__suffix {
+                        .el-select__caret {
+                            line-height: 30px;
                         }
                     }
                 }
-                .el-select{
-                    margin-right:10px;
-                    .el-input__inner{
-                        height:30px;
-                    }
-                    .el-input__suffix{
-                        .el-select__caret{
-                            line-height:30px;
-                        }
+            }
+
+            .el-select {
+                margin-right: 10px;
+
+                .el-input__inner {
+                    height: 30px;
+                }
+
+                .el-input__suffix {
+                    .el-select__caret {
+                        line-height: 30px;
                     }
                 }
+            }
         }
-        span{
-            font-size:14px;
+
+        span {
+            font-size: 14px;
         }
-        .PeriodBtn{
+
+        .PeriodBtn {
             display: flex;
-                justify-content: flex-end;
-                padding: 20px 0;
+            justify-content: flex-end;
+            padding: 20px 0;
         }
-        .el-button{
+
+        .el-button {
             height: 30px;
             // width:100px;
-            padding: 0 20px ;
+            padding: 0 20px;
+
             // padding-top: 8px;
-            span{
-                margin:0;
+            span {
+                margin: 0;
             }
         }
-        .evaluationMonthTableData{
-            .month125Table{
-                .el-table__body-wrapper{
+
+        .evaluationMonthTableData {
+            .month125Table {
+                .el-table__body-wrapper {
                     height: 53vh !important;
                 }
             }
-            .month100Table{
-                .el-table__body-wrapper{
+
+            .month100Table {
+                .el-table__body-wrapper {
                     height: 60vh !important;
                 }
             }
-            .el-table{
-                .el-input__inner{
+
+            .el-table {
+                .el-input__inner {
                     height: 30px !important;
                 }
-                .el-radio__label{
+
+                .el-radio__label {
                     display: none;
                 }
-                .tooltipCC{
+
+                .tooltipCC {
                     width: 300px;
                     display: inline-block;
                     overflow: hidden;
                     text-overflow: ellipsis;
                     white-space: nowrap;
                 }
-                .tooltipCCDes{
+
+                .tooltipCCDes {
                     width: 200px;
                     display: inline-block;
                     overflow: hidden;
                     text-overflow: ellipsis;
                     white-space: nowrap;
                 }
-                .indicitem{
+
+                .indicitem {
                     color: #409EFF;
                     font-size: 12px;
                     margin-right: 20px;
-                    cursor:pointer;
-                    &:hover{
+                    cursor: pointer;
+
+                    &:hover {
                         text-decoration: underline;
                     }
                 }
             }
-            .el-pagination{
+
+            .el-pagination {
                 margin-top: 20px;
                 text-align: end;
                 position: relative;
             }
         }
-        .el-overlay{
-            .el-dialog{
-                .el-dialog__body{
+
+        .el-overlay {
+            .el-dialog {
+                .el-dialog__body {
                     padding: 30px 60px 30px 20px !important;
-                    .periodFrom{
-                        .el-select, .el-input{
+
+                    .periodFrom {
+
+                        .el-select,
+                        .el-input {
                             width: 100%;
                         }
-                        .el-input{
+
+                        .el-input {
                             height: 30px;
                         }
                     }

+ 174 - 145
src/components/assessment/evaluationQuarterPage.vue

@@ -14,33 +14,22 @@
             </div>
             <div class="PeriodBtn" :style="$utils.PeriodBtnSty()">
                 <!-- $utils.havePurview('evaluationQuarter:oneLevel:add') -->
-                <btns
-                :showImport="false"
-                :showExport="false"
-                :showSave="false"
-                :showAdd="$utils.havePurview('evaluationQuarter:oneLevel:add')"
-                :showDelete="$utils.havePurview('evaluationQuarter:oneLevel:delete')"
-                :disDelete="changeDateSelect.length === 0"
-                :disImport="true"
-                :disExport="true"
-                @handleAdd="handleAdd"
-                @handleDelete="handleDelete"
-                ></btns>
+                <btns :showImport="false" :showExport="false" :showSave="false"
+                    :showAdd="$utils.havePurview('evaluationQuarter:oneLevel:add')"
+                    :showDelete="$utils.havePurview('evaluationQuarter:oneLevel:delete')"
+                    :disDelete="changeDateSelect.length === 0" :disImport="true" :disExport="true" @handleAdd="handleAdd"
+                    @handleDelete="handleDelete"></btns>
             </div>
             <div class="evaluationQuarterTableData">
-                <el-table :data="evaluationQuarterData" style="width: 100%" :class="quarterTableSty()"
-                 @select="rowClick" @select-all="rowClick" @row-dblclick="getDetail">
+                <el-table :data="evaluationQuarterData" style="width: 100%" :class="quarterTableSty()" @select="rowClick"
+                    @select-all="rowClick" @row-dblclick="getDetail">
                     <el-table-column type="selection" label="操作" align="center"></el-table-column>
                     <el-table-column label="业务编号" prop="organizationEvaluationCode" width="300" />
                     <el-table-column label="考评单位" width="330">
                         <template #default="scope">
-                            <el-tooltip
-                                class="tooltipName"
-                                effect="customized"
-                                :content="scope.row.createOrgName"
-                                placement="right"
-                            >
-                                <span class="tooltipCC">{{scope.row.createOrgName}}</span>
+                            <el-tooltip class="tooltipName" effect="customized" :content="scope.row.createOrgName"
+                                placement="right">
+                                <span class="tooltipCC">{{ scope.row.createOrgName }}</span>
                             </el-tooltip>
                         </template>
                     </el-table-column>
@@ -49,7 +38,7 @@
                     <el-table-column label="创建人" prop="createName" />
                     <el-table-column label="流程状态" prop="stage">
                         <template #default="scope">
-                            <p class="indicitem" @click="seeStates(scope.row)">{{scope.row.stage}}</p>
+                            <p class="indicitem" @click="seeStates(scope.row)">{{ scope.row.stage }}</p>
                         </template>
                     </el-table-column>
                     <!-- <el-table-column label="业务类别">
@@ -107,36 +96,26 @@
                         </template>
                     </el-table-column>
                 </el-table>
-                <el-pagination
-                    @size-change="handleSizeChange"
-                    @current-change="handleCurrentChange"
-                    :current-page="page.currentPage"
-                    :page-size="page.pagesize"
-                    layout="total, prev, pager, next, jumper"
+                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                    :current-page="page.currentPage" :page-size="page.pagesize" layout="total, prev, pager, next, jumper"
                     :total="page.total">
                 </el-pagination>
             </div>
             <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
                 <div class="periodFrom">
-                    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
+                    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"
+                        :validate-on-rule-change="false">
                         <el-form-item label="考评类别" prop="organizationType">
                             <el-select v-model="ruleForm.organizationType" placeholder="请选择考评类别" disabled>
-                                <el-option
-                                v-for="item in organizationType"
-                                :key="item.code"
-                                :label="item.label"
-                                :value="item.code">
+                                <el-option v-for="item in organizationType" :key="item.code" :label="item.label"
+                                    :value="item.code">
                                 </el-option>
                             </el-select>
-                        </el-form-item>                            
+                        </el-form-item>
                         <el-form-item label="考评周期" prop="evaluationCycle">
                             <el-select v-model="ruleForm.evaluationCycle" placeholder="请选择考评周期" disabled>
-                                <el-option
-                                v-for="item in periodData"
-                                :key="item.keyValue"
-                                :label="item.keyName"
-                                :value="item.keyValue"
-                                :disabled="item.keyValue === 'YDKP' || item.keyValue === 'NDKP'">
+                                <el-option v-for="item in periodData" :key="item.keyValue" :label="item.keyName"
+                                    :value="item.keyValue" :disabled="item.keyValue === 'YDKP' || item.keyValue === 'NDKP'">
                                 </el-option>
                             </el-select>
                         </el-form-item>
@@ -151,12 +130,7 @@
                             </el-select>
                         </el-form-item> -->
                         <el-form-item label="年份" prop="year">
-                            <el-date-picker
-                                v-model="ruleForm.year"
-                                type="year"
-                                value-format="YYYY"
-                                placeholder="请选择年份"
-                                />
+                            <el-date-picker v-model="ruleForm.year" type="year" value-format="YYYY" placeholder="请选择年份" />
                         </el-form-item>
                         <el-form-item label="季度">
                             <el-input-number v-model="ruleForm.month" :min="1" :max="4" />
@@ -175,8 +149,8 @@
             </el-dialog>
             <el-dialog title="流程详情" v-model="statesVisible" :fullscreen="true" :close-on-click-modal="false">
                 <div class="flowSty">
-                    <iframe id="iframeContain" width="100%" height="500px"
-                     frameborder="0" class="iframe" name="iframeContain" seamless scrolling="no" :src="iframeURL">            
+                    <iframe id="iframeContain" width="100%" height="500px" frameborder="0" class="iframe"
+                        name="iframeContain" seamless scrolling="no" :src="iframeURL">
                     </iframe>
                     <el-table :data="stageArr" style="width: 100%">
                         <el-table-column type="index" label="序号" align="center" />
@@ -185,7 +159,7 @@
                         <el-table-column label="任务处理时间" prop="approveTime" />
                         <el-table-column label="候选人" prop="assignInfo" width="300">
                             <template #default="scope">
-                                <span>{{changeAssignInfo(scope.row)}}</span>
+                                <span>{{ changeAssignInfo(scope.row) }}</span>
                             </template>
                         </el-table-column>
                         <el-table-column label="执行人" prop="approverName" />
@@ -212,8 +186,10 @@ import startFromList from './monthQuarterYearFrom.vue'
 import monthQuarterYearReport from './monthQuarterYearReport.vue'
 import btns from '../elbuttonS.vue'
 import seachs from '../seachGroup.vue'
-import {apiGetOrgEvaluationList, apiPostOrgEvaSave,apiPostOrgevaluationDelete,apiGetdoAction,apiGetgenerateEvaluateReport,
-apiGetgenerateUnitMonthEvaluation, apiGetdatadictionaryList, apiGetcalculatorcron, apiGetworkflowgetOpinion} from '../../api/api'
+import {
+    apiGetOrgEvaluationList, apiPostOrgEvaSave, apiPostOrgevaluationDelete, apiGetdoAction, apiGetgenerateEvaluateReport,
+    apiGetgenerateUnitMonthEvaluation, apiGetdatadictionaryList, apiGetcalculatorcron, apiGetworkflowgetOpinion
+} from '../../api/api'
 export default {
     components: {
         startFromList,
@@ -232,8 +208,8 @@ export default {
             windframradio: {},
             deleteSelect: [],
             changeDateSelect: [],
-            evaluationQuarterData:[],
-            page:{
+            evaluationQuarterData: [],
+            page: {
                 pagesize: 12,
                 currentPage: 1,
                 total: 0
@@ -287,7 +263,7 @@ export default {
         this.getevaluStartList()
         this.getPeriodData()
     },
-    methods:{
+    methods: {
         // 查询列表页面
         getevaluStartList() {
             let that = this
@@ -298,7 +274,7 @@ export default {
                 organizationEvaluationCode: that.rescode,
                 des: that.resDes
             }
-            apiGetOrgEvaluationList(params).then(datas =>{
+            apiGetOrgEvaluationList(params).then(datas => {
                 if (datas && datas.data) {
                     that.evaluationQuarterData = datas.data.records
                     that.page.total = datas.data.total
@@ -311,7 +287,7 @@ export default {
             let params = {
                 superKey: 'KPZQ0001'
             }
-            apiGetdatadictionaryList(params).then(datas =>{
+            apiGetdatadictionaryList(params).then(datas => {
                 if (datas && datas.data) {
                     that.periodData = datas.data
                 }
@@ -345,7 +321,7 @@ export default {
             if (that.isSave) {
                 params.id = this.evalradio.id
             }
-            apiPostOrgEvaSave(params).then(datas =>{
+            apiPostOrgEvaSave(params).then(datas => {
                 if (!datas.success) {
                     that.$message({
                         message: datas.message,
@@ -374,7 +350,7 @@ export default {
             let params = {
                 evaluationIds: row.id
             }
-            apiGetgenerateUnitYearEvaluation(params).then(datas =>{
+            apiGetgenerateUnitYearEvaluation(params).then(datas => {
                 if (datas && datas.data) {
                     if (!datas.success) {
                         that.$message({
@@ -400,7 +376,7 @@ export default {
                 opinion: "季度单位考评",
                 iamCode: window.localStorage.getItem('code')
             }
-            apiGetdoAction(par).then(datas =>{
+            apiGetdoAction(par).then(datas => {
                 if (datas && datas.data) {
                     if (datas.data.isOk) {
                         that.$message({
@@ -422,7 +398,7 @@ export default {
             let params = {
                 evaluationIds: row.id
             }
-            apiGetgenerateUnitMonthEvaluation(params).then(datas =>{
+            apiGetgenerateUnitMonthEvaluation(params).then(datas => {
                 if (datas && datas.data) {
                     if (!datas.success) {
                         that.$message({
@@ -437,12 +413,39 @@ export default {
                     }
                     that.getevaluStartList()
                 }
-            })
+            }).catch(({ message }) => {
+                if (message === "考评明细记录已存在") {
+                    this.$confirm("考评明细记录已存在,是否重新生成数据?", "操作提示", {
+                        confirmButtonText: "是",
+                        cancelButtonText: "否"
+                    }).then(() => {
+                        const load = this.$loading({
+                            lock: true,
+                            text: '生成中...请稍候',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(0, 0, 0, 0.7)'
+                        });
+                        params.mark = true;
+                        apiGetgenerateUnitMonthEvaluation(params).then(reEvaRes => {
+                            if (reEvaRes.code === 200) {
+                                that.$message({
+                                    message: '考评数据已重新生成',
+                                    type: 'success'
+                                });
+                                that.getevaluStartList()
+                                load.close();
+                            }
+                        }).catch(() => {
+                            load.close();
+                        });
+                    });
+                }
+            });
         },
         changeAssignInfo(row) {
             let showStr = ''
             if (row.assignInfo) {
-                showStr = row.assignInfo.substring(row.assignInfo.indexOf('-')+1, row.assignInfo.length).substring(0, row.assignInfo.substring(row.assignInfo.indexOf('-')+1, row.assignInfo.length).indexOf('-'))
+                showStr = row.assignInfo.substring(row.assignInfo.indexOf('-') + 1, row.assignInfo.length).substring(0, row.assignInfo.substring(row.assignInfo.indexOf('-') + 1, row.assignInfo.length).indexOf('-'))
             }
             return showStr
         },
@@ -460,7 +463,7 @@ export default {
                 } else {
                     url = 'http://10.65.78.23:8080'
                 }
-                this.iframeURL = url+'/agilebpm-ui/bpm/instance/instanceImageDialog.html?instanceId='+row.instId+'&iamCode='+window.localStorage.getItem('code')
+                this.iframeURL = url + '/agilebpm-ui/bpm/instance/instanceImageDialog.html?instanceId=' + row.instId + '&iamCode=' + window.localStorage.getItem('code')
                 this.getstageData(row.instId)
             }
         },
@@ -471,9 +474,9 @@ export default {
                 instId: id,
                 iamCode: window.localStorage.getItem('code')
             }
-            apiGetworkflowgetOpinion(params).then(datas =>{
+            apiGetworkflowgetOpinion(params).then(datas => {
                 if (datas && datas.data) {
-                    that.stageArr = datas.data.data                    
+                    that.stageArr = datas.data.data
                 }
             })
         },
@@ -488,7 +491,7 @@ export default {
             let params = {
                 id: row.id
             }
-            apiGetcalculatorcron(params).then(datas =>{
+            apiGetcalculatorcron(params).then(datas => {
                 if (datas) {
                     if (datas.success) {
                         that.$message({
@@ -502,8 +505,8 @@ export default {
                             type: 'error'
                         });
                     }
-                } 
-            }).catch(e =>{
+                }
+            }).catch(e => {
                 that.loading = false
                 that.$message({
                     message: '计算得分失败,请联系管理员',
@@ -519,7 +522,7 @@ export default {
             let params = {
                 organizationEvaluationId: row.id
             }
-            apiGetgenerateEvaluateReport(params).then(datas =>{
+            apiGetgenerateEvaluateReport(params).then(datas => {
                 if (datas) {
                     that.isReportshow = false
                     if (datas.success) {
@@ -535,7 +538,7 @@ export default {
                         });
                     }
                 }
-            }).catch(e =>{
+            }).catch(e => {
                 that.loading = false
                 that.$message({
                     message: '生成报表失败,请联系管理员',
@@ -553,12 +556,12 @@ export default {
             this.resDes = ''
             this.getevaluStartList()
         },
-        handleSizeChange(val){
+        handleSizeChange(val) {
             this.page.pagesize = val
             this.getevaluStartList()
         },
-        handleCurrentChange(val){
-            this.page.currentPage =val
+        handleCurrentChange(val) {
+            this.page.currentPage = val
             this.getevaluStartList()
         },
         rowClick(selection, row) {
@@ -572,14 +575,14 @@ export default {
             let quaet = 1
             if (month < 4) {
                 quaet = 1
-            } else if(month>3 && month<7) {
+            } else if (month > 3 && month < 7) {
                 quaet = 2
-            } else if(month>6 && month<10) {
+            } else if (month > 6 && month < 10) {
                 quaet = 3
-            } else if(month>9 && month<13) {
+            } else if (month > 9 && month < 13) {
                 quaet = 4
             }
-            this.$nextTick(() =>{
+            this.$nextTick(() => {
                 this.$refs['ruleForm'].resetFields()
                 this.ruleForm = {
                     organizationType: 'DWKP',
@@ -600,10 +603,10 @@ export default {
             }).then(() => {
                 let that = this
                 let paramsArr = []
-                that.changeDateSelect.forEach(it =>{
+                that.changeDateSelect.forEach(it => {
                     paramsArr.push(it.id)
                 })
-                apiPostOrgevaluationDelete(paramsArr.join(',')).then(datas =>{
+                apiPostOrgevaluationDelete(paramsArr.join(',')).then(datas => {
                     that.$message({
                         type: 'success',
                         message: '删除成功!'
@@ -612,7 +615,7 @@ export default {
                     that.changeDateSelect = []
                 })
             })
-        }, 
+        },
         handleReport(row) {
             this.$refs.reportDia.init(row)
         },
@@ -628,123 +631,149 @@ export default {
 </script>
 
 <style lang="less">
-.evaluationQuarter{
-    .evaluationQuarterBtn{
-        .collectSeach{
+.evaluationQuarter {
+    .evaluationQuarterBtn {
+        .collectSeach {
+            display: flex;
+            padding: 24px 20px;
+            border-bottom: 1px solid#D6DBEA;
+
+            .exceed {
                 display: flex;
-                padding: 24px 20px;
-                border-bottom: 1px solid#D6DBEA;
-                .exceed{
-                    display: flex;
-                    .exceedSpan{
-                        width: 100px;
-                        height: 12px;
-                        font-size: 14px;
-                        font-family: Microsoft YaHei;
-                        font-weight: 400;
-                        color: #8991B0;
-                        line-height: 12px;
-                        margin-top: 14px;
-                    }
-                    .el-input{
-                        margin-right:10px;
+
+                .exceedSpan {
+                    width: 100px;
+                    height: 12px;
+                    font-size: 14px;
+                    font-family: Microsoft YaHei;
+                    font-weight: 400;
+                    color: #8991B0;
+                    line-height: 12px;
+                    margin-top: 14px;
+                }
+
+                .el-input {
+                    margin-right: 10px;
+                    height: 40px;
+
+                    .el-input__inner {
                         height: 40px;
-                        .el-input__inner{
-                            height:40px;
-                        }
-                        .el-input__suffix{
-                            .el-select__caret{
-                                line-height:30px;
-                            }
+                    }
+
+                    .el-input__suffix {
+                        .el-select__caret {
+                            line-height: 30px;
                         }
                     }
                 }
-                .el-select{
-                    margin-right:10px;
-                    .el-input__inner{
-                        height:30px;
-                    }
-                    .el-input__suffix{
-                        .el-select__caret{
-                            line-height:30px;
-                        }
+            }
+
+            .el-select {
+                margin-right: 10px;
+
+                .el-input__inner {
+                    height: 30px;
+                }
+
+                .el-input__suffix {
+                    .el-select__caret {
+                        line-height: 30px;
                     }
                 }
+            }
         }
-        span{
-            font-size:14px;
+
+        span {
+            font-size: 14px;
         }
-        .PeriodBtn{
+
+        .PeriodBtn {
             display: flex;
-                justify-content: flex-end;
-                padding: 20px 0;
+            justify-content: flex-end;
+            padding: 20px 0;
         }
-        .el-button{
+
+        .el-button {
             height: 30px;
             // width:100px;
-            padding: 0 20px ;
+            padding: 0 20px;
+
             // padding-top: 8px;
-            span{
-                margin:0;
+            span {
+                margin: 0;
             }
         }
-        .evaluationQuarterTableData{
-            .quarter125Table{
-                .el-table__body-wrapper{
+
+        .evaluationQuarterTableData {
+            .quarter125Table {
+                .el-table__body-wrapper {
                     height: 53vh !important;
                 }
             }
-            .quarter100Table{
-                .el-table__body-wrapper{
+
+            .quarter100Table {
+                .el-table__body-wrapper {
                     height: 60vh !important;
                 }
             }
-            .el-table{
-                .el-input__inner{
+
+            .el-table {
+                .el-input__inner {
                     height: 30px !important;
                 }
-                .el-radio__label{
+
+                .el-radio__label {
                     display: none;
                 }
-                .tooltipCC{
+
+                .tooltipCC {
                     width: 300px;
                     display: inline-block;
                     overflow: hidden;
                     text-overflow: ellipsis;
                     white-space: nowrap;
                 }
-                .tooltipCCDes{
+
+                .tooltipCCDes {
                     width: 200px;
                     display: inline-block;
                     overflow: hidden;
                     text-overflow: ellipsis;
                     white-space: nowrap;
                 }
-                .indicitem{
+
+                .indicitem {
                     color: #409EFF;
                     font-size: 12px;
                     margin-right: 20px;
-                    cursor:pointer;
-                    &:hover{
+                    cursor: pointer;
+
+                    &:hover {
                         text-decoration: underline;
                     }
                 }
             }
-            .el-pagination{
+
+            .el-pagination {
                 margin-top: 20px;
                 text-align: end;
                 position: relative;
             }
         }
-        .el-overlay{
-            .el-dialog{
-                .el-dialog__body{
+
+        .el-overlay {
+            .el-dialog {
+                .el-dialog__body {
                     padding: 30px 60px 30px 20px !important;
-                    .periodFrom{
-                        .el-select, .el-input{
+
+                    .periodFrom {
+
+                        .el-select,
+                        .el-input {
                             width: 100%;
                         }
-                        .el-input{
+
+                        .el-input {
                             height: 30px;
                         }
                     }

Разлика између датотеке није приказан због своје велике величине
+ 526 - 522
src/components/assessment/evaluationUnitRatingDialog.vue


+ 374 - 374
src/components/assessment/evaluationUnitRatingPage.vue

@@ -22,9 +22,9 @@
                     :showSave="$utils.havePurview('evaluationUnitRate:oneLevel:save')"
                     :showAdd="$utils.havePurview('evaluationUnitRate:oneLevel:add')"
                     :showDelete="$utils.havePurview('evaluationUnitRate:oneLevel:delete')"
-                    :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
-                    :disDelete="changeDateSelect.length === 0" :disImport="false" :disExport="false"
-                    @handleAdd="handleAdd" @handleEdit="handleEdit" @handleDelete="handleDelete"></btns>
+                    :disSave="changeDateSelect.length === 0 || changeDateSelect.length > 1"
+                    :disDelete="changeDateSelect.length === 0" :disImport="false" :disExport="false" @handleAdd="handleAdd"
+                    @handleEdit="handleEdit" @handleDelete="handleDelete"></btns>
             </div>
             <div class="evaluationUnitRatingTableData">
                 <!-- @row-click="rowClickToggle" -->
@@ -37,7 +37,7 @@
                     <el-table-column label="年份" prop="year" />
                     <el-table-column label="状态" prop="stage" width="200">
                         <template #default="scope">
-                            <p class="indicitem" @click="seeStates(scope.row)">{{scope.row.stage}}</p>
+                            <p class="indicitem" @click="seeStates(scope.row)">{{ scope.row.stage }}</p>
                         </template>
                     </el-table-column>
                     <el-table-column label="创建人" prop="createName" />
@@ -55,8 +55,8 @@
                     </el-table-column>
                 </el-table>
                 <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                    :current-page="page.currentPage" :page-size="page.pagesize"
-                    layout="total, prev, pager, next, jumper" :total="page.total">
+                    :current-page="page.currentPage" :page-size="page.pagesize" layout="total, prev, pager, next, jumper"
+                    :total="page.total">
                 </el-pagination>
             </div>
             <el-dialog :title="title" custom-class="startToDia" v-model="dialogVisible" width="600px"
@@ -92,7 +92,7 @@
                         <el-table-column label="任务处理时间" prop="approveTime" />
                         <el-table-column label="候选人" prop="assignInfo" width="300">
                             <template #default="scope">
-                                <span>{{changeAssignInfo(scope.row)}}</span>
+                                <span>{{ changeAssignInfo(scope.row) }}</span>
                             </template>
                         </el-table-column>
                         <el-table-column label="执行人" prop="approverName" />
@@ -114,334 +114,319 @@
 </template>
 
 <script>
-    import ratingDialog from './evaluationUnitRatingDialog.vue'
-    import btns from '../elbuttonS.vue'
-    import seachs from '../seachGroup.vue'
-    import {
-        apiGetorganizationyearratinglist,
-        apiGetOrgEvaluationList,
-        apiGetorganizationyearratingsave,
-        apiGetworkflowgetOpinion,
-        apiGetdoAction,
-        apiPostorganizationyearratingDelete
-    } from '../../api/api'
-    export default {
-        components: {
-            ratingDialog,
-            btns,
-            seachs
+import ratingDialog from './evaluationUnitRatingDialog.vue'
+import btns from '../elbuttonS.vue'
+import seachs from '../seachGroup.vue'
+import {
+    apiGetorganizationyearratinglist,
+    apiGetOrgEvaluationList,
+    apiGetorganizationyearratingsave,
+    apiGetworkflowgetOpinion,
+    apiGetdoAction,
+    apiPostorganizationyearratingDelete
+} from '../../api/api'
+export default {
+    components: {
+        ratingDialog,
+        btns,
+        seachs
+    },
+    data() {
+        return {
+            dialogVisible: false,
+            statesVisible: false,
+            isSave: false,
+            title: '',
+            iframeURL: '',
+            evalradio: {},
+            changeDateSelect: [],
+            evaluationUnitRatingData: [],
+            stageArr: [],
+            ruleForm: {
+                year: '',
+                des: ''
+            },
+            rules: {
+                year: [{
+                    required: true,
+                    message: '请选择年份',
+                    trigger: 'change'
+                }],
+                des: [{
+                    required: true,
+                    message: '请输入描述',
+                    trigger: 'blur'
+                }]
+            },
+            page: {
+                pagesize: 12,
+                currentPage: 1,
+                total: 0
+            },
+            ratingCode: '',
+            ratingDes: '',
+            businessStr: '',
+            resAnnual: '',
+            monthArr: [],
+            ratingArr: [],
+            winPix: window.devicePixelRatio,
+            innerWidth: window.innerWidth
+        }
+    },
+    created() {
+        this.ratingArr = [{
+            label: 'A级',
+            value: 'A'
         },
-        data() {
-            return {
-                dialogVisible: false,
-                statesVisible: false,
-                isSave: false,
-                title: '',
-                iframeURL: '',
-                evalradio: {},
-                changeDateSelect: [],
-                evaluationUnitRatingData: [],
-                stageArr: [],
-                ruleForm: {
-                    year: '',
-                    des: ''
-                },
-                rules: {
-                    year: [{
-                        required: true,
-                        message: '请选择年份',
-                        trigger: 'change'
-                    }],
-                    des: [{
-                        required: true,
-                        message: '请输入描述',
-                        trigger: 'blur'
-                    }]
-                },
-                page: {
-                    pagesize: 12,
-                    currentPage: 1,
-                    total: 0
-                },
-                ratingCode: '',
-                ratingDes: '',
-                businessStr: '',
-                resAnnual: '',
-                monthArr: [],
-                ratingArr: [],
-                winPix: window.devicePixelRatio,
-                innerWidth: window.innerWidth
-            }
+        {
+            label: 'B级',
+            value: 'B'
         },
-        created() {
-            this.ratingArr = [{
-                    label: 'A级',
-                    value: 'A'
-                },
-                {
-                    label: 'B级',
-                    value: 'B'
-                },
-                {
-                    label: 'C级',
-                    value: 'C'
+        {
+            label: 'C级',
+            value: 'C'
+        }
+        ]
+        this.resAnnual = new Date().getFullYear().toString()
+        this.getevaluRatingList()
+    },
+    methods: {
+        // 查询列表页面
+        getevaluRatingList() {
+            let that = this
+            let params = {
+                pageNum: that.page.currentPage,
+                pageSize: that.page.pagesize,
+                checkCycle: 'DWPJ',
+                organizationEvaluationCode: that.ratingCode,
+                des: that.resDes
+            }
+            apiGetOrgEvaluationList(params).then(datas => {
+                if (datas && datas.data) {
+                    that.evaluationUnitRatingData = datas.data.records
+                    that.page.total = datas.data.total
                 }
-            ]
-            this.resAnnual = new Date().getFullYear().toString()
+            })
+        },
+        handleSizeChange(val) {
+            this.page.pagesize = val
             this.getevaluRatingList()
         },
-        methods: {
-            // 查询列表页面
-            getevaluRatingList() {
-                let that = this
-                let params = {
-                    pageNum: that.page.currentPage,
-                    pageSize: that.page.pagesize,
-                    checkCycle: 'DWPJ',
-                    organizationEvaluationCode: that.ratingCode,
-                    des: that.resDes
+        handleCurrentChange(val) {
+            this.page.currentPage = val
+            this.getevaluRatingList()
+        },
+        saveevaluaStart(formName) {
+            let that = this
+            that.$refs[formName].validate((valid) => {
+                if (valid) {
+                    that.saveAndEditIndicatorData()
                 }
-                apiGetOrgEvaluationList(params).then(datas => {
-                    if (datas && datas.data) {
-                        that.evaluationUnitRatingData = datas.data.records
-                        that.page.total = datas.data.total
-                    }
-                })
-            },
-            handleSizeChange(val) {
-                this.page.pagesize = val
-                this.getevaluRatingList()
-            },
-            handleCurrentChange(val) {
-                this.page.currentPage = val
-                this.getevaluRatingList()
-            },
-            saveevaluaStart(formName) {
-                let that = this
-                that.$refs[formName].validate((valid) => {
-                    if (valid) {
-                        that.saveAndEditIndicatorData()
+            });
+        },
+        //新增/修改考评启动数据
+        saveAndEditIndicatorData() {
+            let that = this
+            // let userMes = JSON.parse(window.sessionStorage.getItem('user'))
+            let params = {
+                // createName: userMes.name,
+                createName: '组织人事部',
+                year: that.ruleForm.year,
+                des: that.ruleForm.des
+            }
+            if (that.isSave) {
+                params.id = that.evalradio.id
+            }
+            apiGetorganizationyearratingsave(params).then(datas => {
+                if (!datas.success) {
+                    that.$message({
+                        message: datas.message,
+                        type: 'error'
+                    });
+                } else {
+                    if (!that.isSave) {
+                        that.$message({
+                            message: '单位绩效考核评级新增成功',
+                            type: 'success'
+                        });
+                    } else {
+                        that.$message({
+                            message: '单位绩效考核评级修改成功',
+                            type: 'success'
+                        });
                     }
+                    that.dialogVisible = false
+                    that.changeDateSelect = []
+                    that.getevaluRatingList()
+                }
+            })
+        },
+        getSeachData() {
+            this.getevaluRatingList()
+        },
+        resetSeach() {
+            this.ratingDes = ''
+            this.ratingCode = ''
+            this.resAnnual = ''
+            this.getevaluRatingList()
+        },
+        rowClick(selection, row) {
+            this.changeDateSelect = selection
+        },
+        rowClickToggle(row) {
+            this.$refs.ratingDialog.init(row)
+        },
+        seeStates(row) {
+            if (!row.instId) {
+                this.$message({
+                    type: 'error',
+                    message: '无法查看流程'
                 });
-            },
-            //新增/修改考评启动数据
-            saveAndEditIndicatorData() {
-                let that = this
-                // let userMes = JSON.parse(window.sessionStorage.getItem('user'))
-                let params = {
-                    // createName: userMes.name,
-                    createName: '组织人事部',
-                    year: that.ruleForm.year,
-                    des: that.ruleForm.des
+            } else {
+                this.statesVisible = true
+                let url = ''
+                if (window.location.hostname === '10.65.78.81') {
+                    url = 'http://10.65.79.85:8080'
+                } else {
+                    url = 'http://10.65.78.23:8080'
                 }
-                if (that.isSave) {
-                    params.id = that.evalradio.id
+                this.iframeURL = url + '/agilebpm-ui/bpm/instance/instanceImageDialog.html?instanceId=' + row
+                    .instId + '&iamCode=' + window.localStorage.getItem('code')
+                this.getstageData(row.instId)
+            }
+        },
+        // 根据流程id获取业务id
+        getstageData(id) {
+            let that = this
+            let params = {
+                instId: id,
+                iamCode: window.localStorage.getItem('code')
+            }
+            apiGetworkflowgetOpinion(params).then(datas => {
+                if (datas && datas.data) {
+                    that.stageArr = datas.data.data
                 }
-                apiGetorganizationyearratingsave(params).then(datas => {
-                    if (!datas.success) {
-                        that.$message({
-                            message: datas.message,
-                            type: 'error'
-                        });
-                    } else {
-                        if (!that.isSave) {
+            })
+        },
+        changeAssignInfo(row) {
+            let showStr = ''
+            if (row.assignInfo) {
+                showStr = row.assignInfo.substring(row.assignInfo.indexOf('-') + 1, row.assignInfo.length)
+                    .substring(0, row.assignInfo.substring(row.assignInfo.indexOf('-') + 1, row.assignInfo.length)
+                        .indexOf('-'))
+            }
+            return showStr
+        },
+        agetdeptresponsibility(row) {
+            let that = this
+            let par = {
+                defKey: "nddwpj",
+                businessKey: row.id,
+                action: "start",
+                opinion: "年度单位评级",
+                iamCode: window.localStorage.getItem('code')
+            }
+            if (row.instId === null || row.instId === '') {
+                apiGetdoAction(par).then(datas => {
+                    if (datas && datas.data) {
+                        if (datas.data.isOk) {
                             that.$message({
-                                message: '单位绩效考核评级新增成功',
+                                message: '流程已启动',
                                 type: 'success'
                             });
                         } else {
                             that.$message({
-                                message: '单位绩效考核评级修改成功',
-                                type: 'success'
+                                message: datas.data.msg,
+                                type: 'error'
                             });
                         }
-                        that.dialogVisible = false
-                        that.changeDateSelect = []
-                        that.getevaluRatingList()
-                    }
-                })
-            },
-            getSeachData() {
-                this.getevaluRatingList()
-            },
-            resetSeach() {
-                this.ratingDes = ''
-                this.ratingCode = ''
-                this.resAnnual = ''
-                this.getevaluRatingList()
-            },
-            rowClick(selection, row) {
-                this.changeDateSelect = selection
-            },
-            rowClickToggle(row) {
-                this.$refs.ratingDialog.init(row)
-            },
-            seeStates(row) {
-                if (!row.instId) {
-                    this.$message({
-                        type: 'error',
-                        message: '无法查看流程'
-                    });
-                } else {
-                    this.statesVisible = true
-                    let url = ''
-                    if (window.location.hostname === '10.65.78.81') {
-                        url = 'http://10.65.79.85:8080'
-                    } else {
-                        url = 'http://10.65.78.23:8080'
-                    }
-                    this.iframeURL = url + '/agilebpm-ui/bpm/instance/instanceImageDialog.html?instanceId=' + row
-                        .instId + '&iamCode=' + window.localStorage.getItem('code')
-                    this.getstageData(row.instId)
-                }
-            },
-            // 根据流程id获取业务id
-            getstageData(id) {
-                let that = this
-                let params = {
-                    instId: id,
-                    iamCode: window.localStorage.getItem('code')
-                }
-                apiGetworkflowgetOpinion(params).then(datas => {
-                    if (datas && datas.data) {
-                        that.stageArr = datas.data.data
                     }
                 })
-            },
-            changeAssignInfo(row) {
-                let showStr = ''
-                if (row.assignInfo) {
-                    showStr = row.assignInfo.substring(row.assignInfo.indexOf('-') + 1, row.assignInfo.length)
-                        .substring(0, row.assignInfo.substring(row.assignInfo.indexOf('-') + 1, row.assignInfo.length)
-                            .indexOf('-'))
+            }
+        },
+        handleAdd() {
+            this.dialogVisible = true
+            this.isSave = false
+            this.evalradio = {}
+            this.title = '新建单位绩效考核评级'
+            this.$nextTick(() => {
+                this.ruleForm = {
+                    year: '',
+                    des: ''
                 }
-                return showStr
-            },
-            agetdeptresponsibility(row) {
+            })
+        },
+        handleEdit() {
+            this.dialogVisible = true
+            this.isSave = true
+            this.title = '修改单位绩效考核评级'
+            this.evalradio = this.changeDateSelect[0]
+            this.ruleForm = {
+                year: this.evalradio.year,
+                des: this.evalradio.des
+            }
+        },
+        //删除
+        handleDelete() {
+            this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
                 let that = this
-                let par = {
-                    defKey: "nddwpj",
-                    businessKey: row.id,
-                    action: "start",
-                    opinion: "年度单位评级",
-                    iamCode: window.localStorage.getItem('code')
-                }
-                if (row.instId === null || row.instId === '') {
-                    apiGetdoAction(par).then(datas => {
-                        if (datas && datas.data) {
-                            if (datas.data.isOk) {
-                                that.$message({
-                                    message: '流程已启动',
-                                    type: 'success'
-                                });
-                            } else {
-                                that.$message({
-                                    message: datas.data.msg,
-                                    type: 'error'
-                                });
-                            }
-                        }
-                    })
-                }
-            },
-            handleAdd() {
-                this.dialogVisible = true
-                this.isSave = false
-                this.evalradio = {}
-                this.title = '新建单位绩效考核评级'
-                this.$nextTick(() => {
-                    this.ruleForm = {
-                        year: '',
-                        des: ''
-                    }
+                let paramsArr = []
+                that.changeDateSelect.forEach(it => {
+                    paramsArr.push(it.id)
                 })
-            },
-            handleEdit() {
-                this.dialogVisible = true
-                this.isSave = true
-                this.title = '修改单位绩效考核评级'
-                this.evalradio = this.changeDateSelect[0]
-                this.ruleForm = {
-                    year: this.evalradio.year,
-                    des: this.evalradio.des
-                }
-            },
-            //删除
-            handleDelete() {
-                this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    let that = this
-                    let paramsArr = []
-                    that.changeDateSelect.forEach(it => {
-                        paramsArr.push(it.id)
-                    })
-                    apiPostorganizationyearratingDelete(paramsArr.join(',')).then(datas => {
-                        that.$message({
-                            type: 'success',
-                            message: '删除成功!'
-                        });
-                        that.getevaluRatingList()
-                        that.changeDateSelect = []
-                    })
+                apiPostorganizationyearratingDelete(paramsArr.join(',')).then(datas => {
+                    that.$message({
+                        type: 'success',
+                        message: '删除成功!'
+                    });
+                    that.getevaluRatingList()
+                    that.changeDateSelect = []
                 })
-            },
-            unitRatingTableSty() {
-                if (this.winPix === 1.25 || this.innerWidth < 1800) {
-                    return 'unitRating125Table'
-                } else {
-                    return 'unitRating100Table'
-                }
+            })
+        },
+        unitRatingTableSty() {
+            if (this.winPix === 1.25 || this.innerWidth < 1800) {
+                return 'unitRating125Table'
+            } else {
+                return 'unitRating100Table'
             }
         }
     }
+}
 </script>
 
 <style lang="less">
-    .evaluationUnitRating {
-        .evaluationUnitRatingBtn {
-            .collectSeach {
-                display: flex;
-                padding: 24px 20px;
-                border-bottom: 1px solid#D6DBEA;
-
-                .exceed {
-                    display: flex;
-
-                    .exceedSpan {
-                        width: 100px;
-                        height: 12px;
-                        font-size: 14px;
-                        font-family: Microsoft YaHei;
-                        font-weight: 400;
-                        color: #8991B0;
-                        line-height: 12px;
-                        margin-top: 14px;
-                    }
-
-                    .el-input {
-                        margin-right: 10px;
-                        height: 40px;
+.evaluationUnitRating {
+    .evaluationUnitRatingBtn {
+        .collectSeach {
+            display: flex;
+            padding: 24px 20px;
+            border-bottom: 1px solid#D6DBEA;
 
-                        .el-input__inner {
-                            height: 40px;
-                        }
+            .exceed {
+                display: flex;
 
-                        .el-input__suffix {
-                            .el-select__caret {
-                                line-height: 30px;
-                            }
-                        }
-                    }
+                .exceedSpan {
+                    width: 100px;
+                    height: 12px;
+                    font-size: 14px;
+                    font-family: Microsoft YaHei;
+                    font-weight: 400;
+                    color: #8991B0;
+                    line-height: 12px;
+                    margin-top: 14px;
                 }
 
-                .el-select {
+                .el-input {
                     margin-right: 10px;
+                    height: 40px;
 
                     .el-input__inner {
-                        height: 30px;
+                        height: 40px;
                     }
 
                     .el-input__suffix {
@@ -452,109 +437,124 @@
                 }
             }
 
-            span {
-                font-size: 14px;
-            }
+            .el-select {
+                margin-right: 10px;
 
-            .PeriodBtn {
-                display: flex;
-                justify-content: flex-end;
-                padding: 20px 0;
+                .el-input__inner {
+                    height: 30px;
+                }
+
+                .el-input__suffix {
+                    .el-select__caret {
+                        line-height: 30px;
+                    }
+                }
             }
+        }
 
-            .el-button {
-                height: 30px;
-                // width:100px;
-                padding: 0 20px;
+        span {
+            font-size: 14px;
+        }
 
-                // padding-top: 8px;
-                span {
-                    margin: 0;
-                }
+        .PeriodBtn {
+            display: flex;
+            justify-content: flex-end;
+            padding: 20px 0;
+        }
+
+        .el-button {
+            height: 30px;
+            // width:100px;
+            padding: 0 20px;
+
+            // padding-top: 8px;
+            span {
+                margin: 0;
             }
+        }
 
-            .evaluationUnitRatingTableData {
-                .unitRating125Table {
-                    .el-table__body-wrapper {
-                        height: 53vh !important;
-                    }
+        .evaluationUnitRatingTableData {
+            .unitRating125Table {
+                .el-table__body-wrapper {
+                    height: 53vh !important;
                 }
+            }
 
-                .unitRating100Table {
-                    .el-table__body-wrapper {
-                        height: 60vh !important;
-                    }
+            .unitRating100Table {
+                .el-table__body-wrapper {
+                    height: 60vh !important;
                 }
+            }
 
-                .el-table {
-                    .el-input__inner {
-                        height: 30px !important;
-                    }
+            .el-table {
+                .el-input__inner {
+                    height: 30px !important;
+                }
 
-                    .el-radio__label {
-                        display: none;
-                    }
+                .el-radio__label {
+                    display: none;
+                }
 
-                    .tooltipCC {
-                        width: 300px !important;
-                        display: inline-block;
-                        overflow: hidden;
-                        text-overflow: ellipsis;
-                        white-space: nowrap;
-                    }
+                .tooltipCC {
+                    width: 300px !important;
+                    display: inline-block;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                    white-space: nowrap;
+                }
 
-                    .tooltipCCDes {
-                        width: 50px;
-                        display: inline-block;
-                        overflow: hidden;
-                        text-overflow: ellipsis;
-                        white-space: nowrap;
-                    }
+                .tooltipCCDes {
+                    width: 50px;
+                    display: inline-block;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                    white-space: nowrap;
+                }
 
-                    .indicitem {
-                        color: #409EFF;
-                        font-size: 12px;
-                        margin-right: 20px;
-                        cursor: pointer;
+                .indicitem {
+                    color: #409EFF;
+                    font-size: 12px;
+                    margin-right: 20px;
+                    cursor: pointer;
 
-                        &:hover {
-                            text-decoration: underline;
-                        }
+                    &:hover {
+                        text-decoration: underline;
                     }
                 }
-
-                .el-pagination {
-                    margin-top: 20px;
-                    text-align: end;
-                    position: relative;
-                }
             }
 
-            .el-overlay {
-                .startToDia {
-                    .el-dialog__body {
-                        padding: 30px 60px 30px 20px !important;
+            .el-pagination {
+                margin-top: 20px;
+                text-align: end;
+                position: relative;
+            }
+        }
 
-                        .periodFrom {
+        .el-overlay {
+            .startToDia {
+                .el-dialog__body {
+                    padding: 30px 60px 30px 20px !important;
 
-                            .el-select,
-                            .el-input {
-                                width: 100%;
-                            }
+                    .periodFrom {
 
-                            .el-input {
-                                height: 30px;
-                            }
+                        .el-select,
+                        .el-input {
+                            width: 100%;
                         }
 
-                        .flowSty {
-                            width: 100%;
-                            height: 70vh;
+                        .el-input {
+                            height: 30px;
                         }
                     }
+
+                    .flowSty {
+                        width: 100%;
+                        height: 70vh;
+                    }
                 }
             }
         }
-
     }
+
+}
 </style>

+ 173 - 149
src/components/assessment/evaluationYearPage.vue

@@ -13,33 +13,22 @@
                 <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
             </div>
             <div class="PeriodBtn" :style="$utils.PeriodBtnSty()">
-                <btns
-                :showImport="false"
-                :showSave="false"
-                :showExport="false"
-                :showAdd="$utils.havePurview('evalYear:oneLevel:add')"
-                :showDelete="$utils.havePurview('evalYear:oneLevel:delete')"
-                :disDelete="changeDateSelect.length === 0"
-                :disExport="true"
-                @handleAdd="handleAdd"
-                @handleDelete="handleDelete"
-                @handleExport="handleExport"
-                ></btns>
+                <btns :showImport="false" :showSave="false" :showExport="false"
+                    :showAdd="$utils.havePurview('evalYear:oneLevel:add')"
+                    :showDelete="$utils.havePurview('evalYear:oneLevel:delete')" :disDelete="changeDateSelect.length === 0"
+                    :disExport="true" @handleAdd="handleAdd" @handleDelete="handleDelete" @handleExport="handleExport">
+                </btns>
             </div>
             <div class="evaluationYearTableData">
-                <el-table :data="evaluationYearData" style="width: 100%" :class="yearTableSty()"
-                 @select="rowClick" @select-all="rowClick" @row-dblclick="getDetail">
+                <el-table :data="evaluationYearData" style="width: 100%" :class="yearTableSty()" @select="rowClick"
+                    @select-all="rowClick" @row-dblclick="getDetail">
                     <el-table-column type="selection" label="操作" align="center"></el-table-column>
                     <el-table-column label="业务编号" prop="organizationEvaluationCode" width="300" />
-                    <el-table-column label="考评单位" width="330">                        
+                    <el-table-column label="考评单位" width="330">
                         <template #default="scope">
-                            <el-tooltip
-                                class="tooltipName"
-                                effect="customized"
-                                :content="scope.row.createOrgName"
-                                placement="right"
-                            >
-                                <span class="tooltipCC">{{scope.row.createOrgName}}</span>
+                            <el-tooltip class="tooltipName" effect="customized" :content="scope.row.createOrgName"
+                                placement="right">
+                                <span class="tooltipCC">{{ scope.row.createOrgName }}</span>
                             </el-tooltip>
                         </template>
                     </el-table-column>
@@ -54,18 +43,13 @@
                     <!-- <el-table-column label="月度/季度" prop="month" /> -->
                     <el-table-column label="流程状态" prop="stage">
                         <template #default="scope">
-                            <p class="indicitem" @click="seeStates(scope.row)">{{scope.row.stage}}</p>
+                            <p class="indicitem" @click="seeStates(scope.row)">{{ scope.row.stage }}</p>
                         </template>
                     </el-table-column>
                     <el-table-column label="业务简述" prop="des" width="230">
                         <template #default="scope">
-                            <el-tooltip
-                                class="box-item"
-                                effect="customized"
-                                :content="scope.row.des"
-                                placement="top"
-                            >
-                                <span class="tooltipCC">{{scope.row.des}}</span>
+                            <el-tooltip class="box-item" effect="customized" :content="scope.row.des" placement="top">
+                                <span class="tooltipCC">{{ scope.row.des }}</span>
                             </el-tooltip>
                         </template>
                     </el-table-column>
@@ -105,36 +89,26 @@
                         </template>
                     </el-table-column>
                 </el-table>
-                <el-pagination
-                    @size-change="handleSizeChange"
-                    @current-change="handleCurrentChange"
-                    :current-page="page.currentPage"
-                    :page-size="page.pagesize"
-                    layout="total, prev, pager, next, jumper"
+                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                    :current-page="page.currentPage" :page-size="page.pagesize" layout="total, prev, pager, next, jumper"
                     :total="page.total">
                 </el-pagination>
             </div>
             <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
                 <div class="periodFrom">
-                    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
+                    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"
+                        :validate-on-rule-change="false">
                         <el-form-item label="考评类别" prop="organizationType">
                             <el-select v-model="ruleForm.organizationType" placeholder="请选择考评类别" disabled>
-                                <el-option
-                                v-for="item in organizationType"
-                                :key="item.code"
-                                :label="item.label"
-                                :value="item.code">
+                                <el-option v-for="item in organizationType" :key="item.code" :label="item.label"
+                                    :value="item.code">
                                 </el-option>
                             </el-select>
-                        </el-form-item>                            
+                        </el-form-item>
                         <el-form-item label="考评周期" prop="evaluationCycle">
                             <el-select v-model="ruleForm.evaluationCycle" placeholder="请选择考评周期">
-                                <el-option
-                                v-for="item in periodData"
-                                :key="item.keyValue"
-                                :label="item.keyName"
-                                :value="item.keyValue"
-                                :disabled="item.keyValue === 'JDKP' || item.keyValue === 'YDKP'">
+                                <el-option v-for="item in periodData" :key="item.keyValue" :label="item.keyName"
+                                    :value="item.keyValue" :disabled="item.keyValue === 'JDKP' || item.keyValue === 'YDKP'">
                                 </el-option>
                             </el-select>
                         </el-form-item>
@@ -149,12 +123,7 @@
                             </el-select>
                         </el-form-item> -->
                         <el-form-item label="年份" prop="year">
-                            <el-date-picker
-                                v-model="ruleForm.year"
-                                type="year"
-                                value-format="YYYY"
-                                placeholder="请选择年份"
-                                />
+                            <el-date-picker v-model="ruleForm.year" type="year" value-format="YYYY" placeholder="请选择年份" />
                         </el-form-item>
                         <el-form-item label="描述" prop="desc">
                             <el-input v-model="ruleForm.desc" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
@@ -170,8 +139,8 @@
             </el-dialog>
             <el-dialog title="流程详情" v-model="statesVisible" :fullscreen="true" :close-on-click-modal="false">
                 <div class="flowSty">
-                    <iframe id="iframeContain" width="100%" height="500px"
-                     frameborder="0" class="iframe" name="iframeContain" seamless scrolling="no" :src="iframeURL">            
+                    <iframe id="iframeContain" width="100%" height="500px" frameborder="0" class="iframe"
+                        name="iframeContain" seamless scrolling="no" :src="iframeURL">
                     </iframe>
                     <el-table :data="stageArr" style="width: 100%">
                         <el-table-column type="index" label="序号" align="center" />
@@ -180,7 +149,7 @@
                         <el-table-column label="任务处理时间" prop="approveTime" />
                         <el-table-column label="候选人" prop="assignInfo" width="300">
                             <template #default="scope">
-                                <span>{{changeAssignInfo(scope.row)}}</span>
+                                <span>{{ changeAssignInfo(scope.row) }}</span>
                             </template>
                         </el-table-column>
                         <el-table-column label="执行人" prop="approverName" />
@@ -208,8 +177,10 @@ import startFromList from './monthQuarterYearFrom.vue'
 import monthQuarterYearReport from './monthQuarterYearReport.vue'
 import btns from '../elbuttonS.vue'
 import seachs from '../seachGroup.vue'
-import {apiGetOrgEvaluationList, apiPostOrgEvaSave,apiPostOrgevaluationDelete,apiGetgenerateEvaluateReport,apiGetdoAction,
-apiGetgenerateUnitYearEvaluation, apiGetdatadictionaryList, apiGetcalculatorcron, apiGetworkflowgetOpinion} from '../../api/api'
+import {
+    apiGetOrgEvaluationList, apiPostOrgEvaSave, apiPostOrgevaluationDelete, apiGetgenerateEvaluateReport, apiGetdoAction,
+    apiGetgenerateUnitYearEvaluation, apiGetdatadictionaryList, apiGetcalculatorcron, apiGetworkflowgetOpinion
+} from '../../api/api'
 export default {
     components: {
         startFromList,
@@ -228,8 +199,8 @@ export default {
             windframradio: {},
             deleteSelect: [],
             changeDateSelect: [],
-            evaluationYearData:[],
-            page:{
+            evaluationYearData: [],
+            page: {
                 pagesize: 12,
                 currentPage: 1,
                 total: 0
@@ -283,7 +254,7 @@ export default {
         this.getevaluStartList()
         this.getPeriodData()
     },
-    methods:{
+    methods: {
         // 查询列表页面
         getevaluStartList() {
             let that = this
@@ -294,7 +265,7 @@ export default {
                 organizationEvaluationCode: that.rescode,
                 des: that.resDes
             }
-            apiGetOrgEvaluationList(params).then(datas =>{
+            apiGetOrgEvaluationList(params).then(datas => {
                 if (datas && datas.data) {
                     that.evaluationYearData = datas.data.records
                     that.page.total = datas.data.total
@@ -307,7 +278,7 @@ export default {
             let params = {
                 superKey: 'KPZQ0001'
             }
-            apiGetdatadictionaryList(params).then(datas =>{
+            apiGetdatadictionaryList(params).then(datas => {
                 if (datas && datas.data) {
                     that.periodData = datas.data
                 }
@@ -338,7 +309,7 @@ export default {
             if (that.isSave) {
                 params.id = this.evalradio.id
             }
-            apiPostOrgEvaSave(params).then(datas =>{
+            apiPostOrgEvaSave(params).then(datas => {
                 if (!datas.success) {
                     that.$message({
                         message: datas.message,
@@ -367,7 +338,7 @@ export default {
             let params = {
                 evaluationIds: row.id
             }
-            apiGetgenerateUnitYearEvaluation(params).then(datas =>{
+            apiGetgenerateUnitYearEvaluation(params).then(datas => {
                 if (datas && datas.data) {
                     if (!datas.success) {
                         that.$message({
@@ -382,7 +353,34 @@ export default {
                         that.getevaluStartList()
                     }
                 }
-            })
+            }).catch(({ message }) => {
+                if (message === "考评明细记录已存在") {
+                    this.$confirm("考评明细记录已存在,是否重新生成数据?", "操作提示", {
+                        confirmButtonText: "是",
+                        cancelButtonText: "否"
+                    }).then(() => {
+                        const load = this.$loading({
+                            lock: true,
+                            text: '生成中...请稍候',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(0, 0, 0, 0.7)'
+                        });
+                        params.mark = true;
+                        apiGetgenerateUnitMonthEvaluation(params).then(reEvaRes => {
+                            if (reEvaRes.code === 200) {
+                                that.$message({
+                                    message: '考评数据已重新生成',
+                                    type: 'success'
+                                });
+                                that.getevaluStartList()
+                                load.close();
+                            }
+                        }).catch(() => {
+                            load.close();
+                        });
+                    });
+                }
+            });
         },
         agetdeptresponsibility(row) {
             let that = this
@@ -393,7 +391,7 @@ export default {
                 opinion: "年度单位考评流程",
                 iamCode: window.localStorage.getItem('code')
             }
-            apiGetdoAction(par).then(datas =>{
+            apiGetdoAction(par).then(datas => {
                 if (datas && datas.data) {
                     if (datas.data.isOk) {
                         that.$message({
@@ -413,7 +411,7 @@ export default {
         changeAssignInfo(row) {
             let showStr = ''
             if (row.assignInfo) {
-                showStr = row.assignInfo.substring(row.assignInfo.indexOf('-')+1, row.assignInfo.length).substring(0, row.assignInfo.substring(row.assignInfo.indexOf('-')+1, row.assignInfo.length).indexOf('-'))
+                showStr = row.assignInfo.substring(row.assignInfo.indexOf('-') + 1, row.assignInfo.length).substring(0, row.assignInfo.substring(row.assignInfo.indexOf('-') + 1, row.assignInfo.length).indexOf('-'))
             }
             return showStr
         },
@@ -431,7 +429,7 @@ export default {
                 } else {
                     url = 'http://10.65.78.23:8080'
                 }
-                this.iframeURL = url+'/agilebpm-ui/bpm/instance/instanceImageDialog.html?instanceId='+row.instId+'&iamCode='+window.localStorage.getItem('code')
+                this.iframeURL = url + '/agilebpm-ui/bpm/instance/instanceImageDialog.html?instanceId=' + row.instId + '&iamCode=' + window.localStorage.getItem('code')
                 this.getstageData(row.instId)
             }
         },
@@ -442,9 +440,9 @@ export default {
                 instId: id,
                 iamCode: window.localStorage.getItem('code')
             }
-            apiGetworkflowgetOpinion(params).then(datas =>{
+            apiGetworkflowgetOpinion(params).then(datas => {
                 if (datas && datas.data) {
-                    that.stageArr = datas.data.data                    
+                    that.stageArr = datas.data.data
                 }
             })
         },
@@ -459,7 +457,7 @@ export default {
             let params = {
                 id: row.id
             }
-            apiGetcalculatorcron(params).then(datas =>{
+            apiGetcalculatorcron(params).then(datas => {
                 if (datas) {
                     if (datas.success) {
                         that.$message({
@@ -473,8 +471,8 @@ export default {
                             type: 'error'
                         });
                     }
-                } 
-            }).catch(e =>{
+                }
+            }).catch(e => {
                 that.loading = false
                 that.$message({
                     message: '计算得分失败,请联系管理员',
@@ -490,7 +488,7 @@ export default {
             let params = {
                 organizationEvaluationId: row.id
             }
-            apiGetgenerateEvaluateReport(params).then(datas =>{
+            apiGetgenerateEvaluateReport(params).then(datas => {
                 if (datas && datas.data) {
                     that.isReportshow = false
                     if (datas.success) {
@@ -505,8 +503,8 @@ export default {
                             type: 'error'
                         });
                     }
-                } 
-            }).catch(e =>{
+                }
+            }).catch(e => {
                 that.loading = false
                 that.$message({
                     message: '生成报表失败,请联系管理员',
@@ -524,12 +522,12 @@ export default {
             this.resDes = ''
             this.getevaluStartList()
         },
-        handleSizeChange(val){
+        handleSizeChange(val) {
             this.page.pagesize = val
             this.getevaluStartList()
         },
-        handleCurrentChange(val){
-            this.page.currentPage =val
+        handleCurrentChange(val) {
+            this.page.currentPage = val
             this.getevaluStartList()
         },
         rowClick(selection, row) {
@@ -538,7 +536,7 @@ export default {
         handleAdd() {
             this.dialogVisible = true
             this.title = '新建表单填报'
-            this.$nextTick(() =>{
+            this.$nextTick(() => {
                 this.$refs['ruleForm'].resetFields()
                 this.ruleForm = {
                     organizationType: 'DWKP',
@@ -559,10 +557,10 @@ export default {
             }).then(() => {
                 let that = this
                 let paramsArr = []
-                that.changeDateSelect.forEach(it =>{
+                that.changeDateSelect.forEach(it => {
                     paramsArr.push(it.id)
                 })
-                apiPostOrgevaluationDelete(paramsArr.join(',')).then(datas =>{
+                apiPostOrgevaluationDelete(paramsArr.join(',')).then(datas => {
                     that.$message({
                         type: 'success',
                         message: '删除成功!'
@@ -587,123 +585,149 @@ export default {
 </script>
 
 <style lang="less">
-.evaluationYear{
-    .evaluationYearBtn{
-        .collectSeach{
+.evaluationYear {
+    .evaluationYearBtn {
+        .collectSeach {
+            display: flex;
+            padding: 24px 20px;
+            border-bottom: 1px solid#D6DBEA;
+
+            .exceed {
                 display: flex;
-                padding: 24px 20px;
-                border-bottom: 1px solid#D6DBEA;
-                .exceed{
-                    display: flex;
-                    .exceedSpan{
-                        width: 100px;
-                        height: 12px;
-                        font-size: 14px;
-                        font-family: Microsoft YaHei;
-                        font-weight: 400;
-                        color: #8991B0;
-                        line-height: 12px;
-                        margin-top: 14px;
-                    }
-                    .el-input{
-                        margin-right:10px;
+
+                .exceedSpan {
+                    width: 100px;
+                    height: 12px;
+                    font-size: 14px;
+                    font-family: Microsoft YaHei;
+                    font-weight: 400;
+                    color: #8991B0;
+                    line-height: 12px;
+                    margin-top: 14px;
+                }
+
+                .el-input {
+                    margin-right: 10px;
+                    height: 40px;
+
+                    .el-input__inner {
                         height: 40px;
-                        .el-input__inner{
-                            height:40px;
-                        }
-                        .el-input__suffix{
-                            .el-select__caret{
-                                line-height:30px;
-                            }
+                    }
+
+                    .el-input__suffix {
+                        .el-select__caret {
+                            line-height: 30px;
                         }
                     }
                 }
-                .el-select{
-                    margin-right:10px;
-                    .el-input__inner{
-                        height:30px;
-                    }
-                    .el-input__suffix{
-                        .el-select__caret{
-                            line-height:30px;
-                        }
+            }
+
+            .el-select {
+                margin-right: 10px;
+
+                .el-input__inner {
+                    height: 30px;
+                }
+
+                .el-input__suffix {
+                    .el-select__caret {
+                        line-height: 30px;
                     }
                 }
+            }
         }
-        span{
-            font-size:14px;
+
+        span {
+            font-size: 14px;
         }
-        .PeriodBtn{
+
+        .PeriodBtn {
             display: flex;
-                justify-content: flex-end;
-                padding: 20px 0;
+            justify-content: flex-end;
+            padding: 20px 0;
         }
-        .el-button{
+
+        .el-button {
             height: 30px;
             // width:100px;
-            padding: 0 20px ;
+            padding: 0 20px;
+
             // padding-top: 8px;
-            span{
-                margin:0;
+            span {
+                margin: 0;
             }
         }
-        .evaluationYearTableData{
-            .year125Table{
-                .el-table__body-wrapper{
+
+        .evaluationYearTableData {
+            .year125Table {
+                .el-table__body-wrapper {
                     height: 53vh !important;
                 }
             }
-            .year100Table{
-                .el-table__body-wrapper{
+
+            .year100Table {
+                .el-table__body-wrapper {
                     height: 60vh !important;
                 }
             }
-            .el-table{
-                .el-input__inner{
+
+            .el-table {
+                .el-input__inner {
                     height: 30px !important;
                 }
-                .el-radio__label{
+
+                .el-radio__label {
                     display: none;
                 }
-                .tooltipCC{
+
+                .tooltipCC {
                     width: 300px;
                     display: inline-block;
                     overflow: hidden;
                     text-overflow: ellipsis;
                     white-space: nowrap;
                 }
-                .tooltipCCDes{
+
+                .tooltipCCDes {
                     width: 200px;
                     display: inline-block;
                     overflow: hidden;
                     text-overflow: ellipsis;
                     white-space: nowrap;
                 }
-                .indicitem{
+
+                .indicitem {
                     color: #409EFF;
                     font-size: 12px;
                     margin-right: 20px;
-                    cursor:pointer;
-                    &:hover{
+                    cursor: pointer;
+
+                    &:hover {
                         text-decoration: underline;
                     }
                 }
             }
-            .el-pagination{
+
+            .el-pagination {
                 margin-top: 20px;
                 text-align: end;
                 position: relative;
             }
         }
-        .el-overlay{
-            .el-dialog{
-                .el-dialog__body{
+
+        .el-overlay {
+            .el-dialog {
+                .el-dialog__body {
                     padding: 30px 60px 30px 20px !important;
-                    .periodFrom{
-                        .el-select, .el-input{
+
+                    .periodFrom {
+
+                        .el-select,
+                        .el-input {
                             width: 100%;
                         }
-                        .el-input{
+
+                        .el-input {
                             height: 30px;
                         }
                     }

+ 237 - 164
src/components/assessment/monthQuarterYearFrom.vue

@@ -7,41 +7,41 @@
                     <el-col :span="6">
                         <div class="danjuMsg_data">
                             <span class="data_tit">业务编号:</span>
-                            <span>{{receiptMsg.code}}</span>
+                            <span>{{ receiptMsg.code }}</span>
                         </div>
                         <div class="danjuMsg_data">
                             <span class="data_tit">创建日期:</span>
-                            <span>{{receiptMsg.createDate}}</span>
+                            <span>{{ receiptMsg.createDate }}</span>
                         </div>
                     </el-col>
                     <el-col :span="6">
                         <div class="danjuMsg_data">
                             <span class="data_tit">业务简述:</span>
-                            <span>{{receiptMsg.des}}</span>
+                            <span>{{ receiptMsg.des }}</span>
                         </div>
                         <div class="danjuMsg_data">
                             <span class="data_tit">业务类别:</span>
-                            <span>{{receiptMsg.type}}</span>
+                            <span>{{ receiptMsg.type }}</span>
                         </div>
                     </el-col>
                     <el-col :span="6">
                         <div class="danjuMsg_data">
                             <span class="data_tit">流程状态:</span>
-                            <span>{{receiptMsg.stage}}</span>
+                            <span>{{ receiptMsg.stage }}</span>
                         </div>
                         <div class="danjuMsg_data">
                             <span class="data_tit">年度:</span>
-                            <span>{{receiptMsg.year}}</span>
+                            <span>{{ receiptMsg.year }}</span>
                         </div>
                     </el-col>
                     <el-col :span="6">
                         <div class="danjuMsg_data">
                             <span class="data_tit">创建人:</span>
-                            <span>{{receiptMsg.createName}}</span>
+                            <span>{{ receiptMsg.createName }}</span>
                         </div>
                         <div class="danjuMsg_data">
                             <span class="data_tit">单据状态:</span>
-                            <span>{{receiptMsg.recStage}}</span>
+                            <span>{{ receiptMsg.recStage }}</span>
                         </div>
                     </el-col>
                 </el-row>
@@ -51,13 +51,15 @@
                             <div class="detailsHeader">
                                 <div class="headerLeft">
                                     <el-tag v-for="tag in indicatorList" :key="tag.id" size="large" class="tagArr"
-                                        effect="dark" :type="tag.id === isClickTagId ? '': 'info'" @click="handleShowPage(tag)">
+                                        effect="dark" :type="tag.id === isClickTagId ? '' : 'info'"
+                                        @click="handleShowPage(tag)">
                                         <span>{{ tag.indicator_name }}</span>
                                     </el-tag>
                                 </div>
                                 <div class="headerRight">
                                     <div class="seachFor">
-                                        <el-input v-model="compNameSa" placeholder="请输入单位名称" @keyup.enter="getTableData(isClickTagId)"></el-input>
+                                        <el-input v-model="compNameSa" placeholder="请输入单位名称"
+                                            @keyup.enter="getTableData(isClickTagId)"></el-input>
                                         <!-- <el-icon :size="20" color="#3B7AD1" @click="getTableData(isClickTagId)"><Search /></el-icon> -->
                                     </div>
                                     <!-- <div class="tableBtn add" @click="addTableDetail"
@@ -71,11 +73,13 @@
                                         <span>保存</span>
                                     </div> -->
                                     <!-- activeName !== 'ZDZX' && activeName !== 'GLSX' &&  -->
-                                    <div class="tableBtn save" @click="saveDetail" v-if="receiptMsg.stage === '流程未启动'">
+                                    <div class="tableBtn save" @click="saveDetail"
+                                        v-if="receiptMsg.stage !== '流程已结束'">
                                         <img :src="saveIcon" alt="">
                                         <span>保存</span>
                                     </div>
-                                    <div class="tableBtn import" @click="handleImport" v-if="receiptMsg.stage === '流程未启动'">
+                                    <div class="tableBtn import" @click="handleImport"
+                                        v-if="receiptMsg.stage !== '流程已结束'">
                                         <img :src="importIcon" alt="">
                                         <span>导入</span>
                                     </div>
@@ -86,48 +90,47 @@
                                 </div>
                             </div>
                             <el-table :data="monthQuarterYearData" style="width: 100%" ref="monthQuarterYearTT"
-                             :row-class-name="tableRowClassName" :border="true" >
+                                :row-class-name="tableRowClassName" :border="true">
                                 <el-table-column type="index" label="排名" align="center"></el-table-column>
                                 <el-table-column label="考评单位" prop="organizationShortName" width="300">
                                     <template #default="scope">
                                         <el-select v-model="scope.row.organizationShortName" placeholder="请选择考评单位">
-                                            <el-option
-                                            v-for="item in organizationData"
-                                            :key="item.organizationId"
-                                            :label="item.organizationShortName"
-                                            :value="item.organizationId">
+                                            <el-option v-for="item in organizationData" :key="item.organizationId"
+                                                :label="item.organizationShortName" :value="item.organizationId">
                                             </el-option>
                                         </el-select>
                                     </template>
                                 </el-table-column>
-                                <el-table-column  v-for="(it, index) in monthQuarterYearHeader" :key="index"
-                                 :label="it.name" align="center">
+                                <el-table-column v-for="(it, index) in monthQuarterYearHeader" :key="index" :label="it.name"
+                                    align="center">
                                     <el-table-column v-for="(iv, index) in it.children" :key="index" :label="iv.key"
-                                     align="center" width="150" sortable :sort-method="(a,b)=>sortMethods(a,b,iv.code)">
+                                        align="center" width="150" sortable
+                                        :sort-method="(a, b) => sortMethods(a, b, iv.code)">
                                         <template #default="scope">
                                             <template v-if="!scope.row['operation']">
-                                                <el-select v-model="scope.row[iv.code]" class="selectSty" placeholder="请选择审核状态" v-if="scope.row['IS_LH_'+iv.code] === '3'">
-                                                    <el-option
-                                                    v-for="item in statusData"
-                                                    :key="item.id"
-                                                    :label="item.name"
-                                                    :value="item.id">
+                                                <el-select v-model="scope.row[iv.code]" class="selectSty"
+                                                    placeholder="请选择审核状态" v-if="scope.row['IS_LH_' + iv.code] === '3'">
+                                                    <el-option v-for="item in statusData" :key="item.id" :label="item.name"
+                                                        :value="item.id">
                                                     </el-option>
                                                 </el-select>
-                                                <el-input v-model="scope.row[iv.code]" class="inputSty" v-else-if="scope.row['IS_LH_'+iv.code] === '2'"></el-input>
-                                                <el-input-number v-model="scope.row[iv.code]" class="numberSty" :precision="2" :step="0.1" v-else />
+                                                <el-input v-model="scope.row[iv.code]" class="inputSty"
+                                                    v-else-if="scope.row['IS_LH_' + iv.code] === '2'"></el-input>
+                                                <el-input-number v-model="scope.row[iv.code]" class="numberSty"
+                                                    :precision="2" :step="0.1" v-else />
                                             </template>
                                             <template v-else>
-                                                <el-select v-model="scope.row[iv.code]" class="selectSty" placeholder="请选择审核状态" v-if="scope.row['IS_LH_'+iv.code] === '3'">
-                                                    <el-option
-                                                    v-for="item in statusData"
-                                                    :key="item.id"
-                                                    :label="item.name"
-                                                    :value="item.id">
+                                                <el-select v-model="scope.row[iv.code]" class="selectSty"
+                                                    placeholder="请选择审核状态" v-if="scope.row['IS_LH_' + iv.code] === '3'">
+                                                    <el-option v-for="item in statusData" :key="item.id" :label="item.name"
+                                                        :value="item.id">
                                                     </el-option>
                                                 </el-select>
-                                                <span class="indicitem" v-if="iv.code === 'operation'" @click="changeDetail(scope.row)">详情</span>
-                                                <span class="inputSty" v-else-if="iv.code!=='operation' && scope.row['IS_LH_'+iv.code] !== '3'">{{scope.row[iv.code]}}</span>
+                                                <span class="indicitem" v-if="iv.code === 'operation'"
+                                                    @click="changeDetail(scope.row)">详情</span>
+                                                <span class="inputSty"
+                                                    v-else-if="iv.code !== 'operation' && scope.row['IS_LH_' + iv.code] !== '3'">{{
+                                                        scope.row[iv.code] }}</span>
                                             </template>
                                         </template>
                                     </el-table-column>
@@ -137,10 +140,10 @@
                     </el-tabs>
                     <div class="tableSeach">
                         <div class="seachType" v-for="item in titleMsgArr" :key="item.isName"
-                        :class="item.showClick? 'seachTypeCha':''" @click="changType(item)">
+                            :class="item.showClick ? 'seachTypeCha' : ''" @click="changType(item)">
                             <img :src="item.img" alt="" v-if="!item.showClick">
                             <img :src="item.clickImg" alt="" v-else>
-                            <p :style="item.showClick? 'color: #3B7AD1' : ''">{{item.isName}}</p>
+                            <p :style="item.showClick ? 'color: #3B7AD1' : ''">{{ item.isName }}</p>
                         </div>
                     </div>
                 </div>
@@ -163,15 +166,17 @@
                 </div>
             </div>
             <el-table :data="monthQuarterYearDetailData" style="width: 100%" ref="monthQuarterYearTT"
-                :row-class-name="tableRowClassName" :border="true" >
+                :row-class-name="tableRowClassName" :border="true">
                 <el-table-column type="index" label="序号" align="center"></el-table-column>
                 <el-table-column label="部门名称" prop="deptName" align="center" width="200"></el-table-column>
-                <el-table-column  v-for="(it, index) in monthQuarterYearDetailHeader" :key="index"
-                    :label="it.name" align="center">
+                <el-table-column v-for="(it, index) in monthQuarterYearDetailHeader" :key="index" :label="it.name"
+                    align="center">
                     <el-table-column v-for="(iv, index) in it.children" :key="index" :label="iv.key" align="center">
                         <template #default="scope">
-                            <el-input v-model="scope.row[iv.code]" class="inputSty" v-if="scope.row['IS_LH_'+iv.code] === '2'"></el-input>
-                            <el-input-number v-model="scope.row[iv.code]" class="numberSty" :precision="2" :step="0.1" v-else-if="scope.row['IS_LH_'+iv.code] === '1'" />
+                            <el-input v-model="scope.row[iv.code]" class="inputSty"
+                                v-if="scope.row['IS_LH_' + iv.code] === '2'"></el-input>
+                            <el-input-number v-model="scope.row[iv.code]" class="numberSty" :precision="2" :step="0.1"
+                                v-else-if="scope.row['IS_LH_' + iv.code] === '1'" />
                         </template>
                     </el-table-column>
                 </el-table-column>
@@ -188,12 +193,14 @@
 
 <script>
 import importDailog from '../importPage/importDailog.vue'
-import {apiGetEvaluationIndicatorList,apiGetgetEvaluationInfoDataList,apiGetbinsectionList, apiGetbinstageList,apiGetExportMsg,
-apiPostorganizationUpdateEvaluationInfo, apiPostorganizationUpdateAddEvaluationInfo, apiGetOrganizationListAll,
-apiGetorganizationevaluationcommoninfo, apiPostsaveEvaluationCommonInfo, apiPostremoveEvaluationCommonInfo} from '../../api/api'
+import {
+    apiGetEvaluationIndicatorList, apiGetgetEvaluationInfoDataList, apiGetbinsectionList, apiGetbinstageList, apiGetExportMsg,
+    apiPostorganizationUpdateEvaluationInfo, apiPostorganizationUpdateAddEvaluationInfo, apiGetOrganizationListAll,
+    apiGetorganizationevaluationcommoninfo, apiPostsaveEvaluationCommonInfo, apiPostremoveEvaluationCommonInfo
+} from '../../api/api'
 import * as XLSX from 'xlsx'
 import { saveAs } from 'file-saver'
-import  * as XLSXD from 'xlsx-js-style'
+import * as XLSXD from 'xlsx-js-style'
 
 import sectionDef from '../../assets/benchmarkImg/sectionDef.png'
 
@@ -272,7 +279,7 @@ export default {
                 stage: row.stage,
                 createName: row.createName,
                 createDate: row.createTime,
-                type: row.checkCycle === 'YDKP'?'月度考评':row.checkCycle === 'JDKP'?'季度考评':'年度考评',
+                type: row.checkCycle === 'YDKP' ? '月度考评' : row.checkCycle === 'JDKP' ? '季度考评' : '年度考评',
                 year: row.year,
                 recStage: '有效'
             }
@@ -295,7 +302,7 @@ export default {
         getorganizationData(type) {
             let that = this
             let params = {
-                evaluationCycle: type ==='年度' ? 'NDKP': type ==='季度' ? 'JDKP' : 'YDKP',
+                evaluationCycle: type === '年度' ? 'NDKP' : type === '季度' ? 'JDKP' : 'YDKP',
                 organizationType: 'DWKP',
                 binSection: that.binSectionStr
             }
@@ -312,10 +319,10 @@ export default {
             let params = {
                 type: type === '年度' ? '3' : '2'
             }
-            apiGetbinsectionList(params).then(datas =>{
+            apiGetbinsectionList(params).then(datas => {
                 if (datas && datas.data) {
                     that.moduleData = datas.data
-                    that.moduleData.forEach(item =>{
+                    that.moduleData.forEach(item => {
                         let obj = {
                             id: item.id,
                             isName: item.sectionName === '新能源(光电)' ? '新能源光电' : item.sectionName === '新能源(风电)' ? '新能源风电' : item.sectionName,
@@ -341,7 +348,7 @@ export default {
             let params = {
                 type: '3'
             }
-            apiGetbinstageList(params).then(datas =>{
+            apiGetbinstageList(params).then(datas => {
                 if (datas && datas.data) {
                     that.stageData = datas.data
                     that.activeName = datas.data[0].stageCode
@@ -360,10 +367,10 @@ export default {
                 binSection: that.binSectionStr,
                 binStage: id
             }
-            apiGetEvaluationIndicatorList(params).then(datas =>{
+            apiGetEvaluationIndicatorList(params).then(datas => {
                 if (datas && datas.data) {
                     that.indicatorList = datas.data
-                    if (datas.data.length>0) {
+                    if (datas.data.length > 0) {
                         that.isClickTagId = datas.data[0].id
                         that.getTableData(that.isClickTagId)
                     }
@@ -371,7 +378,7 @@ export default {
             })
         },
         handleClick(val) {
-            this.titleMsgArr.forEach(it =>{
+            this.titleMsgArr.forEach(it => {
                 it.showClick = false
                 if (val.props.name === 'QQXM') {
                     if (it.isNameEn === 'QQ') {
@@ -402,7 +409,7 @@ export default {
             })
             console.log('val.props.name', val.props.name)
             let stageId = ''
-            this.stageData.forEach(it =>{
+            this.stageData.forEach(it => {
                 if (it.stageCode === val.props.name) {
                     stageId = it.id
                 }
@@ -417,11 +424,11 @@ export default {
                 indicatorId: id,
                 organizationShortName: that.compNameSa
             }
-            apiGetgetEvaluationInfoDataList(params).then(datas =>{
+            apiGetgetEvaluationInfoDataList(params).then(datas => {
                 if (datas && datas.data) {
                     if (datas.data.title) {
                         let header = []
-                        for(let i in datas.data.title) {
+                        for (let i in datas.data.title) {
                             let obj = {
                                 name: i,
                                 children: datas.data.title[i]
@@ -453,7 +460,7 @@ export default {
                 this.activeName = 'SCJY'
             }
             console.log('sectionA==>', data)
-            this.titleMsgArr.forEach(it =>{
+            this.titleMsgArr.forEach(it => {
                 it.showClick = false
                 if (it.isName === data.isName) {
                     it.showClick = true
@@ -461,7 +468,7 @@ export default {
                 }
             })
             let stageId = ''
-            this.stageData.forEach(it =>{
+            this.stageData.forEach(it => {
                 if (it.stageCode === this.activeName) {
                     stageId = it.id
                 }
@@ -471,15 +478,15 @@ export default {
         },
         addTableDetail() {
             console.log('表头数据11====>>>>>>>', this.monthQuarterYearHeader)
-            if (this.monthQuarterYearHeader.length>0) {
+            if (this.monthQuarterYearHeader.length > 0) {
                 let headerArr = []
-                this.monthQuarterYearHeader.forEach(item =>{
+                this.monthQuarterYearHeader.forEach(item => {
                     headerArr = headerArr.concat(item.children)
                 })
 
                 console.log('表头数据22====>>>>>>>', headerArr)
                 this.addstageId = ''
-                this.stageData.forEach(it =>{
+                this.stageData.forEach(it => {
                     if (it.stageCode === this.activeName) {
                         this.addstageId = it.id
                     }
@@ -487,11 +494,11 @@ export default {
 
                 let obj = {
                     isAdd: true,
-                    
+
                 }
-                headerArr.forEach(it =>{
+                headerArr.forEach(it => {
                     obj[it.code] = ''
-                    obj['IS_LH_'+it.code] = it.flag
+                    obj['IS_LH_' + it.code] = it.flag
                 })
                 this.monthQuarterYearData.unshift(obj)
             }
@@ -510,7 +517,7 @@ export default {
                 binStage: that.addstageId,
                 optionMap: {}
             }
-            that.monthQuarterYearData.forEach(it =>{
+            that.monthQuarterYearData.forEach(it => {
                 if (it.isAdd) {
                     addObj.organizationId = it.organizationShortName
                     addObj.optionMap = it
@@ -520,14 +527,14 @@ export default {
                 }
             })
             if (addParams.length > 0) {
-                apiPostorganizationUpdateAddEvaluationInfo(addParams).then(datas =>{
+                apiPostorganizationUpdateAddEvaluationInfo(addParams).then(datas => {
                     if (datas) {
                         that.responseData(datas)
                     }
                 })
             }
             if (saveParams.length > 0) {
-                apiPostorganizationUpdateEvaluationInfo(saveParams).then(datas =>{
+                apiPostorganizationUpdateEvaluationInfo(saveParams).then(datas => {
                     if (datas) {
                         that.responseData(datas)
                     }
@@ -551,7 +558,7 @@ export default {
         },
         saveDetail() {
             let that = this
-            apiPostorganizationUpdateEvaluationInfo(that.monthQuarterYearData).then(datas =>{
+            apiPostorganizationUpdateEvaluationInfo(that.monthQuarterYearData).then(datas => {
                 if (datas) {
                     if (datas.message === '成功') {
                         that.$message({
@@ -583,7 +590,7 @@ export default {
                 organizationEvaluationId: that.rowMsg.id,
                 indicatorId: that.isClickTagId
             }
-            apiGetExportMsg(url,params).then(datas =>{
+            apiGetExportMsg(url, params).then(datas => {
                 let blob = new Blob([datas])
                 saveAs(blob, '考评详情数据导出.xlsx')
             }).catch((r) => {
@@ -602,11 +609,11 @@ export default {
                 indicatorId: that.isClickTagId,
                 organizationId: row.organizationId
             }
-            apiGetorganizationevaluationcommoninfo(params).then(datas =>{
+            apiGetorganizationevaluationcommoninfo(params).then(datas => {
                 if (datas && datas.data) {
                     if (datas.data.title) {
                         let header = []
-                        for(let i in datas.data.title) {
+                        for (let i in datas.data.title) {
                             let obj = {
                                 name: i,
                                 children: datas.data.title[i]
@@ -620,9 +627,9 @@ export default {
             })
         },
         addTableDetailInfo() {
-            if (this.monthQuarterYearDetailHeader.length>0) {
+            if (this.monthQuarterYearDetailHeader.length > 0) {
                 let headerArr = []
-                this.monthQuarterYearDetailHeader.forEach(item =>{
+                this.monthQuarterYearDetailHeader.forEach(item => {
                     headerArr = headerArr.concat(item.children)
                 })
 
@@ -630,13 +637,13 @@ export default {
                     isAdd: true,
                     deptName: this.userMes.deptName
                 }
-                headerArr.forEach(it =>{
+                headerArr.forEach(it => {
                     if (it.flag === '1') {
                         obj[it.code] = 0
                     } else {
                         obj[it.code] = ''
                     }
-                    obj['IS_LH_'+it.code] = it.flag
+                    obj['IS_LH_' + it.code] = it.flag
                 })
                 this.monthQuarterYearDetailData.unshift(obj)
             }
@@ -644,7 +651,7 @@ export default {
         saveAddDetailInfo() {
             let that = this
             let addParams = []
-            that.monthQuarterYearDetailData.forEach(it =>{
+            that.monthQuarterYearDetailData.forEach(it => {
                 let addObj = {
                     organizationEvaluationId: that.rowMsg.id,
                     indicatorId: that.isClickTagId,
@@ -653,7 +660,7 @@ export default {
                 }
                 addParams.push(addObj)
             })
-            apiPostsaveEvaluationCommonInfo(addParams).then(datas =>{
+            apiPostsaveEvaluationCommonInfo(addParams).then(datas => {
                 if (datas) {
                     that.detailVisible = false
                     that.responseData(datas)
@@ -668,12 +675,12 @@ export default {
             }).then(() => {
                 let that = this
                 let parArr = []
-                for(let i in row) {
+                for (let i in row) {
                     if (i.indexOf('ID_') !== -1) {
                         parArr.push(row[i])
                     }
                 }
-                apiPostremoveEvaluationCommonInfo(parArr.join(',')).then(datas =>{
+                apiPostremoveEvaluationCommonInfo(parArr.join(',')).then(datas => {
                     if (datas) {
                         that.changeDetailList(that.detailMsg)
                     }
@@ -685,14 +692,16 @@ export default {
 </script>
 
 <style lang="less">
-.monthQuarterYearFrom{
-    .el-overlay{
-        .el-dialog{
+.monthQuarterYearFrom {
+    .el-overlay {
+        .el-dialog {
+
             // margin-top: 7vh;
-            .el-dialog__body{
+            .el-dialog__body {
                 padding: 0 20px !important;
-                .startDetail{
-                    .starttitleSty{
+
+                .startDetail {
+                    .starttitleSty {
                         font-size: 18px;
                         font-family: Microsoft YaHei;
                         font-weight: bold;
@@ -700,58 +709,73 @@ export default {
                         // line-height: 12px;
                         margin: 20px 0 20px 10px;
                     }
-                    .danjuMsg{
+
+                    .danjuMsg {
                         border: 1px solid #D6DBEA;
                         padding: 10px 20px;
                         border-radius: 10px;
+
                         // margin-bottom: 20px;
-                        .danjuMsg_data{
+                        .danjuMsg_data {
                             padding: 5px 0 10px 0;
-                            .data_tit{
+
+                            .data_tit {
                                 margin-right: 10px;
                                 font-weight: bold;
                                 font-size: 14px;
                                 font-family: Microsoft YaHei;
                                 color: #8991B0;
                             }
-                            .data_tit_wd{
+
+                            .data_tit_wd {
                                 display: inline-block;
                                 width: 90px;
                             }
-                            .el-form-item--small{
-                                .el-input{
+
+                            .el-form-item--small {
+                                .el-input {
                                     height: 25px;
                                     width: 160px;
                                 }
+
                                 margin-bottom: 0;
-                                .el-input-number{
+
+                                .el-input-number {
                                     height: 25px;
-                                    .el-input-number__decrease, .el-input-number__increase{
+
+                                    .el-input-number__decrease,
+                                    .el-input-number__increase {
                                         right: -39px;
                                     }
                                 }
                             }
                         }
                     }
-                    .el-select, .el-input{
+
+                    .el-select,
+                    .el-input {
                         width: 100%;
                     }
-                    .monthQuarterYear{
+
+                    .monthQuarterYear {
                         display: flex;
                         width: 100%;
                         margin-top: 20px;
-                        .tableMain{
+
+                        .tableMain {
                             width: calc(100% - 100px);
-                            .el-tabs__header{
-                                .el-tabs__nav{
-                                    .el-tabs__item{
+
+                            .el-tabs__header {
+                                .el-tabs__nav {
+                                    .el-tabs__item {
                                         font-size: 18px;
                                         font-family: Microsoft YaHei;
                                         font-weight: bold;
-                                        margin: 0 10px;                                    
+                                        margin: 0 10px;
                                         color: #8991B0;
                                     }
-                                    .is-active{
+
+                                    .is-active {
                                         font-size: 18px;
                                         font-family: Microsoft YaHei;
                                         font-weight: bold;
@@ -760,14 +784,17 @@ export default {
                                     }
                                 }
                             }
-                            .detailsHeader{
+
+                            .detailsHeader {
                                 width: 100%;
                                 display: flex;
                                 justify-content: space-between;
-                                .headerLeft{
+
+                                .headerLeft {
                                     display: flex;
                                     width: 65%;
                                     overflow-x: auto;
+
                                     .tagArr {
                                         height: 33px;
                                         margin-right: 10px;
@@ -790,40 +817,49 @@ export default {
                                         }
                                     }
                                 }
-                                .headerRight{
+
+                                .headerRight {
                                     display: flex;
                                     justify-content: end;
                                     width: 35%;
                                     margin-bottom: 5px;
-                                    .seachFor{
+
+                                    .seachFor {
                                         display: flex;
-                                        .el-input{
+
+                                        .el-input {
                                             height: 30px;
-                                            .el-input__inner{
-                                                height:30px;
+
+                                            .el-input__inner {
+                                                height: 30px;
                                             }
-                                            .el-input__suffix{
-                                                .el-select__caret{
-                                                    line-height:30px;
+
+                                            .el-input__suffix {
+                                                .el-select__caret {
+                                                    line-height: 30px;
                                                 }
                                             }
                                         }
-                                        .el-icon{
+
+                                        .el-icon {
                                             margin: 5px 10px 0 10px;
                                             cursor: pointer;
                                         }
                                     }
+
                                     .tableBtn {
                                         display: flex;
                                         height: 20px;
                                         margin: 5px 8px 0 8px;
                                         // width: 20%;
                                         width: fit-content;
-                                        img{
+
+                                        img {
                                             margin-right: 5px;
                                             margin-top: 1px;
                                         }
-                                        span{
+
+                                        span {
                                             display: inline-block;
                                             width: 35px;
                                             font-size: 14px;
@@ -831,51 +867,63 @@ export default {
                                             font-weight: 400;
                                         }
                                     }
-                                    .add{
+
+                                    .add {
                                         cursor: pointer;
-                                        span{
+
+                                        span {
                                             color: #3B7AD1;
                                         }
                                     }
-                                    .save{
+
+                                    .save {
                                         cursor: pointer;
-                                        span{
+
+                                        span {
                                             color: #50C14E;
                                         }
                                     }
-                                    .import{
+
+                                    .import {
                                         cursor: pointer;
-                                        span{
+
+                                        span {
                                             color: #ce1e78;
                                         }
                                     }
-                                    .export{
+
+                                    .export {
                                         cursor: pointer;
-                                        span{
+
+                                        span {
                                             color: #2baa8a;
                                         }
                                     }
                                 }
                             }
+
                             .el-table {
-                                .indicitem{
+                                .indicitem {
                                     color: #409EFF;
                                     font-size: 12px;
                                     margin-right: 20px;
-                                    cursor:pointer;
-                                    &:hover{
+                                    cursor: pointer;
+
+                                    &:hover {
                                         text-decoration: underline;
                                     }
                                 }
-                                .el-table__header-wrapper{
-                                    .el-table__header{
+
+                                .el-table__header-wrapper {
+                                    .el-table__header {
                                         .el-table__cell {
                                             border-bottom: none !important;
                                         }
-                                        thead{
-                                            tr{
-                                                th{
-                                                    .cell{
+
+                                        thead {
+                                            tr {
+                                                th {
+                                                    .cell {
                                                         line-height: 16px;
                                                     }
                                                 }
@@ -883,25 +931,31 @@ export default {
                                         }
                                     }
                                 }
+
                                 .el-table__body-wrapper {
                                     height: 47vh !important;
-                                    .el-scrollbar{
-                                        .el-table__body{
+
+                                    .el-scrollbar {
+                                        .el-table__body {
                                             .error-row {
                                                 --el-table-tr-bg-color: #fdecec;
-                                                &:hover > td{
+
+                                                &:hover>td {
                                                     background: #fdecec !important;
                                                 }
                                             }
-                                            .tr{
-                                                td{
+
+                                            .tr {
+                                                td {
                                                     padding: 0;
-                                                    .cell{
+
+                                                    .cell {
                                                         // background: #F6F7FA;
                                                         line-height: 47px;
                                                         height: 47px;
                                                     }
                                                 }
+
                                                 td:hover {
                                                     line-height: 45px;
                                                     height: 45px;
@@ -910,13 +964,15 @@ export default {
                                         }
                                     }
                                 }
-                                .el-table--border .el-table__cell{
+
+                                .el-table--border .el-table__cell {
                                     border: none;
                                 }
-                                .el-table thead.is-group th.el-table__cell{
+
+                                .el-table thead.is-group th.el-table__cell {
                                     background: transparent;
                                 }
-                
+
                                 .tooltipCC {
                                     width: 180px;
                                     display: inline-block;
@@ -925,13 +981,15 @@ export default {
                                     white-space: nowrap;
                                 }
                             }
+
                             .el-pagination {
                                 margin-top: 20px;
                                 text-align: end;
                                 position: relative;
                             }
                         }
-                        .tableSeach{
+
+                        .tableSeach {
                             width: 88px;
                             height: 63vh;
                             margin-left: 10px;
@@ -940,21 +998,25 @@ export default {
                             padding: 5px 0;
                             border-radius: 5px;
                             overflow-y: auto;
-                            .seachType{
+
+                            .seachType {
                                 width: 78px;
                                 height: 78px;
                                 cursor: pointer;
                                 border-left: 3px solid transparent;
-                                img{
+
+                                img {
                                     margin-top: 17px;
                                     margin-left: 27px;
                                 }
-                                p{
+
+                                p {
                                     text-align: center;
                                     font-size: 14px;
                                 }
                             }
-                            .seachTypeCha{
+
+                            .seachTypeCha {
                                 background: #E6EBF5;
                                 cursor: pointer;
                                 border-left: 3px solid #3B7AD1;
@@ -962,21 +1024,25 @@ export default {
                         }
                     }
                 }
-                .detailSeach{
+
+                .detailSeach {
                     display: flex;
                     justify-content: flex-end;
                     margin: 15px 0;
+
                     .tableBtn {
                         display: flex;
                         height: 20px;
                         margin: 5px 8px 0 8px;
                         // width: 20%;
                         width: fit-content;
-                        img{
+
+                        img {
                             margin-right: 5px;
                             margin-top: 1px;
                         }
-                        span{
+
+                        span {
                             display: inline-block;
                             width: 35px;
                             font-size: 14px;
@@ -984,36 +1050,44 @@ export default {
                             font-weight: 400;
                         }
                     }
-                    .add{
+
+                    .add {
                         cursor: pointer;
-                        span{
+
+                        span {
                             color: #3B7AD1;
                         }
                     }
-                    .save{
+
+                    .save {
                         cursor: pointer;
-                        span{
+
+                        span {
                             color: #50C14E;
                         }
                     }
                 }
+
                 .el-table {
-                    .indicitem{
+                    .indicitem {
                         color: #409EFF;
                         font-size: 12px;
                         margin-right: 20px;
-                        cursor:pointer;
-                        &:hover{
+                        cursor: pointer;
+
+                        &:hover {
                             text-decoration: underline;
                         }
                     }
                 }
             }
-            .el-dialog__footer{
-                .dialog-footer{
+
+            .el-dialog__footer {
+                .dialog-footer {
                     display: flex;
                     justify-content: center;
-                    .el-button{
+
+                    .el-button {
                         width: 180px !important;
                         height: 40px !important;
                     }
@@ -1021,6 +1095,5 @@ export default {
             }
         }
     }
-    
-}
-</style>
+
+}</style>

+ 125 - 95
src/components/importPage/importDailog.vue

@@ -4,7 +4,7 @@
         <!-- :limit="1" -->
         <el-upload ref="upload" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.processurl + upload.url"
             :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
-            :on-error="handleFileError" :auto-upload="false" :data="upload.data" drag>
+            :on-error="handleFileError" :auto-upload="false" :data="upload.data" :on-change="test" drag>
             <i class="el-icon-upload"></i>
             <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
             <template #tip>
@@ -25,113 +25,143 @@
 </template>
 
 <script>
-    import baseUrl from '../../utils/baseUrl.js'
-    import {
-        apiGetExportMsg
-    } from '../../api/api'
-    import {
-        saveAs
-    } from 'file-saver'
-    import {
-        getToken
-    } from '@/api/auth'
-    export default {
-        data() {
-            return {
-                // 用户导入参数
-                upload: {
-                    data: null,
-                    // 展示下载模板
-                    showModel: false,
-                    // 是否显示弹出层(用户导入)
-                    open: false,
-                    // 弹出层标题(用户导入)
-                    title: "",
-                    // 是否禁用上传
-                    isUploading: false,
-                    // 是否更新已经存在的用户数据
-                    updateSupport: 0,
-                    // 设置上传的请求头部
-                    headers: {
-                        // Authorization: "Bearer ",
-                        token: getToken()
-                    },
-                    // 上传的地址
-                    // processurl: (process.env.NODE_ENV === 'production') ? process.env.PRO_BASE_API : process.env.BASE_API,
-                    processurl: process.env.NODE_ENV === "production" ? baseUrl.ROOT : baseUrl.ROOT,
-                    url: '',
-                    // 上传模板名称
-                    urlName: '',
-                    // 上传文件名称
-                    proName: ''
+import baseUrl from '../../utils/baseUrl.js'
+import {
+    apiGetExportMsg
+} from '../../api/api'
+
+import {
+    saveAs
+} from 'file-saver'
+import {
+    getToken
+} from '@/api/auth'
+
+import axios from "axios";
+import { ElMessage } from 'element-plus'
+export default {
+    data() {
+        return {
+            // 用户导入参数
+            upload: {
+                data: null,
+                // 展示下载模板
+                showModel: false,
+                // 是否显示弹出层(用户导入)
+                open: false,
+                // 弹出层标题(用户导入)
+                title: "",
+                // 是否禁用上传
+                isUploading: false,
+                // 是否更新已经存在的用户数据
+                updateSupport: 0,
+                // 设置上传的请求头部
+                headers: {
+                    // Authorization: "Bearer ",
+                    token: getToken()
                 },
-                showModelObj: {
-                    url: '',
-                    name: ''
+                // 上传的地址
+                // processurl: (process.env.NODE_ENV === 'production') ? process.env.PRO_BASE_API : process.env.BASE_API,
+                processurl: process.env.NODE_ENV === "production" ? baseUrl.ROOT : baseUrl.ROOT,
+                url: '',
+                // 上传模板名称
+                urlName: '',
+                // 上传文件名称
+                proName: ''
+            },
+            showModelObj: {
+                url: '',
+                name: ''
+            },
+            selectFile: null,
+            binSection: "",
+            year: "",
+        }
+    },
+    methods: {
+        /** 下载模板操作 */
+        importTemplate() {
+            let url = this.showModelObj.url
+            apiGetExportMsg(url).then(datas => {
+                let blob = new Blob([datas])
+                saveAs(blob, `${this.showModelObj.name}.xlsx`)
+            }).catch((r) => {
+                console.error(r)
+            })
+        },
+        // 文件上传中处理
+        handleFileUploadProgress(event, file, fileList) {
+            this.upload.isUploading = true;
+            this.$emit('importLoading', true)
+
+        },
+        // 文件上传成功处理
+        handleFileSuccess(response, file, fileList) {
+            this.upload.open = false;
+            this.upload.isUploading = false;
+            this.$refs.upload.clearFiles();
+            // this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+            if (!response.success) {
+                if (response.message.indexOf('运行时异常') !== -1) {
+                    this.$message.error('模板数据不匹配,请使用模板导入');
+                    this.importTemplate()
+                } else {
+                    this.$message.error(response.message);
                 }
+            } else {
+                this.$message({
+                    message: response.message,
+                    type: 'success'
+                });
+                this.$emit('successImport', response)
             }
+            // this.getList();
         },
-        methods: {
-            /** 下载模板操作 */
-            importTemplate() {
-                let url = this.showModelObj.url
-                apiGetExportMsg(url).then(datas => {
-                    let blob = new Blob([datas])
-                    saveAs(blob, `${this.showModelObj.name}.xlsx`)
-                }).catch((r) => {
-                    console.error(r)
-                })
-            },
-            // 文件上传中处理
-            handleFileUploadProgress(event, file, fileList) {
-                this.upload.isUploading = true;
-                this.$emit('importLoading', true)
-            },
-            // 文件上传成功处理
-            handleFileSuccess(response, file, fileList) {
+        handleFileError(response, file, fileList) {
+            this.$message.error(response.msg);
+        },
+        // 提交上传文件
+        submitFileForm() {
+            // this.$refs.upload.submit();
+            this.upload.isUploading = true;
+            this.$emit('importLoading', true)
+
+            const formData = new FormData();
+            formData.append("file", this.selectFile);
+            formData.append("binSection", this.binSection);
+            formData.append("year", this.year);
+            axios.post(`${this.upload.processurl}${this.upload.url}`, formData, {
+                headers: {
+                    "Content-Type": "application/octet-stream"
+                }
+            }).then(res => {
+                ElMessage[res.data.success ? "success" : "error"](res.data.code === 200 ? "导入成功" : (res.data.message || "请求出错"));
                 this.upload.open = false;
                 this.upload.isUploading = false;
                 this.$refs.upload.clearFiles();
-                // this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
-                if (!response.success) {
-                    if (response.message.indexOf('运行时异常') !== -1) {
-                        this.$message.error('模板数据不匹配,请使用模板导入');
-                        this.importTemplate()
-                    } else {
-                        this.$message.error(response.message);
-                    }
-                } else {
-                    this.$message({
-                        message: response.message,
-                        type: 'success'
-                    });
-                    this.$emit('successImport', response)
-                }
-                // this.getList();
-            },
-            handleFileError(response, file, fileList) {
-                this.$message.error(response.msg);
-            },
-            // 提交上传文件
-            submitFileForm() {
-                this.$refs.upload.submit();
-            }
-        }
+                this.$emit('successImport', res)
+            });
+        },
+
+        test(file) {
+            this.selectFile = file.raw;
+        },
     }
+}
 </script>
 
 <style lang="less">
-    .el-overlay {
-        .el-dialog {
-            .el-dialog__header {
-                .el-dialog__title {
-                    font-size: 14px;
-                }
+.el-overlay {
+    .el-dialog {
+        .el-dialog__header {
+            .el-dialog__title {
+                font-size: 14px;
             }
+        }
 
-            .el-dialog__body {
-                padding: 20px;
-            }
+        .el-dialog__body {
+            padding: 20px;
         }
     }
+}
 </style>

+ 6 - 4
src/utils/baseUrl.js

@@ -10,16 +10,18 @@ switch (process.env.NODE_ENV) {
     case 'development': 
         baseUrl.ROOT = "/api"  //开发环境url
         // baseUrl.URL = "http://10.65.59.67:28800"
-        baseUrl.URL = "http://192.168.2.127:28800"
+         baseUrl.URL = "http://127.0.0.1:28800"
         // baseUrl.URL = "http://10.65.78.23:28800"  //测试环境
-        // baseUrl.URL = "http://10.65.78.81:28800"  // 正式环境
+        //baseUrl.URL = "http://10.65.78.81:28800"  // 正式环境
         break
  
     case 'production': 
         // baseUrl.ROOT = "http://123.60.219.66:28800/"
-        // baseUrl.ROOT = "http://10.65.78.23:28800/" //测试环境
-        baseUrl.ROOT = "http://10.65.78.81:28800/"  // 正式环境
+        baseUrl.ROOT = "http://10.65.78.23:28800/" //测试环境
+        // baseUrl.ROOT = "http://10.65.78.81:28800/"  // 正式环境
         break 
+        // testrsadmin
+        // Gddl!#%1356
 }
 
 module.exports = baseUrl