@things-factory/operato-wms 4.3.110 → 4.3.112

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.
@@ -23,14 +23,12 @@ class BulkOperation extends localize(i18next)(PageView) {
23
23
  display: block;
24
24
  --menu-cards-size: 300px;
25
25
  }
26
-
27
26
  ul {
28
27
  margin: var(--margin-wide) 0;
29
28
  padding: 0;
30
29
  overflow: hidden;
31
30
  list-style: none;
32
31
  }
33
-
34
32
  li {
35
33
  display: block;
36
34
  float: left;
@@ -42,17 +40,14 @@ class BulkOperation extends localize(i18next)(PageView) {
42
40
  padding: var(--padding-default) var(--padding-default) var(--padding-narrow) var(--padding-default);
43
41
  text-align: center;
44
42
  }
45
-
46
43
  li:hover {
47
44
  border: 1px solid var(--primary-color);
48
45
  }
49
-
50
46
  a {
51
47
  cursor: pointer;
52
48
  text-decoration: none;
53
49
  color: var(--secondary-color);
54
50
  }
55
-
56
51
  mwc-icon {
57
52
  font-size: 18px;
58
53
  color: var(--primary-color);
@@ -60,14 +55,12 @@ class BulkOperation extends localize(i18next)(PageView) {
60
55
  border-radius: var(--border-radius);
61
56
  background-color: var(--theme-white-color);
62
57
  }
63
-
64
58
  a,
65
59
  span {
66
60
  overflow: hidden;
67
61
  white-space: nowrap;
68
62
  text-overflow: ellipsis;
69
63
  }
70
-
71
64
  [subtitle] {
72
65
  padding: var(--subtitle-padding);
73
66
  font: var(--subtitle-font);
@@ -77,28 +70,23 @@ class BulkOperation extends localize(i18next)(PageView) {
77
70
  justify-content: center;
78
71
  align-items: center;
79
72
  }
80
-
81
73
  form {
82
74
  display: block;
83
75
  width: var(--menu-cards-size);
84
76
  }
85
-
86
77
  .multi-column-form input {
87
78
  min-width: 85% !important;
88
79
  }
89
-
90
80
  [attachment-wrap] {
91
81
  display: flex;
92
82
  flex-direction: row;
93
83
  justify-content: center;
94
84
  grid-column: span 24;
95
85
  }
96
-
97
86
  [attachment-wrap] file-uploader {
98
87
  flex: 1;
99
88
  background-color: var(--theme-white-color);
100
89
  }
101
-
102
90
  .button-container {
103
91
  padding: var(--button-container-padding);
104
92
  margin: var(--button-container-margin);
@@ -106,7 +94,6 @@ class BulkOperation extends localize(i18next)(PageView) {
106
94
  background-color: var(--button-container-background);
107
95
  height: var(--button-container-height);
108
96
  }
109
-
110
97
  @media screen and (max-width: 600px) {
111
98
  ul {
112
99
  display: grid;
@@ -117,7 +104,6 @@ class BulkOperation extends localize(i18next)(PageView) {
117
104
  grid-column: span 2;
118
105
  }
119
106
  }
120
-
121
107
  @media screen and (max-width: 460px) {
122
108
  [attachment-wrap] {
123
109
  grid-column: span 12;
@@ -170,12 +156,13 @@ class BulkOperation extends localize(i18next)(PageView) {
170
156
  }
171
157
 
172
158
  get _ganData() {
159
+ let date = (new Date().getMonth() + 1).toString() + '-' + new Date().getDate().toString() + '-' + new Date().getFullYear()
173
160
  return [
174
161
  {
175
162
  refNo: '',
176
163
  refNo2: '',
177
164
  refNo3: '',
178
- etaDate: new Date(),
165
+ etaDate: date,
179
166
  truckNo: '',
180
167
  containerNo: '',
181
168
  containerSize: '',
@@ -189,7 +176,7 @@ class BulkOperation extends localize(i18next)(PageView) {
189
176
  uom: '',
190
177
  packQty: 0,
191
178
  palletQty: 0,
192
- manufactureDate: new Date(),
179
+ manufactureDate: '',
193
180
  unitPrice: ''
194
181
  }
195
182
  ]
@@ -268,7 +255,6 @@ class BulkOperation extends localize(i18next)(PageView) {
268
255
  >
269
256
  </div>
270
257
  </li>
271
-
272
258
  <li>
273
259
  <div subtitle>
274
260
  Release Order &nbsp;
@@ -276,7 +262,6 @@ class BulkOperation extends localize(i18next)(PageView) {
276
262
  <mwc-icon>file_download</mwc-icon>
277
263
  </a>
278
264
  </div>
279
-
280
265
  <form name="input-form" class="multi-column-form" autocomplete="off">
281
266
  <fieldset>
282
267
  <div attachment-wrap>
@@ -302,7 +287,6 @@ class BulkOperation extends localize(i18next)(PageView) {
302
287
  </div>
303
288
  </fieldset>
304
289
  </form>
305
-
306
290
  <div class="button-container">
307
291
  <mwc-button raised @click=${async () => await this._extractRawDataFromExcel(this._roDocument, 'RO')}
308
292
  >${i18next.t('button.validate')}</mwc-button
@@ -404,9 +388,10 @@ class BulkOperation extends localize(i18next)(PageView) {
404
388
  html`
405
389
  <validate-gan-popup
406
390
  .records=${records.map(raw => {
407
- let etaDate = new Date((raw.etaDate - (25567 + 1)) * 86400 * 1000 || null)
408
- let mfgDate = new Date((raw.manufactureDate - (25567 + 1)) * 86400 * 1000 || null)
409
-
391
+ // let etaDate = new Date((raw.etaDate - (25567 + 1)) * 86400 * 1000 || null)
392
+ // let mfgDate = new Date((raw.manufactureDate - (25567 + 1)) * 86400 * 1000 || null)
393
+ let etaDate = new Date(String(raw.etaDate || ''))
394
+ let mfgDate = new Date(String(raw.manufactureDate || ''))
410
395
  return {
411
396
  refNo: String(raw.refNo || ''),
412
397
  refNo2: String(raw.refNo2 || ''),
@@ -426,14 +411,8 @@ class BulkOperation extends localize(i18next)(PageView) {
426
411
  packQty: parseInt(raw.packQty || 0),
427
412
  palletQty: parseInt(raw.palletQty || 0),
428
413
  unitPrice: Number(raw.unitPrice || 0),
429
- manufactureDate: `${mfgDate.getFullYear()}-${(mfgDate.getMonth() + 1).toString().padStart(2, 0)}-${mfgDate
430
- .getDate()
431
- .toString()
432
- .padStart(2, 0)}`,
433
- etaDate: `${etaDate.getFullYear()}-${(etaDate.getMonth() + 1).toString().padStart(2, 0)}-${etaDate
434
- .getDate()
435
- .toString()
436
- .padStart(2, 0)}`
414
+ manufactureDate: this._getStdDateStr(mfgDate),
415
+ etaDate: this._getStdDateStr(etaDate)
437
416
  }
438
417
  })}
439
418
  .ganProcessing=${this.ganProcessingSetting}
@@ -461,7 +440,6 @@ class BulkOperation extends localize(i18next)(PageView) {
461
440
  <validate-ro-popup
462
441
  .records=${records.map(record => {
463
442
  let releaseDate = new Date(String(record.releaseDate || ''))
464
-
465
443
  return {
466
444
  refNo: String(record.refNo || ''),
467
445
  refNo2: String(record.refNo2 || ''),
@@ -480,11 +458,7 @@ class BulkOperation extends localize(i18next)(PageView) {
480
458
  packingType: record.packingType && record.packingType != '' ? String(record.packingType) : null,
481
459
  packingSize: !isNaN(Number(record.packingSize || 'x')) ? Number(record.packingSize) : null,
482
460
  uom: record.uom && record.uom != '' ? String(record.uom) : null,
483
- releaseQty: Number(record.releaseQty)
484
- ? Math.floor(Number(record.releaseQty)) < 1
485
- ? 1
486
- : Math.floor(Number(record.releaseQty))
487
- : null,
461
+ releaseQty: parseInt(record.releaseQty),
488
462
  postalCode: String(record.postalCode || ''),
489
463
  phone1: String(record.phone1 || ''),
490
464
  exportOption: false,
@@ -1,12 +1,22 @@
1
1
  import '@things-factory/grist-ui'
2
2
 
3
3
  import gql from 'graphql-tag'
4
- import { css, html, LitElement } from 'lit-element'
4
+ import {
5
+ css,
6
+ html,
7
+ LitElement
8
+ } from 'lit-element'
5
9
  import { connect } from 'pwa-helpers/connect-mixin'
6
10
 
7
11
  import { SingleColumnFormStyles } from '@things-factory/form-ui'
8
- import { i18next, localize } from '@things-factory/i18n-base'
9
- import { client, store } from '@things-factory/shell'
12
+ import {
13
+ i18next,
14
+ localize
15
+ } from '@things-factory/i18n-base'
16
+ import {
17
+ client,
18
+ store
19
+ } from '@things-factory/shell'
10
20
  import { isMobileDevice } from '@things-factory/utils'
11
21
 
12
22
  class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
@@ -19,13 +29,15 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
19
29
  enableProductScanning: Boolean,
20
30
  orderType: String,
21
31
  orderNo: String,
22
- unloadedInventories: Array
32
+ unloadedInventories: Array,
33
+ _isExecuting: Boolean
23
34
  }
24
35
  }
25
36
 
26
37
  constructor() {
27
38
  super()
28
39
  this._selectedRecords = []
40
+ this._isExecuting= false
29
41
  }
30
42
 
31
43
  static get styles() {
@@ -123,7 +135,7 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
123
135
  </div>
124
136
 
125
137
  <div class="button-container">
126
- <mwc-button raised @click="${this._undoUnloading.bind(this)}" label="${i18next.t('button.undo')}"></mwc-button>
138
+ <mwc-button raised @click="${this._undoUnloading.bind(this)}" label="${i18next.t('button.undo')}" ?disabled=${this._isExecuting}></mwc-button>
127
139
  </div>
128
140
  `
129
141
  }
@@ -214,6 +226,8 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
214
226
 
215
227
  async _undoUnloading() {
216
228
  try {
229
+ if(!this._isExecuting){
230
+ this._isExecuting = true
217
231
  let selectedInventoryIds = []
218
232
  selectedInventoryIds = this.dataGrist.selected.map(inventory => inventory.id)
219
233
 
@@ -233,9 +247,13 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
233
247
  if (!response.errors) {
234
248
  this.dispatchEvent(new CustomEvent('undo-inventory'))
235
249
  }
250
+ }
236
251
  } catch (e) {
237
252
  this._showToast(e)
253
+ }finally {
254
+ this._isExecuting = false
238
255
  }
256
+
239
257
  }
240
258
 
241
259
  _populateTargetedInventory(e) {
@@ -56,7 +56,6 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
56
56
  height: var(--button-container-button-height);
57
57
  border: var(--button-container-button-border);
58
58
  margin: var(--button-container-button-margin);
59
-
60
59
  padding: var(--button-padding);
61
60
  color: var(--theme-white-color);
62
61
  font: var(--button-font);
@@ -109,12 +108,10 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
109
108
  <legend>${i18next.t('title.scan_area')}</legend>
110
109
  <label>${i18next.t('label.lot_id')}</label>
111
110
  <barcode-scanable-input name="palletId" custom-input></barcode-scanable-input>
112
-
113
111
  <label>${i18next.t('label.current_location')}</label>
114
112
  <barcode-scanable-input name="location" custom-input></barcode-scanable-input>
115
113
  </fieldset>
116
114
  </form>
117
-
118
115
  <div class="button-container">
119
116
  <mwc-button raised @click="${this._checkPalletId}" label="${i18next.t('button.check')}"></mwc-button>
120
117
  </div>
@@ -149,7 +146,17 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
149
146
  )
150
147
  } else {
151
148
  const invInfo = await this._checkCurrentLocationinCC(this.palletIdInput.value, this.cycleCountNo)
152
- if (invInfo.currentLocation !== this.locationInput.value) {
149
+
150
+ if (!invInfo) {
151
+ this.dispatchEvent(
152
+ new CustomEvent('not-in-cc', {
153
+ detail: {
154
+ palletId: this.palletIdInput.value,
155
+ cycleCountNo: this.cycleCountNo
156
+ }
157
+ })
158
+ )
159
+ } else if (invInfo?.currentLocation !== this.locationInput.value) {
153
160
  this.dispatchEvent(
154
161
  new CustomEvent('relocate-inventory', {
155
162
  detail: {
@@ -170,7 +177,6 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
170
177
  }
171
178
  }
172
179
  } catch (e) {
173
- history.back()
174
180
  this._showToast(e)
175
181
  }
176
182
  }
@@ -223,6 +229,8 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
223
229
 
224
230
  if (!response.errors) {
225
231
  return response.data.checkStockTakeCurrentLocation
232
+ } else {
233
+ return response.errors
226
234
  }
227
235
  } catch (e) {
228
236
  this.showToast(e)
@@ -62,14 +62,12 @@ class CycleCountReport extends localize(i18next)(PageView) {
62
62
  font: var(--grist-title-font);
63
63
  color: var(--secondary-color);
64
64
  }
65
-
66
65
  .grist h2 mwc-icon {
67
66
  vertical-align: middle;
68
67
  margin: var(--grist-title-icon-margin);
69
68
  font-size: var(--grist-title-icon-size);
70
69
  color: var(--grist-title-icon-color);
71
70
  }
72
-
73
71
  h2 + data-grist {
74
72
  padding-top: var(--grist-title-with-grid-padding);
75
73
  }
@@ -87,18 +85,20 @@ class CycleCountReport extends localize(i18next)(PageView) {
87
85
  ]
88
86
 
89
87
  if (this._reportStatus === ORDER_STATUS.PENDING_REVIEW.value) {
90
- actions.push({
91
- title: i18next.t('button.adjust_inventory'),
92
- action: this._adjustInventory.bind(this),
93
- ...CommonButtonStyles.edit
94
- })
95
-
96
- if (this.cycleCountType === WORKSHEET_TYPE.CYCLE_COUNT.value) {
88
+ if (this.isUserBelongsDomain) {
97
89
  actions.push({
98
- title: i18next.t('button.reject'),
99
- action: this.openCycleCountRecheckPopup.bind(this),
100
- ...CommonButtonStyles.reject
90
+ title: i18next.t('button.adjust_inventory'),
91
+ action: this._adjustInventory.bind(this),
92
+ ...CommonButtonStyles.edit
101
93
  })
94
+
95
+ if (this.cycleCountType === WORKSHEET_TYPE.CYCLE_COUNT.value) {
96
+ actions.push({
97
+ title: i18next.t('button.reject'),
98
+ action: this.openCycleCountRecheckPopup.bind(this),
99
+ ...CommonButtonStyles.reject
100
+ })
101
+ }
102
102
  }
103
103
  }
104
104
 
@@ -125,16 +125,12 @@ class CycleCountReport extends localize(i18next)(PageView) {
125
125
  <legend>${i18next.t('title.cycle_count')}</legend>
126
126
  <label>${i18next.t('label.company')}</label>
127
127
  <input name="bizplace" readonly />
128
-
129
128
  <label>${i18next.t('label.cycle_count_no')}</label>
130
129
  <input name="cycleCountNo" readonly />
131
-
132
130
  <label>${i18next.t('label.execute_date')}</label>
133
131
  <input name="executionDate" readonly />
134
-
135
132
  <label>${i18next.t('label.inventory_accuracy')}</label>
136
133
  <input name="inventoryAccuracy" value="${this.inventoryAccuracy ? this.inventoryAccuracy : ''}" readonly />
137
-
138
134
  <label>${i18next.t('label.status')}</label>
139
135
  <select name="status" disabled>
140
136
  ${Object.keys(ORDER_STATUS).map(
@@ -146,10 +142,8 @@ class CycleCountReport extends localize(i18next)(PageView) {
146
142
  </fieldset>
147
143
  </form>
148
144
  </div>
149
-
150
145
  <div class="grist">
151
146
  <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.inventory')}</h2>
152
-
153
147
  <data-grist
154
148
  id="grist"
155
149
  .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
@@ -171,7 +165,8 @@ class CycleCountReport extends localize(i18next)(PageView) {
171
165
  }
172
166
  }
173
167
 
174
- pageInitialized() {
168
+ async pageInitialized() {
169
+ this.isUserBelongsDomain = await this._checkUserBelongsDomain()
175
170
  this.config = {
176
171
  rows: {
177
172
  appendable: false,
@@ -577,6 +572,24 @@ class CycleCountReport extends localize(i18next)(PageView) {
577
572
  )
578
573
  }
579
574
 
575
+ async _checkUserBelongsDomain() {
576
+ try {
577
+ const response = await client.query({
578
+ query: gql`
579
+ query {
580
+ checkUserBelongsDomain
581
+ }
582
+ `
583
+ })
584
+
585
+ if (!response.errors) {
586
+ return response.data.checkUserBelongsDomain
587
+ }
588
+ } catch (e) {
589
+ this._showToast(e)
590
+ }
591
+ }
592
+
580
593
  async _exportableData() {
581
594
  try {
582
595
  let data = []
@@ -61,14 +61,12 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
61
61
  flex: 1;
62
62
  overflow: auto;
63
63
  }
64
-
65
64
  .left-column {
66
65
  flex: 1;
67
66
  overflow: auto;
68
67
  display: flex;
69
68
  flex-direction: column;
70
69
  }
71
-
72
70
  .right-column {
73
71
  flex: 1;
74
72
  overflow: auto;
@@ -93,14 +91,12 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
93
91
  font: var(--grist-title-font);
94
92
  color: var(--secondary-color);
95
93
  }
96
-
97
94
  .grist h2 mwc-icon {
98
95
  vertical-align: middle;
99
96
  margin: var(--grist-title-icon-margin);
100
97
  font-size: var(--grist-title-icon-size);
101
98
  color: var(--grist-title-icon-color);
102
99
  }
103
-
104
100
  h2 + data-grist {
105
101
  padding-top: var(--grist-title-with-grid-padding);
106
102
  }
@@ -130,20 +126,16 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
130
126
  }}"
131
127
  ></barcode-scanable-input>
132
128
  </fieldset>
133
-
134
129
  <fieldset>
135
130
  <legend>
136
131
  ${`${i18next.t('title.inventory_inspection')} ${`: ${this.cycleCountNo ? this.cycleCountNo : ''}`}`}
137
132
  </legend>
138
-
139
133
  <label>${i18next.t('label.company')}</label>
140
134
  <input name="bizplace" readonly />
141
-
142
135
  <label>${i18next.t('label.started_at')}</label>
143
136
  <input name="startedAt" type="datetime-local" readonly />
144
137
  </fieldset>
145
138
  </form>
146
-
147
139
  <div class="grist">
148
140
  <div class="left-column">
149
141
  <form id="condition-form" class="multi-column-form" @change="${this.fillUpGrist.bind(this)}">
@@ -157,19 +149,16 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
157
149
  <option></option>
158
150
  ${this.warehouses.map(warehouse => html` <option>${warehouse}</option> `)}
159
151
  </select>
160
-
161
152
  <label>${i18next.t('field.zone')}</label>
162
153
  <select name="zone" .disabled="${!this.formattedLocations?.length}">
163
154
  <option></option>
164
155
  ${this.zones.map(zone => html`<option>${zone}</option>`)}
165
156
  </select>
166
-
167
157
  <label>${i18next.t('field.row')}</label>
168
158
  <select name="row" .disabled="${!this.formattedLocations?.length}">
169
159
  <option selected></option>
170
160
  ${this.rows.map(row => html`<option ?selected="${row === this.selectedRow}">${row}</option>`)}
171
161
  </select>
172
-
173
162
  <label>${i18next.t('field.column')}</label>
174
163
  <select name="column" .disabled="${!this.formattedLocations?.length}">
175
164
  <option selected></option>
@@ -179,7 +168,6 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
179
168
  </select>
180
169
  </fieldset>
181
170
  </form>
182
-
183
171
  <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.location')}</h2>
184
172
  <data-grist
185
173
  id="location-grist"
@@ -187,7 +175,6 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
187
175
  .config="${this.locationConfig}"
188
176
  .data="${this.locationData}"
189
177
  ></data-grist>
190
-
191
178
  <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.inventories')}</h2>
192
179
  <data-grist
193
180
  id="inventory-grist"
@@ -196,7 +183,6 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
196
183
  .data="${this.inventoryData}"
197
184
  ></data-grist>
198
185
  </div>
199
-
200
186
  <div class="right-column">
201
187
  <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.missing_pallets')}</h2>
202
188
  <data-grist
@@ -205,7 +191,6 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
205
191
  .config="${this.missingInventoryConfig}"
206
192
  .data="${this.missingInventoryData}"
207
193
  ></data-grist>
208
-
209
194
  <div id="input-form-container">
210
195
  <form
211
196
  id="input-form"
@@ -226,15 +211,12 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
226
211
  ${this.selectedInventory?.productName ? this.selectedInventory.productName : ''}
227
212
  (${this.selectedInventory?.productDescription ? this.selectedInventory.productDescription : ''})
228
213
  </legend>
229
-
230
214
  <label>${i18next.t('field.lot_id')}</label>
231
215
  ${this.viewType === VIEW_TYPE.INVENTORY_SELECTED || this.viewType === VIEW_TYPE.MISSING_PALLET_SELECTED
232
216
  ? html` <input name="palletId" readonly .value="${this.selectedInventory?.palletId || ''}" /> `
233
217
  : html` <barcode-scanable-input name="palletId" custom-input></barcode-scanable-input>`}
234
-
235
218
  <label>${i18next.t('label.inspected_batch_no')}</label>
236
219
  <input name="inspectedBatchNo" .value="${this.selectedInventory?.batchId || ''}" />
237
-
238
220
  <label>${i18next.t('label.inspected_qty')}</label>
239
221
  <input
240
222
  name="inspectedQty"
@@ -243,7 +225,6 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
243
225
  ? this.selectedInventory?.inspectedQty || ''
244
226
  : this.selectedInventory?.inspectedQty || this.selectedInventory?.qty || ''}"
245
227
  />
246
-
247
228
  <label>${i18next.t('label.inspected_uom_value')}</label>
248
229
  <input
249
230
  name="inspectedUomValue"
@@ -253,10 +234,8 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
253
234
  ? this.selectedInventory?.inspectedUomValue || ''
254
235
  : this.selectedInventory?.inspectedUomValue || this.selectedInventory?.uomValue || ''}"
255
236
  />
256
-
257
237
  <label>${i18next.t('label.uom')}</label>
258
238
  <input name="uom" .value="${this.selectedInventory?.uom || ''}" readonly />
259
-
260
239
  <label>${i18next.t('field.location')}</label>
261
240
  ${this.viewType === VIEW_TYPE.INVENTORY_SELECTED
262
241
  ? html` <input name="location" readonly .value="${this.selectedLocation?.name || ''}" /> `
@@ -280,6 +259,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
280
259
  this.zones = []
281
260
  this.rows = []
282
261
  this.columns = []
262
+ this.selectedLocation = { records: [] }
283
263
  }
284
264
 
285
265
  get context() {
@@ -331,10 +311,16 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
331
311
  }
332
312
 
333
313
  get locationInput() {
334
- if (this.viewType === VIEW_TYPE.INVENTORY_SELECTED) {
335
- return this.renderRoot.querySelector('input[name=location]')
336
- } else {
314
+ // if (this.viewType === VIEW_TYPE.INVENTORY_SELECTED) {
315
+ // return this.renderRoot.querySelector('input[name=location]')
316
+ // } else {
317
+ // return this.renderRoot.querySelector('barcode-scanable-input[name=location]').renderRoot.querySelector('input')
318
+ // }
319
+
320
+ if (this.renderRoot?.querySelector('barcode-scanable-input[name=location]')) {
337
321
  return this.renderRoot.querySelector('barcode-scanable-input[name=location]').renderRoot.querySelector('input')
322
+ } else {
323
+ return this.renderRoot.querySelector('input[name=location]')
338
324
  }
339
325
  }
340
326
 
@@ -401,6 +387,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
401
387
  click: async (columns, data, column, record, rowIndex) => {
402
388
  if (!this.selectedInventory?.id !== record.id) {
403
389
  this.selectedInventory = record
390
+ this.locationInput.value = this.selectedLocation.name
404
391
  this.viewType = VIEW_TYPE.INVENTORY_SELECTED
405
392
  await this.checkOrderInventory()
406
393
  this.updateContext(this.viewType)
@@ -993,13 +980,25 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
993
980
  this.viewType = VIEW_TYPE.INVENTORY_SELECTED
994
981
  this.updateContext(this.viewType)
995
982
  this.selectedInventory = e.detail.recordInformation
996
- this.locationInput.value = e.detail.locationInput
997
983
  await CustomAlert({
998
984
  title: i18next.t('title.inventory_in_current_location'),
999
985
  text: i18next.t('text.kindly_continue_inspect_the_inventory'),
1000
986
  confirmButton: { text: i18next.t('button.okay') }
1001
987
  })
1002
988
  }}"
989
+ @not-in-cc="${async e => {
990
+ history.back()
991
+ this.viewType = VIEW_TYPE.INVENTORY_SELECTED
992
+ this.updateContext(this.viewType)
993
+ await CustomAlert({
994
+ title: i18next.t('title.inventory_not_found'),
995
+ text: i18next.t('text.pallet_(x)_is_not_found_in_cycle_count_worksheet_(y)', {
996
+ x: e.detail.palletId,
997
+ y: e.detail.cycleCountNo
998
+ }),
999
+ confirmButton: { text: i18next.t('button.okay') }
1000
+ })
1001
+ }}"
1003
1002
  ></check-inventory-popup>
1004
1003
  `,
1005
1004
  {
@@ -1192,6 +1191,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
1192
1191
  if (!response.errors) {
1193
1192
  await this.fetchCycleCountWorksheet()
1194
1193
  this.renewInventoryGrist()
1194
+ this.resetInput()
1195
1195
  }
1196
1196
  } catch (e) {
1197
1197
  this.showToast(e)
@@ -1276,7 +1276,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
1276
1276
  return response.data.checkInventoryOwner
1277
1277
  }
1278
1278
  } catch (e) {
1279
- this.showToast(e)
1279
+ return false
1280
1280
  }
1281
1281
  }
1282
1282
 
@@ -1348,14 +1348,16 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
1348
1348
  throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('field.inspected_uom_value') } }))
1349
1349
  }
1350
1350
 
1351
- const locationName = this.locationInput.value
1352
- if (!locationName) {
1353
- this.selectOnInput(this.locationInput)
1354
- throw new Error(i18next.t('text.invalid_x', { state: { x: i18next.t('label.location') } }))
1355
- } else {
1356
- const locationExist = await this.validateLocation(locationName)
1357
- if (!locationExist) {
1351
+ if (this.locationInput) {
1352
+ const locationName = this.locationInput?.value
1353
+ if (!locationName) {
1354
+ this.selectOnInput(this.locationInput)
1358
1355
  throw new Error(i18next.t('text.invalid_x', { state: { x: i18next.t('label.location') } }))
1356
+ } else {
1357
+ const locationExist = await this.validateLocation(locationName)
1358
+ if (!locationExist) {
1359
+ throw new Error(i18next.t('text.invalid_x', { state: { x: i18next.t('label.location') } }))
1360
+ }
1359
1361
  }
1360
1362
  }
1361
1363
  }