Pārlūkot izejas kodu

调整请假管理,项目甘特图

Lijy 2 gadi atpakaļ
vecāks
revīzija
45768982d0

+ 7 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -1495,11 +1495,18 @@ export default {
                 if(node.type == 'dep') {
                   this.dataArray[this.sindex].auditDeptId = node.value;
                   this.dataArray[this.sindex].auditDeptName = node.label;
+                  this.dataArray[this.sindex].auditorType = 1
+                  this.dataArray[this.sindex].userId = ''
+                  this.dataArray[this.sindex].userName = ''
                 } else {
                   this.dataArray[this.sindex].userId = node.value;
                   this.dataArray[this.sindex].userName = node.label;
+                  this.dataArray[this.sindex].auditDeptId = ''
+                  this.dataArray[this.sindex].auditDeptName = ''
+                  this.dataArray[this.sindex].auditorType = 2
                 }
               }
+              console.log(this.dataArray, '数据')
             },
     deleteNode() {
                 this.dialogVisible = false;

+ 25 - 11
fhKeeper/formulahousekeeper/timesheet/src/views/project/vueGantt.vue

@@ -14,7 +14,9 @@
           <template slot-scope="scope">
             <span v-if="user.userNameNeedTranslate == 1 && scope.row.translationType == 'user'">
               <span v-for="(item, index) in scope.row.userNameList" :key="index">
-                <ww-open-data type='userName' :openid='scope.row.text'></ww-open-data>
+                <!-- <ww-open-data type='userName' :openid='scope.row.text'></ww-open-data> -->
+                <ww-open-data type='userName' :openid='item'></ww-open-data>
+                <span v-if="index < scope.row.userNameList.length - 1">,</span>
               </span>
             </span>
             <span v-if="user.userNameNeedTranslate == 1 && scope.row.translationType == 'user'">{{scope.row.proNameText}}</span>
@@ -99,6 +101,7 @@ export default {
 
     // this.treeDataList = this.integrationTree(this.tasks.data)
     console.log(this.mergeList, '合并数据')
+    console.log(this.treeDataList, '合并完全的数据')
   },
   methods: {
     // 递归加颜色以及存储需要合并的数据
@@ -106,20 +109,31 @@ export default {
       for (let i in data) {
             if(this.stafforpro == '按项目查看') {
               data[i].color = '#409EFF'
-              if(data[i].type == 'user' && data[i].text) {
+              // if(data[i].type == 'user' && data[i].text) {
+              //   let arr = []
+              //   if(data[i].text.indexOf('/') != '-1') {
+              //     let str = data[i].text.split('/')[0]
+              //     if(str.indexOf(',') != '-1') {
+              //       let arrList = str.split(',')
+              //       data[i].userNameList = arrList
+              //     } else {
+              //       arr.push(str)
+              //       data[i].userNameList = arr
+              //     }
+              //     data[i].proNameText = data[i].text.split('/')[1]
+              //   }
+              // }
+              if(data[i].translationType == 'user' && data[i].text) {
                 let arr = []
-                if(data[i].text.indexOf('/') != '-1') {
-                  let str = data[i].text.split('/')[0]
-                  if(str.indexOf(',') != '-1') {
-                    let arrList = str.split(',')
-                    data[i].userNameList = arrList
-                  } else {
-                    arr.push(str)
-                    data[i].userNameList = arr
+                arr = data[i].text.split(',')
+                for(var j in arr) {
+                  if(arr[j].indexOf('/') != '-1') {
+                    arr[j] = arr[j].split('/')[0]
                   }
-                  data[i].proNameText = data[i].text.split('/')[1]
                 }
+                data[i].userNameList = arr
               }
+
             }
             this.num++
             let obj = {