oak-pay-business 2.2.2 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/aspects/AspectDict.d.ts +3 -3
- package/es/aspects/index.d.ts +2 -1
- package/es/checkers/accountOper.js +4 -3
- package/es/checkers/offlineAccount.js +4 -1
- package/es/checkers/refund.js +1 -0
- package/es/components/offlineAccount/upsert/web.pc.js +1 -1
- package/es/components/sysAccount/survey/locales/zh-CN.json +3 -1
- package/es/components/sysAccount/survey/web.pc.js +69 -32
- package/es/components/sysAccount/survey/web.pc.module.less +3 -2
- package/es/components/sysAccount/transferList/index.d.ts +3 -0
- package/es/components/sysAccount/transferList/index.js +52 -0
- package/es/components/sysAccount/transferList/index.json +1 -0
- package/es/components/sysAccount/transferList/locales/zh-CN.json +6 -0
- package/es/components/sysAccount/transferList/web.pc.d.ts +12 -0
- package/es/components/sysAccount/transferList/web.pc.js +45 -0
- package/es/components/sysAccountMove/create/index.d.ts +7 -0
- package/es/components/sysAccountMove/create/index.js +145 -0
- package/es/components/sysAccountMove/create/index.json +1 -0
- package/es/components/sysAccountMove/create/locales/zh-CN.json +6 -0
- package/es/components/sysAccountMove/create/web.pc.d.ts +26 -0
- package/es/components/sysAccountMove/create/web.pc.js +68 -0
- package/es/components/sysAccountOper/list/index.d.ts +5 -0
- package/es/components/sysAccountOper/list/index.js +127 -0
- package/es/components/sysAccountOper/list/index.json +1 -0
- package/es/components/sysAccountOper/list/locales/zh-CN.json +5 -0
- package/es/components/sysAccountOper/list/web.module.less +42 -0
- package/es/components/sysAccountOper/list/web.pc.d.ts +25 -0
- package/es/components/sysAccountOper/list/web.pc.js +36 -0
- package/es/components/withdrawTransfer/list/locales/zh-CN.json +1 -1
- package/es/components/wpAccount/upsert/web.pc.js +1 -1
- package/es/configuration/attrUpdateMatrix.js +2 -2
- package/es/data/actionAuth.js +7 -2
- package/es/data/i18n.js +49 -3
- package/es/data/path.js +2 -2
- package/es/entities/AccountOper.d.ts +1 -1
- package/es/entities/AccountOper.js +3 -1
- package/es/entities/OfflineAccount.d.ts +1 -1
- package/es/entities/OfflineAccount.js +8 -2
- package/es/entities/SysAccountMove.d.ts +13 -0
- package/es/entities/SysAccountMove.js +18 -0
- package/es/entities/SysAccountOper.d.ts +4 -1
- package/es/entities/SysAccountOper.js +1 -0
- package/es/entities/WpAccount.d.ts +1 -1
- package/es/entities/WpAccount.js +8 -2
- package/es/locales/error/zh-CN.json +5 -0
- package/es/locales/offlineAccount/zh-CN.json +2 -1
- package/es/oak-app-domain/AccountOper/Schema.d.ts +1 -1
- package/es/oak-app-domain/AccountOper/Storage.js +1 -1
- package/es/oak-app-domain/AccountOper/Style.js +1 -0
- package/es/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/EntityDict.d.ts +2 -0
- package/es/oak-app-domain/OfflineAccount/Action.d.ts +1 -1
- package/es/oak-app-domain/OfflineAccount/Action.js +1 -1
- package/es/oak-app-domain/OfflineAccount/Style.js +4 -1
- package/es/oak-app-domain/OfflineAccount/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/Path/Schema.d.ts +6 -0
- package/es/oak-app-domain/Path/Storage.js +6 -0
- package/es/oak-app-domain/Path/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/Storage.js +2 -0
- package/es/oak-app-domain/SysAccountMove/Schema.d.ts +185 -0
- package/es/oak-app-domain/SysAccountMove/Schema.js +1 -0
- package/es/oak-app-domain/SysAccountMove/Storage.d.ts +3 -0
- package/es/oak-app-domain/SysAccountMove/Storage.js +31 -0
- package/es/oak-app-domain/SysAccountMove/locales/zh_CN.json +1 -0
- package/es/oak-app-domain/SysAccountOper/Schema.d.ts +34 -5
- package/es/oak-app-domain/SysAccountOper/Storage.js +4 -0
- package/es/oak-app-domain/SysAccountOper/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/System/Schema.d.ts +12 -0
- package/es/oak-app-domain/User/Schema.d.ts +12 -0
- package/es/oak-app-domain/WpAccount/Action.d.ts +1 -1
- package/es/oak-app-domain/WpAccount/Action.js +1 -1
- package/es/oak-app-domain/WpAccount/Style.js +4 -1
- package/es/oak-app-domain/WpAccount/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/_SubQuery.d.ts +12 -0
- package/es/triggers/pay.js +149 -46
- package/es/triggers/refund.js +3 -0
- package/es/types/RuntimeCxt.d.ts +1 -1
- package/es/types/sysAccountOper.d.ts +1 -0
- package/es/types/sysAccountOper.js +1 -0
- package/es/utils/payClazz/Account.js +3 -2
- package/lib/aspects/AspectDict.d.ts +3 -3
- package/lib/aspects/index.d.ts +2 -1
- package/lib/checkers/accountOper.js +4 -3
- package/lib/checkers/offlineAccount.js +4 -1
- package/lib/checkers/refund.js +1 -0
- package/lib/configuration/attrUpdateMatrix.js +2 -2
- package/lib/data/actionAuth.js +7 -2
- package/lib/data/i18n.js +49 -3
- package/lib/data/path.js +2 -2
- package/lib/entities/AccountOper.d.ts +1 -1
- package/lib/entities/AccountOper.js +3 -1
- package/lib/entities/OfflineAccount.d.ts +1 -1
- package/lib/entities/OfflineAccount.js +8 -2
- package/lib/entities/SysAccountMove.d.ts +13 -0
- package/lib/entities/SysAccountMove.js +21 -0
- package/lib/entities/SysAccountOper.d.ts +4 -1
- package/lib/entities/SysAccountOper.js +1 -0
- package/lib/entities/WpAccount.d.ts +1 -1
- package/lib/entities/WpAccount.js +8 -2
- package/lib/locales/error/zh-CN.json +5 -0
- package/lib/locales/offlineAccount/zh-CN.json +2 -1
- package/lib/oak-app-domain/AccountOper/Schema.d.ts +1 -1
- package/lib/oak-app-domain/AccountOper/Storage.js +1 -1
- package/lib/oak-app-domain/AccountOper/Style.js +1 -0
- package/lib/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/EntityDict.d.ts +2 -0
- package/lib/oak-app-domain/OfflineAccount/Action.d.ts +1 -1
- package/lib/oak-app-domain/OfflineAccount/Action.js +1 -1
- package/lib/oak-app-domain/OfflineAccount/Style.js +4 -1
- package/lib/oak-app-domain/OfflineAccount/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/Path/Schema.d.ts +6 -0
- package/lib/oak-app-domain/Path/Storage.js +6 -0
- package/lib/oak-app-domain/Path/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/Storage.js +18 -16
- package/lib/oak-app-domain/SysAccountMove/Schema.d.ts +185 -0
- package/lib/oak-app-domain/SysAccountMove/Schema.js +2 -0
- package/lib/oak-app-domain/SysAccountMove/Storage.d.ts +3 -0
- package/lib/oak-app-domain/SysAccountMove/Storage.js +34 -0
- package/lib/oak-app-domain/SysAccountMove/locales/zh_CN.json +1 -0
- package/lib/oak-app-domain/SysAccountOper/Schema.d.ts +34 -5
- package/lib/oak-app-domain/SysAccountOper/Storage.js +4 -0
- package/lib/oak-app-domain/SysAccountOper/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/System/Schema.d.ts +12 -0
- package/lib/oak-app-domain/User/Schema.d.ts +12 -0
- package/lib/oak-app-domain/WpAccount/Action.d.ts +1 -1
- package/lib/oak-app-domain/WpAccount/Action.js +1 -1
- package/lib/oak-app-domain/WpAccount/Style.js +4 -1
- package/lib/oak-app-domain/WpAccount/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/_SubQuery.d.ts +12 -0
- package/lib/triggers/pay.js +149 -46
- package/lib/triggers/refund.js +3 -0
- package/lib/types/RuntimeCxt.d.ts +1 -1
- package/lib/types/sysAccountOper.d.ts +1 -0
- package/lib/types/sysAccountOper.js +2 -0
- package/lib/utils/payClazz/Account.js +3 -2
- package/package.json +4 -4
- package/src/entities/AccountOper.ts +4 -2
- package/src/entities/OfflineAccount.ts +12 -5
- package/src/entities/SysAccountMove.ts +39 -0
- package/src/entities/SysAccountOper.ts +7 -1
- package/src/entities/WpAccount.ts +11 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
|
2
2
|
import { EntityDict } from '../oak-app-domain';
|
|
3
|
-
export type AspectDict = {
|
|
3
|
+
export type AspectDict<ED extends EntityDict> = {
|
|
4
4
|
getWithdrawCreateData: (params: {
|
|
5
5
|
accountId: string;
|
|
6
6
|
price: number;
|
|
7
7
|
withdrawAccountId?: string;
|
|
8
|
-
}, context:
|
|
8
|
+
}, context: BackendRuntimeContext<ED>) => Promise<EntityDict['withdraw']['CreateSingle']['data']>;
|
|
9
9
|
};
|
package/es/aspects/index.d.ts
CHANGED
|
@@ -54,14 +54,15 @@ const checkers = [
|
|
|
54
54
|
case 'refund':
|
|
55
55
|
case 'withdraw': {
|
|
56
56
|
if (totalPlus >= 0 || availPlus >= 0 || totalPlus !== availPlus) {
|
|
57
|
-
throw new OakInputIllegalException('accountOper', ['availPlus'],
|
|
57
|
+
throw new OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}时,其totalPlus和availPlus必须为不相等的负数`);
|
|
58
58
|
}
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
case 'refundFailure':
|
|
62
|
-
case 'withdrawBack':
|
|
62
|
+
case 'withdrawBack':
|
|
63
|
+
case 'consumeBack': {
|
|
63
64
|
if (totalPlus <= 0 || availPlus <= 0 || totalPlus !== availPlus) {
|
|
64
|
-
throw new OakInputIllegalException('accountOper', ['availPlus'],
|
|
65
|
+
throw new OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}时,其totalPlus和availPlus必须为不相等的正数`);
|
|
65
66
|
}
|
|
66
67
|
break;
|
|
67
68
|
}
|
|
@@ -27,13 +27,16 @@ function checkAttributes(data) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
const { refundCompensateRatio, refundGapDays } = data;
|
|
30
|
+
const { refundCompensateRatio, refundGapDays, withdrawTransferLossRatio } = data;
|
|
31
31
|
if (typeof refundGapDays !== 'number' || refundGapDays < 0) {
|
|
32
32
|
throw new OakInputIllegalException('offlineAccount', ['refundGapDays'], 'offlineAccount::error.refundGapDaysNotNegative');
|
|
33
33
|
}
|
|
34
34
|
if (typeof refundCompensateRatio !== 'number' || refundCompensateRatio < 0 || refundCompensateRatio > 100) {
|
|
35
35
|
throw new OakInputIllegalException('offlineAccount', ['refundGapDays'], 'offlineAccount::error.refundCompensateIllegal');
|
|
36
36
|
}
|
|
37
|
+
if (typeof withdrawTransferLossRatio !== 'number' || withdrawTransferLossRatio < 0) {
|
|
38
|
+
throw new OakInputIllegalException('offlineAccount', ['withdrawTransferLossRatio'], 'offlineAccount::error.withdrawTransferLossRatioNotNegative');
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
41
|
const checkers = [
|
|
39
42
|
{
|
package/es/checkers/refund.js
CHANGED
|
@@ -74,7 +74,7 @@ export default function render(props) {
|
|
|
74
74
|
update({ allowWithdrawTransfer });
|
|
75
75
|
}}/>
|
|
76
76
|
</Form.Item>
|
|
77
|
-
<Form.Item label={t('offlineAccount:attr.withdrawTransferLossRatio')} help={t('placeholder.withdrawTransferLossRatio')}>
|
|
77
|
+
<Form.Item label={t('offlineAccount:attr.withdrawTransferLossRatio')} help={t('placeholder.withdrawTransferLossRatio')} required>
|
|
78
78
|
<InputNumber value={offlineAccount.withdrawTransferLossRatio} max={5} min={0.01} addonAfter={"%"} step={0.01} precision={2} onChange={(value) => {
|
|
79
79
|
const withdrawTransferLossRatio = value;
|
|
80
80
|
update({ withdrawTransferLossRatio });
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { Descriptions, Tag, Modal, Flex, Button, Divider, Alert } from 'antd';
|
|
3
3
|
import { AlipayOutlined, WechatOutlined } from '@ant-design/icons';
|
|
4
4
|
import Styles from './web.pc.module.less';
|
|
5
5
|
import { ThousandCont, ToYuan } from "oak-domain/lib/utils/money";
|
|
6
6
|
import { OfflineAccount as OADetail } from '../../offlineAccount/config/web.pc';
|
|
7
7
|
import { WpAccount as WADetail } from '../../wpAccount/config/web.pc';
|
|
8
|
+
import TransferList from '../transferList';
|
|
9
|
+
import SysAccountMoveCreate from '../../sysAccountMove/create';
|
|
10
|
+
import SysAccountOperList from '../../sysAccountOper/list';
|
|
8
11
|
function OfflineAccount(props) {
|
|
9
12
|
const { data, t } = props;
|
|
10
13
|
const { type, channel, color, name } = data;
|
|
@@ -65,6 +68,10 @@ export default function render(props) {
|
|
|
65
68
|
const { accounts, total, systemId, accountNum, accountTotalSum, accountAvailSum, refundCnt, refundPriceSum, transferCnt, transferPriceSum, orderCnt, orderPaidSum, orderRefundSum, } = props.data;
|
|
66
69
|
const { t, setMessage } = props.methods;
|
|
67
70
|
if (accounts && systemId) {
|
|
71
|
+
const [showTransferList, setShowTransferList] = useState(false);
|
|
72
|
+
const [showMoveCreate, setShowMoveCreate] = useState(false);
|
|
73
|
+
const [showHistoryList, setShowHistoryList] = useState(false);
|
|
74
|
+
const [showHistoryAcc, setShowHistoryAcc] = useState(undefined);
|
|
68
75
|
return (<div className={Styles.container}>
|
|
69
76
|
<Descriptions title={t('sysAccount')} bordered items={[
|
|
70
77
|
{
|
|
@@ -78,7 +85,14 @@ export default function render(props) {
|
|
|
78
85
|
label: t('count'),
|
|
79
86
|
children: accounts.length,
|
|
80
87
|
}
|
|
81
|
-
]} column={2}
|
|
88
|
+
]} column={2} extra={<>
|
|
89
|
+
<Button type="primary" onClick={() => setShowMoveCreate(true)}>
|
|
90
|
+
{t('move')}
|
|
91
|
+
</Button>
|
|
92
|
+
<Modal destroyOnClose open={showMoveCreate} onCancel={() => setShowMoveCreate(false)} closeIcon={null} width={800} title={t('move')} footer={null}>
|
|
93
|
+
<SysAccountMoveCreate oakPath="$opb-sysAccount-survery-saMoveCreate" systemId={systemId} onSuccess={() => setShowMoveCreate(false)}/>
|
|
94
|
+
</Modal>
|
|
95
|
+
</>}/>
|
|
82
96
|
<div className={Styles.sysAccounts}>
|
|
83
97
|
{accounts.map(({ entity, data }, idx) => {
|
|
84
98
|
const TopRender = RenderSysAccountCardTopDict[entity];
|
|
@@ -92,6 +106,12 @@ export default function render(props) {
|
|
|
92
106
|
</div>
|
|
93
107
|
<div className={Styles.bottom}>
|
|
94
108
|
<Button onClick={() => {
|
|
109
|
+
setShowHistoryAcc({ entity, data });
|
|
110
|
+
setShowHistoryList(true);
|
|
111
|
+
}} style={{ marginRight: 8, }}>
|
|
112
|
+
{t('history')}
|
|
113
|
+
</Button>
|
|
114
|
+
<Button onClick={() => {
|
|
95
115
|
const DetailRender = RenderSysAccountDetailDict[entity];
|
|
96
116
|
if (DetailRender) {
|
|
97
117
|
Modal.info({
|
|
@@ -110,6 +130,20 @@ export default function render(props) {
|
|
|
110
130
|
}}>
|
|
111
131
|
{t('common::action.detail')}
|
|
112
132
|
</Button>
|
|
133
|
+
|
|
134
|
+
{!!showHistoryAcc && showHistoryList &&
|
|
135
|
+
<Modal destroyOnClose open={showHistoryList} onCancel={() => {
|
|
136
|
+
setShowHistoryAcc(undefined);
|
|
137
|
+
setShowHistoryList(false);
|
|
138
|
+
}} width={800} title={showHistoryAcc.entity === 'offlineAccount' ?
|
|
139
|
+
(showHistoryAcc.data.type === 'bank' ?
|
|
140
|
+
`${t(`${showHistoryAcc.entity}:v.type.${showHistoryAcc.data.type}`)}-${showHistoryAcc.data.channel}-${t('history')}`
|
|
141
|
+
: `${t(`${showHistoryAcc.entity}:v.type.${showHistoryAcc.data.type}`)}-${showHistoryAcc.data.name}-${t('history')}`) : `${t(`${showHistoryAcc.entity}:name`)}-${t('history')}`} footer={null}>
|
|
142
|
+
<div style={{ height: '65vh' }}>
|
|
143
|
+
<SysAccountOperList entity={showHistoryAcc.entity} entityId={showHistoryAcc.data.id} oakPath="$opb-sysAccount-survery-operList"/>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
</Modal>}
|
|
113
147
|
</div>
|
|
114
148
|
</div>);
|
|
115
149
|
})}
|
|
@@ -119,16 +153,16 @@ export default function render(props) {
|
|
|
119
153
|
{
|
|
120
154
|
label: t('accountTotalSum'),
|
|
121
155
|
children: <div className={Styles.total}>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
156
|
+
<span className={Styles.symbol}>{t('common::pay.symbol')}</span>
|
|
157
|
+
<span className={Styles.value}>{ThousandCont(ToYuan(accountTotalSum || 0), 2)}</span>
|
|
158
|
+
</div>
|
|
125
159
|
},
|
|
126
160
|
{
|
|
127
161
|
label: t('accountAvailSum'),
|
|
128
162
|
children: <div className={Styles.total}>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
163
|
+
<span className={Styles.symbol}>{t('common::pay.symbol')}</span>
|
|
164
|
+
<span className={Styles.value}>{ThousandCont(ToYuan(accountAvailSum || 0), 2)}</span>
|
|
165
|
+
</div>
|
|
132
166
|
},
|
|
133
167
|
{
|
|
134
168
|
label: t('accountNum'),
|
|
@@ -142,14 +176,14 @@ export default function render(props) {
|
|
|
142
176
|
label: t('refundPriceSum'),
|
|
143
177
|
span: 2,
|
|
144
178
|
children: (<div className={Styles.span2}>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
179
|
+
<span className={Styles.total}>
|
|
180
|
+
<span className={Styles.symbol}>{t('common::pay.symbol')}</span>
|
|
181
|
+
<span className={Styles.value}>{ThousandCont(ToYuan(refundPriceSum || 0), 2)}</span>
|
|
182
|
+
</span>
|
|
183
|
+
<Button style={{ marginLeft: 20 }}>
|
|
184
|
+
{t('refundList')}
|
|
185
|
+
</Button>
|
|
186
|
+
</div>)
|
|
153
187
|
},
|
|
154
188
|
{
|
|
155
189
|
label: t('transferCnt'),
|
|
@@ -159,14 +193,17 @@ export default function render(props) {
|
|
|
159
193
|
label: t('transferPriceSum'),
|
|
160
194
|
span: 2,
|
|
161
195
|
children: (<div className={Styles.span2}>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
196
|
+
<span className={Styles.total}>
|
|
197
|
+
<span className={Styles.symbol}>{t('common::pay.symbol')}</span>
|
|
198
|
+
<span className={Styles.value}>{ThousandCont(ToYuan(transferPriceSum || 0), 2)}</span>
|
|
199
|
+
</span>
|
|
200
|
+
<Button onClick={() => setShowTransferList(true)}>
|
|
201
|
+
{t('transferList')}
|
|
202
|
+
</Button>
|
|
203
|
+
<Modal open={showTransferList} onCancel={() => setShowTransferList(false)} footer={null} closeIcon={null} width={800}>
|
|
204
|
+
<TransferList oakPath="$opb-sysAccount-survery-transferList"/>
|
|
205
|
+
</Modal>
|
|
206
|
+
</div>)
|
|
170
207
|
},
|
|
171
208
|
{
|
|
172
209
|
label: t('orderCnt'),
|
|
@@ -175,14 +212,14 @@ export default function render(props) {
|
|
|
175
212
|
{
|
|
176
213
|
label: t('orderPriceSum'),
|
|
177
214
|
children: (<div className={Styles.span2}>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
215
|
+
<div className={Styles.total}>
|
|
216
|
+
<span className={Styles.symbol}>{t('common::pay.symbol')}</span>
|
|
217
|
+
<span className={Styles.value}>{ThousandCont(ToYuan((orderPaidSum || 0) - (orderRefundSum || 0)), 2)}</span>
|
|
218
|
+
</div>
|
|
219
|
+
<Button>
|
|
220
|
+
{t('orderList')}
|
|
221
|
+
</Button>
|
|
222
|
+
</div>)
|
|
186
223
|
}
|
|
187
224
|
]} column={3}/>}
|
|
188
225
|
</div>);
|
|
@@ -19,13 +19,14 @@
|
|
|
19
19
|
padding: 8px;
|
|
20
20
|
flex-wrap: wrap;
|
|
21
21
|
margin-top: 12px;
|
|
22
|
+
gap: 14px;
|
|
22
23
|
|
|
23
24
|
.sysAccount {
|
|
24
25
|
width: 244px;
|
|
25
26
|
height: 284px;
|
|
26
27
|
border: solid 0.1px silver;
|
|
27
28
|
border-radius: 5px;
|
|
28
|
-
margin-right: 14px;
|
|
29
|
+
// margin-right: 14px;
|
|
29
30
|
display: flex;
|
|
30
31
|
flex-direction: column;
|
|
31
32
|
align-items: stretch;
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
|
|
68
69
|
.span2 {
|
|
69
70
|
display: flex;
|
|
70
71
|
flex-direction: row;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
2
|
+
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "withdrawTransfer", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default OakComponent({
|
|
2
|
+
entity: 'withdrawTransfer',
|
|
3
|
+
isList: true,
|
|
4
|
+
projection: {
|
|
5
|
+
id: 1,
|
|
6
|
+
price: 1,
|
|
7
|
+
loss: 1,
|
|
8
|
+
externalId: 1,
|
|
9
|
+
iState: 1,
|
|
10
|
+
withdrawAccount: {
|
|
11
|
+
org: 1,
|
|
12
|
+
name: 1,
|
|
13
|
+
code: 1,
|
|
14
|
+
channel: {
|
|
15
|
+
entity: 1,
|
|
16
|
+
entityId: 1,
|
|
17
|
+
offlineAccount: {
|
|
18
|
+
id: 1,
|
|
19
|
+
type: 1,
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
id: 1,
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
filters: [
|
|
26
|
+
{
|
|
27
|
+
filter() {
|
|
28
|
+
const systemId = this.features.application.getApplication().systemId;
|
|
29
|
+
return {
|
|
30
|
+
withdrawAccount: {
|
|
31
|
+
ofSystemId: systemId,
|
|
32
|
+
},
|
|
33
|
+
iState: 'transferring',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
formData({ data }) {
|
|
39
|
+
return {
|
|
40
|
+
transfers: data?.map((ele) => {
|
|
41
|
+
const { withdrawAccount, ...rest } = ele;
|
|
42
|
+
const { entity, offlineAccount } = withdrawAccount.channel;
|
|
43
|
+
const channel = entity === 'offlineAccount' ? this.t(`withdraw::channel.offlineAccount.${offlineAccount?.type}`) : this.t(`withdraw::channel.${entity}`);
|
|
44
|
+
return {
|
|
45
|
+
...rest,
|
|
46
|
+
withdrawAccount,
|
|
47
|
+
channel,
|
|
48
|
+
};
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RowWithActions, WebComponentProps } from 'oak-frontend-base';
|
|
3
|
+
import { EntityDict } from '../../../oak-app-domain';
|
|
4
|
+
export default function Render(props: WebComponentProps<EntityDict, 'pay', false, {
|
|
5
|
+
transfers?: (RowWithActions<EntityDict, 'withdrawTransfer'> & {
|
|
6
|
+
creatorName: string;
|
|
7
|
+
creatorMobile: string;
|
|
8
|
+
operatorName: string;
|
|
9
|
+
operatorMobile: string;
|
|
10
|
+
channel: string;
|
|
11
|
+
})[];
|
|
12
|
+
}>): React.JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Result, Alert } from 'antd';
|
|
3
|
+
import ListPro from 'oak-frontend-base/es/components/listPro';
|
|
4
|
+
import { ThousandCont, ToYuan } from 'oak-domain/lib/utils/money';
|
|
5
|
+
export default function Render(props) {
|
|
6
|
+
const { transfers, oakFullpath, oakExecutable } = props.data;
|
|
7
|
+
const { t } = props.methods;
|
|
8
|
+
if (transfers?.length) {
|
|
9
|
+
return (<ListPro entity="withdrawTransfer" data={transfers} title={<Alert type="info" message={t('tips')}/>} attributes={[
|
|
10
|
+
{
|
|
11
|
+
path: 'price',
|
|
12
|
+
label: t('withdrawTransfer:attr.price'),
|
|
13
|
+
width: 100,
|
|
14
|
+
render: (row) => {
|
|
15
|
+
return `${t('common::pay.symbol')} ${ThousandCont(ToYuan(row.price), 2)}`;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
path: 'loss',
|
|
20
|
+
label: t('withdrawTransfer:attr.loss'),
|
|
21
|
+
width: 100,
|
|
22
|
+
render: (row) => {
|
|
23
|
+
return `${t('common::pay.symbol')} ${ThousandCont(ToYuan(row.loss), 2)}`;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
path: '$$createAt$$',
|
|
28
|
+
label: t('common::$$createAt$$'),
|
|
29
|
+
width: 100,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
path: 'channel',
|
|
33
|
+
label: t('label.channel'),
|
|
34
|
+
type: 'string',
|
|
35
|
+
width: 100,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
path: 'externalId',
|
|
39
|
+
label: t('withdrawTransfer:attr.externalId'),
|
|
40
|
+
width: 120,
|
|
41
|
+
},
|
|
42
|
+
]} disabledOp={true}/>);
|
|
43
|
+
}
|
|
44
|
+
return (<Result status="404" title={t('common::noData')}/>);
|
|
45
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EntityDict } from "../../../oak-app-domain";
|
|
2
|
+
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, boolean, {
|
|
3
|
+
systemId: string;
|
|
4
|
+
entities: string[];
|
|
5
|
+
onSuccess: (id: string) => void;
|
|
6
|
+
}>) => React.ReactElement;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { uniq } from "oak-domain/lib/utils/lodash";
|
|
2
|
+
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
|
3
|
+
import { ThousandCont, ToCent, ToYuan } from 'oak-domain/lib/utils/money';
|
|
4
|
+
export default OakComponent({
|
|
5
|
+
properties: {
|
|
6
|
+
systemId: '',
|
|
7
|
+
entities: [],
|
|
8
|
+
onSuccess: (id) => undefined,
|
|
9
|
+
},
|
|
10
|
+
data: {
|
|
11
|
+
accounts: [],
|
|
12
|
+
fromEntity: '',
|
|
13
|
+
fromEntityId: '',
|
|
14
|
+
toEntity: '',
|
|
15
|
+
toEntityId: '',
|
|
16
|
+
price: 0,
|
|
17
|
+
externalId: '',
|
|
18
|
+
remark: '',
|
|
19
|
+
max: 0,
|
|
20
|
+
},
|
|
21
|
+
lifetimes: {
|
|
22
|
+
ready() {
|
|
23
|
+
this.refreshSysAccount();
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
methods: {
|
|
27
|
+
async refreshSysAccount() {
|
|
28
|
+
const { entities, systemId } = this.props;
|
|
29
|
+
const accounts2 = await Promise.all(uniq(['wpAccount', 'offlineAccount'].concat(entities || [])).map(async (entity) => {
|
|
30
|
+
const { data: rows } = await this.features.cache.refresh(entity, {
|
|
31
|
+
data: entity === 'offlineAccount' ? {
|
|
32
|
+
id: 1,
|
|
33
|
+
price: 1,
|
|
34
|
+
name: 1,
|
|
35
|
+
type: 1,
|
|
36
|
+
channel: 1,
|
|
37
|
+
} : {
|
|
38
|
+
id: 1,
|
|
39
|
+
price: 1,
|
|
40
|
+
},
|
|
41
|
+
filter: {
|
|
42
|
+
systemId,
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const accounts = rows.map((row) => {
|
|
46
|
+
const { id, price, name, type, channel } = row;
|
|
47
|
+
return {
|
|
48
|
+
id: id,
|
|
49
|
+
entity: entity,
|
|
50
|
+
priceStr: ThousandCont(ToYuan(price)),
|
|
51
|
+
price: price,
|
|
52
|
+
label: entity === 'offlineAccount' ? `${this.t(`${entity}:name`)}-${this.t(`offlineAccount:v.type.${type}`)}` : this.t(`${entity}:name`),
|
|
53
|
+
name: name || undefined,
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
return accounts;
|
|
57
|
+
}));
|
|
58
|
+
this.setState({
|
|
59
|
+
accounts: accounts2.flat(),
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
setFromId(id) {
|
|
63
|
+
const { accounts } = this.state;
|
|
64
|
+
const account = accounts.find(ele => ele.id === id);
|
|
65
|
+
this.setState({
|
|
66
|
+
fromEntity: account.entity,
|
|
67
|
+
fromEntityId: account.id,
|
|
68
|
+
max: ToYuan(account.price),
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
setToId(id) {
|
|
72
|
+
const { accounts } = this.state;
|
|
73
|
+
const account = accounts.find(ele => ele.id === id);
|
|
74
|
+
this.setState({
|
|
75
|
+
toEntity: account.entity,
|
|
76
|
+
toEntityId: account.id,
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
setPrice(price) {
|
|
80
|
+
this.setState({
|
|
81
|
+
price,
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
setExternalId(externalId) {
|
|
85
|
+
this.setState({
|
|
86
|
+
externalId,
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
setRemark(remark) {
|
|
90
|
+
this.setState({
|
|
91
|
+
remark,
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
async createMove() {
|
|
95
|
+
const { fromEntity, fromEntityId, toEntity, toEntityId, price, remark, externalId } = this.state;
|
|
96
|
+
const userId = this.features.token.getUserId();
|
|
97
|
+
const systemId = this.features.application.getApplication().systemId;
|
|
98
|
+
const id = await generateNewIdAsync();
|
|
99
|
+
const price2 = ToCent(price);
|
|
100
|
+
const { onSuccess } = this.props;
|
|
101
|
+
await this.execute(undefined, undefined, undefined, [
|
|
102
|
+
{
|
|
103
|
+
entity: 'sysAccountMove',
|
|
104
|
+
operation: {
|
|
105
|
+
id: await generateNewIdAsync(),
|
|
106
|
+
action: 'create',
|
|
107
|
+
data: {
|
|
108
|
+
id,
|
|
109
|
+
price: price2,
|
|
110
|
+
externalId,
|
|
111
|
+
remark,
|
|
112
|
+
systemId,
|
|
113
|
+
operatorId: userId,
|
|
114
|
+
sysAccountOper$sysAccountMove: [
|
|
115
|
+
{
|
|
116
|
+
id: await generateNewIdAsync(),
|
|
117
|
+
action: 'create',
|
|
118
|
+
data: {
|
|
119
|
+
id: await generateNewIdAsync(),
|
|
120
|
+
entity: fromEntity,
|
|
121
|
+
entityId: fromEntityId,
|
|
122
|
+
delta: -price2,
|
|
123
|
+
type: 'moveOut',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: await generateNewIdAsync(),
|
|
128
|
+
action: 'create',
|
|
129
|
+
data: {
|
|
130
|
+
id: await generateNewIdAsync(),
|
|
131
|
+
entity: toEntity,
|
|
132
|
+
entityId: toEntityId,
|
|
133
|
+
delta: price2,
|
|
134
|
+
type: 'moveIn',
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
}
|
|
141
|
+
]);
|
|
142
|
+
onSuccess && onSuccess(id);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WebComponentProps } from 'oak-frontend-base';
|
|
3
|
+
import { EntityDict } from '../../../oak-app-domain';
|
|
4
|
+
export default function Render(props: WebComponentProps<EntityDict, 'pay', false, {
|
|
5
|
+
fromEntityId?: string;
|
|
6
|
+
toEntityId?: string;
|
|
7
|
+
price: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
externalId: string;
|
|
10
|
+
remark: string;
|
|
11
|
+
accounts: Array<{
|
|
12
|
+
id: string;
|
|
13
|
+
entity: string;
|
|
14
|
+
price: number;
|
|
15
|
+
priceStr: string;
|
|
16
|
+
label: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
}>;
|
|
19
|
+
}, {
|
|
20
|
+
setFromId: (id: string) => void;
|
|
21
|
+
setToId: (id: string) => void;
|
|
22
|
+
setPrice: (price: number) => void;
|
|
23
|
+
setExternalId: (externalId: string) => void;
|
|
24
|
+
setRemark: (remark: string) => void;
|
|
25
|
+
createMove: () => Promise<void>;
|
|
26
|
+
}>): React.JSX.Element | null;
|