@things-factory/operato-wms 4.3.69 → 4.3.72

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.
@@ -8,6 +8,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
8
8
  import { client } from '@things-factory/shell'
9
9
  import { ScrollbarStyles } from '@things-factory/styles'
10
10
  import { isMobileDevice } from '@things-factory/utils'
11
+
11
12
  import { GROUP_TYPES, INVENTORY_STATUS } from '../constants'
12
13
 
13
14
  class SelectInventoryPopUp extends localize(i18next)(LitElement) {
@@ -277,7 +278,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
277
278
  },
278
279
  {
279
280
  label: i18next.t('field.location'),
280
- name: 'location',
281
+ name: 'locationName',
281
282
  props: { searchOper: 'i_like' }
282
283
  }
283
284
  ]
@@ -423,7 +424,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
423
424
  if (paneType === 'product') {
424
425
  const data = this.inventoryData
425
426
 
426
- if (data.length > 0) {
427
+ if (data?.length > 0) {
427
428
  const remapData = data.map(res => {
428
429
  return {
429
430
  batchId: res.batchId,
@@ -472,10 +473,16 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
472
473
  }
473
474
  }
474
475
  } else {
475
- filters.push(
476
- { name: 'status', operator: 'eq', value: INVENTORY_STATUS.STORED.value },
477
- { name: 'recall', operator: '', value: recall }
478
- )
476
+ filters.push({ name: 'status', operator: 'eq', value: INVENTORY_STATUS.STORED.value })
477
+
478
+ const data = this.inventoryData
479
+ if (data?.length > 0) {
480
+ filters.push({
481
+ name: 'id',
482
+ value: data.map(record => record.inventory.id),
483
+ operator: 'notin'
484
+ })
485
+ }
479
486
  const response = await client.query({
480
487
  query: gql`
481
488
  query inventoriesByPallet($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
@@ -344,7 +344,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
344
344
  filters: [
345
345
  { name: 'status', operator: 'eq', value: INVENTORY_STATUS.STORED.value },
346
346
  { name: 'bizplace', value: [this.bizplace], operator: 'in' },
347
- { name: 'recall', value: this.recall ? this.recall : false, operator: 'eq' }
347
+ { name: 'recall', value: this.recall ? this.recall : false, operator: '' }
348
348
  ],
349
349
  locationSortingRules
350
350
  },
@@ -10,6 +10,26 @@ import { ORDER_STATUS } from '../../constants'
10
10
  import './delivery-note-popup'
11
11
 
12
12
  class PrintDeliveryOrder extends localize(i18next)(PageView) {
13
+ static get styles() {
14
+ return [
15
+ ScrollbarStyles,
16
+ css`
17
+ :host {
18
+ display: flex;
19
+ flex-direction: column;
20
+ padding: 0;
21
+ }
22
+
23
+ #container {
24
+ flex: 1;
25
+ padding: 0;
26
+ margin: 0;
27
+ border: 0;
28
+ }
29
+ `
30
+ ]
31
+ }
32
+
13
33
  static get properties() {
14
34
  return {
15
35
  _doNo: String,
@@ -20,7 +40,7 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
20
40
  _date: Date,
21
41
  _recipient: String,
22
42
  _proceedFlag: Boolean,
23
- _customerContactPoints: Array,
43
+ // _customerContactPoints: Array,
24
44
  _bizplace: Object,
25
45
  _orderInfo: Object,
26
46
  _isManualDo: Boolean,
@@ -36,26 +56,6 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
36
56
  this._status = ''
37
57
  }
38
58
 
39
- static get styles() {
40
- return [
41
- ScrollbarStyles,
42
- css`
43
- :host {
44
- display: flex;
45
- flex-direction: column;
46
- padding: 0;
47
- }
48
-
49
- #container {
50
- flex: 1;
51
- padding: 0;
52
- margin: 0;
53
- border: 0;
54
- }
55
- `
56
- ]
57
- }
58
-
59
59
  get context() {
60
60
  var actions = [
61
61
  {
@@ -94,7 +94,7 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
94
94
  exportable: {
95
95
  name: i18next.t('title.goods_delivery_note_details'),
96
96
  data: this._exportableData.bind(this)
97
- },
97
+ }
98
98
  }
99
99
  }
100
100
 
@@ -114,7 +114,8 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
114
114
 
115
115
  if (this._doNo) {
116
116
  await this._fetchDeliveryOrder(this._doNo)
117
- await this._fetchDeliveryOrderRO(this._doNo)
117
+
118
+ this._fetchDOTemplate()
118
119
  }
119
120
 
120
121
  this.updateContext()
@@ -127,6 +128,7 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
127
128
  query deliveryOrderByWorksheet($name: String!) {
128
129
  deliveryOrderByWorksheet(name: $name) {
129
130
  deliveryOrderInfo {
131
+ name
130
132
  contactName
131
133
  createdDate
132
134
  deliverTo
@@ -144,14 +146,22 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
144
146
  id
145
147
  name
146
148
  }
147
- }
148
- contactPointInfo {
149
- id
150
- contactName
151
- address
152
- phone
153
- fax
154
- email
149
+ releaseGood {
150
+ name
151
+ refNo
152
+ refNo2
153
+ refNo3
154
+ attentionTo
155
+ }
156
+ productList {
157
+ batchNo
158
+ sku
159
+ name
160
+ type
161
+ uom
162
+ loadedQty
163
+ uomValue
164
+ }
155
165
  }
156
166
  }
157
167
  }
@@ -166,9 +176,10 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
166
176
 
167
177
  let orderInfo = deliveryOrderData.deliveryOrderInfo
168
178
  let contactPoints = deliveryOrderData.contactPointInfo
179
+ this._roNo = orderInfo.releaseGood.name
169
180
  this._status = orderInfo.doStatus
170
181
  this._ownCollection = orderInfo.ownCollection
171
- this._customerContactPoints = deliveryOrderData.contactPointInfo
182
+ // this._customerContactPoints = deliveryOrderData.contactPointInfo
172
183
  this._truckNo = orderInfo.truckNo
173
184
  this._bizplace = orderInfo.bizplace
174
185
  this._isManualDo = orderInfo.isManualDo
@@ -183,15 +194,20 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
183
194
  }
184
195
 
185
196
  this._orderInfo = orderInfo
186
- this._fetchDOTemplate()
187
197
  }
188
198
  }
189
199
 
190
- async _fetchDeliveryOrderRO(name){
200
+ /**
201
+ * @oscarchuaweiwen-fsd
202
+ * Kindly clean up anything regarding this function.
203
+ * Check and confirm to be remove and remove.
204
+ * This function causes the whole page to render 2 times. Thus causing the document template to run 2 time and consuming alot of resources.
205
+ */
206
+ async _fetchDeliveryOrderRO(name) {
191
207
  const response = await client.query({
192
208
  query: gql`
193
209
  query fetchDeliveryOrderRO($name: String!) {
194
- fetchDeliveryOrderRO(name: $name){
210
+ fetchDeliveryOrderRO(name: $name) {
195
211
  roNo
196
212
  doNo
197
213
  roRef
@@ -217,10 +233,10 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
217
233
  }
218
234
  })
219
235
 
220
- if(!response.error){
221
- this._data = response.data.fetchDeliveryOrderRO
222
- this._roNo = this._data.roNo
223
- this._refNo = this._data.roRef
236
+ if (!response.error) {
237
+ this._data = response.data.fetchDeliveryOrderRO
238
+ this._roNo = this._data.roNo
239
+ this._refNo = this._data.roRef
224
240
  }
225
241
  }
226
242
 
@@ -309,17 +325,22 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
309
325
  }
310
326
 
311
327
  _exportableData() {
312
- const {roNo,doNo,roRef,roRef2,roRef3,companyDomain,recipientBiz,doDate} = this._data
328
+ const { name, doNo, refNo, refNo2, refNo3, companyDomain, attentionTo, doDate } = {
329
+ ...this._orderInfo.releaseGood,
330
+ bizplaceName: this._orderInfo.bizplace.name,
331
+ doNo: this._orderInfo.name,
332
+ doDate: this._orderInfo.createdDate
333
+ }
313
334
 
314
- const exportData = this._data.productList.map((res)=>{
315
- return{
316
- roNo,
335
+ const exportData = this._orderInfo.productList.map(res => {
336
+ return {
337
+ roNo: name,
317
338
  doNo,
318
- roRef,
319
- roRef2,
320
- roRef3,
339
+ roRef: refNo,
340
+ roRef2: refNo2,
341
+ roRef3: refNo3,
321
342
  companyDomain,
322
- recipientBiz,
343
+ recipientBiz: attentionTo,
323
344
  doDate,
324
345
  ...res
325
346
  }
@@ -6,6 +6,7 @@ import gql from 'graphql-tag'
6
6
  import { isMobileDevice } from '@things-factory/utils'
7
7
  import { fetchSettingRule } from '../../fetch-setting-value'
8
8
  import { ORDER_STATUS } from '../constants'
9
+ import { sleep } from '@things-factory/utils'
9
10
 
10
11
  class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
11
12
  static get properties() {
@@ -127,8 +128,18 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
127
128
  <div class="button-container">
128
129
  <mwc-button
129
130
  raised
130
- @click="${async () =>
131
- this._generateStd == 'single' ? this._generatePickingWorksheet() : this._generateBatchPickingWorksheet()}"
131
+ @click="${async e => {
132
+ const button = e.currentTarget
133
+ this.disableButton(button)
134
+ try {
135
+ this._generateStd == 'single'
136
+ ? await this._generatePickingWorksheet()
137
+ : await this._generateBatchPickingWorksheet()
138
+ } finally {
139
+ await sleep(200)
140
+ this.enableButton(button)
141
+ }
142
+ }}"
132
143
  label="${i18next.t('button.confirm')}"
133
144
  ></mwc-button>
134
145
  </div>
@@ -322,6 +333,18 @@ class GenerateWorksheetPopup extends localize(i18next)(LitElement) {
322
333
  }
323
334
  }
324
335
 
336
+ disableButton(button) {
337
+ button.icon = 'rotate_right'
338
+ button.setAttribute('working', true)
339
+ button.disabled = true
340
+ }
341
+
342
+ enableButton(button) {
343
+ button.disabled = false
344
+ button.icon = ''
345
+ button.removeAttribute('working')
346
+ }
347
+
325
348
  _showToast({ type, message }) {
326
349
  document.dispatchEvent(
327
350
  new CustomEvent('notify', {
@@ -144,9 +144,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
144
144
 
145
145
  if (
146
146
  (this.releaseGoodId || this.taskNo) &&
147
- this._selectedOrderInventory.status !== 'MISSING' &&
148
- this._selectedOrderInventory.hasMissingInventoryChanges !== true &&
149
- this._selectedOrderInventory.status !== 'DONE'
147
+ this._selectedOrderInventory?.status !== 'MISSING' &&
148
+ this._selectedOrderInventory?.hasMissingInventoryChanges !== true &&
149
+ this._selectedOrderInventory?.status !== 'DONE'
150
150
  ) {
151
151
  actions.push({
152
152
  title: i18next.t('button.missing_stock'),
@@ -623,6 +623,13 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
623
623
  async fetchInventories(pickingRefNo) {
624
624
  if (!pickingRefNo) return
625
625
 
626
+ //this.releaseGoodNo will be incorrect if worksheet list is used, therefore it's assigned here
627
+ //this._selectedOrderInventory still has the value of previous order, therefore it's cleared here
628
+ if (this.releaseGoodNo !== pickingRefNo) {
629
+ this.releaseGoodNo = pickingRefNo
630
+ this._selectedOrderInventory = null
631
+ }
632
+
626
633
  const data = this._selectedOrderInventory
627
634
  let response
628
635
  switch (this.refPickingType) {
@@ -717,7 +724,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
717
724
  this._bizplaceName = worksheetInfo.bizplaceName
718
725
  this._orderNo = this.releaseGoodNo
719
726
  this._worksheetInfo = worksheetInfo
720
- this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
727
+ this.data = { records: await this.formatWorksheetDetailInfos(worksheetDetailInfos) }
728
+ let a = this.data
721
729
 
722
730
  if (!this._selectedOrderInventory) {
723
731
  this._selectedOrderInventory = this.data.records[0]
@@ -745,7 +753,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
745
753
  if (this._isCartonLabel && data) {
746
754
  const findCartonId = worksheetDetailInfos.find(res => res.cartonId == data.cartonId)
747
755
 
748
- if (data && findCartonId.hasMissingInventoryChanges) {
756
+ if (data && findCartonId?.hasMissingInventoryChanges) {
749
757
  this.scannable = false
750
758
  }
751
759
  }
@@ -898,7 +906,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
898
906
  )
899
907
 
900
908
  this._selectedOrderInventory = record
901
- this.updateSelectedItemProp(record)
909
+ await this.updateSelectedItemProp(record)
902
910
 
903
911
  if (record.pickedQty == record.releaseQty) {
904
912
  if (this._isCartonLabel) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.69",
3
+ "version": "4.3.72",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -63,53 +63,53 @@
63
63
  "@operato/scene-tab": "^0.1.8",
64
64
  "@operato/scene-table": "^0.1.8",
65
65
  "@operato/scene-wheel-sorter": "^0.1.8",
66
- "@things-factory/apptool-ui": "^4.3.69",
67
- "@things-factory/attachment-ui": "^4.3.69",
68
- "@things-factory/auth-ui": "^4.3.69",
69
- "@things-factory/barcode-ui": "^4.3.69",
70
- "@things-factory/biz-ui": "^4.3.69",
71
- "@things-factory/board-service": "^4.3.69",
72
- "@things-factory/board-ui": "^4.3.69",
73
- "@things-factory/code-ui": "^4.3.69",
74
- "@things-factory/context-ui": "^4.3.69",
75
- "@things-factory/export-ui": "^4.3.69",
76
- "@things-factory/export-ui-csv": "^4.3.69",
77
- "@things-factory/export-ui-excel": "^4.3.69",
78
- "@things-factory/fav-base": "^4.3.69",
79
- "@things-factory/form-ui": "^4.3.69",
80
- "@things-factory/geography": "^4.3.69",
81
- "@things-factory/grist-ui": "^4.3.69",
82
- "@things-factory/help": "^4.3.69",
83
- "@things-factory/i18n-base": "^4.3.69",
84
- "@things-factory/id-rule-base": "^4.3.69",
85
- "@things-factory/import-ui": "^4.3.69",
86
- "@things-factory/import-ui-excel": "^4.3.69",
87
- "@things-factory/menu-ui": "^4.3.69",
88
- "@things-factory/more-ui": "^4.3.69",
89
- "@things-factory/notification": "^4.3.69",
66
+ "@things-factory/apptool-ui": "^4.3.72",
67
+ "@things-factory/attachment-ui": "^4.3.72",
68
+ "@things-factory/auth-ui": "^4.3.72",
69
+ "@things-factory/barcode-ui": "^4.3.72",
70
+ "@things-factory/biz-ui": "^4.3.72",
71
+ "@things-factory/board-service": "^4.3.72",
72
+ "@things-factory/board-ui": "^4.3.72",
73
+ "@things-factory/code-ui": "^4.3.72",
74
+ "@things-factory/context-ui": "^4.3.72",
75
+ "@things-factory/export-ui": "^4.3.72",
76
+ "@things-factory/export-ui-csv": "^4.3.72",
77
+ "@things-factory/export-ui-excel": "^4.3.72",
78
+ "@things-factory/fav-base": "^4.3.72",
79
+ "@things-factory/form-ui": "^4.3.72",
80
+ "@things-factory/geography": "^4.3.72",
81
+ "@things-factory/grist-ui": "^4.3.72",
82
+ "@things-factory/help": "^4.3.72",
83
+ "@things-factory/i18n-base": "^4.3.72",
84
+ "@things-factory/id-rule-base": "^4.3.72",
85
+ "@things-factory/import-ui": "^4.3.72",
86
+ "@things-factory/import-ui-excel": "^4.3.72",
87
+ "@things-factory/menu-ui": "^4.3.72",
88
+ "@things-factory/more-ui": "^4.3.72",
89
+ "@things-factory/notification": "^4.3.72",
90
90
  "@things-factory/pdf": "^4.3.66",
91
- "@things-factory/print-proxy-service": "^4.3.69",
92
- "@things-factory/print-ui": "^4.3.69",
93
- "@things-factory/product-base": "^4.3.69",
94
- "@things-factory/resource-ui": "^4.3.69",
95
- "@things-factory/sales-ui": "^4.3.69",
91
+ "@things-factory/print-proxy-service": "^4.3.72",
92
+ "@things-factory/print-ui": "^4.3.72",
93
+ "@things-factory/product-base": "^4.3.72",
94
+ "@things-factory/resource-ui": "^4.3.72",
95
+ "@things-factory/sales-ui": "^4.3.72",
96
96
  "@things-factory/scene-data-transform": "^4.3.69",
97
97
  "@things-factory/scene-excel": "^4.3.69",
98
98
  "@things-factory/scene-firebase": "^4.3.69",
99
99
  "@things-factory/scene-form": "^4.3.69",
100
100
  "@things-factory/scene-google-map": "^4.3.69",
101
101
  "@things-factory/scene-graphql": "^4.3.69",
102
- "@things-factory/scene-label": "^4.3.69",
102
+ "@things-factory/scene-label": "^4.3.72",
103
103
  "@things-factory/scene-marker": "^4.3.69",
104
104
  "@things-factory/scene-mqtt": "^4.3.69",
105
105
  "@things-factory/scene-restful": "^4.3.69",
106
106
  "@things-factory/scene-visualizer": "^4.3.69",
107
- "@things-factory/setting-ui": "^4.3.69",
108
- "@things-factory/system-ui": "^4.3.69",
109
- "@things-factory/transport-base": "^4.3.69",
110
- "@things-factory/tutorial-ui": "^4.3.69",
111
- "@things-factory/warehouse-base": "^4.3.69",
112
- "@things-factory/worksheet-base": "^4.3.69"
107
+ "@things-factory/setting-ui": "^4.3.72",
108
+ "@things-factory/system-ui": "^4.3.72",
109
+ "@things-factory/transport-base": "^4.3.72",
110
+ "@things-factory/tutorial-ui": "^4.3.72",
111
+ "@things-factory/warehouse-base": "^4.3.72",
112
+ "@things-factory/worksheet-base": "^4.3.72"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@things-factory/builder": "^4.3.66",
@@ -118,5 +118,5 @@
118
118
  "cypress-localstorage-commands": "^1.6.1",
119
119
  "eslint-plugin-cypress": "^2.12.1"
120
120
  },
121
- "gitHead": "f1bc559c1d5f98b6a88848dd5c66c1588207978c"
121
+ "gitHead": "e2586ea38950d313bef2620334b15aecbc13c96c"
122
122
  }