规范气站与配送点提现渠道
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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', []),
|
||||
];
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -13,6 +13,10 @@ const listPageSource = readFileSync(
|
||||
resolve(root, 'src/views/shared/CrudListPage.vue'),
|
||||
'utf8',
|
||||
);
|
||||
const fieldFormSource = readFileSync(
|
||||
resolve(root, 'src/views/resource/ResourceFieldForm.vue'),
|
||||
'utf8',
|
||||
);
|
||||
const contract = JSON.parse(
|
||||
readFileSync(resolve(root, 'src/contracts/gas-resources.json'), 'utf8'),
|
||||
);
|
||||
@@ -54,6 +58,17 @@ if (searchSource.includes('关键字段模糊搜索'))
|
||||
throw new Error('列表搜索不得使用含义不明确的兜底提示');
|
||||
if (!listPageSource.includes('<a-form v-if="searchEnabled"'))
|
||||
throw new Error('不支持搜索的资源必须隐藏完整搜索区域');
|
||||
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}`);
|
||||
}
|
||||
if (!fieldFormSource.includes(':disabled="option.disabled"'))
|
||||
throw new Error('未开通的提现渠道必须在下拉框中禁用');
|
||||
|
||||
const forbidden = [
|
||||
'/platform/platform_', '/gas/gas_', '/delivery/delivery_', '/staff/',
|
||||
|
||||
@@ -75,7 +75,7 @@ export type ResourceField = {
|
||||
listDisplayIdentityCopy?: boolean;
|
||||
listHidden?: boolean;
|
||||
displayPrecision?: number;
|
||||
options?: Array<{ label: string; value: string | number }>;
|
||||
options?: Array<{ label: string; value: string | number; disabled?: boolean }>;
|
||||
defaultValue?: string | number | boolean;
|
||||
readonly?: boolean;
|
||||
readonlyOnCreate?: boolean;
|
||||
@@ -400,6 +400,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)]),
|
||||
@@ -540,7 +553,7 @@ const gasOverrides: ResourceUiDefinition[] = [
|
||||
define('payment_order', '支付记录', 'readonly', []),
|
||||
define('wallet_record', '钱包流水', 'readonly', []),
|
||||
define('payment_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 })]),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
功能:渲染标准资源的新建、编辑和业务动作字段控件。
|
||||
版本:v1.4.1
|
||||
版本:v1.4.2
|
||||
-->
|
||||
<template>
|
||||
<div class="field-grid">
|
||||
@@ -78,8 +78,13 @@
|
||||
allow-clear
|
||||
@change="(value: unknown) => emit('change-relation', field, value)"
|
||||
>
|
||||
<a-option v-for="option in selectOptions(field)" :key="option.value" :value="option.value">
|
||||
{{ option.label }}
|
||||
<a-option
|
||||
v-for="option in selectOptions(field)"
|
||||
:key="option.value"
|
||||
:value="option.value"
|
||||
:disabled="option.disabled"
|
||||
>
|
||||
{{ option.label }}{{ option.disabled ? '(暂未开通)' : '' }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
<div v-else-if="field.type === 'identity' || field.type === 'identity-list'" class="relation-control">
|
||||
|
||||
Reference in New Issue
Block a user