@things-factory/operato-wms 4.1.7 → 4.1.8

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,10 +1,13 @@
1
- import { SingleColumnFormStyles } from '@things-factory/form-ui'
2
1
  import '@things-factory/grist-ui'
3
- import { i18next, localize } from '@things-factory/i18n-base'
4
- import { css, html, LitElement } from 'lit-element'
5
- import { openPopup } from '@things-factory/layout-base'
6
2
  import './vas-selector'
7
3
 
4
+ import gql from 'graphql-tag'
5
+ import { css, html, LitElement } from 'lit-element'
6
+
7
+ import { SingleColumnFormStyles } from '@things-factory/form-ui'
8
+ import { i18next, localize } from '@things-factory/i18n-base'
9
+ import { client } from '@things-factory/shell'
10
+
8
11
  class AdjustPalletQty extends localize(i18next)(LitElement) {
9
12
  static get properties() {
10
13
  return {
@@ -95,23 +98,6 @@ class AdjustPalletQty extends localize(i18next)(LitElement) {
95
98
  value="${this.record.palletQty ? this.record.palletQty : ''}"
96
99
  required
97
100
  />
98
- <!-- this should appear only if it is a loose item -->
99
- <label ?hidden=${!this.record.isLooseItem}>${i18next.t('label.repalletizing_vas')}</label>
100
- <input
101
- ?hidden=${!this.record.isLooseItem}
102
- name="vasSelector"
103
- value="${this.record.palletizingVasName ? this.record.palletizingVasName : ''}"
104
- @click="${this.clickHandler}"
105
- readonly
106
- />
107
-
108
- <label>${i18next.t('label.comment')}</label>
109
- <input
110
- name="description"
111
- type="text"
112
- value="${this.record.palletizingDescription ? this.record.palletizingDescription : ''}"
113
- required
114
- />
115
101
  </fieldset>
116
102
  </form>
117
103
 
@@ -120,27 +106,15 @@ class AdjustPalletQty extends localize(i18next)(LitElement) {
120
106
  </div>
121
107
  `
122
108
  }
123
- clickHandler(event) {
124
- this._openVasSelector()
125
- this.repalletizingClick = !this.repalletizingClick
126
- }
127
109
 
128
110
  get _form() {
129
111
  return this.shadowRoot.querySelector('form')
130
112
  }
131
113
 
132
- get _vasSelector() {
133
- return this.shadowRoot.querySelector('input[name=vasSelector]')
134
- }
135
-
136
114
  get _palletQtyInput() {
137
115
  return this.shadowRoot.querySelector('input[name=palletQty]')
138
116
  }
139
117
 
140
- get _descriptionInput() {
141
- return this.shadowRoot.querySelector('input[name=description]')
142
- }
143
-
144
118
  firstUpdated() {
145
119
  this._focusOnInput()
146
120
  }
@@ -149,39 +123,32 @@ class AdjustPalletQty extends localize(i18next)(LitElement) {
149
123
  setTimeout(() => this._palletQtyInput.select(), 100)
150
124
  }
151
125
 
152
- _openVasSelector() {
153
- openPopup(
154
- html`
155
- <vas-selector
156
- @selected="${e => {
157
- this._vasSelector.value = `${e.detail.name} ${e.detail.description ? `(${e.detail.description})` : ''}`
158
- this._vasSelector.palletizingVasId = e.detail.id
159
- }}"
160
- ></vas-selector>
161
- `,
162
- {
163
- backdrop: true,
164
- size: 'large',
165
- title: i18next.t('title.select_warehouse')
166
- }
167
- )
168
- }
169
-
170
- _adjustPalletQty() {
126
+ async _adjustPalletQty() {
171
127
  try {
172
128
  this._validate()
173
- this.dispatchEvent(
174
- new CustomEvent('pallet-adjusted', {
175
- detail: {
176
- palletQty: parseInt(this._palletQtyInput.value),
177
- palletizingDescription: this._descriptionInput.value,
178
- palletizingVasId: this._vasSelector.palletizingVasId,
179
- palletizingVasName: this._vasSelector.value
129
+
130
+ const response = await client.mutate({
131
+ mutation: gql`
132
+ mutation updateOrderProduct($name: String!, $patch: OrderProductPatch!) {
133
+ updateOrderProduct(name: $name, patch: $patch) {
134
+ name
135
+ }
180
136
  }
181
- })
182
- )
137
+ `,
138
+ variables: { name: this.record?.opName, patch: { palletQty: parseInt(this._palletQtyInput.value) } }
139
+ })
140
+
141
+ if (!response.errors) {
142
+ this.dispatchEvent(
143
+ new CustomEvent('pallet-adjusted', {
144
+ detail: {
145
+ palletQty: parseInt(this._palletQtyInput.value)
146
+ }
147
+ })
148
+ )
183
149
 
184
- history.back()
150
+ history.back()
151
+ }
185
152
  } catch (e) {
186
153
  this._showToast(e)
187
154
  }
@@ -189,8 +156,6 @@ class AdjustPalletQty extends localize(i18next)(LitElement) {
189
156
 
190
157
  _validate() {
191
158
  if (!this._form.checkValidity()) throw new Error(i18next.t('text.invalid_form'))
192
- if (this.record.isLooseItem && !this._vasSelector.palletizingVasId)
193
- throw new Error(i18next.t('text.vas_is_not_selected'))
194
159
  }
195
160
 
196
161
  _showToast({ type, message }) {
@@ -1,17 +1,25 @@
1
1
  import '@things-factory/barcode-ui'
2
+ import '@things-factory/grist-ui'
3
+ import '../components/popup-note'
4
+ import '../vas/related-vas-list'
5
+ import './adjust-pallet-qty'
6
+ import './carton-label-popup'
7
+ import './pallet-label-popup'
8
+ import './putaway-worksheet-generate-popup'
9
+
10
+ import gql from 'graphql-tag'
11
+ import { css, html } from 'lit-element'
12
+
2
13
  import { getCodeByName } from '@things-factory/code-base'
3
14
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
4
- import '@things-factory/grist-ui'
5
15
  import { getRenderer } from '@things-factory/grist-ui'
6
16
  import { i18next, localize } from '@things-factory/i18n-base'
7
17
  import { openPopup } from '@things-factory/layout-base'
8
18
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
9
19
  import { CommonButtonStyles } from '@things-factory/styles'
10
20
  import { isMobileDevice } from '@things-factory/utils'
11
- import gql from 'graphql-tag'
12
- import { css, html } from 'lit-element'
21
+
13
22
  import { fetchSettingRule } from '../../fetch-setting-value'
14
- import '../components/popup-note'
15
23
  import {
16
24
  ARRIVAL_NOTICE,
17
25
  ORDER_VAS_STATUS,
@@ -21,11 +29,6 @@ import {
21
29
  VAS_PRODUCT_TYPE,
22
30
  WORKSHEET_STATUS
23
31
  } from '../constants'
24
- import '../vas/related-vas-list'
25
- import './adjust-pallet-qty'
26
- import './carton-label-popup'
27
- import './pallet-label-popup'
28
- import './putaway-worksheet-generate-popup'
29
32
 
30
33
  class WorksheetUnloading extends localize(i18next)(PageView) {
31
34
  static get properties() {
@@ -576,6 +579,7 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
576
579
  return {
577
580
  ...worksheetDetail.targetProduct,
578
581
  id: worksheetDetail.id,
582
+ opName: worksheetDetail.targetProduct.name,
579
583
  name: worksheetDetail.name,
580
584
  status: worksheetDetail.status,
581
585
  description: worksheetDetail.description,
@@ -802,9 +806,6 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
802
806
  records: this.data.records.map(item => {
803
807
  if (item.name === record.name) {
804
808
  item.palletQty = e.detail.palletQty
805
- item.palletizingDescription = e.detail.palletizingDescription
806
- item.palletizingVasId = e.detail.palletizingVasId
807
- item.palletizingVasName = e.detail.palletizingVasName
808
809
  }
809
810
 
810
811
  return item
@@ -926,12 +927,6 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
926
927
  description: worksheetDetail.description
927
928
  }
928
929
 
929
- if (!worksheetDetail.isPalletized) {
930
- _tempObj.palletizingVasId = worksheetDetail.palletizingVasId ? worksheetDetail.palletizingVasId : null
931
- _tempObj.palletQty = worksheetDetail.palletQty
932
- _tempObj.palletizingDescription = worksheetDetail.palletizingDescription
933
- }
934
-
935
930
  if (worksheetDetail?.initialBatchId) {
936
931
  _tempObj.initialBatchId = worksheetDetail.initialBatchId
937
932
  }
@@ -107,10 +107,14 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
107
107
 
108
108
  if (
109
109
  this.releaseGoodNo &&
110
- (this.orderInformation.status === 'packed' || this.orderInformation.status === 'unfulfilled' || this.orderInformation.status === 'processing') &&
110
+ (this.orderInformation.status === 'packed' ||
111
+ this.orderInformation.status === 'unfulfilled' ||
112
+ this.orderInformation.status === 'processing') &&
111
113
  !this._trackingNo &&
112
114
  !this._logisticsInitiated &&
113
- (this.platform === PLATFORM.LAZADA.value || this.platform === PLATFORM.SHOPIFY.value || this.platform === PLATFORM.WOOCOMMERCE.value) &&
115
+ (this.platform === PLATFORM.LAZADA.value ||
116
+ this.platform === PLATFORM.SHOPIFY.value ||
117
+ this.platform === PLATFORM.WOOCOMMERCE.value) &&
114
118
  this.completed
115
119
  ) {
116
120
  actions.push({
@@ -364,12 +368,17 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
364
368
  marketplaceOrder {
365
369
  id
366
370
  name
371
+ orderNo
367
372
  status
368
373
  otherInfoJSON
369
374
  marketplaceStore {
370
375
  id
371
376
  platform
372
377
  }
378
+ domain {
379
+ id
380
+ name
381
+ }
373
382
  }
374
383
  platform
375
384
  }
@@ -769,33 +778,46 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
769
778
  if (this.orderInformation.marketplaceStore.platform === PLATFORM.LAZADA.value) {
770
779
  response = await client.mutate({
771
780
  mutation: gql`
