修复财务支付记录展示
This commit is contained in:
@@ -112,6 +112,25 @@ assertIncludes(
|
||||
'钱包关系必须提供按归属类型生成的可读摘要',
|
||||
);
|
||||
|
||||
// 财务支付记录必须使用本领域的支付状态与渠道,不得复用支付订单状态。
|
||||
const financePaymentDefinition = resources.match(
|
||||
/define\('fin_payment',[\s\S]*?\n\s*\]\),/,
|
||||
)?.[0];
|
||||
if (!financePaymentDefinition) throw new Error('无法读取财务支付记录资源定义');
|
||||
for (const contract of [
|
||||
"relation('ec_order_identity', '/ec_order'",
|
||||
"listRelationNameOnly: true",
|
||||
"f('product_summary', { emptyText: '商品信息缺失' })",
|
||||
"{ label: '已支付', value: 35 }",
|
||||
"{ label: '余额支付', value: 'wallet' }",
|
||||
"{ label: '支付宝', value: 'alipay' }",
|
||||
"{ label: '微信支付', value: 'wechat' }",
|
||||
]) {
|
||||
if (!financePaymentDefinition.includes(contract)) {
|
||||
throw new Error(`财务支付记录缺少中文展示契约:${contract}`);
|
||||
}
|
||||
}
|
||||
|
||||
// 购物车关联列必须展示用户和商品名称,UUID仅作为复制与排障信息保留。
|
||||
const cartDefinition = resources.match(
|
||||
/define\('ec_cart',[\s\S]*?\n\s*\]\),/,
|
||||
|
||||
@@ -126,6 +126,12 @@ const contracts: Record<string, ResourceDetailContract> = {
|
||||
'business_identity', 'user_identity', 'amount', 'identity',
|
||||
],
|
||||
},
|
||||
fin_payment: {
|
||||
leadingKeys: [
|
||||
'ec_order_identity', 'product_summary', 'payment_status', 'channel',
|
||||
'amount', 'paid_at', 'identity', 'status',
|
||||
],
|
||||
},
|
||||
wallet_record: {
|
||||
leadingKeys: [
|
||||
'record_no', 'request_no', 'direction', 'trade_type', 'amount',
|
||||
|
||||
@@ -274,6 +274,7 @@ const fieldLabels: Record<string, string> = {
|
||||
quantity: '数量',
|
||||
selected: '是否选中',
|
||||
product_snapshot: '商品快照',
|
||||
product_summary: '支付商品',
|
||||
sale_amount: '成交金额(元)',
|
||||
score: '评分',
|
||||
paid_at: '支付时间',
|
||||
@@ -818,7 +819,31 @@ export const resources: ResourceUiDefinition[] = [
|
||||
]),
|
||||
|
||||
define('fin_payment', '财务支付记录', 'readonly', [
|
||||
relation('ec_order_identity', '/ec_order'), f('payment_status'), f('channel'), f('amount'), f('paid_at'),
|
||||
relation('ec_order_identity', '/ec_order', false, {
|
||||
label: '商城订单',
|
||||
listRelationNameOnly: true,
|
||||
displayRelationLabel: true,
|
||||
showIdentityCopy: true,
|
||||
}),
|
||||
f('product_summary', { emptyText: '商品信息缺失' }),
|
||||
f('payment_status', {
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '待支付', value: 10 },
|
||||
{ label: '已支付', value: 35 },
|
||||
],
|
||||
unknownValueLabel: '未知支付状态',
|
||||
}),
|
||||
f('channel', {
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '余额支付', value: 'wallet' },
|
||||
{ label: '支付宝', value: 'alipay' },
|
||||
{ label: '微信支付', value: 'wechat' },
|
||||
],
|
||||
unknownValueLabel: '未知支付渠道',
|
||||
}),
|
||||
f('amount'), f('paid_at'),
|
||||
]),
|
||||
define('fin_settlement', '财务结算', 'writable', [f('settlement_no', { required: true }), f('subject_type', { required: true }), f('subject_identity', {
|
||||
required: true, type: 'identity', label: '结算主体', listRelationNameOnly: true,
|
||||
|
||||
Reference in New Issue
Block a user