应收流水中间报表

This commit is contained in:
李鹏宇
2026-03-27 15:24:48 +08:00
parent bfcd0193af
commit 655b080426
2 changed files with 18 additions and 0 deletions
@@ -115,9 +115,11 @@ class ReceivableFlowReport(models.Model):
contract_total_unpaid = sum(r.submitted for r in contract_recs)
seq += 1
contract_key = contract.contract_code if (contract and contract.contract_code) else "contract_{}".format(seq)
# ==== 合同头行 ====
rows.append({
"row_type": "合同",
"orgHierarchy": [contract_key],
"序号": seq,
"租金id": "",
"合同编号": {
@@ -211,6 +213,7 @@ class ReceivableFlowReport(models.Model):
# ==== 应收租金行 ====
rows.append({
"row_type": "主",
"orgHierarchy": [contract_key, str(rec.id)],
"序号": "",
"租金id": rec.id,
"合同编号": "",
@@ -260,6 +263,7 @@ class ReceivableFlowReport(models.Model):
rows.append({
"row_type": "收款",
"orgHierarchy": [contract_key, str(rec.id), "pay_{}".format(ml.id)],
"序号": "",
"租金id": rec.id,
"合同编号": "",
@@ -82,6 +82,20 @@ class ReceivableReport extends Component {
theme: agGrid.themeMaterial,
columnDefs: columns,
rowData: [],
// ===== Tree Data 折叠展开 =====
treeData: true,
getDataPath: (data) => data.orgHierarchy || [],
groupDefaultExpanded: 0, // 默认全部折叠
autoGroupColumnDef: {
headerName: '合同/明细',
minWidth: 200,
flex: 1.5,
pinned: 'left',
cellRendererParams: {
suppressCount: true, // 不显示子行数量
},
},
// ===== 行样式 =====
rowClassRules: {
'ag-row-new-rent': function(params) {
return params.data && params.data.acc_type === 'new';