ts-glitter 13.3.4 → 13.3.7
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-blog.js +2 -7
- package/lowcode/backend-manager/bg-blog.ts +8 -13
- package/lowcode/backend-manager/bg-customer-message.js +4 -2
- package/lowcode/backend-manager/bg-customer-message.ts +4 -2
- package/lowcode/backend-manager/bg-graph-api.js +6 -11
- package/lowcode/backend-manager/bg-graph-api.ts +14 -20
- package/lowcode/backend-manager/bg-line.js +526 -1002
- package/lowcode/backend-manager/bg-line.ts +1815 -2354
- package/lowcode/backend-manager/bg-notify.js +392 -746
- package/lowcode/backend-manager/bg-notify.ts +436 -835
- package/lowcode/backend-manager/bg-project.js +176 -293
- package/lowcode/backend-manager/bg-project.ts +214 -344
- package/lowcode/backend-manager/bg-recommend.js +39 -148
- package/lowcode/backend-manager/bg-recommend.ts +43 -162
- package/lowcode/backend-manager/bg-sns.js +489 -814
- package/lowcode/backend-manager/bg-sns.ts +1876 -2238
- package/lowcode/backend-manager/bg-widget.js +301 -171
- package/lowcode/backend-manager/bg-widget.ts +324 -193
- package/lowcode/cms-plugin/ai-points.js +84 -67
- package/lowcode/cms-plugin/ai-points.ts +280 -247
- package/lowcode/cms-plugin/auto-reply.js +6 -7
- package/lowcode/cms-plugin/auto-reply.ts +6 -7
- package/lowcode/cms-plugin/data-analyze.js +5 -6
- package/lowcode/cms-plugin/data-analyze.ts +5 -6
- package/lowcode/cms-plugin/form-setting.js +122 -220
- package/lowcode/cms-plugin/form-setting.ts +124 -240
- package/lowcode/cms-plugin/line-auto-reply.js +17 -18
- package/lowcode/cms-plugin/line-auto-reply.ts +29 -36
- package/lowcode/cms-plugin/member-group-list.js +5 -2
- package/lowcode/cms-plugin/member-group-list.ts +5 -2
- package/lowcode/cms-plugin/member-type-list.js +36 -84
- package/lowcode/cms-plugin/member-type-list.ts +39 -92
- package/lowcode/cms-plugin/menus-setting.js +8 -73
- package/lowcode/cms-plugin/menus-setting.ts +8 -78
- package/lowcode/cms-plugin/permission-setting.js +73 -106
- package/lowcode/cms-plugin/permission-setting.ts +236 -278
- package/lowcode/cms-plugin/shopping-collections.js +95 -137
- package/lowcode/cms-plugin/shopping-collections.ts +103 -147
- package/lowcode/cms-plugin/shopping-discount-setting.js +310 -416
- package/lowcode/cms-plugin/shopping-discount-setting.ts +1269 -1386
- package/lowcode/cms-plugin/shopping-finance-setting.js +1 -0
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1 -0
- package/lowcode/cms-plugin/shopping-order-manager.js +742 -973
- package/lowcode/cms-plugin/shopping-order-manager.ts +1928 -2164
- package/lowcode/cms-plugin/shopping-order-return.js +147 -267
- package/lowcode/cms-plugin/shopping-order-return.ts +154 -292
- package/lowcode/cms-plugin/shopping-product-setting.js +6 -2
- package/lowcode/cms-plugin/shopping-product-setting.ts +8 -4
- package/lowcode/cms-plugin/shopping-product-stock.js +12 -92
- package/lowcode/cms-plugin/shopping-product-stock.ts +14 -94
- package/lowcode/cms-plugin/shopping-product-text.js +0 -3
- package/lowcode/cms-plugin/shopping-product-text.ts +0 -3
- package/lowcode/cms-plugin/shopping-rebate.js +95 -151
- package/lowcode/cms-plugin/shopping-rebate.ts +101 -159
- package/lowcode/cms-plugin/sms-points.js +83 -67
- package/lowcode/cms-plugin/sms-points.ts +281 -241
- package/lowcode/cms-plugin/sns-auto-reply.js +18 -18
- package/lowcode/cms-plugin/sns-auto-reply.ts +34 -40
- package/lowcode/cms-plugin/user-list.js +71 -90
- package/lowcode/cms-plugin/user-list.ts +76 -95
- package/lowcode/cms-plugin/web-config-setting.js +61 -111
- package/lowcode/cms-plugin/web-config-setting.ts +65 -124
- package/lowcode/css/editor.css +5 -2
- package/lowcode/glitter-base/route/shopping.js +1 -1
- package/lowcode/glitter-base/route/shopping.ts +19 -19
- package/lowcode/jspage/editor.js +1 -1
- package/lowcode/jspage/editor.ts +1 -1
- package/lowcode/jspage/main.js +3 -0
- package/lowcode/jspage/main.ts +3 -0
- package/package.json +1 -2
- package/src/api-public/controllers/ai-chat.js.map +5 -1
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/chat.js.map +1 -1
- package/src/api-public/controllers/fb-message.js.map +1 -1
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/line-message.js.map +1 -1
- package/src/api-public/controllers/rebate.js.map +1 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/chat.js +3 -3
- package/src/api-public/services/chat.js.map +1 -1
- package/src/api-public/services/chat.ts +3 -4
- package/src/api-public/services/fb-message.js.map +5 -1
- package/src/api-public/services/filter-protect-data.js.map +1 -1
- package/src/api-public/services/line-message.js.map +1 -1
- package/src/api-public/services/monitor.js.map +1 -1
- package/src/api-public/services/notify.js.map +1 -1
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/share-permission.js.map +1 -1
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/user.js +67 -66
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +212 -182
- package/src/helper/glitter-util.js.map +1 -1
- package/src/modules/firebase.d.ts +1 -0
- package/src/modules/firebase.js +1 -1
- package/src/modules/firebase.js.map +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GVC } from '../glitterBundle/GVController.js';
|
|
2
2
|
import { BgWidget } from '../backend-manager/bg-widget.js';
|
|
3
3
|
import { ApiShop } from '../glitter-base/route/shopping.js';
|
|
4
|
-
import { EditorElem } from '../glitterBundle/plugins/editor-elem.js';
|
|
5
4
|
import { ShareDialog } from '../glitterBundle/dialog/ShareDialog.js';
|
|
6
5
|
import { BgListComponent } from '../backend-manager/bg-list-component.js';
|
|
7
6
|
import { FilterOptions } from './filter-options.js';
|
|
@@ -25,7 +24,6 @@ const html = String.raw;
|
|
|
25
24
|
|
|
26
25
|
export class ShoppingOrderManager {
|
|
27
26
|
public static main(gvc: GVC) {
|
|
28
|
-
const filterID = gvc.glitter.getUUID();
|
|
29
27
|
const glitter = gvc.glitter;
|
|
30
28
|
|
|
31
29
|
const vm: ViewModel = {
|
|
@@ -50,76 +48,6 @@ export class ShoppingOrderManager {
|
|
|
50
48
|
() => {}
|
|
51
49
|
);
|
|
52
50
|
|
|
53
|
-
function importDataTo(event: Event) {
|
|
54
|
-
const input = event.target as HTMLInputElement;
|
|
55
|
-
const XLSX = (window as any).XLSX;
|
|
56
|
-
if (!input.files || input.files.length === 0) {
|
|
57
|
-
console.log('No file selected');
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const file = input.files[0];
|
|
62
|
-
const reader = new FileReader();
|
|
63
|
-
|
|
64
|
-
reader.onload = (e: ProgressEvent<FileReader>) => {
|
|
65
|
-
if (!e.target) {
|
|
66
|
-
console.log('Failed to read file');
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
const data = new Uint8Array(e.target.result as ArrayBuffer);
|
|
70
|
-
const workbook = XLSX.read(data, { type: 'array' });
|
|
71
|
-
|
|
72
|
-
// 假設我們只讀取第一個工作表
|
|
73
|
-
const firstSheetName = workbook.SheetNames[0];
|
|
74
|
-
const worksheet = workbook.Sheets[firstSheetName];
|
|
75
|
-
|
|
76
|
-
// 將工作表轉換為 JSON
|
|
77
|
-
const json = XLSX.utils.sheet_to_json(worksheet);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
reader.readAsArrayBuffer(file);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function exportDataTo(firstRow: string[], data: any) {
|
|
84
|
-
if ((window as any).XLSX) {
|
|
85
|
-
// 將資料轉換成工作表
|
|
86
|
-
let XLSX = (window as any).XLSX;
|
|
87
|
-
|
|
88
|
-
const worksheet = XLSX.utils.json_to_sheet(data, { skipHeader: true });
|
|
89
|
-
XLSX.utils.sheet_add_aoa(worksheet, [firstRow], { origin: 'A1' });
|
|
90
|
-
|
|
91
|
-
// 創建一個新的工作簿
|
|
92
|
-
const workbook = XLSX.utils.book_new();
|
|
93
|
-
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
|
94
|
-
|
|
95
|
-
// 將工作簿轉換成二進制數據
|
|
96
|
-
const wbout = XLSX.write(workbook, { bookType: 'xlsx', type: 'binary' });
|
|
97
|
-
|
|
98
|
-
// 將二進制數據轉換成 Blob 物件
|
|
99
|
-
function s2ab(s: any) {
|
|
100
|
-
const buf = new ArrayBuffer(s.length);
|
|
101
|
-
const view = new Uint8Array(buf);
|
|
102
|
-
for (let i = 0; i < s.length; i++) {
|
|
103
|
-
view[i] = s.charCodeAt(i) & 0xff;
|
|
104
|
-
}
|
|
105
|
-
return buf;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// 建立 Blob 物件
|
|
109
|
-
const blob = new Blob([s2ab(wbout)], { type: 'application/octet-stream' });
|
|
110
|
-
|
|
111
|
-
// 建立下載連結
|
|
112
|
-
const link = document.createElement('a');
|
|
113
|
-
const url = URL.createObjectURL(blob);
|
|
114
|
-
link.href = url;
|
|
115
|
-
link.download = 'data.xlsx';
|
|
116
|
-
link.click();
|
|
117
|
-
setTimeout(() => {
|
|
118
|
-
URL.revokeObjectURL(url);
|
|
119
|
-
}, 100);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
51
|
return gvc.bindView(() => {
|
|
124
52
|
const id = glitter.getUUID();
|
|
125
53
|
return {
|
|
@@ -139,7 +67,6 @@ export class ShoppingOrderManager {
|
|
|
139
67
|
})
|
|
140
68
|
)}
|
|
141
69
|
</div>
|
|
142
|
-
|
|
143
70
|
${BgWidget.tab(
|
|
144
71
|
[
|
|
145
72
|
{
|
|
@@ -154,110 +81,9 @@ export class ShoppingOrderManager {
|
|
|
154
81
|
gvc.notifyDataChange(vm.id);
|
|
155
82
|
}
|
|
156
83
|
)}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
getData: (vmi) => {
|
|
161
|
-
ApiShop.getSearchReturnOrder({
|
|
162
|
-
page: vmi.page - 1,
|
|
163
|
-
limit: 20,
|
|
164
|
-
search: vm.query ?? '',
|
|
165
|
-
searchType: vm.queryType || 'name',
|
|
166
|
-
orderString: vm.orderString ?? '',
|
|
167
|
-
filter: vm.filter,
|
|
168
|
-
archived: vm.filter_type === 'normal' ? `false` : `true`,
|
|
169
|
-
}).then((data) => {
|
|
170
|
-
vmi.pageSize = Math.ceil(data.response.total / 20);
|
|
171
|
-
vm.dataList = data.response.data;
|
|
172
|
-
|
|
173
|
-
function getDatalist() {
|
|
174
|
-
return data.response.data.map((dd: any) => {
|
|
175
|
-
return [
|
|
176
|
-
{
|
|
177
|
-
key: EditorElem.checkBoxOnly({
|
|
178
|
-
gvc: gvc,
|
|
179
|
-
def: !data.response.data.find((dd: any) => {
|
|
180
|
-
return !dd.checked;
|
|
181
|
-
}),
|
|
182
|
-
callback: (result) => {
|
|
183
|
-
data.response.data.map((dd: any) => {
|
|
184
|
-
dd.checked = result;
|
|
185
|
-
});
|
|
186
|
-
vmi.data = getDatalist();
|
|
187
|
-
vmi.callback();
|
|
188
|
-
gvc.notifyDataChange(filterID);
|
|
189
|
-
},
|
|
190
|
-
}),
|
|
191
|
-
value: EditorElem.checkBoxOnly({
|
|
192
|
-
gvc: gvc,
|
|
193
|
-
def: dd.checked,
|
|
194
|
-
callback: (result) => {
|
|
195
|
-
dd.checked = result;
|
|
196
|
-
vmi.data = getDatalist();
|
|
197
|
-
vmi.callback();
|
|
198
|
-
gvc.notifyDataChange(filterID);
|
|
199
|
-
},
|
|
200
|
-
style: 'height:40px;',
|
|
201
|
-
}),
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
key: '退貨單編號',
|
|
205
|
-
value: dd.return_order_id,
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
key: '訂單編號',
|
|
209
|
-
value: dd.order_id,
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
key: '申請日期',
|
|
213
|
-
value: glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd hh:mm:ss'),
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
key: '申請人',
|
|
217
|
-
value: dd.orderData.user_info ? dd.orderData.user_info.name : `匿名`,
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
key: '退貨狀態',
|
|
221
|
-
value: (() => {
|
|
222
|
-
switch (dd.orderData.returnProgress ?? '1') {
|
|
223
|
-
case '0':
|
|
224
|
-
return `<div class="badge" style="font-size: 14px;color:#393939;height: 22px;padding: 4px 6px;border-radius: 7px;background: #FFE9B2;">退貨中</div>`;
|
|
225
|
-
case '-1':
|
|
226
|
-
return `<div class="badge" style="font-size: 14px;border-radius: 7px;background: #D8ECDA;height: 22px;padding: 4px 6px;color:#393939;">已退貨</div>`;
|
|
227
|
-
default:
|
|
228
|
-
return `<div class="badge" style="font-size: 14px;color:#393939;height: 22px;padding: 4px 6px;border-radius: 7px;background: #FFE9B2;">處理中</div>`;
|
|
229
|
-
}
|
|
230
|
-
})(),
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
key: '退款狀態',
|
|
234
|
-
value: (() => {
|
|
235
|
-
switch (dd.status ?? 0) {
|
|
236
|
-
case 1:
|
|
237
|
-
return `<div class="badge " style="font-size: 14px;color:#393939;border-radius: 7px;background: #D8ECDA;height: 22px;padding: 4px 6px;">已退款</div>`;
|
|
238
|
-
default:
|
|
239
|
-
return `<div class="badge" style="font-size: 14px;color:#393939;height: 22px;padding: 4px 6px;border-radius: 7px;background: #FFE9B2;">退款中</div>`;
|
|
240
|
-
}
|
|
241
|
-
})(),
|
|
242
|
-
},
|
|
243
|
-
].map((dd: any) => {
|
|
244
|
-
dd.value = `<div style="line-height:40px;">${dd.value}</div>`;
|
|
245
|
-
return dd;
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
vmi.data = getDatalist();
|
|
251
|
-
vmi.loading = false;
|
|
252
|
-
vmi.callback();
|
|
253
|
-
});
|
|
254
|
-
},
|
|
255
|
-
rowClick: (data, index) => {
|
|
256
|
-
vm.data = vm.dataList[index];
|
|
257
|
-
vm.type = 'replace';
|
|
258
|
-
},
|
|
259
|
-
filter: html`
|
|
260
|
-
<div>
|
|
84
|
+
${BgWidget.mainCard(
|
|
85
|
+
[
|
|
86
|
+
html`<div>
|
|
261
87
|
<div style="display: flex; align-items: center; gap: 10px;">
|
|
262
88
|
${BgWidget.selectFilter({
|
|
263
89
|
gvc,
|
|
@@ -291,103 +117,154 @@ export class ShoppingOrderManager {
|
|
|
291
117
|
})}
|
|
292
118
|
</div>
|
|
293
119
|
<div>${ListComp.getFilterTags(FilterOptions.returnOrderFunnel)}</div>
|
|
294
|
-
</div
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
120
|
+
</div>`,
|
|
121
|
+
BgWidget.tableV3({
|
|
122
|
+
gvc: gvc,
|
|
123
|
+
getData: (vmi) => {
|
|
124
|
+
const limit = 20;
|
|
125
|
+
ApiShop.getSearchReturnOrder({
|
|
126
|
+
page: vmi.page - 1,
|
|
127
|
+
limit: limit,
|
|
128
|
+
search: vm.query ?? '',
|
|
129
|
+
searchType: vm.queryType || 'name',
|
|
130
|
+
orderString: vm.orderString ?? '',
|
|
131
|
+
filter: vm.filter,
|
|
132
|
+
archived: vm.filter_type === 'normal' ? `false` : `true`,
|
|
133
|
+
}).then((data) => {
|
|
134
|
+
function getDatalist() {
|
|
135
|
+
return data.response.data.map((dd: any) => {
|
|
136
|
+
return [
|
|
137
|
+
{
|
|
138
|
+
key: '退貨單編號',
|
|
139
|
+
value: dd.return_order_id,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
key: '訂單編號',
|
|
143
|
+
value: dd.order_id,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
key: '申請日期',
|
|
147
|
+
value: glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd hh:mm:ss'),
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
key: '申請人',
|
|
151
|
+
value: dd.orderData.user_info ? dd.orderData.user_info.name : `匿名`,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: '退貨狀態',
|
|
155
|
+
value: (() => {
|
|
156
|
+
switch (dd.orderData.returnProgress ?? '1') {
|
|
157
|
+
case '0':
|
|
158
|
+
return `<div class="badge" style="font-size: 14px;color:#393939;height: 22px;padding: 4px 6px;border-radius: 7px;background: #FFE9B2;">退貨中</div>`;
|
|
159
|
+
case '-1':
|
|
160
|
+
return `<div class="badge" style="font-size: 14px;border-radius: 7px;background: #D8ECDA;height: 22px;padding: 4px 6px;color:#393939;">已退貨</div>`;
|
|
161
|
+
default:
|
|
162
|
+
return `<div class="badge" style="font-size: 14px;color:#393939;height: 22px;padding: 4px 6px;border-radius: 7px;background: #FFE9B2;">處理中</div>`;
|
|
163
|
+
}
|
|
164
|
+
})(),
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
key: '退款狀態',
|
|
168
|
+
value: (() => {
|
|
169
|
+
switch (dd.status ?? 0) {
|
|
170
|
+
case 1:
|
|
171
|
+
return `<div class="badge " style="font-size: 14px;color:#393939;border-radius: 7px;background: #D8ECDA;height: 22px;padding: 4px 6px;">已退款</div>`;
|
|
172
|
+
default:
|
|
173
|
+
return `<div class="badge" style="font-size: 14px;color:#393939;height: 22px;padding: 4px 6px;border-radius: 7px;background: #FFE9B2;">退款中</div>`;
|
|
174
|
+
}
|
|
175
|
+
})(),
|
|
176
|
+
},
|
|
177
|
+
].map((dd: any) => {
|
|
178
|
+
dd.value = `<div style="line-height:40px;">${dd.value}</div>`;
|
|
179
|
+
return dd;
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
vm.dataList = data.response.data;
|
|
185
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
186
|
+
vmi.originalData = vm.dataList;
|
|
187
|
+
vmi.tableData = getDatalist();
|
|
188
|
+
vmi.loading = false;
|
|
189
|
+
vmi.callback();
|
|
190
|
+
});
|
|
191
|
+
},
|
|
192
|
+
rowClick: (data, index) => {
|
|
193
|
+
vm.data = vm.dataList[index];
|
|
194
|
+
vm.type = 'replace';
|
|
195
|
+
},
|
|
196
|
+
filter: [
|
|
197
|
+
{
|
|
198
|
+
name: vm.filter_type === 'normal' ? `批量封存` : `解除封存`,
|
|
199
|
+
option: true,
|
|
200
|
+
event: () => {
|
|
201
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
202
|
+
dialog.checkYesOrNot({
|
|
203
|
+
text: `是否確認${vm.filter_type === 'normal' ? `封存` : `解除封存`}所選項目?`,
|
|
204
|
+
callback: async (response) => {
|
|
205
|
+
if (response) {
|
|
206
|
+
dialog.dataLoading({ visible: true });
|
|
207
|
+
const check = vm.dataList.filter((dd: any) => {
|
|
208
|
+
return dd.checked;
|
|
358
209
|
});
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
210
|
+
for (const b of check) {
|
|
211
|
+
b.orderData.archived = vm.filter_type === 'normal' ? `true` : `false`;
|
|
212
|
+
await ApiShop.putReturnOrder({
|
|
213
|
+
id: `${b.id}`,
|
|
214
|
+
data: b,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
setTimeout(() => {
|
|
218
|
+
dialog.dataLoading({ visible: false });
|
|
219
|
+
gvc.notifyDataChange(vm.id);
|
|
220
|
+
}, 100);
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
},
|
|
364
225
|
},
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
226
|
+
{
|
|
227
|
+
name: vm.filter_type === 'void' ? `批量作廢` : `解除作廢`,
|
|
228
|
+
option: true,
|
|
229
|
+
event: () => {
|
|
230
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
231
|
+
dialog.checkYesOrNot({
|
|
232
|
+
text: `是否確認${vm.filter_type === 'void' ? `解除作廢` : `作廢`}所選項目?`,
|
|
233
|
+
callback: async (response) => {
|
|
234
|
+
if (response) {
|
|
235
|
+
dialog.dataLoading({ visible: true });
|
|
236
|
+
const check = vm.dataList.filter((dd: any) => {
|
|
237
|
+
return dd.checked;
|
|
238
|
+
});
|
|
239
|
+
for (const b of check) {
|
|
240
|
+
b.orderData.void = vm.filter_type === 'void' ? `false` : `true`;
|
|
241
|
+
await ApiShop.putReturnOrder({
|
|
242
|
+
id: `${b.id}`,
|
|
243
|
+
data: b,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
setTimeout(() => {
|
|
247
|
+
dialog.dataLoading({ visible: false });
|
|
248
|
+
gvc.notifyDataChange(vm.id);
|
|
249
|
+
}, 100);
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
},
|
|
377
254
|
},
|
|
378
|
-
|
|
379
|
-
})
|
|
380
|
-
|
|
381
|
-
|
|
255
|
+
],
|
|
256
|
+
}),
|
|
257
|
+
].join('')
|
|
258
|
+
)}
|
|
382
259
|
`,
|
|
383
|
-
|
|
260
|
+
BgWidget.getContainerWidth()
|
|
384
261
|
);
|
|
385
262
|
} else if (vm.type == 'replace') {
|
|
386
263
|
return this.replaceOrder(gvc, vm, id);
|
|
387
264
|
} else if (vm.type == 'addSearch') {
|
|
388
265
|
return this.searchOrder(gvc, vm);
|
|
389
266
|
} else {
|
|
390
|
-
return
|
|
267
|
+
return '';
|
|
391
268
|
}
|
|
392
269
|
},
|
|
393
270
|
};
|
|
@@ -1212,10 +1089,7 @@ export class ShoppingOrderManager {
|
|
|
1212
1089
|
`position: relative;`
|
|
1213
1090
|
)}
|
|
1214
1091
|
${BgWidget.mbContainer(240)}
|
|
1215
|
-
<div
|
|
1216
|
-
class="testLine d-flex align-items-center justify-content-end"
|
|
1217
|
-
style="gap:14px;max-height:48px; position:fixed;bottom:0;right:0;width: 100%;height:50px;background: #FFF;box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.15);padding: 14px 16px 14px 0;"
|
|
1218
|
-
>
|
|
1092
|
+
<div class="update-bar-container">
|
|
1219
1093
|
${BgWidget.danger(
|
|
1220
1094
|
gvc.event(() => {
|
|
1221
1095
|
vm.type = 'list';
|
|
@@ -1229,8 +1103,6 @@ export class ShoppingOrderManager {
|
|
|
1229
1103
|
)}
|
|
1230
1104
|
${BgWidget.save(
|
|
1231
1105
|
gvc.event(() => {
|
|
1232
|
-
const now = new Date();
|
|
1233
|
-
console.log(orderData.orderData);
|
|
1234
1106
|
let passData = {
|
|
1235
1107
|
id: orderData.id,
|
|
1236
1108
|
status: orderData.status,
|
|
@@ -1253,10 +1125,10 @@ export class ShoppingOrderManager {
|
|
|
1253
1125
|
</div>
|
|
1254
1126
|
</div>
|
|
1255
1127
|
`,
|
|
1256
|
-
|
|
1128
|
+
BgWidget.getContainerWidth()
|
|
1257
1129
|
);
|
|
1258
1130
|
} catch (e) {
|
|
1259
|
-
console.
|
|
1131
|
+
console.error(e);
|
|
1260
1132
|
return ``;
|
|
1261
1133
|
}
|
|
1262
1134
|
},
|
|
@@ -1995,22 +1867,14 @@ ${orderData?.return_order_remark ?? ''}</textarea
|
|
|
1995
1867
|
</div>
|
|
1996
1868
|
`)}
|
|
1997
1869
|
${BgWidget.mbContainer(240)}
|
|
1998
|
-
<div
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
>
|
|
2002
|
-
<button
|
|
2003
|
-
style="padding: 6px 18px;border-radius: 10px;border: 1px solid #DDD;background: #FFF;font-size: 16px;font-weight: 700;color:#393939;"
|
|
2004
|
-
onclick="${gvc.event(() => {
|
|
1870
|
+
<div class="update-bar-container">
|
|
1871
|
+
${BgWidget.cancel(
|
|
1872
|
+
gvc.event(() => {
|
|
2005
1873
|
vm.type = 'list';
|
|
2006
|
-
})
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
<button
|
|
2011
|
-
class="btn bt_c39"
|
|
2012
|
-
style="color: #FFF;font-size: 16px;font-weight: 700;padding: 6px 18px;align-items: center;gap: 8px;"
|
|
2013
|
-
onclick="${gvc.event(() => {
|
|
1874
|
+
})
|
|
1875
|
+
)}
|
|
1876
|
+
${BgWidget.save(
|
|
1877
|
+
gvc.event(() => {
|
|
2014
1878
|
viewModel.searchData.orderData.returnProgress = '1';
|
|
2015
1879
|
viewModel.searchData.orderData.lineItems = checkList;
|
|
2016
1880
|
|
|
@@ -2029,10 +1893,8 @@ ${orderData?.return_order_remark ?? ''}</textarea
|
|
|
2029
1893
|
vm.type = 'list';
|
|
2030
1894
|
});
|
|
2031
1895
|
}
|
|
2032
|
-
})
|
|
2033
|
-
|
|
2034
|
-
儲存
|
|
2035
|
-
</button>
|
|
1896
|
+
})
|
|
1897
|
+
)}
|
|
2036
1898
|
</div>
|
|
2037
1899
|
</div>
|
|
2038
1900
|
`;
|
|
@@ -2042,7 +1904,7 @@ ${orderData?.return_order_remark ?? ''}</textarea
|
|
|
2042
1904
|
divCreate: {},
|
|
2043
1905
|
})}
|
|
2044
1906
|
`,
|
|
2045
|
-
|
|
1907
|
+
BgWidget.getContainerWidth()
|
|
2046
1908
|
);
|
|
2047
1909
|
}
|
|
2048
1910
|
}
|
|
@@ -1045,7 +1045,6 @@ export class ShoppingProductSetting {
|
|
|
1045
1045
|
class: 'rounded border me-4',
|
|
1046
1046
|
})}${Tool.truncateString(dd.content.title)}
|
|
1047
1047
|
</div>`,
|
|
1048
|
-
width: 45,
|
|
1049
1048
|
},
|
|
1050
1049
|
{
|
|
1051
1050
|
key: '售價',
|
|
@@ -1221,7 +1220,6 @@ export class ShoppingProductSetting {
|
|
|
1221
1220
|
},
|
|
1222
1221
|
});
|
|
1223
1222
|
},
|
|
1224
|
-
option: false,
|
|
1225
1223
|
},
|
|
1226
1224
|
],
|
|
1227
1225
|
});
|
|
@@ -2044,6 +2042,11 @@ export class ShoppingProductSetting {
|
|
|
2044
2042
|
return BgWidget.spinner();
|
|
2045
2043
|
}
|
|
2046
2044
|
return html ` <div class="d-flex align-items-center justify-content-end mb-3">
|
|
2045
|
+
${BgWidget.aiChatButton({
|
|
2046
|
+
gvc,
|
|
2047
|
+
select: 'writer',
|
|
2048
|
+
title: '使用AI文案寫手',
|
|
2049
|
+
})}
|
|
2047
2050
|
<div class="flex-fill"></div>
|
|
2048
2051
|
<div
|
|
2049
2052
|
class="cursor_pointer"
|
|
@@ -2175,6 +2178,7 @@ export class ShoppingProductSetting {
|
|
|
2175
2178
|
},
|
|
2176
2179
|
}),
|
|
2177
2180
|
height: 800,
|
|
2181
|
+
openOnInit: true,
|
|
2178
2182
|
})}
|
|
2179
2183
|
${BgWidget.mbContainer(8)}
|
|
2180
2184
|
${vm.documents
|