@things-factory/operato-wms 4.3.183 → 4.3.184

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.
@@ -1,11 +1,24 @@
1
1
  import gql from 'graphql-tag'
2
- import { css, html, LitElement } from 'lit-element'
3
-
4
- import { i18next, localize } from '@things-factory/i18n-base'
5
- import { client, CustomAlert } from '@things-factory/shell'
2
+ import {
3
+ css,
4
+ html,
5
+ LitElement
6
+ } from 'lit-element'
7
+
8
+ import {
9
+ i18next,
10
+ localize
11
+ } from '@things-factory/i18n-base'
12
+ import {
13
+ client,
14
+ CustomAlert
15
+ } from '@things-factory/shell'
6
16
  import { isMobileDevice } from '@things-factory/utils'
7
17
 
8
- import { INVENTORY_STATUS, ORDER_INVENTORY_STATUS } from '../constants'
18
+ import {
19
+ INVENTORY_STATUS,
20
+ ORDER_INVENTORY_STATUS
21
+ } from '../constants'
9
22
 
10
23
  class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
11
24
  static get properties() {
@@ -16,7 +29,8 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
16
29
  crossDockGristData: Object,
17
30
  arrivalNotice: Object,
18
31
  returnOrder: Object,
19
- crossDocking: Boolean
32
+ crossDocking: Boolean,
33
+ _isExecuting: Boolean
20
34
  }
21
35
  }
22
36
 
@@ -111,7 +125,9 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
111
125
 
112
126
  <div class="button-container">
113
127
  <mwc-button raised @click="${this._generatePutawayWorksheet.bind(this)}"
114
- >${i18next.t('button.create')}</mwc-button
128
+ label="${i18next.t('button.create')}"
129
+ ?disabled=${this._isExecuting}
130
+ </mwc-button
115
131
  >
116
132
  </div>
117
133
  `
@@ -121,6 +137,7 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
121
137
  super()
122
138
  this.crossDockGristData = { records: [] }
123
139
  this.inventoryGristData = { records: [] }
140
+ this._isExecuting = false
124
141
  }
125
142
 
126
143
  firstUpdated() {
@@ -396,6 +413,9 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
396
413
  return { id: record.id }
397
414
  })
398
415
 
416
+
417
+ if (!this._isExecuting) {
418
+ this._isExecuting = true
399
419
  const response = await client.mutate({
400
420
  mutation: gql`
401
421
  mutation generatePartialPutawayWorksheet($arrivalNoticeNo: String!, $inventories: [InventoryPatch]!) {
@@ -404,6 +424,7 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
404
424
  `,
405
425
  variables: { arrivalNoticeNo: this.arrivalNotice.name, inventories }
406
426
  })
427
+
407
428
 
408
429
  if (!response.errors) {
409
430
  await CustomAlert({
@@ -415,7 +436,7 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
415
436
  this.dispatchEvent(new CustomEvent('completed'))
416
437
  history.back()
417
438
  }
418
- }
439
+ }}
419
440
 
420
441
  if (this.returnOrder) {
421
442
  if (!this.returnOrder || !this.returnOrder.name) return
@@ -431,7 +452,7 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
431
452
  const inventories = this.inventoryGrist.selected.map(record => {
432
453
  return { id: record.id }
433
454
  })
434
-
455
+
435
456
  const response = await client.mutate({
436
457
  mutation: gql`
437
458
  mutation generatePartialPutawayReturnWorksheet($returnOrderNo: String!, $inventories: [InventoryPatch]!) {
@@ -446,11 +467,10 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
446
467
  title: i18next.t('title.completed'),
447
468
  text: i18next.t('text.generate_putaway_worksheet'),
448
469
  confirmButton: { text: i18next.t('button.confirm') }
449
- })
470
+ })}
450
471
 
451
472
  this.dispatchEvent(new CustomEvent('completed'))
452
473
  history.back()
453
- }
454
474
  }
455
475
  } catch (e) {
456
476
  this._showToast(e)
@@ -74,6 +74,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
74
74
  }
75
75
 
