@things-factory/operato-wms 4.3.593 → 4.3.596
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/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/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/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/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/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/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 +30 -1
- package/translations/ko.json +27 -0
- package/translations/ms.json +29 -2
- package/translations/zh.json +27 -0
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
import '@things-factory/barcode-ui'
|
|
2
|
+
import '@things-factory/grist-ui'
|
|
3
|
+
|
|
4
|
+
import './worksheet-info'
|
|
5
|
+
import './scan-bin-no-popup'
|
|
6
|
+
import './report-issue-popup'
|
|
7
|
+
|
|
8
|
+
import { gql } from 'graphql-tag'
|
|
9
|
+
import { css, html, LitElement } from 'lit-element'
|
|
10
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
11
|
+
import { openPopup } from '@things-factory/layout-base'
|
|
12
|
+
import { client, CustomAlert, gqlContext, PageView, store } from '@things-factory/shell'
|
|
13
|
+
import { CommonButtonStyles } from '@things-factory/styles'
|
|
14
|
+
|
|
15
|
+
import { showToast } from '../../../util'
|
|
16
|
+
import { BATCH_PICKING, PICKING, ZONE_PICKING, ORDER_INVENTORY_STATUS } from '../../constants'
|
|
17
|
+
|
|
18
|
+
const PICKING_TYPES = { PICKING, BATCH_PICKING, ZONE_PICKING }
|
|
19
|
+
|
|
20
|
+
export class PickingExecutionBase extends LitElement {
|
|
21
|
+
static get properties() {
|
|
22
|
+
return {
|
|
23
|
+
parent: Object,
|
|
24
|
+
state: Object,
|
|
25
|
+
data: Object,
|
|
26
|
+
pickingData: Object,
|
|
27
|
+
pickedData: Object,
|
|
28
|
+
_executionData: Object
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get backButton() {
|
|
33
|
+
return {
|
|
34
|
+
title: i18next.t('button.back'),
|
|
35
|
+
action: () => {
|
|
36
|
+
resetContext(this.parent)
|
|
37
|
+
},
|
|
38
|
+
...CommonButtonStyles.back
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get completeButton() {
|
|
43
|
+
return {
|
|
44
|
+
title: i18next.t('button.complete'),
|
|
45
|
+
action: async () => {
|
|
46
|
+
await this.completePicking()
|
|
47
|
+
resetContext(this.parent)
|
|
48
|
+
},
|
|
49
|
+
...CommonButtonStyles.submit
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get partialButton() {
|
|
54
|
+
return {
|
|
55
|
+
title: i18next.t('button.partial_pick'),
|
|
56
|
+
action: async () => {
|
|
57
|
+
await this.partialPicking()
|
|
58
|
+
},
|
|
59
|
+
...CommonButtonStyles.submit
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get binNoInput() {
|
|
64
|
+
return this.shadowRoot?.querySelector('barcode-scanable-input[name=binNo]')?.shadowRoot.querySelector('input')
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
get cartonIdInput() {
|
|
68
|
+
return this.shadowRoot?.querySelector('barcode-scanable-input[name=cartonId]')?.shadowRoot.querySelector('input')
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get productBarcodeInput() {
|
|
72
|
+
return this.shadowRoot
|
|
73
|
+
?.querySelector('barcode-scanable-input[name=productBarcode]')
|
|
74
|
+
?.shadowRoot.querySelector('input')
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get qtyInput() {
|
|
78
|
+
return this.shadowRoot?.querySelector('barcode-scanable-input[name=quantity]')?.shadowRoot.querySelector('input')
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
_focusOnCartonNoInput() {
|
|
82
|
+
if (this.cartonInput) {
|
|
83
|
+
setTimeout(() => this.cartonInput.focus(), 50)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
_focusOnProductBarcodeInput() {
|
|
88
|
+
if (this.productBarcodeInput) {
|
|
89
|
+
setTimeout(() => this.productBarcodeInput.focus(), 50)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
_focusOnQtyInput() {
|
|
94
|
+
if (this.qtyInput) {
|
|
95
|
+
setTimeout(() => this.qtyInput.focus(), 50)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async openTab(e, tabName) {
|
|
100
|
+
this.state = { ...this.state, activeTab: tabName }
|
|
101
|
+
|
|
102
|
+
let newData = await this.fetchWorksheet(
|
|
103
|
+
this._executionData.worksheetNo,
|
|
104
|
+
this.parent._context.locationSortingRules,
|
|
105
|
+
tabName
|
|
106
|
+
)
|
|
107
|
+
if (tabName == 'PICKING') {
|
|
108
|
+
this.pickingData = newData.worksheetDetailInfos
|
|
109
|
+
} else if (tabName == 'PICKED') {
|
|
110
|
+
this.pickedData = newData.worksheetDetailInfos
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
resetView() {
|
|
115
|
+
this._executionData = {
|
|
116
|
+
...this._executionData,
|
|
117
|
+
worksheetNo: this.data.worksheetInfo.name,
|
|
118
|
+
worksheetId: this.data.worksheetInfo.id
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
this.pickingData = this.data?.worksheetDetailInfos.filter(item => item.pickedQty != item.releaseQty)
|
|
122
|
+
this.pickedData = this.data?.worksheetDetailInfos.filter(item => item.pickedQty > 0)
|
|
123
|
+
|
|
124
|
+
this.state = { ...this.state, activeTab: 'PICKING' }
|
|
125
|
+
this.getButtons(this.data)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
getButtons(data) {
|
|
129
|
+
let pickingButton = null
|
|
130
|
+
|
|
131
|
+
if (this.state.activeTab == 'PICKED') {
|
|
132
|
+
if (data?.completable == 'true') {
|
|
133
|
+
pickingButton = this.completeButton
|
|
134
|
+
} else if (data?.completable == 'partial') {
|
|
135
|
+
pickingButton = this.partialButton
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
this.parent.configContext([pickingButton, this.backButton])
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_getTotalSku() {
|
|
143
|
+
let activeTab = this.state?.activeTab
|
|
144
|
+
let total = 0
|
|
145
|
+
if (activeTab == 'PICKING') {
|
|
146
|
+
let uniqueSku = new Set(this.pickingData?.map(item => item.inventoryId))
|
|
147
|
+
total = uniqueSku.size
|
|
148
|
+
} else {
|
|
149
|
+
//need to add filter incomplete sku only
|
|
150
|
+
let uniqueSku = new Set(this.pickedData?.map(item => item.inventoryId))
|
|
151
|
+
total = uniqueSku.size
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return total
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
async showWorksheetInfo(data) {
|
|
158
|
+
openPopup(html` <worksheet-info .data="${data.issues}" .worksheet="${data.worksheetInfo}"></worksheet-info> `, {
|
|
159
|
+
backdrop: true,
|
|
160
|
+
size: 'large',
|
|
161
|
+
title: i18next.t('title.worksheet_info')
|
|
162
|
+
})
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async binNoScanHandler(e) {
|
|
166
|
+
if (e.keyCode === 13) {
|
|
167
|
+
e.preventDefault()
|
|
168
|
+
let binNo = await this.validateBinNo(this.binNoInput.value)
|
|
169
|
+
if (binNo) this._executionData = { ...this._executionData, binNo: binNo }
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async changeBinNoPopup(e) {
|
|
174
|
+
let popup = openPopup(
|
|
175
|
+
html`<scan-bin-no
|
|
176
|
+
@updateBinNo="${e => {
|
|
177
|
+
this._executionData = { ...this._executionData, binNo: e.detail }
|
|
178
|
+
popup.close()
|
|
179
|
+
}}"
|
|
180
|
+
></scan-bin-no> `,
|
|
181
|
+
{
|
|
182
|
+
closable: false,
|
|
183
|
+
backdrop: false,
|
|
184
|
+
size: 'small'
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async validateBinNo(binNo) {
|
|
190
|
+
if (!binNo) return
|
|
191
|
+
|
|
192
|
+
const response = await client.query({
|
|
193
|
+
query: gql`
|
|
194
|
+
query binLocation($name: String!) {
|
|
195
|
+
binLocation(name: $name) {
|
|
196
|
+
id
|
|
197
|
+
name
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
`,
|
|
201
|
+
variables: { name: binNo }
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
if (!response.errors) {
|
|
205
|
+
return response.data.binLocation.name
|
|
206
|
+
} else {
|
|
207
|
+
this.binNoInput.value = ''
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
async openReportIssuePopup(palletId) {
|
|
212
|
+
let popup = openPopup(
|
|
213
|
+
html`
|
|
214
|
+
<report-issue-popup
|
|
215
|
+
._palletId="${palletId}"
|
|
216
|
+
@submit="${async e => {
|
|
217
|
+
popup.close()
|
|
218
|
+
let newData = await this.fetchWorksheet(
|
|
219
|
+
this._executionData.worksheetNo,
|
|
220
|
+
this.parent._context.locationSortingRules,
|
|
221
|
+
this.state.activeTab
|
|
222
|
+
)
|
|
223
|
+
if (this.data) this.data.issues = newData.issues
|
|
224
|
+
this.pickingData = newData.worksheetDetailInfos
|
|
225
|
+
}
|
|
226
|
+
}"
|
|
227
|
+
></report-issue-popup>
|
|
228
|
+
`,
|
|
229
|
+
{
|
|
230
|
+
backdrop: true,
|
|
231
|
+
size: 'medium',
|
|
232
|
+
title: i18next.t('title.report_issue')
|
|
233
|
+
}
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async picking(e) {
|
|
238
|
+
if (e.keyCode !== 13) return
|
|
239
|
+
e.preventDefault()
|
|
240
|
+
try {
|
|
241
|
+
await this.validatePicking()
|
|
242
|
+
const response = await client.mutate({
|
|
243
|
+
mutation: gql`
|
|
244
|
+
mutation scanProductZonePicking(
|
|
245
|
+
$worksheetId: String!
|
|
246
|
+
$cartonId: String!
|
|
247
|
+
$productBarcode: String!
|
|
248
|
+
$binNo: String!
|
|
249
|
+
$pickingQty: Int
|
|
250
|
+
) {
|
|
251
|
+
scanProductZonePicking(
|
|
252
|
+
worksheetId: $worksheetId
|
|
253
|
+
cartonId: $cartonId
|
|
254
|
+
productBarcode: $productBarcode
|
|
255
|
+
binNo: $binNo
|
|
256
|
+
pickingQty: $pickingQty
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
`,
|
|
260
|
+
variables: {
|
|
261
|
+
worksheetId: this._executionData.worksheetId,
|
|
262
|
+
productBarcode: this.productBarcodeInput.value.trim(),
|
|
263
|
+
cartonId: this.cartonIdInput.value.trim(),
|
|
264
|
+
binNo: this._executionData.binNo,
|
|
265
|
+
pickingQty: this.qtyInput?.value ? parseInt(this.qtyInput.value) : 1
|
|
266
|
+
}
|
|
267
|
+
})
|
|
268
|
+
|
|
269
|
+
if (!response.error) {
|
|
270
|
+
//reset input value
|
|
271
|
+
this.productBarcodeInput.value = ''
|
|
272
|
+
this.cartonIdInput.value = ''
|
|
273
|
+
this.qtyInput.value = ''
|
|
274
|
+
|
|
275
|
+
//fetch data
|
|
276
|
+
let newData = await this.fetchWorksheet(
|
|
277
|
+
this._executionData.worksheetNo,
|
|
278
|
+
this.parent._context.locationSortingRules,
|
|
279
|
+
'PICKING'
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
this.pickingData = newData.worksheetDetailInfos
|
|
283
|
+
}
|
|
284
|
+
} catch (e) {
|
|
285
|
+
showToast(e)
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
async validatePicking() {
|
|
290
|
+
if (!this.cartonIdInput.value) {
|
|
291
|
+
this._focusOnCartonNoInput()
|
|
292
|
+
throw new Error(i18next.t('text.carton_id_is_empty'))
|
|
293
|
+
}
|
|
294
|
+
if (!this.productBarcodeInput.value) {
|
|
295
|
+
this._focusOnProductBarcodeInput()
|
|
296
|
+
throw new Error(i18next.t('text.empty_product_barcode'))
|
|
297
|
+
}
|
|
298
|
+
if (!this.qtyInput.value || this.qtyInput.value < 0) {
|
|
299
|
+
this._focusOnQtyInput()
|
|
300
|
+
throw new Error(i18next.t('text.invalid_qty'))
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
async completePicking() {
|
|
305
|
+
try {
|
|
306
|
+
const result = await CustomAlert({
|
|
307
|
+
title: i18next.t('title.are_you_sure'),
|
|
308
|
+
text: i18next.t('text.complete_picking'),
|
|
309
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
310
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
311
|
+
})
|
|
312
|
+
|
|
313
|
+
if (!result.value) return
|
|
314
|
+
|
|
315
|
+
const response = await client.mutate({
|
|
316
|
+
mutation: gql`
|
|
317
|
+
mutation completeZonePicking($worksheetId: String!) {
|
|
318
|
+
completeZonePicking(worksheetId: $worksheetId)
|
|
319
|
+
}
|
|
320
|
+
`,
|
|
321
|
+
variables: {
|
|
322
|
+
worksheetId: this._executionData.worksheetId
|
|
323
|
+
}
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
if (!response.errors) {
|
|
327
|
+
showToast({ type: 'success', message: i18next.t('text.picking_is_completed') })
|
|
328
|
+
}
|
|
329
|
+
} catch (e) {
|
|
330
|
+
showToast(e)
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
async partialPicking() {
|
|
335
|
+
try {
|
|
336
|
+
const result = await CustomAlert({
|
|
337
|
+
title: i18next.t('title.are_you_sure'),
|
|
338
|
+
text: i18next.t('text.partial_picking'),
|
|
339
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
340
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
341
|
+
})
|
|
342
|
+
|
|
343
|
+
if (!result.value) return
|
|
344
|
+
|
|
345
|
+
const response = await client.mutate({
|
|
346
|
+
mutation: gql`
|
|
347
|
+
mutation completeZonePickingPartially($worksheetId: String!) {
|
|
348
|
+
completeZonePickingPartially(worksheetId: $worksheetId)
|
|
349
|
+
}
|
|
350
|
+
`,
|
|
351
|
+
variables: {
|
|
352
|
+
worksheetId: this._executionData.worksheetId
|
|
353
|
+
}
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
if (!response.errors) {
|
|
357
|
+
showToast({ type: 'success', message: i18next.t('text.picking_completed_partially') })
|
|
358
|
+
}
|
|
359
|
+
} catch (e) {
|
|
360
|
+
showToast(e)
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
async fetchWorksheet(worksheetNo, locationSortingRules, tab) {
|
|
365
|
+
if (!worksheetNo) return
|
|
366
|
+
|
|
367
|
+
try {
|
|
368
|
+
let response = await client.query({
|
|
369
|
+
query: gql`
|
|
370
|
+
query zonePickingWorksheet($name: String!, $locationSortingRules: [Sorting!], $filter: String) {
|
|
371
|
+
zonePickingWorksheet(name: $name, locationSortingRules: $locationSortingRules, filter: $filter) {
|
|
372
|
+
groupedOrderInventories {
|
|
373
|
+
inventory {
|
|
374
|
+
id
|
|
375
|
+
palletId
|
|
376
|
+
cartonId
|
|
377
|
+
batchId
|
|
378
|
+
expirationDate
|
|
379
|
+
location {
|
|
380
|
+
name
|
|
381
|
+
description
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
product {
|
|
385
|
+
sku
|
|
386
|
+
name
|
|
387
|
+
description
|
|
388
|
+
}
|
|
389
|
+
releaseQty
|
|
390
|
+
pickedQty
|
|
391
|
+
status
|
|
392
|
+
packingType
|
|
393
|
+
packingSize
|
|
394
|
+
}
|
|
395
|
+
inventoryChanges {
|
|
396
|
+
id
|
|
397
|
+
inventory {
|
|
398
|
+
id
|
|
399
|
+
product {
|
|
400
|
+
name
|
|
401
|
+
sku
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
palletId
|
|
405
|
+
status
|
|
406
|
+
transactionType
|
|
407
|
+
details
|
|
408
|
+
}
|
|
409
|
+
completable
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
`,
|
|
413
|
+
variables: { name: worksheetNo, locationSortingRules: locationSortingRules, filter: tab }
|
|
414
|
+
})
|
|
415
|
+
|
|
416
|
+
if (!response.errors) {
|
|
417
|
+
let newData = await mapWorksheetData(response.data.zonePickingWorksheet)
|
|
418
|
+
this.getButtons(newData)
|
|
419
|
+
return newData
|
|
420
|
+
}
|
|
421
|
+
} catch (e) {
|
|
422
|
+
throw new Error(e.message)
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
async function mapWorksheetData(data) {
|
|
428
|
+
const worksheetDetailInfos = data.groupedOrderInventories.map(orderInv => ({
|
|
429
|
+
inventoryId: orderInv.inventory.id,
|
|
430
|
+
palletId: orderInv.inventory.palletId,
|
|
431
|
+
cartonId: orderInv.inventory.cartonId,
|
|
432
|
+
batchId: orderInv.inventory.batchId,
|
|
433
|
+
product: {
|
|
434
|
+
sku: orderInv.product.sku,
|
|
435
|
+
name: orderInv.product.name,
|
|
436
|
+
description: orderInv.product.description
|
|
437
|
+
},
|
|
438
|
+
qty: orderInv.pickedQty,
|
|
439
|
+
releaseQty: orderInv.releaseQty,
|
|
440
|
+
pickedQty: orderInv.pickedQty,
|
|
441
|
+
expirationDate: orderInv.inventory.expirationDate
|
|
442
|
+
? new Date(orderInv.inventory.expirationDate).toISOString().slice(0, 10).replace('-', '/').replace('-', '/')
|
|
443
|
+
: null,
|
|
444
|
+
status: orderInv.status,
|
|
445
|
+
packingType: orderInv.packingType,
|
|
446
|
+
packingSize: orderInv.packingSize,
|
|
447
|
+
location: {
|
|
448
|
+
name: orderInv.inventory.location.name,
|
|
449
|
+
description: orderInv.inventory.location.description
|
|
450
|
+
},
|
|
451
|
+
relatedOrderInv: {
|
|
452
|
+
id: orderInv.id,
|
|
453
|
+
batchId: orderInv.inventory.batchId,
|
|
454
|
+
packingType: orderInv.packingType,
|
|
455
|
+
product: {
|
|
456
|
+
sku: orderInv.product.sku,
|
|
457
|
+
name: orderInv.product.name,
|
|
458
|
+
description: orderInv.product.description
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}))
|
|
462
|
+
|
|
463
|
+
const issues = data.inventoryChanges.map(ic => {
|
|
464
|
+
return {
|
|
465
|
+
...ic,
|
|
466
|
+
inventoryId: ic.inventory.id
|
|
467
|
+
}
|
|
468
|
+
})
|
|
469
|
+
|
|
470
|
+
const completable = data.completable
|
|
471
|
+
|
|
472
|
+
return {
|
|
473
|
+
worksheetDetailInfos,
|
|
474
|
+
issues,
|
|
475
|
+
completable
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function resetContext(target) {
|
|
480
|
+
target._data = null
|
|
481
|
+
target.configContext()
|
|
482
|
+
}
|