From 9645430a4b48159a722ffeebfe58a2cf2f6c6020 Mon Sep 17 00:00:00 2001
From: lxp <1928192722@qq.com>
Date: 星期一, 10 三月 2025 15:28:38 +0800
Subject: [PATCH] 绩效管理代码搬迁
---
src/views/performance/staffEvaluate/index.vue | 222 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 219 insertions(+), 3 deletions(-)
diff --git a/src/views/performance/staffEvaluate/index.vue b/src/views/performance/staffEvaluate/index.vue
index 4a04173..bbfd6a3 100644
--- a/src/views/performance/staffEvaluate/index.vue
+++ b/src/views/performance/staffEvaluate/index.vue
@@ -1,9 +1,225 @@
<template>
- <div>浜哄憳鑰冭瘎</div>
+ <div class="personnel-evaluation">
+ <basicContainer>
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">鏈堜唤锛�</div>
+ <div class="search_input">
+ <el-date-picker
+ v-model="entity.month"
+ format="yyyy-MM"
+ placeholder="閫夋嫨鏈�"
+ size="small"
+ type="month"
+ value-format="yyyy-MM"
+ @change="refreshTable()">
+ </el-date-picker>
+ </div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">瀹為獙瀹わ細</div>
+ <div class="search_input">
+ <el-select v-model="entity.departLims" placeholder="鍏ㄩ儴" size="small" @change="refreshTable()">
+ <el-option v-for="item in laboratoryList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">浜哄憳鍚嶇О锛�</div>
+ <div class="search_input"><el-input v-model="entity.name" clearable placeholder="璇疯緭鍏�"
+ size="small" @keyup.enter.native="refreshTable()"></el-input></div>
+ </div>
+ <div class="search_thing" style="padding-left: 30px;">
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+ </div>
+ </div>
+ <div class="tabs" style="margin-top: 10px;">
+ <el-radio-group v-model="tabValue" size="small" >
+ <el-radio-button v-hasPermi="['staffEvaluate:evaluation:list']" label="evaluation">鑰冭瘎</el-radio-button>
+ <el-radio-button v-hasPermi="['staffEvaluate:employeeMutualEvaluation:list']" label="employeeMutualEvaluation">鍛樺伐浜掕瘎</el-radio-button>
+ <el-radio-button v-hasPermi="['staffEvaluate:leaderRate:list']" label="leaderRate">缁勯暱璇勫垎</el-radio-button>
+ <el-radio-button v-hasPermi="['staffEvaluate:supervisorRate:list']" label="supervisorRate">涓荤鎵撳垎</el-radio-button>
+ </el-radio-group>
+ <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">瀵� 鍑�</el-button>
+ </div>
+
+ </basicContainer>
+
+
+ <div class="table">
+ <component :is="tabValue" v-if="laboratoryList.length>0" ref="component" :entity="entity"></component>
+ </div>
+ </div>
</template>
<script>
-export default {};
+ import evaluation from '../staffEvaluate/evaluation.vue'
+import employeeMutualEvaluation from '../staffEvaluate/employee-mutual-evaluation.vue'
+import leaderRate from '../staffEvaluate/leader-rate.vue'
+import supervisorRate from '../staffEvaluate/supervisor-rate.vue'
+
+import {
+ obtainItemParameterList,
+ exportEvaluate,
+ exportEvaluateLeader,
+ exportEvaluateCompetent
+} from '../../../api/cnas/performance/staffEvaluate'
+
+export default {
+ components: {
+ evaluation,
+ employeeMutualEvaluation,
+ leaderRate,
+ supervisorRate,
+ },
+ data(){
+ return{
+ // isPermission: isPermission,
+ entity:{
+ month:new Date().getFullYear()+'-'+((new Date().getMonth() + 1) < 10 ? '0'+(new Date().getMonth() + 1):(new Date().getMonth() + 1)),
+ departLims:'',
+ name:''
+ },
+ tabValue:'evaluation',
+ laboratoryList:[],
+ outLoading:false,
+ copyEntity:null
+ }
+ },
+ created(){
+ this.obtainItemParameterList()
+ this.tabValue = this.initTabValueByPermissions()
+ },
+ methods: {
+ initTabValueByPermissions(){
+ // const per1 = this.isPermission('page')//鏌ヨ鑰冭瘎
+ // const per2 = this.isPermission('getEvaluateGroup')//鍛樺伐浜掕瘎
+ // const per3 = this.isPermission('getEvaluateLeader')//缁勯暱璇勫垎
+ // const per4 = this.isPermission('getEvaluateCompetent')//涓荤鎵撳垎
+ // return per1?'evaluation':per2?'employeeMutualEvaluation':per3?'leaderRate':per4?'supervisorRate':''
+
+ return 'evaluation'
+ },
+ refreshTable(){
+ this.$refs.component.refreshTable()
+ },
+ refresh(){
+ this.entity = this.HaveJson(this.copyEntity)
+ this.$refs.component.refresh()
+ },
+ obtainItemParameterList() {
+ obtainItemParameterList().then(res => {
+ let data = []
+ res.data.forEach(a => {
+ data.push({
+ label: a.laboratoryName,
+ value: a.laboratoryName
+ })
+ })
+ this.laboratoryList = data
+ this.entity.departLims = data[0].value
+ this.copyEntity = this.HaveJson(this.entity)
+ })
+ },
+ handleDown(){
+ let url = null;
+ let title = ''
+ if(this.tabValue=='evaluation'){
+ url = exportEvaluate
+ title = '鑰冭瘎琛�'
+ }else if(this.tabValue=='employeeMutualEvaluation'){
+ url = exportEvaluate
+ title = '鑰冭瘎琛�'
+ }else if(this.tabValue=='leaderRate'){
+ url = exportEvaluateLeader
+ title = '缁勯暱璇勫垎琛�'
+ }else if(this.tabValue=='supervisorRate'){
+ url = exportEvaluateCompetent
+ title = '涓荤璇勫垎琛�'
+ }
+ let entity = {...this.entity}
+ this.outLoading = true
+ url(entity).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res],{ type: 'application/octet-stream' });
+ //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆
+ let reader = new FileReader();
+ reader.readAsText(blob, 'utf-8');
+ reader.onload = () => {
+ try {
+ let result = JSON.parse(reader.result);
+ if (result.message) {
+ this.$message.error(result.message);
+ } else {
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = entity.departLims+'-'+entity.month+title+'.xlsx';
+ link.click();
+ this.$message.success('瀵煎嚭鎴愬姛')
+ }
+ } catch (err) {
+ console.log(err);
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = entity.departLims+'-'+entity.month+title+'.xlsx';
+ link.click();
+ this.$message.success('瀵煎嚭鎴愬姛')
+ }
+ }
+ })
+ },
+ }
+}
</script>
-<style></style>
+<style scoped>
+.personnel-evaluation {
+ height: 100%;
+ overflow-y: auto;
+}
+.title {
+ height: 60px;
+ line-height: 60px;
+}
+.search {
+ background-color: #ffffff;
+ height: 80px;
+ display: flex;
+ align-items: center;
+ margin-top: 20px;
+ }
+
+ .search_thing {
+ width: 350px;
+ display: flex;
+ align-items: center;
+ }
+
+ .search_label {
+ width: 110px;
+
+ font-size: 14px;
+ text-align: right;
+ }
+
+ .search_input {
+ width: calc(100% - 110px);
+ }
+ .tabs{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ }
+ .table {
+ margin-top: 10px;
+ background-color: #ffffff;
+ width: calc(100% - 40px);
+ height: calc(100% - 60px - 80px - 10px - 42px);
+ padding: 20px;
+ }
+</style>
+
--
Gitblit v1.9.3