Переглянути джерело

单位月度考评,单位季度考评,单位年度考评详情页面根据甲方需求进行重新设计并开发,与后端服务联调(进行中);
本部部门业绩考核详情页面功能修改;

SunZehao 1 рік тому
батько
коміт
3c88c6f8d7

+ 5 - 0
src/api/api.js

@@ -653,6 +653,11 @@ export function apiPostorganizationUpdateEvaluationInfo(params) {
     return httpRequest.post('organization-evaluation-info/updateEvaluationInfo', params)
 }
 
+//单位月季年详情-----新增
+export function apiPostorganizationUpdateAddEvaluationInfo(params) {
+    return httpRequest.post('organization-evaluation-info/addEvaluationInfo', params)
+}
+
 
 
 //----------------------------------------考评体系配置------------------------------------------------

+ 15 - 2
src/components/assessment/assessmentApplicationFrom.vue

@@ -82,7 +82,11 @@
                                     </el-select>
                                 </template>
                             </el-table-column>
-                            <el-table-column label="人员编号" prop="employeeNo" />
+                            <el-table-column label="人员编号" prop="employeeNo">
+                                <template #default="scope">
+                                    <el-input v-model="scope.row.employeeNo" @blur="employeeNoInputBlur(scope.row.employeeNo, scope.row)" />
+                                </template>
+                            </el-table-column>
                             <el-table-column label="建议值">
                                 <template #default="scope">
                                     <el-input-number v-model="scope.row.suggestedValue" :precision="2" :step="0.1" :min="0" />
@@ -246,11 +250,19 @@ export default {
                 }
             })
         },
