@things-factory/operato-wms 3.8.15 → 3.8.19

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,6 +1,7 @@
1
- import { client } from '@things-factory/shell'
2
1
  import gql from 'graphql-tag'
3
2
 
3
+ import { client } from '@things-factory/shell'
4
+
4
5
  export async function fetchSettingRule(setting, partnerDomainId) {
5
6
  const response = await client.query({
6
7
  query: gql`
@@ -15,7 +16,14 @@ export async function fetchSettingRule(setting, partnerDomainId) {
15
16
 
16
17
  if (!response.errors) {
17
18
  if (response.data.setting?.value) {
18
- return response.data.setting.value.toLowerCase() == 'true'
19
+ switch (response.data.setting.value.toLowerCase().trim()) {
20
+ case 'true':
21
+ return true
22
+ case 'false':
23
+ return false
24
+ default:
25
+ return response.data.setting.value.trim()
26
+ }
19
27
  }
20
28
 
21
29
  return false
@@ -8,6 +8,7 @@ import { css, html, LitElement } from 'lit-element'
8
8
  import gql from 'graphql-tag'
9
9
  import { ScrollbarStyles } from '@things-factory/styles'
10
10
  import { ORDER_STATUS, RO_TYPES } from '../../constants'
11
+ import { fetchSettingRule } from '../../../fetch-setting-value'
11
12
  import '@things-factory/biz-ui'
12
13
 
13
14
  class BatchPickingPopup extends localize(i18next)(LitElement) {
@@ -152,7 +153,6 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
152
153
  name: 'type',
153
154
  type: 'select',
154
155
  options: Object.keys(RO_TYPES).map(map => {
155
- debugger
156
156
  return { name: RO_TYPES[map].name, value: RO_TYPES[map].value }
157
157
  }),
158
158
  props: { searchOper: 'eq' }
@@ -292,7 +292,8 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
292
292
  { name: 'bizplaceId', operator: 'eq', value: this.partnerBizplace.id }
293
293
  ]
294
294
 
295
- const pagination = { page, limit }
295
+ let batchLimit = await fetchSettingRule('batch-picking-limit')
296
+ const pagination = { page, limit: batchLimit && !!parseInt(batchLimit) ? parseInt(batchLimit) : 20 }
296
297
  const sortings = sorters
297
298
 
298
299
  const response = await client.query({
@@ -6,8 +6,8 @@ import { css, html } from 'lit-element'
6
6
 
7
7
  import { getCodeByName } from '@things-factory/code-base'
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
- import { client, navigate, PageView } from '@things-factory/shell'
10
- import { ScrollbarStyles } from '@things-factory/styles'
9
+ import { client, navigate, PageView, CustomAlert } from '@things-factory/shell'
10
+ import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
11
11
  import { isMobileDevice } from '@things-factory/utils'
12
12
 
13
13
  import { WORKSHEET_TYPE } from '../constants'
@@ -57,6 +57,13 @@ class PackingWorksheetList extends localize(i18next)(PageView) {
57
57
  get context() {
58
58
  return {
59
59
  title: i18next.t('title.packing_worksheet_list'),
60
+ actions: [
61
+ {
62
+ title: i18next.t('button.activate'),
63
+ action: this._activateWorksheet.bind(this),
64
+ ...CommonButtonStyles.activate
65
+ }
66
+ ],
60
67
  exportable: {
61
68
  name: i18next.t('title.packing_worksheet_list'),
62
69
  data: this._exportableData.bind(this)
@@ -159,11 +166,11 @@ class PackingWorksheetList extends localize(i18next)(PageView) {
159
166
  list: {
160
167
  fields: ['releaseGood', 'bizplace', 'type', 'releaseRefNo', 'status', 'startedAt', 'endedAt']
161
168
  },
162
- rows: { appendable: false },
169
+ rows: { appendable: false, selectable: { multiple: true } },
163
170
  pagination: { limit: 100, pages: [20, 50, 100, 200, 500] },
164
171
  columns: [
165
- { type: 'gutter', gutterName: 'dirty' },
166
172
  { type: 'gutter', gutterName: 'sequence' },
173
+ { type: 'gutter', gutterName: 'row-selector', multiple: true },
167
174
  {
168
175
  type: 'gutter',
169
176
  gutterName: 'button',
@@ -344,6 +351,48 @@ class PackingWorksheetList extends localize(i18next)(PageView) {
344
351
  }
345
352
  }
346
353
 
354
+ async _activateWorksheet() {
355
+ try {
356
+ let selectedItem = this.dataGrist.selected.filter(i => i.status == 'DEACTIVATED')
357
+ if (selectedItem.length > 0) {
358
+ const result = await CustomAlert({
359
+ title: i18next.t('title.are_you_sure'),
360
+ text: i18next.t('text.activate_packing_worksheet'),
361
+ confirmButton: { text: i18next.t('button.confirm') },
362
+ cancelButton: { text: i18next.t('button.cancel') }
363
+ })
364
+
365
+ if (!result.value) {
366
+ return
367
+ }
368
+
369
+ const response = await client.mutate({
370
+ mutation: gql`
371
+ mutation activatePacking($worksheetNo: [String!]!) {
372
+ activatePacking(worksheetNo: $worksheetNo) {
373
+ id
374
+ name
375
+ }
376
+ }
377
+ `,
378
+ variables: {
379
+ worksheetNo: selectedItem.map(itm => {
380
+ return itm.name
381
+ })
382
+ }
383
+ })
384
+
385
+ if (!response.errors) {
386
+ this._showToast({ message: i18next.t('text.worksheet_activated') })
387
+ }
388
+ }
389
+ } catch (e) {
390
+ this._showToast(e)
391
+ } finally {
392
+ this.dataGrist.fetch()
393
+ }
394
+ }
395
+
347
396
  _modifyDateRange(e) {
348
397
  const fromDate = e.currentTarget.value
349
398
 
@@ -409,6 +458,17 @@ class PackingWorksheetList extends localize(i18next)(PageView) {
409
458
  })
410
459
  return { header: headerSetting, data: data }
411
460
  }
461
+
462
+ _showToast({ type, message }) {
463
+ document.dispatchEvent(
464
+ new CustomEvent('notify', {
465
+ detail: {
466
+ type,
467
+ message
468
+ }
469
+ })
470
+ )
471
+ }
412
472
  }
413
473
 
414
474
  window.customElements.define('packing-worksheet-list', PackingWorksheetList)
@@ -849,7 +849,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
849
849
 
850
850
  if (this._selectedOrderInventory) {
851
851
  const record = this.data.records.find(
852
- record => record.product.sku === this._selectedOrderInventory.product.sku
852
+ record =>
853
+ record.product.sku === this._selectedOrderInventory.product.sku &&
854
+ record.palletId === this._selectedOrderInventory.palletId
853
855
  )
854
856
 
855
857
  this.updateSelectedItemProp(record)
@@ -860,7 +862,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
860
862
  this.productBarcodeInput.value = ''
861
863
  // this._focusOnCartonNoInput()
862
864
  }
863
- this.inputForm.reset()
865
+ this.fillUpForm(this.inputForm, record)
864
866
  } else {
865
867
  // this._focusOnProductBarcodeInput()
866
868
  this.fillUpForm(this.inputForm, record)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "3.8.15",
3
+ "version": "3.8.19",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -71,7 +71,7 @@
71
71
  "@things-factory/print-ui": "^3.8.0",
72
72
  "@things-factory/product-base": "^3.8.9",
73
73
  "@things-factory/resource-ui": "^3.8.0",
74
- "@things-factory/sales-ui": "^3.8.12",
74
+ "@things-factory/sales-ui": "^3.8.19",
75
75
  "@things-factory/scene-chartjs": "^3.7.5",
76
76
  "@things-factory/scene-clock": "^3.7.5",
77
77
  "@things-factory/scene-clone": "^3.7.5",
@@ -98,15 +98,15 @@
98
98
  "@things-factory/scene-table": "^3.7.5",
99
99
  "@things-factory/scene-visualizer": "^3.7.5",
100
100
  "@things-factory/scene-wheel-sorter": "^3.7.5",
101
- "@things-factory/setting-ui": "^3.8.0",
101
+ "@things-factory/setting-ui": "^3.8.19",
102
102
  "@things-factory/system-ui": "^3.8.0",
103
103
  "@things-factory/transport-base": "^3.8.0",
104
104
  "@things-factory/tutorial-ui": "^3.8.0",
105
- "@things-factory/warehouse-base": "^3.8.12",
106
- "@things-factory/worksheet-base": "^3.8.12"
105
+ "@things-factory/warehouse-base": "^3.8.19",
106
+ "@things-factory/worksheet-base": "^3.8.19"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@things-factory/builder": "^3.7.5"
110
110
  },
111
- "gitHead": "19c5659022fadb625ef251b09aea65ab70588ef9"
111
+ "gitHead": "4cedfe9a9f2a6e694d6175409469b7048dc4786f"
112
112
  }
@@ -318,6 +318,7 @@
318
318
  "field.order_status": "order status",
319
319
  "field.order_type": "order type",
320
320
  "field.origin_product": "origin product",
321
+ "field.original_name": "original name",
321
322
  "field.ot": "O/T",
322
323
  "field.other_target": "other target",
323
324
  "field.out": "out",
@@ -350,6 +350,7 @@
350
350
  "field.order_status": "주문 상태",
351
351
  "field.order_type": "주문 유형",
352
352
  "field.origin_product": "원제품",
353
+ "field.original_name": "[ko]original name",
353
354
  "field.ot": "다른 대상",
354
355
  "field.other_target": "다른 대상",
355
356
  "field.out": "out",
@@ -332,6 +332,7 @@
332
332
  "field.order_status": "status pesanan",
333
333
  "field.order_type": "jenis pesanan",
334
334
  "field.origin_product": "produk asal",
335
+ "field.original_name": "nama asal",
335
336
  "field.ot": "O/T",
336
337
  "field.other_target": "sasaran lain",
337
338
  "field.out": "keluar",
@@ -315,6 +315,7 @@
315
315
  "field.order_status": "[zh]order status",
316
316
  "field.order_type": "[zh]order type",
317
317
  "field.origin_product": "[zh]origin product",
318
+ "field.original_name": "[zh]original name",
318
319
  "field.ot": "O/T",
319
320
  "field.other_target": "[zh]other target",
320
321
  "field.out": "out",