76
76
  async pageInitialized() {
77
+ const partners = await this._fetchPartners()
77
78
  this.config = {
78
79
  list: {
79
80
  fields: [
@@ -103,6 +104,13 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
103
104
  label: true,
104
105
  width: 150
105
106
  },
107
+ {
108
+ type: 'string',
109
+ name: 'bizplaceName',
110
+ header: i18next.t('field.bizplace'),
111
+ label: true,
112
+ width: 150
113
+ },
106
114
  {
107
115
  type: 'string',
108
116
  name: 'refNo',
@@ -198,6 +206,24 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
198
206
  }
199
207
 
200
208
  this._searchFields = [
209
+ {
210
+ label: i18next.t('field.company'),
211
+ name: 'bizplace',
212
+ type: 'select',
213
+ options: [
214
+ { value: '' },
215
+ ...partners
216
+ .map(partner => {
217
+ return {
218
+ name: `${partner.name} ${partner.description ? `(${partner.description})` : ''}`,
219
+ value: partner.id
220
+ }
221
+ })
222
+ .sort(this._compareValues('name', 'asc'))
223
+ ],
224
+ props: { searchOper: 'eq' },
225
+ attrs: ['custom']
226
+ },
201
227
  {
202
228
  label: i18next.t('field.product_info'),
203
229
  name: 'productInfo',
@@ -267,6 +293,9 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
267
293
  releaseGood {
268
294
  name
269
295
  refNo
296
+ bizplace {
297
+ name
298
+ }
270
299
  }
271
300
  inventory {
272
301
  palletId
@@ -312,6 +341,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
312
341
  palletId: item.inventory.palletId,
313
342
  cartonId: item.inventory.cartonId,
314
343
  releaseOrderNo: item.releaseGood.name,
344
+ bizplaceName: item.releaseGood.bizplace.name,
315
345
  refNo: item.releaseGood.refNo
316
346
  }
317
347
  }) || []
@@ -324,6 +354,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
324
354
 
325
355
  var headerSetting = [
326
356
  { header: i18next.t('field.ro_no'), key: 'releaseOrderNo', width: 50, type: 'string' },
357
+ { header: i18next.t('field.bizplace'), key: 'bizplaceName', width: 50, type: 'string' },
327
358
  { header: i18next.t('field.ref_no'), key: 'refNo', width: 50, type: 'string' },
328
359
  { header: i18next.t('field.lot_id'), key: 'palletId', width: 50, type: 'string' },
329
360
  { header: i18next.t('field.carton_id'), key: 'cartonId', width: 50, type: 'string' },
@@ -350,6 +381,47 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
350
381
  }
351
382
  }
352
383
 
384
+ async _fetchPartners() {
385
+ const filters = []
386
+ const response = await client.query({
387
+ query: gql`
388
+ query partnersBizplaces($filters: [Filter!]) {
389
+ partnersBizplaces(filters: $filters) {
390
+ items {
391
+ id
392
+ name
393
+ description
394
+ }
395
+ }
396
+ }
397
+ `,
398
+ variables: { filters }
399
+ })
400
+
401
+ if (!response.errors) {
402
+ return response.data.partnersBizplaces.items
403
+ }
404
+ }
405
+
406
+ _compareValues(key, order = 'asc') {
407
+ return function innerSort(a, b) {
408
+ if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
409
+ return 0
410
+ }
411
+
412
+ const varA = typeof a[key] === 'string' ? a[key].toUpperCase() : a[key]
413
+ const varB = typeof b[key] === 'string' ? b[key].toUpperCase() : b[key]
414
+
415
+ let comparison = 0
416
+ if (varA > varB) {
417
+ comparison = 1
418
+ } else if (varA < varB) {
419
+ comparison = -1
420
+ }
421
+ return order === 'desc' ? comparison * -1 : comparison
422
+ }
423
+ }
424
+
353
425
  _showToast({ type, message }) {
354
426
  document.dispatchEvent(
355
427
  new CustomEvent('notify', {
@@ -4,33 +4,45 @@ module.exports = {
4
4
  useVirtualHostBasedDomain: false,
5
5
  fallbackRoute: '/',
6
6
  subdomainOffset: 2,
7
- port: 1100,
8
- inspect: '9430',
7
+ port: 4000,
8
+ inspect: '9330',
9
9
  ormconfig: {
10
10
  name: 'default',
11
11
  type: 'postgres',
12
- database: 'dev',
12
+ database: 'dev3',
13
13
  username: 'postgres',
14
14
  password: 'hatio',
15
- host: '192.168.0.161',
15
+ host: 'localhost',
16
16
  port: 15432,
17
- synchronize: true,
18
- logging: false
17
+ synchronize: false,
18
+ logging: true
19
19
  },
20
20
  // ormconfig: {
21
21
  // name: 'default',
22
22
  // type: 'postgres',
23
- // database: 'dev',
24
- // username: 'postgres',
25
- // password: 'abcd1234',
26
23
  // host: 'operatov3.cluster-cijhm4n1hbst.ap-southeast-1.rds.amazonaws.com',
27
24
  // port: 55432,
28
- // synchronize: true,
29
- // logging: true
25
+ // database: 'dev2',
26
+ // username: 'postgres',
27
+ // password: 'abcd1234',
28
+ // synchronize: false,
29
+ // logging: true,
30
+ // connectTimeoutMS: 30000,
31
+ // extra: { poolSize: 30 }
30
32
  // },
31
- sellercraftIntegrationConfig: {
32
- apiKey: 'Et0KqtLvA6e92bDvOywy9eCCud4hpAal8akpqI90'
33
- },
33
+ //ormconfig: {
34
+ // name: 'default',
35
+ // type: 'postgres',
36
+ // database: 'dev2',
37
+ // username: 'postgres',
38
+ // password: 'hatio',
39
+ // host: 'localhost',
40
+ // port: 15432,
41
+ // synchronize: false,
42
+ // logging: true,
43
+ // connectTimeoutMS: 30000,
44
+ // extra: { poolSize: 30 }
45
+ //},
34
46
  SECRET: '0xD58F835B69D207A76CC5F84a70a1D0d4C79dfC95',
35
47
  password: {
36
48
  lowerCase: true,
@@ -44,13 +56,6 @@ module.exports = {
44
56
  looseCharacterLength: 4,
45
57
  history: 2
46
58
  },
47
- // storage: {
48
- // type: 's3',
49
- // accessKeyId: 'AKIAUQEOPWEJCDH6AR5H',
50
- // secretAccessKey: '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',
51
- // bucketName: 'opa-one',
52
- // region: 'ap-southeast-1'
53
- // },
54
59
  uploads: 'uploads',
55
60
  attachmentsPath: 'attachments',
56
61
  logger: {
@@ -100,5 +105,7 @@ module.exports = {
100
105
  // privateKey: '4pmlt3Wk019u7nqU3Q_oGZE6LbUDjjf8DpmAcn9-iss'
101
106
  // }
102
107
  },
103
- reportApiUrl: 'http://192.168.0.153:8888/rest/report/show_html'
108
+ reportApiUrl: 'http://localhost:8888/rest/report/show_html'
109
+ // reportApiUrl: 'http://192.168.0.153:8888/rest/report/show_html'
110
+ // reportApiUrl: 'http://10.100.109.66:8090/rest/report/show_html'
104
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.183",
3
+ "version": "4.3.184",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -91,7 +91,7 @@
91
91
  "@things-factory/print-ui": "^4.3.179",
92
92
  "@things-factory/product-base": "^4.3.179",
93
93
  "@things-factory/resource-ui": "^4.3.179",
94
- "@things-factory/sales-ui": "^4.3.183",
94
+ "@things-factory/sales-ui": "^4.3.184",
95
95
  "@things-factory/scene-data-transform": "^4.3.159",
96
96
  "@things-factory/scene-excel": "^4.3.159",
97
97
  "@things-factory/scene-firebase": "^4.3.159",
@@ -108,7 +108,7 @@
108
108
  "@things-factory/transport-base": "^4.3.179",
109
109
  "@things-factory/tutorial-ui": "^4.3.179",
110
110
  "@things-factory/warehouse-base": "^4.3.183",
111
- "@things-factory/worksheet-base": "^4.3.183"
111
+ "@things-factory/worksheet-base": "^4.3.184"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.179",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "7f1c4065051da7867827873478b8cbeec0beded4"
120
+ "gitHead": "e4ece27cb59de6b0b49ab8638f7f192eceb1b98c"
121
121
  }
@@ -1,104 +0,0 @@
1
- module.exports = {
2
- domainType: 'warehouse',
3
- domainExtType: 'warehouse',
4
- useVirtualHostBasedDomain: false,
5
- fallbackRoute: '/',
6
- subdomainOffset: 2,
7
- port: 1100,
8
- inspect: '9430',
9
- ormconfig: {
10
- name: 'default',
11
- type: 'postgres',
12
- database: 'dev',
13
- username: 'postgres',
14
- password: 'hatio',
15
- host: '192.168.0.161',
16
- port: 15432,
17
- synchronize: true,
18
- logging: false
19
- },
20
- // ormconfig: {
21
- // name: 'default',
22
- // type: 'postgres',
23
- // database: 'dev',
24
- // username: 'postgres',
25
- // password: 'abcd1234',
26
- // host: 'operatov3.cluster-cijhm4n1hbst.ap-southeast-1.rds.amazonaws.com',
27
- // port: 55432,
28
- // synchronize: true,
29
- // logging: true
30
- // },
31
- sellercraftIntegrationConfig: {
32
- apiKey: 'Et0KqtLvA6e92bDvOywy9eCCud4hpAal8akpqI90'
33
- },
34
- SECRET: '0xD58F835B69D207A76CC5F84a70a1D0d4C79dfC95',
35
- password: {
36
- lowerCase: true,
37
- upperCase: false,
38
- digit: false,
39
- specialCharacter: false,
40
- allowRepeat: true,
41
- useTightPattern: false,
42
- useLoosePattern: true,
43
- tightCharacterLength: 4,
44
- looseCharacterLength: 4,
45
- history: 2
46
- },
47
- // storage: {
48
- // type: 's3',
49
- // accessKeyId: 'AKIAUQEOPWEJCDH6AR5H',
50
- // secretAccessKey: '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',
51
- // bucketName: 'opa-one',
52
- // region: 'ap-southeast-1'
53
- // },
54
- uploads: 'uploads',
55
- attachmentsPath: 'attachments',
56
- logger: {
57
- file: {
58
- filename: 'logs/application-%DATE%.log',
59
- datePattern: 'YYYY-MM-DD-HH',
60
- zippedArchive: true,
61
- maxSize: '200m',
62
- maxFiles: '1m',
63
- level: 'info'
64
- }
65
- },
66
- email: {
67
- host: 'smtp.office365.com',
68
- port: 587,
69
- secure: false, // true for 465, false for other ports
70
- auth: {
71
- user: 'no-reply@hatiolab.com', // generated ethereal user
72
- pass: 'h@ti0LAB1008' // generated ethereal password
73
- },
74
- secureConnection: false,
75
- tls: {
76
- ciphers: 'SSLv3'
77
- }
78
- },
79
- sender: 'no-reply@hatiolab.com',
80
- notification: {
81
- // fcm: {
82
- // serviceAccount: {
83
- // project_id: 'operato',
84
- // private_key:
85
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vy\nWOWu26qN0ZbwxVS2qVpHuj6iHWJKHuDZZUkFtJg3BeeBSOUHSA8TvjnA0xd83xeb\n8ZJasWoFvwKBgQDFs/gQ/gIdcq0exLfluh5nw0qgcmyHpNWJHdjqITS9IX/nqFkU\n0IYLtmdStf2jQiLmbkydHcvz9wZVvLqml67VBHhwLcwpgPULoskd34/4V0Dvzy4c\nv1Esw8H5zVqIDLeLu+VpFjZMzQrjyl6RIWbyTExEc84rVWfpQYAu3qIGOQKBgAFr\nXatEk7TdAtRNSPflTfu/rTAaSeKROjQBkvBiU8x4US1YpOBDBxUUyAtG8wKh5FHC\nfnsaGq+fM3KXJVv2R6J62mXQOfg4xyDLpWlwcBK4aSBBMoiBcsjouqSlZQlqMpdf\nZBgixqHe6U8BsFJg/6ZxC0y+e3AIss4Bo4/lb+1lAoGAFOexvaBh21K6W3inmRW4\nLlkVYJaBJ20OwokXg5aXjBiHxqmk7VLAuFbkpb5LOKH2xPILRQ0OEkn51yVymS3T\n9lLpHOFTQXt5tF2/F7NW7kaQJNlLr/h5jPi3O9XHeFmuaN2z150ZB6zzgjeGKzr8\ni+1fgTsRfDtNw8xkSH9qL1Y=\n-----END PRIVATE KEY-----\n',
86
- // client_email: 'firebase-adminsdk-xmm2e@operato.iam.gserviceaccount.com'
87
- // },
88
- // appConfig: {
89
- // apiKey: 'AIzaSyDdTM2BTLHSt2LNS0G5QB8G0i4KBXFiG7U',
90
- // projectId: 'operato',
91
- // messagingSenderId: 79537064975,
92
- // appId: '1:79537064975:web:32f53119e9c8c6ee2a277a'
93
- // },
94
- // serverKey:
95
- // 'AAAAEoTHTA8:APA91bGwt-4HT82Dfwf_VwbQaKT0_qHd0Y3tuW41udjWz5Lz0Ko0mEMD6WbHHSILvQpa6yuoGGKCMsrU7VW2qWRrUm3CYpyG9oSwshNm1tIhljAnOuUfwHCoawbVLwf9qlWpHt4dwCoc'
96
- // },
97
- // vapidKey: {
98
- // subject: 'mailto:heartyoh@hatiolab.com',
99
- // publicKey: 'BAkVkITsCXBIsYL1yeaBmx5_dn57we-ZXMjirPPHzC2dan82cdEnAio_53PQ-1_w3ykWCBPrrFAWQ_d9N4cFF0o',
100
- // privateKey: '4pmlt3Wk019u7nqU3Q_oGZE6LbUDjjf8DpmAcn9-iss'
101
- // }
102
- },
103
- reportApiUrl: 'http://192.168.0.153:8888/rest/report/show_html'
104
- }