@things-factory/operato-wms 4.3.592 → 4.3.595
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/client/pages/components/list-view/product-list-view.js +378 -0
- package/client/pages/constants/picking-standard.js +1 -0
- package/client/pages/constants/worksheet.js +12 -0
- package/client/pages/inventory-check/cycle-count-inventory-details-popup.js +12 -12
- package/client/pages/inventory-check/cycle-count-report.js +181 -91
- package/client/pages/inventory-check/inspecting-product.js +56 -12
- package/client/pages/order/release-order/b2b/b2b-order-list.js +91 -39
- package/client/pages/outbound/generate-worksheet-popup.js +188 -25
- package/client/pages/outbound/loading-v2/delivery-order-info.js +205 -0
- package/client/pages/outbound/loading-v2/load-by-qty.js +151 -0
- package/client/pages/outbound/loading-v2/loading-execution-base.js +514 -0
- package/client/pages/outbound/loading-v2/loading-execution.js +392 -0
- package/client/pages/outbound/loading-v2/loading.js +419 -0
- package/client/pages/outbound/loading-v2/release-good-info.js +93 -0
- package/client/pages/outbound/loading-v2/show-my-loading-worksheet-list-popup.js +93 -0
- package/client/pages/outbound/loading-v2/warehouse-return-popup.js +194 -0
- package/client/pages/outbound/picking-v2/issue-details-popup.js +163 -0
- package/client/pages/outbound/picking-v2/picking-execution-base.js +482 -0
- package/client/pages/outbound/picking-v2/picking-execution.js +379 -0
- package/client/pages/outbound/picking-v2/picking.js +387 -0
- package/client/pages/outbound/picking-v2/report-issue-popup.js +139 -0
- package/client/pages/outbound/picking-v2/scan-bin-no-popup.js +126 -0
- package/client/pages/outbound/picking-v2/worksheet-info.js +200 -0
- package/client/pages/outbound/select-operator-popup.js +6 -3
- package/client/pages/outbound/show-my-worksheet-list-popup.js +6 -2
- package/client/pages/outbound/worksheet-zone-picking.js +507 -0
- package/client/pages/outbound/zone-worksheet.js +574 -0
- package/client/route.js +15 -0
- package/dist-server/graphql/resolvers/index.js +11 -2
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/outbound/complete-load.js +96 -0
- package/dist-server/graphql/resolvers/outbound/complete-load.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/find-loadable-release-good.js +58 -0
- package/dist-server/graphql/resolvers/outbound/find-loadable-release-good.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/get-delivery-orders.js +29 -0
- package/dist-server/graphql/resolvers/outbound/get-delivery-orders.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/get-loading-task.js +86 -0
- package/dist-server/graphql/resolvers/outbound/get-loading-task.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/index.js +16 -0
- package/dist-server/graphql/resolvers/outbound/index.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/load-by-qty.js +112 -0
- package/dist-server/graphql/resolvers/outbound/load-by-qty.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js +122 -0
- package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/my-loading-assignment-status.js +32 -0
- package/dist-server/graphql/resolvers/outbound/my-loading-assignment-status.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/sort-item.js +65 -0
- package/dist-server/graphql/resolvers/outbound/sort-item.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/undo-load.js +72 -0
- package/dist-server/graphql/resolvers/outbound/undo-load.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/warehouse-return.js +101 -0
- package/dist-server/graphql/resolvers/outbound/warehouse-return.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/cycle-count-report.js +119 -86
- package/dist-server/graphql/resolvers/reports/cycle-count-report.js.map +1 -1
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +53 -25
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +1 -1
- package/dist-server/graphql/resolvers/zone-worksheet/activate-zone-worksheet.js +91 -0
- package/dist-server/graphql/resolvers/zone-worksheet/activate-zone-worksheet.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/assign-sorter.js +36 -0
- package/dist-server/graphql/resolvers/zone-worksheet/assign-sorter.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/generate-zone-worksheet.js +103 -0
- package/dist-server/graphql/resolvers/zone-worksheet/generate-zone-worksheet.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/get-zone-picking-task.js +98 -0
- package/dist-server/graphql/resolvers/zone-worksheet/get-zone-picking-task.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/index.js +12 -0
- package/dist-server/graphql/resolvers/zone-worksheet/index.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/zone-picking.js +327 -0
- package/dist-server/graphql/resolvers/zone-worksheet/zone-picking.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/zone-worksheet.js +146 -0
- package/dist-server/graphql/resolvers/zone-worksheet/zone-worksheet.js.map +1 -0
- package/dist-server/graphql/types/index.js +11 -3
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/outbound/delivery-order-info-list.js +14 -0
- package/dist-server/graphql/types/outbound/delivery-order-info-list.js.map +1 -0
- package/dist-server/graphql/types/outbound/index.js +23 -0
- package/dist-server/graphql/types/outbound/index.js.map +1 -0
- package/dist-server/graphql/types/outbound/loading-assignment.js +15 -0
- package/dist-server/graphql/types/outbound/loading-assignment.js.map +1 -0
- package/dist-server/graphql/types/outbound/loading-worksheet-type.js +25 -0
- package/dist-server/graphql/types/outbound/loading-worksheet-type.js.map +1 -0
- package/dist-server/graphql/types/reports/cycle-count-report.js +2 -0
- package/dist-server/graphql/types/reports/cycle-count-report.js.map +1 -1
- package/dist-server/graphql/types/reports/index.js +1 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/zone-worksheet/index.js +22 -0
- package/dist-server/graphql/types/zone-worksheet/index.js.map +1 -0
- package/dist-server/graphql/types/zone-worksheet/zone-picking-worksheet.js +18 -0
- package/dist-server/graphql/types/zone-worksheet/zone-picking-worksheet.js.map +1 -0
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview-list.js +13 -0
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview-list.js.map +1 -0
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview.js +16 -0
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview.js.map +1 -0
- package/helps/release-note.md +20 -12
- package/package.json +8 -8
- package/server/graphql/resolvers/index.ts +11 -2
- package/server/graphql/resolvers/outbound/complete-load.ts +126 -0
- package/server/graphql/resolvers/outbound/find-loadable-release-good.ts +61 -0
- package/server/graphql/resolvers/outbound/get-delivery-orders.ts +32 -0
- package/server/graphql/resolvers/outbound/get-loading-task.ts +105 -0
- package/server/graphql/resolvers/outbound/index.ts +26 -0
- package/server/graphql/resolvers/outbound/load-by-qty.ts +176 -0
- package/server/graphql/resolvers/outbound/loading-worksheet-v2.ts +131 -0
- package/server/graphql/resolvers/outbound/my-loading-assignment-status.ts +35 -0
- package/server/graphql/resolvers/outbound/sort-item.ts +81 -0
- package/server/graphql/resolvers/outbound/undo-load.ts +83 -0
- package/server/graphql/resolvers/outbound/warehouse-return.ts +129 -0
- package/server/graphql/resolvers/reports/cycle-count-report.ts +125 -87
- package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +77 -35
- package/server/graphql/resolvers/zone-worksheet/activate-zone-worksheet.ts +124 -0
- package/server/graphql/resolvers/zone-worksheet/assign-sorter.ts +49 -0
- package/server/graphql/resolvers/zone-worksheet/generate-zone-worksheet.ts +133 -0
- package/server/graphql/resolvers/zone-worksheet/get-zone-picking-task.ts +118 -0
- package/server/graphql/resolvers/zone-worksheet/index.ts +20 -0
- package/server/graphql/resolvers/zone-worksheet/zone-picking.ts +458 -0
- package/server/graphql/resolvers/zone-worksheet/zone-worksheet.ts +183 -0
- package/server/graphql/types/index.ts +11 -3
- package/server/graphql/types/outbound/delivery-order-info-list.ts +8 -0
- package/server/graphql/types/outbound/index.ts +22 -0
- package/server/graphql/types/outbound/loading-assignment.ts +9 -0
- package/server/graphql/types/outbound/loading-worksheet-type.ts +20 -0
- package/server/graphql/types/reports/cycle-count-report.ts +2 -0
- package/server/graphql/types/reports/index.ts +3 -9
- package/server/graphql/types/zone-worksheet/index.ts +21 -0
- package/server/graphql/types/zone-worksheet/zone-picking-worksheet.ts +12 -0
- package/server/graphql/types/zone-worksheet/zone-worksheet-overview-list.ts +7 -0
- package/server/graphql/types/zone-worksheet/zone-worksheet-overview.ts +10 -0
- package/things-factory.config.js +16 -0
- package/translations/en.json +31 -1
- package/translations/ko.json +28 -0
- package/translations/ms.json +30 -2
- package/translations/zh.json +28 -0
|
@@ -2,37 +2,20 @@ import '@things-factory/form-ui'
|
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
import '../batch-picking-popup'
|
|
4
4
|
import '../../../outbound/generate-worksheet-popup'
|
|
5
|
+
import '../../../outbound/select-operator-popup'
|
|
5
6
|
|
|
6
7
|
import gql from 'graphql-tag'
|
|
7
|
-
import {
|
|
8
|
-
css,
|
|
9
|
-
html
|
|
10
|
-
} from 'lit-element'
|
|
8
|
+
import { css, html } from 'lit-element'
|
|
11
9
|
|
|
12
10
|
import { getCodeByName } from '@things-factory/code-base'
|
|
13
|
-
import {
|
|
14
|
-
i18next,
|
|
15
|
-
localize
|
|
16
|
-
} from '@things-factory/i18n-base'
|
|
11
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
17
12
|
import { openPopup } from '@things-factory/layout-base'
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} from '
|
|
23
|
-
import {
|
|
24
|
-
CommonButtonStyles,
|
|
25
|
-
ScrollbarStyles
|
|
26
|
-
} from '@things-factory/styles'
|
|
27
|
-
import {
|
|
28
|
-
isMobileDevice,
|
|
29
|
-
sleep
|
|
30
|
-
} from '@things-factory/utils'
|
|
31
|
-
|
|
32
|
-
import {
|
|
33
|
-
ORDER_STATUS,
|
|
34
|
-
ORDER_VAS_STATUS
|
|
35
|
-
} from '../../../constants'
|
|
13
|
+
import { client, navigate, PageView } from '@things-factory/shell'
|
|
14
|
+
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
15
|
+
import { isMobileDevice, sleep } from '@things-factory/utils'
|
|
16
|
+
|
|
17
|
+
import { ORDER_STATUS, ORDER_VAS_STATUS } from '../../../constants'
|
|
18
|
+
import { fetchSettingRule } from '../../../../fetch-setting-value'
|
|
36
19
|
|
|
37
20
|
class B2bOrderList extends localize(i18next)(PageView) {
|
|
38
21
|
static get styles() {
|
|
@@ -66,7 +49,8 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
66
49
|
_exportOption: Boolean,
|
|
67
50
|
_routeId: Boolean,
|
|
68
51
|
vasStatus: String,
|
|
69
|
-
isUserBelongsDomain: Boolean
|
|
52
|
+
isUserBelongsDomain: Boolean,
|
|
53
|
+
_enableZonePicking: Boolean
|
|
70
54
|
}
|
|
71
55
|
}
|
|
72
56
|
|
|
@@ -92,6 +76,14 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
92
76
|
...CommonButtonStyles.activate
|
|
93
77
|
})
|
|
94
78
|
}
|
|
79
|
+
|
|
80
|
+
if (this._enableZonePicking) {
|
|
81
|
+
actions.push({
|
|
82
|
+
title: i18next.t('button.assign_sorter'),
|
|
83
|
+
action: this._openSelectSorterPopup.bind(this),
|
|
84
|
+
...CommonButtonStyles.add
|
|
85
|
+
})
|
|
86
|
+
}
|
|
95
87
|
return {
|
|
96
88
|
title: i18next.t('title.release_orders'),
|
|
97
89
|
actions,
|
|
@@ -127,10 +119,10 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
127
119
|
const _orderStatus = _orderStatusReq.status == 'fulfilled' ? _orderStatusReq.value : []
|
|
128
120
|
const _bizplaces = _bizplacesReq.status == 'fulfilled' ? _bizplacesReq.value : []
|
|
129
121
|
const _excludedVasStatus = ['DONE', 'CHANGES', 'NEW', 'REMOVED']
|
|
130
|
-
const _orderVasStatus = Object.values(ORDER_VAS_STATUS)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
122
|
+
const _orderVasStatus = Object.values(ORDER_VAS_STATUS).filter(status => !_excludedVasStatus.includes(status.value))
|
|
123
|
+
this._enableZonePicking = await fetchSettingRule('enable-zone-picking')
|
|
124
|
+
|
|
125
|
+
this._searchFields = [
|
|
134
126
|
{
|
|
135
127
|
label: i18next.t('field.order_info'),
|
|
136
128
|
name: 'name',
|
|
@@ -251,7 +243,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
251
243
|
type: 'checkbox',
|
|
252
244
|
props: { searchOper: 'eq' },
|
|
253
245
|
attrs: ['indeterminate']
|
|
254
|
-
|
|
246
|
+
},
|
|
255
247
|
{
|
|
256
248
|
label: i18next.t('field.vas'),
|
|
257
249
|
name: 'hasVas',
|
|
@@ -400,7 +392,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
400
392
|
type: 'string',
|
|
401
393
|
name: 'vasStatus',
|
|
402
394
|
header: i18next.t('field.vas_status'),
|
|
403
|
-
imex: { header: i18next.t('field.vas'), key: 'vas', width: 20, type: 'string'},
|
|
395
|
+
imex: { header: i18next.t('field.vas'), key: 'vas', width: 20, type: 'string' },
|
|
404
396
|
sortable: true,
|
|
405
397
|
width: 120
|
|
406
398
|
},
|
|
@@ -412,6 +404,14 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
412
404
|
sortable: true,
|
|
413
405
|
width: 120
|
|
414
406
|
},
|
|
407
|
+
{
|
|
408
|
+
type: 'object',
|
|
409
|
+
name: 'sortedBy',
|
|
410
|
+
header: i18next.t('field.sorter'),
|
|
411
|
+
imex: { header: i18next.t('field.sorter'), key: 'sortedBy', width: 30, type: 'object' },
|
|
412
|
+
sortable: true,
|
|
413
|
+
width: 160
|
|
414
|
+
},
|
|
415
415
|
{
|
|
416
416
|
type: 'datetime',
|
|
417
417
|
name: 'createdAt',
|
|
@@ -488,7 +488,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
488
488
|
let toDt = new Date(filter.value)
|
|
489
489
|
toDt.setHours(23, 59, 59)
|
|
490
490
|
filter.value = toDt.toISOString()
|
|
491
|
-
break
|
|
491
|
+
break
|
|
492
492
|
default:
|
|
493
493
|
break
|
|
494
494
|
}
|
|
@@ -530,6 +530,9 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
530
530
|
id
|
|
531
531
|
status
|
|
532
532
|
}
|
|
533
|
+
sortedBy {
|
|
534
|
+
name
|
|
535
|
+
}
|
|
533
536
|
creator {
|
|
534
537
|
id
|
|
535
538
|
name
|
|
@@ -569,11 +572,12 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
569
572
|
return {
|
|
570
573
|
...itm,
|
|
571
574
|
routeId: itm.routeId ? true : false,
|
|
572
|
-
vasStatus:
|
|
573
|
-
|
|
574
|
-
? ORDER_VAS_STATUS.PENDING_APPROVE.value
|
|
575
|
-
|
|
576
|
-
|
|
575
|
+
vasStatus:
|
|
576
|
+
itm.orderVass?.length > 0
|
|
577
|
+
? itm.orderVass.some(ov => ov.status === ORDER_VAS_STATUS.PENDING_APPROVE.value)
|
|
578
|
+
? ORDER_VAS_STATUS.PENDING_APPROVE.value
|
|
579
|
+
: itm.orderVass[0].status
|
|
580
|
+
: null
|
|
577
581
|
}
|
|
578
582
|
}) || []
|
|
579
583
|
}
|
|
@@ -644,6 +648,54 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
644
648
|
}
|
|
645
649
|
}
|
|
646
650
|
|
|
651
|
+
_openSelectSorterPopup() {
|
|
652
|
+
try {
|
|
653
|
+
let selectedData = this.dataGrist.selected.filter(
|
|
654
|
+
item => item.status != ORDER_STATUS.DONE.value && item.status != ORDER_STATUS.CANCELLED.value
|
|
655
|
+
)
|
|
656
|
+
|
|
657
|
+
if (selectedData.length <= 0) throw new Error('Please select at least one valid order')
|
|
658
|
+
|
|
659
|
+
openPopup(
|
|
660
|
+
html`
|
|
661
|
+
<select-operator-popup
|
|
662
|
+
.selectSorter = "${true}"
|
|
663
|
+
@updateOperator="${async e => {
|
|
664
|
+
let assignee = e.detail
|
|
665
|
+
|
|
666
|
+
const response = await client.mutate({
|
|
667
|
+
mutation: gql`
|
|
668
|
+
mutation assignSorter($releaseGoodId: [String]!, $userId: String!) {
|
|
669
|
+
assignSorter(releaseGoodId: $releaseGoodId, userId: $userId)
|
|
670
|
+
}
|
|
671
|
+
`,
|
|
672
|
+
variables: { releaseGoodId: selectedData.map(itm => itm.id), userId: assignee.id }
|
|
673
|
+
})
|
|
674
|
+
|
|
675
|
+
if (!response.errors) {
|
|
676
|
+
this.dataGrist.fetch()
|
|
677
|
+
return this._showToast({ message: i18next.t('text.updated_successfully') })
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
if (this.activatable) {
|
|
681
|
+
if (this.orderNo) {
|
|
682
|
+
history.back()
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}}"
|
|
686
|
+
></select-operator-popup>
|
|
687
|
+
`,
|
|
688
|
+
{
|
|
689
|
+
backdrop: true,
|
|
690
|
+
size: 'medium',
|
|
691
|
+
title: 'select operator'
|
|
692
|
+
}
|
|
693
|
+
)
|
|
694
|
+
} catch (error) {
|
|
695
|
+
return this._showToast(error)
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
|
|
647
699
|
_compareValues(key, order = 'asc') {
|
|
648
700
|
return function innerSort(a, b) {
|
|
649
701
|
if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
|
|
@@ -17,7 +17,8 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
|
|
|
17
17
|
_releaseGoods: Array,
|
|
18
18
|
_batchLimit: String,
|
|
19
19
|
_groupedReleaseGoods: Array,
|
|
20
|
-
_processing: Boolean
|
|
20
|
+
_processing: Boolean,
|
|
21
|
+
_enableZonePicking: Boolean
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -78,6 +79,36 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
|
|
|
78
79
|
]
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
get gristColumn() {
|
|
83
|
+
if (this._generateStd == 'zone') {
|
|
84
|
+
return html`
|
|
85
|
+
<div class="grist-container">
|
|
86
|
+
<div class="grist">
|
|
87
|
+
<data-grist
|
|
88
|
+
id="zoneGrist"
|
|
89
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
90
|
+
.config=${this.zoneConfig}
|
|
91
|
+
.fetchHandler=${this._calculateZoneWoksheets.bind(this)}
|
|
92
|
+
></data-grist>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
`
|
|
96
|
+
} else {
|
|
97
|
+
return html`
|
|
98
|
+
<div class="grist-container">
|
|
99
|
+
<div class="grist">
|
|
100
|
+
<data-grist
|
|
101
|
+
id="batchGrist"
|
|
102
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
103
|
+
.config=${this.batchConfig}
|
|
104
|
+
.fetchHandler=${this._calculatePossibleWorksheets.bind(this)}
|
|
105
|
+
></data-grist>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
`
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
81
112
|
render() {
|
|
82
113
|
return html`
|
|
83
114
|
<div class="container">
|
|
@@ -91,9 +122,7 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
|
|
|
91
122
|
name="generate-std"
|
|
92
123
|
type="radio"
|
|
93
124
|
value="single"
|
|
94
|
-
@change="${e => {
|
|
95
|
-
this._generateStd = e.currentTarget.value
|
|
96
|
-
}}"
|
|
125
|
+
@change="${e => {this._handleGenerateStdChange(e)}}"
|
|
97
126
|
.checked="true"
|
|
98
127
|
checked
|
|
99
128
|
/>
|
|
@@ -105,27 +134,31 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
|
|
|
105
134
|
name="generate-std"
|
|
106
135
|
type="radio"
|
|
107
136
|
value="batch"
|
|
108
|
-
@change="${e => {
|
|
109
|
-
this._generateStd = e.currentTarget.value
|
|
110
|
-
}}"
|
|
137
|
+
@change="${e => {this._handleGenerateStdChange(e)}}"
|
|
111
138
|
/>
|
|
112
139
|
<label for="batch-picking">${i18next.t('text.batch_picking')}</label>
|
|
113
140
|
</div>
|
|
141
|
+
${this._enableZonePicking
|
|
142
|
+
? html`
|
|
143
|
+
<div class="radio-div">
|
|
144
|
+
<input
|
|
145
|
+
id="zone-picking"
|
|
146
|
+
name="generate-std"
|
|
147
|
+
type="radio"
|
|
148
|
+
value="zone"
|
|
149
|
+
@change="${e => {this._handleGenerateStdChange(e)}}"
|
|
150
|
+
/>
|
|
151
|
+
<label for="zone-picking">${i18next.t('text.zone_picking')}</label>
|
|
152
|
+
</div>
|
|
153
|
+
`
|
|
154
|
+
: ''}
|
|
114
155
|
</div>
|
|
115
156
|
</fieldset>
|
|
116
157
|
</form>
|
|
117
158
|
</div>
|
|
118
159
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<data-grist
|
|
122
|
-
id="grist"
|
|
123
|
-
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
124
|
-
.config=${this.config}
|
|
125
|
-
.fetchHandler=${this._calculatePossibleWorksheets.bind(this)}
|
|
126
|
-
></data-grist>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
160
|
+
${this.gristColumn}
|
|
161
|
+
|
|
129
162
|
<div class="button-container">
|
|
130
163
|
<mwc-button
|
|
131
164
|
raised
|
|
@@ -133,9 +166,17 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
|
|
|
133
166
|
const button = e.currentTarget
|
|
134
167
|
this.disableButton(button)
|
|
135
168
|
try {
|
|
136
|
-
this._generateStd
|
|
137
|
-
|
|
138
|
-
|
|
169
|
+
switch (this._generateStd) {
|
|
170
|
+
case 'single':
|
|
171
|
+
await this._generatePickingWorksheet()
|
|
172
|
+
break
|
|
173
|
+
case 'batch':
|
|
174
|
+
await this._generateBatchPickingWorksheet()
|
|
175
|
+
break
|
|
176
|
+
case 'zone':
|
|
177
|
+
await this._generateZonePickingWorksheet()
|
|
178
|
+
break
|
|
179
|
+
}
|
|
139
180
|
} finally {
|
|
140
181
|
await sleep(200)
|
|
141
182
|
this.enableButton(button)
|
|
@@ -148,8 +189,12 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
|
|
|
148
189
|
`
|
|
149
190
|
}
|
|
150
191
|
|
|
151
|
-
get
|
|
152
|
-
return this.shadowRoot.querySelector('data-grist#
|
|
192
|
+
get batchGrist() {
|
|
193
|
+
return this.shadowRoot.querySelector('data-grist#batchGrist')
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
get zoneGrist() {
|
|
197
|
+
return this.shadowRoot.querySelector('data-grist#zoneGrist')
|
|
153
198
|
}
|
|
154
199
|
|
|
155
200
|
constructor() {
|
|
@@ -162,7 +207,7 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
|
|
|
162
207
|
}
|
|
163
208
|
|
|
164
209
|
async firstUpdated() {
|
|
165
|
-
this.
|
|
210
|
+
this.batchConfig = {
|
|
166
211
|
pagination: { infinite: true },
|
|
167
212
|
rows: {
|
|
168
213
|
appendable: false
|
|
@@ -190,9 +235,54 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
|
|
|
190
235
|
]
|
|
191
236
|
}
|
|
192
237
|
|
|
238
|
+
this.zoneConfig = {
|
|
239
|
+
pagination: { infinite: true },
|
|
240
|
+
rows: {
|
|
241
|
+
appendable: false
|
|
242
|
+
},
|
|
243
|
+
columns: [
|
|
244
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
245
|
+
{
|
|
246
|
+
type: 'string',
|
|
247
|
+
name: 'company',
|
|
248
|
+
header: i18next.t('field.company'),
|
|
249
|
+
width: 180
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
type: 'int',
|
|
253
|
+
name: 'noOfSku',
|
|
254
|
+
header: i18next.t('field.no_of_sku'),
|
|
255
|
+
width: 110
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
type: 'int',
|
|
259
|
+
name: 'noOfRo',
|
|
260
|
+
header: i18next.t('field.no_of_ro'),
|
|
261
|
+
width: 110
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
type: 'string',
|
|
265
|
+
name: 'zone',
|
|
266
|
+
header: i18next.t('field.zone'),
|
|
267
|
+
width: 180
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
}
|
|
271
|
+
|
|
193
272
|
this._batchLimit = await fetchSettingRule('batch-picking-limit')
|
|
194
|
-
|
|
195
|
-
|
|
273
|
+
this._enableZonePicking = await fetchSettingRule('enable-zone-picking')
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
_handleGenerateStdChange(e) {
|
|
277
|
+
this._generateStd = e.currentTarget.value
|
|
278
|
+
|
|
279
|
+
this.updateComplete.then(() => {
|
|
280
|
+
if (this._generateStd === 'zone') {
|
|
281
|
+
this.zoneGrist.fetch()
|
|
282
|
+
} else {
|
|
283
|
+
this.batchGrist.fetch()
|
|
284
|
+
}
|
|
285
|
+
})
|
|
196
286
|
}
|
|
197
287
|
|
|
198
288
|
async _generatePickingWorksheet() {
|
|
@@ -257,6 +347,37 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
|
|
|
257
347
|
}
|
|
258
348
|
}
|
|
259
349
|
|
|
350
|
+
async _generateZonePickingWorksheet() {
|
|
351
|
+
this._processing = true
|
|
352
|
+
try {
|
|
353
|
+
|
|
354
|
+
let releaseGoodNames = this.gristData.selected
|
|
355
|
+
.filter(itm => itm.status === ORDER_STATUS.PENDING_WORKSHEET.value)
|
|
356
|
+
.map(itm => itm.name)
|
|
357
|
+
|
|
358
|
+
const response = await client.mutate({
|
|
359
|
+
mutation: gql`
|
|
360
|
+
mutation generateWorksheetZonePicking($releaseGoods: [String!]) {
|
|
361
|
+
generateWorksheetZonePicking(releaseGoods: $releaseGoods) {
|
|
362
|
+
name
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
`,
|
|
366
|
+
variables: {
|
|
367
|
+
releaseGoods: releaseGoodNames
|
|
368
|
+
}
|
|
369
|
+
})
|
|
370
|
+
if (!response.errors) {
|
|
371
|
+
navigate('zone_worksheets')
|
|
372
|
+
this._showToast({ message: i18next.t('text.worksheet(s)_has_been_generated')})
|
|
373
|
+
}
|
|
374
|
+
this._processing = false
|
|
375
|
+
} catch (e) {
|
|
376
|
+
this._showToast(e)
|
|
377
|
+
this._processing = false
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
260
381
|
async _splitOrdersForGenerateBatchWorksheet() {
|
|
261
382
|
this._releaseGoods = this.gristData.selected
|
|
262
383
|
.filter(itm => itm.status === ORDER_STATUS.PENDING_WORKSHEET.value)
|
|
@@ -315,6 +436,48 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
|
|
|
315
436
|
return { records: data, total: data.length }
|
|
316
437
|
}
|
|
317
438
|
|
|
439
|
+
async _calculateZoneWoksheets() {
|
|
440
|
+
//fetch orders and estimated worksheet count
|
|
441
|
+
const orderZones = await this.fetchOrderZone()
|
|
442
|
+
|
|
443
|
+
let data = orderZones.items.map(item => {
|
|
444
|
+
return {
|
|
445
|
+
company: item.company,
|
|
446
|
+
noOfSku: item.noOfSku,
|
|
447
|
+
noOfRo: item.noOfRo,
|
|
448
|
+
zone: item.zone
|
|
449
|
+
}
|
|
450
|
+
})
|
|
451
|
+
|
|
452
|
+
return { records: data, total: data.length }
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
async fetchOrderZone() {
|
|
456
|
+
let releaseGoodNames = this.gristData.selected
|
|
457
|
+
.filter(itm => itm.status === ORDER_STATUS.PENDING_WORKSHEET.value)
|
|
458
|
+
.map(itm => itm.name)
|
|
459
|
+
|
|
460
|
+
const response = await client.query({
|
|
461
|
+
query: gql`
|
|
462
|
+
query zoneWorksheetOverview($releaseGoods: [String!]!) {
|
|
463
|
+
zoneWorksheetOverview(releaseGoods: $releaseGoods) {
|
|
464
|
+
items {
|
|
465
|
+
company
|
|
466
|
+
noOfSku
|
|
467
|
+
noOfRo
|
|
468
|
+
zone
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
`,
|
|
473
|
+
variables: {
|
|
474
|
+
releaseGoods: releaseGoodNames
|
|
475
|
+
}
|
|
476
|
+
})
|
|
477
|
+
|
|
478
|
+
return response.data.zoneWorksheetOverview
|
|
479
|
+
}
|
|
480
|
+
|
|
318
481
|
_validateWorksheets() {
|
|
319
482
|
//check if there is at least 2 orders, separate orders based on batch picking limit
|
|
320
483
|
this._partnerBizplaceIds.forEach(itm => {
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
import { html, css, LitElement } from 'lit-element'
|
|
3
|
+
import { client, CustomAlert } from '@things-factory/shell'
|
|
4
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
5
|
+
import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
|
|
6
|
+
import { ScrollbarStyles } from '@things-factory/styles'
|
|
7
|
+
import '../../components/list-view/product-list-view'
|
|
8
|
+
import { showToast } from '../../../util'
|
|
9
|
+
|
|
10
|
+
class DeliveryOrderInfo extends localize(i18next)(LitElement) {
|
|
11
|
+
static get properties() {
|
|
12
|
+
return {
|
|
13
|
+
_doNo: String,
|
|
14
|
+
_truckNo: String,
|
|
15
|
+
data: Object
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static get styles() {
|
|
20
|
+
return [
|
|
21
|
+
ScrollbarStyles,
|
|
22
|
+
css`
|
|
23
|
+
:host {
|
|
24
|
+
padding: 12px;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
background-color: var(--main-section-background-color);
|
|
29
|
+
}
|
|
30
|
+
.do-info {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: repeat(12, 1fr);
|
|
33
|
+
grid-gap: 8px;
|
|
34
|
+
color: #3a5877;
|
|
35
|
+
padding: 0 0 12px 0;
|
|
36
|
+
margin: 0 0 12px 0;
|
|
37
|
+
border-bottom: solid 0.5px #3a5877;
|
|
38
|
+
}
|
|
39
|
+
.do-info-title {
|
|
40
|
+
grid-column: span 3;
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
color: #3a5877;
|
|
44
|
+
}
|
|
45
|
+
.do-info-description {
|
|
46
|
+
grid-column: span 9;
|
|
47
|
+
font-size: 12px;
|
|
48
|
+
}
|
|
49
|
+
.tab {
|
|
50
|
+
display: flex;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
color: #f3f2f7;
|
|
53
|
+
background-color: #007e7f;
|
|
54
|
+
padding: 10px;
|
|
55
|
+
}
|
|
56
|
+
.content {
|
|
57
|
+
display: block;
|
|
58
|
+
flex: 1;
|
|
59
|
+
overflow-y: auto;
|
|
60
|
+
}
|
|
61
|
+
.text-14 {
|
|
62
|
+
font-size: 14px !important;
|
|
63
|
+
line-height: 1.5 !important;
|
|
64
|
+
}
|
|
65
|
+
.font-bold {
|
|
66
|
+
font-weight: bold !important;
|
|
67
|
+
}
|
|
68
|
+
.button-container {
|
|
69
|
+
position: absolute;
|
|
70
|
+
bottom: 12px;
|
|
71
|
+
right: 12px;
|
|
72
|
+
display: flex;
|
|
73
|
+
gap: 8px;
|
|
74
|
+
}
|
|
75
|
+
[danger] {
|
|
76
|
+
background: var(--mdc-danger-button-primary-color);
|
|
77
|
+
border-radius: 4px;
|
|
78
|
+
}
|
|
79
|
+
[outlined] {
|
|
80
|
+
background: var(--main-section-background-color);
|
|
81
|
+
}
|
|
82
|
+
.color-white {
|
|
83
|
+
color: var(--main-section-background-color);
|
|
84
|
+
}
|
|
85
|
+
`
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
get deliveryInfoConfig() {
|
|
90
|
+
return {
|
|
91
|
+
columnLeft: {
|
|
92
|
+
size: 8,
|
|
93
|
+
fields: [
|
|
94
|
+
{
|
|
95
|
+
type: 'row',
|
|
96
|
+
content: [
|
|
97
|
+
{
|
|
98
|
+
header: 'Product Name',
|
|
99
|
+
field: 'product.name',
|
|
100
|
+
type: 'string',
|
|
101
|
+
style: '-webkit-line-clamp: 2;'
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{ type: 'row', content: [{ header: 'SKU No.', field: 'product.sku', type: 'string' }] },
|
|
106
|
+
{
|
|
107
|
+
type: 'row',
|
|
108
|
+
content: [
|
|
109
|
+
{ header: 'Exp Date', field: 'expirationDate', type: 'string' },
|
|
110
|
+
{ header: 'Batch No', field: 'batchId', type: 'string' }
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: 'row',
|
|
115
|
+
content: [
|
|
116
|
+
{ header: 'Packing Size', field: 'packingSize', type: 'string' },
|
|
117
|
+
{ header: 'Packing Type', field: 'packingType', type: 'string' }
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
columnRight: {
|
|
123
|
+
size: 4,
|
|
124
|
+
fields: [
|
|
125
|
+
{
|
|
126
|
+
type: 'valueBox',
|
|
127
|
+
content: { header: 'Qty.', field: 'sortedQty', type: 'string' }
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
render() {
|
|
135
|
+
return html`
|
|
136
|
+
<!-- Header Form Section -->
|
|
137
|
+
<div class="do-info">
|
|
138
|
+
<label class="do-info-title">Name</label>
|
|
139
|
+
<label class="do-info-description">: ${this._doNo}</label>
|
|
140
|
+
|
|
141
|
+
<label class="do-info-title">Truck No</label>
|
|
142
|
+
<label class="do-info-description">: ${this._truckNo}</label>
|
|
143
|
+
</div>
|
|
144
|
+
<!-- Header Form Section End -->
|
|
145
|
+
|
|
146
|
+
<!-- Tab Info Section -->
|
|
147
|
+
<div class="tab text-center">
|
|
148
|
+
<label class="text-14 font-bold">Total SKU: ${this._getTotalSku()}</label>
|
|
149
|
+
</div>
|
|
150
|
+
<!-- Tab Info Section End -->
|
|
151
|
+
|
|
152
|
+
<!-- Content Section -->
|
|
153
|
+
<div class="content">
|
|
154
|
+
<product-list-view .config=${this.deliveryInfoConfig} .data=${this.data?.orderInventories}></product-list-view>
|
|
155
|
+
</div>
|
|
156
|
+
<!-- Content Section End -->
|
|
157
|
+
|
|
158
|
+
<div class="button-container">
|
|
159
|
+
<mwc-button danger @click=${e => this.undoLoad(e)}
|
|
160
|
+
><label class="color-white">${i18next.t('button.undo')}</label></mwc-button
|
|
161
|
+
>
|
|
162
|
+
<mwc-button outlined @click=${e => this.closePopup(e)}>${i18next.t('button.back')}</mwc-button>
|
|
163
|
+
</div>
|
|
164
|
+
`
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async undoLoad() {
|
|
168
|
+
try {
|
|
169
|
+
const result = await CustomAlert({
|
|
170
|
+
title: i18next.t('title.are_you_sure'),
|
|
171
|
+
text: i18next.t('text.proceed_undo_loading'),
|
|
172
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
173
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
if (!result.value) return
|
|
177
|
+
|
|
178
|
+
const response = await client.mutate({
|
|
179
|
+
mutation: gql`
|
|
180
|
+
mutation undoLoad($doId: String!) {
|
|
181
|
+
undoLoad(doId: $doId)
|
|
182
|
+
}
|
|
183
|
+
`,
|
|
184
|
+
variables: { doId: this.data.id }
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
if(!response.error) {
|
|
188
|
+
this.dispatchEvent(new CustomEvent('undo', { detail: { doId: this.data.id } }))
|
|
189
|
+
history.back()
|
|
190
|
+
}
|
|
191
|
+
} catch (e) {
|
|
192
|
+
showToast(e)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
_getTotalSku() {
|
|
197
|
+
return this.data.orderInventories?.length || 0
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
closePopup() {
|
|
201
|
+
history.back()
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
window.customElements.define('delivery-order-info', DeliveryOrderInfo)
|