oak-pay-business 3.1.1 → 3.1.3
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/checkers/accountOper.js +11 -11
- package/es/checkers/index.js +2 -0
- package/es/checkers/order.js +46 -37
- package/es/checkers/settlePlan.d.ts +5 -0
- package/es/checkers/settlePlan.js +105 -0
- package/es/components/AbstractComponents.d.ts +67 -11
- package/es/components/accountOper/pure/List.pc.d.ts +1 -0
- package/es/components/offlineAccount/upsert/index.d.ts +1 -0
- package/es/components/order/list/index.d.ts +1 -0
- package/es/components/order/pay/index.d.ts +1 -1
- package/es/components/order/pay/index.js +3 -3
- package/es/components/order/pay/info.d.ts +1 -0
- package/es/components/pay/channelPicker2/web.d.ts +1 -0
- package/es/components/pay/channelPicker2/web.pc.d.ts +1 -0
- package/es/components/pay/list/index.d.ts +1 -0
- package/es/components/payConfig/system/index.d.ts +1 -0
- package/es/components/refund/list/index.d.ts +1 -0
- package/es/components/ship/system/index.d.ts +1 -0
- package/es/components/ship/wechatMpShip/upsert/index.d.ts +1 -0
- package/es/components/sysAccount/survey/index.js +1 -1
- package/es/components/sysAccount/transferList/index.d.ts +1 -0
- package/es/components/withdraw/detail/index.d.ts +1 -0
- package/es/components/withdraw/display/web.d.ts +1 -0
- package/es/components/withdraw/display/web.pc.d.ts +1 -0
- package/es/components/withdrawTransfer/list/index.d.ts +1 -0
- package/es/data/i18n.js +8 -2
- package/es/entities/AccountOper.d.ts +1 -1
- package/es/entities/AccountOper.js +0 -2
- package/es/entities/ApAccount.js +1 -1
- package/es/entities/Order.d.ts +3 -2
- package/es/entities/Order.js +2 -3
- package/es/entities/SettlePlan.d.ts +19 -0
- package/es/entities/SettlePlan.js +47 -0
- package/es/entities/Settlement.d.ts +8 -6
- package/es/entities/Settlement.js +8 -6
- package/es/locales/error/zh-CN.json +8 -2
- package/es/oak-app-domain/AccountOper/Storage.js +1 -1
- package/es/oak-app-domain/AccountOper/Style.js +0 -1
- package/es/oak-app-domain/AccountOper/_baseSchema.d.ts +1 -1
- package/es/oak-app-domain/AccountOper/locales/zh_CN.json +0 -1
- package/es/oak-app-domain/ActionDefDict.d.ts +3 -0
- package/es/oak-app-domain/ActionDefDict.js +2 -0
- package/es/oak-app-domain/EntityDict.d.ts +65 -15
- package/es/oak-app-domain/Order/Action.d.ts +1 -1
- package/es/oak-app-domain/Order/Action.js +1 -1
- package/es/oak-app-domain/Order/Storage.js +8 -4
- package/es/oak-app-domain/Order/Style.js +0 -1
- package/es/oak-app-domain/Order/_baseSchema.d.ts +8 -4
- package/es/oak-app-domain/Order/locales/zh_CN.json +3 -3
- package/es/oak-app-domain/SettlePlan/Action.d.ts +11 -0
- package/es/oak-app-domain/SettlePlan/Action.js +11 -0
- package/es/oak-app-domain/SettlePlan/Schema.d.ts +19 -0
- package/es/oak-app-domain/SettlePlan/Schema.js +1 -0
- package/es/oak-app-domain/SettlePlan/Storage.d.ts +3 -0
- package/es/oak-app-domain/SettlePlan/Storage.js +29 -0
- package/es/oak-app-domain/SettlePlan/Style.d.ts +3 -0
- package/es/oak-app-domain/SettlePlan/Style.js +13 -0
- package/es/oak-app-domain/SettlePlan/_baseSchema.d.ts +57 -0
- package/es/oak-app-domain/SettlePlan/_baseSchema.js +1 -0
- package/es/oak-app-domain/SettlePlan/locales/zh_CN.json +22 -0
- package/es/oak-app-domain/Settlement/Action.d.ts +3 -3
- package/es/oak-app-domain/Settlement/Action.js +2 -1
- package/es/oak-app-domain/Settlement/Storage.js +11 -5
- package/es/oak-app-domain/Settlement/Style.js +2 -2
- package/es/oak-app-domain/Settlement/_baseSchema.d.ts +13 -5
- package/es/oak-app-domain/Settlement/locales/zh_CN.json +7 -6
- package/es/oak-app-domain/Storage.js +2 -0
- package/es/oak-app-domain/StyleDict.js +2 -0
- package/es/oak-app-domain/System/Storage.js +2 -1
- package/es/timers/index.d.ts +1 -1
- package/es/triggers/index.js +2 -0
- package/es/triggers/order.js +32 -27
- package/es/triggers/refund.js +136 -90
- package/es/triggers/settlePlan.d.ts +5 -0
- package/es/triggers/settlePlan.js +284 -0
- package/es/triggers/withdraw.d.ts +1 -1
- package/es/types/Exception.d.ts +67 -1
- package/es/types/Exception.js +62 -2
- package/es/utils/pay.d.ts +1 -0
- package/es/utils/payClazz/AliPay/AliPay.js +4 -4
- package/es/utils/ship.js +2 -2
- package/es/utils/shipClazz/WechatMpShip/WechatMpShip.debug.js +3 -3
- package/es/watchers/index.js +2 -0
- package/es/watchers/pay.js +1 -2
- package/es/watchers/settlePlan.d.ts +5 -0
- package/es/watchers/settlePlan.js +37 -0
- package/lib/aspects/ship.js +3 -2
- package/lib/aspects/withdraw.js +2 -1
- package/lib/checkers/abstractChecker.js +2 -2
- package/lib/checkers/accountOper.js +11 -11
- package/lib/checkers/index.js +2 -0
- package/lib/checkers/order.js +46 -37
- package/lib/checkers/settlePlan.d.ts +5 -0
- package/lib/checkers/settlePlan.js +107 -0
- package/lib/data/i18n.js +8 -2
- package/lib/entities/AccountOper.d.ts +1 -1
- package/lib/entities/AccountOper.js +0 -2
- package/lib/entities/ApAccount.js +1 -1
- package/lib/entities/Order.d.ts +3 -2
- package/lib/entities/Order.js +2 -3
- package/lib/entities/SettlePlan.d.ts +19 -0
- package/lib/entities/SettlePlan.js +50 -0
- package/lib/entities/Settlement.d.ts +8 -6
- package/lib/entities/Settlement.js +8 -6
- package/lib/features/index.js +3 -2
- package/lib/hooks/useFeatures.js +1 -1
- package/lib/locales/error/zh-CN.json +8 -2
- package/lib/oak-app-domain/AccountOper/Storage.js +1 -1
- package/lib/oak-app-domain/AccountOper/Style.js +0 -1
- package/lib/oak-app-domain/AccountOper/_baseSchema.d.ts +1 -1
- package/lib/oak-app-domain/AccountOper/locales/zh_CN.json +0 -1
- package/lib/oak-app-domain/ActionDefDict.d.ts +3 -0
- package/lib/oak-app-domain/ActionDefDict.js +16 -14
- package/lib/oak-app-domain/EntityDict.d.ts +65 -15
- package/lib/oak-app-domain/Order/Action.d.ts +1 -1
- package/lib/oak-app-domain/Order/Action.js +1 -1
- package/lib/oak-app-domain/Order/Storage.js +8 -4
- package/lib/oak-app-domain/Order/Style.js +0 -1
- package/lib/oak-app-domain/Order/_baseSchema.d.ts +8 -4
- package/lib/oak-app-domain/Order/locales/zh_CN.json +3 -3
- package/lib/oak-app-domain/SettlePlan/Action.d.ts +11 -0
- package/lib/oak-app-domain/SettlePlan/Action.js +14 -0
- package/lib/oak-app-domain/SettlePlan/Schema.d.ts +19 -0
- package/lib/oak-app-domain/SettlePlan/Schema.js +4 -0
- package/lib/oak-app-domain/SettlePlan/Storage.d.ts +3 -0
- package/lib/oak-app-domain/SettlePlan/Storage.js +32 -0
- package/lib/oak-app-domain/SettlePlan/Style.d.ts +3 -0
- package/lib/oak-app-domain/SettlePlan/Style.js +16 -0
- package/lib/oak-app-domain/SettlePlan/_baseSchema.d.ts +57 -0
- package/lib/oak-app-domain/SettlePlan/_baseSchema.js +2 -0
- package/lib/oak-app-domain/SettlePlan/locales/zh_CN.json +22 -0
- package/lib/oak-app-domain/Settlement/Action.d.ts +3 -3
- package/lib/oak-app-domain/Settlement/Action.js +2 -1
- package/lib/oak-app-domain/Settlement/Storage.js +11 -5
- package/lib/oak-app-domain/Settlement/Style.js +2 -2
- package/lib/oak-app-domain/Settlement/_baseSchema.d.ts +13 -5
- package/lib/oak-app-domain/Settlement/locales/zh_CN.json +7 -6
- package/lib/oak-app-domain/Storage.js +32 -30
- package/lib/oak-app-domain/StyleDict.js +20 -18
- package/lib/oak-app-domain/System/Storage.js +2 -1
- package/lib/timers/index.d.ts +1 -1
- package/lib/triggers/index.js +2 -0
- package/lib/triggers/order.js +39 -35
- package/lib/triggers/refund.js +135 -89
- package/lib/triggers/settlePlan.d.ts +5 -0
- package/lib/triggers/settlePlan.js +287 -0
- package/lib/triggers/withdraw.d.ts +1 -1
- package/lib/triggers/withdraw.js +2 -1
- package/lib/types/DependentExceptions.js +1 -1
- package/lib/types/Exception.d.ts +67 -1
- package/lib/types/Exception.js +67 -4
- package/lib/utils/apProduct.js +2 -1
- package/lib/utils/application.js +2 -2
- package/lib/utils/pay.d.ts +1 -0
- package/lib/utils/pay.js +4 -4
- package/lib/utils/payClazz/AliPay/AliPay.debug.js +2 -1
- package/lib/utils/payClazz/AliPay/AliPay.js +4 -4
- package/lib/utils/payClazz/WechatPay/WechatPay.debug.js +2 -1
- package/lib/utils/payClazz/index.js +4 -3
- package/lib/utils/ship.js +9 -9
- package/lib/utils/shipClazz/WechatMpShip/WechatMpShip.debug.js +3 -3
- package/lib/utils/shipClazz/index.js +4 -3
- package/lib/utils/wpProduct.js +2 -1
- package/lib/utils/wpProductFrontend.js +3 -2
- package/lib/watchers/index.js +2 -0
- package/lib/watchers/pay.js +1 -2
- package/lib/watchers/settlePlan.d.ts +5 -0
- package/lib/watchers/settlePlan.js +39 -0
- package/package.json +3 -3
- package/src/entities/AccountOper.ts +1 -3
- package/src/entities/Order.ts +5 -5
- package/src/entities/SettlePlan.ts +70 -0
- package/src/entities/Settlement.ts +15 -15
|
@@ -99,22 +99,22 @@ const checkers = [
|
|
|
99
99
|
}
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
|
-
case 'preSettle': {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
102
|
+
// case 'preSettle': {
|
|
103
|
+
// //预分账时账户total增加,avail不变,refundable不变
|
|
104
|
+
// if (totalPlus < 0 || availPlus !== 0 || (refundablePlus && refundablePlus !== 0)) {
|
|
105
|
+
// throw new OakInputIllegalException('accountOper', ['totalPlus', 'availPlus', 'refundablePlus'], 'accountOper为preSettle时,其totalPlus必须为非负数、availPlus必须为0,refundable必须为空或者0');
|
|
106
|
+
// }
|
|
107
|
+
// break;
|
|
108
|
+
// }
|
|
109
109
|
case 'settle': {
|
|
110
|
-
//分账时账户total
|
|
111
|
-
if (totalPlus
|
|
112
|
-
throw new OakInputIllegalException('accountOper', ['totalPlus', 'refundablePlus'], 'accountOper为settle时,其totalPlus
|
|
110
|
+
//分账时账户total增加,avail增加,refundable不变
|
|
111
|
+
if (totalPlus < 0 || availPlus < 0 || (refundablePlus && refundablePlus !== 0)) {
|
|
112
|
+
throw new OakInputIllegalException('accountOper', ['totalPlus', 'refundablePlus'], 'accountOper为settle时,其totalPlus、availPlus必须为非负数,refundable必须为空或者0');
|
|
113
113
|
}
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
default: {
|
|
117
|
-
assert(false);
|
|
117
|
+
// assert(false);
|
|
118
118
|
break;
|
|
119
119
|
}
|
|
120
120
|
}
|
package/es/checkers/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import withdrawAccounts from './withdrawAccount';
|
|
|
9
9
|
import refundCheckers from './refund';
|
|
10
10
|
import withdrawTransferCheckers from './withdrawTransfer';
|
|
11
11
|
import shipCheckers from './ship';
|
|
12
|
+
import settlePlanCheckers from './settlePlan';
|
|
12
13
|
const checkers = [
|
|
13
14
|
...refundCheckers,
|
|
14
15
|
...withdrawAccounts,
|
|
@@ -21,5 +22,6 @@ const checkers = [
|
|
|
21
22
|
...wpProductCheckers,
|
|
22
23
|
...withdrawTransferCheckers,
|
|
23
24
|
...shipCheckers,
|
|
25
|
+
...settlePlanCheckers,
|
|
24
26
|
];
|
|
25
27
|
export default checkers;
|
package/es/checkers/order.js
CHANGED
|
@@ -13,7 +13,8 @@ const checkers = [
|
|
|
13
13
|
}
|
|
14
14
|
data.paid = 0;
|
|
15
15
|
data.refunded = 0;
|
|
16
|
-
data.settled =
|
|
16
|
+
data.settled = 0;
|
|
17
|
+
data.settlePlanned = 0;
|
|
17
18
|
if (!data.systemId) {
|
|
18
19
|
const contextSystemId = context.getApplication()?.systemId;
|
|
19
20
|
assert(contextSystemId);
|
|
@@ -105,51 +106,59 @@ const checkers = [
|
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
108
|
},
|
|
109
|
+
/**todo 调整至settlePlan 执行settle
|
|
108
110
|
{
|
|
109
111
|
// 订单结算,检查存在关联的未结算的settlement,其price之和等于订单的已支付与已退款的差值
|
|
110
112
|
type: 'logicalData',
|
|
111
113
|
entity: 'order',
|
|
112
114
|
action: 'settle',
|
|
113
115
|
checker: (operation, context) => {
|
|
114
|
-
const { data, filter } = operation;
|
|
115
|
-
|
|
116
|
+
const { data, filter } = operation as EntityDict['order']['Update'];
|
|
117
|
+
|
|
118
|
+
assert(typeof filter!.id === 'string');
|
|
119
|
+
|
|
116
120
|
data.settled = true;
|
|
117
|
-
return pipeline(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
$
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
return pipeline(
|
|
122
|
+
() => context.select('order', {
|
|
123
|
+
data: {
|
|
124
|
+
id: 1,
|
|
125
|
+
price: 1,
|
|
126
|
+
paid: 1,
|
|
127
|
+
refunded: 1,
|
|
128
|
+
iState: 1,
|
|
129
|
+
settlement$order: {
|
|
130
|
+
$entity: 'settlement',
|
|
131
|
+
data: {
|
|
132
|
+
id: 1,
|
|
133
|
+
accountId: 1,
|
|
134
|
+
price: 1,
|
|
135
|
+
iState: 1,
|
|
136
|
+
},
|
|
137
|
+
filter: {
|
|
138
|
+
iState: 'unsettled'
|
|
139
|
+
}
|
|
134
140
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
141
|
+
},
|
|
142
|
+
filter: {
|
|
143
|
+
id: filter!.id!,
|
|
144
|
+
},
|
|
145
|
+
}, {}),
|
|
146
|
+
(orders: EntityDict['order']['Schema'][]) => {
|
|
147
|
+
const [order] = orders;
|
|
148
|
+
const { price, paid, refunded, iState, settlement$order: settlements } = order;
|
|
149
|
+
assert(['paid'].includes(iState!) && refunded === 0 && paid === price);
|
|
150
|
+
assert(settlements && settlements.length > 0, '该结算订单需添加结算明细');
|
|
151
|
+
|
|
152
|
+
let amount = 0;
|
|
153
|
+
settlements.forEach((settlement) => {
|
|
154
|
+
amount += settlement.price;
|
|
155
|
+
assert(settlement.iState === 'unsettled', '订单结算前,settlement必须处于未分账状态');
|
|
156
|
+
})
|
|
157
|
+
assert(amount === paid);
|
|
158
|
+
}
|
|
159
|
+
);
|
|
152
160
|
}
|
|
153
161
|
},
|
|
162
|
+
*/
|
|
154
163
|
];
|
|
155
164
|
export default checkers;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { pipeline } from 'oak-domain/lib/utils/executor';
|
|
2
|
+
import { assert } from 'oak-domain/lib/utils/assert';
|
|
3
|
+
const checkers = [
|
|
4
|
+
{
|
|
5
|
+
/**
|
|
6
|
+
* 1、settlement.price总和等于settlePlan.price
|
|
7
|
+
* 2、settlePlan.price <= order.paid - order.refunded - order.settlePlanned
|
|
8
|
+
*/
|
|
9
|
+
entity: 'settlePlan',
|
|
10
|
+
action: 'create',
|
|
11
|
+
type: 'logicalData',
|
|
12
|
+
priority: 1,
|
|
13
|
+
checker: (operation, context) => {
|
|
14
|
+
const { data } = operation;
|
|
15
|
+
const checkfn = (settlePlan) => {
|
|
16
|
+
return pipeline(() => context.select('order', {
|
|
17
|
+
data: {
|
|
18
|
+
id: 1,
|
|
19
|
+
paid: 1,
|
|
20
|
+
refunded: 1,
|
|
21
|
+
settlePlanned: 1,
|
|
22
|
+
},
|
|
23
|
+
filter: {
|
|
24
|
+
id: settlePlan.orderId,
|
|
25
|
+
},
|
|
26
|
+
}, { dontCollect: true }), (orders) => {
|
|
27
|
+
const [order] = orders;
|
|
28
|
+
const { paid, refunded, settlePlanned } = order;
|
|
29
|
+
const orderPrice = paid - refunded - settlePlanned;
|
|
30
|
+
assert(settlePlan.price <= orderPrice, '结算计划金额不大于订单可结算金额');
|
|
31
|
+
return context.select('settlement', {
|
|
32
|
+
data: {
|
|
33
|
+
id: 1,
|
|
34
|
+
price: 1,
|
|
35
|
+
iState: 1,
|
|
36
|
+
planId: 1,
|
|
37
|
+
},
|
|
38
|
+
filter: {
|
|
39
|
+
planId: settlePlan.id,
|
|
40
|
+
iState: 'unsettled',
|
|
41
|
+
},
|
|
42
|
+
}, { dontCollect: true });
|
|
43
|
+
}, (settlements) => {
|
|
44
|
+
let amount = 0;
|
|
45
|
+
settlements.forEach((settlement) => amount += settlement.price);
|
|
46
|
+
if (settlePlan.settlement$plan && settlePlan.settlement$plan.length > 0) {
|
|
47
|
+
for (const settlementOper of settlePlan.settlement$plan) {
|
|
48
|
+
const settlementData = settlementOper.data;
|
|
49
|
+
if (settlementData instanceof Array) {
|
|
50
|
+
settlementData.forEach((s) => amount += s.price ?? 0);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
amount += settlementData?.price ?? 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
assert(amount === settlePlan.price, '结算计划金额需等于关联的结算明细金额总和');
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
if (data instanceof Array) {
|
|
61
|
+
for (const d of data) {
|
|
62
|
+
checkfn(d);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
checkfn(data);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
entity: 'settlePlan',
|
|
72
|
+
action: 'close',
|
|
73
|
+
type: 'logicalData',
|
|
74
|
+
checker: (operation, context) => {
|
|
75
|
+
const { filter } = operation;
|
|
76
|
+
return pipeline(() => context.select('settlePlan', {
|
|
77
|
+
data: {
|
|
78
|
+
id: 1,
|
|
79
|
+
price: 1,
|
|
80
|
+
iState: 1,
|
|
81
|
+
settlement$plan: {
|
|
82
|
+
$entity: 'settlement',
|
|
83
|
+
data: {
|
|
84
|
+
id: 1,
|
|
85
|
+
price: 1,
|
|
86
|
+
iState: 1,
|
|
87
|
+
},
|
|
88
|
+
filter: {
|
|
89
|
+
iState: 'unsettled',
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
filter,
|
|
94
|
+
}, { dontCollect: true }), (settlePlans) => {
|
|
95
|
+
for (const settlePlan of settlePlans) {
|
|
96
|
+
const { price: planPrice, settlement$plan: settlements } = settlePlan;
|
|
97
|
+
let amount = 0;
|
|
98
|
+
settlements.forEach((settlement) => amount += settlement.price);
|
|
99
|
+
assert(amount === planPrice, '结算计划金额需等于未结算的结算明细金额总和');
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
export default checkers;
|
|
@@ -4,15 +4,71 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { EntityDict } from '../oak-app-domain';
|
|
7
|
-
import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef } from 'oak-frontend-base';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, ListButtonProps, OakAbsAttrUpsertDef } from 'oak-frontend-base';
|
|
8
|
+
declare const FilterPanel: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
9
|
+
entity: T;
|
|
10
|
+
columns: ColumnProps<EntityDict, T>[];
|
|
11
|
+
}>) => React.ReactElement;
|
|
12
|
+
declare const List: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
13
|
+
entity: T;
|
|
14
|
+
extraActions: OakExtraActionProps[] | ((row: RowWithActions<EntityDict, T>) => OakExtraActionProps[]);
|
|
15
|
+
onAction: onActionFnDef;
|
|
16
|
+
disabledOp: boolean;
|
|
17
|
+
attributes: OakAbsAttrDef[];
|
|
18
|
+
data: RowWithActions<EntityDict, T>[];
|
|
19
|
+
loading: boolean;
|
|
20
|
+
tablePagination?: React.ReactNode;
|
|
21
|
+
rowSelection?: any;
|
|
22
|
+
hideHeader?: boolean | undefined;
|
|
23
|
+
disableSerialNumber?: boolean | undefined;
|
|
24
|
+
size?: "small" | "middle" | "large" | undefined;
|
|
25
|
+
scroll?: ({
|
|
26
|
+
x?: string | number | true | undefined;
|
|
27
|
+
y?: string | number | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
scrollToFirstRowOnChange?: boolean | undefined;
|
|
30
|
+
}) | undefined;
|
|
31
|
+
empty?: React.ReactNode;
|
|
32
|
+
opWidth?: number | undefined;
|
|
33
|
+
ellipsis?: boolean | undefined;
|
|
34
|
+
}>) => React.ReactElement;
|
|
35
|
+
declare const ListPro: <T extends keyof EntityDict>(props: {
|
|
36
|
+
title?: any;
|
|
37
|
+
extraContent?: any;
|
|
38
|
+
hideDefaultButtons?: boolean | undefined;
|
|
39
|
+
buttonGroup?: ListButtonProps[] | undefined;
|
|
40
|
+
onReload?: (() => void) | undefined;
|
|
41
|
+
entity: T;
|
|
42
|
+
extraActions?: OakExtraActionProps[] | ((row: RowWithActions<EntityDict, T>) => OakExtraActionProps[]) | undefined;
|
|
43
|
+
onAction?: onActionFnDef | undefined;
|
|
44
|
+
disabledOp?: boolean | undefined;
|
|
45
|
+
attributes: OakAbsAttrDef[];
|
|
46
|
+
data: RowWithActions<EntityDict, T>[];
|
|
47
|
+
loading?: boolean | undefined;
|
|
48
|
+
tablePagination?: any;
|
|
49
|
+
rowSelection?: any;
|
|
50
|
+
disableSerialNumber?: boolean | undefined;
|
|
51
|
+
size?: "small" | "middle" | "large" | undefined;
|
|
52
|
+
scroll?: any;
|
|
53
|
+
empty?: any;
|
|
54
|
+
opWidth?: number | undefined;
|
|
55
|
+
oakPath?: string | undefined;
|
|
56
|
+
}) => React.ReactElement;
|
|
57
|
+
declare const Detail: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
58
|
+
column?: number | Record<Breakpoint, number> | undefined;
|
|
59
|
+
entity: T;
|
|
60
|
+
attributes: OakAbsAttrDef[];
|
|
61
|
+
data: Partial<EntityDict[T]["Schema"]>;
|
|
62
|
+
title?: string | undefined;
|
|
63
|
+
bordered?: boolean | undefined;
|
|
64
|
+
layout?: "horizontal" | "vertical" | undefined;
|
|
65
|
+
}>) => React.ReactElement;
|
|
66
|
+
declare const Upsert: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
67
|
+
helps: Record<string, string>;
|
|
68
|
+
entity: T;
|
|
69
|
+
attributes: OakAbsAttrUpsertDef<EntityDict, T, string | number>[];
|
|
70
|
+
data: EntityDict[T]["Schema"];
|
|
71
|
+
layout: "horizontal" | "vertical";
|
|
72
|
+
mode: "default" | "card";
|
|
73
|
+
}>) => React.ReactElement;
|
|
18
74
|
export { FilterPanel, List, ListPro, Detail, Upsert, ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "offlineAccount", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "order", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import { EntityDict } from "../../../oak-app-domain";
|
|
|
2
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "order", false, {
|
|
3
3
|
accountId: string;
|
|
4
4
|
accountAvailMax: number;
|
|
5
|
-
onSetPays: (pays: Partial<EntityDict[
|
|
5
|
+
onSetPays: (pays: Partial<EntityDict['pay']['CreateOperationData']>[]) => void;
|
|
6
6
|
accountTips: string;
|
|
7
7
|
autoStartPay: boolean;
|
|
8
8
|
}>) => React.ReactElement;
|
|
@@ -24,10 +24,10 @@ export default OakComponent({
|
|
|
24
24
|
},
|
|
25
25
|
isList: false,
|
|
26
26
|
properties: {
|
|
27
|
-
accountId: '',
|
|
28
|
-
accountAvailMax: 0,
|
|
27
|
+
accountId: '',
|
|
28
|
+
accountAvailMax: 0,
|
|
29
29
|
onSetPays: (pays) => undefined,
|
|
30
|
-
accountTips: '',
|
|
30
|
+
accountTips: '',
|
|
31
31
|
autoStartPay: false,
|
|
32
32
|
},
|
|
33
33
|
formData({ data }) {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "pay", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "system", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "refund", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "system", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
import { EntityDict } from "../../../../oak-app-domain";
|
|
2
3
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "wechatMpShip", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
3
4
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "withdrawTransfer", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
import { EntityDict } from "../../../oak-app-domain";
|
|
2
3
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "withdraw", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
3
4
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
import { EntityDict } from '../../../oak-app-domain';
|
|
2
3
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "withdrawTransfer", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
3
4
|
export default _default;
|
package/es/data/i18n.js
CHANGED
|
@@ -924,7 +924,9 @@ const i18ns = [
|
|
|
924
924
|
"create": {
|
|
925
925
|
"hasAnotherRefunding": "您有一笔退款正在进行中",
|
|
926
926
|
"exceedMax": "退款额度大于可用值",
|
|
927
|
-
"payUnrefundable": "支付已经不可退款"
|
|
927
|
+
"payUnrefundable": "支付已经不可退款",
|
|
928
|
+
"opersNotEnough": "指定退款帐户的操作金额总和不足",
|
|
929
|
+
"opersExceed": "指定退款帐户的操作金额总和超过订单已结算金额"
|
|
928
930
|
}
|
|
929
931
|
},
|
|
930
932
|
"pay": {
|
|
@@ -932,7 +934,11 @@ const i18ns = [
|
|
|
932
934
|
"priceOverflow": "支付金额总和大于订单金额"
|
|
933
935
|
},
|
|
934
936
|
"ship": {
|
|
935
|
-
"noClazz": "当前物流未关联外部接口"
|
|
937
|
+
"noClazz": "当前物流未关联外部接口",
|
|
938
|
+
"uploadShipException": "小程序上传发货信息异常"
|
|
939
|
+
},
|
|
940
|
+
"settlePlan": {
|
|
941
|
+
"exceed": "结算计划总金额超过订单可结算金额上限"
|
|
936
942
|
}
|
|
937
943
|
}
|
|
938
944
|
},
|
|
@@ -2,7 +2,7 @@ import { String, Price } from 'oak-domain/lib/types/DataType';
|
|
|
2
2
|
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
3
3
|
import { EntityDesc } from 'oak-domain/lib/types';
|
|
4
4
|
import { Schema as Account } from './Account';
|
|
5
|
-
type Type = 'deposit' | 'withdraw' | 'consume' | 'consumeBack' | 'loan' | 'repay' | 'withdrawBack' | 'earn' | 'cutoffRefundable' | 'tax' | 'taxRefund' | 'refund' | 'refundFailure' | '
|
|
5
|
+
type Type = 'deposit' | 'withdraw' | 'consume' | 'consumeBack' | 'loan' | 'repay' | 'withdrawBack' | 'earn' | 'cutoffRefundable' | 'tax' | 'taxRefund' | 'refund' | 'refundFailure' | 'settle';
|
|
6
6
|
export interface Schema extends EntityShape {
|
|
7
7
|
account: Account;
|
|
8
8
|
type: Type;
|
|
@@ -30,7 +30,6 @@ export const entityDesc = {
|
|
|
30
30
|
cutoffRefundable: '削减可自由退额度',
|
|
31
31
|
refund: '退款',
|
|
32
32
|
refundFailure: '退款失败',
|
|
33
|
-
preSettle: '预分账',
|
|
34
33
|
settle: '分账',
|
|
35
34
|
},
|
|
36
35
|
},
|
|
@@ -52,7 +51,6 @@ export const entityDesc = {
|
|
|
52
51
|
cutoffRefundable: '#2E4053',
|
|
53
52
|
refund: '#CC3333',
|
|
54
53
|
refundFailure: '#009933',
|
|
55
|
-
preSettle: '#8A631D',
|
|
56
54
|
settle: '#157d5a',
|
|
57
55
|
}
|
|
58
56
|
}
|
package/es/entities/ApAccount.js
CHANGED
package/es/entities/Order.d.ts
CHANGED
|
@@ -9,13 +9,14 @@ export interface Schema extends EntityShape {
|
|
|
9
9
|
price: Price;
|
|
10
10
|
paid: Price;
|
|
11
11
|
refunded: Price;
|
|
12
|
+
settled: Price;
|
|
13
|
+
settlePlanned: Price;
|
|
12
14
|
title: String<32>;
|
|
13
15
|
desc: Text;
|
|
14
16
|
timeoutAt?: Datetime;
|
|
15
17
|
creator: User;
|
|
16
18
|
entity: String<32>;
|
|
17
19
|
entityId: String<64>;
|
|
18
|
-
settled: Boolean;
|
|
19
20
|
allowPartialPay?: Boolean;
|
|
20
21
|
system: System;
|
|
21
22
|
address?: Address;
|
|
@@ -25,7 +26,7 @@ export interface Schema extends EntityShape {
|
|
|
25
26
|
export type IAction = 'startPaying' | 'payAll' | 'payPartially' | 'payNone' | 'timeout' | 'cancel' | 'startRefunding' | 'refundAll' | 'refundPartially' | 'refundNone';
|
|
26
27
|
export type IState = 'unpaid' | 'timeout' | 'cancelled' | 'paying' | 'partiallyPaid' | 'paid' | 'refunding' | 'partiallyRefunded' | 'refunded';
|
|
27
28
|
export declare const IActionDef: ActionDef<IAction, IState>;
|
|
28
|
-
export type Action = IAction
|
|
29
|
+
export type Action = IAction;
|
|
29
30
|
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
30
31
|
iState: IState;
|
|
31
32
|
}>;
|
package/es/entities/Order.js
CHANGED
|
@@ -51,6 +51,8 @@ export const entityDesc = {
|
|
|
51
51
|
price: '订单金额',
|
|
52
52
|
paid: '已支付金额',
|
|
53
53
|
refunded: '已退款金额',
|
|
54
|
+
settled: '已结算金额',
|
|
55
|
+
settlePlanned: '已计划结算金额',
|
|
54
56
|
iState: '订单状态',
|
|
55
57
|
title: '订单标题',
|
|
56
58
|
desc: "订单描述",
|
|
@@ -59,7 +61,6 @@ export const entityDesc = {
|
|
|
59
61
|
creator: '创建者',
|
|
60
62
|
entity: '关联对象',
|
|
61
63
|
entityId: '关联对象Id',
|
|
62
|
-
settled: '是否结算',
|
|
63
64
|
opers: '相关帐户操作',
|
|
64
65
|
system: '所属系统',
|
|
65
66
|
address: '收货地址',
|
|
@@ -76,7 +77,6 @@ export const entityDesc = {
|
|
|
76
77
|
refundAll: '完全退款',
|
|
77
78
|
refundNone: '退款失败',
|
|
78
79
|
refundPartially: '部分退款',
|
|
79
|
-
settle: '结算',
|
|
80
80
|
},
|
|
81
81
|
v: {
|
|
82
82
|
iState: {
|
|
@@ -105,7 +105,6 @@ export const entityDesc = {
|
|
|
105
105
|
refundAll: '',
|
|
106
106
|
refundNone: '',
|
|
107
107
|
refundPartially: '',
|
|
108
|
-
settle: '',
|
|
109
108
|
},
|
|
110
109
|
color: {
|
|
111
110
|
iState: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Price, Datetime } from 'oak-domain/lib/types/DataType';
|
|
2
|
+
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
3
|
+
import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
|
|
4
|
+
import { Schema as Order } from './Order';
|
|
5
|
+
export interface Schema extends EntityShape {
|
|
6
|
+
when?: Datetime;
|
|
7
|
+
order: Order;
|
|
8
|
+
price: Price;
|
|
9
|
+
settledAt?: Datetime;
|
|
10
|
+
closedAt?: Datetime;
|
|
11
|
+
}
|
|
12
|
+
type IState = 'unsettled' | 'settled' | 'closed';
|
|
13
|
+
type IAction = 'settle' | 'close';
|
|
14
|
+
export declare const IActionDef: ActionDef<IAction, IState>;
|
|
15
|
+
type Action = IAction;
|
|
16
|
+
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
17
|
+
iState: IState;
|
|
18
|
+
}>;
|
|
19
|
+
export {};
|