@things-factory/operato-wms 4.3.61 → 4.3.64
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/select-inventory-popup.js +626 -0
- package/client/pages/inbound/unload-product.js +10 -9
- package/client/pages/inventory/inventory-by-product-detail.js +99 -92
- package/client/pages/inventory/inventory-by-product.js +170 -68
- package/client/pages/inventory-check/inspecting-product.js +1 -1
- package/client/pages/order/release-order/b2b/b2b-order-list.js +76 -80
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +93 -81
- package/client/pages/order/release-order/batch-picking-popup.js +11 -0
- package/client/pages/order/release-order/create-release-order.js +258 -252
- package/client/pages/order/release-order/release-extra-product-popup.js +10 -3
- package/client/pages/order/release-order/release-order-detail.js +202 -63
- package/client/pages/order/transport-order/delivery-note-popup.js +12 -17
- package/client/pages/order/transport-order/upload-delivery-note.js +6 -4
- package/client/pages/order/transport-order/view-delivery-note.js +0 -1
- package/client/pages/outbound/generate-worksheet-popup.js +337 -0
- package/client/pages/outbound/inventory-reassign-popup.js +1097 -0
- package/client/pages/outbound/loading-product.js +2 -2
- package/client/pages/outbound/picking-product.js +174 -100
- package/client/pages/outbound/sorting-product.js +5 -5
- package/client/pages/outbound/worksheet-batch-picking.js +39 -5
- package/client/pages/outbound/worksheet-picking.js +45 -6
- package/client/pages/report/outbound-order-details-report.js +181 -49
- package/client/pages/report/release-inventory-report.js +503 -0
- package/client/route.js +5 -0
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js +54 -3
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/index.js +2 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +63 -28
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js +180 -0
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +6 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report.js +14 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/types/reports/release-inventory-report-list.js +14 -0
- package/dist-server/graphql/types/reports/release-inventory-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/release-inventory-report.js +29 -0
- package/dist-server/graphql/types/reports/release-inventory-report.js.map +1 -0
- package/dist-server/utils/report-query-util.js +4 -2
- package/dist-server/utils/report-query-util.js.map +1 -1
- package/helps/release-note.ko.md +13 -7
- package/helps/release-note.md +13 -7
- package/helps/release-note.ms.md +13 -7
- package/helps/release-note.zh.md +13 -7
- package/package.json +9 -9
- package/server/graphql/resolvers/extra/add-release-good-products.ts +66 -3
- package/server/graphql/resolvers/reports/index.ts +3 -1
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +66 -29
- package/server/graphql/resolvers/reports/release-inventory-report.ts +202 -0
- package/server/graphql/types/reports/index.ts +6 -1
- package/server/graphql/types/reports/outbound-order-details-report.ts +14 -1
- package/server/graphql/types/reports/release-inventory-report-list.ts +8 -0
- package/server/graphql/types/reports/release-inventory-report.ts +23 -0
- package/server/utils/report-query-util.ts +4 -2
- package/things-factory.config.js +4 -0
- package/translations/en.json +73 -16
- package/translations/ko.json +157 -110
- package/translations/ms.json +65 -16
- package/translations/zh.json +79 -29
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import '@material/mwc-button/mwc-button'
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
|
+
import './inventory-history-by-pallet'
|
|
4
|
+
|
|
5
|
+
import gql from 'graphql-tag'
|
|
6
|
+
import { css, html, LitElement } from 'lit-element'
|
|
7
|
+
|
|
3
8
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
4
9
|
import { openPopup } from '@things-factory/layout-base'
|
|
5
10
|
import { client } from '@things-factory/shell'
|
|
6
11
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
7
12
|
import { isMobileDevice } from '@things-factory/utils'
|
|
8
|
-
import gql from 'graphql-tag'
|
|
9
|
-
import { css, html, LitElement } from 'lit-element'
|
|
10
|
-
import './inventory-history-by-pallet'
|
|
11
13
|
|
|
12
14
|
class InventoryByProductDetail extends localize(i18next)(LitElement) {
|
|
13
15
|
static get styles() {
|
|
@@ -54,6 +56,54 @@ class InventoryByProductDetail extends localize(i18next)(LitElement) {
|
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
firstUpdated() {
|
|
59
|
+
this._searchFields = [
|
|
60
|
+
{
|
|
61
|
+
label: i18next.t('field.batch_id'),
|
|
62
|
+
name: 'batchId',
|
|
63
|
+
type: 'text',
|
|
64
|
+
props: { searchOper: 'i_like' }
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: i18next.t('field.lot_id'),
|
|
68
|
+
name: 'palletId',
|
|
69
|
+
type: 'text',
|
|
70
|
+
props: { searchOper: 'i_like' }
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: i18next.t('field.carton_id'),
|
|
74
|
+
name: 'cartonId',
|
|
75
|
+
type: 'text',
|
|
76
|
+
props: { searchOper: 'i_like' }
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: i18next.t('field.location'),
|
|
80
|
+
name: 'location',
|
|
81
|
+
type: 'object',
|
|
82
|
+
queryName: 'locations',
|
|
83
|
+
field: 'name'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
label: i18next.t('field.expirying_in'),
|
|
87
|
+
name: 'expiryingIn',
|
|
88
|
+
type: 'select',
|
|
89
|
+
options: [
|
|
90
|
+
{ value: '' },
|
|
91
|
+
{ name: i18next.t('text.3_months'), value: '3 months' },
|
|
92
|
+
{ name: i18next.t('text.6_months'), value: '6 months' },
|
|
93
|
+
{ name: i18next.t('text.9_months'), value: '9 months' },
|
|
94
|
+
{ name: i18next.t('text.12_months'), value: '12 months' }
|
|
95
|
+
],
|
|
96
|
+
props: { searchOper: 'eq' }
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: i18next.t('field.has_balance'),
|
|
100
|
+
name: 'remainOnly',
|
|
101
|
+
type: 'checkbox',
|
|
102
|
+
value: true,
|
|
103
|
+
props: { searchOper: 'eq' }
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
|
|
57
107
|
this.config = {
|
|
58
108
|
list: { fields: ['palletId', 'batchId', 'orderRefNo', 'orderNo', 'zone', 'location', 'qty', 'batchIdRef'] },
|
|
59
109
|
rows: { appendable: false },
|
|
@@ -68,39 +118,28 @@ class InventoryByProductDetail extends localize(i18next)(LitElement) {
|
|
|
68
118
|
},
|
|
69
119
|
{
|
|
70
120
|
type: 'string',
|
|
71
|
-
name: '
|
|
72
|
-
header: i18next.t('field.
|
|
73
|
-
sortable: true,
|
|
121
|
+
name: 'batchId',
|
|
122
|
+
header: i18next.t('field.batch_id'),
|
|
74
123
|
width: 200
|
|
75
124
|
},
|
|
76
125
|
{
|
|
77
126
|
type: 'string',
|
|
78
|
-
name: '
|
|
79
|
-
header: i18next.t('field.
|
|
80
|
-
sortable: true,
|
|
127
|
+
name: 'palletId',
|
|
128
|
+
header: i18next.t('field.lot_id'),
|
|
81
129
|
width: 200
|
|
82
130
|
},
|
|
83
131
|
{
|
|
84
132
|
type: 'string',
|
|
85
|
-
name: '
|
|
86
|
-
header: i18next.t('field.
|
|
87
|
-
sortable: true,
|
|
133
|
+
name: 'cartonId',
|
|
134
|
+
header: i18next.t('field.carton_id'),
|
|
88
135
|
width: 200
|
|
89
136
|
},
|
|
90
137
|
{
|
|
91
138
|
type: 'string',
|
|
92
139
|
name: 'packingType',
|
|
93
140
|
header: i18next.t('field.packing_type'),
|
|
94
|
-
sortable: true,
|
|
95
141
|
width: 200
|
|
96
142
|
},
|
|
97
|
-
{
|
|
98
|
-
type: 'string',
|
|
99
|
-
name: 'zone',
|
|
100
|
-
header: i18next.t('field.zone'),
|
|
101
|
-
sortable: true,
|
|
102
|
-
width: 80
|
|
103
|
-
},
|
|
104
143
|
{
|
|
105
144
|
type: 'object',
|
|
106
145
|
name: 'location',
|
|
@@ -108,31 +147,24 @@ class InventoryByProductDetail extends localize(i18next)(LitElement) {
|
|
|
108
147
|
sortable: true,
|
|
109
148
|
width: 200
|
|
110
149
|
},
|
|
111
|
-
{
|
|
112
|
-
type: 'number',
|
|
113
|
-
name: 'qty',
|
|
114
|
-
header: i18next.t('field.qty'),
|
|
115
|
-
sortable: true,
|
|
116
|
-
width: 80
|
|
117
|
-
},
|
|
118
150
|
{
|
|
119
151
|
type: 'number',
|
|
120
152
|
name: 'lockedQty',
|
|
121
153
|
header: i18next.t('field.release_qty'),
|
|
122
|
-
sortable:
|
|
154
|
+
sortable: true,
|
|
123
155
|
width: 160
|
|
124
156
|
},
|
|
125
157
|
{
|
|
126
158
|
type: 'number',
|
|
127
|
-
name: '
|
|
128
|
-
header: i18next.t('field.
|
|
159
|
+
name: 'qty',
|
|
160
|
+
header: i18next.t('field.available_qty'),
|
|
129
161
|
sortable: true,
|
|
130
|
-
width:
|
|
162
|
+
width: 80
|
|
131
163
|
},
|
|
132
164
|
{
|
|
133
165
|
type: 'string',
|
|
134
166
|
name: 'uomValue',
|
|
135
|
-
header: i18next.t('field.
|
|
167
|
+
header: i18next.t('field.available_uom_value'),
|
|
136
168
|
sortable: true,
|
|
137
169
|
width: 80
|
|
138
170
|
},
|
|
@@ -140,52 +172,24 @@ class InventoryByProductDetail extends localize(i18next)(LitElement) {
|
|
|
140
172
|
type: 'string',
|
|
141
173
|
name: 'batchIdRef',
|
|
142
174
|
header: i18next.t('field.batch_no_ref'),
|
|
175
|
+
width: 200
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
type: 'date',
|
|
179
|
+
name: 'expirationDate',
|
|
180
|
+
header: i18next.t('field.expiry_date'),
|
|
181
|
+
sortable: true,
|
|
182
|
+
width: 200
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'date',
|
|
186
|
+
name: 'manufactureDate',
|
|
187
|
+
header: i18next.t('field.manufacture_date'),
|
|
143
188
|
sortable: true,
|
|
144
189
|
width: 200
|
|
145
190
|
}
|
|
146
191
|
]
|
|
147
192
|
}
|
|
148
|
-
|
|
149
|
-
this._searchFields = [
|
|
150
|
-
{
|
|
151
|
-
label: i18next.t('field.batch_id'),
|
|
152
|
-
name: 'batchId',
|
|
153
|
-
type: 'text',
|
|
154
|
-
props: { searchOper: 'i_like' }
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
label: i18next.t('field.lot_id'),
|
|
158
|
-
name: 'palletId',
|
|
159
|
-
type: 'text',
|
|
160
|
-
props: { searchOper: 'i_like' }
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
label: i18next.t('field.carton_id'),
|
|
164
|
-
name: 'cartonId',
|
|
165
|
-
type: 'text',
|
|
166
|
-
props: { searchOper: 'i_like' }
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
label: i18next.t('field.location'),
|
|
170
|
-
name: 'location',
|
|
171
|
-
type: 'object',
|
|
172
|
-
queryName: 'locations',
|
|
173
|
-
field: 'name'
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
label: i18next.t('field.zone'),
|
|
177
|
-
name: 'zone',
|
|
178
|
-
type: 'text',
|
|
179
|
-
props: { searchOper: 'i_like' }
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
label: i18next.t('field.has_balance'),
|
|
183
|
-
name: 'remainOnly',
|
|
184
|
-
type: 'checkbox',
|
|
185
|
-
value: true,
|
|
186
|
-
props: { searchOper: 'eq' }
|
|
187
|
-
}
|
|
188
|
-
]
|
|
189
193
|
}
|
|
190
194
|
|
|
191
195
|
get dataGrist() {
|
|
@@ -199,35 +203,38 @@ class InventoryByProductDetail extends localize(i18next)(LitElement) {
|
|
|
199
203
|
async fetchHandler({ page, limit, sorters = [] }) {
|
|
200
204
|
try {
|
|
201
205
|
if (!this.productId) return
|
|
202
|
-
|
|
206
|
+
let filters = await this.searchForm.getQueryFilters()
|
|
207
|
+
|
|
208
|
+
if (filters && filters.length > 2 && filters.find(filter => filter.name == 'remainOnly')) {
|
|
209
|
+
// only supports 2 filters including remainOnly (because its a boolean)
|
|
210
|
+
this._showToast({ type: 'warning', message: i18next.t('text.only_supports_search_of_single_field') })
|
|
211
|
+
return
|
|
212
|
+
} else if (!filters.find(filter => filter.name == 'remainOnly')) {
|
|
213
|
+
// when popup init, it doesnt capture the value of this field
|
|
214
|
+
// hence, we need to push a default value as follows
|
|
215
|
+
filters.push({ name: 'remainOnly', operator: 'eq', value: true })
|
|
216
|
+
}
|
|
217
|
+
|
|
203
218
|
const response = await client.query({
|
|
204
219
|
query: gql`
|
|
205
220
|
query inventories($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
206
221
|
inventories(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
207
222
|
items {
|
|
208
|
-
|
|
223
|
+
batchId
|
|
209
224
|
palletId
|
|
210
225
|
cartonId
|
|
211
|
-
|
|
212
|
-
batchIdRef
|
|
213
|
-
qty
|
|
214
|
-
uomValue
|
|
215
|
-
uom
|
|
216
|
-
remainQty
|
|
217
|
-
warehouse {
|
|
218
|
-
name
|
|
219
|
-
description
|
|
220
|
-
}
|
|
221
|
-
zone
|
|
226
|
+
packingType
|
|
222
227
|
location {
|
|
223
228
|
name
|
|
224
229
|
description
|
|
225
230
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
+
uom
|
|
232
|
+
remainQty
|
|
233
|
+
qty
|
|
234
|
+
uomValue
|
|
235
|
+
batchIdRef
|
|
236
|
+
expirationDate
|
|
237
|
+
manufactureDate
|
|
231
238
|
}
|
|
232
239
|
total
|
|
233
240
|
}
|
|
@@ -237,7 +244,7 @@ class InventoryByProductDetail extends localize(i18next)(LitElement) {
|
|
|
237
244
|
filters: [
|
|
238
245
|
...filters,
|
|
239
246
|
{ name: 'product_id', operator: 'eq', value: this.productId },
|
|
240
|
-
{ name: 'status', operator: 'in', value: ['STORED', 'TERMINATED','MISSING'] }
|
|
247
|
+
{ name: 'status', operator: 'in', value: ['STORED', 'TERMINATED', 'MISSING'] }
|
|
241
248
|
],
|
|
242
249
|
pagination: { page, limit },
|
|
243
250
|
sortings: sorters
|
|
@@ -15,6 +15,7 @@ import { isMobileDevice } from '@things-factory/utils'
|
|
|
15
15
|
class InventoryByProduct extends localize(i18next)(PageView) {
|
|
16
16
|
static get properties() {
|
|
17
17
|
return {
|
|
18
|
+
_checkedBoxes: Array,
|
|
18
19
|
_searchFields: Array,
|
|
19
20
|
config: Object,
|
|
20
21
|
data: Object
|
|
@@ -43,6 +44,11 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
43
44
|
]
|
|
44
45
|
}
|
|
45
46
|
|
|
47
|
+
constructor() {
|
|
48
|
+
super()
|
|
49
|
+
this._checkedBoxes = []
|
|
50
|
+
}
|
|
51
|
+
|
|
46
52
|
render() {
|
|
47
53
|
return html`
|
|
48
54
|
<search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
|
|
@@ -70,12 +76,8 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
70
76
|
return this.shadowRoot.querySelector('search-form')
|
|
71
77
|
}
|
|
72
78
|
|
|
73
|
-
get
|
|
74
|
-
return this.searchForm.shadowRoot.querySelector('input[name=
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
get _overStockCheckbox() {
|
|
78
|
-
return this.searchForm.shadowRoot.querySelector('input[name=overStock]')
|
|
79
|
+
get _availabletockCheckbox() {
|
|
80
|
+
return this.searchForm.shadowRoot.querySelector('input[name=availableStock]')
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
get dataGrist() {
|
|
@@ -84,6 +86,9 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
84
86
|
|
|
85
87
|
pageUpdated(changes, lifecycle) {
|
|
86
88
|
if (this.active) {
|
|
89
|
+
if (this._availabletockCheckbox && !this._checkedBoxes.length)
|
|
90
|
+
this._checkedBoxes = [this._availabletockCheckbox, { name: 'temp', checked: false }]
|
|
91
|
+
|
|
87
92
|
this.dataGrist.fetch()
|
|
88
93
|
}
|
|
89
94
|
}
|
|
@@ -95,17 +100,25 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
95
100
|
label: i18next.t('field.company'),
|
|
96
101
|
name: 'bizplace',
|
|
97
102
|
type: 'select',
|
|
98
|
-
options:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
options:
|
|
104
|
+
partners?.length == 1
|
|
105
|
+
? [
|
|
106
|
+
{
|
|
107
|
+
name: `${partners[0].name} ${partners[0].description ? `(${partners[0].description})` : ''}`,
|
|
108
|
+
value: partners[0].id
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
: [
|
|
112
|
+
{ value: '' },
|
|
113
|
+
...partners
|
|
114
|
+
.map(partner => {
|
|
115
|
+
return {
|
|
116
|
+
name: `${partner.name} ${partner.description ? `(${partner.description})` : ''}`,
|
|
117
|
+
value: partner.id
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
.sort(this._compareValues('name', 'asc'))
|
|
121
|
+
],
|
|
109
122
|
props: { searchOper: 'eq' }
|
|
110
123
|
},
|
|
111
124
|
{
|
|
@@ -115,18 +128,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
115
128
|
props: { searchOper: 'eq' }
|
|
116
129
|
},
|
|
117
130
|
{
|
|
118
|
-
label: i18next.t('field.
|
|
119
|
-
name: '
|
|
131
|
+
label: i18next.t('field.packing_type'),
|
|
132
|
+
name: 'packingType',
|
|
120
133
|
type: 'string',
|
|
121
134
|
props: { searchOper: 'eq' }
|
|
122
135
|
},
|
|
123
|
-
,
|
|
124
136
|
{
|
|
125
|
-
label: i18next.t('field.
|
|
137
|
+
label: i18next.t('field.available_qty_only'),
|
|
126
138
|
name: 'availableStock',
|
|
127
139
|
type: 'checkbox',
|
|
128
140
|
value: true,
|
|
129
|
-
props: { searchOper: 'eq' }
|
|
141
|
+
props: { searchOper: 'eq' },
|
|
142
|
+
handlers: { change: this._updateSearchInputState.bind(this, 'availableStock') }
|
|
130
143
|
},
|
|
131
144
|
{
|
|
132
145
|
label: i18next.t('field.low_on_stock'),
|
|
@@ -143,6 +156,22 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
143
156
|
value: false,
|
|
144
157
|
props: { searchOper: 'eq' },
|
|
145
158
|
handlers: { change: this._updateSearchInputState.bind(this, 'overStock') }
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
label: i18next.t('field.quarantine_stock_only'),
|
|
162
|
+
name: 'quarantineStock',
|
|
163
|
+
type: 'checkbox',
|
|
164
|
+
value: false,
|
|
165
|
+
props: { searchOper: 'eq' },
|
|
166
|
+
handlers: { change: this._updateSearchInputState.bind(this, 'quarantineStock') }
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: i18next.t('field.reserve_stock_only'),
|
|
170
|
+
name: 'reserveStock',
|
|
171
|
+
type: 'checkbox',
|
|
172
|
+
value: false,
|
|
173
|
+
props: { searchOper: 'eq' },
|
|
174
|
+
handlers: { change: this._updateSearchInputState.bind(this, 'reserveStock') }
|
|
146
175
|
}
|
|
147
176
|
]
|
|
148
177
|
|
|
@@ -167,6 +196,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
167
196
|
header: i18next.t('field.company'),
|
|
168
197
|
imex: { header: i18next.t('field.company'), key: 'bizplace', width: 50, type: 'string' },
|
|
169
198
|
sortable: true,
|
|
199
|
+
label: true,
|
|
170
200
|
width: 300
|
|
171
201
|
},
|
|
172
202
|
{
|
|
@@ -174,6 +204,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
174
204
|
name: 'sku',
|
|
175
205
|
imex: { header: i18next.t('field.sku'), key: 'sku', width: 30, type: 'string' },
|
|
176
206
|
header: i18next.t('field.sku'),
|
|
207
|
+
label: true,
|
|
177
208
|
width: 100
|
|
178
209
|
},
|
|
179
210
|
{
|
|
@@ -181,6 +212,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
181
212
|
name: 'name',
|
|
182
213
|
imex: { header: i18next.t('field.name'), key: 'name', width: 50, type: 'string' },
|
|
183
214
|
header: i18next.t('field.name'),
|
|
215
|
+
label: true,
|
|
184
216
|
width: 200
|
|
185
217
|
},
|
|
186
218
|
{
|
|
@@ -188,6 +220,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
188
220
|
name: 'brand',
|
|
189
221
|
imex: { header: i18next.t('field.brand'), key: 'brand', width: 30, type: 'string' },
|
|
190
222
|
header: i18next.t('field.brand'),
|
|
223
|
+
label: true,
|
|
191
224
|
width: 100
|
|
192
225
|
},
|
|
193
226
|
{
|
|
@@ -195,21 +228,15 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
195
228
|
name: 'description',
|
|
196
229
|
imex: { header: i18next.t('field.description'), key: 'description', width: 50, type: 'string' },
|
|
197
230
|
header: i18next.t('field.description'),
|
|
198
|
-
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
type: 'object',
|
|
202
|
-
name: 'productRef',
|
|
203
|
-
record: { options: { queryName: 'products' } },
|
|
204
|
-
imex: { header: i18next.t('field.product_ref'), key: 'product_ref', width: 50, type: 'string' },
|
|
205
|
-
header: i18next.t('field.product_ref'),
|
|
231
|
+
label: true,
|
|
206
232
|
width: 300
|
|
207
233
|
},
|
|
208
234
|
{
|
|
209
235
|
type: 'string',
|
|
210
|
-
name: '
|
|
211
|
-
imex: { header: i18next.t('field.
|
|
212
|
-
header: i18next.t('field.
|
|
236
|
+
name: 'packingType',
|
|
237
|
+
imex: { header: i18next.t('field.packing_type'), key: 'packingType', width: 25, type: 'string' },
|
|
238
|
+
header: i18next.t('field.packing_type'),
|
|
239
|
+
label: true,
|
|
213
240
|
width: 150
|
|
214
241
|
},
|
|
215
242
|
{
|
|
@@ -217,6 +244,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
217
244
|
name: 'minQty',
|
|
218
245
|
imex: { header: i18next.t('field.min_qty'), key: 'minQty', width: 20, type: 'integer' },
|
|
219
246
|
header: i18next.t('field.min_qty'),
|
|
247
|
+
label: true,
|
|
220
248
|
width: 80
|
|
221
249
|
},
|
|
222
250
|
{
|
|
@@ -224,13 +252,52 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
224
252
|
name: 'maxQty',
|
|
225
253
|
imex: { header: i18next.t('field.max_qty'), key: 'maxQty', width: 20, type: 'integer' },
|
|
226
254
|
header: i18next.t('field.max_qty'),
|
|
255
|
+
label: true,
|
|
256
|
+
width: 80
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
type: 'integer',
|
|
260
|
+
name: 'availableQty',
|
|
261
|
+
imex: { header: i18next.t('field.available_qty'), key: 'availableQty', width: 20, type: 'integer' },
|
|
262
|
+
header: i18next.t('field.available_qty'),
|
|
263
|
+
label: true,
|
|
264
|
+
sortable: true,
|
|
265
|
+
width: 80
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
type: 'integer',
|
|
269
|
+
name: 'releaseQty',
|
|
270
|
+
imex: { header: i18next.t('field.release_qty'), key: 'releaseQty', width: 20, type: 'integer' },
|
|
271
|
+
header: i18next.t('field.release_qty'),
|
|
272
|
+
label: true,
|
|
273
|
+
sortable: true,
|
|
227
274
|
width: 80
|
|
228
275
|
},
|
|
229
276
|
{
|
|
230
277
|
type: 'integer',
|
|
231
|
-
name: '
|
|
232
|
-
imex: { header: i18next.t('field.
|
|
233
|
-
header: i18next.t('field.
|
|
278
|
+
name: 'quarantineQty',
|
|
279
|
+
imex: { header: i18next.t('field.quarantine_qty'), key: 'quarantineQty', width: 20, type: 'integer' },
|
|
280
|
+
header: i18next.t('field.quarantine_qty'),
|
|
281
|
+
label: true,
|
|
282
|
+
sortable: true,
|
|
283
|
+
width: 80
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
type: 'integer',
|
|
287
|
+
name: 'reserveQty',
|
|
288
|
+
imex: { header: i18next.t('field.reserve_qty'), key: 'reserveQty', width: 20, type: 'integer' },
|
|
289
|
+
header: i18next.t('field.reserve_qty'),
|
|
290
|
+
label: true,
|
|
291
|
+
sortable: true,
|
|
292
|
+
width: 80
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
type: 'integer',
|
|
296
|
+
name: 'warehouseQty',
|
|
297
|
+
imex: { header: i18next.t('field.warehouse_qty'), key: 'warehouseQty', width: 20, type: 'integer' },
|
|
298
|
+
header: i18next.t('field.warehouse_qty'),
|
|
299
|
+
label: true,
|
|
300
|
+
sortable: true,
|
|
234
301
|
width: 80
|
|
235
302
|
}
|
|
236
303
|
]
|
|
@@ -249,19 +316,19 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
249
316
|
brand
|
|
250
317
|
name
|
|
251
318
|
description
|
|
252
|
-
type
|
|
253
|
-
bizplace {
|
|
254
|
-
name
|
|
255
|
-
}
|
|
256
|
-
productRef {
|
|
257
|
-
name
|
|
258
|
-
description
|
|
259
|
-
}
|
|
260
319
|
minQty
|
|
261
320
|
maxQty
|
|
262
321
|
}
|
|
263
|
-
|
|
322
|
+
bizplace {
|
|
323
|
+
name
|
|
324
|
+
}
|
|
325
|
+
packingType
|
|
264
326
|
averageUnitCost
|
|
327
|
+
availableQty
|
|
328
|
+
releaseQty
|
|
329
|
+
quarantineQty
|
|
330
|
+
reserveQty
|
|
331
|
+
warehouseQty
|
|
265
332
|
}
|
|
266
333
|
total
|
|
267
334
|
}
|
|
@@ -274,10 +341,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
274
341
|
return {
|
|
275
342
|
total: response.data.inventoriesByProduct.total || 0,
|
|
276
343
|
records: (response.data.inventoriesByProduct.items || []).map(item => {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
344
|
+
// changed to direct assign instead of spread ...item, ...item.product to improve performance
|
|
345
|
+
let record = item.product
|
|
346
|
+
record.packingType = item.packingType
|
|
347
|
+
record.averageUnitCost = item.averageUnitCost
|
|
348
|
+
record.availableQty = item.availableQty
|
|
349
|
+
record.releaseQty = item.releaseQty
|
|
350
|
+
record.quarantineQty = item.quarantineQty
|
|
351
|
+
record.reserveQty = item.reserveQty
|
|
352
|
+
record.warehouseQty = item.warehouseQty
|
|
353
|
+
record.bizplace = item.bizplace
|
|
354
|
+
|
|
355
|
+
return record
|
|
281
356
|
})
|
|
282
357
|
}
|
|
283
358
|
}
|
|
@@ -287,16 +362,44 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
287
362
|
return this.config.columns
|
|
288
363
|
}
|
|
289
364
|
|
|
290
|
-
_updateSearchInputState(
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
365
|
+
_updateSearchInputState(fieldName) {
|
|
366
|
+
const targetField = this.searchForm.shadowRoot.querySelector(`input[name=${fieldName}]`)
|
|
367
|
+
|
|
368
|
+
if (targetField.checked) {
|
|
369
|
+
// clear all previously checked fields
|
|
370
|
+
this._checkedBoxes[1].checked = false
|
|
371
|
+
this._checkedBoxes[0].checked = false
|
|
372
|
+
|
|
373
|
+
const tempIdx = this._checkedBoxes.findIndex(cb => cb.name == 'temp')
|
|
374
|
+
|
|
375
|
+
if (fieldName == 'lowStock' || fieldName == 'overStock') {
|
|
376
|
+
const idx = this._checkedBoxes.findIndex(cb => cb.name == (fieldName == 'lowStock' ? 'overStock' : 'lowStock'))
|
|
377
|
+
if (idx == 1) {
|
|
378
|
+
this._checkedBoxes[1] = targetField
|
|
379
|
+
} else {
|
|
380
|
+
if (tempIdx == 1) {
|
|
381
|
+
this._checkedBoxes[1] = targetField
|
|
382
|
+
} else {
|
|
383
|
+
this._checkedBoxes[0] = this._checkedBoxes[1]
|
|
384
|
+
this._checkedBoxes[1] = targetField
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
} else {
|
|
388
|
+
if (tempIdx == 1) {
|
|
389
|
+
this._checkedBoxes[1] = targetField
|
|
390
|
+
} else {
|
|
391
|
+
this._checkedBoxes[0] = this._checkedBoxes[1]
|
|
392
|
+
this._checkedBoxes[1] = targetField
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// reset all fields in _checkedBoxes array to TRUE
|
|
397
|
+
this._checkedBoxes[1].checked = true
|
|
398
|
+
this._checkedBoxes[0].checked = true
|
|
399
|
+
} else {
|
|
400
|
+
// replace unchecked field with default
|
|
401
|
+
const idx = this._checkedBoxes.findIndex(cb => cb.name == fieldName)
|
|
402
|
+
if (idx >= 0) this._checkedBoxes[idx] = { name: 'temp', checked: false }
|
|
300
403
|
}
|
|
301
404
|
}
|
|
302
405
|
|
|
@@ -321,6 +424,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
321
424
|
return response.data.partnersBizplaces.items
|
|
322
425
|
}
|
|
323
426
|
}
|
|
427
|
+
|
|
324
428
|
_compareValues(key, order = 'asc') {
|
|
325
429
|
return function innerSort(a, b) {
|
|
326
430
|
if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
|
|
@@ -360,11 +464,6 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
360
464
|
})
|
|
361
465
|
|
|
362
466
|
var data = records.map(item => {
|
|
363
|
-
if (item.productRef) {
|
|
364
|
-
var refName = item.productRef.name ? item.productRef.name : ''
|
|
365
|
-
var refDesc = item.productRef.description ? ` (${item.productRef.description})` : ''
|
|
366
|
-
}
|
|
367
|
-
|
|
368
467
|
return {
|
|
369
468
|
...this._columns
|
|
370
469
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
@@ -378,12 +477,15 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
378
477
|
name: item.name,
|
|
379
478
|
sku: item.sku,
|
|
380
479
|
description: item.description,
|
|
381
|
-
|
|
480
|
+
packingType: item.packingType,
|
|
382
481
|
bizplace: item.bizplace.name,
|
|
383
|
-
product_ref: refName + refDesc,
|
|
384
|
-
qty: item.qty,
|
|
385
482
|
minQty: item.minQty,
|
|
386
|
-
maxQty: item.maxQty
|
|
483
|
+
maxQty: item.maxQty,
|
|
484
|
+
availableQty: item.availableQty,
|
|
485
|
+
releaseQty: item.releaseQty,
|
|
486
|
+
quarantineQty: item.quarantineQty,
|
|
487
|
+
reserveQty: item.reserveQty,
|
|
488
|
+
warehouseQty: item.warehouseQty
|
|
387
489
|
// averageUnitCost: item.averageUnitCost
|
|
388
490
|
}
|
|
389
491
|
})
|
|
@@ -1013,7 +1013,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1013
1013
|
async checkOrderInventory() {
|
|
1014
1014
|
try {
|
|
1015
1015
|
const filters = [
|
|
1016
|
-
{ name: '
|
|
1016
|
+
{ name: 'inventoryId', operator: 'eq', value: this.selectedInventory.inventoryId },
|
|
1017
1017
|
{ name: 'status', operator: 'noteq', value: ORDER_INVENTORY_STATUS.TERMINATED.value },
|
|
1018
1018
|
{ name: 'type', operator: 'eq', value: ORDER_TYPES.RELEASE_OF_GOODS.value }
|
|
1019
1019
|
]
|