diff --git a/src/modules/finance/pages/FinanceCustomerArapView.test.ts b/src/modules/finance/pages/FinanceCustomerArapView.test.ts index 73c6ef90..854fe8c8 100644 --- a/src/modules/finance/pages/FinanceCustomerArapView.test.ts +++ b/src/modules/finance/pages/FinanceCustomerArapView.test.ts @@ -127,6 +127,26 @@ describe('FinanceCustomerArapView G2 operations', () => { } }) + it.each([['PAYABLE_BILLED', '已生成应付单'], ['PARTIALLY_PAID', '部分付款'], ['PAID', '已付款']])( + 'shows payable progress and prevents editing occupied or paid sources: %s', async (status, label) => { + const row = { ...feeSummary, direction: 'PAYABLE', sourceSystem: 'FINANCE', sourceType: 'MANUAL', + reviewStatus: 'APPROVED', sourceStatus: status, status, statementGenerated: false } as FinanceFeeSourceSummary + vi.mocked(listFinanceFeeSources).mockResolvedValue({ records: [row], total: 1, pages: 1 }) + const wrapper = await mountView(['platform:finance:customer-arap:list', 'platform:finance:fee-source:edit']) + await loadRows(wrapper) + const body = wrapper.get('.el-table__body-wrapper') + expect(body.text()).toContain(label) + expect(body.text()).not.toContain('可结算') + expect(body.text()).not.toContain('未生成') + expect(body.findAll('button').map(button => button.text().trim())).toEqual(['详情']) + vi.mocked(getFinanceFeeSource).mockResolvedValueOnce({ ...detail, ...row }) + await body.get('button').trigger('click') + await flushPromises() + expect(wrapper.get('.arap-metrics').text()).toContain(label) + expect(wrapper.get('.arap-settlement').text()).toContain('不适用') + }, + ) + it('shows detail from the list permission but keeps G2 operations independent', async () => { const wrapper = await mountView(['platform:finance:customer-arap:list']) await loadRows(wrapper) diff --git a/src/modules/finance/pages/FinanceCustomerArapView.vue b/src/modules/finance/pages/FinanceCustomerArapView.vue index ebe1a6de..d1cf5741 100644 --- a/src/modules/finance/pages/FinanceCustomerArapView.vue +++ b/src/modules/finance/pages/FinanceCustomerArapView.vue @@ -126,7 +126,7 @@ const queryFields = computed(() => [ options: activeCustomers.value.map((item) => ({ label: item.tenantName, value: String(item.id) })), }, { key: 'direction', type: 'select', label: '收付方向', width: 140, placeholder: '请选择收付方向', options: [{ label: '应收', value: 'RECEIVABLE' }, { label: '应付', value: 'PAYABLE' }] }, - { key: 'status', type: 'select', label: '来源状态', width: 150, placeholder: '请选择来源状态', options: [{ label: '可结算', value: 'AVAILABLE' }, { label: '已占用', value: 'LOCKED' }, { label: '已生成对账单', value: 'BILLED' }, { label: '资金账户已结清', value: 'SETTLED' }, { label: '已作废', value: 'VOIDED' }, { label: '已被调整替代', value: 'SUPERSEDED' }] }, + { key: 'status', type: 'select', label: '来源状态', width: 150, placeholder: '请选择来源状态', options: [{ label: '可结算', value: 'AVAILABLE' }, { label: '已占用', value: 'LOCKED' }, { label: '已生成对账单', value: 'BILLED' }, { label: '已生成应付单', value: 'PAYABLE_BILLED' }, { label: '部分付款', value: 'PARTIALLY_PAID' }, { label: '已付款', value: 'PAID' }, { label: '资金账户已结清', value: 'SETTLED' }, { label: '已作废', value: 'VOIDED' }, { label: '已被调整替代', value: 'SUPERSEDED' }] }, { key: 'reviewStatus', type: 'select', label: '审核状态', width: 150, placeholder: '请选择审核状态', options: financeArapStatusOptions }, { key: 'statementGenerated', type: 'select', label: '已生成对账单', width: 160, placeholder: '请选择对账单状态', options: [{ label: '已生成', value: 'true' }, { label: '未生成', value: 'false' }] }, { key: 'businessRange', type: 'daterange', label: '业务日期', width: 280 }, @@ -191,7 +191,7 @@ function businessReference(row: Pick = { AVAILABLE: '可结算', LOCKED: '已占用', BILLED: '已生成对账单', SETTLED: '资金账户已结清', VOIDED: '已作废', SUPERSEDED: '已被调整替代' } + const labels: Record = { AVAILABLE: '可结算', LOCKED: '已占用', BILLED: '已生成对账单', PAYABLE_BILLED: '已生成应付单', PARTIALLY_PAID: '部分付款', PAID: '已付款', SETTLED: '资金账户已结清', VOIDED: '已作废', SUPERSEDED: '已被调整替代' } return labels[String(value || '').toUpperCase()] || '状态待确认' } function formatDateTime(value: unknown) { @@ -414,7 +414,7 @@ watch(() => [route.name, String(route.params.feeSourceId || '')], ([name, feeSou - + @@ -424,7 +424,7 @@ watch(() => [route.name, String(route.params.feeSourceId || '')], ([name, feeSou - +