Browse Source

完善集团日报表、事业部日报表、分公司日报表--合并单元格--分公司列数据显示不全的问题

zhanglei
yunuo970428 1 year ago
parent
commit
75826cbf0e
  1. 76
      anrui-reportcenter-ui/src/views/branchofficestatistics/branchofficestatistics.vue
  2. 85
      anrui-reportcenter-ui/src/views/businessdivisionstatistics/businessdivisionstatistics.vue
  3. 78
      anrui-reportcenter-ui/src/views/groupstatistics/groupstatistics.vue

76
anrui-reportcenter-ui/src/views/branchofficestatistics/branchofficestatistics.vue

@ -31,7 +31,7 @@
</div>
<!--Start 主页面主要部分 -->
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange" :span-method="rowspanMethod">
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange" :span-method="objectSpanMethod">
<el-table-column prop="useOrgName" label="分公司" width="120" align="center"></el-table-column>
<el-table-column prop="brandName" label="品牌" width="120" align="center"></el-table-column>
<el-table-column prop="vehModeName" label="车型" width="250" align="center"></el-table-column>
@ -266,6 +266,80 @@ export default {
}
}
},
// element-ui
// objectSpanMethod { row, column, rowIndex, columnIndex }
// row:
// column:
// rowIndex:
// columnIndex:
// 1:
// :
// 0: ,
mergeCol(id, rowIndex) {
// debugger
//
// id:
// rowIndex:
var idName = this.list[rowIndex][id] //
if (rowIndex > 0) {
//
// eslint-disable-next-line eqeqeq
if (this.list[rowIndex][id] !== this.list[rowIndex - 1][id]) {
//
var i = rowIndex
var num = 0 // i,,num
while (i < this.list.length) {
// table,
if (this.list[i][id] === idName) {
//
i++ // ,1
num++ // num1
} else {
i = this.list.length // ,table,
}
}
return {
rowspan: num, //
colspan: 1
}
} else {
return {
rowspan: 0, // ,rowspan0
colspan: 1
}
}
} else {
// ,
let i = rowIndex
let num = 0
while (i < this.list.length) {
// table,
if (this.list[i][id] === idName) {
i++
num++
} else {
i = this.list.length
}
}
return {
rowspan: num,
colspan: 1
}
}
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
//
switch (
columnIndex //
) {
// ,(0,1 0,1)
// gzTroubles,gzID
case 0:
return this.mergeCol('useOrgName', rowIndex)
case 1:
return this.mergeCol('brandName', rowIndex)
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size

85
anrui-reportcenter-ui/src/views/businessdivisionstatistics/businessdivisionstatistics.vue

@ -31,9 +31,9 @@
</div>
<!--Start 主页面主要部分 -->
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange" :span-method="rowspanMethod">
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange" :span-method="objectSpanMethod">
<el-table-column prop="busOrgName" label="事业部" width="120" align="center"></el-table-column>
<el-table-column label="分公司" width="120" align="center">
<el-table-column prop="useOrgName" label="分公司" width="120" align="center">
<template slot-scope="scope">
<span class="bluezi" @click="lookBranch(scope.row)">{{ scope.row.useOrgName }}</span>
</template>
@ -233,9 +233,9 @@ export default {
})
this.sids = aa
},
//
//
rowspanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0 || columnIndex === 1 || columnIndex === 2) { //
if (columnIndex === 1) { //
//
const currentValue = row[column.property]
//
@ -260,6 +260,83 @@ export default {
}
}
},
//
// element-ui
// objectSpanMethod { row, column, rowIndex, columnIndex }
// row:
// column:
// rowIndex:
// columnIndex:
// 1:
// :
// 0: ,
mergeCol(id, rowIndex) {
// debugger
//
// id:
// rowIndex:
var idName = this.list[rowIndex][id] //
if (rowIndex > 0) {
//
// eslint-disable-next-line eqeqeq
if (this.list[rowIndex][id] !== this.list[rowIndex - 1][id]) {
//
var i = rowIndex
var num = 0 // i,,num
while (i < this.list.length) {
// table,
if (this.list[i][id] === idName) {
//
i++ // ,1
num++ // num1
} else {
i = this.list.length // ,table,
}
}
return {
rowspan: num, //
colspan: 1
}
} else {
return {
rowspan: 0, // ,rowspan0
colspan: 1
}
}
} else {
// ,
let i = rowIndex
let num = 0
while (i < this.list.length) {
// table,
if (this.list[i][id] === idName) {
i++
num++
} else {
i = this.list.length
}
}
return {
rowspan: num,
colspan: 1
}
}
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
//
switch (
columnIndex //
) {
// ,(0,1 0,1)
// gzTroubles,gzID
case 0:
return this.mergeCol('busOrgName', rowIndex)
case 1:
return this.mergeCol('useOrgName', rowIndex)
case 2:
return this.mergeCol('brandName', rowIndex)
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size

78
anrui-reportcenter-ui/src/views/groupstatistics/groupstatistics.vue

@ -31,8 +31,8 @@
</div>
<!--Start 主页面主要部分 -->
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange" :span-method="rowspanMethod">
<el-table-column label="事业部" width="120" align="center">
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange" :span-method="objectSpanMethod">
<el-table-column prop="busOrgName" label="事业部" width="120" align="center">
<template slot-scope="scope">
<span class="bluezi" @click="lookBusiness(scope.row)">{{ scope.row.busOrgName }}</span>
</template>
@ -250,6 +250,80 @@ export default {
}
}
},
// element-ui
// objectSpanMethod { row, column, rowIndex, columnIndex }
// row:
// column:
// rowIndex:
// columnIndex:
// 1:
// :
// 0: ,
mergeCol(id, rowIndex) {
// debugger
//
// id:
// rowIndex:
var idName = this.list[rowIndex][id] //
if (rowIndex > 0) {
//
// eslint-disable-next-line eqeqeq
if (this.list[rowIndex][id] !== this.list[rowIndex - 1][id]) {
//
var i = rowIndex
var num = 0 // i,,num
while (i < this.list.length) {
// table,
if (this.list[i][id] === idName) {
//
i++ // ,1
num++ // num1
} else {
i = this.list.length // ,table,
}
}
return {
rowspan: num, //
colspan: 1
}
} else {
return {
rowspan: 0, // ,rowspan0
colspan: 1
}
}
} else {
// ,
let i = rowIndex
let num = 0
while (i < this.list.length) {
// table,
if (this.list[i][id] === idName) {
i++
num++
} else {
i = this.list.length
}
}
return {
rowspan: num,
colspan: 1
}
}
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
//
switch (
columnIndex //
) {
// ,(0,1 0,1)
// gzTroubles,gzID
case 0:
return this.mergeCol('busOrgName', rowIndex)
case 1:
return this.mergeCol('brandName', rowIndex)
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size

Loading…
Cancel
Save