ts-glitter 21.3.7 → 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/POS-setting.js +2 -2
- package/lowcode/cms-plugin/POS-setting.ts +2 -2
- 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 +4 -3
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +12 -6
- package/lowcode/cms-plugin/pos-pages/products-page.js +9 -5
- package/lowcode/cms-plugin/pos-pages/products-page.ts +11 -5
- 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
|
@@ -121,9 +121,23 @@ export class OrderExcel {
|
|
|
121
121
|
const formatJSON = (obj) => Object.fromEntries(Object.entries(obj).filter(([key]) => column.includes(key)));
|
|
122
122
|
const getOrderJSON = (order, orderData) => {
|
|
123
123
|
var _b, _c, _d, _e, _f, _g;
|
|
124
|
+
const formatOrderSource = (() => {
|
|
125
|
+
var _b;
|
|
126
|
+
if (orderData.fbp)
|
|
127
|
+
return 'FB廣告';
|
|
128
|
+
if (!orderData.orderSource)
|
|
129
|
+
return '線上';
|
|
130
|
+
const source = {
|
|
131
|
+
pos: 'POS',
|
|
132
|
+
combine: '合併訂單',
|
|
133
|
+
split: '拆分訂單',
|
|
134
|
+
manual: '手動新增',
|
|
135
|
+
};
|
|
136
|
+
return (_b = source[orderData.orderSource]) !== null && _b !== void 0 ? _b : '線上';
|
|
137
|
+
})();
|
|
124
138
|
return formatJSON({
|
|
125
139
|
訂單編號: order.cart_token,
|
|
126
|
-
訂單來源:
|
|
140
|
+
訂單來源: formatOrderSource,
|
|
127
141
|
訂單建立時間: formatDate(order.created_time),
|
|
128
142
|
會員信箱: (_b = order.email) !== null && _b !== void 0 ? _b : 'no-email',
|
|
129
143
|
訂單處理狀態: getStatusLabel(orderData.orderStatus, { '-1': '已取消', '1': '已完成', '0': '處理中' }, '處理中'),
|
|
@@ -144,6 +158,7 @@ export class OrderExcel {
|
|
|
144
158
|
訂單總計: orderData.total,
|
|
145
159
|
分銷連結代碼: (_e = (_d = orderData.distribution_info) === null || _d === void 0 ? void 0 : _d.code) !== null && _e !== void 0 ? _e : '',
|
|
146
160
|
分銷連結名稱: (_g = (_f = orderData.distribution_info) === null || _f === void 0 ? void 0 : _f.title) !== null && _g !== void 0 ? _g : '',
|
|
161
|
+
FB廣告追蹤碼: orderData.fbp,
|
|
147
162
|
});
|
|
148
163
|
};
|
|
149
164
|
const getProductJSON = (item) => {
|
|
@@ -753,7 +768,7 @@ export class OrderExcel {
|
|
|
753
768
|
yield ApiUser.getPublicConfig('customer_form_user_setting', 'manager').then(r => {
|
|
754
769
|
return Array.isArray(r.response.value.list) ? r.response.value.list : [];
|
|
755
770
|
}),
|
|
756
|
-
(yield ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager')).response.value
|
|
771
|
+
(yield ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager')).response.value,
|
|
757
772
|
]);
|
|
758
773
|
return dataArray;
|
|
759
774
|
});
|
|
@@ -802,6 +817,7 @@ OrderExcel.headerColumn = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
802
817
|
'訂單使用購物金',
|
|
803
818
|
'分銷連結代碼',
|
|
804
819
|
'分銷連結名稱',
|
|
820
|
+
'FB廣告追蹤碼',
|
|
805
821
|
],
|
|
806
822
|
商品: ['商品名稱', '商品規格', '商品SKU', '商品購買數量', '商品價格', '商品折扣'],
|
|
807
823
|
顧客: [
|
|
@@ -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) => {
|
|
@@ -489,7 +490,7 @@ export class PaymentPage {
|
|
|
489
490
|
<div
|
|
490
491
|
style="flex: 1 1 0; color: #8D8D8D; font-size: 16px; font-weight: 400; word-wrap: break-word"
|
|
491
492
|
>
|
|
492
|
-
|
|
493
|
+
信箱 / 電話 / 編號
|
|
493
494
|
</div>
|
|
494
495
|
</div>
|
|
495
496
|
</div>
|
|
@@ -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(
|
|
@@ -558,7 +559,7 @@ export class PaymentPage {
|
|
|
558
559
|
<div
|
|
559
560
|
style="flex: 1 1 0; color: #8D8D8D; font-size: 16px; font-weight: 400; word-wrap: break-word"
|
|
560
561
|
>
|
|
561
|
-
|
|
562
|
+
信箱 / 電話 / 編號
|
|
562
563
|
</div>
|
|
563
564
|
</div>
|
|
564
565
|
</div>
|
|
@@ -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
|
/>
|
|
@@ -29,7 +29,9 @@ export class ProductsPage {
|
|
|
29
29
|
};
|
|
30
30
|
function loadData() {
|
|
31
31
|
let category = vm.categories.find((category) => category.select == true);
|
|
32
|
-
|
|
32
|
+
if ((!vm.productSearch) || !vm.productSearch.length) {
|
|
33
|
+
dialog.dataLoading({ visible: true });
|
|
34
|
+
}
|
|
33
35
|
ApiShop.getProduct({
|
|
34
36
|
page: pVM.pageIndex - 1,
|
|
35
37
|
collection: category.key == 'all' ? '' : category.key,
|
|
@@ -40,9 +42,11 @@ export class ProductsPage {
|
|
|
40
42
|
whereStore: POSSetting.config.where_store,
|
|
41
43
|
orderBy: 'created_time_desc',
|
|
42
44
|
}).then(res => {
|
|
45
|
+
if ((!vm.productSearch) || !vm.productSearch.length) {
|
|
46
|
+
dialog.dataLoading({ visible: false });
|
|
47
|
+
}
|
|
43
48
|
vm.productSearch = res.response.data;
|
|
44
49
|
pVM.pageSize = Math.ceil(res.response.total / parseInt(pVM.limit, 10));
|
|
45
|
-
dialog.dataLoading({ visible: false });
|
|
46
50
|
gvc.notifyDataChange(`productShow`);
|
|
47
51
|
});
|
|
48
52
|
}
|
|
@@ -101,7 +105,7 @@ export class ProductsPage {
|
|
|
101
105
|
},
|
|
102
106
|
divCreate: {
|
|
103
107
|
class: `d-flex px-3 `,
|
|
104
|
-
style: `width:100%;overflow: scroll
|
|
108
|
+
style: `width:100%;overflow: scroll;${document.body.clientWidth > 992 ? `padding-left:32px !important;padding-right:32px !important;padding-bottom:32px;` : `padding-top:20px;padding-bottom:20px;`}`,
|
|
105
109
|
},
|
|
106
110
|
})}
|
|
107
111
|
${gvc.bindView(() => {
|
|
@@ -117,7 +121,7 @@ export class ProductsPage {
|
|
|
117
121
|
}
|
|
118
122
|
let maxwidth = (parent.offsetWidth - 72 - (rowItem - 1) * 26) / rowItem;
|
|
119
123
|
if (document.body.offsetWidth < 600) {
|
|
120
|
-
maxwidth +=
|
|
124
|
+
maxwidth += 30;
|
|
121
125
|
}
|
|
122
126
|
if (vm.productSearch.length > 0) {
|
|
123
127
|
return (vm.productSearch
|
|
@@ -191,7 +195,7 @@ export class ProductsPage {
|
|
|
191
195
|
if (document.body.offsetWidth < 800) {
|
|
192
196
|
return {
|
|
193
197
|
class: `d-flex flex-wrap w-100 product-show`,
|
|
194
|
-
style: `overflow:scroll;max-height:100%;padding-left:
|
|
198
|
+
style: `overflow:scroll;max-height:100%;padding-left:12px;padding-right:12px;justify-content: space-between;padding-bottom:100px;`,
|
|
195
199
|
};
|
|
196
200
|
}
|
|
197
201
|
else {
|
|
@@ -108,7 +108,10 @@ export class ProductsPage {
|
|
|
108
108
|
|
|
109
109
|
function loadData() {
|
|
110
110
|
let category = vm.categories.find((category: any) => category.select == true);
|
|
111
|
-
|
|
111
|
+
if((!vm.productSearch) || !vm.productSearch.length){
|
|
112
|
+
dialog.dataLoading({ visible: true });
|
|
113
|
+
}
|
|
114
|
+
// dialog.dataLoading({ visible: true });
|
|
112
115
|
ApiShop.getProduct({
|
|
113
116
|
page: pVM.pageIndex - 1,
|
|
114
117
|
collection: category.key == 'all' ? '' : category.key,
|
|
@@ -119,9 +122,12 @@ export class ProductsPage {
|
|
|
119
122
|
whereStore: POSSetting.config.where_store,
|
|
120
123
|
orderBy: 'created_time_desc',
|
|
121
124
|
}).then(res => {
|
|
125
|
+
if((!vm.productSearch) || !vm.productSearch.length){
|
|
126
|
+
dialog.dataLoading({ visible: false });
|
|
127
|
+
}
|
|
122
128
|
vm.productSearch = res.response.data;
|
|
123
129
|
pVM.pageSize = Math.ceil(res.response.total / parseInt(pVM.limit as any, 10));
|
|
124
|
-
dialog.dataLoading({ visible: false });
|
|
130
|
+
// dialog.dataLoading({ visible: false });
|
|
125
131
|
gvc.notifyDataChange(`productShow`);
|
|
126
132
|
});
|
|
127
133
|
}
|
|
@@ -183,7 +189,7 @@ export class ProductsPage {
|
|
|
183
189
|
},
|
|
184
190
|
divCreate: {
|
|
185
191
|
class: `d-flex px-3 `,
|
|
186
|
-
style: `width:100%;overflow: scroll
|
|
192
|
+
style: `width:100%;overflow: scroll;${document.body.clientWidth > 992 ? `padding-left:32px !important;padding-right:32px !important;padding-bottom:32px;` : `padding-top:20px;padding-bottom:20px;`}`,
|
|
187
193
|
},
|
|
188
194
|
})}
|
|
189
195
|
${gvc.bindView(() => {
|
|
@@ -199,7 +205,7 @@ export class ProductsPage {
|
|
|
199
205
|
}
|
|
200
206
|
let maxwidth = (parent.offsetWidth - 72 - (rowItem - 1) * 26) / rowItem;
|
|
201
207
|
if (document.body.offsetWidth < 600) {
|
|
202
|
-
maxwidth +=
|
|
208
|
+
maxwidth += 30;
|
|
203
209
|
}
|
|
204
210
|
|
|
205
211
|
if (vm.productSearch.length > 0) {
|
|
@@ -279,7 +285,7 @@ export class ProductsPage {
|
|
|
279
285
|
if (document.body.offsetWidth < 800) {
|
|
280
286
|
return {
|
|
281
287
|
class: `d-flex flex-wrap w-100 product-show`,
|
|
282
|
-
style: `overflow:scroll;max-height:100%;padding-left:
|
|
288
|
+
style: `overflow:scroll;max-height:100%;padding-left:12px;padding-right:12px;justify-content: space-between;padding-bottom:100px;`,
|
|
283
289
|
};
|
|
284
290
|
} else {
|
|
285
291
|
return {
|
|
@@ -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) => {
|