规范气站与配送点提现渠道

This commit is contained in:
czl231
2026-08-19 23:43:02 +08:00
parent 2f5b934037
commit b93202274d
13 changed files with 148 additions and 12 deletions

View File

@@ -35,6 +35,16 @@ for (const item of contract.resources) {
throw new Error(`缺少后端资源路由:${item.name}`);
}
if (!source.includes("defaultValue: 'bank'"))
throw new Error('提现申请必须默认选择银行卡提现');
for (const option of [
"{ label: '银行卡提现', value: 'bank' }",
"{ label: '支付宝提现', value: 'alipay', disabled: true }",
"{ label: '微信提现', value: 'wechat', disabled: true }",
]) {
if (!source.includes(option)) throw new Error(`提现渠道配置缺失:${option}`);
}
const forbidden = [
'/platform/platform_', '/gas/gas_', '/delivery/delivery_', '/staff/',
'/user/', '/ec/ec_', '/finance/fin_', '/wallet/wallet',

View File

@@ -32,7 +32,7 @@ export type ResourceField = {
readonlyRelationText?: boolean;
/** 列表中以可悬浮、可复制的紧凑文本展示普通字段。 */
listCopyable?: boolean;
options?: Array<{ label: string; value: string | number }>;
options?: Array<{ label: string; value: string | number; disabled?: boolean }>;
defaultValue?: string | number | boolean;
readonly?: boolean;
unknownValueLabel?: string;
@@ -336,6 +336,19 @@ function define(
const reason = [f('reason', { required: true })];
/** 提现渠道保留未来选项,但当前仅开放银行卡提现。 */
const withdrawalChannelField = f('channel', {
required: true,
type: 'select',
defaultValue: 'bank',
unknownValueLabel: '未知提现渠道',
options: [
{ label: '银行卡提现', value: 'bank' },
{ label: '支付宝提现', value: 'alipay', disabled: true },
{ label: '微信提现', value: 'wechat', disabled: true },
],
});
const platformResources: ResourceUiDefinition[] = [
{ ...define('gas_basic', '气站管理', 'writable', [f('code', { required: true }), f('name', { required: true }), f('credit_code'), f('principal'), f('address'), f('longitude'), f('latitude')]), accountManagement: { resource: '/gas_account', relationKey: 'gas_basic_identity', title: '气站账户' }, walletOwnerType: 'gas' },
define('gas_account', '气站账户', 'writable', [f('username', { required: true }), f('password', { required: true }), f('display_name'), fixedAdminRole('气站管理员'), relation('gas_basic_identity', '/gas_basic', true)]),
@@ -476,7 +489,7 @@ const gasOverrides: ResourceUiDefinition[] = [
define('wallet_payment', '支付记录', 'readonly', []),
define('wallet_record', '钱包流水', 'readonly', []),
define('wallet_refund', '退款记录', 'readonly', []),
define('wallet_apply_cash', '提现申请', 'append_only', [relation('wallet_bank_identity', '/wallet_bank'), f('request_no', { required: true }), f('amount', { required: true }), f('channel', { required: true }), f('remark')]),
define('wallet_apply_cash', '提现申请', 'append_only', [relation('wallet_bank_identity', '/wallet_bank'), f('request_no', { required: true }), f('amount', { required: true }), withdrawalChannelField, f('remark')]),
define('fin_settlement', '财务结算', 'readonly', []),
define('fin_reconciliation', '财务对账', 'readonly', []),
define('cs_ticket', '客服工单', 'writable', [relation('user_account_identity', '/user_account', true), f('ticket_no', { required: true }), f('category', { required: true }), f('priority', { required: true })]),
@@ -516,7 +529,7 @@ const deliveryOverrides: ResourceUiDefinition[] = [
define('wallet_record', '钱包流水', 'readonly', []),
define('wallet_refund', '退款记录', 'readonly', []),
define('wallet_recharge', '钱包充值', 'append_only', [f('request_no', { required: true }), f('amount', { required: true }), ...reason, f('remark')]),
define('wallet_apply_cash', '提现申请', 'append_only', [relation('wallet_bank_identity', '/wallet_bank'), f('request_no', { required: true }), f('amount', { required: true }), f('channel', { required: true }), f('remark')]),
define('wallet_apply_cash', '提现申请', 'append_only', [relation('wallet_bank_identity', '/wallet_bank'), f('request_no', { required: true }), f('amount', { required: true }), withdrawalChannelField, f('remark')]),
define('fin_settlement', '结算结果', 'readonly', []),
];

View File

@@ -173,7 +173,7 @@
<a-textarea v-else-if="field.type === 'textarea'" v-model="form[field.key]" :auto-size="{ minRows: 3, maxRows: 8 }" />
<a-input-password v-else-if="field.type === 'password'" v-model="form[field.key]" />
<a-select v-else-if="field.type === 'select'" v-model="form[field.key]" :disabled="field.readonly" allow-clear>
<a-option v-for="option in selectFieldOptions(field)" :key="option.value" :value="option.value">{{ option.label }}</a-option>
<a-option v-for="option in selectFieldOptions(field)" :key="option.value" :value="option.value" :disabled="option.disabled">{{ option.label }}{{ option.disabled ? '暂未开通' : '' }}</a-option>
</a-select>
<a-select v-else-if="field.type === 'identity' || field.type === 'identity-list'" v-model="form[field.key]" :multiple="field.type === 'identity-list'" allow-clear allow-search :loading="relationLoading[field.relation ?? '']" @search="(value: string) => searchRelation(field.relation, value)">
<a-option v-for="option in relationOptions[field.relation ?? ''] ?? []" :key="String(option.identity)" :value="String(option.identity)">
@@ -243,7 +243,7 @@
<a-textarea v-else-if="field.type === 'textarea'" v-model="actionForm[field.key]" />
<a-date-picker v-else-if="field.type === 'datetime'" v-model="actionForm[field.key]" show-time value-format="YYYY-MM-DDTHH:mm:ssZ" />
<a-select v-else-if="field.type === 'select'" v-model="actionForm[field.key]">
<a-option v-for="option in field.options" :key="option.value" :value="option.value">{{ option.label }}</a-option>
<a-option v-for="option in field.options" :key="option.value" :value="option.value" :disabled="option.disabled">{{ option.label }}{{ option.disabled ? '暂未开通' : '' }}</a-option>
</a-select>
<a-select v-else-if="field.type === 'identity' || field.type === 'identity-list'" v-model="actionForm[field.key]" :multiple="field.type === 'identity-list'" allow-search :loading="relationLoading[field.relation ?? '']" @search="(value: string) => searchRelation(field.relation, value)">
<a-option v-for="option in relationOptions[field.relation ?? ''] ?? []" :key="String(option.identity)" :value="String(option.identity)">{{ optionLabel(option) }}</a-option>