772
- mutation updateOrderReadyToShip($shippingProvider: String!, $deliveryType: String!, $orderNo: String!) {
781
+ mutation updateOrderReadyToShip(
782
+ $shippingProvider: String!
783
+ $deliveryType: String!
784
+ $orderNo: String!
785
+ $orderId: String!
786
+ $domainId: String!
787
+ ) {
773
788
  updateOrderReadyToShip(
774
789
  shippingProvider: $shippingProvider
775
790
  deliveryType: $deliveryType
776
791
  orderNo: $orderNo
792
+ orderId: $orderId
793
+ domainId: $domainId
777
794
  )
778
795
  }
779
796
  `,
780
797
  variables: {
781
798
  shippingProvider: this.getShippingProvider(),
782
799
  deliveryType: this.getDeliveryType(),
783
- orderNo: this.orderInformation.name
800
+ orderNo: this.orderInformation.orderNo,
801
+ orderId: this.orderInformation.name,
802
+ domainId: this.orderInformation.domain.id
784
803
  }
785
804
  })
786
805
  }
787
806
 
788
- if (this.orderInformation.marketplaceStore.platform === PLATFORM.SHOPIFY.value || this.orderInformation.marketplaceStore.platform === PLATFORM.WOOCOMMERCE.value) {
807
+ if (
808
+ this.orderInformation.marketplaceStore.platform === PLATFORM.SHOPIFY.value ||
809
+ this.orderInformation.marketplaceStore.platform === PLATFORM.WOOCOMMERCE.value
810
+ ) {
789
811
  response = await client.mutate({
790
812
  mutation: gql`
791
- mutation updateOrderReadyToShip($orderNo: String!) {
792
- updateOrderReadyToShip(
793
- orderNo: $orderNo
794
- )
813
+ mutation updateOrderReadyToShip($orderNo: String!, $orderId: String!, $domainId: String!) {
814
+ updateOrderReadyToShip(orderNo: $orderNo, orderId: $orderId, domainId: $domainId)
795
815
  }
796
816
  `,
797
817
  variables: {
798
- orderNo: this.orderInformation.name
818
+ orderNo: this.orderInformation.orderNo,
819
+ orderId: this.orderInformation.name,
820
+ domainId: this.orderInformation.domain.id
799
821
  }
800
822
  })
801
823
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.1.7",
3
+ "version": "4.1.8",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -85,7 +85,7 @@
85
85
  "@things-factory/print-ui": "^4.1.6",
86
86
  "@things-factory/product-base": "^4.1.6",
87
87
  "@things-factory/resource-ui": "^4.1.6",
88
- "@things-factory/sales-ui": "^4.1.7",
88
+ "@things-factory/sales-ui": "^4.1.8",
89
89
  "@things-factory/scene-data-transform": "^4.1.6",
90
90
  "@things-factory/scene-excel": "^4.1.6",
91
91
  "@things-factory/scene-firebase": "^4.1.6",
@@ -102,11 +102,11 @@
102
102
  "@things-factory/system-ui": "^4.1.6",
103
103
  "@things-factory/transport-base": "^4.1.6",
104
104
  "@things-factory/tutorial-ui": "^4.1.6",
105
- "@things-factory/warehouse-base": "^4.1.6",
106
- "@things-factory/worksheet-base": "^4.1.7"
105
+ "@things-factory/warehouse-base": "^4.1.8",
106
+ "@things-factory/worksheet-base": "^4.1.8"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@things-factory/builder": "^4.1.6"
110
110
  },
111
- "gitHead": "5e68e258a7ec97f4c92a11fe8aa88088a4c80ea6"
111
+ "gitHead": "a2c80a6ae7adc79c5779b5ef9173c66d5a5d89b9"
112
112
  }