+        employeeNoInputBlur(val, row) {
+            this.deptLeaderOptionDet.forEach(it =>{
+                if (val === it.no) {
+                    row.employeeId = it.id
+                }
+            })
+        },
         addTableDetail() {
             let obj = {
                 showInput: true,
                 businessPlanId: this.rowMsg.id,
                 employeeId: '',
+                employeeNo: '',
                 baseScore: 0,
                 serialNumber: 0
             }
@@ -272,7 +284,7 @@ export default {
                     assessmentDeclarationId: that.rowMsg.id,
                     employeeId: item.employeeId,
                     employeeName: emName,
-                    employeeNo: emNo,
+                    employeeNo: item.employeeNo ? item.employeeNo : emNo,
                     suggestedValue: item.suggestedValue.toString(),
                     serialNumber: item.serialNumber
                 }
@@ -315,6 +327,7 @@ export default {
             colums = [
                 { header: 'ID', key: 'id', width: 26 },
                 { header: '申报ID', key: 'assessmentDeclarationId', width: 26 },
+                { header: '人员编号', key: 'employeeNo', width: 26 },
                 { header: '员工ID', key: 'employeeId', width: 26 },
                 { header: '员工名称', key: 'employeeName', width: 26 },
                 { header: '序号', key: 'serialNumber', width: 26 },

+ 107 - 12
src/components/assessment/monthQuarterYearFrom.vue

@@ -56,11 +56,17 @@
                                     </el-tag>
                                 </div>
                                 <div class="headerRight">
-                                    <div class="tableBtn add" @click="addTableDetail" v-if="activeName === 'ZDZX' || activeName === 'GLSX'">
+                                    <div class="tableBtn add" @click="addTableDetail"
+                                     v-if="(activeName === 'ZDZX' || activeName === 'GLSX') && indicatorList.length > 0">
                                         <img :src="addIcon" alt="">
                                         <span>新增</span>
                                     </div>
-                                    <div class="tableBtn save" @click="saveDetail">
+                                    <div class="tableBtn save" @click="saveAddDetail"
+                                    v-if="(activeName === 'ZDZX' || activeName === 'GLSX') && indicatorList.length > 0">
+                                        <img :src="saveIcon" alt="">
+                                        <span>保存</span>
+                                    </div>
+                                    <div class="tableBtn save" @click="saveDetail" v-else>
                                         <img :src="saveIcon" alt="">
                                         <span>保存</span>
                                     </div>
@@ -80,12 +86,8 @@
                                 <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">
                                         <template #default="scope">
-                                            <!-- <span
-                                            style="font-weight: bold"
-                                            :style="scope.row[iv.code+'_flag'] === '1'?'color:#3B7AD1': scope.row[iv.code+'_flag'] === '-1'?'color:#F65177':'color:#666666'">
-                                            {{scope.row[iv.code]}}
-                                            </span> -->
-                                            <el-input-number v-model="scope.row[iv.code]" :min="0" />
+                                            <el-input v-model="scope.row[iv.code]" v-if="!scope.row['IS_LH_'+iv.code]"></el-input>
+                                            <el-input-number v-model="scope.row[iv.code]" v-else />
                                         </template>
                                     </el-table-column>
                                 </el-table-column>
@@ -115,7 +117,7 @@
 <script>
 import importDailog from '../importPage/importDailog.vue'
 import {apiGetEvaluationIndicatorList,apiGetgetEvaluationInfoDataList,apiGetbinsectionList, apiGetbinstageList,
-apiPostorganizationUpdateEvaluationInfo} from '../../api/api'
+apiPostorganizationUpdateEvaluationInfo, apiPostorganizationUpdateAddEvaluationInfo} from '../../api/api'
 import * as XLSX from 'xlsx'
 import { saveAs } from 'file-saver'
 import  * as XLSXD from 'xlsx-js-style'
@@ -170,6 +172,8 @@ export default {
             saveIcon: saveIcon,
             exportIcon: exportIcon,
             importIcon: importIcon,
+            addstageId: '',
+            userMes: {}
         }
     },
     created() {
@@ -187,6 +191,8 @@ export default {
                 year: row.year,
                 recStage: '有效'
             }
+            
+            this.userMes = JSON.parse(window.sessionStorage.getItem('user'))
             this.getModelData(type)
             this.rowMsg = row
         },
@@ -265,8 +271,9 @@ export default {
         //获取指标数据
         getTableHeaderData(id) {
             let that = this
-            this.monthQuarterYearHeader = []
-            this.monthQuarterYearData = []
+            that.monthQuarterYearHeader = []
+            that.monthQuarterYearData = []
+            that.isClickTagId = ''
             let params = {
                 organizationEvaluationId: that.rowMsg.id,
                 binSection: that.binSectionStr,
@@ -337,10 +344,98 @@ export default {
             })
             this.getTableHeaderData(stageId)
         },
+        addTableDetail() {
+            console.log('表头数据11====>>>>>>>', this.monthQuarterYearHeader)
+            if (this.monthQuarterYearHeader.length>0) {
+                let headerArr = []
+                this.monthQuarterYearHeader.forEach(item =>{
+                    headerArr = headerArr.concat(item.children)
+                })
+
+                console.log('表头数据22====>>>>>>>', headerArr)
+                this.addstageId = ''
+                this.stageData.forEach(it =>{
+                    if (it.stageCode === this.activeName) {
+                        this.addstageId = it.id
+                    }
+                })
+
+                let obj = {
+                    isAdd: true,
+                    
+                }
+                headerArr.forEach(it =>{
+                    obj[it.code] = ''
+                    obj['IS_LH_'+it.code] = it.flag
+                })
+                this.monthQuarterYearData.unshift(obj)
+            }
+            console.log('表格数据====>>>>>>>', this.monthQuarterYearData)
+        },
+        saveAddDetail() {
+            let that = this
+            let addParams = []
+            let saveParams = []
+            let addObj = {
+                organizationId: that.userMes.unitId,
+                // organizationId: "23079300",
+                organizationEvaluationId: that.rowMsg.id,
+                indicatorId: that.isClickTagId,
+                binSection: that.binSectionStr,
+                binStage: that.addstageId,
+                optionMap: {}
+            }
+            that.monthQuarterYearData.forEach(it =>{
+                if (it.isAdd) {
+                    addObj.optionMap = it
+                    addParams.push(addObj)
+                } else {
+                    saveParams.push(it)
+                }
+            })
+            apiPostorganizationUpdateAddEvaluationInfo(addParams).then(datas =>{
+                if (datas) {
+                    that.responseData(datas)
+                }
+            })
+            if (saveParams.length > 0) {
+                apiPostorganizationUpdateEvaluationInfo(saveParams).then(datas =>{
+                    if (datas) {
+                        that.responseData(datas)
+                    }
+                })
+            }
+        },
+        // 返回数据
+        responseData(datas) {
+            if (datas.message === '成功') {
+                this.$message({
+                    message: '考评详情信息保存成功',
+                    type: 'success'
+                });
+            } else {
+                this.$message({
+                    message: datas.message,
+                    type: 'error'
+                });
+            }
+            this.getTableData(this.isClickTagId)
+        },
         saveDetail() {
             let that = this
             apiPostorganizationUpdateEvaluationInfo(that.monthQuarterYearData).then(datas =>{
                 if (datas) {
+                    if (datas.message === '成功') {
+                        that.$message({
+                            message: '考评详情信息保存成功',
+                            type: 'success'
+                        });
+                    } else {
+                        that.$message({
+                            message: datas.message,
+                            type: 'error'
+                        });
+                    }
                     that.getTableData(that.isClickTagId)
                 }
             })
@@ -348,7 +443,7 @@ export default {
         handleImport() {
             this.$refs.importPage.upload.title = "考评详情信息导入"
             this.$refs.importPage.upload.open = true
-            this.$refs.importPage.upload.url = '/organization-evaluation-info/import'
+            this.$refs.importPage.upload.url = '/organization-evaluation-info/import-excel'
         },
         successImport(val) {
             that.getTableData(that.isClickTagId)