Browse Source

调整报表取值合并的判断

Lijy 1 year ago
parent
commit
4ad3eccfd1

+ 5 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -1791,14 +1791,16 @@ export default {
       if(this.permissions.reportProjectEstimated) {this.ssl(27);this.reportProjectEstimated = '1-28';return} else
       {this.allWrong = false}
     },
-    rowspan(spanArr,position,spanName,dataItem = []){
+    rowspan(spanArr,position,spanName,dataItem = [],fields=false){
       let newArray = dataItem.length > 0 ? dataItem : this.list1
       newArray.forEach((item,index) => {
         if(index == 0){
           spanArr.push(1)
           position = 0
         }else {
-          if(newArray[index][spanName] == newArray[index-1][spanName]){
+          let newArrFlag = newArray[index][spanName] == newArray[index-1][spanName] && (!fields || newArray[index][fields] == newArray[index-1][fields]);
+          // if(newArray[index][spanName] == newArray[index-1][spanName]){
+          if(newArrFlag){
             spanArr[position] += 1
             spanArr.push(0)
           }else {
@@ -3789,7 +3791,7 @@ export default {
       }) 
       this.resetMerge()
       this.rowspan(this.listArr1, this.listPosition1, 'projectId', data.record)
-      this.rowspan(this.listArr2, this.listPosition2, 'corpwxDeptId', data.record)
+      this.rowspan(this.listArr2, this.listPosition2, 'corpwxDeptId', data.record, 'projectId')
       this.isbeCustomReport.consumptionSchedule = data.record
       this.total = data.total
       this.listLoading = false