Selaa lähdekoodia

信息部爱绩效

liuhj 2 viikkoa sitten
vanhempi
commit
4642caa632
1 muutettua tiedostoa jossa 42 lisäystä ja 4 poistoa
  1. 42 4
      src/components/OP/performanceanalysis.vue

+ 42 - 4
src/components/OP/performanceanalysis.vue

@@ -265,7 +265,7 @@ export default {
         },
         //国交部绩效下载接口
         AiPerformanceAnalysis_GuojiaoFileDown(new_year,new_month,val){
-            var url = "/api/PersonnelModule/AiPerformanceAnalysis_GuojiaoFileDown?start="+new_year+"&end="+new_month+"&end="+val.id
+            var url = "/api/PersonnelModule/AiPerformanceAnalysis_GuojiaoFileDown?start="+new_year+"&end="+new_month+"&userId="+val.id
             var that = this
             this.$axios({
                 method: 'post',
@@ -298,7 +298,7 @@ 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=='国交部'){
+            }else if(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);
             }
@@ -475,6 +475,31 @@ export default {
                     that.$message.error('AI绩效分析生成失败,请稍后重试!');
                 }
             })
+        },
+         //生成信息部绩效
+        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
+            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('AI绩效分析生成失败,请稍后重试!');
+                }
+            })
         },
         //生成市场部绩效
         MarketingDepartment(val,text){
@@ -530,7 +555,6 @@ export default {
                 this.$message.error('请选择月份!');
                 return
             }
-            console.log(val);
             if (val.depName=='市场部') {
                 this.performanLoading=true;
                 this.MarketingDepartment(val,text);
@@ -592,7 +616,21 @@ export default {
                 }
                 return
             }
-            this.$message.error('当前仅支持市场部员工号及酒店、机票生成AI分析,其他部门正在开发中!');
+            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_InformationDepartment(val);
+                }
+                return
+            }
+            this.$message.error('正在开发中!');
         },
         async exportToPDF() {
             try {