@things-factory/operato-wms 5.0.0-alpha.2 → 5.0.0-alpha.22
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/inbound/serial-number-list-popup.js +342 -0
- package/client/pages/inbound/unload-product.js +220 -41
- package/client/pages/inbound/unloaded-inventories-popup.js +7 -0
- package/client/pages/inventory/non-loaded-inventory.js +297 -0
- package/client/pages/order/release-order/b2b/b2b-order-list.js +41 -18
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +40 -18
- package/client/pages/outbound/packing-product.js +88 -80
- package/client/pages/outbound/picking-product.js +61 -36
- package/client/pages/outbound/serial-number-popup.js +150 -64
- package/client/pages/report/inbound-serial-number-report.js +452 -0
- package/client/pages/report/outbound-order-details-report.js +64 -9
- package/client/pages/report/outbound-serial-number-report.js +467 -0
- package/client/route.js +11 -0
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +111 -0
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/index.js +3 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +53 -48
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +118 -0
- package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -0
- package/dist-server/graphql/types/reports/inbound-serial-number-report-list.js +14 -0
- package/dist-server/graphql/types/reports/inbound-serial-number-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/inbound-serial-number-report.js +23 -0
- package/dist-server/graphql/types/reports/inbound-serial-number-report.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +10 -0
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report.js +3 -0
- package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/types/reports/outbound-serial-number-report-list.js +14 -0
- package/dist-server/graphql/types/reports/outbound-serial-number-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/outbound-serial-number-report.js +25 -0
- package/dist-server/graphql/types/reports/outbound-serial-number-report.js.map +1 -0
- package/dist-server/migrations/1568858861188-SeedSetting.js +2 -1
- package/dist-server/migrations/1568858861188-SeedSetting.js.map +1 -1
- package/package.json +67 -66
- package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +128 -0
- package/server/graphql/resolvers/reports/index.ts +5 -0
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +54 -48
- package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +135 -0
- package/server/graphql/types/reports/inbound-serial-number-report-list.ts +8 -0
- package/server/graphql/types/reports/inbound-serial-number-report.ts +17 -0
- package/server/graphql/types/reports/index.ts +11 -0
- package/server/graphql/types/reports/outbound-order-details-report.ts +3 -0
- package/server/graphql/types/reports/outbound-serial-number-report-list.ts +8 -0
- package/server/graphql/types/reports/outbound-serial-number-report.ts +19 -0
- package/server/migrations/1568858861188-SeedSetting.ts +5 -2
- package/things-factory.config.js +12 -0
- package/translations/en.json +26 -6
- package/translations/ko.json +21 -2
- package/translations/ms.json +21 -2
- package/translations/zh.json +25 -6
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import '@things-factory/form-ui'
|
|
2
|
+
import '@things-factory/grist-ui'
|
|
3
|
+
import '../inventory/inventory-by-product-detail'
|
|
4
|
+
|
|
5
|
+
import gql from 'graphql-tag'
|
|
6
|
+
import { css, html } from 'lit-element'
|
|
7
|
+
import { connect } from 'pwa-helpers/connect-mixin'
|
|
8
|
+
|
|
9
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
10
|
+
import { client, gqlContext, PageView, store } from '@things-factory/shell'
|
|
11
|
+
import { flattenObject, isMobileDevice } from '@things-factory/utils'
|
|
12
|
+
|
|
13
|
+
class InboundSerialNumberReport extends connect(store)(localize(i18next)(PageView)) {
|
|
14
|
+
static get styles() {
|
|
15
|
+
return css`
|
|
16
|
+
:host {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
data-grist {
|
|
23
|
+
overflow-y: auto;
|
|
24
|
+
flex: 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.summary {
|
|
28
|
+
background-color: var(--main-section-background-color);
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
overflow-y: auto;
|
|
32
|
+
align-items: flex-end;
|
|
33
|
+
padding: var(--data-list-item-padding);
|
|
34
|
+
display: grid;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
color: #394e64;
|
|
37
|
+
grid-template-columns: repeat(2, 1fr);
|
|
38
|
+
grid-auto-rows: minmax(24px, auto);
|
|
39
|
+
}
|
|
40
|
+
`
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static get properties() {
|
|
44
|
+
return {
|
|
45
|
+
_searchFields: Object,
|
|
46
|
+
_config: Object,
|
|
47
|
+
_partners: Object,
|
|
48
|
+
_gristData: Object,
|
|
49
|
+
data: Object
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get context() {
|
|
54
|
+
return {
|
|
55
|
+
title: i18next.t('title.inbound_serial_number_report'),
|
|
56
|
+
printable: {
|
|
57
|
+
accept: ['preview'],
|
|
58
|
+
content: this
|
|
59
|
+
},
|
|
60
|
+
help: 'operato-wms/report/inbound-serial-number-report'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get dataGrist() {
|
|
65
|
+
return this.shadowRoot.querySelector('data-grist')
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get searchForm() {
|
|
69
|
+
return this.shadowRoot.querySelector('search-form')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get _bizplaceSelector() {
|
|
73
|
+
return this.searchForm.shadowRoot.querySelector('select[name=bizplace]')
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
get _fromDateInput() {
|
|
77
|
+
return this.searchForm.shadowRoot.querySelector('input[name=fromDate]')
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
get _toDateInput() {
|
|
81
|
+
return this.searchForm.shadowRoot.querySelector('input[name=toDate]')
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
render() {
|
|
85
|
+
return html`
|
|
86
|
+
<search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
|
|
87
|
+
|
|
88
|
+
<data-grist
|
|
89
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
90
|
+
.config=${this._config}
|
|
91
|
+
.fetchHandler="${this.fetchHandler.bind(this)}"
|
|
92
|
+
></data-grist>
|
|
93
|
+
`
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
get searchFields() {
|
|
97
|
+
return [
|
|
98
|
+
{
|
|
99
|
+
label: i18next.t('field.company'),
|
|
100
|
+
name: 'bizplace',
|
|
101
|
+
type: 'select',
|
|
102
|
+
options: [
|
|
103
|
+
{ value: '' },
|
|
104
|
+
...this._partners
|
|
105
|
+
.map(partner => {
|
|
106
|
+
return {
|
|
107
|
+
name: `${partner.name} ${partner.description ? `(${partner.description})` : ''}`,
|
|
108
|
+
value: partner.id
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
.sort(this._compareValues('name', 'asc'))
|
|
112
|
+
],
|
|
113
|
+
props: { searchOper: 'eq' }
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: i18next.t('field.from_date'),
|
|
117
|
+
name: 'fromDate',
|
|
118
|
+
type: 'date',
|
|
119
|
+
props: {
|
|
120
|
+
searchOper: 'eq',
|
|
121
|
+
max: new Date().toISOString().split('T')[0]
|
|
122
|
+
},
|
|
123
|
+
value: (() => {
|
|
124
|
+
let date = new Date()
|
|
125
|
+
date.setMonth(date.getMonth() - 1)
|
|
126
|
+
return date.toISOString().split('T')[0]
|
|
127
|
+
})(),
|
|
128
|
+
handlers: { change: this._modifyDateRange.bind(this) }
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
label: i18next.t('field.to_date'),
|
|
132
|
+
name: 'toDate',
|
|
133
|
+
type: 'date',
|
|
134
|
+
props: {
|
|
135
|
+
searchOper: 'eq',
|
|
136
|
+
min: (() => {
|
|
137
|
+
let date = new Date()
|
|
138
|
+
date.setMonth(date.getMonth() - 1)
|
|
139
|
+
return date.toISOString().split('T')[0]
|
|
140
|
+
})()
|
|
141
|
+
},
|
|
142
|
+
value: new Date().toISOString().split('T')[0],
|
|
143
|
+
handlers: { change: this._submit.bind(this) }
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
get reportConfig() {
|
|
149
|
+
let columns = [
|
|
150
|
+
{
|
|
151
|
+
type: 'number',
|
|
152
|
+
name: 'no',
|
|
153
|
+
header: i18next.t('field.no'),
|
|
154
|
+
width: 50
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
type: 'string',
|
|
158
|
+
name: 'bizplace|name',
|
|
159
|
+
header: i18next.t('field.company'),
|
|
160
|
+
width: 200
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
type: 'string',
|
|
164
|
+
name: 'orderNo',
|
|
165
|
+
header: i18next.t('field.order_no'),
|
|
166
|
+
width: 200
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: 'string',
|
|
170
|
+
name: 'refNo1',
|
|
171
|
+
header: i18next.t('field.ref_no'),
|
|
172
|
+
width: 150
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'string',
|
|
176
|
+
name: 'refNo2',
|
|
177
|
+
header: i18next.t('field.ref_no_2'),
|
|
178
|
+
width: 150
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: 'string',
|
|
182
|
+
name: 'refNo3',
|
|
183
|
+
header: i18next.t('field.ref_no_3'),
|
|
184
|
+
width: 150
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: 'string',
|
|
188
|
+
name: 'palletId',
|
|
189
|
+
header: i18next.t('field.lot_id'),
|
|
190
|
+
width: 200
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
type: 'string',
|
|
194
|
+
name: 'cartonId',
|
|
195
|
+
header: i18next.t('field.carton_id'),
|
|
196
|
+
width: 200
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
type: 'string',
|
|
200
|
+
name: 'product|sku',
|
|
201
|
+
header: i18next.t('field.sku'),
|
|
202
|
+
width: 150
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
type: 'string',
|
|
206
|
+
name: 'product|brandSku',
|
|
207
|
+
header: i18next.t('field.brand_sku'),
|
|
208
|
+
width: 150
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
type: 'string',
|
|
212
|
+
name: 'product|name',
|
|
213
|
+
header: i18next.t('field.product_name'),
|
|
214
|
+
width: 200
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
type: 'string',
|
|
218
|
+
name: 'product|description',
|
|
219
|
+
header: i18next.t('field.product_description'),
|
|
220
|
+
width: 300
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
type: 'string',
|
|
224
|
+
name: 'product|type',
|
|
225
|
+
header: i18next.t('field.product_type'),
|
|
226
|
+
width: 150
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
type: 'number',
|
|
230
|
+
name: 'product|volume',
|
|
231
|
+
header: i18next.t('field.volume'),
|
|
232
|
+
width: 150
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
type: 'string',
|
|
236
|
+
name: 'serialNumber',
|
|
237
|
+
header: i18next.t('field.serial_number'),
|
|
238
|
+
width: 150
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
type: 'datetime',
|
|
242
|
+
name: 'etd',
|
|
243
|
+
header: i18next.t('field.etd'),
|
|
244
|
+
width: 170
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
let list = {
|
|
248
|
+
fields: [
|
|
249
|
+
'no',
|
|
250
|
+
'bizplace|name',
|
|
251
|
+
'orderNo',
|
|
252
|
+
'refNo1',
|
|
253
|
+
'refNo2',
|
|
254
|
+
'refNo3',
|
|
255
|
+
'palletId',
|
|
256
|
+
'cartonId',
|
|
257
|
+
'product|sku',
|
|
258
|
+
'product|brandSku',
|
|
259
|
+
'product|name',
|
|
260
|
+
'product|description',
|
|
261
|
+
'product|type',
|
|
262
|
+
'product|volume',
|
|
263
|
+
'serialNumber',
|
|
264
|
+
'etd'
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
columns: columns,
|
|
270
|
+
list,
|
|
271
|
+
pagination: { limit: 100, pages: [50, 100, 200, 500, 1000] },
|
|
272
|
+
rows: {
|
|
273
|
+
selectable: false,
|
|
274
|
+
insertable: false,
|
|
275
|
+
appendable: false
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
async pageInitialized() {
|
|
281
|
+
this._gristData = { total: 0, records: [] }
|
|
282
|
+
this._partners = [...(await this._fetchPartners())]
|
|
283
|
+
|
|
284
|
+
this._searchFields = this.searchFields
|
|
285
|
+
this._config = this.reportConfig
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
async pageUpdated(changes, lifecycle) {
|
|
289
|
+
if (this.active) {
|
|
290
|
+
this.dataGrist.fetch()
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
async fetchHandler({ page, limit, sorters = [] }) {
|
|
295
|
+
try {
|
|
296
|
+
this._validate()
|
|
297
|
+
let filters = this.searchForm.queryFilters.map(filter => {
|
|
298
|
+
switch (filter.name) {
|
|
299
|
+
case 'fromDate':
|
|
300
|
+
let fromDt = new Date(filter.value)
|
|
301
|
+
fromDt.setHours(0)
|
|
302
|
+
filter.value = fromDt.toISOString()
|
|
303
|
+
break
|
|
304
|
+
case 'toDate':
|
|
305
|
+
let toDt = new Date(filter.value)
|
|
306
|
+
toDt.setHours(23, 59, 59)
|
|
307
|
+
filter.value = toDt.toISOString()
|
|
308
|
+
break
|
|
309
|
+
default:
|
|
310
|
+
break
|
|
311
|
+
}
|
|
312
|
+
return filter
|
|
313
|
+
})
|
|
314
|
+
|
|
315
|
+
const pagination = { page, limit }
|
|
316
|
+
const sortings = sorters
|
|
317
|
+
|
|
318
|
+
const response = await client.query({
|
|
319
|
+
query: gql`
|
|
320
|
+
query inboundSerialNumberReport($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
321
|
+
inboundSerialNumberReport(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
322
|
+
items {
|
|
323
|
+
no
|
|
324
|
+
bizplace {
|
|
325
|
+
name
|
|
326
|
+
description
|
|
327
|
+
}
|
|
328
|
+
orderNo
|
|
329
|
+
refNo1
|
|
330
|
+
refNo2
|
|
331
|
+
refNo3
|
|
332
|
+
palletId
|
|
333
|
+
cartonId
|
|
334
|
+
product {
|
|
335
|
+
id
|
|
336
|
+
sku
|
|
337
|
+
brandSku
|
|
338
|
+
name
|
|
339
|
+
description
|
|
340
|
+
type
|
|
341
|
+
volume
|
|
342
|
+
}
|
|
343
|
+
serialNumber
|
|
344
|
+
etd
|
|
345
|
+
}
|
|
346
|
+
total
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
`,
|
|
350
|
+
variables: { filters, pagination, sortings },
|
|
351
|
+
context: gqlContext()
|
|
352
|
+
})
|
|
353
|
+
|
|
354
|
+
const data = {
|
|
355
|
+
total: response.data.inboundSerialNumberReport.total,
|
|
356
|
+
records:
|
|
357
|
+
response.data.inboundSerialNumberReport.items.map(itm => {
|
|
358
|
+
return flattenObject({ ...itm, bizplace: { name: `${itm.bizplace.name} ${itm.bizplace.description}` } })
|
|
359
|
+
}) || []
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
this._gristData = {
|
|
363
|
+
...data
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return data
|
|
367
|
+
} catch (e) {
|
|
368
|
+
this._showToast(e)
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
async _fetchPartners() {
|
|
373
|
+
const filters = []
|
|
374
|
+
const response = await client.query({
|
|
375
|
+
query: gql`
|
|
376
|
+
query partnersBizplaces($filters: [Filter!]) {
|
|
377
|
+
partnersBizplaces(filters: $filters) {
|
|
378
|
+
items {
|
|
379
|
+
id
|
|
380
|
+
name
|
|
381
|
+
description
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
`,
|
|
386
|
+
variables: { filters }
|
|
387
|
+
})
|
|
388
|
+
|
|
389
|
+
if (!response.errors) {
|
|
390
|
+
return response.data.partnersBizplaces.items
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
_validate() {
|
|
394
|
+
if (!this.searchForm.shadowRoot.querySelector('form').checkValidity())
|
|
395
|
+
throw new Error(i18next.t('text.invalid_form_value'))
|
|
396
|
+
if (!this._bizplaceSelector.value) throw new Error(i18next.t('text.no_company_selected'))
|
|
397
|
+
if (!this._fromDateInput.value) throw new Error(i18next.t('text.from_date_is_empty'))
|
|
398
|
+
if (!this._toDateInput.value) throw new Error(i18next.t('text.to_date_is_empty'))
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
_compareValues(key, order = 'asc') {
|
|
402
|
+
return function innerSort(a, b) {
|
|
403
|
+
if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
|
|
404
|
+
return 0
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const varA = typeof a[key] === 'string' ? a[key].toUpperCase() : a[key]
|
|
408
|
+
const varB = typeof b[key] === 'string' ? b[key].toUpperCase() : b[key]
|
|
409
|
+
|
|
410
|
+
let comparison = 0
|
|
411
|
+
if (varA > varB) {
|
|
412
|
+
comparison = 1
|
|
413
|
+
} else if (varA < varB) {
|
|
414
|
+
comparison = -1
|
|
415
|
+
}
|
|
416
|
+
return order === 'desc' ? comparison * -1 : comparison
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
_modifyDateRange(e) {
|
|
421
|
+
const fromDate = e.currentTarget.value
|
|
422
|
+
|
|
423
|
+
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
424
|
+
|
|
425
|
+
let min = new Date(fromDate)
|
|
426
|
+
let today = new Date()
|
|
427
|
+
today.setHours(0, 0, 0, 0)
|
|
428
|
+
|
|
429
|
+
min = min.toISOString().split('T')[0]
|
|
430
|
+
|
|
431
|
+
this._toDateInput.min = min
|
|
432
|
+
this._submit()
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
_submit(e) {
|
|
436
|
+
this._config = { ...this.reportConfig }
|
|
437
|
+
this.searchForm.submit()
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
_showToast({ type, message }) {
|
|
441
|
+
document.dispatchEvent(
|
|
442
|
+
new CustomEvent('notify', {
|
|
443
|
+
detail: {
|
|
444
|
+
type,
|
|
445
|
+
message
|
|
446
|
+
}
|
|
447
|
+
})
|
|
448
|
+
)
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
window.customElements.define('inbound-serial-number-report', InboundSerialNumberReport)
|
|
@@ -6,6 +6,7 @@ import gql from 'graphql-tag'
|
|
|
6
6
|
import { css, html } from 'lit-element'
|
|
7
7
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
8
8
|
|
|
9
|
+
import { getCodeByName } from '@things-factory/code-base'
|
|
9
10
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
10
11
|
import { client, gqlContext, PageView, store } from '@things-factory/shell'
|
|
11
12
|
import { flattenObject, isMobileDevice } from '@things-factory/utils'
|
|
@@ -45,6 +46,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
45
46
|
_searchFields: Object,
|
|
46
47
|
_config: Object,
|
|
47
48
|
_partners: Object,
|
|
49
|
+
__orderStatus: Object,
|
|
48
50
|
_gristData: Object,
|
|
49
51
|
data: Object
|
|
50
52
|
}
|
|
@@ -138,10 +140,14 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
138
140
|
date.setMonth(date.getMonth() - 1)
|
|
139
141
|
return date.toISOString().split('T')[0]
|
|
140
142
|
})(),
|
|
141
|
-
max:
|
|
143
|
+
max: (() => {
|
|
144
|
+
var max = new Date()
|
|
145
|
+
max.setMonth(max.getMonth() + 1)
|
|
146
|
+
return max.toISOString().split('T')[0]
|
|
147
|
+
})()
|
|
142
148
|
},
|
|
143
|
-
value: new Date().toISOString().split('T')[0]
|
|
144
|
-
handlers: { change: this._submit.bind(this) }
|
|
149
|
+
value: new Date().toISOString().split('T')[0]
|
|
150
|
+
// handlers: { change: this._submit.bind(this) }
|
|
145
151
|
},
|
|
146
152
|
{
|
|
147
153
|
label: i18next.t('field.product_info'),
|
|
@@ -160,6 +166,19 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
160
166
|
name: 'doNo',
|
|
161
167
|
type: 'text',
|
|
162
168
|
props: { searchOper: 'custom' }
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
label: i18next.t('field.status'),
|
|
172
|
+
name: 'status',
|
|
173
|
+
type: 'select',
|
|
174
|
+
options: [
|
|
175
|
+
{ name: 'all', value: '' },
|
|
176
|
+
...this._orderStatus.map(status => {
|
|
177
|
+
return { name: i18next.t(`label.${status.description}`), value: status.name }
|
|
178
|
+
})
|
|
179
|
+
],
|
|
180
|
+
value: 'DONE',
|
|
181
|
+
props: { searchOper: 'eq' }
|
|
163
182
|
}
|
|
164
183
|
]
|
|
165
184
|
}
|
|
@@ -221,6 +240,12 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
221
240
|
header: i18next.t('field.ref_no_3'),
|
|
222
241
|
width: 150
|
|
223
242
|
},
|
|
243
|
+
{
|
|
244
|
+
type: 'string',
|
|
245
|
+
name: 'status',
|
|
246
|
+
header: i18next.t('field.status'),
|
|
247
|
+
width: 120
|
|
248
|
+
},
|
|
224
249
|
{
|
|
225
250
|
type: 'datetime',
|
|
226
251
|
name: 'orderCreatedAt',
|
|
@@ -305,6 +330,18 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
305
330
|
header: i18next.t('field.uom'),
|
|
306
331
|
width: 100
|
|
307
332
|
},
|
|
333
|
+
{
|
|
334
|
+
type: 'float',
|
|
335
|
+
name: 'returnToLocationQty',
|
|
336
|
+
header: i18next.t('field.return_qty'),
|
|
337
|
+
width: 120
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
type: 'float',
|
|
341
|
+
name: 'returnToLocationUomValue',
|
|
342
|
+
header: i18next.t('field.return_uom_value'),
|
|
343
|
+
width: 120
|
|
344
|
+
},
|
|
308
345
|
{
|
|
309
346
|
type: 'float',
|
|
310
347
|
name: 'unitVolume',
|
|
@@ -437,6 +474,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
437
474
|
'refNo1',
|
|
438
475
|
'refNo2',
|
|
439
476
|
'refNo3',
|
|
477
|
+
'status',
|
|
440
478
|
'orderCreatedAt',
|
|
441
479
|
'pickingStart',
|
|
442
480
|
'pickingComplete',
|
|
@@ -451,6 +489,8 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
451
489
|
'qty',
|
|
452
490
|
'uomValue',
|
|
453
491
|
'uom',
|
|
492
|
+
'returnToLocationQty',
|
|
493
|
+
'returnToLocationUomValue',
|
|
454
494
|
'unitVolume',
|
|
455
495
|
'totalVolume',
|
|
456
496
|
'unitNettWeight',
|
|
@@ -477,7 +517,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
477
517
|
return {
|
|
478
518
|
columns: columns,
|
|
479
519
|
list,
|
|
480
|
-
pagination: { limit:
|
|
520
|
+
pagination: { limit: 100, pages: [100, 200, 500, 1000] },
|
|
481
521
|
rows: {
|
|
482
522
|
selectable: false,
|
|
483
523
|
insertable: false,
|
|
@@ -489,7 +529,14 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
489
529
|
async pageInitialized() {
|
|
490
530
|
this._gristData = { total: 0, totalWithOpeningBalance: 0, records: [] }
|
|
491
531
|
this._products = []
|
|
492
|
-
|
|
532
|
+
|
|
533
|
+
const [_orderStatusReq, _partnersReq] = await Promise.allSettled([
|
|
534
|
+
getCodeByName('RO_REQUESTS_STATUS'),
|
|
535
|
+
this._fetchPartners()
|
|
536
|
+
])
|
|
537
|
+
|
|
538
|
+
this._orderStatus = _orderStatusReq.status == 'fulfilled' ? _orderStatusReq.value : []
|
|
539
|
+
this._partners = _partnersReq.status == 'fulfilled' ? _partnersReq.value : []
|
|
493
540
|
|
|
494
541
|
this._searchFields = this.searchFields
|
|
495
542
|
this._config = this.reportConfig
|
|
@@ -539,6 +586,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
539
586
|
deliveryAddress
|
|
540
587
|
roNo
|
|
541
588
|
roType
|
|
589
|
+
status
|
|
542
590
|
refNo1
|
|
543
591
|
refNo2
|
|
544
592
|
refNo3
|
|
@@ -558,6 +606,8 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
558
606
|
packSize
|
|
559
607
|
qty
|
|
560
608
|
uomValue
|
|
609
|
+
returnToLocationQty
|
|
610
|
+
returnToLocationUomValue
|
|
561
611
|
uom
|
|
562
612
|
unitVolume
|
|
563
613
|
totalVolume
|
|
@@ -657,14 +707,18 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
657
707
|
_modifyDateRange(e) {
|
|
658
708
|
const fromDate = e.currentTarget.value
|
|
659
709
|
|
|
660
|
-
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
661
|
-
|
|
662
710
|
let min = new Date(fromDate)
|
|
663
|
-
let
|
|
664
|
-
|
|
711
|
+
let max = new Date(fromDate)
|
|
712
|
+
max.setMonth(max.getMonth() + 2)
|
|
665
713
|
|
|
666
714
|
min = min.toISOString().split('T')[0]
|
|
715
|
+
max = max.toISOString().split('T')[0]
|
|
716
|
+
|
|
717
|
+
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
718
|
+
|
|
719
|
+
if (this._toDateInput.value > max) this._toDateInput.value = max
|
|
667
720
|
|
|
721
|
+
this._toDateInput.max = max
|
|
668
722
|
this._toDateInput.min = min
|
|
669
723
|
this._submit()
|
|
670
724
|
}
|
|
@@ -686,6 +740,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
686
740
|
{ header: i18next.t('field.ref_no'), key: 'refNo1', width: 60, type: 'string' },
|
|
687
741
|
{ header: i18next.t('field.ref_no_2'), key: 'refNo2', width: 60, type: 'string' },
|
|
688
742
|
{ header: i18next.t('field.ref_no_3'), key: 'refNo3', width: 60, type: 'string' },
|
|
743
|
+
{ header: i18next.t('field.status'), key: 'status', width: 30, type: 'string' },
|
|
689
744
|
{ header: i18next.t('field.order_created_at'), key: 'orderCreatedAt', width: 30, type: 'string' },
|
|
690
745
|
{ header: i18next.t('field.picking_start'), key: 'pickingStart', width: 30, type: 'string' },
|
|
691
746
|
{ header: i18next.t('field.picking_complete'), key: 'pickingComplete', width: 30, type: 'string' },
|