@things-factory/operato-wms 3.8.17 → 3.8.18

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()) {
20
+ case 'true':
21
+ return true
22
+ case 'false':
23
+ return false
24
+ default:
25
+ return response.data.setting.value.toLowerCase()
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "3.8.17",
3
+ "version": "3.8.18",
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.18",
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",
@@ -102,11 +102,11 @@
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.16"
105
+ "@things-factory/warehouse-base": "^3.8.18",
106
+ "@things-factory/worksheet-base": "^3.8.18"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@things-factory/builder": "^3.7.5"
110
110
  },
111
- "gitHead": "8ecd441781a6f13992e9d5b5713b1b5a33122c7d"
111
+ "gitHead": "77e03326d44b59c82558ae20970babfdaf5e8f3b"
112
112
  }