@things-factory/operato-wms 4.0.27 → 4.0.31

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.
Files changed (71) hide show
  1. package/client/fetch-setting-value.js +10 -2
  2. package/client/pages/bulk-operation/bulk-operation.js +44 -10
  3. package/client/pages/bulk-operation/validate-gan-popup.js +5 -4
  4. package/client/pages/bulk-operation/validate-ro-popup.js +7 -39
  5. package/client/pages/components/popup-reusable-pallet.js +145 -0
  6. package/client/pages/components/vas-templates/vas-pallet-add-popup.js +12 -11
  7. package/client/pages/components/vas-templates/vas-relabel.js +57 -34
  8. package/client/pages/components/vas-templates/vas-repack-relabel.js +56 -36
  9. package/client/pages/components/vas-templates/vas-repack.js +45 -31
  10. package/client/pages/components/vas-templates/vas-repalletizing.js +58 -39
  11. package/client/pages/components/vas-templates/vas-unpack.js +38 -24
  12. package/client/pages/components/worksheet-information-popup.js +4 -1
  13. package/client/pages/inbound/unload-product.js +116 -91
  14. package/client/pages/inventory/onhand-inventory.js +1 -0
  15. package/client/pages/master/location-list.js +1 -0
  16. package/client/pages/master/print-location-label.js +131 -146
  17. package/client/pages/order/arrival-notice/arrival-notice-detail.js +52 -44
  18. package/client/pages/order/arrival-notice/arrival-notice-list.js +2 -5
  19. package/client/pages/order/goods-received-note/received-note-detail.js +7 -6
  20. package/client/pages/order/release-order/b2b/b2b-order-list.js +1 -5
  21. package/client/pages/order/release-order/batch-generate-single-picking-worksheet-popup.js +1 -1
  22. package/client/pages/order/release-order/batch-picking-popup.js +4 -3
  23. package/client/pages/order/release-order/create-release-order.js +1 -1
  24. package/client/pages/order/release-order/release-extra-product-popup.js +10 -5
  25. package/client/pages/order/release-order/release-order-detail.js +29 -12
  26. package/client/pages/order/return-order/create-return-order.js +41 -52
  27. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +2 -2
  28. package/client/pages/order/transport-order/create-delivery-order.js +4 -2
  29. package/client/pages/order/transport-order/delivery-note-popup.js +2 -2
  30. package/client/pages/outbound/packing-product.js +6 -0
  31. package/client/pages/outbound/packing-worksheet-list.js +64 -4
  32. package/client/pages/outbound/picking-product.js +12 -7
  33. package/client/pages/outbound/worksheet-batch-picking.js +1 -1
  34. package/client/pages/outbound/worksheet-loading.js +16 -14
  35. package/client/pages/outbound/worksheet-packing.js +15 -13
  36. package/client/pages/outbound/worksheet-picking.js +2 -2
  37. package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +8 -9
  38. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +26 -25
  39. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +10 -9
  40. package/client/pages/report/custom-elccl/elccl-inventory-pallet-detail-report.js +13 -8
  41. package/client/pages/report/custom-elccl/elccl-inventory-report.js +11 -10
  42. package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +5 -1
  43. package/client/pages/report/inbound-order-details-report.js +3 -5
  44. package/client/pages/report/inventory-pallet-report.js +13 -12
  45. package/client/pages/report/job-sheet-popup.js +9 -9
  46. package/client/pages/report/job-sheet-report.js +6 -6
  47. package/client/pages/system/location-sorting-rule.js +53 -46
  48. package/client/pages/vas/abstract-execute-vas.js +51 -35
  49. package/client/pages/vas/execute-pure-vas.js +63 -64
  50. package/client/pages/vas/execute-ref-vas.js +39 -41
  51. package/client/pages/vas/related-vas-list.js +7 -6
  52. package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +3 -3
  53. package/client/pages/vas/reverse-kitting/popup-combination-sets.js +3 -3
  54. package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +1 -1
  55. package/client/pages/vas/target-inventory-assignment-popup.js +16 -14
  56. package/client/pages/vas/vas-pallet-label-popup.js +1 -1
  57. package/client/pages/vas/vas-worksheet-list.js +9 -8
  58. package/client/pages/vas/worksheet-ref-vas.js +7 -6
  59. package/client/pages/vas/worksheet-vas.js +16 -14
  60. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +2 -4
  61. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +1 -1
  62. package/dist-server/graphql/types/reports/inbound-order-details-report.js +2 -1
  63. package/dist-server/graphql/types/reports/inbound-order-details-report.js.map +1 -1
  64. package/package.json +65 -65
  65. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +2 -4
  66. package/server/graphql/types/reports/inbound-order-details-report.ts +2 -1
  67. package/translations/en.json +15 -1
  68. package/translations/ko.json +20 -7
  69. package/translations/ms.json +21 -8
  70. package/translations/zh.json +21 -8
  71. package/client/pages/components/popup-unloading.js +0 -610
