@things-factory/operato-wms 4.3.708 → 4.3.725
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/order/release-order/b2c/b2c-order-requests.js +30 -13
- package/client/pages/report/analysis-picking-packing-report.js +76 -79
- package/client/pages/report/billing-module-report.js +46 -49
- package/client/pages/report/costing-report.js +22 -14
- package/client/pages/report/inbound-order-details-report.js +18 -14
- package/client/pages/report/inbound-serial-number-report.js +24 -16
- package/client/pages/report/inventory-pallet-report.js +17 -12
- package/client/pages/report/inventory-pallet-storage-report.js +17 -12
- package/client/pages/report/inventory-report.js +28 -19
- package/client/pages/report/inventory-summary-report.js +20 -11
- package/client/pages/report/job-sheet-list.js +26 -15
- package/client/pages/report/manifest-report.js +20 -14
- package/client/pages/report/order-vas-report.js +18 -23
- package/client/pages/report/outbound-order-details-report.js +27 -34
- package/client/pages/report/outbound-serial-number-report.js +25 -17
- package/client/pages/report/product-label-report.js +17 -12
- package/client/pages/report/shortage-report.js +13 -6
- package/client/pages/report/tote-loading-qc-report.js +23 -21
- package/client/pages/report/vas-report.js +15 -10
- package/client/pages/report/volume-summary-report.js +23 -21
- package/config.development.js +117 -85
- package/package.json +50 -50
|
@@ -10,6 +10,13 @@ import { i18next, localize } from '@things-factory/i18n-base'
|
|
|
10
10
|
import { client, gqlContext, PageView, store } from '@things-factory/shell'
|
|
11
11
|
import { flattenObject, isMobileDevice } from '@things-factory/utils'
|
|
12
12
|
|
|
13
|
+
function formatLocalDate(date = new Date()) {
|
|
14
|
+
const year = date.getFullYear()
|
|
15
|
+
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
16
|
+
const day = String(date.getDate()).padStart(2, '0')
|
|
17
|
+
return `${year}-${month}-${day}`
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
class InboundSerialNumberReport extends connect(store)(localize(i18next)(PageView)) {
|
|
14
21
|
static get styles() {
|
|
15
22
|
return css`
|
|
@@ -122,12 +129,12 @@ class InboundSerialNumberReport extends connect(store)(localize(i18next)(PageVie
|
|
|
122
129
|
type: 'date',
|
|
123
130
|
props: {
|
|
124
131
|
searchOper: 'eq',
|
|
125
|
-
max: new Date()
|
|
132
|
+
max: formatLocalDate(new Date())
|
|
126
133
|
},
|
|
127
134
|
value: (() => {
|
|
128
|
-
|
|
135
|
+
const date = new Date()
|
|
129
136
|
date.setMonth(date.getMonth() - 1)
|
|
130
|
-
return date
|
|
137
|
+
return formatLocalDate(date)
|
|
131
138
|
})(),
|
|
132
139
|
handlers: { change: this._modifyDateRange.bind(this) }
|
|
133
140
|
},
|
|
@@ -138,13 +145,13 @@ class InboundSerialNumberReport extends connect(store)(localize(i18next)(PageVie
|
|
|
138
145
|
props: {
|
|
139
146
|
searchOper: 'eq',
|
|
140
147
|
min: (() => {
|
|
141
|
-
|
|
148
|
+
const date = new Date()
|
|
142
149
|
date.setMonth(date.getMonth() - 1)
|
|
143
|
-
return date
|
|
150
|
+
return formatLocalDate(date)
|
|
144
151
|
})(),
|
|
145
|
-
max: new Date()
|
|
152
|
+
max: formatLocalDate(new Date())
|
|
146
153
|
},
|
|
147
|
-
value: new Date()
|
|
154
|
+
value: formatLocalDate(new Date()),
|
|
148
155
|
handlers: { change: this._submit.bind(this) }
|
|
149
156
|
},
|
|
150
157
|
{
|
|
@@ -493,17 +500,18 @@ class InboundSerialNumberReport extends connect(store)(localize(i18next)(PageVie
|
|
|
493
500
|
|
|
494
501
|
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
495
502
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
503
|
+
const minDate = new Date(fromDate)
|
|
504
|
+
if (Number.isNaN(minDate.getTime())) return
|
|
505
|
+
|
|
506
|
+
const maxDate = new Date(minDate)
|
|
507
|
+
maxDate.setMonth(maxDate.getMonth() + 1)
|
|
508
|
+
maxDate.setDate(maxDate.getDate() - 1)
|
|
509
|
+
|
|
510
|
+
const min = formatLocalDate(minDate)
|
|
511
|
+
const max = formatLocalDate(maxDate)
|
|
502
512
|
|
|
503
|
-
|
|
504
|
-
max = max.toISOString().split('T')[0]
|
|
513
|
+
if (this._toDateInput.value > max) this._toDateInput.value = max
|
|
505
514
|
|
|
506
|
-
this._toDateInput.value = max
|
|
507
515
|
this._toDateInput.max = max
|
|
508
516
|
this._toDateInput.min = min
|
|
509
517
|
this._submit()
|
|
@@ -9,6 +9,13 @@ import { i18next, localize } from '@things-factory/i18n-base'
|
|
|
9
9
|
import { client, PageView, store } from '@things-factory/shell'
|
|
10
10
|
import { flattenObject } from '@things-factory/utils'
|
|
11
11
|
|
|
12
|
+
function formatLocalDate(date = new Date()) {
|
|
13
|
+
const year = date.getFullYear()
|
|
14
|
+
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
15
|
+
const day = String(date.getDate()).padStart(2, '0')
|
|
16
|
+
return `${year}-${month}-${day}`
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
class InventoryPalletReport extends connect(store)(localize(i18next)(PageView)) {
|
|
13
20
|
static get styles() {
|
|
14
21
|
return css`
|
|
@@ -106,12 +113,12 @@ class InventoryPalletReport extends connect(store)(localize(i18next)(PageView))
|
|
|
106
113
|
type: 'date',
|
|
107
114
|
props: {
|
|
108
115
|
searchOper: 'eq',
|
|
109
|
-
max: new Date()
|
|
116
|
+
max: formatLocalDate(new Date())
|
|
110
117
|
},
|
|
111
118
|
value: (() => {
|
|
112
|
-
|
|
119
|
+
const date = new Date()
|
|
113
120
|
date.setMonth(date.getMonth() - 1)
|
|
114
|
-
return date
|
|
121
|
+
return formatLocalDate(date)
|
|
115
122
|
})(),
|
|
116
123
|
handlers: { change: this._modifyDateRange.bind(this) }
|
|
117
124
|
},
|
|
@@ -122,13 +129,13 @@ class InventoryPalletReport extends connect(store)(localize(i18next)(PageView))
|
|
|
122
129
|
props: {
|
|
123
130
|
searchOper: 'eq',
|
|
124
131
|
min: (() => {
|
|
125
|
-
|
|
132
|
+
const date = new Date()
|
|
126
133
|
date.setMonth(date.getMonth() - 1)
|
|
127
|
-
return date
|
|
134
|
+
return formatLocalDate(date)
|
|
128
135
|
})(),
|
|
129
|
-
max: new Date()
|
|
136
|
+
max: formatLocalDate(new Date())
|
|
130
137
|
},
|
|
131
|
-
value: new Date()
|
|
138
|
+
value: formatLocalDate(new Date())
|
|
132
139
|
}
|
|
133
140
|
]
|
|
134
141
|
}
|
|
@@ -286,12 +293,10 @@ class InventoryPalletReport extends connect(store)(localize(i18next)(PageView))
|
|
|
286
293
|
|
|
287
294
|
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
288
295
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
today.setHours(0, 0, 0, 0)
|
|
292
|
-
|
|
293
|
-
min = min.toISOString().split('T')[0]
|
|
296
|
+
const minDate = new Date(fromDate)
|
|
297
|
+
if (Number.isNaN(minDate.getTime())) return
|
|
294
298
|
|
|
299
|
+
const min = formatLocalDate(minDate)
|
|
295
300
|
this._toDateInput.min = min
|
|
296
301
|
}
|
|
297
302
|
}
|
|
@@ -10,6 +10,13 @@ import { i18next, localize } from '@things-factory/i18n-base'
|
|
|
10
10
|
import { client, PageView, store } from '@things-factory/shell'
|
|
11
11
|
import { flattenObject, isMobileDevice } from '@things-factory/utils'
|
|
12
12
|
|
|
13
|
+
function formatLocalDate(date = new Date()) {
|
|
14
|
+
const year = date.getFullYear()
|
|
15
|
+
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
16
|
+
const day = String(date.getDate()).padStart(2, '0')
|
|
17
|
+
return `${year}-${month}-${day}`
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
class InventoryPalletStorageReport extends connect(store)(localize(i18next)(PageView)) {
|
|
14
21
|
static get styles() {
|
|
15
22
|
return css`
|
|
@@ -132,12 +139,12 @@ class InventoryPalletStorageReport extends connect(store)(localize(i18next)(Page
|
|
|
132
139
|
type: 'date',
|
|
133
140
|
props: {
|
|
134
141
|
searchOper: 'eq',
|
|
135
|
-
max: new Date()
|
|
142
|
+
max: formatLocalDate(new Date())
|
|
136
143
|
},
|
|
137
144
|
value: (() => {
|
|
138
|
-
|
|
145
|
+
const date = new Date()
|
|
139
146
|
date.setMonth(date.getMonth() - 1)
|
|
140
|
-
return date
|
|
147
|
+
return formatLocalDate(date)
|
|
141
148
|
})(),
|
|
142
149
|
handlers: { change: this._modifyDateRange.bind(this) }
|
|
143
150
|
},
|
|
@@ -148,13 +155,13 @@ class InventoryPalletStorageReport extends connect(store)(localize(i18next)(Page
|
|
|
148
155
|
props: {
|
|
149
156
|
searchOper: 'eq',
|
|
150
157
|
min: (() => {
|
|
151
|
-
|
|
158
|
+
const date = new Date()
|
|
152
159
|
date.setMonth(date.getMonth() - 1)
|
|
153
|
-
return date
|
|
160
|
+
return formatLocalDate(date)
|
|
154
161
|
})(),
|
|
155
|
-
max: new Date()
|
|
162
|
+
max: formatLocalDate(new Date())
|
|
156
163
|
},
|
|
157
|
-
value: new Date()
|
|
164
|
+
value: formatLocalDate(new Date())
|
|
158
165
|
},
|
|
159
166
|
{
|
|
160
167
|
label: i18next.t('field.location_type'),
|
|
@@ -380,12 +387,10 @@ class InventoryPalletStorageReport extends connect(store)(localize(i18next)(Page
|
|
|
380
387
|
|
|
381
388
|
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
382
389
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
today.setHours(0, 0, 0, 0)
|
|
386
|
-
|
|
387
|
-
min = min.toISOString().split('T')[0]
|
|
390
|
+
const minDate = new Date(fromDate)
|
|
391
|
+
if (Number.isNaN(minDate.getTime())) return
|
|
388
392
|
|
|
393
|
+
const min = formatLocalDate(minDate)
|
|
389
394
|
this._toDateInput.min = min
|
|
390
395
|
}
|
|
391
396
|
|
|
@@ -9,6 +9,13 @@ import { i18next, localize } from '@things-factory/i18n-base'
|
|
|
9
9
|
import { client, PageView, store } from '@things-factory/shell'
|
|
10
10
|
import { flattenObject } from '@things-factory/utils'
|
|
11
11
|
|
|
12
|
+
function formatLocalDate(date = new Date()) {
|
|
13
|
+
const year = date.getFullYear()
|
|
14
|
+
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
15
|
+
const day = String(date.getDate()).padStart(2, '0')
|
|
16
|
+
return `${year}-${month}-${day}`
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
class InventoryReport extends connect(store)(localize(i18next)(PageView)) {
|
|
13
20
|
static get styles() {
|
|
14
21
|
return css`
|
|
@@ -108,12 +115,12 @@ class InventoryReport extends connect(store)(localize(i18next)(PageView)) {
|
|
|
108
115
|
type: 'date',
|
|
109
116
|
props: {
|
|
110
117
|
searchOper: 'eq',
|
|
111
|
-
max: new Date()
|
|
118
|
+
max: formatLocalDate(new Date())
|
|
112
119
|
},
|
|
113
120
|
value: (() => {
|
|
114
|
-
|
|
121
|
+
const date = new Date()
|
|
115
122
|
date.setMonth(date.getMonth() - 1)
|
|
116
|
-
return date
|
|
123
|
+
return formatLocalDate(date)
|
|
117
124
|
})(),
|
|
118
125
|
handlers: { change: this._modifyDateRange.bind(this) }
|
|
119
126
|
},
|
|
@@ -124,13 +131,13 @@ class InventoryReport extends connect(store)(localize(i18next)(PageView)) {
|
|
|
124
131
|
props: {
|
|
125
132
|
searchOper: 'eq',
|
|
126
133
|
min: (() => {
|
|
127
|
-
|
|
134
|
+
const date = new Date()
|
|
128
135
|
date.setMonth(date.getMonth() - 1)
|
|
129
|
-
return date
|
|
136
|
+
return formatLocalDate(date)
|
|
130
137
|
})(),
|
|
131
|
-
max: new Date()
|
|
138
|
+
max: formatLocalDate(new Date())
|
|
132
139
|
},
|
|
133
|
-
value: new Date()
|
|
140
|
+
value: formatLocalDate(new Date()),
|
|
134
141
|
handlers: { change: this._modifyDateRange.bind(this) }
|
|
135
142
|
},
|
|
136
143
|
{
|
|
@@ -389,27 +396,29 @@ class InventoryReport extends connect(store)(localize(i18next)(PageView)) {
|
|
|
389
396
|
if (e.currentTarget.name == 'fromDate') {
|
|
390
397
|
const fromDate = e.currentTarget.value
|
|
391
398
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
maxToDate = maxToDate.toISOString().split('T')[0]
|
|
395
|
-
if (this._toDateInput.value > maxToDate) this._toDateInput.value = maxToDate
|
|
396
|
-
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
399
|
+
const from = new Date(fromDate)
|
|
400
|
+
if (Number.isNaN(from.getTime())) return
|
|
397
401
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
402
|
+
const maxTo = new Date(from)
|
|
403
|
+
maxTo.setDate(maxTo.getDate() + 31)
|
|
404
|
+
const maxToStr = formatLocalDate(maxTo)
|
|
401
405
|
|
|
402
|
-
|
|
406
|
+
if (this._toDateInput.value > maxToStr) this._toDateInput.value = maxToStr
|
|
407
|
+
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
403
408
|
|
|
409
|
+
const min = formatLocalDate(from)
|
|
404
410
|
this._toDateInput.min = min
|
|
405
411
|
}
|
|
406
412
|
if (e.currentTarget.name == 'toDate') {
|
|
407
413
|
const toDate = e.currentTarget.value
|
|
408
|
-
|
|
414
|
+
const to = new Date(toDate)
|
|
415
|
+
if (Number.isNaN(to.getTime())) return
|
|
416
|
+
|
|
417
|
+
const maxFromDate = new Date(to)
|
|
409
418
|
maxFromDate.setDate(maxFromDate.getDate() - 31)
|
|
410
|
-
|
|
419
|
+
const maxFromStr = formatLocalDate(maxFromDate)
|
|
411
420
|
|
|
412
|
-
if (this._fromDateInput.value <
|
|
421
|
+
if (this._fromDateInput.value < maxFromStr) this._fromDateInput.value = maxFromStr
|
|
413
422
|
}
|
|
414
423
|
}
|
|
415
424
|
|
|
@@ -12,6 +12,13 @@ import { openPopup } from '@things-factory/layout-base'
|
|
|
12
12
|
import { client, PageView, store } from '@things-factory/shell'
|
|
13
13
|
import { flattenObject, isMobileDevice } from '@things-factory/utils'
|
|
14
14
|
|
|
15
|
+
function formatLocalDate(date = new Date()) {
|
|
16
|
+
const year = date.getFullYear()
|
|
17
|
+
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
18
|
+
const day = String(date.getDate()).padStart(2, '0')
|
|
19
|
+
return `${year}-${month}-${day}`
|
|
20
|
+
}
|
|
21
|
+
|
|
15
22
|
class InventorySummaryReport extends connect(store)(localize(i18next)(PageView)) {
|
|
16
23
|
static get styles() {
|
|
17
24
|
return css`
|
|
@@ -139,12 +146,12 @@ class InventorySummaryReport extends connect(store)(localize(i18next)(PageView))
|
|
|
139
146
|
type: 'date',
|
|
140
147
|
props: {
|
|
141
148
|
searchOper: 'eq',
|
|
142
|
-
max: new Date()
|
|
149
|
+
max: formatLocalDate(new Date())
|
|
143
150
|
},
|
|
144
151
|
value: (() => {
|
|
145
|
-
|
|
152
|
+
const date = new Date()
|
|
146
153
|
date.setMonth(date.getMonth() - 1)
|
|
147
|
-
return date
|
|
154
|
+
return formatLocalDate(date)
|
|
148
155
|
})(),
|
|
149
156
|
handlers: { change: this._modifyDateRange.bind(this) }
|
|
150
157
|
},
|
|
@@ -155,17 +162,16 @@ class InventorySummaryReport extends connect(store)(localize(i18next)(PageView))
|
|
|
155
162
|
props: {
|
|
156
163
|
searchOper: 'eq',
|
|
157
164
|
min: (() => {
|
|
158
|
-
|
|
165
|
+
const date = new Date()
|
|
159
166
|
date.setMonth(date.getMonth() - 1)
|
|
160
|
-
return date
|
|
167
|
+
return formatLocalDate(date)
|
|
161
168
|
})(),
|
|
162
169
|
max: (() => {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
return max.toISOString().split('T')[0]
|
|
170
|
+
const max = new Date()
|
|
171
|
+
return formatLocalDate(max)
|
|
166
172
|
})()
|
|
167
173
|
},
|
|
168
|
-
value: new Date()
|
|
174
|
+
value: formatLocalDate(new Date()),
|
|
169
175
|
handlers: { change: this._submit.bind(this) }
|
|
170
176
|
},
|
|
171
177
|
{
|
|
@@ -464,7 +470,10 @@ class InventorySummaryReport extends connect(store)(localize(i18next)(PageView))
|
|
|
464
470
|
|
|
465
471
|
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
466
472
|
|
|
467
|
-
|
|
473
|
+
const minDate = new Date(fromDate)
|
|
474
|
+
if (Number.isNaN(minDate.getTime())) return
|
|
475
|
+
|
|
476
|
+
const min = formatLocalDate(minDate)
|
|
468
477
|
this._toDateInput.min = min
|
|
469
478
|
this._submit()
|
|
470
479
|
}
|
|
@@ -523,7 +532,7 @@ class InventorySummaryReport extends connect(store)(localize(i18next)(PageView))
|
|
|
523
532
|
{ header: i18next.t('field.inbound_qty'), key: 'totalInQty', width: 25, type: 'string' },
|
|
524
533
|
{ header: i18next.t('field.adjusted_qty'), key: 'adjustmentQty', width: 25, type: 'string' },
|
|
525
534
|
{ header: i18next.t('field.outbound_qty'), key: 'totalOutQty', width: 25, type: 'string' },
|
|
526
|
-
{ header: i18next.t('field.missing_qty'), key:'missingQty', width: 25, type: 'string'},
|
|
535
|
+
{ header: i18next.t('field.missing_qty'), key: 'missingQty', width: 25, type: 'string' },
|
|
527
536
|
{ header: i18next.t('field.closing_balance'), key: 'closingQty', width: 25, type: 'string' }
|
|
528
537
|
]
|
|
529
538
|
|
|
@@ -9,6 +9,13 @@ import { client, navigate, PageView } from '@things-factory/shell'
|
|
|
9
9
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
10
10
|
import { flattenObject, isMobileDevice } from '@things-factory/utils'
|
|
11
11
|
|
|
12
|
+
function formatLocalDate(date = new Date()) {
|
|
13
|
+
const year = date.getFullYear()
|
|
14
|
+
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
15
|
+
const day = String(date.getDate()).padStart(2, '0')
|
|
16
|
+
return `${year}-${month}-${day}`
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
class JobSheetList extends localize(i18next)(PageView) {
|
|
13
20
|
static get styles() {
|
|
14
21
|
return [
|
|
@@ -118,13 +125,13 @@ class JobSheetList extends localize(i18next)(PageView) {
|
|
|
118
125
|
type: 'date',
|
|
119
126
|
props: {
|
|
120
127
|
searchOper: 'eq',
|
|
121
|
-
max: new Date()
|
|
128
|
+
max: formatLocalDate(new Date())
|
|
122
129
|
},
|
|
123
130
|
attrs: ['custom'],
|
|
124
131
|
value: (() => {
|
|
125
|
-
|
|
132
|
+
const date = new Date()
|
|
126
133
|
date.setMonth(date.getMonth() - 1)
|
|
127
|
-
return date
|
|
134
|
+
return formatLocalDate(date)
|
|
128
135
|
})(),
|
|
129
136
|
handlers: { change: this._modifyDateRange.bind(this) }
|
|
130
137
|
},
|
|
@@ -135,14 +142,14 @@ class JobSheetList extends localize(i18next)(PageView) {
|
|
|
135
142
|
props: {
|
|
136
143
|
searchOper: 'eq',
|
|
137
144
|
min: (() => {
|
|
138
|
-
|
|
145
|
+
const date = new Date()
|
|
139
146
|
date.setMonth(date.getMonth() - 1)
|
|
140
|
-
return date
|
|
147
|
+
return formatLocalDate(date)
|
|
141
148
|
})(),
|
|
142
|
-
max: new Date()
|
|
149
|
+
max: formatLocalDate(new Date())
|
|
143
150
|
},
|
|
144
151
|
attrs: ['custom'],
|
|
145
|
-
value: new Date()
|
|
152
|
+
value: formatLocalDate(new Date())
|
|
146
153
|
}
|
|
147
154
|
]
|
|
148
155
|
|
|
@@ -295,17 +302,21 @@ class JobSheetList extends localize(i18next)(PageView) {
|
|
|
295
302
|
_modifyDateRange(e) {
|
|
296
303
|
this._toDateInput.value = ''
|
|
297
304
|
const fromDate = e.currentTarget.value
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
305
|
+
const minDate = new Date(fromDate)
|
|
306
|
+
if (Number.isNaN(minDate.getTime())) return
|
|
307
|
+
|
|
308
|
+
const maxDate = new Date(minDate)
|
|
309
|
+
maxDate.setMonth(maxDate.getMonth() + 1)
|
|
310
|
+
maxDate.setHours(0, 0, 0, 0)
|
|
311
|
+
|
|
312
|
+
const today = new Date()
|
|
303
313
|
today.setDate(today.getDate() + 1)
|
|
304
314
|
today.setHours(0, 0, 0, 0)
|
|
305
315
|
|
|
306
|
-
if (
|
|
307
|
-
|
|
308
|
-
|
|
316
|
+
if (maxDate >= today) maxDate.setTime(today.getTime())
|
|
317
|
+
|
|
318
|
+
const min = formatLocalDate(minDate)
|
|
319
|
+
const max = formatLocalDate(maxDate)
|
|
309
320
|
|
|
310
321
|
// this._fromDateInput.max = max
|
|
311
322
|
this._toDateInput.min = min
|
|
@@ -9,6 +9,13 @@ import { client, gqlContext, PageView } from '@things-factory/shell'
|
|
|
9
9
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
10
10
|
import { isMobileDevice } from '@things-factory/utils'
|
|
11
11
|
|
|
12
|
+
function formatLocalDate(date = new Date()) {
|
|
13
|
+
const year = date.getFullYear()
|
|
14
|
+
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
15
|
+
const day = String(date.getDate()).padStart(2, '0')
|
|
16
|
+
return `${year}-${month}-${day}`
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
class ManifestReport extends localize(i18next)(PageView) {
|
|
13
20
|
static get styles() {
|
|
14
21
|
return [
|
|
@@ -129,12 +136,12 @@ class ManifestReport extends localize(i18next)(PageView) {
|
|
|
129
136
|
type: 'date',
|
|
130
137
|
props: {
|
|
131
138
|
searchOper: 'eq',
|
|
132
|
-
max: new Date()
|
|
139
|
+
max: formatLocalDate(new Date())
|
|
133
140
|
},
|
|
134
141
|
value: (() => {
|
|
135
|
-
|
|
142
|
+
const date = new Date()
|
|
136
143
|
date.setMonth(date.getMonth() - 1)
|
|
137
|
-
return date
|
|
144
|
+
return formatLocalDate(date)
|
|
138
145
|
})(),
|
|
139
146
|
handlers: { change: this._modifyDateRange.bind(this) }
|
|
140
147
|
},
|
|
@@ -144,14 +151,14 @@ class ManifestReport extends localize(i18next)(PageView) {
|
|
|
144
151
|
type: 'date',
|
|
145
152
|
props: {
|
|
146
153
|
searchOper: 'eq',
|
|
147
|
-
max: new Date()
|
|
154
|
+
max: formatLocalDate(new Date()),
|
|
148
155
|
min: (() => {
|
|
149
|
-
|
|
156
|
+
const date = new Date()
|
|
150
157
|
date.setMonth(date.getMonth() - 1)
|
|
151
|
-
return date
|
|
158
|
+
return formatLocalDate(date)
|
|
152
159
|
})()
|
|
153
160
|
},
|
|
154
|
-
value: new Date()
|
|
161
|
+
value: formatLocalDate(new Date())
|
|
155
162
|
},
|
|
156
163
|
{
|
|
157
164
|
label: i18next.t('field.tracking_no'),
|
|
@@ -391,15 +398,14 @@ class ManifestReport extends localize(i18next)(PageView) {
|
|
|
391
398
|
if (fromDate == '') return
|
|
392
399
|
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
393
400
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
max.setMonth(max.getMonth() + 3)
|
|
401
|
+
const minDate = new Date(fromDate)
|
|
402
|
+
if (Number.isNaN(minDate.getTime())) return
|
|
397
403
|
|
|
398
|
-
|
|
399
|
-
|
|
404
|
+
const maxDate = new Date(minDate)
|
|
405
|
+
maxDate.setMonth(maxDate.getMonth() + 3)
|
|
400
406
|
|
|
401
|
-
min =
|
|
402
|
-
max =
|
|
407
|
+
const min = formatLocalDate(minDate)
|
|
408
|
+
const max = formatLocalDate(maxDate)
|
|
403
409
|
|
|
404
410
|
if (this._toDateInput.value > max) this._toDateInput.value = max
|
|
405
411
|
|
|
@@ -2,23 +2,20 @@ import '@things-factory/form-ui'
|
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
|
|
4
4
|
import gql from 'graphql-tag'
|
|
5
|
-
import {
|
|
6
|
-
css,
|
|
7
|
-
html
|
|
8
|
-
} from 'lit-element'
|
|
5
|
+
import { css, html } from 'lit-element'
|
|
9
6
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
10
7
|
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
localize
|
|
14
|
-
} from '@things-factory/i18n-base'
|
|
15
|
-
import {
|
|
16
|
-
client,
|
|
17
|
-
PageView,
|
|
18
|
-
store
|
|
19
|
-
} from '@things-factory/shell'
|
|
8
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
9
|
+
import { client, PageView, store } from '@things-factory/shell'
|
|
20
10
|
import { flattenObject } from '@things-factory/utils'
|
|
21
11
|
|
|
12
|
+
function formatLocalDate(date = new Date()) {
|
|
13
|
+
const year = date.getFullYear()
|
|
14
|
+
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
15
|
+
const day = String(date.getDate()).padStart(2, '0')
|
|
16
|
+
return `${year}-${month}-${day}`
|
|
17
|
+
}
|
|
18
|
+
|
|
22
19
|
class OrderVasReport extends connect(store)(localize(i18next)(PageView)) {
|
|
23
20
|
static get styles() {
|
|
24
21
|
return css`
|
|
@@ -123,12 +120,12 @@ class OrderVasReport extends connect(store)(localize(i18next)(PageView)) {
|
|
|
123
120
|
type: 'date',
|
|
124
121
|
props: {
|
|
125
122
|
searchOper: 'gte',
|
|
126
|
-
max: new Date()
|
|
123
|
+
max: formatLocalDate(new Date())
|
|
127
124
|
},
|
|
128
125
|
value: (() => {
|
|
129
|
-
|
|
126
|
+
const date = new Date()
|
|
130
127
|
date.setMonth(date.getMonth() - 1)
|
|
131
|
-
return date
|
|
128
|
+
return formatLocalDate(date)
|
|
132
129
|
})(),
|
|
133
130
|
handlers: { change: this._modifyDateRange.bind(this) }
|
|
134
131
|
},
|
|
@@ -138,9 +135,9 @@ class OrderVasReport extends connect(store)(localize(i18next)(PageView)) {
|
|
|
138
135
|
type: 'date',
|
|
139
136
|
props: {
|
|
140
137
|
searchOper: 'lte',
|
|
141
|
-
max: new Date()
|
|
138
|
+
max: formatLocalDate(new Date())
|
|
142
139
|
},
|
|
143
|
-
value: new Date()
|
|
140
|
+
value: formatLocalDate(new Date()),
|
|
144
141
|
handlers: { change: this._modifyDateRange.bind(this) }
|
|
145
142
|
},
|
|
146
143
|
{
|
|
@@ -607,12 +604,10 @@ class OrderVasReport extends connect(store)(localize(i18next)(PageView)) {
|
|
|
607
604
|
|
|
608
605
|
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
609
606
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
today.setHours(0, 0, 0, 0)
|
|
613
|
-
|
|
614
|
-
min = min.toISOString().split('T')[0]
|
|
607
|
+
const minDate = new Date(fromDate)
|
|
608
|
+
if (Number.isNaN(minDate.getTime())) return
|
|
615
609
|
|
|
610
|
+
const min = formatLocalDate(minDate)
|
|
616
611
|
this._toDateInput.min = min
|
|
617
612
|
}
|
|
618
613
|
|