ts-glitter 21.9.0 → 21.9.1
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/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/filter-options.js +1 -1
- package/lowcode/cms-plugin/filter-options.ts +1 -1
- package/lowcode/cms-plugin/model/order.d.ts +62 -21
- package/lowcode/cms-plugin/module/data.js +7 -0
- package/lowcode/cms-plugin/module/data.ts +7 -189
- package/lowcode/cms-plugin/module/delivery-html.ts +1 -2
- package/lowcode/cms-plugin/module/order-setting.js +90 -60
- package/lowcode/cms-plugin/module/order-setting.ts +110 -77
- package/lowcode/cms-plugin/shopping-order-manager.js +152 -81
- package/lowcode/cms-plugin/shopping-order-manager.ts +165 -85
- package/lowcode/css/editor.css +1 -1
- package/lowcode/public-components/checkout/index.js +38 -33
- package/lowcode/public-components/checkout/index.ts +37 -34
- package/package.json +1 -1
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/shopping.js +5 -4
- package/src/api-public/services/shopping.js.map +5 -1
- package/src/api-public/services/shopping.ts +5 -4
package/lowcode/Entry.js
CHANGED
|
@@ -146,7 +146,7 @@ export class Entry {
|
|
|
146
146
|
}
|
|
147
147
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
|
|
148
148
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
149
|
-
glitter.share.editerVersion = 'V_21.9.
|
|
149
|
+
glitter.share.editerVersion = 'V_21.9.1';
|
|
150
150
|
glitter.share.start = new Date();
|
|
151
151
|
const vm = { appConfig: [] };
|
|
152
152
|
window.saasConfig = {
|
package/lowcode/Entry.ts
CHANGED
|
@@ -150,7 +150,7 @@ export class Entry {
|
|
|
150
150
|
}
|
|
151
151
|
(window as any).renderClock = (window as any).renderClock ?? createClock();
|
|
152
152
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
153
|
-
glitter.share.editerVersion = 'V_21.9.
|
|
153
|
+
glitter.share.editerVersion = 'V_21.9.1';
|
|
154
154
|
glitter.share.start = new Date();
|
|
155
155
|
const vm = { appConfig: [] };
|
|
156
156
|
(window as any).saasConfig = {
|
|
@@ -390,7 +390,7 @@ FilterOptions.reconciliationOptions = [
|
|
|
390
390
|
FilterOptions.payloadStatusOptions = [
|
|
391
391
|
{ key: '1', name: '已付款' },
|
|
392
392
|
{ key: '3', name: '部分付款' },
|
|
393
|
-
{ key: '0', name: '未付款' },
|
|
393
|
+
{ key: '0', name: '待核款 / 貨到付款 / 未付款' },
|
|
394
394
|
{ key: '-1', name: '付款失敗' },
|
|
395
395
|
{ key: '-2', name: '已退款' },
|
|
396
396
|
];
|
|
@@ -226,7 +226,7 @@ export class FilterOptions {
|
|
|
226
226
|
static payloadStatusOptions = [
|
|
227
227
|
{ key: '1', name: '已付款' },
|
|
228
228
|
{ key: '3', name: '部分付款' },
|
|
229
|
-
{ key: '0', name: '未付款' },
|
|
229
|
+
{ key: '0', name: '待核款 / 貨到付款 / 未付款' },
|
|
230
230
|
{ key: '-1', name: '付款失敗' },
|
|
231
231
|
{ key: '-2', name: '已退款' },
|
|
232
232
|
];
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
type Status = 0 | 1 | -1;
|
|
2
2
|
type VoucherMethod = 'percent' | 'fixed';
|
|
3
|
-
type ReBackType = 'rebate' | 'discount' | 'shipment_free';
|
|
4
|
-
type TriggerType = 'auto' | 'code';
|
|
5
3
|
type VoucherFor = 'collection' | 'product' | 'all';
|
|
6
4
|
type VoucherRule = 'min_price' | 'min_count';
|
|
5
|
+
type ReBackType = 'rebate' | 'discount' | 'shipment_free';
|
|
6
|
+
type TriggerType = 'auto' | 'code';
|
|
7
7
|
type FilterType = 'normal' | 'block' | 'pos' | 'all';
|
|
8
|
-
type PaymentMethod = 'ATM' | 'CreditCard' | 'ConvenienceStore';
|
|
9
8
|
type ShipmentMethod =
|
|
10
9
|
| 'normal'
|
|
11
10
|
| 'FAMIC2C'
|
|
@@ -17,9 +16,12 @@ type ShipmentMethod =
|
|
|
17
16
|
| 'global_express'
|
|
18
17
|
| 'UNIMARTFREEZE'
|
|
19
18
|
| 'black_cat_freezing'
|
|
20
|
-
| 'black_cat'
|
|
21
|
-
|
|
19
|
+
| 'black_cat'
|
|
20
|
+
| 'FAMIC2CFREEZE';
|
|
21
|
+
type PaymentMethod = 'ATM' | 'CreditCard' | 'ConvenienceStore';
|
|
22
22
|
type ViewModelType = 'list' | 'add' | 'replace' | 'select' | 'createInvoice' | 'viewInvoice' | 'recommend';
|
|
23
|
+
type POSPayment = 'cash' | 'credit' | 'line_pay';
|
|
24
|
+
type TradeStatus = '0' | '1' | '10200095';
|
|
23
25
|
|
|
24
26
|
interface EditRecord {
|
|
25
27
|
time: string;
|
|
@@ -88,13 +90,34 @@ interface CartData {
|
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
interface OrderData {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
distribution_info?: {
|
|
94
|
+
code: string;
|
|
95
|
+
condition: number;
|
|
96
|
+
link: string;
|
|
97
|
+
recommend_medium: any;
|
|
98
|
+
recommend_status: string;
|
|
99
|
+
recommend_user: any;
|
|
100
|
+
redirect: string;
|
|
101
|
+
relative: string;
|
|
102
|
+
relative_data: any;
|
|
103
|
+
share_type: string;
|
|
104
|
+
share_value: number;
|
|
105
|
+
startDate: string;
|
|
106
|
+
startTime: string;
|
|
107
|
+
status: boolean;
|
|
108
|
+
title: string;
|
|
109
|
+
voucher: number;
|
|
110
|
+
voucher_status: string;
|
|
111
|
+
};
|
|
94
112
|
archived: 'true' | 'false';
|
|
95
|
-
customer_info:
|
|
113
|
+
customer_info: any;
|
|
114
|
+
editRecord: any;
|
|
96
115
|
method: string;
|
|
97
|
-
shipment_selector:
|
|
116
|
+
shipment_selector: {
|
|
117
|
+
name: string;
|
|
118
|
+
value: string;
|
|
119
|
+
form: any;
|
|
120
|
+
}[];
|
|
98
121
|
orderStatus: string;
|
|
99
122
|
use_wallet: number;
|
|
100
123
|
email: string;
|
|
@@ -105,16 +128,17 @@ interface OrderData {
|
|
|
105
128
|
use_rebate: number;
|
|
106
129
|
lineItems: LineItem[];
|
|
107
130
|
user_info: UserInfo;
|
|
131
|
+
custom_receipt_form?: any;
|
|
132
|
+
custom_form_format?: any;
|
|
133
|
+
custom_form_data?: any;
|
|
108
134
|
proof_purchase: any;
|
|
109
135
|
progress: string;
|
|
110
136
|
order_note: string;
|
|
111
137
|
voucherList: VoucherData[];
|
|
112
138
|
orderSource?: string;
|
|
113
139
|
deliveryData: Record<string, string>;
|
|
140
|
+
cash_flow: PaymentFlow;
|
|
114
141
|
pos_info: POSInfo;
|
|
115
|
-
custom_receipt_form?: any;
|
|
116
|
-
custom_form_format?: any;
|
|
117
|
-
custom_form_data?: any;
|
|
118
142
|
tags?: string[];
|
|
119
143
|
fbp?: string;
|
|
120
144
|
fbc?:string;
|
|
@@ -125,7 +149,7 @@ interface PaymentFlow {
|
|
|
125
149
|
HandlingCharge?: string;
|
|
126
150
|
PaymentType: PaymentMethod;
|
|
127
151
|
PaymentDate?: string;
|
|
128
|
-
TradeStatus?:
|
|
152
|
+
TradeStatus?: TradeStatus;
|
|
129
153
|
TradeAmt: string;
|
|
130
154
|
TradeNo: string;
|
|
131
155
|
credit_receipt?: any;
|
|
@@ -148,22 +172,32 @@ interface UserInfo {
|
|
|
148
172
|
name: string;
|
|
149
173
|
email: string;
|
|
150
174
|
phone: string;
|
|
175
|
+
address: string;
|
|
176
|
+
shipment: ShipmentMethod;
|
|
177
|
+
CVSStoreName: string;
|
|
178
|
+
CVSStoreID: string;
|
|
179
|
+
CVSTelephone: string;
|
|
180
|
+
MerchantTradeNo: string;
|
|
181
|
+
CVSAddress: string;
|
|
182
|
+
note: string;
|
|
151
183
|
city?: string;
|
|
152
184
|
area?: string;
|
|
153
185
|
shipment_date: string;
|
|
154
186
|
shipment_refer: string;
|
|
155
|
-
address: string;
|
|
156
187
|
shipment_number?: string;
|
|
157
188
|
state: string;
|
|
158
189
|
company: string;
|
|
159
190
|
country: string;
|
|
160
191
|
postal_code: string;
|
|
161
192
|
invoice_type: string;
|
|
193
|
+
custom_form_delivery?: any;
|
|
194
|
+
shipment_detail?: any;
|
|
195
|
+
code_note?: string;
|
|
162
196
|
[key: string]: any;
|
|
163
197
|
}
|
|
164
198
|
|
|
165
199
|
interface POSInfo {
|
|
166
|
-
payment:
|
|
200
|
+
payment: POSPayment;
|
|
167
201
|
who: {
|
|
168
202
|
id: number;
|
|
169
203
|
user: string;
|
|
@@ -185,18 +219,18 @@ interface POSConfig {
|
|
|
185
219
|
|
|
186
220
|
interface LineItem {
|
|
187
221
|
id: number;
|
|
188
|
-
sku: string;
|
|
189
222
|
spec: string[];
|
|
190
223
|
count: number;
|
|
191
|
-
|
|
192
|
-
|
|
224
|
+
sale_price: number;
|
|
225
|
+
sku: string;
|
|
193
226
|
rebate: number;
|
|
194
227
|
weight: number;
|
|
195
228
|
is_gift: boolean;
|
|
196
|
-
sale_price: number;
|
|
197
229
|
origin_price: number;
|
|
198
230
|
discount_price: number;
|
|
199
|
-
|
|
231
|
+
title?: string;
|
|
232
|
+
preview_image?: string;
|
|
233
|
+
deduction_log?: any;
|
|
200
234
|
}
|
|
201
235
|
|
|
202
236
|
interface OrderQuery {
|
|
@@ -205,6 +239,13 @@ interface OrderQuery {
|
|
|
205
239
|
isShipment?: boolean;
|
|
206
240
|
}
|
|
207
241
|
|
|
242
|
+
interface CustomerInfo {
|
|
243
|
+
name: string;
|
|
244
|
+
email: string;
|
|
245
|
+
phone: string;
|
|
246
|
+
payment_select?: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
208
249
|
interface ViewModel {
|
|
209
250
|
id: string;
|
|
210
251
|
loading: boolean;
|
|
@@ -22,6 +22,13 @@ export class OrderDetail {
|
|
|
22
22
|
}
|
|
23
23
|
initUserInfo() {
|
|
24
24
|
return {
|
|
25
|
+
country: '',
|
|
26
|
+
postal_code: '',
|
|
27
|
+
invoice_type: '',
|
|
28
|
+
shipment_date: '',
|
|
29
|
+
shipment_refer: '',
|
|
30
|
+
state: '',
|
|
31
|
+
company: '',
|
|
25
32
|
CVSAddress: '',
|
|
26
33
|
CVSStoreID: '',
|
|
27
34
|
CVSStoreName: '',
|
|
@@ -1,192 +1,3 @@
|
|
|
1
|
-
export interface OrderData {
|
|
2
|
-
distribution_info?: {
|
|
3
|
-
code: string;
|
|
4
|
-
condition: number;
|
|
5
|
-
link: string;
|
|
6
|
-
recommend_medium: any;
|
|
7
|
-
recommend_status: string;
|
|
8
|
-
recommend_user: any;
|
|
9
|
-
redirect: string;
|
|
10
|
-
relative: string;
|
|
11
|
-
relative_data: any;
|
|
12
|
-
share_type: string;
|
|
13
|
-
share_value: number;
|
|
14
|
-
startDate: string;
|
|
15
|
-
startTime: string;
|
|
16
|
-
status: boolean;
|
|
17
|
-
title: string;
|
|
18
|
-
voucher: number;
|
|
19
|
-
voucher_status: string;
|
|
20
|
-
};
|
|
21
|
-
archived: 'true' | 'false';
|
|
22
|
-
customer_info: any;
|
|
23
|
-
editRecord: any;
|
|
24
|
-
method: string;
|
|
25
|
-
shipment_selector: {
|
|
26
|
-
name: string;
|
|
27
|
-
value: string;
|
|
28
|
-
form: any;
|
|
29
|
-
}[];
|
|
30
|
-
orderStatus: string;
|
|
31
|
-
use_wallet: number;
|
|
32
|
-
email: string;
|
|
33
|
-
total: number;
|
|
34
|
-
discount: number;
|
|
35
|
-
expectDate: string;
|
|
36
|
-
shipment_fee: number;
|
|
37
|
-
use_rebate: number;
|
|
38
|
-
lineItems: LineItem[];
|
|
39
|
-
user_info: {
|
|
40
|
-
name: string;
|
|
41
|
-
email: string;
|
|
42
|
-
city?: string;
|
|
43
|
-
area?: string;
|
|
44
|
-
phone: string;
|
|
45
|
-
address: string;
|
|
46
|
-
custom_form_delivery?: any;
|
|
47
|
-
shipment:
|
|
48
|
-
| 'normal'
|
|
49
|
-
| 'black_cat_freezing'
|
|
50
|
-
| 'now'
|
|
51
|
-
| 'shop'
|
|
52
|
-
| 'global_express'
|
|
53
|
-
| 'black_cat'
|
|
54
|
-
| 'UNIMARTC2C'
|
|
55
|
-
| 'FAMIC2C'
|
|
56
|
-
| 'HILIFEC2C'
|
|
57
|
-
| 'OKMARTC2C'
|
|
58
|
-
| 'UNIMARTFREEZE'
|
|
59
|
-
| 'FAMIC2CFREEZE';
|
|
60
|
-
CVSStoreName: string;
|
|
61
|
-
CVSStoreID: string;
|
|
62
|
-
CVSTelephone: string;
|
|
63
|
-
MerchantTradeNo: string;
|
|
64
|
-
CVSAddress: string;
|
|
65
|
-
shipment_number?: string;
|
|
66
|
-
note?: string;
|
|
67
|
-
code_note?: string;
|
|
68
|
-
};
|
|
69
|
-
custom_receipt_form?: any;
|
|
70
|
-
custom_form_format?: any;
|
|
71
|
-
custom_form_data?: any;
|
|
72
|
-
proof_purchase: any;
|
|
73
|
-
progress: string;
|
|
74
|
-
// progress: 'finish' | 'wait' | 'shipping' | "returns";
|
|
75
|
-
order_note: string;
|
|
76
|
-
voucherList: [
|
|
77
|
-
{
|
|
78
|
-
title: string;
|
|
79
|
-
method: 'percent' | 'fixed';
|
|
80
|
-
trigger: 'auto' | 'code';
|
|
81
|
-
value: string;
|
|
82
|
-
for: 'collection' | 'product';
|
|
83
|
-
rule: 'min_price' | 'min_count';
|
|
84
|
-
forKey: string[];
|
|
85
|
-
ruleValue: number;
|
|
86
|
-
startDate: string;
|
|
87
|
-
startTime: string;
|
|
88
|
-
endDate?: string;
|
|
89
|
-
endTime?: string;
|
|
90
|
-
status: 0 | 1 | -1;
|
|
91
|
-
type: 'voucher';
|
|
92
|
-
code?: string;
|
|
93
|
-
overlay: boolean;
|
|
94
|
-
bind?: {
|
|
95
|
-
id: string;
|
|
96
|
-
spec: string[];
|
|
97
|
-
count: number;
|
|
98
|
-
sale_price: number;
|
|
99
|
-
collection: string[];
|
|
100
|
-
discount_price: number;
|
|
101
|
-
}[];
|
|
102
|
-
start_ISO_Date: string;
|
|
103
|
-
end_ISO_Date: string;
|
|
104
|
-
},
|
|
105
|
-
];
|
|
106
|
-
orderSource?: string;
|
|
107
|
-
deliveryData: Record<string, string>;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface CartData {
|
|
111
|
-
id: number;
|
|
112
|
-
cart_token: string;
|
|
113
|
-
status: number;
|
|
114
|
-
email: string;
|
|
115
|
-
orderData: OrderData;
|
|
116
|
-
created_time: string;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
interface DeductionLogEntry {
|
|
120
|
-
[key: string]: number; // 物件,鍵是字串,值是數字
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export interface LineItem {
|
|
124
|
-
id: number;
|
|
125
|
-
spec: string[];
|
|
126
|
-
count: number;
|
|
127
|
-
sale_price: number;
|
|
128
|
-
title?: string;
|
|
129
|
-
sku: string;
|
|
130
|
-
preview_image?: string;
|
|
131
|
-
deduction_log?: any;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
interface CustomerInfo {
|
|
135
|
-
name: string;
|
|
136
|
-
email: string;
|
|
137
|
-
phone: string;
|
|
138
|
-
payment_select?: string;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
interface UserInfo {
|
|
142
|
-
name: string;
|
|
143
|
-
email: string;
|
|
144
|
-
phone: string;
|
|
145
|
-
address: string;
|
|
146
|
-
shipment: 'normal' | 'FAMIC2C' | 'UNIMARTC2C' | 'HILIFEC2C' | 'OKMARTC2C';
|
|
147
|
-
CVSStoreName: string;
|
|
148
|
-
CVSStoreID: string;
|
|
149
|
-
CVSTelephone: string;
|
|
150
|
-
MerchantTradeNo: string;
|
|
151
|
-
CVSAddress: string;
|
|
152
|
-
note: string;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
interface VoucherData {
|
|
156
|
-
id: number;
|
|
157
|
-
discount_total: number;
|
|
158
|
-
title: string;
|
|
159
|
-
method: 'percent' | 'fixed';
|
|
160
|
-
trigger: 'auto' | 'code';
|
|
161
|
-
value: string;
|
|
162
|
-
for: 'collection' | 'product';
|
|
163
|
-
rule: 'min_price' | 'min_count';
|
|
164
|
-
forKey: string[];
|
|
165
|
-
ruleValue: number;
|
|
166
|
-
startDate: string;
|
|
167
|
-
startTime: string;
|
|
168
|
-
endDate?: string;
|
|
169
|
-
endTime?: string;
|
|
170
|
-
status: 0 | 1 | -1;
|
|
171
|
-
type: 'voucher';
|
|
172
|
-
code?: string;
|
|
173
|
-
overlay: boolean;
|
|
174
|
-
bind?: {
|
|
175
|
-
id: string;
|
|
176
|
-
spec: string[];
|
|
177
|
-
count: number;
|
|
178
|
-
sale_price: number;
|
|
179
|
-
collection: string[];
|
|
180
|
-
discount_price: number;
|
|
181
|
-
}[];
|
|
182
|
-
start_ISO_Date: string;
|
|
183
|
-
end_ISO_Date: string;
|
|
184
|
-
reBackType: string;
|
|
185
|
-
rebate_total: number;
|
|
186
|
-
target: string;
|
|
187
|
-
targetList: string[];
|
|
188
|
-
}
|
|
189
|
-
|
|
190
1
|
export class OrderDetail {
|
|
191
2
|
subtotal: number;
|
|
192
3
|
shipment: number;
|
|
@@ -249,6 +60,13 @@ export class OrderDetail {
|
|
|
249
60
|
|
|
250
61
|
private initUserInfo(): UserInfo {
|
|
251
62
|
return {
|
|
63
|
+
country: '',
|
|
64
|
+
postal_code: '',
|
|
65
|
+
invoice_type: '',
|
|
66
|
+
shipment_date: '',
|
|
67
|
+
shipment_refer: '',
|
|
68
|
+
state: '',
|
|
69
|
+
company: '',
|
|
252
70
|
CVSAddress: '',
|
|
253
71
|
CVSStoreID: '',
|
|
254
72
|
CVSStoreName: '',
|
|
@@ -2,14 +2,13 @@ import { GVC } from '../../glitterBundle/GVController.js';
|
|
|
2
2
|
import { Tool } from '../../modules/tool.js';
|
|
3
3
|
import { BgWidget } from '../../backend-manager/bg-widget.js';
|
|
4
4
|
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
5
|
-
import { CartData, OrderData } from './data.js';
|
|
6
5
|
import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
|
|
7
6
|
import { PaymentConfig } from '../../glitter-base/global/payment-config.js';
|
|
8
7
|
import { OrderExcel } from './order-excel.js';
|
|
9
8
|
|
|
10
9
|
const html = String.raw;
|
|
11
10
|
|
|
12
|
-
type PrintType = 'shipment' | 'pick' | 'address' | 'shipAddr';
|
|
11
|
+
export type PrintType = 'shipment' | 'pick' | 'address' | 'shipAddr';
|
|
13
12
|
|
|
14
13
|
type InfoObject = {
|
|
15
14
|
title: string;
|
|
@@ -47,6 +47,7 @@ export class OrderSetting {
|
|
|
47
47
|
{ title: '部分付款', value: '3' },
|
|
48
48
|
{ title: '待核款 / 貨到付款 / 未付款', value: '0' },
|
|
49
49
|
{ title: '已退款', value: '-2' },
|
|
50
|
+
{ title: '付款失敗', value: '-1' },
|
|
50
51
|
].map(item => {
|
|
51
52
|
return {
|
|
52
53
|
key: item.value,
|
|
@@ -1132,6 +1133,43 @@ export class OrderSetting {
|
|
|
1132
1133
|
});
|
|
1133
1134
|
}, 'combineOrders');
|
|
1134
1135
|
}
|
|
1136
|
+
static allEditDialog(data) {
|
|
1137
|
+
const gvc = data.gvc;
|
|
1138
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
1139
|
+
const defaultValue = '';
|
|
1140
|
+
let temp = '';
|
|
1141
|
+
BgWidget.settingDialog({
|
|
1142
|
+
gvc: gvc,
|
|
1143
|
+
title: data.title,
|
|
1144
|
+
innerHTML: (innerGVC) => {
|
|
1145
|
+
return html ` <div>
|
|
1146
|
+
<div class="tx_700 mb-2">更改為</div>
|
|
1147
|
+
${BgWidget.select({
|
|
1148
|
+
gvc: innerGVC,
|
|
1149
|
+
callback: (value) => {
|
|
1150
|
+
temp = value;
|
|
1151
|
+
},
|
|
1152
|
+
default: defaultValue,
|
|
1153
|
+
options: [{ key: '', value: '請選擇狀態' }, ...data.options],
|
|
1154
|
+
})}
|
|
1155
|
+
</div>`;
|
|
1156
|
+
},
|
|
1157
|
+
footer_html: (footerGVC) => {
|
|
1158
|
+
return [
|
|
1159
|
+
BgWidget.cancel(footerGVC.event(() => footerGVC.closeDialog()), '取消'),
|
|
1160
|
+
BgWidget.save(footerGVC.event(() => {
|
|
1161
|
+
if (temp === defaultValue) {
|
|
1162
|
+
dialog.infoMessage({ text: '請選擇欲更改的選項' });
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
footerGVC.closeDialog();
|
|
1166
|
+
data.callback(temp);
|
|
1167
|
+
}), '儲存'),
|
|
1168
|
+
].join('');
|
|
1169
|
+
},
|
|
1170
|
+
width: 350,
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1135
1173
|
static batchEditOrders(obj) {
|
|
1136
1174
|
const wp = window.parent;
|
|
1137
1175
|
const topGVC = wp.glitter.pageConfig[wp.glitter.pageConfig.length - 1].gvc;
|
|
@@ -1241,8 +1279,23 @@ export class OrderSetting {
|
|
|
1241
1279
|
dd.status = value;
|
|
1242
1280
|
},
|
|
1243
1281
|
default: `${dd.status || 0}`,
|
|
1244
|
-
options:
|
|
1245
|
-
|
|
1282
|
+
options: (() => {
|
|
1283
|
+
const paymentOptions = OrderSetting.getPaymentStatusOpt();
|
|
1284
|
+
const unpayOption = paymentOptions.find(item => item.key === '0');
|
|
1285
|
+
if (unpayOption) {
|
|
1286
|
+
if (dd.orderData.proof_purchase) {
|
|
1287
|
+
unpayOption.value = '待核款';
|
|
1288
|
+
}
|
|
1289
|
+
else if (dd.orderData.customer_info.payment_select == 'cash_on_delivery') {
|
|
1290
|
+
unpayOption.value = '貨到付款';
|
|
1291
|
+
}
|
|
1292
|
+
else {
|
|
1293
|
+
unpayOption.value = '未付款';
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
return paymentOptions;
|
|
1297
|
+
})(),
|
|
1298
|
+
style: 'min-width: 150px;',
|
|
1246
1299
|
}),
|
|
1247
1300
|
},
|
|
1248
1301
|
{
|
|
@@ -1319,7 +1372,7 @@ export class OrderSetting {
|
|
|
1319
1372
|
return html ` <div class="d-flex align-items-center gap-2">${htmlArray.join('')}</div>`;
|
|
1320
1373
|
},
|
|
1321
1374
|
divCreate: {
|
|
1322
|
-
style: 'min-width:
|
|
1375
|
+
style: 'min-width: 620px;',
|
|
1323
1376
|
},
|
|
1324
1377
|
};
|
|
1325
1378
|
})()),
|
|
@@ -1327,42 +1380,6 @@ export class OrderSetting {
|
|
|
1327
1380
|
];
|
|
1328
1381
|
});
|
|
1329
1382
|
}
|
|
1330
|
-
function allEditDialog(data) {
|
|
1331
|
-
const defaultValue = '';
|
|
1332
|
-
let temp = '';
|
|
1333
|
-
BgWidget.settingDialog({
|
|
1334
|
-
gvc: gvc,
|
|
1335
|
-
title: data.title,
|
|
1336
|
-
innerHTML: (innerGVC) => {
|
|
1337
|
-
return html ` <div>
|
|
1338
|
-
<div class="tx_700 mb-2">更改為</div>
|
|
1339
|
-
${BgWidget.select({
|
|
1340
|
-
gvc: innerGVC,
|
|
1341
|
-
callback: (value) => {
|
|
1342
|
-
temp = value;
|
|
1343
|
-
},
|
|
1344
|
-
default: defaultValue,
|
|
1345
|
-
options: [{ key: '', value: '請選擇狀態' }, ...data.options],
|
|
1346
|
-
})}
|
|
1347
|
-
</div>`;
|
|
1348
|
-
},
|
|
1349
|
-
footer_html: (footerGVC) => {
|
|
1350
|
-
return [
|
|
1351
|
-
BgWidget.cancel(footerGVC.event(() => footerGVC.closeDialog()), '取消'),
|
|
1352
|
-
BgWidget.save(footerGVC.event(() => {
|
|
1353
|
-
if (temp === defaultValue) {
|
|
1354
|
-
dialog.infoMessage({ text: '請選擇欲更改的選項' });
|
|
1355
|
-
return;
|
|
1356
|
-
}
|
|
1357
|
-
footerGVC.closeDialog();
|
|
1358
|
-
data.callback(temp);
|
|
1359
|
-
gvc.notifyDataChange(vm.id);
|
|
1360
|
-
}), '儲存'),
|
|
1361
|
-
].join('');
|
|
1362
|
-
},
|
|
1363
|
-
width: 350,
|
|
1364
|
-
});
|
|
1365
|
-
}
|
|
1366
1383
|
function editOrderView() {
|
|
1367
1384
|
return BgWidget.tableV3({
|
|
1368
1385
|
gvc,
|
|
@@ -1370,13 +1387,15 @@ export class OrderSetting {
|
|
|
1370
1387
|
{
|
|
1371
1388
|
name: '更改付款狀態',
|
|
1372
1389
|
event: (checkArray) => {
|
|
1373
|
-
allEditDialog({
|
|
1390
|
+
OrderSetting.allEditDialog({
|
|
1391
|
+
gvc,
|
|
1374
1392
|
title: '批量更改付款狀態',
|
|
1375
1393
|
options: OrderSetting.getPaymentStatusOpt(),
|
|
1376
1394
|
callback: (value) => {
|
|
1377
1395
|
checkArray.forEach((order) => {
|
|
1378
1396
|
order.status = Number(value);
|
|
1379
1397
|
});
|
|
1398
|
+
gvc.notifyDataChange(vm.id);
|
|
1380
1399
|
},
|
|
1381
1400
|
});
|
|
1382
1401
|
},
|
|
@@ -1384,7 +1403,8 @@ export class OrderSetting {
|
|
|
1384
1403
|
{
|
|
1385
1404
|
name: '更改出貨狀態',
|
|
1386
1405
|
event: (checkArray) => {
|
|
1387
|
-
allEditDialog({
|
|
1406
|
+
OrderSetting.allEditDialog({
|
|
1407
|
+
gvc,
|
|
1388
1408
|
title: '批量更改出貨狀態',
|
|
1389
1409
|
options: OrderSetting.getShippmentOpt(),
|
|
1390
1410
|
callback: (value) => {
|
|
@@ -1394,6 +1414,7 @@ export class OrderSetting {
|
|
|
1394
1414
|
order.orderData.user_info.shipment_number = '';
|
|
1395
1415
|
}
|
|
1396
1416
|
});
|
|
1417
|
+
gvc.notifyDataChange(vm.id);
|
|
1397
1418
|
},
|
|
1398
1419
|
});
|
|
1399
1420
|
},
|
|
@@ -1401,13 +1422,15 @@ export class OrderSetting {
|
|
|
1401
1422
|
{
|
|
1402
1423
|
name: '更改訂單狀態',
|
|
1403
1424
|
event: (checkArray) => {
|
|
1404
|
-
allEditDialog({
|
|
1425
|
+
OrderSetting.allEditDialog({
|
|
1426
|
+
gvc,
|
|
1405
1427
|
title: '批量更改訂單狀態',
|
|
1406
1428
|
options: OrderSetting.getOrderStatusOpt(),
|
|
1407
1429
|
callback: (value) => {
|
|
1408
1430
|
checkArray.forEach((order) => {
|
|
1409
1431
|
order.orderData.orderStatus = value;
|
|
1410
1432
|
});
|
|
1433
|
+
gvc.notifyDataChange(vm.id);
|
|
1411
1434
|
},
|
|
1412
1435
|
});
|
|
1413
1436
|
},
|
|
@@ -1467,25 +1490,11 @@ export class OrderSetting {
|
|
|
1467
1490
|
<div class="w-100 d-flex justify-content-end" style="padding: 14px 16px; gap: 14px;">
|
|
1468
1491
|
${BgWidget.cancel(gvc.event(() => closeEvent()))}
|
|
1469
1492
|
${BgWidget.save(gvc.event(() => {
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
['arrived', 'finish', 'shipping', 'in_stock'].includes(order.orderData.progress) &&
|
|
1475
|
-
!order.orderData.user_info.shipment_number) {
|
|
1476
|
-
dialog.errorMessage({
|
|
1477
|
-
text: `訂單編號 #${order.cart_token} 未輸入出貨單號碼`,
|
|
1478
|
-
});
|
|
1479
|
-
return;
|
|
1480
|
-
}
|
|
1493
|
+
const verify = this.batchUpdateOrderVerify(gvc, cloneOrders, vm.orders);
|
|
1494
|
+
if (verify) {
|
|
1495
|
+
obj.callback(vm.orders);
|
|
1496
|
+
topGVC.glitter.closeDiaLog();
|
|
1481
1497
|
}
|
|
1482
|
-
vm.orders.forEach((order) => {
|
|
1483
|
-
if (order.orderData.progress === 'in_stock') {
|
|
1484
|
-
order.orderData.progress = 'wait';
|
|
1485
|
-
}
|
|
1486
|
-
});
|
|
1487
|
-
obj.callback(vm.orders);
|
|
1488
|
-
topGVC.glitter.closeDiaLog();
|
|
1489
1498
|
}))}
|
|
1490
1499
|
</div>
|
|
1491
1500
|
</div>
|
|
@@ -1494,6 +1503,27 @@ export class OrderSetting {
|
|
|
1494
1503
|
});
|
|
1495
1504
|
}, 'batchEditOrders');
|
|
1496
1505
|
}
|
|
1506
|
+
static batchUpdateOrderVerify(gvc, cloneOrders, updateOrders) {
|
|
1507
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
1508
|
+
for (let i = 0; i < updateOrders.length; i++) {
|
|
1509
|
+
const order = updateOrders[i];
|
|
1510
|
+
const cloneOrder = cloneOrders[i];
|
|
1511
|
+
if (['wait', 'returns', undefined].includes(cloneOrder.orderData.progress) &&
|
|
1512
|
+
['arrived', 'finish', 'shipping', 'in_stock'].includes(order.orderData.progress) &&
|
|
1513
|
+
!order.orderData.user_info.shipment_number) {
|
|
1514
|
+
dialog.errorMessage({
|
|
1515
|
+
text: `訂單編號 #${order.cart_token} 未輸入出貨單號碼`,
|
|
1516
|
+
});
|
|
1517
|
+
return false;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
updateOrders.forEach((order) => {
|
|
1521
|
+
if (order.orderData.progress === 'in_stock') {
|
|
1522
|
+
order.orderData.progress = 'wait';
|
|
1523
|
+
}
|
|
1524
|
+
});
|
|
1525
|
+
return true;
|
|
1526
|
+
}
|
|
1497
1527
|
static splitOrder(topGVC, origOrderData, callback) {
|
|
1498
1528
|
var _a, _b;
|
|
1499
1529
|
const orderData = structuredClone(origOrderData);
|