@things-factory/operato-wms 4.0.25 → 4.0.26

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 (66) hide show
  1. package/client/bootstrap.js +1 -1
  2. package/client/pages/billing/claim-chit/claim-chit-detail.js +32 -35
  3. package/client/pages/billing/claim-chit/claim-chit-list.js +17 -17
  4. package/client/pages/billing/claim-chit/create-claim-chit.js +39 -30
  5. package/client/pages/billing/transport-summary-report.js +21 -23
  6. package/client/pages/bulk-operation/validate-ro-popup.js +14 -54
  7. package/client/pages/inbound/expiry-date-popup.js +2 -2
  8. package/client/pages/inbound/inbound-reusable-pallet.js +21 -19
  9. package/client/pages/inbound/palletizing-pallets-popup.js +10 -9
  10. package/client/pages/inbound/putaway-product.js +16 -8
  11. package/client/pages/inbound/putaway-worksheet-generate-popup.js +4 -4
  12. package/client/pages/inbound/unload-product.js +16 -88
  13. package/client/pages/inbound/vas-selector.js +9 -8
  14. package/client/pages/inventory-check/check-inventory-popup.js +20 -18
  15. package/client/pages/inventory-check/cycle-count-recheck-popup.js +25 -15
  16. package/client/pages/inventory-check/inspecting-product.js +2 -2
  17. package/client/pages/inventory-check/inventory-check-list.js +30 -19
  18. package/client/pages/inventory-check/search-popup.js +15 -14
  19. package/client/pages/inventory-check/worksheet-cycle-count.js +17 -15
  20. package/client/pages/master/location-list.js +60 -52
  21. package/client/pages/master/pallet-list.js +34 -30
  22. package/client/pages/master/print-location-label.js +37 -36
  23. package/client/pages/master/warehouse-list.js +33 -29
  24. package/client/pages/master/worker-list.js +30 -30
  25. package/client/pages/order/arrival-notice/assign-buffer-location.js +1 -1
  26. package/client/pages/order/goods-received-note/customer-grn-list.js +9 -8
  27. package/client/pages/order/goods-received-note/customer-received-note.js +8 -7
  28. package/client/pages/order/goods-received-note/received-note-list.js +9 -8
  29. package/client/pages/order/release-order/release-extra-product-popup.js +3 -7
  30. package/client/pages/order/return-order/check-return-order.js +15 -13
  31. package/client/pages/order/return-order/receive-return-order-requests.js +25 -22
  32. package/client/pages/order/return-order/rejected-return-order.js +8 -14
  33. package/client/pages/order/return-order/return-order-assign-buffer-location.js +16 -14
  34. package/client/pages/order/return-order/return-order-detail.js +35 -31
  35. package/client/pages/order/return-order/return-order-list.js +9 -8
  36. package/client/pages/order/return-order/return-order-requests.js +20 -18
  37. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +9 -8
  38. package/client/pages/order/transfer-order/receive-transfer-order-request.js +67 -66
  39. package/client/pages/order/transfer-order/rejected-transfer-order.js +7 -6
  40. package/client/pages/order/transfer-order/transfer-order-detail.js +7 -6
  41. package/client/pages/order/transfer-order/transfer-order-requests.js +20 -18
  42. package/client/pages/order/transport-order/contact-point-selector-popup.js +20 -20
  43. package/client/pages/order/transport-order/delivery-note-popup.js +52 -46
  44. package/client/pages/order/transport-order/print-delivery-note.js +17 -16
  45. package/client/pages/order/transport-order/upload-delivery-note.js +21 -18
  46. package/client/pages/order/transport-order/view-delivery-note.js +19 -22
  47. package/client/pages/order/vas-order/create-vas-order.js +12 -11
  48. package/client/pages/order/vas-order/receive-vas-order.js +25 -22
  49. package/client/pages/order/vas-order/vas-order-detail.js +26 -23
  50. package/client/pages/order/vas-order/vas-order-list.js +9 -8
  51. package/client/pages/order/vas-order/vas-order-requests.js +11 -12
  52. package/client/pages/outbound/outbound-reusable-pallet.js +25 -33
  53. package/client/pages/outbound/single-outbound-worksheet.js +9 -8
  54. package/client/pages/report/job-sheet-list.js +9 -8
  55. package/client/route.js +16 -32
  56. package/package.json +65 -65
  57. package/things-factory.config.js +0 -16
  58. package/translations/en.json +3 -0
  59. package/translations/ko.json +3 -1
  60. package/translations/ms.json +3 -1
  61. package/translations/zh.json +3 -1
  62. package/client/pages/inbound/location-selector.js +0 -224
  63. package/client/pages/master/picking-bin-list.js +0 -354
  64. package/client/pages/order/retail-replenishment-order/retail-replenishment-order-detail.js +0 -315
  65. package/client/pages/order/retail-replenishment-order/retail-replenishment-order-requests.js +0 -307
  66. package/client/pages/order/vas-order/rejected-vas-order.js +0 -300
