@things-factory/operato-wms 3.7.2 → 3.7.7
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.
- package/client/pages/components/select-product-popup.js +5 -1
- package/client/pages/constants/order.js +10 -0
- package/client/pages/inbound/putaway-product.js +162 -139
- package/client/pages/inventory-check/inspecting-product.js +146 -80
- package/client/pages/manifest/create-loading-manifest.js +314 -0
- package/client/pages/manifest/dispatcher-verification-popup.js +86 -0
- package/client/pages/manifest/loading-manifest-detail.js +345 -0
- package/client/pages/manifest/loading-manifest-list.js +305 -0
- package/client/pages/order/arrival-notice/create-arrival-notice.js +8 -1
- package/client/pages/order/goods-received-note/received-note-list.js +138 -6
- package/client/pages/order/release-order/b2b/b2b-order-list.js +45 -5
- package/client/pages/order/release-order/b2b/b2b-order-requests.js +45 -5
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +181 -21
- package/client/pages/order/release-order/bulk-print-packing-list.js +23 -0
- package/client/pages/order/release-order/create-release-order.js +25 -4
- package/client/pages/order/release-order/receive-release-order-request.js +27 -24
- package/client/pages/order/release-order/release-extra-product-popup.js +189 -56
- package/client/pages/order/release-order/release-order-detail.js +292 -71
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +115 -50
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +1 -6
- package/client/pages/order/reverse-kitting-order/reverse-kitting-pallet-label-popup.js +239 -0
- package/client/pages/order/transport-order/delivery-order-list.js +99 -59
- package/client/pages/outbound/loading-product.js +4 -1
- package/client/pages/outbound/merged-outbound-worksheet.js +39 -1
- package/client/pages/outbound/packing-product.js +4 -1
- package/client/pages/outbound/packing-worksheet-list.js +39 -1
- package/client/pages/outbound/picking-product.js +622 -290
- package/client/pages/outbound/serial-number-popup.js +280 -0
- package/client/pages/outbound/worksheet-picking.js +28 -2
- package/client/pages/report/product-label-report.js +401 -0
- package/client/pages/support/inventory-comparison.js +296 -0
- package/client/pages/vas/print-product-label.js +298 -132
- package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +30 -12
- package/client/pages/vas/reverse-kitting/popup-combination-sets.js +75 -5
- package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +113 -18
- package/client/route.js +23 -0
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +64 -54
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +1 -1
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js +34 -9
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
- package/dist-server/graphql/resolvers/index.js +3 -1
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/inventory-comparison/index.js +6 -0
- package/dist-server/graphql/resolvers/inventory-comparison/index.js.map +1 -0
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js +78 -0
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/index.js +2 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/product-label-report.js +56 -0
- package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -0
- package/dist-server/graphql/types/index.js +5 -2
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/inventory-comparison/index.js +13 -0
- package/dist-server/graphql/types/inventory-comparison/index.js.map +1 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js +14 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js.map +1 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js +18 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +6 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/product-label-report-list.js +14 -0
- package/dist-server/graphql/types/reports/product-label-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/product-label-report.js +16 -0
- package/dist-server/graphql/types/reports/product-label-report.js.map +1 -0
- package/package.json +65 -65
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +75 -65
- package/server/graphql/resolvers/extra/add-release-good-products.ts +57 -15
- package/server/graphql/resolvers/index.ts +3 -1
- package/server/graphql/resolvers/inventory-comparison/index.ts +5 -0
- package/server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts +99 -0
- package/server/graphql/resolvers/reports/index.ts +3 -1
- package/server/graphql/resolvers/reports/product-label-report.ts +56 -0
- package/server/graphql/types/index.ts +5 -2
- package/server/graphql/types/inventory-comparison/index.ts +11 -0
- package/server/graphql/types/inventory-comparison/inventory-comparison-list.ts +8 -0
- package/server/graphql/types/inventory-comparison/inventory-comparison.ts +12 -0
- package/server/graphql/types/reports/index.ts +6 -1
- package/server/graphql/types/reports/product-label-report-list.ts +8 -0
- package/server/graphql/types/reports/product-label-report.ts +10 -0
- package/things-factory.config.js +24 -0
- package/translations/en.json +64 -12
- package/translations/ko.json +50 -1
- package/translations/ms.json +51 -1
- package/translations/zh.json +50 -1
|
@@ -49,7 +49,10 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
49
49
|
_mimetype: String,
|
|
50
50
|
_doPath: String,
|
|
51
51
|
_allowROAddProductSetting: Boolean,
|
|
52
|
-
|
|
52
|
+
_releaseOrder: Object,
|
|
53
|
+
_shippingOrder: Object,
|
|
54
|
+
_containerArrivalDate: Date,
|
|
55
|
+
_containerLeavingDate: Date
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
|
|
@@ -166,20 +169,40 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
166
169
|
type="checkbox"
|
|
167
170
|
name="ownTransport"
|
|
168
171
|
?checked="${this._ownTransport}"
|
|
169
|
-
?
|
|
170
|
-
|
|
172
|
+
?disabled="${this._disableTransport || !this?._editable}"
|
|
173
|
+
@change="${e => {
|
|
174
|
+
this._ownTransport = e.currentTarget.checked
|
|
175
|
+
if (this._ownTransport) {
|
|
176
|
+
this._warehouseTransportInput.checked = false
|
|
177
|
+
this._warehouseTransport = false
|
|
178
|
+
} else {
|
|
179
|
+
this._warehouseTransportInput.checked = true
|
|
180
|
+
this._warehouseTransport = true
|
|
181
|
+
}
|
|
182
|
+
this._validateTransport()
|
|
183
|
+
}}"
|
|
171
184
|
/>
|
|
172
|
-
<label
|
|
185
|
+
<label for="ownTransport">${i18next.t('label.own_transport')}</label>
|
|
173
186
|
|
|
174
187
|
<input
|
|
175
188
|
id="warehouseTransport"
|
|
176
189
|
type="checkbox"
|
|
177
190
|
name="warehouseTransport"
|
|
178
191
|
?checked="${!this._ownTransport}"
|
|
179
|
-
?
|
|
180
|
-
|
|
192
|
+
?disabled="${this._disableTransport || !this?._editable}"
|
|
193
|
+
@change="${e => {
|
|
194
|
+
this._warehouseTransport = e.currentTarget.checked
|
|
195
|
+
if (this._warehouseTransport) {
|
|
196
|
+
this._ownTransportInput.checked = false
|
|
197
|
+
this._ownTransport = false
|
|
198
|
+
} else {
|
|
199
|
+
this._ownTransportInput.checked = true
|
|
200
|
+
this._ownTransport = true
|
|
201
|
+
}
|
|
202
|
+
this._validateTransport()
|
|
203
|
+
}}"
|
|
181
204
|
/>
|
|
182
|
-
<label
|
|
205
|
+
<label for="warehouseTransport">${i18next.t('label.warehouse_transport')}</label>
|
|
183
206
|
|
|
184
207
|
<input
|
|
185
208
|
id="courierOption"
|
|
@@ -199,8 +222,17 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
199
222
|
/>
|
|
200
223
|
<label>${i18next.t('label.packing')}</label>
|
|
201
224
|
|
|
202
|
-
<input
|
|
203
|
-
|
|
225
|
+
<input
|
|
226
|
+
id="exportOption"
|
|
227
|
+
type="checkbox"
|
|
228
|
+
name="exportOption"
|
|
229
|
+
?checked="${this._exportOption}"
|
|
230
|
+
?disabled="${!this?._editable}"
|
|
231
|
+
@change="${e => {
|
|
232
|
+
this._exportOption = e.currentTarget.checked
|
|
233
|
+
}}"
|
|
234
|
+
/>
|
|
235
|
+
<label for="exportOption">${i18next.t('label.export')}</label>
|
|
204
236
|
|
|
205
237
|
${this._crossDocking
|
|
206
238
|
? html`
|
|
@@ -217,27 +249,36 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
217
249
|
</div>
|
|
218
250
|
|
|
219
251
|
<label>${i18next.t('label.company')}</label>
|
|
220
|
-
<input name="bizplaceName"
|
|
252
|
+
<input name="bizplaceName" disabled />
|
|
221
253
|
|
|
222
254
|
<label>${i18next.t('label.ref_no')}</label>
|
|
223
|
-
<input name="refNo" readonly />
|
|
255
|
+
<input name="refNo" ?readonly="${!this?._editable}" />
|
|
224
256
|
|
|
225
257
|
<label>${i18next.t('label.ref_no_2')}</label>
|
|
226
|
-
<input name="refNo2" readonly />
|
|
258
|
+
<input name="refNo2" ?readonly="${!this?._editable}" />
|
|
227
259
|
|
|
228
260
|
<label>${i18next.t('label.ref_no_3')}</label>
|
|
229
|
-
<input name="refNo3" readonly />
|
|
261
|
+
<input name="refNo3" ?readonly="${!this?._editable}" />
|
|
230
262
|
|
|
231
263
|
<label>${i18next.t('label.release_date')}</label>
|
|
232
|
-
<input name="releaseDate" type="date" readonly />
|
|
264
|
+
<input name="releaseDate" type="date" ?readonly="${!this?._editable}" required />
|
|
233
265
|
|
|
234
266
|
<label ?hidden="${!this._ownTransport}">${i18next.t('label.co_no')}</label>
|
|
235
|
-
<input name="collectionOrderNo" ?hidden="${!this._ownTransport}" readonly />
|
|
267
|
+
<input name="collectionOrderNo" ?hidden="${!this._ownTransport}" ?readonly="${!this?._editable}" />
|
|
268
|
+
|
|
269
|
+
<label ?hidden="${this.roType === 'b2b'}">${i18next.t('label.attention_to')}</label>
|
|
270
|
+
<input name="attentionTo" ?hidden="${this.roType === 'b2b'}" readonly />
|
|
271
|
+
|
|
272
|
+
<label ?hidden="${this.roType === 'b2b'}">${i18next.t('label.phone_no')}</label>
|
|
273
|
+
<input name="phone1" ?hidden="${this.roType === 'b2b'}" readonly />
|
|
274
|
+
|
|
275
|
+
<label ?hidden="${this.roType === 'b2b'}">${i18next.t('label.delivery_address')}</label>
|
|
276
|
+
<textarea name="deliveryAddress1" ?hidden="${this.roType === 'b2b'}" rows="5" readonly></textarea>
|
|
236
277
|
|
|
237
278
|
${this._crossDocking
|
|
238
279
|
? html`
|
|
239
280
|
<label for="ganNo">${i18next.t('label.arrival_notice')}</label>
|
|
240
|
-
<input
|
|
281
|
+
<input disabled name="ganNo" .value="${this._ganNo}" />
|
|
241
282
|
`
|
|
242
283
|
: ''}
|
|
243
284
|
${this._attachments?.length > 0
|
|
@@ -263,24 +304,46 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
263
304
|
<barcode-tag bcid="qrcode" .value=${this._releaseOrderNo}></barcode-tag>
|
|
264
305
|
</div>
|
|
265
306
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
307
|
+
${this._exportOption
|
|
308
|
+
? html`
|
|
309
|
+
<div class="so-form-container">
|
|
310
|
+
<form name="shippingOrder" class="multi-column-form">
|
|
311
|
+
<fieldset>
|
|
312
|
+
<legend>${i18next.t('title.export_order')}</legend>
|
|
313
|
+
<label>${i18next.t('label.container_no')}</label>
|
|
314
|
+
<input name="containerNo" ?readonly="${!this?._editable}" required />
|
|
315
|
+
|
|
316
|
+
<label>${i18next.t('label.container_arrival_date')}</label>
|
|
317
|
+
<input
|
|
318
|
+
name="containerArrivalDate"
|
|
319
|
+
type="date"
|
|
320
|
+
?readonly="${!this?._editable}"
|
|
321
|
+
.value="${this._containerArrivalDate}"
|
|
322
|
+
@change="${e => {
|
|
323
|
+
this._containerLeavingDateInput.setAttribute('min', e.currentTarget.value)
|
|
324
|
+
required
|
|
325
|
+
}}"
|
|
326
|
+
/>
|
|
327
|
+
|
|
328
|
+
<label>${i18next.t('label.container_leaving_date')}</label>
|
|
329
|
+
<input
|
|
330
|
+
name="containerLeavingDate"
|
|
331
|
+
type="date"
|
|
332
|
+
?readonly="${!this?._editable}"
|
|
333
|
+
.value="${this._containerLeavingDate}"
|
|
334
|
+
@change="${e => {
|
|
335
|
+
this._containerArrivalDateInput.setAttribute('max', e.currentTarget.value)
|
|
336
|
+
required
|
|
337
|
+
}}"
|
|
338
|
+
/>
|
|
339
|
+
|
|
340
|
+
<label>${i18next.t('label.ship_name')}</label>
|
|
341
|
+
<input name="shipName" ?readonly="${!this?._editable}" required />
|
|
342
|
+
</fieldset>
|
|
343
|
+
</form>
|
|
344
|
+
</div>
|
|
345
|
+
`
|
|
346
|
+
: ''}
|
|
284
347
|
|
|
285
348
|
<div class="container">
|
|
286
349
|
<div class="grist">
|
|
@@ -309,6 +372,9 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
309
372
|
constructor() {
|
|
310
373
|
super()
|
|
311
374
|
this._clearPage()
|
|
375
|
+
this._editable = false
|
|
376
|
+
this._disableTransport = false
|
|
377
|
+
this._shippingOrder = null
|
|
312
378
|
}
|
|
313
379
|
|
|
314
380
|
get context() {
|
|
@@ -328,6 +394,13 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
328
394
|
...CommonButtonStyles.back
|
|
329
395
|
}
|
|
330
396
|
]
|
|
397
|
+
if (this._editable) {
|
|
398
|
+
actions.push({
|
|
399
|
+
title: i18next.t('button.update_order_details'),
|
|
400
|
+
action: this._updateReleaseGoodDetails.bind(this),
|
|
401
|
+
...CommonButtonStyles.add
|
|
402
|
+
})
|
|
403
|
+
}
|
|
331
404
|
|
|
332
405
|
if (this._status === ORDER_STATUS.PENDING.value) {
|
|
333
406
|
actions.push(
|
|
@@ -386,6 +459,18 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
386
459
|
return this.shadowRoot.querySelector('input[name=ownTransport]')
|
|
387
460
|
}
|
|
388
461
|
|
|
462
|
+
get _warehouseTransportInput() {
|
|
463
|
+
return this.shadowRoot.querySelector('input[name=warehouseTransport]')
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
get _containerArrivalDateInput() {
|
|
467
|
+
return this.shadowRoot.querySelector('input[name=containerArrivalDate]')
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
get _containerLeavingDateInput() {
|
|
471
|
+
return this.shadowRoot.querySelector('input[name=containerLeavingDate]')
|
|
472
|
+
}
|
|
473
|
+
|
|
389
474
|
get inventoryGrist() {
|
|
390
475
|
return this.shadowRoot.querySelector('data-grist#inventory-grist')
|
|
391
476
|
}
|
|
@@ -409,7 +494,11 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
409
494
|
|
|
410
495
|
async pageInitialized() {
|
|
411
496
|
let [allowROAddProductSetting, userRoles] = [fetchSettingRule('allow-ro-add-product'), this.fetchUserRoleHandler()]
|
|
497
|
+
let [enableTransportationServiceSetting] = await Promise.all([fetchSettingRule('enable-transportation-service')])
|
|
498
|
+
|
|
499
|
+
this._enableTransportationServiceSetting = enableTransportationServiceSetting
|
|
412
500
|
|
|
501
|
+
this._validateTransport()
|
|
413
502
|
this._clearPage()
|
|
414
503
|
|
|
415
504
|
this.inventoryGristConfig = {
|
|
@@ -454,14 +543,12 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
454
543
|
type: 'integer',
|
|
455
544
|
name: 'releaseQty',
|
|
456
545
|
header: i18next.t('field.release_qty'),
|
|
457
|
-
record: { options: { min: 0 } },
|
|
458
546
|
width: 130
|
|
459
547
|
},
|
|
460
548
|
{
|
|
461
549
|
type: 'string',
|
|
462
550
|
name: 'releaseUomValueWithUom',
|
|
463
551
|
header: i18next.t('field.release_uom_value'),
|
|
464
|
-
record: { options: { min: 0 } },
|
|
465
552
|
width: 150
|
|
466
553
|
},
|
|
467
554
|
{
|
|
@@ -595,6 +682,9 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
595
682
|
name
|
|
596
683
|
truckNo
|
|
597
684
|
type
|
|
685
|
+
attentionTo
|
|
686
|
+
phone1
|
|
687
|
+
deliveryAddress1
|
|
598
688
|
bizplace {
|
|
599
689
|
id
|
|
600
690
|
name
|
|
@@ -641,6 +731,8 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
641
731
|
packingType
|
|
642
732
|
packingSize
|
|
643
733
|
qty
|
|
734
|
+
lockedQty
|
|
735
|
+
lockedUomValue
|
|
644
736
|
uomValue
|
|
645
737
|
releaseQty
|
|
646
738
|
releaseUomValue
|
|
@@ -652,6 +744,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
652
744
|
status
|
|
653
745
|
}
|
|
654
746
|
shippingOrderInfo {
|
|
747
|
+
id
|
|
655
748
|
containerNo
|
|
656
749
|
containerLeavingDate
|
|
657
750
|
containerArrivalDate
|
|
@@ -689,6 +782,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
689
782
|
if (!response.errors) {
|
|
690
783
|
const releaseOrder = response.data.releaseGoodDetail
|
|
691
784
|
const shippingOrder = releaseOrder.shippingOrderInfo
|
|
785
|
+
|
|
692
786
|
this.roType = releaseOrder.type
|
|
693
787
|
const orderInventories = releaseOrder.inventoryInfos.map(inventoryInfo => {
|
|
694
788
|
let roundedUomValue =
|
|
@@ -711,46 +805,63 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
711
805
|
releaseUomValue: inventoryInfo.releaseUomValue,
|
|
712
806
|
releaseUomValueWithUom: inventoryInfo.releaseUomValue + ' ' + inventoryInfo.uom
|
|
713
807
|
},
|
|
714
|
-
qty: inventoryInfo.qty
|
|
715
|
-
remainQty: inventoryInfo.qty,
|
|
716
|
-
uomValue: inventoryInfo.uomValue
|
|
808
|
+
qty: inventoryInfo.qty,
|
|
809
|
+
remainQty: inventoryInfo.qty - inventoryInfo.lockedQty,
|
|
810
|
+
uomValue: inventoryInfo.uomValue, //total
|
|
717
811
|
releaseUomValue: inventoryInfo.releaseUomValue,
|
|
718
|
-
remainUomValue: inventoryInfo.uomValue,
|
|
719
|
-
availableUomValueWithUom: `${inventoryInfo.uomValue
|
|
812
|
+
remainUomValue: inventoryInfo.uomValue - inventoryInfo.lockedUomValue,
|
|
813
|
+
availableUomValueWithUom: `${inventoryInfo.uomValue /*+ inventoryInfo.releaseUomValue*/} ${
|
|
814
|
+
inventoryInfo.uom
|
|
815
|
+
}`, //total
|
|
720
816
|
releaseUomValueWithUom: inventoryInfo.releaseUomValue + ' ' + inventoryInfo.uom,
|
|
721
|
-
remainUomValueWithUom: `${inventoryInfo.uomValue} ${inventoryInfo.uom}`,
|
|
817
|
+
remainUomValueWithUom: `${inventoryInfo.uomValue - inventoryInfo.releaseUomValue} ${inventoryInfo.uom}`,
|
|
722
818
|
status: inventoryInfo.status,
|
|
723
819
|
existing: true,
|
|
724
|
-
roundedUomValue: `${roundedUomValue} ${inventoryInfo.uom}
|
|
820
|
+
roundedUomValue: `${roundedUomValue} ${inventoryInfo.uom}`,
|
|
821
|
+
addableQty: inventoryInfo.qty - inventoryInfo.lockedQty,
|
|
822
|
+
addableUomValue: inventoryInfo.uomValue - inventoryInfo.lockedUomValue
|
|
725
823
|
}
|
|
726
824
|
})
|
|
727
825
|
|
|
728
826
|
const orderVass = releaseOrder.orderVass
|
|
729
827
|
|
|
828
|
+
this._releaseOrderId = releaseOrder.id
|
|
730
829
|
this.partnerBizplaceId = releaseOrder.bizplace.id
|
|
731
|
-
this._exportOption =
|
|
732
|
-
this._bizplaceName = response.data.releaseGoodDetail.bizplace.name
|
|
830
|
+
this._exportOption = releaseOrder.exportOption
|
|
733
831
|
if (this._exportOption) {
|
|
734
832
|
this._ownTransport = true
|
|
735
833
|
} else if (!this._exportOption) {
|
|
736
|
-
this._ownTransport =
|
|
834
|
+
this._ownTransport = releaseOrder.ownTransport
|
|
737
835
|
}
|
|
738
836
|
|
|
739
|
-
this._courierOption =
|
|
740
|
-
this._packingOption =
|
|
741
|
-
this._crossDocking =
|
|
742
|
-
|
|
837
|
+
this._courierOption = releaseOrder.courierOption
|
|
838
|
+
this._packingOption = releaseOrder.packingOption
|
|
839
|
+
this._crossDocking = releaseOrder?.crossDocking
|
|
840
|
+
|
|
841
|
+
await this.updateComplete
|
|
743
842
|
|
|
843
|
+
this._ganNo = releaseOrder?.arrivalNotice?.name
|
|
744
844
|
this._status = releaseOrder.status
|
|
745
845
|
|
|
746
|
-
this._fillupRGForm(
|
|
846
|
+
this._fillupRGForm({
|
|
847
|
+
...releaseOrder,
|
|
848
|
+
bizplaceName: releaseOrder.bizplace?.name
|
|
849
|
+
})
|
|
850
|
+
|
|
851
|
+
if (shippingOrder) {
|
|
852
|
+
this._shippingOrder = shippingOrder
|
|
853
|
+
this._fillupSOForm(shippingOrder)
|
|
854
|
+
}
|
|
747
855
|
|
|
748
856
|
if (releaseOrder && releaseOrder?.attachment) {
|
|
749
857
|
this._attachments = releaseOrder && releaseOrder.attachment
|
|
750
858
|
}
|
|
751
859
|
|
|
752
|
-
if (
|
|
753
|
-
|
|
860
|
+
if (releaseOrder.status !== 'DONE') {
|
|
861
|
+
this._editable = true
|
|
862
|
+
} else {
|
|
863
|
+
this._editable = false
|
|
864
|
+
}
|
|
754
865
|
this.inventoryData = { records: orderInventories }
|
|
755
866
|
this.vasData = {
|
|
756
867
|
records: orderVass
|
|
@@ -778,35 +889,37 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
778
889
|
}
|
|
779
890
|
|
|
780
891
|
_fillupForm(form, data) {
|
|
781
|
-
form
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
field.
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
if (
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
892
|
+
if (form) {
|
|
893
|
+
form.reset()
|
|
894
|
+
for (let key in data) {
|
|
895
|
+
Array.from(form.querySelectorAll('input, textarea')).forEach(field => {
|
|
896
|
+
if (field.name === key && field.type === 'checkbox') {
|
|
897
|
+
field.checked = data[key]
|
|
898
|
+
} else if (field.name === key && field.type === 'datetime-local') {
|
|
899
|
+
const datetime = Number(data[key])
|
|
900
|
+
const timezoneOffset = new Date(datetime).getTimezoneOffset() * 60000
|
|
901
|
+
field.value = new Date(datetime - timezoneOffset).toISOString().slice(0, -1)
|
|
902
|
+
} else if (field.name === key) {
|
|
903
|
+
if (data[key] instanceof Object) {
|
|
904
|
+
const objectData = data[key]
|
|
905
|
+
field.value = `${objectData.name} ${objectData.description ? `(${objectData.description})` : ''}`
|
|
906
|
+
} else {
|
|
907
|
+
field.value = data[key]
|
|
908
|
+
}
|
|
796
909
|
}
|
|
797
|
-
}
|
|
798
|
-
}
|
|
910
|
+
})
|
|
911
|
+
}
|
|
799
912
|
}
|
|
800
913
|
}
|
|
801
914
|
|
|
802
915
|
_clearPage() {
|
|
803
916
|
this._status = null
|
|
917
|
+
this.roType = 'b2b'
|
|
804
918
|
this._exportOption = false
|
|
805
919
|
this._courierOption = false
|
|
806
920
|
this._packingOption = false
|
|
807
921
|
this._ownTransport = true
|
|
808
922
|
this._downloadable = true
|
|
809
|
-
this._bizplaceName = ''
|
|
810
923
|
this._attachments = []
|
|
811
924
|
this.inventoryData = { records: [] }
|
|
812
925
|
this.vasData = { records: [] }
|
|
@@ -1005,6 +1118,114 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1005
1118
|
|
|
1006
1119
|
return []
|
|
1007
1120
|
}
|
|
1121
|
+
|
|
1122
|
+
async _updateReleaseGoodDetails() {
|
|
1123
|
+
try {
|
|
1124
|
+
this._validateTransport()
|
|
1125
|
+
this._validateForm()
|
|
1126
|
+
|
|
1127
|
+
const result = await CustomAlert({
|
|
1128
|
+
title: i18next.t('title.are_you_sure'),
|
|
1129
|
+
text: i18next.t('text.update_release_order_details'),
|
|
1130
|
+
confirmButton: { text: i18next.t('button.submit') },
|
|
1131
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
1132
|
+
})
|
|
1133
|
+
|
|
1134
|
+
if (!result.value) return
|
|
1135
|
+
|
|
1136
|
+
let releaseOrder = this._getFormInfo()
|
|
1137
|
+
delete releaseOrder.warehouseTransport
|
|
1138
|
+
delete releaseOrder.bizplaceId
|
|
1139
|
+
delete releaseOrder.bizplaceName
|
|
1140
|
+
delete releaseOrder.status
|
|
1141
|
+
delete releaseOrder.ganNo
|
|
1142
|
+
|
|
1143
|
+
let shippingOrder = this._exportOption ? this._serializeForm(this.shippingOrderForm) : null
|
|
1144
|
+
|
|
1145
|
+
const response = await client.mutate({
|
|
1146
|
+
mutation: gql`
|
|
1147
|
+
mutation updateReleaseGoodDetails($releaseOrder: ReleaseGoodPatch!, $shippingOrder: ShippingOrderPatch) {
|
|
1148
|
+
updateReleaseGoodDetails(releaseGood: $releaseOrder, shippingOrder: $shippingOrder) {
|
|
1149
|
+
id
|
|
1150
|
+
name
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
`,
|
|
1154
|
+
variables: {
|
|
1155
|
+
releaseOrder: {
|
|
1156
|
+
...releaseOrder,
|
|
1157
|
+
id: this._releaseOrderId,
|
|
1158
|
+
name: this._releaseOrderNo,
|
|
1159
|
+
ownTransport: this._importCargo ? true : this._ownTransport
|
|
1160
|
+
},
|
|
1161
|
+
shippingOrder
|
|
1162
|
+
}
|
|
1163
|
+
})
|
|
1164
|
+
|
|
1165
|
+
if (!response.errors) {
|
|
1166
|
+
this._showToast({ message: i18next.t('text.release_order_details_updated') })
|
|
1167
|
+
await this._fetchReleaseOrder()
|
|
1168
|
+
}
|
|
1169
|
+
} catch (e) {
|
|
1170
|
+
this._showToast(e)
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
_getFormInfo() {
|
|
1175
|
+
const formData = this._serializeForm(this.releaseOrderForm)
|
|
1176
|
+
delete formData.importedOrder
|
|
1177
|
+
return formData
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
_serializeForm(form) {
|
|
1181
|
+
let obj = {}
|
|
1182
|
+
Array.from(form.querySelectorAll('input, select')).forEach(field => {
|
|
1183
|
+
if (!field.hasAttribute('hidden') && field.value) {
|
|
1184
|
+
obj[field.name] = field.type === 'checkbox' ? field.checked : field.value
|
|
1185
|
+
}
|
|
1186
|
+
})
|
|
1187
|
+
|
|
1188
|
+
return obj
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
_validateTransport() {
|
|
1192
|
+
//Check if warehouse provide transport
|
|
1193
|
+
if (this._enableTransportationServiceSetting != undefined && !this._enableTransportationServiceSetting) {
|
|
1194
|
+
this._disableTransport = true
|
|
1195
|
+
this._ownTransportInput.checked = true
|
|
1196
|
+
this._ownTransport = true
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
_validateForm() {
|
|
1201
|
+
if (!this.releaseOrderForm.checkValidity()) {
|
|
1202
|
+
throw new Error(i18next.t('text.release_order_form_invalid'))
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
// - condition: export is ticked
|
|
1206
|
+
if (this.shippingOrderForm) {
|
|
1207
|
+
if (!this.shippingOrderForm.checkValidity()) {
|
|
1208
|
+
throw new Error(i18next.t('text.shipping_order_form_invalid'))
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
validateDate(e) {
|
|
1214
|
+
let inputDate = e.currentTarget.value
|
|
1215
|
+
let todayDate = this._getStdDate()
|
|
1216
|
+
if (inputDate < todayDate) {
|
|
1217
|
+
this._showToast({
|
|
1218
|
+
message: 'Invalid date'
|
|
1219
|
+
})
|
|
1220
|
+
}
|
|
1221
|
+
return inputDate
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
_getStdDate() {
|
|
1225
|
+
let date = new Date()
|
|
1226
|
+
date.setDate(date.getDate())
|
|
1227
|
+
return date.toISOString().split('T')[0]
|
|
1228
|
+
}
|
|
1008
1229
|
}
|
|
1009
1230
|
|
|
1010
1231
|
window.customElements.define('release-order-detail', ReleaseOrderDetail)
|