@things-factory/operato-wms 4.0.24 → 4.0.25
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/adjustment/transfer-inventory.js +32 -6
- package/client/pages/bulk-operation/bulk-operation.js +189 -64
- package/client/pages/bulk-operation/validate-gan-popup.js +391 -0
- package/client/pages/bulk-operation/validate-ro-popup.js +52 -22
- package/client/pages/components/popup-unloading.js +47 -34
- package/client/pages/components/select-product-popup.js +74 -27
- package/client/pages/components/worksheet-information-popup.js +100 -0
- package/client/pages/inbound/putaway-product.js +184 -231
- package/client/pages/inbound/undo-unload-popup.js +295 -0
- package/client/pages/inbound/unload-product.js +229 -567
- package/client/pages/inbound/unloaded-inventories-popup.js +129 -0
- package/client/pages/inbound/worksheet-unloading.js +15 -11
- package/client/pages/inventory/inventory-adjustment.js +9 -10
- package/client/pages/master/product/product-list.js +1 -1
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +409 -21
- package/client/pages/order/arrival-notice/create-arrival-notice.js +89 -13
- package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +90 -10
- package/client/pages/order/arrival-notice/edit-product-popup.js +2 -2
- package/client/pages/order/release-order/b2b/b2b-order-list.js +78 -2
- package/client/pages/order/release-order/b2b/b2b-order-requests.js +32 -16
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +49 -5
- package/client/pages/order/release-order/batch-generate-single-picking-worksheet-popup.js +314 -0
- package/client/pages/order/release-order/batch-picking-popup.js +19 -2
- package/client/pages/order/release-order/create-release-order.js +194 -89
- package/client/pages/order/release-order/release-order-detail.js +390 -107
- package/client/pages/order/return-order/create-return-order.js +3 -3
- package/client/pages/order/transport-order/create-delivery-order.js +1 -1
- package/client/pages/order/transport-order/delivery-order-list.js +1 -1
- package/client/pages/outbound/packing-product.js +111 -236
- package/client/pages/outbound/picking-product.js +287 -380
- package/client/pages/outbound/sorting-product.js +66 -63
- package/client/pages/outbound/worksheet-loading.js +7 -3
- package/client/pages/outbound/worksheet-packing.js +3 -3
- package/client/pages/outbound/worksheet-picking.js +22 -18
- package/client/pages/vas/print-product-label.js +17 -9
- package/dist-server/graphql/resolvers/reports/product-label-report.js +1 -0
- package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -1
- package/package.json +65 -65
- package/server/graphql/resolvers/reports/product-label-report.ts +1 -0
- package/translations/en.json +31 -2
- package/translations/ko.json +32 -3
- package/translations/ms.json +32 -3
- package/translations/zh.json +32 -3
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import '@things-factory/grist-ui'
|
|
2
|
+
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
3
|
+
import { openPopup } from '@things-factory/layout-base'
|
|
4
|
+
import { client, CustomAlert } from '@things-factory/shell'
|
|
5
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
6
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
7
|
+
import { css, html, LitElement } from 'lit-element'
|
|
8
|
+
import gql from 'graphql-tag'
|
|
9
|
+
import { ScrollbarStyles } from '@things-factory/styles'
|
|
10
|
+
import { ORDER_STATUS } from '../../constants'
|
|
11
|
+
import '@things-factory/biz-ui'
|
|
12
|
+
|
|
13
|
+
class BatchGenerateSinglePickingWorksheetPopup extends localize(i18next)(LitElement) {
|
|
14
|
+
static get properties() {
|
|
15
|
+
return {
|
|
16
|
+
_searchFields: Array,
|
|
17
|
+
config: Object,
|
|
18
|
+
data: Object
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static get styles() {
|
|
23
|
+
return [
|
|
24
|
+
MultiColumnFormStyles,
|
|
25
|
+
ScrollbarStyles,
|
|
26
|
+
css`
|
|
27
|
+
:host {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
background-color: white;
|
|
32
|
+
padding: var(--padding-default);
|
|
33
|
+
}
|
|
34
|
+
search-form {
|
|
35
|
+
overflow: visible;
|
|
36
|
+
}
|
|
37
|
+
.grist {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
flex: 1;
|
|
41
|
+
overflow-y: auto;
|
|
42
|
+
}
|
|
43
|
+
.grist-container {
|
|
44
|
+
overflow-y: hidden;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex: 1;
|
|
47
|
+
}
|
|
48
|
+
data-grist {
|
|
49
|
+
overflow-y: hidden;
|
|
50
|
+
flex: 1;
|
|
51
|
+
}
|
|
52
|
+
h2 {
|
|
53
|
+
padding: var(--subtitle-padding);
|
|
54
|
+
font: var(--subtitle-font);
|
|
55
|
+
color: var(--subtitle-text-color);
|
|
56
|
+
border-bottom: var(--subtitle-border-bottom);
|
|
57
|
+
}
|
|
58
|
+
.grist h2 {
|
|
59
|
+
font: var(--grist-title-font);
|
|
60
|
+
}
|
|
61
|
+
.button-container {
|
|
62
|
+
padding: var(--button-container-padding);
|
|
63
|
+
margin: var(--button-container-margin);
|
|
64
|
+
text-align: var(--button-container-align);
|
|
65
|
+
background-color: var(--button-container-background);
|
|
66
|
+
height: var(--button-container-height);
|
|
67
|
+
}
|
|
68
|
+
`
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
submit() {
|
|
73
|
+
this.dispatchEvent(new CustomEvent('submit'))
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
render() {
|
|
77
|
+
return html`
|
|
78
|
+
<search-form .fields=${this._searchFields} @submit=${() => this.releaseOrderGrist.fetch()}></search-form>
|
|
79
|
+
|
|
80
|
+
<div class="grist-container">
|
|
81
|
+
<div class="grist">
|
|
82
|
+
<h2>${i18next.t('title.release_order')}</h2>
|
|
83
|
+
<data-grist
|
|
84
|
+
id="releaseOrder"
|
|
85
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
86
|
+
.config=${this.roConfig}
|
|
87
|
+
.fetchHandler="${this.fetchReadyToPickOrders.bind(this)}"
|
|
88
|
+
></data-grist>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div class="button-container">
|
|
93
|
+
<mwc-button
|
|
94
|
+
@click="${this.generatePickingWorksheet.bind(this)}"
|
|
95
|
+
raised
|
|
96
|
+
label="${i18next.t('button.generate_worksheet')}"
|
|
97
|
+
></mwc-button>
|
|
98
|
+
</div>
|
|
99
|
+
`
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async firstUpdated() {
|
|
103
|
+
const partners = await this._fetchPartners()
|
|
104
|
+
this._searchFields = [
|
|
105
|
+
{
|
|
106
|
+
label: i18next.t('field.company'),
|
|
107
|
+
name: 'bizplace',
|
|
108
|
+
type: 'select',
|
|
109
|
+
options: [
|
|
110
|
+
{ value: '' },
|
|
111
|
+
...partners
|
|
112
|
+
.map(partner => {
|
|
113
|
+
return {
|
|
114
|
+
name: `${partner.name} ${partner.description ? `(${partner.description})` : ''}`,
|
|
115
|
+
value: partner.id
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
.sort(this._compareValues('name', 'asc'))
|
|
119
|
+
],
|
|
120
|
+
props: { searchOper: 'eq' }
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: i18next.t('field.release_date'),
|
|
124
|
+
name: 'releaseDate',
|
|
125
|
+
type: 'date',
|
|
126
|
+
props: { searchOper: 'lte' }
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
this.roConfig = {
|
|
131
|
+
pagination: { pages: [100, 200, 300, 500], limit: 200 },
|
|
132
|
+
rows: {
|
|
133
|
+
selectable: { multiple: true },
|
|
134
|
+
appendable: false
|
|
135
|
+
},
|
|
136
|
+
list: { fields: ['name', 'refNo', 'bizplace', 'releaseDate'] },
|
|
137
|
+
columns: [
|
|
138
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
139
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
140
|
+
{
|
|
141
|
+
type: 'string',
|
|
142
|
+
name: 'name',
|
|
143
|
+
header: i18next.t('field.release_good_no'),
|
|
144
|
+
width: 150
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
type: 'string',
|
|
148
|
+
name: 'refNo',
|
|
149
|
+
header: i18next.t('field.ref_no'),
|
|
150
|
+
width: 130
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
type: 'object',
|
|
154
|
+
name: 'bizplace',
|
|
155
|
+
header: i18next.t('field.company'),
|
|
156
|
+
width: 200
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: 'date',
|
|
160
|
+
name: 'releaseDate',
|
|
161
|
+
header: i18next.t('field.release_date'),
|
|
162
|
+
sortable: true,
|
|
163
|
+
width: 150
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
get searchForm() {
|
|
170
|
+
return this.renderRoot.querySelector('search-form')
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
get releaseOrderGrist() {
|
|
174
|
+
return this.shadowRoot.querySelector('data-grist#releaseOrder')
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
get orderInventoryGrist() {
|
|
178
|
+
return this.shadowRoot.querySelector('data-grist#orderInventory')
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
async _fetchPartners() {
|
|
182
|
+
const response = await client.query({
|
|
183
|
+
query: gql`
|
|
184
|
+
query partnersBizplaces($filters: [Filter!]) {
|
|
185
|
+
partnersBizplaces(filters: $filters) {
|
|
186
|
+
items {
|
|
187
|
+
id
|
|
188
|
+
name
|
|
189
|
+
description
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
`,
|
|
194
|
+
variables: { filters: [] }
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
if (!response.errors) {
|
|
198
|
+
return response.data.partnersBizplaces.items
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
async fetchReadyToPickOrders({ page, limit, sorters = [{ name: 'releaseDate' }] }) {
|
|
203
|
+
// if (!this.partnerBizplace) return { total: 0, records: [] }
|
|
204
|
+
|
|
205
|
+
const filters = [
|
|
206
|
+
...(await this.searchForm.getQueryFilters()).filter(x => x.name != 'partnerBizplace'),
|
|
207
|
+
{ name: 'status', operator: 'eq', value: ORDER_STATUS.PENDING_WORKSHEET.value },
|
|
208
|
+
{ name: 'crossDocking', operator: 'eq', value: false }
|
|
209
|
+
]
|
|
210
|
+
|
|
211
|
+
if (this.partnerBizplace) {
|
|
212
|
+
filters.push({ name: 'bizplaceId', operator: 'eq', value: this.partnerBizplace.id })
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const pagination = { page, limit }
|
|
216
|
+
const sortings = sorters
|
|
217
|
+
|
|
218
|
+
const response = await client.query({
|
|
219
|
+
query: gql`
|
|
220
|
+
query releaseGoodRequests($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
221
|
+
releaseGoodRequests(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
222
|
+
items {
|
|
223
|
+
id
|
|
224
|
+
name
|
|
225
|
+
refNo
|
|
226
|
+
releaseDate
|
|
227
|
+
type
|
|
228
|
+
bizplace {
|
|
229
|
+
id
|
|
230
|
+
name
|
|
231
|
+
description
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
total
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
`,
|
|
238
|
+
variables: { filters, pagination, sortings }
|
|
239
|
+
})
|
|
240
|
+
if (!response.errors) {
|
|
241
|
+
return {
|
|
242
|
+
total: response.data.releaseGoodRequests.total || 0,
|
|
243
|
+
records: response.data.releaseGoodRequests.items || []
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
async generatePickingWorksheet() {
|
|
249
|
+
try {
|
|
250
|
+
let releaseGoodNos = []
|
|
251
|
+
releaseGoodNos = this.releaseOrderGrist.selected.map(record => record.name)
|
|
252
|
+
|
|
253
|
+
if (releaseGoodNos.length <= 0) throw new Error('Please select one or more order to generate worksheet')
|
|
254
|
+
|
|
255
|
+
let result = await CustomAlert({
|
|
256
|
+
title: i18next.t('title.are_you_sure'),
|
|
257
|
+
text: i18next.t('text.generate_worksheet'),
|
|
258
|
+
confirmButton: { text: i18next.t('button.submit') },
|
|
259
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
if (!result.value) return
|
|
263
|
+
|
|
264
|
+
const response = await client.mutate({
|
|
265
|
+
mutation: gql`
|
|
266
|
+
mutation generateMultipleReleaseGoodWorksheet($releaseGoodNos: [String!]) {
|
|
267
|
+
generateMultipleReleaseGoodWorksheet(releaseGoodNos: $releaseGoodNos)
|
|
268
|
+
}
|
|
269
|
+
`,
|
|
270
|
+
variables: {
|
|
271
|
+
releaseGoodNos
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
if (!response.errors) {
|
|
276
|
+
this.dispatchEvent(new CustomEvent('generated'))
|
|
277
|
+
history.back()
|
|
278
|
+
}
|
|
279
|
+
} catch (e) {
|
|
280
|
+
this._showToast(e)
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
_compareValues(key, order = 'asc') {
|
|
285
|
+
return function innerSort(a, b) {
|
|
286
|
+
if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
|
|
287
|
+
return 0
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
const varA = typeof a[key] === 'string' ? a[key].toUpperCase() : a[key]
|
|
291
|
+
const varB = typeof b[key] === 'string' ? b[key].toUpperCase() : b[key]
|
|
292
|
+
|
|
293
|
+
let comparison = 0
|
|
294
|
+
if (varA > varB) {
|
|
295
|
+
comparison = 1
|
|
296
|
+
} else if (varA < varB) {
|
|
297
|
+
comparison = -1
|
|
298
|
+
}
|
|
299
|
+
return order === 'desc' ? comparison * -1 : comparison
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
_showToast({ type, message }) {
|
|
304
|
+
document.dispatchEvent(
|
|
305
|
+
new CustomEvent('notify', {
|
|
306
|
+
detail: {
|
|
307
|
+
type,
|
|
308
|
+
message
|
|
309
|
+
}
|
|
310
|
+
})
|
|
311
|
+
)
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
window.customElements.define('batch-generate-single-picking-worksheet-popup', BatchGenerateSinglePickingWorksheetPopup)
|
|
@@ -7,7 +7,7 @@ import { isMobileDevice } from '@things-factory/utils'
|
|
|
7
7
|
import { css, html, LitElement } from 'lit-element'
|
|
8
8
|
import gql from 'graphql-tag'
|
|
9
9
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
10
|
-
import { ORDER_STATUS } from '../../constants'
|
|
10
|
+
import { ORDER_STATUS, RO_TYPES } from '../../constants'
|
|
11
11
|
import '@things-factory/biz-ui'
|
|
12
12
|
|
|
13
13
|
class BatchPickingPopup extends localize(i18next)(LitElement) {
|
|
@@ -146,6 +146,16 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
|
|
|
146
146
|
name: 'releaseDate',
|
|
147
147
|
type: 'date',
|
|
148
148
|
props: { searchOper: 'lte' }
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
label: i18next.t('field.type'),
|
|
152
|
+
name: 'type',
|
|
153
|
+
type: 'select',
|
|
154
|
+
options: Object.keys(RO_TYPES).map(map => {
|
|
155
|
+
debugger
|
|
156
|
+
return { name: RO_TYPES[map].name, value: RO_TYPES[map].value }
|
|
157
|
+
}),
|
|
158
|
+
props: { searchOper: 'eq' }
|
|
149
159
|
}
|
|
150
160
|
]
|
|
151
161
|
|
|
@@ -165,6 +175,12 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
|
|
|
165
175
|
header: i18next.t('field.release_good_no'),
|
|
166
176
|
width: 150
|
|
167
177
|
},
|
|
178
|
+
{
|
|
179
|
+
type: 'string',
|
|
180
|
+
name: 'type',
|
|
181
|
+
header: i18next.t('field.type'),
|
|
182
|
+
width: 100
|
|
183
|
+
},
|
|
168
184
|
{
|
|
169
185
|
type: 'string',
|
|
170
186
|
name: 'refNo',
|
|
@@ -288,6 +304,7 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
|
|
|
288
304
|
name
|
|
289
305
|
refNo
|
|
290
306
|
releaseDate
|
|
307
|
+
type
|
|
291
308
|
bizplace {
|
|
292
309
|
id
|
|
293
310
|
name
|
|
@@ -323,7 +340,7 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
|
|
|
323
340
|
|
|
324
341
|
const response = await client.query({
|
|
325
342
|
query: gql`
|
|
326
|
-
query mergedProductOrderInventories($filters: [Filter
|
|
343
|
+
query mergedProductOrderInventories($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
327
344
|
mergedProductOrderInventories(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
328
345
|
items {
|
|
329
346
|
productName
|