Forráskód Böngészése

财务人事绩效,固定任务管理页面及接口调用

liuhj 1 hete%!(EXTRA string=óta)
szülő
commit
3c7aebe96f

+ 161 - 0
src/components/OP/SpecialPerformance.vue

@@ -0,0 +1,161 @@
+<template>
+    <div class="SPerformance-all" v-loading.fullscreen.lock="SPLoading">
+        <div class="SPerformance-Search">
+            <div class="SPerformance-Search-ul">
+                <div class="SPerformance-Search-li">
+                    <label>选择月份:</label>
+                    <el-date-picker @change="CompanyDailyKpiInfo" size="small" style="width:200px" v-model="months" type="month" placeholder="选择月">
+                    </el-date-picker>
+                </div>
+                <div class="SPerformance-Search-li">
+                    <label>人员名称:</label>
+                    <el-select @change="CompanyDailyKpiInfo" size="small" style="width:200px" v-model="value" filterable placeholder="请选择">
+                        <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id">
+                        </el-option>
+                    </el-select>
+                </div>
+            </div>
+             <el-button @click="CompanyDailyKpiSave" size="small" type="primary">保存</el-button>
+        </div>
+        <div class="SPerformance-Search-table">
+            <el-table :data="tableData" border style="width: 100%">
+                <el-table-column prop="evalContentOrder" label="序号" width="80">
+                </el-table-column>
+                <el-table-column prop="evalContent" label="工作内容">
+                </el-table-column>
+                <el-table-column prop="name" label="工作是否失误" width="100">
+                    <template slot-scope="scope">
+                        <el-checkbox v-model="scope.row.isMistake"></el-checkbox>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="address" label="失误原因描述">
+                    <template slot-scope="scope">
+                        <el-input style="width:100%" v-model="scope.row.mistakeReason" type="textarea" :rows="2" placeholder="请输入内容"></el-input>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    data () {
+        return {
+            userId:'',
+            months:new Date(),
+            value:'',
+            options:[],
+            tableData: [],
+            SPLoading:false,
+        }
+    },
+    methods: {
+        //获取人员名单
+        CompanyDailyKpiInit() {
+            var url = "/api/PersonnelModule/CompanyDailyKpiInit";
+            var that = this;
+            this.$axios({
+                method: 'get',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    that.options=res.data.data;
+                    if(that.value==''){
+                        that.value=that.options[0].id;
+                    }
+                    that.CompanyDailyKpiInfo();
+                } else {
+                    that.$message.error(res.data.msg);
+                }
+            })
+        },
+        //处理日期
+        datetime(val){
+            var date=new Date(val);
+            var y=date.getFullYear();
+            var m=date.getMonth()+1>=10?date.getMonth()+1:'0'+(date.getMonth()+1).toString();
+            var d=date.getDate()>=10?date.getDate():'0'+(date.getDate()).toString();
+            return y+'-'+m
+        },
+        //获取任务明细
+        CompanyDailyKpiInfo() {
+            this.SPLoading=true;
+            if (this.months==''||this.months==null){
+                this.$message.error('请选择月份!');
+                return
+            }
+            var url = "/api/PersonnelModule/CompanyDailyKpiInfo?month="+this.datetime(this.months)+"&evaluator="+this.value;
+            var that = this;
+            this.$axios({
+                method: 'get',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    that.tableData=res.data.data;
+                    that.SPLoading=false;
+                } else {
+                    that.SPLoading=false;
+                    that.$message.error(res.data.msg);
+                }
+            })
+        },
+        //保存任务
+        CompanyDailyKpiSave() {
+            this.SPLoading=true;
+            var url = "/api/PersonnelModule/CompanyDailyKpiSave";
+            var that = this;
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data:{
+                    currUserId:that.userId,
+                    infos:that.tableData
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    that.$message.success(res.data.msg);
+                    that.CompanyDailyKpiInfo();
+                } else {
+                    that.SPLoading=false;
+                    that.$message.error(res.data.msg);
+                }
+            })
+        },
+    },
+    mounted() {
+        this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
+        this.CompanyDailyKpiInit();
+    }
+}
+</script>
+<style>
+.SPerformance-all {
+    background-color: #fff;
+    padding: 10px;
+    box-shadow: 0 0 5px #0005;
+    border-radius: 10px;
+    min-height: 780px;
+}
+.SPerformance-Search{
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 20px;
+}
+.SPerformance-Search-ul{
+    display: flex;
+    align-items: center;
+}
+.SPerformance-Search-li{
+    margin-right: 20px;
+}
+</style>

+ 83 - 2
src/components/OP/performanceanalysis.vue

