规范气站与配送点提现渠道
This commit is contained in:
@@ -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