@@ -6,7 +6,7 @@ import '@things-factory/import-ui'
6
6
  import { openPopup } from '@things-factory/layout-base'
7
7
  import { client, CustomAlert, PageView } from '@things-factory/shell'
8
8
  import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
9
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
9
+ import { isMobileDevice } from '@things-factory/utils'
10
10
  import gql from 'graphql-tag'
11
11
  import { css, html } from 'lit-element'
12
12
 
@@ -212,19 +212,15 @@ class WorkerList extends localize(i18next)(PageView) {
212
212
  async fetchHandler({ page, limit, sorters = [] }) {
213
213
  const response = await client.query({
214
214
  query: gql`
215
- query {
216
- workers(${gqlBuilder.buildArgs({
217
- filters: this.searchForm.queryFilters,
218
- pagination: { page, limit },
219
- sortings: sorters
220
- })}) {
215
+ query workers($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
216
+ workers(filters: $filters, pagination: $pagination, sortings: $sortings) {
221
217
  items {
222
218
  id
223
219
  name
224
220
  description
225
221
  type
226
222
  updatedAt
227
- updater{
223
+ updater {
228
224
  id
229
225
  name
230
226
  description
@@ -233,7 +229,12 @@ class WorkerList extends localize(i18next)(PageView) {
233
229
  total
234
230
  }
235
231
  }
236
- `
232
+ `,
233
+ variables: {
234
+ filters: this.searchForm.queryFilters,
235
+ pagination: { page, limit },
236
+ sortings: sorters
237
+ }
237
238
  })
238
239
 
239
240
  return {
@@ -245,14 +246,13 @@ class WorkerList extends localize(i18next)(PageView) {
245
246
  async importHandler(patches) {
246
247
  const response = await client.query({
247
248
  query: gql`
248
- mutation {
249
- updateMultipleWorker(${gqlBuilder.buildArgs({
250
- patches
251
- })}) {
252
- name
253
- }
249
+ mutation updateMultipleWorker($patches: [WorkerPatch!]!) {
250
+ updateMultipleWorker(patches: $patches) {
251
+ name
254
252
  }
255
- `
253
+ }
254
+ `,
255
+ variables: { patches }
256
256
  })
257
257
 
258
258
  if (!response.errors) {
@@ -271,16 +271,15 @@ class WorkerList extends localize(i18next)(PageView) {
271
271
  async _saveWorker() {
272
272
  let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
273
273
  if (patches && patches.length) {
274
- const response = await client.query({
275
- query: gql`
276
- mutation {
277
- updateMultipleWorker(${gqlBuilder.buildArgs({
278
- patches
279
- })}) {
280
- name
281
- }
274
+ const response = await client.mutate({
275
+ mutation: gql`
276
+ mutation updateMultipleWorker($patches: [WorkerPatch!]!) {
277
+ updateMultipleWorker(patches: $patches) {
278
+ name
282
279
  }
283
- `
280
+ }
281
+ `,
282
+ variables: { patches }
284
283
  })
285
284
 
286
285
  if (!response.errors) {
@@ -308,12 +307,13 @@ class WorkerList extends localize(i18next)(PageView) {
308
307
  if (result.value) {
309
308
  const ids = this.dataGrist.selected.map(record => record.id)
310
309
  if (ids && ids.length > 0) {
311
- const response = await client.query({
312
- query: gql`
313
- mutation {
314
- deleteWorkers(${gqlBuilder.buildArgs({ ids })})
310
+ const response = await client.mutate({
311
+ mutation: gql`
312
+ mutation deleteWorkers($ids: [String!]!) {
313
+ deleteWorkers(ids: $ids)
315
314
  }
316
- `
315
+ `,
316
+ variables: { ids }
317
317
  })
318
318
 
319
319
  if (!response.errors) {
@@ -5,7 +5,7 @@ import { getRenderer } from '@things-factory/grist-ui'
5
5
  import { i18next, localize } from '@things-factory/i18n-base'
6
6
  import { openPopup } from '@things-factory/layout-base'
7
7
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
8
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
8
+ import { isMobileDevice } from '@things-factory/utils'
9
9
  import gql from 'graphql-tag'
10
10
  import { css, html } from 'lit-element'
11
11
  import '../../components/attachment-viewer'
@@ -3,7 +3,7 @@ import '@things-factory/grist-ui'
3
3
  import { i18next, localize } from '@things-factory/i18n-base'
4
4
  import { client, navigate, PageView } from '@things-factory/shell'
5
5
  import { ScrollbarStyles } from '@things-factory/styles'
6
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
6
+ import { isMobileDevice } from '@things-factory/utils'
7
7
  import gql from 'graphql-tag'
8
8
  import { css, html } from 'lit-element'
9
9
  import { getCodeByName } from '@things-factory/code-base'
@@ -174,12 +174,8 @@ class CustomerGrnList extends localize(i18next)(PageView) {
174
174
  const filters = await this.searchForm.getQueryFilters()
175
175
  const response = await client.query({
176
176
  query: gql`
177
- query {
178
- goodsReceivalNotes(${gqlBuilder.buildArgs({
179
- filters: [...filters],
180
- pagination: { page, limit },
181
- sortings: sorters
182
- })}) {
177
+ query goodsReceivalNotes($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
178
+ goodsReceivalNotes(filters: $filters, pagination: $pagination, sortings: $sortings) {
183
179
  items {
184
180
  id
185
181
  name
@@ -208,7 +204,12 @@ class CustomerGrnList extends localize(i18next)(PageView) {
208
204
  total
209
205
  }
210
206
  }
211
- `
207
+ `,
208
+ variables: {
209
+ filters: [...filters],
210
+ pagination: { page, limit },
211
+ sortings: sorters
212
+ }
212
213
  })
213
214
 
214
215
  if (!response.errors) {
@@ -4,7 +4,7 @@ import { css, html } from 'lit-element'
4
4
  import { i18next, localize } from '@things-factory/i18n-base'
5
5
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
6
6
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
7
- import { getPathInfo, gqlBuilder } from '@things-factory/utils'
7
+ import { getPathInfo } from '@things-factory/utils'
8
8
 
9
9
  class CustomerReceivedNote extends localize(i18next)(PageView) {
10
10
  static get properties() {
@@ -136,14 +136,15 @@ class CustomerReceivedNote extends localize(i18next)(PageView) {
136
136
 
137
137
  const response = await client.query({
138
138
  query: gql`
139
- mutation {
140
- receivedGoodsReceivalNote(${gqlBuilder.buildArgs({
141
- name: this._grnNo
142
- })}) {
143
- name
139
+ mutation receivedGoodsReceivalNote($name: String!) {
140
+ receivedGoodsReceivalNote(name: $name) {
141
+ name
142
+ }
144
143
  }
144
+ `,
145
+ variables: {
146
+ name: this._grnNo
145
147
  }
146
- `
147
148
  })
148
149
 
149
150
  if (!response.errors) {
@@ -8,7 +8,7 @@ import { getCodeByName } from '@things-factory/code-base'
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { client, navigate, PageView } from '@things-factory/shell'
10
10
  import { ScrollbarStyles } from '@things-factory/styles'
11
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
11
+ import { isMobileDevice } from '@things-factory/utils'
12
12
 
13
13
  class ReceivedNoteList extends localize(i18next)(PageView) {
14
14
  static get styles() {
@@ -317,12 +317,8 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
317
317
  async fetchHandler({ page, limit, sorters = [{ name: 'createdAt', desc: true }] }) {
318
318
  const response = await client.query({
319
319
  query: gql`
320
- query {
321
- goodsReceivalNotes(${gqlBuilder.buildArgs({
322
- filters: this.searchForm.queryFilters,
323
- pagination: { page, limit },
324
- sortings: sorters
325
- })}) {
320
+ query goodsReceivalNotes($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
321
+ goodsReceivalNotes(filters: $filters, pagination: $pagination, sortings: $sortings) {
326
322
  items {
327
323
  id
328
324
  name
@@ -359,7 +355,12 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
359
355
  total
360
356
  }
361
357
  }
362
- `
358
+ `,
359
+ variables: {
360
+ filters: this.searchForm.queryFilters,
361
+ pagination: { page, limit },
362
+ sortings: sorters
363
+ }
363
364
  })
364
365
 
365
366
  if (!response.errors) {
@@ -702,17 +702,13 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
702
702
 
703
703
  _onProductChangeHandler(event) {
704
704
  const changeRecord = event.detail.after
705
+ const beforeRecord = event.detail.before
705
706
  const changedColumn = event.detail.column.name
706
707
  var totalAvailableQty = 0
707
708
  var totalAvailableUomValue = 0
708
709
 
709
- if (changeRecord.inventory.remainQty) {
710
- totalAvailableQty = changeRecord.inventory.remainQty
711
- totalAvailableUomValue = changeRecord.inventory.remainUomValue
712
- } else if (event.detail.before) {
713
- totalAvailableQty = event.detail.before.inventory.releaseQty + event.detail.before.addableQty
714
- totalAvailableUomValue = event.detail.before.inventory.releaseUomValue + event.detail.before.addableUomValue
715
- }
710
+ totalAvailableQty = beforeRecord.addableQty + beforeRecord.releaseQty
711
+ totalAvailableUomValue = beforeRecord.addableUomValue + beforeRecord.releaseUomValue
716
712
 
717
713
  try {
718
714
  if (changedColumn === 'releaseQty') {
@@ -3,7 +3,7 @@ import '@things-factory/grist-ui'
3
3
  import { i18next, localize } from '@things-factory/i18n-base'
4
4
  import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
5
5
  import { CommonButtonStyles } from '@things-factory/styles'
6
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
6
+ import { isMobileDevice } from '@things-factory/utils'
7
7
  import gql from 'graphql-tag'
8
8
  import { css, html } from 'lit-element'
9
9
  import { connect } from 'pwa-helpers/connect-mixin'
@@ -315,10 +315,8 @@ class CheckReturnOrder extends connect(store)(localize(i18next)(PageView)) {
315
315
  if (!this._returnOrderNo) return
316
316
  const response = await client.query({
317
317
  query: gql`
318
- query {
319
- returnOrderDetail(${gqlBuilder.buildArgs({
320
- name: this._returnOrderNo
321
- })}) {
318
+ query returnOrderDetail($name: String!) {
319
+ returnOrderDetail(name: $name) {
322
320
  id
323
321
  name
324
322
  truckNo
@@ -361,7 +359,10 @@ class CheckReturnOrder extends connect(store)(localize(i18next)(PageView)) {
361
359
  }
362
360
  }
363
361
  }
364
- `
362
+ `,
363
+ variables: {
364
+ name: this._returnOrderNo
365
+ }
365
366
  })
366
367
 
367
368
  if (!response.errors) {
@@ -432,16 +433,17 @@ class CheckReturnOrder extends connect(store)(localize(i18next)(PageView)) {
432
433
 
433
434
  if (!result.value) return
434
435
 
435
- const response = await client.query({
436
- query: gql`
437
- mutation {
438
- checkReturnOrder(${gqlBuilder.buildArgs({
439
- name: this._returnOrderNo
440
- })}) {
436
+ const response = await client.mutate({
437
+ mutation: gql`
438
+ mutation checkReturnOrder($name: String!) {
439
+ checkReturnOrder(name: $name) {
441
440
  name
442
441
  }
443
442
  }
444
- `
443
+ `,
444
+ variables: {
445
+ name: this._returnOrderNo
446
+ }
445
447
  })
446
448
 
447
449
  if (!response.errors) {
@@ -4,7 +4,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
4
4
  import { openPopup } from '@things-factory/layout-base'
5
5
  import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
6
6
  import { CommonButtonStyles } from '@things-factory/styles'
7
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
7
+ import { isMobileDevice } from '@things-factory/utils'
8
8
  import gql from 'graphql-tag'
9
9
  import { css, html } from 'lit-element'
10
10
  import { connect } from 'pwa-helpers/connect-mixin'
@@ -321,10 +321,8 @@ class ReceiveReturnOrderRequests extends connect(store)(localize(i18next)(PageVi
321
321
  if (!this._returnOrderNo) return
322
322
  const response = await client.query({
323
323
  query: gql`
324
- query {
325
- returnOrderDetail(${gqlBuilder.buildArgs({
326
- name: this._returnOrderNo
327
- })}) {
324
+ query returnOrderDetail($name: String!) {
325
+ returnOrderDetail(name: $name) {
328
326
  id
329
327
  name
330
328
  truckNo
@@ -367,7 +365,10 @@ class ReceiveReturnOrderRequests extends connect(store)(localize(i18next)(PageVi
367
365
  }
368
366
  }
369
367
  }
370
- `
368
+ `,
369
+ variables: {
370
+ name: this._returnOrderNo
371
+ }
371
372
  })
372
373
 
373
374
  if (!response.errors) {
@@ -437,16 +438,17 @@ class ReceiveReturnOrderRequests extends connect(store)(localize(i18next)(PageVi
437
438
 
438
439
  if (!result.value) return
439
440
 
440
- const response = await client.query({
441
- query: gql`
442
- mutation {
443
- receiveReturnOrder(${gqlBuilder.buildArgs({
444
- name: this._returnOrderNo
445
- })}) {
441
+ const response = await client.mutate({
442
+ mutation: gql`
443
+ mutation receiveReturnOrder($name: String!) {
444
+ receiveReturnOrder(name: $name) {
446
445
  name
447
446
  }
448
447
  }
449
- `
448
+ `,
449
+ variables: {
450
+ name: this._returnOrderNo
451
+ }
450
452
  })
451
453
 
452
454
  if (!response.errors) {
@@ -478,17 +480,18 @@ class ReceiveReturnOrderRequests extends connect(store)(localize(i18next)(PageVi
478
480
  return
479
481
  }
480
482
 
481
- const response = await client.query({
482
- query: gql`
483
- mutation {
484
- rejectReturnOrder(${gqlBuilder.buildArgs({
485
- name: this._returnOrderNo,
486
- patch: { remark: e.detail.value }
487
- })}) {
488
- name
483
+ const response = await client.mutate({
484
+ mutation: gql`
485
+ mutation rejectReturnOrder($name: String!, $patch: ReturnOrderPatch!) {
486
+ rejectReturnOrder(name: $name, patch: $patch) {
487
+ name
488
+ }
489
489
  }
490
+ `,
491
+ variables: {
492
+ name: this._returnOrderNo,
493
+ patch: { remark: e.detail.value }
490
494
  }
491
- `
492
495
  })
493
496
 
494
497
  if (!response.errors) {
@@ -1,23 +1,16 @@
1
1
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
2
2
  import { CommonButtonStyles } from '@things-factory/styles'
3
3
  import '@things-factory/grist-ui'
4
- import { getRenderer } from '@things-factory/grist-ui'
5
4
  import { i18next, localize } from '@things-factory/i18n-base'
6
5
  import { client, PageView, store } from '@things-factory/shell'
7
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
6
+ import { isMobileDevice } from '@things-factory/utils'
8
7
  import gql from 'graphql-tag'
9
8
  import { css, html } from 'lit-element'
10
9
  import { connect } from 'pwa-helpers/connect-mixin'
11
10
  import '../../components/attachment-viewer'
12
11
  import '../../components/popup-note'
13
12
  import '../../components/vas-templates'
14
- import {
15
- ORDER_STATUS,
16
- VAS_BATCH_AND_PRODUCT_TYPE,
17
- VAS_BATCH_NO_TYPE,
18
- VAS_ETC_TYPE,
19
- VAS_PRODUCT_TYPE
20
- } from '../../constants'
13
+ import { ORDER_STATUS } from '../../constants'
21
14
 
22
15
  class RejectedReturnOrder extends connect(store)(localize(i18next)(PageView)) {
23
16
  static get properties() {
@@ -318,10 +311,8 @@ class RejectedReturnOrder extends connect(store)(localize(i18next)(PageView)) {
318
311
  if (!this._returnOrderNo) return
319
312
  const response = await client.query({
320
313
  query: gql`
321
- query {
322
- returnOrderDetail(${gqlBuilder.buildArgs({
323
- name: this._returnOrderNo
324
- })}) {
314
+ query returnOrderDetail($name: String!) {
315
+ returnOrderDetail(name: $name) {
325
316
  id
326
317
  name
327
318
  truckNo
@@ -364,7 +355,10 @@ class RejectedReturnOrder extends connect(store)(localize(i18next)(PageView)) {
364
355
  }
365
356
  }
366
357
  }
367
- `
358
+ `,
359
+ variables: {
360
+ name: this._returnOrderNo
361
+ }
368
362
  })
369
363
 
370
364
  if (!response.errors) {
@@ -4,7 +4,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
4
4
  import { openPopup } from '@things-factory/layout-base'
5
5
  import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
6
6
  import { CommonButtonStyles } from '@things-factory/styles'
7
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
7
+ import { isMobileDevice } from '@things-factory/utils'
8
8
  import gql from 'graphql-tag'
9
9
  import { css, html } from 'lit-element'
10
10
  import { connect } from 'pwa-helpers/connect-mixin'
@@ -316,10 +316,8 @@ class ReturnOrderAssignBufferLocation extends connect(store)(localize(i18next)(P
316
316
  if (!this._returnOrderNo) return
317
317
  const response = await client.query({
318
318
  query: gql`
319
- query {
320
- returnOrderDetail(${gqlBuilder.buildArgs({
321
- name: this._returnOrderNo
322
- })}) {
319
+ query returnOrderDetail($name: String!) {
320
+ returnOrderDetail(name: $name) {
323
321
  id
324
322
  name
325
323
  truckNo
@@ -361,7 +359,10 @@ class ReturnOrderAssignBufferLocation extends connect(store)(localize(i18next)(P
361
359
  }
362
360
  }
363
361
  }
364
- `
362
+ `,
363
+ variables: {
364
+ name: this._returnOrderNo
365
+ }
365
366
  })
366
367
 
367
368
  if (!response.errors) {
@@ -433,19 +434,20 @@ class ReturnOrderAssignBufferLocation extends connect(store)(localize(i18next)(P
433
434
 
434
435
  if (!result.value) return
435
436
 
436
- const response = await client.query({
437
- query: gql`
438
- mutation {
439
- generateReturnOrderWorksheet(${gqlBuilder.buildArgs({
440
- returnOrderNo: this._returnOrderNo,
441
- bufferLocation: { id: this.bufferLocationField.getAttribute('location-id') }
442
- })}) {
437
+ const response = await client.mutate({
438
+ mutation: gql`
439
+ mutation generateReturnOrderWorksheet($returnOrderNo: String!, $bufferLocation: ObjectRef!) {
440
+ generateReturnOrderWorksheet(returnOrderNo: $returnOrderNo, bufferLocation: $bufferLocation) {
443
441
  returnOrderWorksheet {
444
442
  name
445
443
  }
446
444
  }
447
445
  }
448
- `
446
+ `,
447
+ variables: {
448
+ returnOrderNo: this._returnOrderNo,
449
+ bufferLocation: { id: this.bufferLocationField.getAttribute('location-id') }
450
+ }
449
451
  })
450
452
 
451
453
  if (!response.errors) {
@@ -3,7 +3,7 @@ import '@things-factory/grist-ui'
3
3
  import { i18next, localize } from '@things-factory/i18n-base'
4
4
  import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
5
5
  import { CommonButtonStyles } from '@things-factory/styles'
6
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
6
+ import { isMobileDevice } from '@things-factory/utils'
7
7
  import gql from 'graphql-tag'
8
8
  import { css, html } from 'lit-element'
9
9
  import { connect } from 'pwa-helpers/connect-mixin'
@@ -357,10 +357,8 @@ class ReturnOrderDetail extends connect(store)(localize(i18next)(PageView)) {
357
357
  if (!this._returnOrderNo) return
358
358
  const response = await client.query({
359
359
  query: gql`
360
- query {
361
- returnOrderDetail(${gqlBuilder.buildArgs({
362
- name: this._returnOrderNo
363
- })}) {
360
+ query returnOrderDetail($name: String!) {
361
+ returnOrderDetail(name: $name) {
364
362
  id
365
363
  name
366
364
  truckNo
@@ -403,7 +401,10 @@ class ReturnOrderDetail extends connect(store)(localize(i18next)(PageView)) {
403
401
  }
404
402
  }
405
403
  }
406
- `
404
+ `,
405
+ variables: {
406
+ name: this._returnOrderNo
407
+ }
407
408
  })
408
409
 
409
410
  if (!response.errors) {
@@ -475,14 +476,15 @@ class ReturnOrderDetail extends connect(store)(localize(i18next)(PageView)) {
475
476
  if (!result.value) return
476
477
 
477
478
  await this._executeRevertTransactions()
478
- const response = await client.query({
479
- query: gql`
480
- mutation {
481
- deleteReturnOrder(${gqlBuilder.buildArgs({
482
- name: this._returnOrderNo
483
- })})
484
- }
485
- `
479
+ const response = await client.mutate({
480
+ mutation: gql`
481
+ mutation deleteReturnOrder($name: String!) {
482
+ deleteReturnOrder(name: $name)
483
+ }
484
+ `,
485
+ variables: {
486
+ name: this._returnOrderNo
487
+ }
486
488
  })
487
489
 
488
490
  if (!response.errors) {
@@ -505,14 +507,15 @@ class ReturnOrderDetail extends connect(store)(localize(i18next)(PageView)) {
505
507
 
506
508
  if (!result.value) return
507
509
 
508
- const response = await client.query({
509
- query: gql`
510
- mutation {
511
- pendingCancellationReturnOrder(${gqlBuilder.buildArgs({
512
- name: this._returnOrderNo
513
- })})
514
- }
515
- `
510
+ const response = await client.mutate({
511
+ mutation: gql`
512
+ mutation pendingCancellationReturnOrder($name: String!) {
513
+ pendingCancellationReturnOrder(name: $name)
514
+ }
515
+ `,
516
+ variables: {
517
+ name: this._returnOrderNo
518
+ }
516
519
  })
517
520
 
518
521
  if (!response.errors) {
@@ -535,16 +538,17 @@ class ReturnOrderDetail extends connect(store)(localize(i18next)(PageView)) {
535
538
  if (!result.value) return
536
539
 
537
540
  try {
538
- const response = await client.query({
539
- query: gql`
540
- mutation {
541
- confirmReturnOrder(${gqlBuilder.buildArgs({
542
- name: this._returnOrderNo
543
- })}) {
544
- name
545
- }
541
+ const response = await client.mutate({
542
+ mutation: gql`
543
+ mutation confirmReturnOrder($name: String!) {
544
+ confirmReturnOrder(name: $name) {
545
+ name
546
546
  }
547
- `
547
+ }
548
+ `,
549
+ variables: {
550
+ name: this._returnOrderNo
551
+ }
548
552
  })
549
553
 
550
554
  if (!response.errors) {
@@ -4,7 +4,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
4
4
  import { client, navigate, PageView } from '@things-factory/shell'
5
5
  import { ScrollbarStyles } from '@things-factory/styles'
6
6
  import { getCodeByName } from '@things-factory/code-base'
7
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
7
+ import { isMobileDevice } from '@things-factory/utils'
8
8
  import gql from 'graphql-tag'
9
9
  import { css, html } from 'lit-element'
10
10
  import { ORDER_STATUS } from '../../constants'
@@ -200,12 +200,8 @@ class ReturnOrderList extends localize(i18next)(PageView) {
200
200
  async fetchHandler({ page, limit, sorters = [{ name: 'createdAt', desc: true }] }) {
201
201
  const response = await client.query({
202
202
  query: gql`
203
- query {
204
- returnOrders(${gqlBuilder.buildArgs({
205
- filters: this.searchForm.queryFilters,
206
- pagination: { page, limit },
207
- sortings: sorters
208
- })}) {
203
+ query returnOrders($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
204
+ returnOrders(filters: $filters, pagination: $pagination, sortings: $sortings) {
209
205
  items {
210
206
  id
211
207
  name
@@ -229,7 +225,12 @@ class ReturnOrderList extends localize(i18next)(PageView) {
229
225
  total
230
226
  }
231
227
  }
232
- `
228
+ `,
229
+ variables: {
230
+ filters: this.searchForm.queryFilters,
231
+ pagination: { page, limit },
232
+ sortings: sorters
233
+ }
233
234
  })
234
235
 
235
236
  if (!response.errors) {