@@ -7,7 +7,7 @@ import { connect } from 'pwa-helpers/connect-mixin'
7
7
 
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { client, PageView, store } from '@things-factory/shell'
10
- import { flattenObject, gqlBuilder, isMobileDevice } from '@things-factory/utils'
10
+ import { flattenObject, isMobileDevice } from '@things-factory/utils'
11
11
 
12
12
  class ElcclDailyOrderInventoryReport extends connect(store)(localize(i18next)(PageView)) {
13
13
  static get styles() {
@@ -261,33 +261,34 @@ class ElcclDailyOrderInventoryReport extends connect(store)(localize(i18next)(Pa
261
261
 
262
262
  const response = await client.query({
263
263
  query: gql`
264
- query {
265
- elcclDailyOrderInventoryReport(${gqlBuilder.buildArgs({
266
- filters: [...filter, { name: 'tzoffset', operator: 'custom', value: tzoffset }],
267
- pagination: { page, limit },
268
- sortings: sorters
269
- })}) {
270
- items{
271
- bizplace {
272
- name
273
- }
274
- bag
275
- bagRunningTotal
276
- basket
277
- basketRunningTotal
278
- carton
279
- cartonRunningTotal
280
- createdAt
281
- doRefNo
282
- orderNo
283
- orderRefNo
284
- pallet
285
- palletRunningTotal
264
+ query elcclDailyOrderInventoryReport($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
265
+ elcclDailyOrderInventoryReport(filters: $filters, pagination: $pagination, sortings: $sortings) {
266
+ items {
267
+ bizplace {
268
+ name
286
269
  }
287
- total
270
+ bag
271
+ bagRunningTotal
272
+ basket
273
+ basketRunningTotal
274
+ carton
275
+ cartonRunningTotal
276
+ createdAt
277
+ doRefNo
278
+ orderNo
279
+ orderRefNo
280
+ pallet
281
+ palletRunningTotal
288
282
  }
283
+ total
289
284
  }
290
- `
285
+ }
286
+ `,
287
+ variables: {
288
+ filters: [...filter, { name: 'tzoffset', operator: 'custom', value: tzoffset }],
289
+ pagination: { page, limit },
290
+ sortings: sorters
291
+ }
291
292
  })
292
293
  return {
293
294
  total: response.data.elcclDailyOrderInventoryReport.total,
@@ -7,7 +7,7 @@ import { connect } from 'pwa-helpers/connect-mixin'
7
7
 
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { client, PageView, store } from '@things-factory/shell'
10
- import { flattenObject, gqlBuilder, isMobileDevice } from '@things-factory/utils'
10
+ import { flattenObject, isMobileDevice } from '@things-factory/utils'
11
11
 
12
12
  class ElcclDeliveryOrderSummary extends connect(store)(localize(i18next)(PageView)) {
13
13
  static get styles() {
@@ -229,12 +229,8 @@ class ElcclDeliveryOrderSummary extends connect(store)(localize(i18next)(PageVie
229
229
 
230
230
  const response = await client.query({
231
231
  query: gql`
232
- query {
233
- deliveryOrders(${gqlBuilder.buildArgs({
234
- filters: [...filters],
235
- pagination: { page, limit },
236
- sortings: sorters
237
- })}) {
232
+ query deliveryOrders($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
233
+ deliveryOrders(filters: $filters, pagination: $pagination, sortings: $sortings) {
238
234
  items {
239
235
  id
240
236
  name
@@ -246,7 +242,7 @@ class ElcclDeliveryOrderSummary extends connect(store)(localize(i18next)(PageVie
246
242
  orderInventories {
247
243
  inventory {
248
244
  batchId
249
- product{
245
+ product {
250
246
  name
251
247
  description
252
248
  }
@@ -266,7 +262,12 @@ class ElcclDeliveryOrderSummary extends connect(store)(localize(i18next)(PageVie
266
262
  total
267
263
  }
268
264
  }
269
- `
265
+ `,
266
+ variables: {
267
+ filters: [...filters],
268
+ pagination: { page, limit },
269
+ sortings: sorters
270
+ }
270
271
  })
271
272
 
272
273
  if (!response.errors) {
@@ -7,7 +7,7 @@ import { connect } from 'pwa-helpers/connect-mixin'
7
7
 
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { client, PageView, store } from '@things-factory/shell'
10
- import { flattenObject, gqlBuilder } from '@things-factory/utils'
10
+ import { flattenObject } from '@things-factory/utils'
11
11
 
12
12
  class ElcclInventoryPalletDetailReport extends connect(store)(localize(i18next)(PageView)) {
13
13
  static get styles() {
@@ -242,12 +242,12 @@ class ElcclInventoryPalletDetailReport extends connect(store)(localize(i18next)(
242
242
 
243
243
  const response = await client.query({
244
244
  query: gql`
245
- query {
246
- elcclInventoryHistoryPalletDetailReport(${gqlBuilder.buildArgs({
247
- filters,
248
- pagination: { page, limit },
249
- sortings: sorters
250
- })}) {
245
+ query elcclInventoryHistoryPalletDetailReport(
246
+ $filters: [Filter!]
247
+ $pagination: Pagination
248
+ $sortings: [Sorting!]
249
+ ) {
250
+ elcclInventoryHistoryPalletDetailReport(filters: $filters, pagination: $pagination, sortings: $sortings) {
251
251
  bizplace {
252
252
  name
253
253
  description
@@ -266,7 +266,12 @@ class ElcclInventoryPalletDetailReport extends connect(store)(localize(i18next)(
266
266
  containerSize
267
267
  }
268
268
  }
269
- `
269
+ `,
270
+ variables: {
271
+ filters,
272
+ pagination: { page, limit },
273
+ sortings: sorters
274
+ }
270
275
  })
271
276
 
272
277
  this.data = {
@@ -7,7 +7,7 @@ import { connect } from 'pwa-helpers/connect-mixin'
7
7
 
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { client, PageView, store } from '@things-factory/shell'
10
- import { flattenObject, gqlBuilder } from '@things-factory/utils'
10
+ import { flattenObject } from '@things-factory/utils'
11
11
 
12
12
  class ElcclInventoryReport extends connect(store)(localize(i18next)(PageView)) {
13
13
  static get styles() {
@@ -379,17 +379,18 @@ class ElcclInventoryReport extends connect(store)(localize(i18next)(PageView)) {
379
379
  } else {
380
380
  const response = await client.query({
381
381
  query: gql`
382
- query {
383
- productsByBizplace(${gqlBuilder.buildArgs({
384
- filters: [...bizplace]
385
- })}) {
386
- items {
387
- id
388
- name
389
- }
382
+ query productsByBizplace($filters: [Filter!]) {
383
+ productsByBizplace(filters: $filters) {
384
+ items {
385
+ id
386
+ name
390
387
  }
391
388
  }
392
- `
389
+ }
390
+ `,
391
+ variables: {
392
+ filters: [...bizplace]
393
+ }
393
394
  })
394
395
 
395
396
  if (!response.errors) {
@@ -378,7 +378,11 @@ class ElcclInventorySummaryReport extends connect(store)(localize(i18next)(PageV
378
378
  })
379
379
  ]
380
380
 
381
- let data = (await this.fetchHandler({ page: 1, limit: 9999999 })).records
381
+ header.filter(hdr => hdr.type == 'date').map(hdr => (hdr.type = 'string'))
382
+
383
+ let data = (await this.fetchHandler({ page: 1, limit: 9999999 })).records.map(itm =>
384
+ flattenObject({ ...itm, initialDate: new Date(parseInt(itm.initialDate)).toLocaleDateString() })
385
+ )
382
386
 
383
387
  return { header, data }
384
388
  } catch (e) {
@@ -205,7 +205,7 @@ class InboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVie
205
205
  },
206
206
  {
207
207
  type: 'string',
208
- name: 'purchaseOrder|name',
208
+ name: 'purchaseOrderNo',
209
209
  header: i18next.t('field.po_no'),
210
210
  width: 200
211
211
  },
@@ -602,10 +602,8 @@ class InboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVie
602
602
  description
603
603
  type
604
604
  }
605
- purchaseOrder {
606
- id
607
- name
608
- }
605
+ purchaseOrderId
606
+ purchaseOrderNo
609
607
  contactPoint {
610
608
  id
611
609
  name
@@ -7,7 +7,7 @@ import { connect } from 'pwa-helpers/connect-mixin'
7
7
 
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { client, PageView, store } from '@things-factory/shell'
10
- import { flattenObject, gqlBuilder } from '@things-factory/utils'
10
+ import { flattenObject } from '@things-factory/utils'
11
11
 
12
12
  class InventoryPalletReport extends connect(store)(localize(i18next)(PageView)) {
13
13
  static get styles() {
@@ -196,16 +196,8 @@ class InventoryPalletReport extends connect(store)(localize(i18next)(PageView))
196
196
 
197
197
  const response = await client.query({
198
198
  query: gql`
199
- query {
200
- inventoryHistoryPalletReport(${gqlBuilder.buildArgs({
201
- filters: [
202
- ...this.searchForm.queryFilters.map(filter => {
203
- return filter
204
- })
205
- ],
206
- pagination: { page, limit },
207
- sortings: sorters
208
- })}) {
199
+ query inventoryHistoryPalletReport($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
200
+ inventoryHistoryPalletReport(filters: $filters, pagination: $pagination, sortings: $sortings) {
209
201
  bizplace {
210
202
  name
211
203
  description
@@ -220,7 +212,16 @@ class InventoryPalletReport extends connect(store)(localize(i18next)(PageView))
220
212
  closingBalance
221
213
  }
222
214
  }
223
- `
215
+ `,
216
+ variables: {
217
+ filters: [
218
+ ...this.searchForm.queryFilters.map(filter => {
219
+ return filter
220
+ })
221
+ ],
222
+ pagination: { page, limit },
223
+ sortings: sorters
224
+ }
224
225
  })
225
226
  return {
226
227
  total: 0,
@@ -2,7 +2,6 @@ import { SingleColumnFormStyles } from '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import { i18next, localize } from '@things-factory/i18n-base'
4
4
  import { client } from '@things-factory/shell'
5
- import { gqlBuilder } from '@things-factory/utils'
6
5
  import gql from 'graphql-tag'
7
6
  import { css, html, LitElement } from 'lit-element'
8
7
 
@@ -115,19 +114,20 @@ class JobSheetPopup extends localize(i18next)(LitElement) {
115
114
 
116
115
  async _saveJobSheet() {
117
116
  try {
118
- const response = await client.query({
119
- query: gql`
120
- mutation {
121
- updateJobSheet(${gqlBuilder.buildArgs({
122
- name: this.jobSheetNo,
123
- patch: { ...this._getJobSheetInfo() }
124
- })}) {
117
+ const response = await client.mutate({
118
+ mutation: gql`
119
+ mutation updateJobSheet($name: String!, $patch: JobSheetPatch!) {
120
+ updateJobSheet(name: $name, patch: $patch) {
125
121
  id
126
122
  name
127
123
  description
128
124
  }
129
125
  }
130
- `
126
+ `,
127
+ variables: {
128
+ name: this.jobSheetNo,
129
+ patch: { ...this._getJobSheetInfo() }
130
+ }
131
131
  })
132
132
 
133
133
  if (!response.errors) {
@@ -2,7 +2,6 @@ import { i18next, localize } from '@things-factory/i18n-base'
2
2
  import { openPopup } from '@things-factory/layout-base'
3
3
  import { client, navigate, PageView } from '@things-factory/shell'
4
4
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
5
- import { gqlBuilder } from '@things-factory/utils'
6
5
  import gql from 'graphql-tag'
7
6
  import { css, html } from 'lit-element'
8
7
  import './job-sheet-popup'
@@ -86,10 +85,8 @@ class JobSheetReport extends localize(i18next)(PageView) {
86
85
  async _fetchJobSheet(arrivalNoticeRefNo) {
87
86
  const response = await client.query({
88
87
  query: gql`
89
- query {
90
- jobSheet(${gqlBuilder.buildArgs({
91
- arrivalNoticeRefNo
92
- })}) {
88
+ query jobSheet($arrivalNoticeRefNo: String!) {
89
+ jobSheet(arrivalNoticeRefNo: $arrivalNoticeRefNo) {
93
90
  name
94
91
  containerSize
95
92
  containerMtDate
@@ -102,7 +99,10 @@ class JobSheetReport extends localize(i18next)(PageView) {
102
99
  ata
103
100
  }
104
101
  }
105
- `
102
+ `,
103
+ variables: {
104
+ arrivalNoticeRefNo
105
+ }
106
106
  })
107
107
 
108
108
  if (!response.errors) {
@@ -2,8 +2,9 @@ import '@things-factory/form-ui'
2
2
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
3
3
  import '@things-factory/grist-ui'
4
4
  import { i18next, localize } from '@things-factory/i18n-base'
5
+ import { CommonButtonStyles } from '@things-factory/styles'
5
6
  import { client, PageView } from '@things-factory/shell'
6
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
7
+ import { isMobileDevice } from '@things-factory/utils'
7
8
  import gql from 'graphql-tag'
8
9
  import { css, html } from 'lit-element'
9
10
  import { LOCATION_SORTING_RULE } from '../constants'
@@ -75,11 +76,13 @@ class LocationSortingRule extends localize(i18next)(PageView) {
75
76
  actions: [
76
77
  {
77
78
  title: i18next.t('button.preview'),
78
- action: this._getPreviewData.bind(this)
79
+ action: this._getPreviewData.bind(this),
80
+ ...CommonButtonStyles.preview
79
81
  },
80
82
  {
81
83
  title: i18next.t('button.reset'),
82
- action: this._resetRule.bind(this)
84
+ action: this._resetRule.bind(this),
85
+ ...CommonButtonStyles.refresh
83
86
  },
84
87
  {
85
88
  title: i18next.t('button.save'),
@@ -109,7 +112,7 @@ class LocationSortingRule extends localize(i18next)(PageView) {
109
112
  <option value=""></option>
110
113
  ${this._locationColumns
111
114
  .filter(column => Object.keys(this.sortingRule).indexOf(column.value) < 0)
112
- .map(column => html` <option value="${column.value}">${i18next.t(`field.${column.name}`)}</option> `)}
115
+ .map(column => html` <option value="${column.value}">${i18next.t(`${column.name}`)}</option> `)}
113
116
  </select>
114
117
  </fieldset>
115
118
  </form>
@@ -126,7 +129,7 @@ class LocationSortingRule extends localize(i18next)(PageView) {
126
129
  ${this._orderTypes.map(
127
130
  orderType => html`
128
131
  <option value="${orderType.value}" ?selected="${this.sortingRule[key] === orderType.value}">
129
- ${orderType.name}
132
+ ${i18next.t(`${orderType.name}`)}
130
133
  </option>
131
134
  `
132
135
  )}
@@ -164,15 +167,16 @@ class LocationSortingRule extends localize(i18next)(PageView) {
164
167
  async _getCurrentSortingRule() {
165
168
  const response = await client.query({
166
169
  query: gql`
167
- query {
168
- setting(${gqlBuilder.buildArgs({
169
- name: LOC_SORTING_RULE_SETTING_KEY
170
- })}) {
170
+ query setting($name: String!) {
171
+ setting(name: $name) {
171
172
  id
172
173
  value
173
174
  }
174
175
  }
175
- `
176
+ `,
177
+ variables: {
178
+ name: LOC_SORTING_RULE_SETTING_KEY
179
+ }
176
180
  })
177
181
 
178
182
  if (!response.errors) {
@@ -229,23 +233,24 @@ class LocationSortingRule extends localize(i18next)(PageView) {
229
233
 
230
234
  const response = await client.query({
231
235
  query: gql`
232
- query {
233
- locations(${gqlBuilder.buildArgs({
234
- filters: [],
235
- pagination: { page: 1, limit: 100 },
236
- sortings
237
- })}) {
238
- items {
239
- name
240
- type
241
- zone
242
- row
243
- column
244
- shelf
236
+ query locations($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
237
+ locations(filters: $filters, pagination: $pagination, sortings: $sortings) {
238
+ items {
239
+ name
240
+ type
241
+ zone
242
+ row
243
+ column
244
+ shelf
245
+ }
245
246
  }
246
247
  }
248
+ `,
249
+ variables: {
250
+ filters: [],
251
+ pagination: { page: 1, limit: 100 },
252
+ sortings
247
253
  }
248
- `
249
254
  })
250
255
 
251
256
  if (!response.errors) {
@@ -262,36 +267,38 @@ class LocationSortingRule extends localize(i18next)(PageView) {
262
267
  async _saveSetting() {
263
268
  let response = null
264
269
  if (!this.settingId) {
265
- response = await client.query({
266
- query: gql`
267
- mutation {
268
- createSetting(${gqlBuilder.buildArgs({
269
- setting: {
270
- name: LOC_SORTING_RULE_SETTING_KEY,
271
- category: 'location',
272
- description: 'location sorting rules',
273
- value: JSON.stringify(this.sortingRule)
274
- }
275
- })}) {
270
+ response = await client.mutate({
271
+ mutation: gql`
272
+ mutation createSetting($setting: NewSetting!) {
273
+ createSetting(setting: $setting) {
276
274
  value
277
275
  }
278
276
  }
279
- `
277
+ `,
278
+ variables: {
279
+ setting: {
280
+ name: LOC_SORTING_RULE_SETTING_KEY,
281
+ category: 'location',
282
+ description: 'location sorting rules',
283
+ value: JSON.stringify(this.sortingRule)
284
+ }
285
+ }
280
286
  })
281
287
  } else {
282
- response = await client.query({
283
- query: gql`
284
- mutation {
285
- updateSetting(${gqlBuilder.buildArgs({
286
- name: LOC_SORTING_RULE_SETTING_KEY,
287
- patch: {
288
- value: JSON.stringify(this.sortingRule)
289
- }
290
- })}) {
288
+ response = await client.mutate({
289
+ mutation: gql`
290
+ mutation updateSetting($name: String!, $patch: SettingPatch!) {
291
+ updateSetting(name: $name, patch: $patch) {
291
292
  value
292
293
  }
293
294
  }
294
- `
295
+ `,
296
+ variables: {
297
+ name: LOC_SORTING_RULE_SETTING_KEY,
298
+ patch: {
299
+ value: JSON.stringify(this.sortingRule)
300
+ }
301
+ }
295
302
  })
296
303
  }
297
304
 
@@ -3,7 +3,6 @@ import { getRenderer } from '@things-factory/grist-ui'
3
3
  import { i18next } from '@things-factory/i18n-base'
4
4
  import { openPopup } from '@things-factory/layout-base'
5
5
  import { client, CustomAlert, navigate, UPDATE_CONTEXT, store } from '@things-factory/shell'
6
- import { gqlBuilder } from '@things-factory/utils'
7
6
  import { CommonButtonStyles } from '@things-factory/styles'
8
7
  import gql from 'graphql-tag'
9
8
  import { css, html, LitElement } from 'lit-element'
@@ -111,7 +110,7 @@ export class AbstractExecuteVas extends LitElement {
111
110
  if (this._selectedTaskStatus === WORKSHEET_STATUS.EXECUTING.value) {
112
111
  actions.push(
113
112
  { title: i18next.t('button.issue'), action: this._openIssueEditor.bind(this), ...CommonButtonStyles.issue },
114
- { title: i18next.t('button.done'), action: this._executeVas.bind(this), ...CommonButtonStyles.done }
113
+ { title: i18next.t('button.done'), action: this._executeVas.bind(this), ...CommonButtonStyles.save }
115
114
  )
116
115
  } else if (this._selectedTaskStatus === WORKSHEET_STATUS.DONE.value) {
117
116
  actions.push({
@@ -407,7 +406,11 @@ export class AbstractExecuteVas extends LitElement {
407
406
  const response = await client.query({
408
407
  query: gql`
409
408
  ${this.fetchVasQuery}
410
- `
409
+ `,
410
+ variables: {
411
+ orderNo: this.orderNo,
412
+ orderType: this.orderType
413
+ }
411
414
  })
412
415
 
413
416
  if (!response.errors) {
@@ -436,7 +439,11 @@ export class AbstractExecuteVas extends LitElement {
436
439
  const response = await client.query({
437
440
  query: gql`
438
441
  ${this.fetchVasQuery}
439
- `
442
+ `,
443
+ variables: {
444
+ orderNo: this.orderNo,
445
+ orderType: this.orderType
446
+ }
440
447
  })
441
448
 
442
449
  if (!response.errors) {
@@ -465,7 +472,10 @@ export class AbstractExecuteVas extends LitElement {
465
472
  const response = await client.query({
466
473
  query: gql`
467
474
  ${this.fetchInventoriesQuery}
468
- `
475
+ `,
476
+ variables: {
477
+ worksheetDetailName: this._selectedVas.name
478
+ }
469
479
  })
470
480
 
471
481
  if (!response.errors) {
@@ -607,12 +617,15 @@ export class AbstractExecuteVas extends LitElement {
607
617
  await this._template.checkExecutionValidity()
608
618
  }
609
619
 
610
- const response = await client.query({
611
- query: gql`
612
- mutation {
613
- executeVas(${gqlBuilder.buildArgs(this._getExecuteArgs())})
620
+ const response = await client.mutate({
621
+ mutation: gql`
622
+ mutation executeVas($worksheetDetail: WorksheetDetailPatch!) {
623
+ executeVas(worksheetDetail: $worksheetDetail)
614
624
  }
615
- `
625
+ `,
626
+ variables: {
627
+ worksheetDetail: this._getExecuteArgs()
628
+ }
616
629
  })
617
630
 
618
631
  if (!response.errors) {
@@ -629,7 +642,7 @@ export class AbstractExecuteVas extends LitElement {
629
642
  const worksheetDetail = this.taskGrist.dirtyData.records.filter(record => record.name === this._selectedVas.name)[0]
630
643
  let vasWorkseetDetail = { name: worksheetDetail.name }
631
644
  if (worksheetDetail.issue) vasWorkseetDetail.issue = worksheetDetail.issue
632
- return { worksheetDetail: vasWorkseetDetail }
645
+ return vasWorkseetDetail
633
646
  }
634
647
 
635
648
  async _undoVas() {
@@ -647,14 +660,15 @@ export class AbstractExecuteVas extends LitElement {
647
660
  return
648
661
  }
649
662
 
650
- const response = await client.query({
651
- query: gql`
652
- mutation {
653
- undoVas(${gqlBuilder.buildArgs({
654
- worksheetDetail: { name: this._selectedVas.name }
655
- })})
663
+ const response = await client.mutate({
664
+ mutation: gql`
665
+ mutation undoVas($worksheetDetail: WorksheetDetailPatch!) {
666
+ undoVas(worksheetDetail: $worksheetDetail)
656
667
  }
657
- `
668
+ `,
669
+ variables: {
670
+ worksheetDetail: { name: this._selectedVas.name }
671
+ }
658
672
  })
659
673
 
660
674
  if (!response.errors) {
@@ -680,15 +694,16 @@ export class AbstractExecuteVas extends LitElement {
680
694
  return
681
695
  }
682
696
 
683
- const response = await client.query({
684
- query: gql`
685
- mutation {
686
- undoVasInventory(${gqlBuilder.buildArgs({
687
- worksheetDetailName: this._selectedVas.name,
688
- palletId: this._selectedInventory.palletId
689
- })})
697
+ const response = await client.mutate({
698
+ mutation: gql`
699
+ mutation undoVasInventory($worksheetDetailName: String!, $palletId: String!) {
700
+ undoVasInventory(worksheetDetailName: $worksheetDetailName, palletId: $palletId)
690
701
  }
691
- `
702
+ `,
703
+ variables: {
704
+ worksheetDetailName: this._selectedVas.name,
705
+ palletId: this._selectedInventory.palletId
706
+ }
692
707
  })
693
708
 
694
709
  if (!response.errors) {
@@ -722,16 +737,17 @@ export class AbstractExecuteVas extends LitElement {
722
737
 
723
738
  if (!result.value) return
724
739
 
725
- const response = await client.query({
726
- query: gql`
727
- mutation {
728
- completeVas(${gqlBuilder.buildArgs({
729
- orderNo: this.orderNo,
730
- orderType: this.orderType,
731
- worksheetDetails: this._getWorksheetDetails()
732
- })})
740
+ const response = await client.mutate({
741
+ mutation: gql`
742
+ mutation completeVas($orderNo: String!, $orderType: String!, $worksheetDetails: [WorksheetDetailPatch]!) {
743
+ completeVas(orderNo: $orderNo, orderType: $orderType, worksheetDetails: $worksheetDetails)
733
744
  }
734
- `
745
+ `,
746
+ variables: {
747
+ orderNo: this.orderNo,
748
+ orderType: this.orderType,
749
+ worksheetDetails: this._getWorksheetDetails()
750
+ }
735
751
  })
736
752
 
737
753
  if (!response.errors) {