-
-
+
+
-
+
{{scope.row.period_id.slice(0,4)}}-{{scope.row.period_id.slice(4,6)}}
+
- {{scope.row.amount}} 元
+ {{scope.row.amount}}
@@ -76,49 +77,12 @@ export default {
components: { Framework },
data () {
return {
- person_uid: '', // 510212196307160054
+ person_uid: '', // 510212196307160054 //512326196303104368
person_name: '',
idNumber: '',
pageSize: 10,
currentPage: 100,
- tableData: [
- {
- date: '2016-05-03',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles'
- },
- {
- date: '2016-05-02',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles'
- },
- {
- date: '2016-05-04',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles'
- },
- {
- date: '2016-05-01',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles'
- },
- {
- date: '2016-05-01',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles'
- },
- {
- date: '2016-05-01',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles'
- },
- {
- date: '2016-05-01',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles'
- }
-
- ],
+ tableData: [],
moneyDate: {
currtMx: [],
hisMx: []
@@ -128,6 +92,27 @@ export default {
}
},
methods: {
+ // 合并单元格
+ mergeCells ({ column, rowIndex }) {
+ if (column.property === 'period_id') {
+ const currentPeriod = this.moneyDate.hisMx[rowIndex].period_id
+ const prevPeriod = rowIndex > 0 ? this.moneyDate.hisMx[rowIndex - 1].period_id : null
+
+ if (prevPeriod === currentPeriod) {
+ return [0, 0] // 不显示单元格
+ } else {
+ let rowspan = 1
+ for (let i = rowIndex + 1; i < this.moneyDate.hisMx.length; i++) {
+ if (this.moneyDate.hisMx[i].period_id === currentPeriod) {
+ rowspan++
+ } else {
+ break
+ }
+ }
+ return [rowspan, 1] // 合并单元格
+ }
+ }
+ },
async queryPaymentAmount () {
if (this.person_uid === '') return ElMessage.error('请输入身份证号')
const params = {
@@ -135,6 +120,19 @@ export default {
}
const { data } = await this.$http.get('api/archive/queryPaymentAmount.do', { params })
+ data.hisMx.sort((a, b) => {
+ // 先按 period_id 降序排序
+ if (b.period_id !== a.period_id) {
+ return b.period_id - a.period_id
+ }
+ // 再按 archive_name 升序排序
+ return a.archive_name.localeCompare(b.archive_name)
+ })
+ data.currtMx.sort((a, b) => {
+ // archive_name 升序排序
+ return a.archive_name.localeCompare(b.archive_name)
+ })
+
this.moneyDate = data
if (data.currtMx.length === 0 && data.hisMx.length === 0) {
this.empty = true
@@ -270,8 +268,12 @@ export default {
border: 1px solid #D7D7D7;
border-radius: 8px;
.table-center{
- width: 1400px;
+ width: 900px;
margin: 0 auto;
+
+ }
+ :deep(.cell){
+ font-size: 18px;
}
}