@@ -298,10 +298,13 @@ export default {
             if (val.depName=='市场部') {
                 this.AiPerformanceAnalysis_JobMarketingFileDown(this.datetime(this.months[0]),this.datetime(this.months[1]),val);
                 // this.AiPerformanceAnalysis_JobMarketingFileDown(new_year,new_month,val);
-            }else if(val.depName=='国交部'||val.depName=='信息部'){
+                return
+            }else if(val.depName=='国交部'||val.depName=='信息部'||val.depName=='财务部'||val.depName=='人事部'){
                 this.AiPerformanceAnalysis_GuojiaoFileDown(this.datetime(this.months[0]),this.datetime(this.months[1]),val);
                 // this.AiPerformanceAnalysis_GuojiaoFileDown(new_year,new_month,val);
+                return
             }
+            this.$message.error('正在开发中!');
         },
         //查看
         AiPerformanceAnalysis_Query(val){
@@ -476,7 +479,7 @@ export default {
                 }
             })
         },
-         //生成信息部绩效
+        //生成信息部绩效
         AiPerformanceAnalysis_InformationDepartment(val){
             var url = "/api/PersonnelModule/AiPerformanceAnalysis_InformationDepartment?userId="+val.id+"&start="+this.datetime(this.months[0])+"&end="+this.datetime(this.months[1])+"&createUserId="+this.userId
             var that = this
@@ -501,6 +504,56 @@ export default {
                 }
             })
         },
+        //生成财务部绩效
+        AiPerformanceAnalysis_FinancialDepartment(val){
+            var url = "/api/PersonnelModule/AiPerformanceAnalysis_FinancialDepartment?userId="+val.id+"&start="+this.datetime(this.months[0])+"&end="+this.datetime(this.months[1])+"&createUserId="+this.userId
+            var that = this
+            this.$axios({
+                method: 'get',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                }
+            }).then(function (res) {
+                if(res.data.code==200){
+                    that.performanLoading=false;
+                    that.AIVisible=true;
+                    if (that.$marked && typeof that.$marked === 'function') {
+                        that.marktext = that.$marked(res.data.data.answer+that.texehr);
+                        that.marktexts = that.$marked(res.data.data.kaoqinAnswer);
+                    }
+                    that.AiPerformanceAnalysis_UserList();
+                }else{
+                    that.performanLoading=false;
+                    that.$message.error(res.data.msg);
+                }
+            })
+        },
+        //生成人事部绩效
+        AiPerformanceAnalysis_HumanResourceDepartment(val){
+            var url = "/api/PersonnelModule/AiPerformanceAnalysis_HumanResourceDepartment?userId="+val.id+"&start="+this.datetime(this.months[0])+"&end="+this.datetime(this.months[1])+"&createUserId="+this.userId
+            var that = this
+            this.$axios({
+                method: 'get',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                }
+            }).then(function (res) {
+                if(res.data.code==200){
+                    that.performanLoading=false;
+                    that.AIVisible=true;
+                    if (that.$marked && typeof that.$marked === 'function') {
+                        that.marktext = that.$marked(res.data.data.answer+that.texehr);
+                        that.marktexts = that.$marked(res.data.data.kaoqinAnswer);
+                    }
+                    that.AiPerformanceAnalysis_UserList();
+                }else{
+                    that.performanLoading=false;
+                    that.$message.error(res.data.msg);
+                }
+            })
+        },
         //生成市场部绩效
         MarketingDepartment(val,text){
             var new_year = this.months[0].getFullYear()
@@ -630,6 +683,34 @@ export default {
                 }
                 return
             }
+            if (val.depName=='财务部') {
+                this.performanLoading=true;
+                if(text=='查看'){
+                    if (val.hasPerformanceData==false) {
+                        this.performanLoading=false;
+                        this.$message.error('该用户尚未生成AI绩效分析,请先生成!');
+                        return
+                    }
+                    this.AiPerformanceAnalysis_Query(val)
+                }else{
+                    this.AiPerformanceAnalysis_FinancialDepartment(val);
+                }
+                return
+            }
+            if (val.depName=='人事部') {
+                this.performanLoading=true;
+                if(text=='查看'){
+                    if (val.hasPerformanceData==false) {
+                        this.performanLoading=false;
+                        this.$message.error('该用户尚未生成AI绩效分析,请先生成!');
+                        return
+                    }
+                    this.AiPerformanceAnalysis_Query(val)
+                }else{
+                    this.AiPerformanceAnalysis_HumanResourceDepartment(val);
+                }
+                return
+            }
             this.$message.error('正在开发中!');
         },
         async exportToPDF() {

+ 6 - 0
src/router/index.js

@@ -145,6 +145,7 @@ import DepartProcessAdd from '@/components/OP/DepartProcessAdd'
 import TaskReview from '@/components/OP/TaskReview'
 import GroupProgress from '@/components/OP/GroupProgress'
 import performanceanalysis from '@/components/OP/performanceanalysis'
+import SpecialPerformance from '@/components/OP/SpecialPerformance'
 
 
 Vue.use(Router)
@@ -867,6 +868,11 @@ export default new Router({
           name: 'performanceanalysis',
           component: performanceanalysis
         },
+        {
+          path: '/home/SpecialPerformance',
+          name: 'SpecialPerformance',
+          component: SpecialPerformance
+        },
       ]
     },
     {