Sfoglia il codice sorgente

提交没来得的工作计划任务

Lijy 1 mese fa
parent
commit
bb78adcefb

File diff suppressed because it is too large
+ 415 - 31
fhKeeper/formulahousekeeper/timesheet_mld/src/components/taskComponent.vue


+ 72 - 24
fhKeeper/formulahousekeeper/timesheet_mld/src/views/project/project_gantt.vue

@@ -190,6 +190,12 @@
           <el-link type="primary" :underline="false" @click="exportProjectData" download="资源需求导出.xlsx">{{ $t('dao-chu-xu-qiu') }}</el-link>
         </div>
       </template>
+
+      <template v-if="radio1 == $t('an-ren-yuan-cha-kan')">
+        <div class="eachLayout">
+          <el-link type="primary" :underline="false" @click="exportPersonnelData">导出数据</el-link>
+        </div>
+      </template>
     </div>
 
     <div class="ganttChartLayout" v-if="isDataLoaded && user.userNameNeedTranslate != 1">
@@ -520,32 +526,74 @@ export default {
       },
       // 资源需求导出
       exportProjectData() {
-        let parameter = {}
-        if(this.valuex){
-          parameter.projectId = this.valuex
+          let parameter = {}
+          if(this.valuex){
+            parameter.projectId = this.valuex
+          }
+          if(this.valuex2){
+            parameter.groupName = this.valuex2
+          }
+          this.http.post('/project-requirement/exportData',parameter,
+          res => {
+              if (res.code == "ok") {
+                  let filePath = res.data;
+                  const a = document.createElement('a'); // 创建a标签
+                  a.setAttribute('download', this.$t('zi-yuan-xu-qiu-dao-chu')+'.xlsx');// download属性
+                  a.setAttribute('href', filePath);// href链接
+                  a.click(); //自执行点击事件
+                  a.remove();
+              } 
+          },
+          error => {
+              this.$message({
+                  message: error,
+                  type: "error"
+              });
+              }
+          );
+      },
+      // 人员数据导出
+      exportPersonnelData() {
+        let getlistcs = {type : this.reqpar1 , startDate : this.reqpar2[0] , endDate : this.reqpar2[1]}
+        if(this.reqpar1) {
+          if(this.valuex != ''){
+            getlistcs.projectId = this.valuex
+          }
+          if(this.valuex2 != ''){
+            getlistcs.groupName = this.valuex2
+          }
+          getlistcs.taskType = this.taskType
+          
+        }else {
+          if(this.valuex != ''){
+            getlistcs.userId = this.valuex
+          }
         }
-        if(this.valuex2){
-          parameter.groupName = this.valuex2
+        if(this.radio1 == this.$t('an-ren-yuan-cha-kan')) {
+          if(this.departmentValue.length > 0) {
+            getlistcs.deptId = this.departmentValue[this.departmentValue.length - 1]
+          }
         }
-                this.http.post('/project-requirement/exportData',parameter,
-                res => {
-                    if (res.code == "ok") {
-                        let filePath = res.data;
-                        const a = document.createElement('a'); // 创建a标签
-                        a.setAttribute('download', this.$t('zi-yuan-xu-qiu-dao-chu')+'.xlsx');// download属性
-                        a.setAttribute('href', filePath);// href链接
-                        a.click(); //自执行点击事件
-                        a.remove();
-                    } 
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                    }
-                );
-            },
+        var urls = '/project/exportGanttData';
+        this.http.post(urls, getlistcs,
+          res => {
+              if (res.code == "ok") {
+                  let filePath = res.data;
+                  const a = document.createElement('a'); // 创建a标签
+                  a.setAttribute('download', `${this.reqpar2[0]}-${this.reqpar2[1]}工作计划导出`+'.xlsx');// download属性
+                  a.setAttribute('href', filePath);// href链接
+                  a.click(); //自执行点击事件
+                  a.remove();
+              } 
+          },
+          error => {
+              this.$message({
+                  message: error,
+                  type: "error"
+              });
+              }
+          );
+      },
       // 资源需求导入
       importProject(item) {
                 //首先判断文件类型