@things-factory/operato-wms 4.3.503 → 4.3.505
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/bulk-operation/validate-b2c-ro-popup.js +5 -1
- package/client/pages/manifest/create-loading-manifest.js +12 -21
- package/client/pages/manifest/existing-manifest-list.js +15 -20
- package/client/pages/manifest/generate-manifest-popup.js +9 -12
- package/client/pages/manifest/loading-manifest-detail.js +6 -1
- package/client/pages/manifest/loading-manifest-list.js +15 -17
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +10 -28
- package/client/pages/order/release-order/b2c/create-b2c-release-order.js +4 -1
- package/client/pages/outbound/item-label-popup.js +1 -0
- package/client/pages/outbound/picking-product.js +3 -3
- package/client/pages/outbound/worksheet-packing.js +5 -1
- package/client/pages/outbound/worksheet-picking.js +2 -0
- package/client/pages/report/manifest-report.js +321 -325
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +22 -3
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -1
- package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +7 -3
- package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +1 -1
- package/package.json +5 -5
- package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +22 -3
- package/server/graphql/resolvers/shipping-provider/shipping-providers.ts +7 -3
- package/translations/en.json +1 -2
- package/translations/ko.json +1 -2
- package/translations/ms.json +1 -2
- package/translations/zh.json +1 -2
|
@@ -2,116 +2,106 @@ import '@things-factory/form-ui'
|
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
|
|
4
4
|
import gql from 'graphql-tag'
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from '
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
i18next,
|
|
12
|
-
localize
|
|
13
|
-
} from '@things-factory/i18n-base'
|
|
14
|
-
import {
|
|
15
|
-
client,
|
|
16
|
-
gqlContext,
|
|
17
|
-
PageView
|
|
18
|
-
} from '@things-factory/shell'
|
|
5
|
+
import { css, html } from 'lit-element'
|
|
6
|
+
|
|
7
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
8
|
+
import { client, gqlContext, PageView } from '@things-factory/shell'
|
|
19
9
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
20
10
|
import { isMobileDevice } from '@things-factory/utils'
|
|
21
11
|
|
|
22
12
|
class ManifestReport extends localize(i18next)(PageView) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
13
|
+
static get styles() {
|
|
14
|
+
return [
|
|
15
|
+
ScrollbarStyles,
|
|
16
|
+
css`
|
|
17
|
+
:host {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
search-form {
|
|
24
|
+
overflow: visible;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
data-grist {
|
|
28
|
+
overflow-y: auto;
|
|
29
|
+
flex: 1;
|
|
30
|
+
}
|
|
31
|
+
`
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static get properties() {
|
|
36
|
+
return {
|
|
37
|
+
_searchFields: Array,
|
|
38
|
+
config: Object,
|
|
39
|
+
data: Object,
|
|
40
|
+
_shippingProviderList: Array,
|
|
41
|
+
_partners: Object
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
get context() {
|
|
46
|
+
return {
|
|
47
|
+
title: i18next.t('title.manifest_report'),
|
|
48
|
+
exportable: {
|
|
49
|
+
name: i18next.t('title.manifest_report'),
|
|
50
|
+
data: this._exportableData.bind(this)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
get _fromDateInput() {
|
|
56
|
+
return this.searchForm.shadowRoot.querySelector('input[name=fromDate]')
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
get _toDateInput() {
|
|
60
|
+
return this.searchForm.shadowRoot.querySelector('input[name=toDate]')
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get searchForm() {
|
|
64
|
+
return this.shadowRoot.querySelector('search-form')
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
get dataGrist() {
|
|
68
|
+
return this.shadowRoot.querySelector('data-grist')
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get _bizplaceSelector() {
|
|
82
72
|
return this.searchForm.shadowRoot.querySelector('select[name=bizplace]')
|
|
83
73
|
}
|
|
84
74
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
75
|
+
render() {
|
|
76
|
+
return html`
|
|
77
|
+
<search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
|
|
78
|
+
|
|
79
|
+
<data-grist
|
|
80
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
81
|
+
.config=${this.config}
|
|
82
|
+
.fetchHandler="${this.fetchHandler.bind(this)}"
|
|
83
|
+
></data-grist>
|
|
84
|
+
`
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
pageUpdated(changes, lifecycle) {
|
|
88
|
+
if (this.active) {
|
|
89
|
+
this.dataGrist.fetch()
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
constructor() {
|
|
94
|
+
super()
|
|
95
|
+
this._shippingProviderList = []
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async pageInitialized() {
|
|
99
|
+
const partners = await this._fetchPartners()
|
|
100
|
+
this._searchFields = [
|
|
101
|
+
{
|
|
102
|
+
label: i18next.t('field.company'),
|
|
103
|
+
name: 'bizplace',
|
|
104
|
+
type: 'select',
|
|
115
105
|
options:
|
|
116
106
|
partners?.length == 1
|
|
117
107
|
? [
|
|
@@ -131,155 +121,155 @@ class ManifestReport extends localize(i18next)(PageView) {
|
|
|
131
121
|
})
|
|
132
122
|
.sort(this._compareValues('name', 'asc'))
|
|
133
123
|
],
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
124
|
+
props: { searchOper: 'eq' }
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: i18next.t('field.from_date'),
|
|
128
|
+
name: 'fromDate',
|
|
129
|
+
type: 'date',
|
|
130
|
+
props: {
|
|
141
131
|
searchOper: 'eq',
|
|
142
132
|
max: new Date().toISOString().split('T')[0]
|
|
143
133
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
134
|
+
value: (() => {
|
|
135
|
+
let date = new Date()
|
|
136
|
+
date.setMonth(date.getMonth() - 1)
|
|
137
|
+
return date.toISOString().split('T')[0]
|
|
138
|
+
})(),
|
|
139
|
+
handlers: { change: this._modifyDateRange.bind(this) }
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: i18next.t('field.to_date'),
|
|
143
|
+
name: 'toDate',
|
|
144
|
+
type: 'date',
|
|
145
|
+
props: {
|
|
146
|
+
searchOper: 'eq',
|
|
147
|
+
max: new Date().toISOString().split('T')[0],
|
|
148
|
+
min: (() => {
|
|
149
|
+
let date = new Date()
|
|
150
|
+
date.setMonth(date.getMonth() - 1)
|
|
151
|
+
return date.toISOString().split('T')[0]
|
|
152
|
+
})()
|
|
153
|
+
},
|
|
154
|
+
value: new Date().toISOString().split('T')[0]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: i18next.t('field.tracking_no'),
|
|
158
|
+
name: 'trackingNo',
|
|
159
|
+
type: 'text',
|
|
160
|
+
props: { searchOper: 'eq' }
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
label: i18next.t('field.ro_no'),
|
|
164
|
+
name: 'releaseGoodNo',
|
|
165
|
+
type: 'text',
|
|
166
|
+
props: { searchOper: 'eq' }
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: i18next.t('field.tracking_no'),
|
|
170
|
+
name: 'hasTrackingNo',
|
|
171
|
+
type: 'checkbox',
|
|
172
|
+
props: { searchOper: 'eq' },
|
|
173
|
+
attrs: ['indeterminate']
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
|
|
177
|
+
this.config = {
|
|
178
|
+
list: {
|
|
179
|
+
fields: [
|
|
180
|
+
'company',
|
|
181
|
+
'refNo',
|
|
182
|
+
'roNo',
|
|
183
|
+
'status',
|
|
184
|
+
'trackingNo',
|
|
185
|
+
'name',
|
|
186
|
+
'manifestedAt',
|
|
187
|
+
'manifestedBy',
|
|
188
|
+
'createdAt',
|
|
189
|
+
'transporter'
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
rows: { appendable: false, selectable: false },
|
|
193
|
+
columns: [
|
|
194
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
195
|
+
{
|
|
196
|
+
type: 'string',
|
|
197
|
+
name: 'bizplace',
|
|
198
|
+
header: i18next.t('field.company'),
|
|
199
|
+
label: true,
|
|
200
|
+
width: 130
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
type: 'string',
|
|
204
|
+
name: 'refNo',
|
|
205
|
+
header: i18next.t('field.ref_no'),
|
|
206
|
+
label: true,
|
|
207
|
+
width: 140
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
type: 'string',
|
|
211
|
+
name: 'roNo',
|
|
212
|
+
header: i18next.t('field.ro_no'),
|
|
213
|
+
label: true,
|
|
214
|
+
width: 150
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
type: 'string',
|
|
218
|
+
name: 'status',
|
|
219
|
+
header: i18next.t('field.status'),
|
|
220
|
+
label: true,
|
|
221
|
+
width: 120
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
type: 'string',
|
|
225
|
+
name: 'trackingNo',
|
|
226
|
+
header: i18next.t('field.tracking_no'),
|
|
227
|
+
label: true,
|
|
228
|
+
width: 120
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
type: 'string',
|
|
232
|
+
name: 'manifestNo',
|
|
233
|
+
header: i18next.t('field.manifest_no'),
|
|
234
|
+
label: true,
|
|
235
|
+
width: 140
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
type: 'datetime',
|
|
239
|
+
name: 'manifestedAt',
|
|
240
|
+
header: i18next.t('field.manifested_at'),
|
|
241
|
+
label: true,
|
|
242
|
+
width: 120
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
type: 'string',
|
|
246
|
+
name: 'manifestedBy',
|
|
247
|
+
header: i18next.t('field.manifested_by'),
|
|
248
|
+
label: true,
|
|
249
|
+
width: 130
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
type: 'datetime',
|
|
253
|
+
name: 'orderedAt',
|
|
254
|
+
header: i18next.t('field.created_at'),
|
|
255
|
+
label: true,
|
|
256
|
+
width: 120
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
type: 'string',
|
|
260
|
+
name: 'transporter',
|
|
261
|
+
header: i18next.t('field.transporter'),
|
|
262
|
+
label: true,
|
|
263
|
+
width: 120
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
}
|
|
278
268
|
|
|
279
269
|
async fetchHandler({ page, limit, sorters = [{ name: 'createdAt', desc: true }] }) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
270
|
+
try {
|
|
271
|
+
this._validate()
|
|
272
|
+
let filters = this.searchForm.queryFilters.map(filter => {
|
|
283
273
|
switch (filter.name) {
|
|
284
274
|
case 'fromDate':
|
|
285
275
|
let fromDt = new Date(filter.value)
|
|
@@ -297,39 +287,45 @@ class ManifestReport extends localize(i18next)(PageView) {
|
|
|
297
287
|
return filter
|
|
298
288
|
})
|
|
299
289
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
290
|
+
const response = await client.query({
|
|
291
|
+
query: gql`
|
|
292
|
+
query manifestReport($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
293
|
+
manifestReport(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
294
|
+
items {
|
|
295
|
+
bizplace
|
|
296
|
+
refNo
|
|
297
|
+
roNo
|
|
298
|
+
status
|
|
299
|
+
trackingNo
|
|
300
|
+
manifestNo
|
|
301
|
+
manifestedAt
|
|
302
|
+
manifestedBy
|
|
303
|
+
orderedAt
|
|
304
|
+
transporter
|
|
305
|
+
}
|
|
306
|
+
total
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
`,
|
|
310
|
+
variables: { filters, pagination: { page, limit }, sortings: sorters },
|
|
311
|
+
context: gqlContext()
|
|
312
|
+
})
|
|
313
|
+
|
|
314
|
+
if (!response.errors) {
|
|
315
|
+
return {
|
|
316
|
+
total: response.data.manifestReport.total || 0,
|
|
317
|
+
records: (response.data.manifestReport.items || []).map(item => {
|
|
318
|
+
let transporterData = item?.transporter == 'EMS' ? 'EFMX' : item.transporter
|
|
319
|
+
return {
|
|
320
|
+
...item,
|
|
321
|
+
transporter: transporterData
|
|
322
|
+
}
|
|
323
|
+
})
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
} catch (e) {
|
|
327
|
+
this._showToast(e)
|
|
328
|
+
}
|
|
333
329
|
}
|
|
334
330
|
|
|
335
331
|
async _fetchPartners() {
|
|
@@ -354,7 +350,7 @@ class ManifestReport extends localize(i18next)(PageView) {
|
|
|
354
350
|
}
|
|
355
351
|
}
|
|
356
352
|
|
|
357
|
-
|
|
353
|
+
_validate() {
|
|
358
354
|
if (!this.searchForm.shadowRoot.querySelector('form').checkValidity())
|
|
359
355
|
throw new Error(i18next.t('text.invalid_form_value'))
|
|
360
356
|
if (!this._bizplaceSelector.value) throw new Error(i18next.t('text.no_company_selected'))
|
|
@@ -362,7 +358,7 @@ class ManifestReport extends localize(i18next)(PageView) {
|
|
|
362
358
|
if (!this._toDateInput.value) throw new Error(i18next.t('text.to_date_is_empty'))
|
|
363
359
|
}
|
|
364
360
|
|
|
365
|
-
|
|
361
|
+
_compareValues(key, order = 'asc') {
|
|
366
362
|
return function innerSort(a, b) {
|
|
367
363
|
if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
|
|
368
364
|
return 0
|
|
@@ -381,7 +377,7 @@ class ManifestReport extends localize(i18next)(PageView) {
|
|
|
381
377
|
}
|
|
382
378
|
}
|
|
383
379
|
|
|
384
|
-
|
|
380
|
+
_modifyDateRange(e) {
|
|
385
381
|
const fromDate = e.currentTarget.value
|
|
386
382
|
if (fromDate == '') return
|
|
387
383
|
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
@@ -402,47 +398,47 @@ class ManifestReport extends localize(i18next)(PageView) {
|
|
|
402
398
|
this._toDateInput.max = max
|
|
403
399
|
}
|
|
404
400
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
401
|
+
async _exportableData() {
|
|
402
|
+
try {
|
|
403
|
+
var headerSetting = [
|
|
404
|
+
{ header: i18next.t('field.company'), key: 'bizplace', width: 40, type: 'string' },
|
|
405
|
+
{ header: i18next.t('field.ref_no'), key: 'refNo', width: 20, type: 'string' },
|
|
406
|
+
{ header: i18next.t('field.ro_no'), key: 'roNo', width: 30, type: 'string' },
|
|
407
|
+
{ header: i18next.t('field.status'), key: 'status', width: 15, type: 'string' },
|
|
408
|
+
{ header: i18next.t('field.tracking_no'), key: 'trackingNo', width: 15, type: 'string' },
|
|
409
|
+
{ header: i18next.t('field.manifest_no'), key: 'manifestNo', width: 20, type: 'string' },
|
|
410
|
+
{ header: i18next.t('field.manifested_at'), key: 'manifestedAt', width: 20, type: 'string' },
|
|
411
|
+
{ header: i18next.t('field.manifested_by'), key: 'manifestedBy', width: 20, type: 'string' },
|
|
412
|
+
{ header: i18next.t('field.created_at'), key: 'orderedAt', width: 20, type: 'string' },
|
|
413
|
+
{ header: i18next.t('field.transporter'), key: 'transporter', width: 20, type: 'string' }
|
|
414
|
+
]
|
|
415
|
+
|
|
416
|
+
var exportData = {
|
|
417
|
+
header: [...headerSetting],
|
|
418
|
+
data: (await this.fetchHandler({ page: 1, limit: 999999 })).records.map(itm => {
|
|
419
|
+
return {
|
|
420
|
+
...itm,
|
|
421
|
+
manifestedAt: itm.manifestedAt ? new Date(parseInt(itm.manifestedAt)).toLocaleString() : '',
|
|
422
|
+
orderedAt: itm.orderedAt ? new Date(parseInt(itm.orderedAt)).toLocaleString() : ''
|
|
423
|
+
}
|
|
424
|
+
})
|
|
425
|
+
}
|
|
426
|
+
return exportData
|
|
427
|
+
} catch (e) {
|
|
428
|
+
this._showToast(e)
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
_showToast({ type, message }) {
|
|
433
|
+
document.dispatchEvent(
|
|
434
|
+
new CustomEvent('notify', {
|
|
435
|
+
detail: {
|
|
436
|
+
type,
|
|
437
|
+
message
|
|
438
|
+
}
|
|
439
|
+
})
|
|
440
|
+
)
|
|
441
|
+
}
|
|
446
442
|
}
|
|
447
443
|
|
|
448
|
-
customElements.define('manifest-report', ManifestReport)
|
|
444
|
+
customElements.define('manifest-report', ManifestReport)
|