ts-glitter 21.3.8 → 21.3.9
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/backend-manager/bg-line.js +12 -1
- package/lowcode/backend-manager/bg-line.ts +16 -1
- package/lowcode/backend-manager/bg-notify.js +13 -2
- package/lowcode/backend-manager/bg-notify.ts +17 -2
- package/lowcode/backend-manager/bg-product.js +81 -30
- package/lowcode/backend-manager/bg-product.ts +95 -34
- package/lowcode/backend-manager/bg-recommend.js +109 -141
- package/lowcode/backend-manager/bg-recommend.ts +122 -144
- package/lowcode/backend-manager/bg-sns.js +14 -4
- package/lowcode/backend-manager/bg-sns.ts +18 -4
- package/lowcode/backend-manager/bg-widget.js +176 -12
- package/lowcode/backend-manager/bg-widget.ts +198 -13
- package/lowcode/cms-plugin/auto-fcm-advertise.js +13 -2
- package/lowcode/cms-plugin/auto-fcm-advertise.ts +16 -2
- package/lowcode/cms-plugin/auto-fcm-history.js +13 -2
- package/lowcode/cms-plugin/auto-fcm-history.ts +16 -2
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/module/order-excel.js +18 -2
- package/lowcode/cms-plugin/module/order-excel.ts +20 -9
- package/lowcode/cms-plugin/module/product-setting.js +2 -1
- package/lowcode/cms-plugin/module/product-setting.ts +2 -1
- package/lowcode/cms-plugin/module/user-excel.js +1 -1
- package/lowcode/cms-plugin/module/user-excel.ts +2 -2
- package/lowcode/cms-plugin/pos-pages/payment-page.js +3 -2
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +11 -5
- package/lowcode/cms-plugin/pos-pages/products-page.ts +0 -1
- package/lowcode/cms-plugin/shopping-allowance-manager.js +3 -2
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +3 -2
- package/lowcode/cms-plugin/shopping-discount-setting.js +2 -0
- package/lowcode/cms-plugin/shopping-discount-setting.ts +2 -0
- package/lowcode/cms-plugin/shopping-invoice-manager.js +7 -4
- package/lowcode/cms-plugin/shopping-invoice-manager.ts +12 -11
- package/lowcode/cms-plugin/shopping-order-manager.js +21 -4
- package/lowcode/cms-plugin/shopping-order-manager.ts +30 -11
- package/lowcode/cms-plugin/shopping-product-setting.js +45 -41
- package/lowcode/cms-plugin/shopping-product-setting.ts +55 -48
- package/lowcode/cms-plugin/shopping-rebate.js +52 -46
- package/lowcode/cms-plugin/shopping-rebate.ts +402 -396
- package/lowcode/cms-plugin/shopping-setting-advance.js +6 -6
- package/lowcode/cms-plugin/shopping-setting-advance.ts +7 -7
- package/lowcode/cms-plugin/shopping-setting-basic.js +44 -0
- package/lowcode/cms-plugin/shopping-setting-basic.ts +63 -1
- package/lowcode/cms-plugin/shopping-setting-stock-log.js +57 -0
- package/lowcode/cms-plugin/shopping-setting-stock-log.ts +101 -0
- package/lowcode/cms-plugin/user-list.js +10 -9
- package/lowcode/cms-plugin/user-list.ts +11 -8
- package/lowcode/css/editor.css +1 -1
- package/lowcode/form-view/editor/image-selector.js +83 -82
- package/lowcode/form-view/editor/image-selector.ts +115 -107
- package/lowcode/glitter-base/route/user.js +27 -34
- package/lowcode/glitter-base/route/user.ts +31 -40
- package/lowcode/glitterBundle/dialog/ShareDialog.js +1 -0
- package/lowcode/glitterBundle/dialog/ShareDialog.ts +2 -0
- package/lowcode/glitterBundle/dialog/dialog.js +2 -2
- package/lowcode/glitterBundle/dialog/dialog.ts +2 -2
- package/lowcode/glitterBundle/plugins/editor-elem.js +5 -11
- package/lowcode/glitterBundle/plugins/editor-elem.ts +11 -11
- package/lowcode/modules/image-library.js +836 -486
- package/lowcode/modules/image-library.ts +1760 -1418
- package/lowcode/modules/tool.js +10 -9
- package/lowcode/modules/tool.ts +11 -10
- package/lowcode/public-models/product.ts +13 -0
- package/nxv0ptv53w.json +1 -0
- package/package.json +1 -1
- package/src/api-public/controllers/shop.js +2 -2
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +5 -2
- package/src/api-public/controllers/stock.js +1 -1
- package/src/api-public/controllers/stock.js.map +1 -1
- package/src/api-public/controllers/stock.ts +93 -81
- package/src/api-public/models/glitter-finance.js +2 -1
- package/src/api-public/models/glitter-finance.js.map +1 -1
- package/src/api-public/services/checkout-event.js +1 -0
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +2 -2
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/diff-record.d.ts +25 -0
- package/src/api-public/services/diff-record.js +158 -0
- package/src/api-public/services/diff-record.js.map +1 -0
- package/src/api-public/services/diff-record.ts +217 -0
- package/src/api-public/services/ezpay/tool.d.ts +1 -0
- package/src/api-public/services/financial-serviceV2.js +7 -17
- package/src/api-public/services/financial-serviceV2.js.map +1 -1
- package/src/api-public/services/public-table-check.js +25 -7
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/public-table-check.ts +53 -31
- package/src/api-public/services/shopping.d.ts +2 -12
- package/src/api-public/services/shopping.js +16 -7
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +33 -7
- package/src/api-public/services/stock.d.ts +1 -1
- package/src/api-public/services/stock.js +19 -17
- package/src/api-public/services/stock.js.map +1 -1
- package/src/api-public/services/stock.ts +711 -696
- package/src/api-public/services/user.d.ts +1 -1
- package/src/api-public/services/user.js +18 -8
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +34 -27
- package/src/app-project/serverless/src/index.js +7 -17
- package/src/app-project/serverless/src/index.js.map +1 -1
- package/src/app-project/serverless/src/modules/CryptoJS.js +7 -17
- package/src/app-project/serverless/src/modules/CryptoJS.js.map +1 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/app-project/serverless/src/modules/ssh.js +7 -17
- package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
- package/src/firebase/message.js +2 -1
- package/src/firebase/message.js.map +1 -1
- package/src/helper/app_creater.js +2 -1
- package/src/helper/app_creater.js.map +1 -1
- package/src/helper/glitter-util.d.ts +1 -0
- package/src/index.js +17 -7
- package/src/index.js.map +5 -1
- package/src/lambda/interface.js +2 -2
- package/src/lambda/interface.js.map +1 -1
- package/src/modules/CryptoJS.js +7 -17
- package/src/modules/CryptoJS.js.map +1 -1
- package/src/modules/database.d.ts +1 -1
- package/src/modules/ssh.js +7 -17
- package/src/modules/ssh.js.map +1 -1
- package/src/modules/tool.d.ts +5 -0
- package/src/modules/tool.js +19 -0
- package/src/modules/tool.js.map +1 -1
- package/src/modules/tool.ts +27 -0
- package/src/run.js +2 -1
- package/src/run.js.map +1 -1
- package/src/services/saas-table-check.js +2 -2
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/ses.js +2 -1
- package/src/services/ses.js.map +1 -1
|
@@ -63,6 +63,7 @@ export class OrderExcel {
|
|
|
63
63
|
'訂單使用購物金',
|
|
64
64
|
'分銷連結代碼',
|
|
65
65
|
'分銷連結名稱',
|
|
66
|
+
'FB廣告追蹤碼',
|
|
66
67
|
],
|
|
67
68
|
商品: ['商品名稱', '商品規格', '商品SKU', '商品購買數量', '商品價格', '商品折扣'],
|
|
68
69
|
顧客: [
|
|
@@ -216,9 +217,22 @@ export class OrderExcel {
|
|
|
216
217
|
|
|
217
218
|
// 訂單欄位物件
|
|
218
219
|
const getOrderJSON = (order: any, orderData: any) => {
|
|
220
|
+
const formatOrderSource = (() => {
|
|
221
|
+
if (orderData.fbp) return 'FB廣告';
|
|
222
|
+
if (!orderData.orderSource) return '線上';
|
|
223
|
+
|
|
224
|
+
const source: Record<string, string> = {
|
|
225
|
+
pos: 'POS',
|
|
226
|
+
combine: '合併訂單',
|
|
227
|
+
split: '拆分訂單',
|
|
228
|
+
manual: '手動新增',
|
|
229
|
+
};
|
|
230
|
+
return source[orderData.orderSource] ?? '線上';
|
|
231
|
+
})();
|
|
232
|
+
|
|
219
233
|
return formatJSON({
|
|
220
234
|
訂單編號: order.cart_token,
|
|
221
|
-
訂單來源:
|
|
235
|
+
訂單來源: formatOrderSource,
|
|
222
236
|
訂單建立時間: formatDate(order.created_time),
|
|
223
237
|
會員信箱: order.email ?? 'no-email',
|
|
224
238
|
訂單處理狀態: getStatusLabel(orderData.orderStatus, { '-1': '已取消', '1': '已完成', '0': '處理中' }, '處理中'),
|
|
@@ -247,6 +261,7 @@ export class OrderExcel {
|
|
|
247
261
|
訂單總計: orderData.total,
|
|
248
262
|
分銷連結代碼: orderData.distribution_info?.code ?? '',
|
|
249
263
|
分銷連結名稱: orderData.distribution_info?.title ?? '',
|
|
264
|
+
FB廣告追蹤碼: orderData.fbp,
|
|
250
265
|
});
|
|
251
266
|
};
|
|
252
267
|
|
|
@@ -410,7 +425,8 @@ export class OrderExcel {
|
|
|
410
425
|
|
|
411
426
|
// 取得客製化資訊
|
|
412
427
|
static getCustomizeMap = async (order?: any) => {
|
|
413
|
-
const [cashflowConfigObj, shipmentConfigObj, registerConfig, memberConfig
|
|
428
|
+
const [cashflowConfigObj, shipmentConfigObj, registerConfig, memberConfig, receipt] =
|
|
429
|
+
await OrderExcel.customizePromise();
|
|
414
430
|
const customizeMap = new Map();
|
|
415
431
|
|
|
416
432
|
const getUserValue = (key: string) => {
|
|
@@ -468,7 +484,7 @@ export class OrderExcel {
|
|
|
468
484
|
) {
|
|
469
485
|
customizeMap.set(`收件人資訊 - ${d1.title}`, order ? (order.orderData.user_info[d1.key] ?? '-') : '-');
|
|
470
486
|
}
|
|
471
|
-
})
|
|
487
|
+
});
|
|
472
488
|
return customizeMap;
|
|
473
489
|
};
|
|
474
490
|
|
|
@@ -1024,12 +1040,7 @@ export class OrderExcel {
|
|
|
1024
1040
|
return Array.isArray(r.response.value.list) ? r.response.value.list : [];
|
|
1025
1041
|
}),
|
|
1026
1042
|
//收件人資料
|
|
1027
|
-
(
|
|
1028
|
-
await ApiUser.getPublicConfig(
|
|
1029
|
-
'custom_form_checkout_recipient',
|
|
1030
|
-
'manager'
|
|
1031
|
-
)
|
|
1032
|
-
).response.value
|
|
1043
|
+
(await ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager')).response.value,
|
|
1033
1044
|
]);
|
|
1034
1045
|
|
|
1035
1046
|
return dataArray;
|
|
@@ -298,12 +298,13 @@ export class ProductSetting {
|
|
|
298
298
|
}
|
|
299
299
|
})}"
|
|
300
300
|
onchange="${gvc.event(e => {
|
|
301
|
-
data['stockList'][item.id].count = e.value;
|
|
301
|
+
data['stockList'][item.id].count = Number(e.value);
|
|
302
302
|
let count = 0;
|
|
303
303
|
Object.values(data['stockList']).map((stock) => {
|
|
304
304
|
count += parseInt(stock.count, 10);
|
|
305
305
|
});
|
|
306
306
|
data['stock'] = count;
|
|
307
|
+
console.log("data -- ", data);
|
|
307
308
|
gvc.notifyDataChange(vm.id);
|
|
308
309
|
})}"
|
|
309
310
|
/>
|
|
@@ -328,13 +328,14 @@ export class ProductSetting {
|
|
|
328
328
|
}
|
|
329
329
|
})}"
|
|
330
330
|
onchange="${gvc.event(e => {
|
|
331
|
-
(data as any)['stockList'][item.id].count = e.value;
|
|
331
|
+
(data as any)['stockList'][item.id].count = Number(e.value);
|
|
332
332
|
let count = 0;
|
|
333
333
|
Object.values((data as any)['stockList']).map((stock: any) => {
|
|
334
334
|
count += parseInt(stock.count, 10);
|
|
335
335
|
});
|
|
336
336
|
|
|
337
337
|
data['stock'] = count;
|
|
338
|
+
console.log("data -- " , data);
|
|
338
339
|
gvc.notifyDataChange(vm.id);
|
|
339
340
|
})}"
|
|
340
341
|
/>
|
|
@@ -124,7 +124,7 @@ export class UserExcel {
|
|
|
124
124
|
return formatJSON({
|
|
125
125
|
最後購買日期: formatDate(user.latest_order_date),
|
|
126
126
|
最後消費金額: user.latest_order_total,
|
|
127
|
-
最後出貨日期: user.
|
|
127
|
+
最後出貨日期: user.last_has_shipment_number_date ? formatDate(user.last_has_shipment_number_date) : '無',
|
|
128
128
|
累積消費金額: user.checkout_total,
|
|
129
129
|
累積消費次數: user.checkout_count,
|
|
130
130
|
});
|
|
@@ -50,7 +50,7 @@ interface User {
|
|
|
50
50
|
latest_order_total: number;
|
|
51
51
|
rebate: number;
|
|
52
52
|
member_deadline: string;
|
|
53
|
-
|
|
53
|
+
last_has_shipment_number_date: string;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export class UserExcel {
|
|
@@ -233,7 +233,7 @@ export class UserExcel {
|
|
|
233
233
|
return formatJSON({
|
|
234
234
|
最後購買日期: formatDate(user.latest_order_date),
|
|
235
235
|
最後消費金額: user.latest_order_total,
|
|
236
|
-
最後出貨日期: user.
|
|
236
|
+
最後出貨日期: user.last_has_shipment_number_date ? formatDate(user.last_has_shipment_number_date) : '無',
|
|
237
237
|
累積消費金額: user.checkout_total,
|
|
238
238
|
累積消費次數: user.checkout_count,
|
|
239
239
|
});
|
|
@@ -460,8 +460,9 @@ export class PaymentPage {
|
|
|
460
460
|
return new Promise(resolve => {
|
|
461
461
|
ApiUser.getUserList({
|
|
462
462
|
page: 0,
|
|
463
|
-
limit:
|
|
463
|
+
limit: 99999,
|
|
464
464
|
search: data.query,
|
|
465
|
+
only_id: true,
|
|
465
466
|
}).then(dd => {
|
|
466
467
|
if (dd.response.data) {
|
|
467
468
|
resolve(dd.response.data.map((item) => {
|
|
@@ -2201,7 +2202,7 @@ export class PaymentPage {
|
|
|
2201
2202
|
placeholder="請輸入統一編號"
|
|
2202
2203
|
value="${c_vm.value}"
|
|
2203
2204
|
onclick="${gvc.event(() => {
|
|
2204
|
-
PosFunction.setMoney(gvc, c_vm.value || '0',
|
|
2205
|
+
PosFunction.setMoney(gvc, c_vm.value || '0', text => {
|
|
2205
2206
|
c_vm.value = `${text}`;
|
|
2206
2207
|
gvc.recreateView();
|
|
2207
2208
|
}, '統一編號');
|
|
@@ -520,8 +520,9 @@ export class PaymentPage {
|
|
|
520
520
|
return new Promise(resolve => {
|
|
521
521
|
ApiUser.getUserList({
|
|
522
522
|
page: 0,
|
|
523
|
-
limit:
|
|
523
|
+
limit: 99999,
|
|
524
524
|
search: data.query,
|
|
525
|
+
only_id: true,
|
|
525
526
|
}).then(dd => {
|
|
526
527
|
if (dd.response.data) {
|
|
527
528
|
resolve(
|
|
@@ -2394,10 +2395,15 @@ export class PaymentPage {
|
|
|
2394
2395
|
placeholder="請輸入統一編號"
|
|
2395
2396
|
value="${c_vm.value}"
|
|
2396
2397
|
onclick="${gvc.event(() => {
|
|
2397
|
-
PosFunction.setMoney(
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2398
|
+
PosFunction.setMoney(
|
|
2399
|
+
gvc,
|
|
2400
|
+
c_vm.value || '0',
|
|
2401
|
+
text => {
|
|
2402
|
+
c_vm.value = `${text}`;
|
|
2403
|
+
gvc.recreateView();
|
|
2404
|
+
},
|
|
2405
|
+
'統一編號'
|
|
2406
|
+
);
|
|
2401
2407
|
})}"
|
|
2402
2408
|
readonly
|
|
2403
2409
|
/>
|
|
@@ -6,7 +6,6 @@ import { POSSetting } from '../POS-setting.js';
|
|
|
6
6
|
import { Swal } from '../../modules/sweetAlert.js';
|
|
7
7
|
import { PaymentPage } from './payment-page.js';
|
|
8
8
|
import { PayConfig } from './pay-config.js';
|
|
9
|
-
import { fa } from '@faker-js/faker';
|
|
10
9
|
|
|
11
10
|
const html = String.raw;
|
|
12
11
|
|
|
@@ -83,15 +83,16 @@ export class ShoppingAllowanceManager {
|
|
|
83
83
|
<div class="flex-fill"></div>
|
|
84
84
|
<div style="display: flex; gap: 14px;">
|
|
85
85
|
${BgWidget.grayButton('匯出', gvc.event(() => {
|
|
86
|
+
const limit = 1000;
|
|
86
87
|
let dialog = new ShareDialog(glitter);
|
|
87
88
|
dialog.warningMessage({
|
|
88
|
-
text: `系統將以目前列表搜尋的訂單結果匯出<br
|
|
89
|
+
text: `系統將以目前列表搜尋的訂單結果匯出<br />最多匯出${limit}筆資料,是否匯出?`,
|
|
89
90
|
callback: bool => {
|
|
90
91
|
if (bool) {
|
|
91
92
|
dialog.dataLoading({ visible: true });
|
|
92
93
|
ApiShop.getInvoice({
|
|
93
94
|
page: 0,
|
|
94
|
-
limit:
|
|
95
|
+
limit: limit,
|
|
95
96
|
search: vm.query || undefined,
|
|
96
97
|
searchType: vm.queryType || 'cart_token',
|
|
97
98
|
orderString: vm.orderString,
|
|
@@ -126,15 +126,16 @@ export class ShoppingAllowanceManager {
|
|
|
126
126
|
${BgWidget.grayButton(
|
|
127
127
|
'匯出',
|
|
128
128
|
gvc.event(() => {
|
|
129
|
+
const limit = 1000;
|
|
129
130
|
let dialog = new ShareDialog(glitter);
|
|
130
131
|
dialog.warningMessage({
|
|
131
|
-
text: `系統將以目前列表搜尋的訂單結果匯出<br
|
|
132
|
+
text: `系統將以目前列表搜尋的訂單結果匯出<br />最多匯出${limit}筆資料,是否匯出?`,
|
|
132
133
|
callback: bool => {
|
|
133
134
|
if (bool) {
|
|
134
135
|
dialog.dataLoading({ visible: true });
|
|
135
136
|
ApiShop.getInvoice({
|
|
136
137
|
page: 0,
|
|
137
|
-
limit:
|
|
138
|
+
limit: limit,
|
|
138
139
|
search: vm.query || undefined,
|
|
139
140
|
searchType: vm.queryType || 'cart_token',
|
|
140
141
|
orderString: vm.orderString,
|
|
@@ -429,6 +429,7 @@ export class ShoppingDiscountSetting {
|
|
|
429
429
|
limit: 99999,
|
|
430
430
|
search: data.query,
|
|
431
431
|
orderString: data.orderString,
|
|
432
|
+
only_id: true,
|
|
432
433
|
}).then(dd => {
|
|
433
434
|
if (dd.response.data) {
|
|
434
435
|
resolve(dd.response.data.map((item) => {
|
|
@@ -470,6 +471,7 @@ export class ShoppingDiscountSetting {
|
|
|
470
471
|
page: 0,
|
|
471
472
|
limit: 99999,
|
|
472
473
|
id: voucherData.targetList.join(','),
|
|
474
|
+
only_id: true,
|
|
473
475
|
}).then(dd => {
|
|
474
476
|
if (dd.response.data) {
|
|
475
477
|
customVM.dataList = dd.response.data.map((item) => {
|
|
@@ -556,6 +556,7 @@ export class ShoppingDiscountSetting {
|
|
|
556
556
|
limit: 99999,
|
|
557
557
|
search: data.query,
|
|
558
558
|
orderString: data.orderString,
|
|
559
|
+
only_id: true,
|
|
559
560
|
}).then(dd => {
|
|
560
561
|
if (dd.response.data) {
|
|
561
562
|
resolve(
|
|
@@ -609,6 +610,7 @@ export class ShoppingDiscountSetting {
|
|
|
609
610
|
page: 0,
|
|
610
611
|
limit: 99999,
|
|
611
612
|
id: voucherData.targetList.join(','),
|
|
613
|
+
only_id: true,
|
|
612
614
|
}).then(dd => {
|
|
613
615
|
if (dd.response.data) {
|
|
614
616
|
customVM.dataList = dd.response.data.map(
|
|
@@ -129,14 +129,15 @@ export class ShoppingInvoiceManager {
|
|
|
129
129
|
<div class="flex-fill"></div>
|
|
130
130
|
<div style="display: flex; gap: 14px;">
|
|
131
131
|
${BgWidget.grayButton('匯出', gvc.event(() => {
|
|
132
|
+
const limit = 1000;
|
|
132
133
|
dialog.warningMessage({
|
|
133
|
-
text: `系統將以目前列表搜尋的訂單結果匯出<br
|
|
134
|
+
text: `系統將以目前列表搜尋的訂單結果匯出<br />最多匯出${limit}筆資料,是否匯出?`,
|
|
134
135
|
callback: bool => {
|
|
135
136
|
if (bool) {
|
|
136
137
|
dialog.dataLoading({ visible: true });
|
|
137
138
|
ApiShop.getInvoice({
|
|
138
139
|
page: 0,
|
|
139
|
-
limit:
|
|
140
|
+
limit: limit,
|
|
140
141
|
search: vm.query || undefined,
|
|
141
142
|
searchType: vm.queryType || 'order_number',
|
|
142
143
|
orderString: vm.orderString,
|
|
@@ -444,7 +445,7 @@ export class ShoppingInvoiceManager {
|
|
|
444
445
|
}).then((response) => {
|
|
445
446
|
orderData_ = response.response;
|
|
446
447
|
orderData_.orderData.user_info = invoiceData.invoice_data.original_data;
|
|
447
|
-
orderData_.orderData.user_info.print_invoice =
|
|
448
|
+
orderData_.orderData.user_info.print_invoice = invoiceData.invoice_data.original_data.Print;
|
|
448
449
|
dataLoading = false;
|
|
449
450
|
gvc.notifyDataChange([mainViewID, 'invoiceContent']);
|
|
450
451
|
});
|
|
@@ -505,7 +506,9 @@ export class ShoppingInvoiceManager {
|
|
|
505
506
|
const orderData = invoiceData.invoice_data.orderData || orderData_.orderData;
|
|
506
507
|
console.log(`orderData_.orderData===>`, orderData_.orderData);
|
|
507
508
|
console.log(`invoiceData.invoice_data.orderData=>`, invoiceData.invoice_data);
|
|
508
|
-
orderData.user_info.invoice_type = invoiceData.invoice_data.original_data.CustomerIdentifier
|
|
509
|
+
orderData.user_info.invoice_type = invoiceData.invoice_data.original_data.CustomerIdentifier
|
|
510
|
+
? `company`
|
|
511
|
+
: `customer`;
|
|
509
512
|
orderData.user_info.company = invoiceData.invoice_data.original_data.CustomerName;
|
|
510
513
|
orderData.user_info.print_invoice = invoiceData.invoice_data.original_data.Print;
|
|
511
514
|
let tax_total = (() => {
|
|
@@ -173,14 +173,15 @@ export class ShoppingInvoiceManager {
|
|
|
173
173
|
${BgWidget.grayButton(
|
|
174
174
|
'匯出',
|
|
175
175
|
gvc.event(() => {
|
|
176
|
+
const limit = 1000;
|
|
176
177
|
dialog.warningMessage({
|
|
177
|
-
text: `系統將以目前列表搜尋的訂單結果匯出<br
|
|
178
|
+
text: `系統將以目前列表搜尋的訂單結果匯出<br />最多匯出${limit}筆資料,是否匯出?`,
|
|
178
179
|
callback: bool => {
|
|
179
180
|
if (bool) {
|
|
180
181
|
dialog.dataLoading({ visible: true });
|
|
181
182
|
ApiShop.getInvoice({
|
|
182
183
|
page: 0,
|
|
183
|
-
limit:
|
|
184
|
+
limit: limit,
|
|
184
185
|
search: vm.query || undefined,
|
|
185
186
|
searchType: vm.queryType || 'order_number',
|
|
186
187
|
orderString: vm.orderString,
|
|
@@ -494,7 +495,6 @@ export class ShoppingInvoiceManager {
|
|
|
494
495
|
public static replaceOrder(gvc: GVC, vm: any, searchOrder?: any) {
|
|
495
496
|
const glitter = gvc.glitter;
|
|
496
497
|
|
|
497
|
-
|
|
498
498
|
let orderData_: {
|
|
499
499
|
id: number;
|
|
500
500
|
cart_token: string;
|
|
@@ -537,7 +537,7 @@ export class ShoppingInvoiceManager {
|
|
|
537
537
|
MerchantTradeNo: string;
|
|
538
538
|
CVSAddress: string;
|
|
539
539
|
note?: string;
|
|
540
|
-
print_invoice?:string;
|
|
540
|
+
print_invoice?: string;
|
|
541
541
|
code_note?: string;
|
|
542
542
|
gui_number?: string;
|
|
543
543
|
};
|
|
@@ -583,7 +583,7 @@ export class ShoppingInvoiceManager {
|
|
|
583
583
|
};
|
|
584
584
|
const mainViewID = gvc.glitter.getUUID();
|
|
585
585
|
let dataLoading = true;
|
|
586
|
-
const invoiceData=vm.invoiceData;
|
|
586
|
+
const invoiceData = vm.invoiceData;
|
|
587
587
|
ApiShop.getOrder({
|
|
588
588
|
page: 0,
|
|
589
589
|
limit: 100,
|
|
@@ -593,8 +593,8 @@ const invoiceData=vm.invoiceData;
|
|
|
593
593
|
}).then((response: any) => {
|
|
594
594
|
orderData_ = response.response;
|
|
595
595
|
|
|
596
|
-
orderData_.orderData.user_info=invoiceData.invoice_data.original_data;
|
|
597
|
-
orderData_.orderData.user_info.print_invoice=
|
|
596
|
+
orderData_.orderData.user_info = invoiceData.invoice_data.original_data;
|
|
597
|
+
orderData_.orderData.user_info.print_invoice = invoiceData.invoice_data.original_data.Print;
|
|
598
598
|
dataLoading = false;
|
|
599
599
|
gvc.notifyDataChange([mainViewID, 'invoiceContent']);
|
|
600
600
|
});
|
|
@@ -663,9 +663,11 @@ const invoiceData=vm.invoiceData;
|
|
|
663
663
|
const orderData = invoiceData.invoice_data.orderData || orderData_.orderData;
|
|
664
664
|
console.log(`orderData_.orderData===>`, orderData_.orderData);
|
|
665
665
|
console.log(`invoiceData.invoice_data.orderData=>`, invoiceData.invoice_data);
|
|
666
|
-
orderData.user_info.invoice_type=invoiceData.invoice_data.original_data.CustomerIdentifier
|
|
667
|
-
|
|
668
|
-
|
|
666
|
+
orderData.user_info.invoice_type = invoiceData.invoice_data.original_data.CustomerIdentifier
|
|
667
|
+
? `company`
|
|
668
|
+
: `customer`;
|
|
669
|
+
orderData.user_info.company = invoiceData.invoice_data.original_data.CustomerName;
|
|
670
|
+
orderData.user_info.print_invoice = invoiceData.invoice_data.original_data.Print;
|
|
669
671
|
let tax_total = (() => {
|
|
670
672
|
let total = 0;
|
|
671
673
|
orderData.lineItems
|
|
@@ -1588,7 +1590,6 @@ ${reason}</textarea
|
|
|
1588
1590
|
),
|
|
1589
1591
|
];
|
|
1590
1592
|
|
|
1591
|
-
|
|
1592
1593
|
if (
|
|
1593
1594
|
invoiceData.invoice_data.original_data.Print === '1' &&
|
|
1594
1595
|
(window.parent as any).glitter.share.PayConfig.posType === 'SUNMI'
|
|
@@ -336,6 +336,7 @@ export class ShoppingOrderManager {
|
|
|
336
336
|
page: 0,
|
|
337
337
|
limit: 99999,
|
|
338
338
|
filter_type: 'watch',
|
|
339
|
+
only_id: true,
|
|
339
340
|
}),
|
|
340
341
|
]).then(dataArray => {
|
|
341
342
|
return [dataArray[0], dataArray[1].response.data];
|
|
@@ -2603,16 +2604,31 @@ export class ShoppingOrderManager {
|
|
|
2603
2604
|
${[
|
|
2604
2605
|
BgWidget.mainCard(html `
|
|
2605
2606
|
<div style="font-size: 16px;font-weight: 700;">訂單來源</div>
|
|
2606
|
-
<div>
|
|
2607
|
+
<div class="d-flex flex-column gap-1 mt-1">
|
|
2607
2608
|
${(() => {
|
|
2608
2609
|
var _a;
|
|
2610
|
+
if (orderData.orderData.fbp) {
|
|
2611
|
+
return html `
|
|
2612
|
+
<div>FB廣告</div>
|
|
2613
|
+
${BgWidget.blueNote(html `複製追蹤碼<i class="fa-regular fa-copy ms-1"></i>`, gvc.event(() => {
|
|
2614
|
+
navigator.clipboard.writeText(`${orderData.orderData.fbp}`);
|
|
2615
|
+
BgWidget.jumpAlert({
|
|
2616
|
+
gvc,
|
|
2617
|
+
text: '複製成功',
|
|
2618
|
+
justify: 'top',
|
|
2619
|
+
align: 'center',
|
|
2620
|
+
});
|
|
2621
|
+
}), 'font-weight: 500;')}
|
|
2622
|
+
`;
|
|
2623
|
+
}
|
|
2609
2624
|
if (!orderData.orderData.orderSource) {
|
|
2610
2625
|
return '線上';
|
|
2611
2626
|
}
|
|
2612
2627
|
const source = {
|
|
2613
2628
|
pos: 'POS',
|
|
2614
2629
|
combine: '合併訂單',
|
|
2615
|
-
split: '
|
|
2630
|
+
split: '拆分訂單',
|
|
2631
|
+
manual: '手動新增',
|
|
2616
2632
|
};
|
|
2617
2633
|
return (_a = source[orderData.orderData.orderSource]) !== null && _a !== void 0 ? _a : '線上';
|
|
2618
2634
|
})()}
|
|
@@ -2923,7 +2939,7 @@ export class ShoppingOrderManager {
|
|
|
2923
2939
|
</div>`,
|
|
2924
2940
|
ratio: 25,
|
|
2925
2941
|
})}
|
|
2926
|
-
|
|
2942
|
+
<div style="height:240px;"></div>
|
|
2927
2943
|
<div class="update-bar-container">
|
|
2928
2944
|
<div>
|
|
2929
2945
|
${gvc.bindView(() => {
|
|
@@ -4056,8 +4072,9 @@ export class ShoppingOrderManager {
|
|
|
4056
4072
|
return new Promise(resolve => {
|
|
4057
4073
|
ApiUser.getUserList({
|
|
4058
4074
|
page: 0,
|
|
4059
|
-
limit:
|
|
4075
|
+
limit: 99999,
|
|
4060
4076
|
search: data.query,
|
|
4077
|
+
only_id: true,
|
|
4061
4078
|
}).then(dd => {
|
|
4062
4079
|
if (dd.response.data) {
|
|
4063
4080
|
resolve(dd.response.data.map((item) => {
|
|
@@ -28,7 +28,6 @@ import { LineItem } from './module/data.js';
|
|
|
28
28
|
import { OrderModule } from './order/order-module.js';
|
|
29
29
|
import { TableStorage } from './module/table-storage.js';
|
|
30
30
|
|
|
31
|
-
|
|
32
31
|
const html = String.raw;
|
|
33
32
|
const css = String.raw;
|
|
34
33
|
|
|
@@ -196,11 +195,10 @@ export class ShoppingOrderManager {
|
|
|
196
195
|
};
|
|
197
196
|
|
|
198
197
|
return viewMap[vm.type]() ?? '';
|
|
199
|
-
}catch (e) {
|
|
200
|
-
console.error(e)
|
|
201
|
-
return `${e}
|
|
198
|
+
} catch (e) {
|
|
199
|
+
console.error(e);
|
|
200
|
+
return `${e}`;
|
|
202
201
|
}
|
|
203
|
-
|
|
204
202
|
},
|
|
205
203
|
onCreate: () => {
|
|
206
204
|
if (vm.loading) {
|
|
@@ -405,6 +403,7 @@ export class ShoppingOrderManager {
|
|
|
405
403
|
page: 0,
|
|
406
404
|
limit: 99999,
|
|
407
405
|
filter_type: 'watch',
|
|
406
|
+
only_id: true,
|
|
408
407
|
}),
|
|
409
408
|
]).then(dataArray => {
|
|
410
409
|
return [dataArray[0], dataArray[1].response.data];
|
|
@@ -1066,7 +1065,7 @@ export class ShoppingOrderManager {
|
|
|
1066
1065
|
let userData: any = {};
|
|
1067
1066
|
let invoiceDataList: any = [];
|
|
1068
1067
|
let storeList: any = [];
|
|
1069
|
-
let mainViewId=gvc.glitter.getUUID();
|
|
1068
|
+
let mainViewId = gvc.glitter.getUUID();
|
|
1070
1069
|
let productData: any = [];
|
|
1071
1070
|
let is_shipment = ['shipment_list_archive', 'shipment_list'].includes(
|
|
1072
1071
|
(window as any).glitter.getUrlParameter('page')
|
|
@@ -1965,7 +1964,7 @@ export class ShoppingOrderManager {
|
|
|
1965
1964
|
return;
|
|
1966
1965
|
}
|
|
1967
1966
|
(window.parent as any).glitter.setUrlParameter('orderID', undefined);
|
|
1968
|
-
|
|
1967
|
+
|
|
1969
1968
|
if (backCallback) {
|
|
1970
1969
|
backCallback();
|
|
1971
1970
|
} else {
|
|
@@ -2873,15 +2872,34 @@ export class ShoppingOrderManager {
|
|
|
2873
2872
|
${[
|
|
2874
2873
|
BgWidget.mainCard(html`
|
|
2875
2874
|
<div style="font-size: 16px;font-weight: 700;">訂單來源</div>
|
|
2876
|
-
<div>
|
|
2875
|
+
<div class="d-flex flex-column gap-1 mt-1">
|
|
2877
2876
|
${(() => {
|
|
2877
|
+
if (orderData.orderData.fbp) {
|
|
2878
|
+
return html`
|
|
2879
|
+
<div>FB廣告</div>
|
|
2880
|
+
${BgWidget.blueNote(
|
|
2881
|
+
html`複製追蹤碼<i class="fa-regular fa-copy ms-1"></i>`,
|
|
2882
|
+
gvc.event(() => {
|
|
2883
|
+
navigator.clipboard.writeText(`${orderData.orderData.fbp}`);
|
|
2884
|
+
BgWidget.jumpAlert({
|
|
2885
|
+
gvc,
|
|
2886
|
+
text: '複製成功',
|
|
2887
|
+
justify: 'top',
|
|
2888
|
+
align: 'center',
|
|
2889
|
+
});
|
|
2890
|
+
}),
|
|
2891
|
+
'font-weight: 500;'
|
|
2892
|
+
)}
|
|
2893
|
+
`;
|
|
2894
|
+
}
|
|
2878
2895
|
if (!orderData.orderData.orderSource) {
|
|
2879
2896
|
return '線上';
|
|
2880
2897
|
}
|
|
2881
2898
|
const source: Record<string, string> = {
|
|
2882
2899
|
pos: 'POS',
|
|
2883
2900
|
combine: '合併訂單',
|
|
2884
|
-
split: '
|
|
2901
|
+
split: '拆分訂單',
|
|
2902
|
+
manual: '手動新增',
|
|
2885
2903
|
};
|
|
2886
2904
|
return source[orderData.orderData.orderSource] ?? '線上';
|
|
2887
2905
|
})()}
|
|
@@ -3219,7 +3237,7 @@ export class ShoppingOrderManager {
|
|
|
3219
3237
|
ratio: 25,
|
|
3220
3238
|
}
|
|
3221
3239
|
)}
|
|
3222
|
-
|
|
3240
|
+
<div style="height:240px;"></div>
|
|
3223
3241
|
<div class="update-bar-container">
|
|
3224
3242
|
<div>
|
|
3225
3243
|
${gvc.bindView(() => {
|
|
@@ -4426,8 +4444,9 @@ export class ShoppingOrderManager {
|
|
|
4426
4444
|
return new Promise(resolve => {
|
|
4427
4445
|
ApiUser.getUserList({
|
|
4428
4446
|
page: 0,
|
|
4429
|
-
limit:
|
|
4447
|
+
limit: 99999,
|
|
4430
4448
|
search: data.query,
|
|
4449
|
+
only_id: true,
|
|
4431
4450
|
}).then(dd => {
|
|
4432
4451
|
if (dd.response.data) {
|
|
4433
4452
|
resolve(
|