ts-glitter 17.1.7 → 17.1.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-widget.js +1 -1
- package/lowcode/backend-manager/bg-widget.ts +1 -1
- package/lowcode/cms-plugin/POS-setting.js +2 -2
- package/lowcode/cms-plugin/POS-setting.ts +3 -2
- package/lowcode/cms-plugin/pos-pages/pos-summary.js +222 -153
- package/lowcode/cms-plugin/pos-pages/pos-summary.ts +380 -307
- package/lowcode/cms-plugin/pos-pages/products-page.js +1 -1
- package/lowcode/cms-plugin/pos-pages/products-page.ts +1 -1
- package/lowcode/cms-plugin/pos-pages/work-status.js +116 -0
- package/lowcode/cms-plugin/pos-pages/work-status.ts +126 -0
- package/lowcode/cms-plugin/pos-widget.js +3 -1
- package/lowcode/cms-plugin/pos-widget.ts +3 -1
- package/lowcode/glitter-base/route/pos.js +18 -0
- package/lowcode/glitter-base/route/pos.ts +23 -0
- package/lowcode/glitterBundle/Glitter.js +0 -7
- package/lowcode/glitterBundle/Glitter.ts +0 -9
- package/lowcode/jspage/function-page/setting_editor.js +26 -8
- package/lowcode/jspage/function-page/setting_editor.ts +26 -8
- package/package.json +1 -1
- package/src/api-public/controllers/shop.js +8 -0
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +8 -0
- package/src/api-public/services/pos.d.ts +28 -0
- package/src/api-public/services/pos.js +41 -2
- package/src/api-public/services/pos.js.map +1 -1
- package/src/api-public/services/pos.ts +65 -3
- package/src/api-public/services/public-table-check.js +5 -1
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/public-table-check.ts +6 -1
- package/src/api-public/services/shopping.d.ts +1 -1
- package/src/api-public/services/updated-table-checked.d.ts +10 -0
- package/src/api-public/services/updated-table-checked.js +35 -0
- package/src/api-public/services/updated-table-checked.js.map +1 -0
- package/src/api-public/services/updated-table-checked.ts +36 -0
- package/src/services/saas-table-check.js +2 -20
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/saas-table-check.ts +18 -18
package/lowcode/Entry.js
CHANGED
|
@@ -89,7 +89,7 @@ export class Entry {
|
|
|
89
89
|
}
|
|
90
90
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : clockF();
|
|
91
91
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
92
|
-
glitter.share.editerVersion = 'V_17.1.
|
|
92
|
+
glitter.share.editerVersion = 'V_17.1.9';
|
|
93
93
|
glitter.share.start = new Date();
|
|
94
94
|
const vm = {
|
|
95
95
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -90,7 +90,7 @@ export class Entry {
|
|
|
90
90
|
}
|
|
91
91
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
92
92
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
93
|
-
glitter.share.editerVersion = 'V_17.1.
|
|
93
|
+
glitter.share.editerVersion = 'V_17.1.9';
|
|
94
94
|
glitter.share.start = new Date();
|
|
95
95
|
const vm: {
|
|
96
96
|
appConfig: any;
|
|
@@ -2120,7 +2120,7 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
|
|
|
2120
2120
|
}
|
|
2121
2121
|
static summaryCard(htmlString) {
|
|
2122
2122
|
return html `
|
|
2123
|
-
<div class="main-card summary-card">${htmlString !== null && htmlString !== void 0 ? htmlString : ''}</div>`;
|
|
2123
|
+
<div class="main-card summary-card ">${htmlString !== null && htmlString !== void 0 ? htmlString : ''}</div>`;
|
|
2124
2124
|
}
|
|
2125
2125
|
static tab(data, gvc, select, callback, style) {
|
|
2126
2126
|
return html `
|
|
@@ -2525,7 +2525,7 @@ ${obj.default ?? ''}</textarea
|
|
|
2525
2525
|
|
|
2526
2526
|
static summaryCard(htmlString: string) {
|
|
2527
2527
|
return html`
|
|
2528
|
-
<div class="main-card summary-card">${htmlString ?? ''}</div>`;
|
|
2528
|
+
<div class="main-card summary-card ">${htmlString ?? ''}</div>`;
|
|
2529
2529
|
}
|
|
2530
2530
|
|
|
2531
2531
|
static tab(
|
|
@@ -285,7 +285,6 @@ height: 51px;
|
|
|
285
285
|
const member_auth_ = member_auth.find((dd) => {
|
|
286
286
|
return `${dd.user}` === `${POSSetting.config.who}`;
|
|
287
287
|
});
|
|
288
|
-
console.log(`member_auth_=>`, member_auth_);
|
|
289
288
|
member_auth_.config.support_shop = member_auth_.config.support_shop.filter((dd) => {
|
|
290
289
|
return store_list.find((d1) => {
|
|
291
290
|
return dd === d1.id;
|
|
@@ -668,7 +667,7 @@ cursor: pointer;
|
|
|
668
667
|
style="z-index:20;padding-top:${glitter.share.top_inset}px;width: 100%;background: #FFF;box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.10);position: fixed;left: 0;top: 0;"
|
|
669
668
|
>
|
|
670
669
|
<div
|
|
671
|
-
class="POS-logo d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : `
|
|
670
|
+
class="POS-logo d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : ` `} mx-2 "
|
|
672
671
|
style="${document.body.offsetWidth < 800 ? `gap: 0px;` : `gap: 10px;padding-left: 24px;`}height: ${(() => {
|
|
673
672
|
if (document.body.offsetWidth > 800) {
|
|
674
673
|
return `86px`;
|
|
@@ -857,6 +856,7 @@ ${document.body.clientWidth < 800 ? `` : `position: absolute;left: 50%;top:50%;t
|
|
|
857
856
|
if (response) {
|
|
858
857
|
dialog.dataLoading({ visible: true });
|
|
859
858
|
ApiPos.setWorkStatus({
|
|
859
|
+
store: POSSetting.config.where_store,
|
|
860
860
|
status: 'off_work'
|
|
861
861
|
}).then((res) => {
|
|
862
862
|
dialog.dataLoading({ visible: false });
|
|
@@ -337,7 +337,7 @@ height: 51px;
|
|
|
337
337
|
const member_auth_ = member_auth.find((dd: any) => {
|
|
338
338
|
return `${dd.user}` === `${POSSetting.config.who}`
|
|
339
339
|
})
|
|
340
|
-
|
|
340
|
+
|
|
341
341
|
member_auth_.config.support_shop = member_auth_.config.support_shop.filter((dd: string) => {
|
|
342
342
|
return store_list.find((d1: any) => {
|
|
343
343
|
return dd === d1.id
|
|
@@ -798,7 +798,7 @@ cursor: pointer;
|
|
|
798
798
|
style="z-index:20;padding-top:${glitter.share.top_inset}px;width: 100%;background: #FFF;box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.10);position: fixed;left: 0;top: 0;"
|
|
799
799
|
>
|
|
800
800
|
<div
|
|
801
|
-
class="POS-logo d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : `
|
|
801
|
+
class="POS-logo d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : ` `} mx-2 "
|
|
802
802
|
style="${document.body.offsetWidth < 800 ? `gap: 0px;` : `gap: 10px;padding-left: 24px;`}height: ${(() => {
|
|
803
803
|
if (document.body.offsetWidth > 800) {
|
|
804
804
|
return `86px`
|
|
@@ -992,6 +992,7 @@ ${document.body.clientWidth < 800 ? `` : `position: absolute;left: 50%;top:50%;t
|
|
|
992
992
|
if (response) {
|
|
993
993
|
dialog.dataLoading({visible: true})
|
|
994
994
|
ApiPos.setWorkStatus({
|
|
995
|
+
store:POSSetting.config.where_store,
|
|
995
996
|
status: 'off_work'
|
|
996
997
|
}).then((res) => {
|
|
997
998
|
dialog.dataLoading({visible: false})
|
|
@@ -15,8 +15,12 @@ import { ApiPos } from "../../glitter-base/route/pos.js";
|
|
|
15
15
|
import { GlobalUser } from "../../glitter-base/global/global-user.js";
|
|
16
16
|
import { POSSetting } from "../POS-setting.js";
|
|
17
17
|
import { ApiShop } from "../../glitter-base/route/shopping.js";
|
|
18
|
+
import { ApiUser } from "../../glitter-base/route/user.js";
|
|
18
19
|
const html = String.raw;
|
|
19
20
|
export class PosSummary {
|
|
21
|
+
static in_pos() {
|
|
22
|
+
return window.parent.glitter.getUrlParameter('page') !== 'cms';
|
|
23
|
+
}
|
|
20
24
|
static addSummary(gvc, refresh) {
|
|
21
25
|
const dialog = new ShareDialog(gvc.glitter);
|
|
22
26
|
const oGvc = gvc;
|
|
@@ -162,7 +166,9 @@ ${dd.title}
|
|
|
162
166
|
}
|
|
163
167
|
}));
|
|
164
168
|
check_list.map((dd) => {
|
|
165
|
-
const fi_ = last_.check_list.find((d1) => {
|
|
169
|
+
const fi_ = last_.check_list.find((d1) => {
|
|
170
|
+
return d1.key === dd.key;
|
|
171
|
+
});
|
|
166
172
|
dd.last_ = ((fi_ && fi_.real) || 0) - ((fi_ && fi_.export) || 0);
|
|
167
173
|
dd.payment = 0;
|
|
168
174
|
});
|
|
@@ -171,7 +177,9 @@ ${dd.title}
|
|
|
171
177
|
dialog.errorMessage({ text: '請檢查網路連線' });
|
|
172
178
|
return;
|
|
173
179
|
}
|
|
174
|
-
order.response.data.
|
|
180
|
+
order.response.data.filter((dd) => {
|
|
181
|
+
return dd.orderData.pos_info;
|
|
182
|
+
}).map((dd) => {
|
|
175
183
|
dd.orderData.pos_info.payment.map((dd) => {
|
|
176
184
|
const fi_ = check_list.find((d1) => {
|
|
177
185
|
return d1.key === dd.method;
|
|
@@ -202,31 +210,31 @@ ${dd.title}
|
|
|
202
210
|
innerHTML: (gvc) => {
|
|
203
211
|
try {
|
|
204
212
|
return html `
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
</div>
|
|
213
|
+
<div class="row m-0 p-0">
|
|
214
|
+
<div class="col-6 d-flex flex-column" style="gap:5px;">
|
|
215
|
+
<div class="fs-6 fw-500" style="color:#585858;">清點區間</div>
|
|
216
|
+
<div class=" fw-500 fs-6">
|
|
217
|
+
${gvc.glitter.ut.dateFormat(new Date(checkSummaryDir.start), 'yyyy-MM-dd')}
|
|
218
|
+
${gvc.glitter.ut.dateFormat(new Date(checkSummaryDir.start), 'hh:mm')}
|
|
219
|
+
- ${gvc.glitter.ut.dateFormat(new Date(checkSummaryDir.end), 'hh:mm')}
|
|
213
220
|
</div>
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
221
|
+
</div>
|
|
222
|
+
<div class="col-6 d-flex flex-column" style="gap:5px;">
|
|
223
|
+
<div class="fs-6 fw-500" style="color:#585858;">操作人員</div>
|
|
224
|
+
<div class=" fw-500 fs-6">${gvc.glitter.share.member_auth_list.find((d1) => {
|
|
217
225
|
return `${d1.user}` === `${POSSetting.config.who}`;
|
|
218
226
|
}).config.name}
|
|
219
|
-
</div>
|
|
220
227
|
</div>
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
228
|
+
</div>
|
|
229
|
+
<div class="col-12 border-top my-2"></div>
|
|
230
|
+
<div class="col-12 d-flex flex-column" style="gap:5px;">
|
|
231
|
+
<div class="fs-6 fw-500" style="color:#585858;">付款方式</div>
|
|
232
|
+
<div class="text-black fw-500 fs-6">
|
|
233
|
+
${BgWidget.grayNote('若清點不符合,請填寫差額原因')}
|
|
227
234
|
</div>
|
|
228
|
-
|
|
229
|
-
|
|
235
|
+
</div>
|
|
236
|
+
<div class="col-12 border-top my-2"></div>
|
|
237
|
+
${checkSummaryDir.check_list.map((dd) => {
|
|
230
238
|
const last_m = (dd.last_);
|
|
231
239
|
return `<div class=" col-12">
|
|
232
240
|
<div class="d-flex align-items-center p-2">
|
|
@@ -265,7 +273,7 @@ ${((dd.real) - (last_m + dd.payment) === 0) ? '$0' : `<span class="text-danger">
|
|
|
265
273
|
</div>
|
|
266
274
|
</div>`;
|
|
267
275
|
}).join(' <div class="col-12 border-top my-2"></div>')}
|
|
268
|
-
|
|
276
|
+
</div>`;
|
|
269
277
|
}
|
|
270
278
|
catch (e) {
|
|
271
279
|
console.log(e);
|
|
@@ -274,11 +282,11 @@ ${((dd.real) - (last_m + dd.payment) === 0) ? '$0' : `<span class="text-danger">
|
|
|
274
282
|
},
|
|
275
283
|
footer_html: (gvc) => {
|
|
276
284
|
return html `
|
|
277
|
-
|
|
278
|
-
|
|
285
|
+
<div class="d-flex align-items-center" style="gap:10px;">
|
|
286
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
279
287
|
gvc.closeDialog();
|
|
280
288
|
}, '取消'))}
|
|
281
|
-
|
|
289
|
+
${BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
|
|
282
290
|
const staff = GlobalUser.parseJWT(GlobalUser.saas_token).payload.userID;
|
|
283
291
|
const dialog = new ShareDialog(gvc.glitter);
|
|
284
292
|
dialog.dataLoading({ visible: true });
|
|
@@ -303,7 +311,7 @@ ${((dd.real) - (last_m + dd.payment) === 0) ? '$0' : `<span class="text-danger">
|
|
|
303
311
|
localStorage.removeItem('checkSummaryDir');
|
|
304
312
|
refresh();
|
|
305
313
|
})), '完成')}
|
|
306
|
-
|
|
314
|
+
</div>`;
|
|
307
315
|
}
|
|
308
316
|
});
|
|
309
317
|
}
|
|
@@ -312,7 +320,9 @@ ${((dd.real) - (last_m + dd.payment) === 0) ? '$0' : `<span class="text-danger">
|
|
|
312
320
|
gvc.recreateView();
|
|
313
321
|
}
|
|
314
322
|
const checkSummaryDir = data.content;
|
|
315
|
-
const export_ = checkSummaryDir.check_list.find((dd) => {
|
|
323
|
+
const export_ = checkSummaryDir.check_list.find((dd) => {
|
|
324
|
+
return dd.key === 'cash';
|
|
325
|
+
}).export || 0;
|
|
316
326
|
BgWidget.settingDialog({
|
|
317
327
|
gvc: gvc,
|
|
318
328
|
d_main_style: 'padding-left:0px;padding-right:0px;',
|
|
@@ -320,30 +330,30 @@ ${((dd.real) - (last_m + dd.payment) === 0) ? '$0' : `<span class="text-danger">
|
|
|
320
330
|
innerHTML: (gvc) => {
|
|
321
331
|
try {
|
|
322
332
|
return html `
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
</div>
|
|
333
|
+
<div class="row m-0 p-0">
|
|
334
|
+
<div class="col-6 d-flex flex-column" style="gap:5px;">
|
|
335
|
+
<div class="fs-6 fw-500" style="color:#585858;">清點區間</div>
|
|
336
|
+
<div class=" fw-500 fs-6">
|
|
337
|
+
${gvc.glitter.ut.dateFormat(new Date(checkSummaryDir.start), 'yyyy-MM-dd')}
|
|
338
|
+
${gvc.glitter.ut.dateFormat(new Date(checkSummaryDir.start), 'hh:mm')}
|
|
339
|
+
- ${gvc.glitter.ut.dateFormat(new Date(checkSummaryDir.end), 'hh:mm')}
|
|
331
340
|
</div>
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
341
|
+
</div>
|
|
342
|
+
<div class="col-6 d-flex flex-column" style="gap:5px;">
|
|
343
|
+
<div class="fs-6 fw-500" style="color:#585858;">操作人員</div>
|
|
344
|
+
<div class=" fw-500 fs-6">${gvc.glitter.share.member_auth_list.find((d1) => {
|
|
335
345
|
return `${d1.user}` === `${data.staff}`;
|
|
336
346
|
}).config.name}
|
|
337
|
-
</div>
|
|
338
347
|
</div>
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
348
|
+
</div>
|
|
349
|
+
<div class="col-12 ${export_ ? `d-flex` : `d-none`} flex-column mt-2" style="gap:5px;">
|
|
350
|
+
<div class="fs-6 fw-500" style="color:#585858;">現金匯出</div>
|
|
351
|
+
<div class="text-success fw-500 fs-6 ">$${export_.toLocaleString()}
|
|
343
352
|
</div>
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
353
|
+
</div>
|
|
354
|
+
|
|
355
|
+
<div class="col-12 border-top my-2"></div>
|
|
356
|
+
${checkSummaryDir.check_list.map((dd) => {
|
|
347
357
|
const last_m = (dd.last_);
|
|
348
358
|
return `<div class=" col-12">
|
|
349
359
|
<div class="d-flex align-items-center p-2">
|
|
@@ -380,7 +390,7 @@ ${((dd.real) - (last_m + dd.payment) === 0) ? '$0' : `<span class="text-danger">
|
|
|
380
390
|
</div>
|
|
381
391
|
</div>`;
|
|
382
392
|
}).join(' <div class="col-12 border-top my-2"></div>')}
|
|
383
|
-
|
|
393
|
+
</div>`;
|
|
384
394
|
}
|
|
385
395
|
catch (e) {
|
|
386
396
|
console.log(e);
|
|
@@ -390,18 +400,18 @@ ${((dd.real) - (last_m + dd.payment) === 0) ? '$0' : `<span class="text-danger">
|
|
|
390
400
|
footer_html: (gvc) => {
|
|
391
401
|
const dialog = new ShareDialog(gvc.glitter);
|
|
392
402
|
return html `
|
|
393
|
-
|
|
394
|
-
|
|
403
|
+
<div class="d-flex align-items-center" style="gap:10px;">
|
|
404
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
395
405
|
gvc.closeDialog();
|
|
396
406
|
}), '關閉')}
|
|
397
|
-
|
|
407
|
+
${(data.summary_type === 'daily' || !last) ? `` : BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
|
|
398
408
|
let money = 0;
|
|
399
409
|
let min_ = checkSummaryDir.check_list.find((dd) => {
|
|
400
410
|
return dd.key === 'cash';
|
|
401
411
|
}).real;
|
|
402
412
|
dialog.customCheck({
|
|
403
413
|
text: html `${PosWidget.fontBold('要從錢箱匯出的金額')}
|
|
404
|
-
|
|
414
|
+
<input class="form-control mt-2" onclick="${gvc.event((e, event) => {
|
|
405
415
|
PosFunction.setMoney(gvc, (response) => {
|
|
406
416
|
if (response > min_) {
|
|
407
417
|
dialog.errorMessage({ text: '錢箱金額不足' });
|
|
@@ -412,7 +422,7 @@ ${((dd.real) - (last_m + dd.payment) === 0) ? '$0' : `<span class="text-danger">
|
|
|
412
422
|
}
|
|
413
423
|
}, '匯出金額');
|
|
414
424
|
})}" placeholder="請輸入金額">
|
|
415
|
-
|
|
425
|
+
`,
|
|
416
426
|
callback: (response) => __awaiter(this, void 0, void 0, function* () {
|
|
417
427
|
if (response) {
|
|
418
428
|
const staff = GlobalUser.parseJWT(GlobalUser.saas_token).payload.userID;
|
|
@@ -445,123 +455,182 @@ ${((dd.real) - (last_m + dd.payment) === 0) ? '$0' : `<span class="text-danger">
|
|
|
445
455
|
})
|
|
446
456
|
});
|
|
447
457
|
})), '設為日結單')}
|
|
448
|
-
|
|
458
|
+
</div>`;
|
|
449
459
|
}
|
|
450
460
|
});
|
|
451
461
|
}
|
|
452
462
|
static main(obj) {
|
|
453
463
|
const gvc = obj.gvc;
|
|
454
464
|
const table_id = gvc.glitter.getUUID();
|
|
455
|
-
return
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
465
|
+
return gvc.bindView(() => {
|
|
466
|
+
const init_id = gvc.glitter.getUUID();
|
|
467
|
+
let store_list = [];
|
|
468
|
+
const vm = {
|
|
469
|
+
loading: PosSummary.in_pos()
|
|
470
|
+
};
|
|
471
|
+
function initialStore() {
|
|
472
|
+
var _a;
|
|
473
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
474
|
+
if (!PosSummary.in_pos()) {
|
|
475
|
+
const [store_d, member_auth] = yield Promise.all([
|
|
476
|
+
ApiUser.getPublicConfig('store_manager', 'manager'),
|
|
477
|
+
ApiUser.getPermission({
|
|
478
|
+
page: 0,
|
|
479
|
+
limit: 100
|
|
480
|
+
})
|
|
481
|
+
]);
|
|
482
|
+
gvc.glitter.share.member_auth_list = member_auth.response.data.filter((dd) => {
|
|
483
|
+
return dd.invited && dd.status;
|
|
484
|
+
});
|
|
485
|
+
window.parent.glitter.share.member_auth_list = gvc.glitter.share.member_auth_list;
|
|
486
|
+
const store = (_a = store_d.response.value.list) !== null && _a !== void 0 ? _a : [];
|
|
487
|
+
console.log(`store.response.value`, store);
|
|
488
|
+
POSSetting.config.where_store = store.find((dd) => {
|
|
489
|
+
return dd.is_shop;
|
|
490
|
+
}).id;
|
|
491
|
+
store_list = store.filter((dd) => {
|
|
492
|
+
return dd.is_shop;
|
|
493
|
+
});
|
|
494
|
+
vm.loading = true;
|
|
495
|
+
gvc.notifyDataChange(init_id);
|
|
496
|
+
}
|
|
466
497
|
});
|
|
467
498
|
}
|
|
468
|
-
|
|
469
|
-
</div>
|
|
470
|
-
${BgWidget.mainCard(gvc.bindView(() => {
|
|
471
|
-
let data = [];
|
|
499
|
+
initialStore();
|
|
472
500
|
return {
|
|
473
|
-
bind:
|
|
501
|
+
bind: init_id,
|
|
474
502
|
view: () => {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
503
|
+
if (!vm.loading) {
|
|
504
|
+
return BgWidget.spinner();
|
|
505
|
+
}
|
|
506
|
+
return BgWidget.container(html `
|
|
507
|
+
<div class="title-container ${PosSummary.in_pos() ? `mb-4` : ''}">
|
|
508
|
+
${BgWidget.title('小結紀錄')}
|
|
509
|
+
<div class="flex-fill"></div>
|
|
510
|
+
${PosSummary.in_pos() ? BgWidget.darkButton('新增小結單', obj.gvc.event(() => {
|
|
511
|
+
if (localStorage.getItem('checkSummaryDir')) {
|
|
512
|
+
this.checkSummaryDir(gvc);
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
this.addSummary(gvc, () => {
|
|
516
|
+
gvc.notifyDataChange(table_id);
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
})) : ''}
|
|
520
|
+
</div>
|
|
521
|
+
${(PosSummary.in_pos()) ? `` : BgWidget.tab(store_list.map((dd) => {
|
|
522
|
+
return {
|
|
523
|
+
title: dd.name,
|
|
524
|
+
key: dd.id
|
|
525
|
+
};
|
|
526
|
+
}), gvc, POSSetting.config.where_store, (dd) => {
|
|
527
|
+
POSSetting.config.where_store = dd;
|
|
528
|
+
gvc.notifyDataChange(init_id);
|
|
529
|
+
})}
|
|
530
|
+
${BgWidget.mainCard(gvc.bindView(() => {
|
|
531
|
+
let data = [];
|
|
532
|
+
return {
|
|
533
|
+
bind: table_id,
|
|
534
|
+
view: () => {
|
|
535
|
+
return BgWidget.tableV3({
|
|
536
|
+
gvc: obj.gvc,
|
|
537
|
+
getData: (vd) => {
|
|
538
|
+
let vmi = vd;
|
|
539
|
+
const limit = 10;
|
|
540
|
+
ApiPos.getSummary(POSSetting.config.where_store).then((r) => {
|
|
541
|
+
function getDatalist() {
|
|
542
|
+
return r.response.data.map((dd) => {
|
|
543
|
+
try {
|
|
544
|
+
const content = dd.content;
|
|
545
|
+
return [
|
|
546
|
+
{
|
|
547
|
+
key: '建立日期',
|
|
548
|
+
value: html `<span
|
|
549
|
+
class="fs-7">${obj.gvc.glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd hh:mm')}</span>`,
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
key: '操作人員',
|
|
553
|
+
value: html `<span class="fs-7">${gvc.glitter.share.member_auth_list.find((d1) => {
|
|
554
|
+
return `${d1.user}` === `${dd.staff}`;
|
|
555
|
+
}).config.name}</span>`,
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
key: '應有金額',
|
|
559
|
+
value: html `<span class="fs-7">
|
|
500
560
|
${content.need.toLocaleString()}
|
|
501
561
|
</span>`,
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
key: '實點金額',
|
|
565
|
+
value: html `<span class="fs-7">
|
|
506
566
|
${content.real.toLocaleString()}
|
|
507
567
|
</span>`,
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
key: '小結結果',
|
|
571
|
+
value: html `<span class="fs-7">${(() => {
|
|
572
|
+
switch (dd.summary_type) {
|
|
573
|
+
case "reserve":
|
|
574
|
+
return BgWidget.infoInsignia('備用金');
|
|
575
|
+
default:
|
|
576
|
+
if (content.real !== content.need) {
|
|
577
|
+
return BgWidget.dangerInsignia('不符合');
|
|
578
|
+
}
|
|
579
|
+
else {
|
|
580
|
+
return BgWidget.successInsignia('符合');
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
})()}</span>`,
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
key: '當日最終筆',
|
|
587
|
+
value: html `
|
|
588
|
+
<div class="fs-5 ${(dd.summary_type === 'daily') ? `d-flex` : `d-none`} align-items-center justify-content-center rounded-circle bg-success text-white rounded-circle"
|
|
589
|
+
style="width:30px;height:30px;">
|
|
590
|
+
|
|
591
|
+
<i class="fa-solid fa-check"></i>
|
|
592
|
+
</div>`,
|
|
593
|
+
}
|
|
594
|
+
];
|
|
595
|
+
}
|
|
596
|
+
catch (e) {
|
|
597
|
+
return [];
|
|
598
|
+
}
|
|
599
|
+
}).filter((dd) => {
|
|
600
|
+
return dd.length;
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
if (r.result && r.response.data) {
|
|
604
|
+
data = r.response.data;
|
|
605
|
+
vmi.pageSize = Math.ceil(r.response.total / limit);
|
|
606
|
+
vmi.tableData = getDatalist();
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
vmi.pageSize = 0;
|
|
610
|
+
vmi.originalData = [];
|
|
611
|
+
vmi.tableData = [];
|
|
612
|
+
}
|
|
613
|
+
vmi.loading = false;
|
|
614
|
+
vmi.callback();
|
|
615
|
+
});
|
|
616
|
+
},
|
|
617
|
+
rowClick: (s, index) => {
|
|
618
|
+
if (data[index].summary_type !== 'reverse') {
|
|
619
|
+
this.showInfo(gvc, data[index], index === 0);
|
|
536
620
|
}
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
}
|
|
541
|
-
if (r.result && r.response.data) {
|
|
542
|
-
data = r.response.data;
|
|
543
|
-
vmi.pageSize = Math.ceil(r.response.total / limit);
|
|
544
|
-
vmi.tableData = getDatalist();
|
|
545
|
-
}
|
|
546
|
-
else {
|
|
547
|
-
vmi.pageSize = 0;
|
|
548
|
-
vmi.originalData = [];
|
|
549
|
-
vmi.tableData = [];
|
|
550
|
-
}
|
|
551
|
-
vmi.loading = false;
|
|
552
|
-
vmi.callback();
|
|
553
|
-
});
|
|
554
|
-
},
|
|
555
|
-
rowClick: (s, index) => {
|
|
556
|
-
if (data[index].summary_type !== 'reverse') {
|
|
557
|
-
this.showInfo(gvc, data[index], index === 0);
|
|
621
|
+
},
|
|
622
|
+
filter: [],
|
|
623
|
+
});
|
|
558
624
|
}
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
|
|
625
|
+
};
|
|
626
|
+
}))}
|
|
627
|
+
`);
|
|
628
|
+
},
|
|
629
|
+
divCreate: {
|
|
630
|
+
class: `w-100 justify-content-center d-flex`
|
|
562
631
|
}
|
|
563
632
|
};
|
|
564
|
-
})
|
|
565
|
-
`);
|
|
633
|
+
});
|
|
566
634
|
}
|
|
567
635
|
}
|
|
636
|
+
window.glitter.setModule(import.meta.url, PosSummary);
|