@things-factory/operato-wms 4.3.38 → 4.3.41
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/bulk-operation/bulk-operation.js +13 -2
- package/client/pages/bulk-operation/validate-ro-popup.js +40 -0
- package/client/pages/inventory/onhand-inventory.js +1 -18
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +2 -2
- package/client/pages/order/arrival-notice/create-arrival-notice.js +2 -2
- package/client/pages/order/goods-received-note/received-note-detail.js +187 -15
- package/client/pages/order/release-order/create-release-order.js +500 -6
- package/client/pages/order/release-order/release-order-detail.js +760 -169
- package/client/pages/order/transport-order/delivery-note-popup.js +970 -126
- package/client/pages/order/transport-order/print-delivery-note.js +162 -2
- package/client/pages/outbound/loading-product.js +87 -77
- package/client/pages/outbound/merged-outbound-worksheet.js +2 -2
- package/client/pages/outbound/picking-product.js +11 -7
- package/client/pages/outbound/route-label-popup.js +283 -191
- package/client/pages/outbound/sorting-product.js +7 -7
- package/client/pages/report/inbound-serial-number-report.js +86 -9
- package/client/pages/report/inventory-report.js +10 -0
- package/client/pages/report/outbound-serial-number-report.js +87 -9
- package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +10 -5
- package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +1 -1
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +11 -5
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +33 -4
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +33 -8
- package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -1
- package/dist-server/utils/report-query-util.js +3 -2
- package/dist-server/utils/report-query-util.js.map +1 -1
- package/helps/release-note.ko.md +10 -12
- package/helps/release-note.md +10 -12
- package/helps/release-note.ms.md +10 -12
- package/helps/release-note.zh.md +10 -12
- package/package.json +21 -20
- package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +10 -8
- package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +10 -7
- package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +34 -4
- package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +34 -8
- package/server/utils/report-query-util.ts +3 -2
- package/translations/en.json +31 -0
- package/translations/ko.json +10 -1
- package/translations/ms.json +11 -1
- package/translations/zh.json +10 -1
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import '@things-factory/biz-ui'
|
|
1
2
|
import '@things-factory/grist-ui'
|
|
2
3
|
import '../../components/attachment-viewer'
|
|
3
4
|
import '../../components/vas-templates'
|
|
4
5
|
import './release-extra-product-popup'
|
|
5
6
|
import '../../components/popup-note'
|
|
7
|
+
import '@things-factory/component-ui'
|
|
8
|
+
|
|
9
|
+
import '@things-factory/import-ui'
|
|
6
10
|
|
|
7
11
|
import gql from 'graphql-tag'
|
|
8
12
|
import { css, html } from 'lit-element'
|
|
@@ -56,7 +60,38 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
56
60
|
_containerLeavingDate: Date,
|
|
57
61
|
_vasExpanded: Boolean,
|
|
58
62
|
_beforeRemark: String,
|
|
59
|
-
isUserBelongsDomain: Boolean
|
|
63
|
+
isUserBelongsDomain: Boolean,
|
|
64
|
+
/* Shipping Form Field */
|
|
65
|
+
_contactPointId: String,
|
|
66
|
+
_contactPointName: String,
|
|
67
|
+
_companyName: String,
|
|
68
|
+
_attentionTo: String,
|
|
69
|
+
_deliveryCountry: String,
|
|
70
|
+
_deliveryPostCode: Array,
|
|
71
|
+
_deliveryState: String,
|
|
72
|
+
_deliveryCity: String,
|
|
73
|
+
_deliveryContact: String,
|
|
74
|
+
_deliveryFullAddress: String,
|
|
75
|
+
_selectedPostCode: String,
|
|
76
|
+
_selectedDeliveryCountry: String,
|
|
77
|
+
_selectedBillingCountry: String,
|
|
78
|
+
_billingCountry: String,
|
|
79
|
+
_billingPostCode: Array,
|
|
80
|
+
_billingState: String,
|
|
81
|
+
_billingCity: String,
|
|
82
|
+
_billingContact: String,
|
|
83
|
+
_billingFullAddress: String,
|
|
84
|
+
_selectedBillingPostCode: String,
|
|
85
|
+
_switchDeliveryCountryInput: Boolean,
|
|
86
|
+
_switchBillingCountryInput: Boolean,
|
|
87
|
+
_deliveryAllCountry: Array,
|
|
88
|
+
_billingAllCountry: Array,
|
|
89
|
+
|
|
90
|
+
/* Tab Toggle*/
|
|
91
|
+
_showReleasedOrderInfo: Boolean,
|
|
92
|
+
_showShippingInfo: Boolean,
|
|
93
|
+
_disableBillingAddress: Boolean,
|
|
94
|
+
currentTab: Object
|
|
60
95
|
}
|
|
61
96
|
}
|
|
62
97
|
|
|
@@ -127,6 +162,10 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
127
162
|
h2.vas-title {
|
|
128
163
|
padding-bottom: 0px;
|
|
129
164
|
}
|
|
165
|
+
[title] {
|
|
166
|
+
margin-top: -5px;
|
|
167
|
+
margin-bottom: -5px;
|
|
168
|
+
}
|
|
130
169
|
|
|
131
170
|
[options-wrap] *,
|
|
132
171
|
[attachment-wrap] a * {
|
|
@@ -174,177 +213,377 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
174
213
|
}
|
|
175
214
|
|
|
176
215
|
render() {
|
|
216
|
+
const RELEASE_ORDER_TABS = {
|
|
217
|
+
RELEASE_ORDER_INFO: i18next.t('label.order'),
|
|
218
|
+
SHIPPING_INFO: i18next.t('label.shipment')
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const orderSet = {
|
|
222
|
+
[RELEASE_ORDER_TABS.RELEASE_ORDER_INFO]: {},
|
|
223
|
+
[RELEASE_ORDER_TABS.SHIPPING_INFO]: {}
|
|
224
|
+
}
|
|
225
|
+
|
|
177
226
|
return html`
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
this.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
227
|
+
<div>
|
|
228
|
+
<quick-find-content
|
|
229
|
+
id="order-items-list"
|
|
230
|
+
.data="${orderSet}"
|
|
231
|
+
.currentTabkey="${this.currentTab.selected}"
|
|
232
|
+
@tabChanged="${e => {
|
|
233
|
+
this.currentTab = e.detail.currentTabKey
|
|
234
|
+
this._tabChange(e.detail.currentTabKey)
|
|
235
|
+
}}"
|
|
236
|
+
></quick-find-content>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<div ?hidden="${this._showReleasedOrderInfo}">
|
|
240
|
+
<div class="form-container">
|
|
241
|
+
|
|
242
|
+
<form name="releaseOrder" class="multi-column-form">
|
|
243
|
+
<fieldset>
|
|
244
|
+
<legend>${i18next.t('title.release_order_no')}: ${this._releaseOrderNo}</legend>
|
|
245
|
+
|
|
246
|
+
<label>${i18next.t('label.options')}</label>
|
|
247
|
+
<div options-wrap>
|
|
248
|
+
<input
|
|
249
|
+
id="ownTransport"
|
|
250
|
+
type="checkbox"
|
|
251
|
+
name="ownTransport"
|
|
252
|
+
?checked="${this._ownTransport}"
|
|
253
|
+
?disabled="${this._disableTransport || !this?._editable}"
|
|
254
|
+
@change="${e => {
|
|
255
|
+
this._ownTransport = e.currentTarget.checked
|
|
256
|
+
if (this._ownTransport) {
|
|
257
|
+
this._warehouseTransportInput.checked = false
|
|
258
|
+
this._warehouseTransport = false
|
|
259
|
+
} else {
|
|
260
|
+
this._warehouseTransportInput.checked = true
|
|
261
|
+
this._warehouseTransport = true
|
|
262
|
+
this._exportInput.checked = false
|
|
263
|
+
this._exportOption = false
|
|
264
|
+
}
|
|
265
|
+
this._validateTransport()
|
|
266
|
+
}}"
|
|
267
|
+
/>
|
|
268
|
+
<label for="ownTransport">${i18next.t('label.own_transport')}</label>
|
|
269
|
+
|
|
270
|
+
<input
|
|
271
|
+
id="warehouseTransport"
|
|
272
|
+
type="checkbox"
|
|
273
|
+
name="warehouseTransport"
|
|
274
|
+
?checked="${!this._ownTransport}"
|
|
275
|
+
?disabled="${this._disableTransport || !this?._editable}"
|
|
276
|
+
@change="${e => {
|
|
277
|
+
this._warehouseTransport = e.currentTarget.checked
|
|
278
|
+
if (this._warehouseTransport) {
|
|
279
|
+
this._ownTransportInput.checked = false
|
|
280
|
+
this._ownTransport = false
|
|
281
|
+
this._exportInput.checked = false
|
|
282
|
+
this._exportOption = false
|
|
283
|
+
} else {
|
|
284
|
+
this._ownTransportInput.checked = true
|
|
285
|
+
this._ownTransport = true
|
|
286
|
+
}
|
|
287
|
+
this._validateTransport()
|
|
288
|
+
}}"
|
|
289
|
+
/>
|
|
290
|
+
<label for="warehouseTransport">${i18next.t('label.warehouse_transport')}</label>
|
|
291
|
+
|
|
292
|
+
<input
|
|
293
|
+
id="courierOption"
|
|
294
|
+
type="checkbox"
|
|
295
|
+
name="courierOption"
|
|
296
|
+
?checked="${this._courierOption}"
|
|
297
|
+
disabled
|
|
298
|
+
/>
|
|
299
|
+
<label>${i18next.t('label.courier')}</label>
|
|
300
|
+
|
|
301
|
+
<input
|
|
302
|
+
id="packingOption"
|
|
303
|
+
type="checkbox"
|
|
304
|
+
name="packingOption"
|
|
305
|
+
?checked="${this._packingOption}"
|
|
306
|
+
disabled
|
|
307
|
+
/>
|
|
308
|
+
<label>${i18next.t('label.packing')}</label>
|
|
309
|
+
|
|
310
|
+
<input
|
|
311
|
+
id="exportOption"
|
|
312
|
+
type="checkbox"
|
|
313
|
+
name="exportOption"
|
|
314
|
+
?checked="${this._exportOption}"
|
|
315
|
+
?disabled="${!this?._editable}"
|
|
316
|
+
@change="${e => {
|
|
317
|
+
this._exportOption = e.currentTarget.checked
|
|
318
|
+
if (this._exportOption == true) {
|
|
319
|
+
this._warehouseTransportInput.checked = false
|
|
320
|
+
this._warehouseTransport = false
|
|
321
|
+
this._ownTransportInput.checked = true
|
|
322
|
+
this._ownTransport = true
|
|
323
|
+
}
|
|
324
|
+
if (this._warehouseTransport) {
|
|
325
|
+
this._exportInput.checked = false
|
|
326
|
+
this._exportOption = false
|
|
327
|
+
}
|
|
328
|
+
}}"
|
|
329
|
+
/>
|
|
330
|
+
<label for="exportOption">${i18next.t('label.export')}</label>
|
|
331
|
+
|
|
332
|
+
${
|
|
333
|
+
this._crossDocking
|
|
334
|
+
? html`
|
|
335
|
+
<input
|
|
336
|
+
id="crossDocking"
|
|
337
|
+
type="checkbox"
|
|
338
|
+
name="crossDocking"
|
|
339
|
+
?checked="${this._crossDocking}"
|
|
340
|
+
disabled
|
|
341
|
+
/>
|
|
342
|
+
<label for="crossDocking">${i18next.t('label.cross_docking')}</label>
|
|
343
|
+
`
|
|
344
|
+
: ''
|
|
345
|
+
}
|
|
346
|
+
</div>
|
|
347
|
+
|
|
348
|
+
<label>${i18next.t('label.company')}</label>
|
|
349
|
+
<input name="bizplaceName" disabled />
|
|
350
|
+
|
|
351
|
+
<label>${i18next.t('label.ref_no')}</label>
|
|
352
|
+
<input name="refNo" ?readonly="${!this?._editable}" />
|
|
353
|
+
|
|
354
|
+
<label>${i18next.t('label.ref_no_2')}</label>
|
|
355
|
+
<input name="refNo2" ?readonly="${!this?._editable}" />
|
|
356
|
+
|
|
357
|
+
<label>${i18next.t('label.ref_no_3')}</label>
|
|
358
|
+
<input name="refNo3" ?readonly="${!this?._editable}" />
|
|
359
|
+
|
|
360
|
+
<label>${i18next.t('label.release_date')}</label>
|
|
361
|
+
<input name="releaseDate" type="date" ?readonly="${!this?._editable}" min="${this._getStdDate()}" />
|
|
362
|
+
|
|
363
|
+
<label ?hidden="${!this._ownTransport}">${i18next.t('label.co_no')}</label>
|
|
364
|
+
<input name="collectionOrderNo" ?hidden="${!this._ownTransport}" ?readonly="${!this?._editable}" />
|
|
365
|
+
|
|
366
|
+
<label ?hidden="${this.roType === 'b2b'}">${i18next.t('label.attention_to')}</label>
|
|
367
|
+
<input name="attentionTo" ?hidden="${this.roType === 'b2b'}" readonly />
|
|
368
|
+
|
|
369
|
+
<label ?hidden="${this.roType === 'b2b'}">${i18next.t('label.phone_no')}</label>
|
|
370
|
+
<input name="phone1" ?hidden="${this.roType === 'b2b'}" readonly />
|
|
371
|
+
|
|
372
|
+
<label ?hidden="${this.roType === 'b2b'}">${i18next.t('label.delivery_address')}</label>
|
|
373
|
+
<textarea name="deliveryAddress1" ?hidden="${this.roType === 'b2b'}" rows="5" readonly></textarea>
|
|
374
|
+
|
|
375
|
+
<label ?hidden="${this.roType === 'b2b'}">${i18next.t('label.order_remark')}</label>
|
|
376
|
+
<textarea name="remark" ?hidden="${this.roType === 'b2b'}" rows="5" ?readonly="${!this
|
|
377
|
+
?._editable}"></textarea>
|
|
268
378
|
|
|
269
379
|
${
|
|
270
380
|
this._crossDocking
|
|
271
381
|
? html`
|
|
272
|
-
<
|
|
273
|
-
|
|
274
|
-
type="checkbox"
|
|
275
|
-
name="crossDocking"
|
|
276
|
-
?checked="${this._crossDocking}"
|
|
277
|
-
disabled
|
|
278
|
-
/>
|
|
279
|
-
<label for="crossDocking">${i18next.t('label.cross_docking')}</label>
|
|
382
|
+
<label for="ganNo">${i18next.t('label.arrival_notice')}</label>
|
|
383
|
+
<input disabled name="ganNo" .value="${this._ganNo}" />
|
|
280
384
|
`
|
|
281
385
|
: ''
|
|
282
386
|
}
|
|
283
|
-
|
|
387
|
+
${
|
|
388
|
+
this._attachments?.length > 0
|
|
389
|
+
? html`
|
|
390
|
+
<label>${i18next.t('label.attachment')}</label>
|
|
391
|
+
<ul attachment-wrap>
|
|
392
|
+
${(this._attachments || []).map(
|
|
393
|
+
attachment =>
|
|
394
|
+
html`
|
|
395
|
+
<li>
|
|
396
|
+
<a href="${location.origin}/attachment/${attachment.path}" download
|
|
397
|
+
><mwc-icon>attach_file</mwc-icon> ${attachment.name}</a
|
|
398
|
+
>
|
|
399
|
+
</li>
|
|
400
|
+
`
|
|
401
|
+
)}
|
|
402
|
+
</ul>
|
|
403
|
+
`
|
|
404
|
+
: ''
|
|
405
|
+
}
|
|
406
|
+
</fieldset>
|
|
407
|
+
</form>
|
|
284
408
|
|
|
285
|
-
|
|
286
|
-
|
|
409
|
+
<barcode-tag bcid="qrcode" .value=${this._releaseOrderNo}></barcode-tag>
|
|
410
|
+
</div>
|
|
411
|
+
</div>
|
|
287
412
|
|
|
288
|
-
|
|
289
|
-
|
|
413
|
+
<div ?hidden="${this._showShippingInfo}">
|
|
414
|
+
<form name="deliveryOrderInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
|
|
415
|
+
<fieldset>
|
|
416
|
+
|
|
417
|
+
<legend>${i18next.t('title.shipping_information')}</legend>
|
|
418
|
+
|
|
419
|
+
<label>${i18next.t('label.search')}</label>
|
|
420
|
+
<input type="hidden" name="contactPointId" value="${this._contactPointId}" />
|
|
421
|
+
<input
|
|
422
|
+
type="text"
|
|
423
|
+
name="contactPointName"
|
|
424
|
+
value="${this._contactPointName}"
|
|
425
|
+
@click="${this._openContactPointSelector.bind(this)}"
|
|
426
|
+
/>
|
|
427
|
+
</fieldset>
|
|
428
|
+
</form>
|
|
429
|
+
|
|
430
|
+
<form name="contactPointInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
|
|
431
|
+
<label>${i18next.t('label.company')}</label>
|
|
432
|
+
<input name="companyName" .value="${this._companyName}" />
|
|
433
|
+
|
|
434
|
+
<label>${i18next.t('label.attention_to')}</label>
|
|
435
|
+
<input name="attentionTo" .value="${this._attentionTo}" />
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
</fieldset>
|
|
439
|
+
</form>
|
|
440
|
+
|
|
441
|
+
<form class="multi-column-form" title ?hidden="${this._showShippingInfo}">
|
|
442
|
+
<label>${i18next.t('label.delivery_address')}</label>
|
|
443
|
+
</form>
|
|
444
|
+
|
|
445
|
+
<form name="deliveryAddressInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
|
|
446
|
+
<!-- delivery -->
|
|
447
|
+
<fieldset>
|
|
448
|
+
<label>${i18next.t('label.country')}</label>
|
|
449
|
+
<select
|
|
450
|
+
name="deliveryCountry"
|
|
451
|
+
@change=${e => {
|
|
452
|
+
this._validateCountry(e)
|
|
453
|
+
}}
|
|
454
|
+
>
|
|
455
|
+
<!-- <option value=${this._selectedDeliveryCountry ? this._selectedDeliveryCountry : ''} selected>
|
|
456
|
+
${this._selectedDeliveryCountry ? this._selectedDeliveryCountry : ''}
|
|
457
|
+
</option> -->
|
|
458
|
+
${this._deliveryAllCountry?.map(
|
|
459
|
+
(country, key) => html`<option value=${country.name}>${country.name}</option>`
|
|
460
|
+
)}
|
|
461
|
+
</select>
|
|
462
|
+
|
|
463
|
+
<label>${i18next.t('label.zip_postal_code')}</label>
|
|
464
|
+
${
|
|
465
|
+
this._switchDeliveryCountryInput
|
|
466
|
+
? html` <input name="deliveryPostalCode" .value="" /> `
|
|
467
|
+
: html`<select
|
|
468
|
+
name="deliveryPostalCode"
|
|
469
|
+
@change=${e => {
|
|
470
|
+
this._getStateAndCityByPostCode(e.target.value, e.target.name)
|
|
471
|
+
}}
|
|
472
|
+
value=${this?._selectedPostCode || ''}
|
|
473
|
+
>
|
|
474
|
+
<option value=""></option>
|
|
475
|
+
${this._deliveryPostCode.map(
|
|
476
|
+
(country, key) =>
|
|
477
|
+
html`<option
|
|
478
|
+
?selected=${(this._selectedPostCode.length > 0
|
|
479
|
+
? this._selectedPostCode
|
|
480
|
+
: this._releaseOrder.postalCode) == country.postalCode}
|
|
481
|
+
value=${country.postalCode}
|
|
482
|
+
>
|
|
483
|
+
${country.postalCode}
|
|
484
|
+
</option>`
|
|
485
|
+
)}
|
|
486
|
+
</select>`
|
|
487
|
+
}
|
|
290
488
|
|
|
291
|
-
|
|
292
|
-
|
|
489
|
+
<label>${i18next.t('label.state')}</label>
|
|
490
|
+
<input name="deliveryState" .value="${this._deliveryState}" />
|
|
293
491
|
|
|
294
|
-
|
|
295
|
-
|
|
492
|
+
<label>${i18next.t('label.city')}</label>
|
|
493
|
+
<input name="deliveryCity" .value="${this._deliveryCity}" />
|
|
296
494
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
?._editable}" min="${this._getStdDate()}" required />
|
|
495
|
+
<label>${i18next.t('label.delivery_address')}</label>
|
|
496
|
+
<textarea name="deliveryFullAddress" .value="${this._deliveryFullAddress}"></textarea>
|
|
300
497
|
|
|
301
|
-
|
|
302
|
-
|
|
498
|
+
<label>${i18next.t('label.contact')}</label>
|
|
499
|
+
<input name="contact" value="${this._deliveryContact}" />
|
|
500
|
+
</fieldset>
|
|
501
|
+
</form>
|
|
303
502
|
|
|
304
|
-
<label ?hidden="${this.roType === 'b2b'}">${i18next.t('label.attention_to')}</label>
|
|
305
|
-
<input name="attentionTo" ?hidden="${this.roType === 'b2b'}" readonly />
|
|
306
503
|
|
|
307
|
-
|
|
308
|
-
|
|
504
|
+
<form class="multi-column-form" title ?hidden="${this._showShippingInfo}">
|
|
505
|
+
<label>${i18next.t('label.billing_address')}</label>
|
|
506
|
+
</form>
|
|
309
507
|
|
|
310
|
-
|
|
311
|
-
|
|
508
|
+
<form name="billingAddressInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
|
|
509
|
+
|
|
510
|
+
<!-- billing -->
|
|
511
|
+
<fieldset>
|
|
512
|
+
|
|
513
|
+
<label>${i18next.t('label.country')}</label>
|
|
514
|
+
|
|
515
|
+
<select
|
|
516
|
+
name="billingCountry"
|
|
517
|
+
?disabled=${this._disableBillingAddress ? true : false}
|
|
518
|
+
@change=${e => {
|
|
519
|
+
this._validateBillingCountry(e)
|
|
520
|
+
}}
|
|
521
|
+
>
|
|
522
|
+
<option value=${this._selectedBillingCountry ? this._selectedBillingCountry : ''} selected>
|
|
523
|
+
${this._selectedBillingCountry ? this._selectedBillingCountry : ''}
|
|
524
|
+
</option>
|
|
525
|
+
${this._deliveryAllCountry.map(
|
|
526
|
+
(country, key) => html`<option value=${country.name}>${country.name}</option>`
|
|
527
|
+
)}
|
|
528
|
+
</select>
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
<label>${i18next.t('label.zip_postal_code')}</label>
|
|
312
532
|
|
|
313
|
-
<label ?hidden="${this.roType === 'b2b'}">${i18next.t('label.order_remark')}</label>
|
|
314
|
-
<textarea name="remark" ?hidden="${this.roType === 'b2b'}" rows="5" ?readonly="${!this
|
|
315
|
-
?._editable}"></textarea>
|
|
316
533
|
|
|
317
534
|
${
|
|
318
|
-
this.
|
|
319
|
-
? html`
|
|
320
|
-
<label for="ganNo">${i18next.t('label.arrival_notice')}</label>
|
|
321
|
-
<input disabled name="ganNo" .value="${this._ganNo}" />
|
|
322
|
-
`
|
|
323
|
-
: ''
|
|
324
|
-
}
|
|
325
|
-
${
|
|
326
|
-
this._attachments?.length > 0
|
|
535
|
+
this._switchBillingCountryInput
|
|
327
536
|
? html`
|
|
328
|
-
<
|
|
329
|
-
<ul attachment-wrap>
|
|
330
|
-
${(this._attachments || []).map(
|
|
331
|
-
attachment =>
|
|
332
|
-
html`
|
|
333
|
-
<li>
|
|
334
|
-
<a href="${location.origin}/attachment/${attachment.path}" download
|
|
335
|
-
><mwc-icon>attach_file</mwc-icon> ${attachment.name}</a
|
|
336
|
-
>
|
|
337
|
-
</li>
|
|
338
|
-
`
|
|
339
|
-
)}
|
|
340
|
-
</ul>
|
|
537
|
+
<input ?disabled=${this._disableBillingAddress ? true : false} name="billingPostalCode" .value="" />
|
|
341
538
|
`
|
|
342
|
-
:
|
|
539
|
+
: html`<select
|
|
540
|
+
?disabled=${this._disableBillingAddress ? true : false}
|
|
541
|
+
name="billingPostalCode"
|
|
542
|
+
@change=${e => {
|
|
543
|
+
this._getStateAndCityByPostCode(e.target.value, e.target.name)
|
|
544
|
+
}}
|
|
545
|
+
value=${this._releaseOrder.billingPostalCode}
|
|
546
|
+
>
|
|
547
|
+
<option value=""></option>
|
|
548
|
+
|
|
549
|
+
${this._billingPostCode.map(
|
|
550
|
+
(country, key) =>
|
|
551
|
+
html`<option
|
|
552
|
+
?selected=${this._releaseOrder.billingPostalCode == country.postalCode}
|
|
553
|
+
value=${country.postalCode}
|
|
554
|
+
>
|
|
555
|
+
${country.postalCode}
|
|
556
|
+
</option>`
|
|
557
|
+
)}
|
|
558
|
+
</select>`
|
|
343
559
|
}
|
|
344
|
-
</fieldset>
|
|
345
|
-
</form>
|
|
346
560
|
|
|
347
|
-
|
|
561
|
+
<label>${i18next.t('label.state')}</label>
|
|
562
|
+
<input ?disabled=${this._disableBillingAddress ? true : false} name="billingState" .value="${
|
|
563
|
+
this._billingState
|
|
564
|
+
}" />
|
|
565
|
+
|
|
566
|
+
<label>${i18next.t('label.city')}</label>
|
|
567
|
+
<input ?disabled=${this._disableBillingAddress ? true : false} name="billingCity" .value="${
|
|
568
|
+
this._billingCity
|
|
569
|
+
}" />
|
|
570
|
+
|
|
571
|
+
<label>${i18next.t('label.billing_address')}</label>
|
|
572
|
+
<textarea ?disabled=${this._disableBillingAddress ? true : false} name="billingFullAddress" .value="${
|
|
573
|
+
this._billingFullAddress
|
|
574
|
+
}"></textarea>
|
|
575
|
+
|
|
576
|
+
<input type="checkbox" id="matchDeliveryAddress" name="matchDeliveryAddressInputa" ?checked=${
|
|
577
|
+
this._billingFullAddress == this._deliveryFullAddress &&
|
|
578
|
+
this._selectedPostCode == this._selectedBillingPostCode
|
|
579
|
+
} @click=${e => {
|
|
580
|
+
e.currentTarget.checked ? (this._disableBillingAddress = true) : (this._disableBillingAddress = false)
|
|
581
|
+
e.currentTarget.checked ? this.matchDeliveryAddress() : ''
|
|
582
|
+
}} />
|
|
583
|
+
<label for="matchDeliveryAddress">${i18next.t('label.match_delivery_address')}</label>
|
|
584
|
+
|
|
585
|
+
</fieldset>
|
|
586
|
+
</form>
|
|
348
587
|
</div>
|
|
349
588
|
|
|
350
589
|
${
|
|
@@ -355,7 +594,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
355
594
|
<fieldset>
|
|
356
595
|
<legend>${i18next.t('title.export_order')}</legend>
|
|
357
596
|
<label>${i18next.t('label.container_no')}</label>
|
|
358
|
-
<input name="containerNo" ?readonly="${!this?._editable}"
|
|
597
|
+
<input name="containerNo" ?readonly="${!this?._editable}" />
|
|
359
598
|
|
|
360
599
|
<label>${i18next.t('label.container_arrival_date')}</label>
|
|
361
600
|
<input
|
|
@@ -366,7 +605,6 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
366
605
|
@change="${e => {
|
|
367
606
|
this._containerLeavingDateInput.setAttribute('min', e.currentTarget.value)
|
|
368
607
|
}}"
|
|
369
|
-
required
|
|
370
608
|
/>
|
|
371
609
|
|
|
372
610
|
<label>${i18next.t('label.container_leaving_date')}</label>
|
|
@@ -378,11 +616,10 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
378
616
|
@change="${e => {
|
|
379
617
|
this._containerArrivalDateInput.setAttribute('max', e.currentTarget.value)
|
|
380
618
|
}}"
|
|
381
|
-
required
|
|
382
619
|
/>
|
|
383
620
|
|
|
384
621
|
<label>${i18next.t('label.ship_name')}</label>
|
|
385
|
-
<input name="shipName" ?readonly="${!this?._editable}"
|
|
622
|
+
<input name="shipName" ?readonly="${!this?._editable}" />
|
|
386
623
|
</fieldset>
|
|
387
624
|
</form>
|
|
388
625
|
</div>
|
|
@@ -428,10 +665,36 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
428
665
|
constructor() {
|
|
429
666
|
super()
|
|
430
667
|
this._clearPage()
|
|
668
|
+
this._deliveryAllCountry = []
|
|
431
669
|
this._editable = false
|
|
432
670
|
this._disableTransport = false
|
|
433
671
|
this._shippingOrder = null
|
|
434
672
|
this._vasExpanded = false
|
|
673
|
+
this._showReleasedOrderInfo = false
|
|
674
|
+
this._showShippingInfo = true
|
|
675
|
+
this._attentionTo = ''
|
|
676
|
+
this._companyName = ''
|
|
677
|
+
this._deliveryCountry = 'Malaysia'
|
|
678
|
+
this._deliveryPostCode = []
|
|
679
|
+
this._deliveryState = ''
|
|
680
|
+
this._deliveryCity = ''
|
|
681
|
+
this._deliveryFullAddress = ''
|
|
682
|
+
this._deliveryContact = ''
|
|
683
|
+
this._billingCountry = 'Malaysia'
|
|
684
|
+
this._billingPostCode = []
|
|
685
|
+
this._billingState = ''
|
|
686
|
+
this._billingCity = ''
|
|
687
|
+
this._billingFullAddress = ''
|
|
688
|
+
this._billingContact = ''
|
|
689
|
+
this._selectedPostCode = ''
|
|
690
|
+
this._selectedBillingPostCode = ''
|
|
691
|
+
this._switchDeliveryCountryInput = false
|
|
692
|
+
this._switchBillingCountryInput = false
|
|
693
|
+
this._selectedDeliveryCountry = 'MALAYSIA'
|
|
694
|
+
this._selectedBillingCountry = 'MALAYSIA'
|
|
695
|
+
this.currentTab = {
|
|
696
|
+
selected: 'order'
|
|
697
|
+
}
|
|
435
698
|
}
|
|
436
699
|
|
|
437
700
|
get context() {
|
|
@@ -527,7 +790,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
527
790
|
|
|
528
791
|
let cancelOrderStatus = [
|
|
529
792
|
ORDER_STATUS.PICKING.value,
|
|
530
|
-
ORDER_STATUS.PENDING_WORKSHEET,
|
|
793
|
+
ORDER_STATUS.PENDING_WORKSHEET.value,
|
|
531
794
|
ORDER_STATUS.READY_TO_PICK.value,
|
|
532
795
|
ORDER_STATUS.LOADING.value
|
|
533
796
|
]
|
|
@@ -550,10 +813,30 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
550
813
|
return this.shadowRoot.querySelector('form[name=releaseOrder]')
|
|
551
814
|
}
|
|
552
815
|
|
|
816
|
+
get deliveryOrderForm() {
|
|
817
|
+
return this.shadowRoot.querySelector('form[name=deliveryOrderInfo]')
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
get billingPostalCodeInput() {
|
|
821
|
+
return this.shadowRoot.querySelector('select[name=billingPostalCode]')
|
|
822
|
+
}
|
|
823
|
+
|
|
553
824
|
get shippingOrderForm() {
|
|
554
825
|
return this.shadowRoot.querySelector('form[name=shippingOrder]')
|
|
555
826
|
}
|
|
556
827
|
|
|
828
|
+
get contactPointForm() {
|
|
829
|
+
return this.shadowRoot.querySelector('form[name=contactPointInfo]')
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
get billingAddressForm() {
|
|
833
|
+
return this.shadowRoot.querySelector('form[name=billingAddressInfo]')
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
get deliveryAddressForm() {
|
|
837
|
+
return this.shadowRoot.querySelector('form[name=deliveryAddressInfo]')
|
|
838
|
+
}
|
|
839
|
+
|
|
557
840
|
get _ownTransportInput() {
|
|
558
841
|
return this.shadowRoot.querySelector('input[name=ownTransport]')
|
|
559
842
|
}
|
|
@@ -586,11 +869,16 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
586
869
|
return this.shadowRoot.querySelector('data-grist#vas-grist')
|
|
587
870
|
}
|
|
588
871
|
|
|
872
|
+
get matchDeliveryAddressInput() {
|
|
873
|
+
return this.shadowRoot?.querySelector('input[name=matchDeliveryAddressInputa]')
|
|
874
|
+
}
|
|
875
|
+
|
|
589
876
|
async pageUpdated(changes) {
|
|
590
877
|
if (this.active) {
|
|
591
878
|
if (changes.resourceId) {
|
|
592
879
|
this._releaseOrderNo = changes.resourceId
|
|
593
880
|
}
|
|
881
|
+
this._clearPage()
|
|
594
882
|
|
|
595
883
|
if (this._releaseOrderNo) {
|
|
596
884
|
await this._fetchReleaseOrder(this._releaseOrderNo)
|
|
@@ -600,6 +888,9 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
600
888
|
}
|
|
601
889
|
|
|
602
890
|
async pageInitialized() {
|
|
891
|
+
await this._getAllPostCode()
|
|
892
|
+
await this.fetchCountry()
|
|
893
|
+
|
|
603
894
|
this.isUserBelongsDomain = await this._checkUserBelongsDomain()
|
|
604
895
|
let [allowROAddProductSetting, userRoles] = [fetchSettingRule('allow-ro-add-product'), this.fetchUserRoleHandler()]
|
|
605
896
|
let [enableTransportationServiceSetting] = await Promise.all([fetchSettingRule('enable-transportation-service')])
|
|
@@ -612,7 +903,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
612
903
|
this.inventoryGristConfig = {
|
|
613
904
|
pagination: { infinite: true },
|
|
614
905
|
rows: { selectable: { multiple: true }, appendable: false },
|
|
615
|
-
list: { fields: ['sku', 'productName', 'batchId','invStatus', 'packingType', 'releaseQty', 'releaseUomValue'] },
|
|
906
|
+
list: { fields: ['sku', 'productName', 'batchId', 'invStatus', 'packingType', 'releaseQty', 'releaseUomValue'] },
|
|
616
907
|
columns: [
|
|
617
908
|
{ name: 'releaseUomValue', hidden: true },
|
|
618
909
|
{ name: 'remainUomValue', hidden: true },
|
|
@@ -804,8 +1095,18 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
804
1095
|
truckNo
|
|
805
1096
|
type
|
|
806
1097
|
attentionTo
|
|
1098
|
+
attentionCompany
|
|
807
1099
|
phone1
|
|
808
1100
|
deliveryAddress1
|
|
1101
|
+
billingAddress
|
|
1102
|
+
billingCity
|
|
1103
|
+
billingCountry
|
|
1104
|
+
billingPostalCode
|
|
1105
|
+
billingState
|
|
1106
|
+
city
|
|
1107
|
+
state
|
|
1108
|
+
postalCode
|
|
1109
|
+
country
|
|
809
1110
|
remark
|
|
810
1111
|
bizplace {
|
|
811
1112
|
id
|
|
@@ -939,7 +1240,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
939
1240
|
releaseUomValueWithUom: inventoryInfo.releaseUomValue + ' ' + inventoryInfo.uom,
|
|
940
1241
|
remainUomValueWithUom: `${inventoryInfo.uomValue - inventoryInfo.releaseUomValue} ${inventoryInfo.uom}`,
|
|
941
1242
|
status: inventoryInfo.status,
|
|
942
|
-
invStatus: inventoryInfo.status ==
|
|
1243
|
+
invStatus: inventoryInfo.status == 'MISSING' ? true : false,
|
|
943
1244
|
existing: true,
|
|
944
1245
|
roundedUomValue: `${roundedUomValue} ${inventoryInfo.uom}`,
|
|
945
1246
|
addableQty: inventoryInfo.qty - inventoryInfo.lockedQty,
|
|
@@ -948,6 +1249,9 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
948
1249
|
})
|
|
949
1250
|
|
|
950
1251
|
const orderVass = releaseOrder.orderVass
|
|
1252
|
+
this._releaseOrder = {
|
|
1253
|
+
...releaseOrder
|
|
1254
|
+
}
|
|
951
1255
|
|
|
952
1256
|
this._releaseOrderId = releaseOrder.id
|
|
953
1257
|
this.partnerBizplaceId = releaseOrder.bizplace.id
|
|
@@ -958,6 +1262,38 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
958
1262
|
this._packingOption = releaseOrder.packingOption
|
|
959
1263
|
this._crossDocking = releaseOrder?.crossDocking
|
|
960
1264
|
|
|
1265
|
+
// shipment info
|
|
1266
|
+
this._billingFullAddress = releaseOrder?.billingAddress || ''
|
|
1267
|
+
this._deliveryFullAddress = releaseOrder?.deliveryAddress1
|
|
1268
|
+
this._attentionTo = releaseOrder?.attentionTo
|
|
1269
|
+
this._companyName = releaseOrder?.attentionCompany
|
|
1270
|
+
this._deliveryCity = releaseOrder?.city
|
|
1271
|
+
this._deliveryState = releaseOrder?.state
|
|
1272
|
+
this._deliveryCountry = releaseOrder?.country
|
|
1273
|
+
this._deliveryContact = releaseOrder?.phone1
|
|
1274
|
+
this._selectedBillingPostCode = releaseOrder?.billingPostalCode
|
|
1275
|
+
this._billingCity = releaseOrder?.billingCity
|
|
1276
|
+
this._billingState = releaseOrder?.billingState
|
|
1277
|
+
this._billingCountry = releaseOrder?.billingCountry
|
|
1278
|
+
|
|
1279
|
+
releaseOrder.deliveryCity = releaseOrder?.city
|
|
1280
|
+
releaseOrder.deliveryState = releaseOrder?.state
|
|
1281
|
+
releaseOrder.contact = releaseOrder?.phone1
|
|
1282
|
+
releaseOrder.deliveryFullAddress = releaseOrder?.deliveryAddress1
|
|
1283
|
+
releaseOrder.deliveryCountry = releaseOrder?.country
|
|
1284
|
+
releaseOrder.deliveryPostalCode = releaseOrder?.postalCode
|
|
1285
|
+
releaseOrder.billingFullAddress = releaseOrder?.billingAddress
|
|
1286
|
+
releaseOrder.companyName = releaseOrder?.attentionCompany
|
|
1287
|
+
|
|
1288
|
+
if (
|
|
1289
|
+
releaseOrder?.billingAddress == releaseOrder?.deliveryAddress1 &&
|
|
1290
|
+
releaseOrder?.postalCode == releaseOrder?.billingPostalCode
|
|
1291
|
+
) {
|
|
1292
|
+
this._disableBillingAddress = true
|
|
1293
|
+
} else {
|
|
1294
|
+
this._disableBillingAddress = false
|
|
1295
|
+
}
|
|
1296
|
+
|
|
961
1297
|
await this.updateComplete
|
|
962
1298
|
|
|
963
1299
|
this._ganNo = releaseOrder?.arrivalNotice?.name
|
|
@@ -973,6 +1309,12 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
973
1309
|
this._fillupSOForm(shippingOrder)
|
|
974
1310
|
}
|
|
975
1311
|
|
|
1312
|
+
this._fillupDAForm(releaseOrder)
|
|
1313
|
+
|
|
1314
|
+
this._fillupBLForm(releaseOrder)
|
|
1315
|
+
|
|
1316
|
+
this._fillupCPForm(releaseOrder)
|
|
1317
|
+
|
|
976
1318
|
if (this._exportOption) {
|
|
977
1319
|
this._ownTransport = true
|
|
978
1320
|
this._ownTransportInput.checked = true
|
|
@@ -1197,6 +1539,18 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1197
1539
|
this._fillupForm(this.shippingOrderForm, data)
|
|
1198
1540
|
}
|
|
1199
1541
|
|
|
1542
|
+
_fillupDAForm(data) {
|
|
1543
|
+
this._fillupForm(this.deliveryAddressForm, data)
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
_fillupBLForm(data) {
|
|
1547
|
+
this._fillupForm(this.billingAddressForm, data)
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
_fillupCPForm(data) {
|
|
1551
|
+
this._fillupForm(this.contactPointForm, data)
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1200
1554
|
_fillupForm(form, data) {
|
|
1201
1555
|
if (form) {
|
|
1202
1556
|
form.reset()
|
|
@@ -1222,6 +1576,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1222
1576
|
}
|
|
1223
1577
|
|
|
1224
1578
|
_clearPage() {
|
|
1579
|
+
this._releaseOrder = {}
|
|
1225
1580
|
this._status = null
|
|
1226
1581
|
this.roType = 'b2b'
|
|
1227
1582
|
this._exportOption = false
|
|
@@ -1298,7 +1653,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1298
1653
|
|
|
1299
1654
|
if (!response.errors) {
|
|
1300
1655
|
this._showToast({ message: i18next.t('text.release_order_is_submitted_for_cancellation') })
|
|
1301
|
-
navigate(`b2b_orders`)
|
|
1656
|
+
this.roType === 'b2b' ? navigate(`b2b_orders`) : navigate(`b2c_order_requests`)
|
|
1302
1657
|
}
|
|
1303
1658
|
} catch (e) {
|
|
1304
1659
|
throw e
|
|
@@ -1447,21 +1802,56 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1447
1802
|
delete releaseOrder.status
|
|
1448
1803
|
delete releaseOrder.ganNo
|
|
1449
1804
|
|
|
1805
|
+
let shippingOrderInfo = {}
|
|
1806
|
+
|
|
1807
|
+
let contactPointInfo = this._serializeForm(this.contactPointForm)
|
|
1808
|
+
|
|
1809
|
+
let deliveryAddressInfo = this._serializeForm(this.deliveryAddressForm)
|
|
1810
|
+
|
|
1811
|
+
let billingAddressInfo = this._serializeForm(this.billingAddressForm)
|
|
1812
|
+
|
|
1813
|
+
shippingOrderInfo = {
|
|
1814
|
+
...contactPointInfo,
|
|
1815
|
+
...deliveryAddressInfo,
|
|
1816
|
+
...billingAddressInfo
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
delete shippingOrderInfo['']
|
|
1820
|
+
|
|
1821
|
+
if (
|
|
1822
|
+
this._disableBillingAddress ||
|
|
1823
|
+
(shippingOrderInfo.billingFullAddress == shippingOrderInfo.deliveryFullAddress &&
|
|
1824
|
+
shippingOrderInfo.billingPostalCode == shippingOrderInfo.deliveryPostalCode)
|
|
1825
|
+
) {
|
|
1826
|
+
shippingOrderInfo.billingAddress = deliveryAddressInfo.deliveryFullAddress
|
|
1827
|
+
shippingOrderInfo.billingPostalCode = deliveryAddressInfo.deliveryPostalCode
|
|
1828
|
+
shippingOrderInfo.billingCity = deliveryAddressInfo.deliveryCity
|
|
1829
|
+
shippingOrderInfo.billingState = deliveryAddressInfo.deliveryState
|
|
1830
|
+
} else {
|
|
1831
|
+
shippingOrderInfo.billingAddress = billingAddressInfo.billingFullAddress
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
shippingOrderInfo.deliveryAddress = this._deliveryFullAddress
|
|
1835
|
+
shippingOrderInfo.billingCountry = this._billingCountry
|
|
1836
|
+
delete shippingOrderInfo.matchDeliveryAddressInputa
|
|
1837
|
+
|
|
1450
1838
|
let afterRemarkValue
|
|
1451
1839
|
if (releaseOrder?.remark) {
|
|
1452
1840
|
afterRemarkValue = releaseOrder.remark = releaseOrder.remark.trimStart()
|
|
1453
1841
|
}
|
|
1454
1842
|
|
|
1455
|
-
if (this.
|
|
1456
|
-
if (
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1843
|
+
if (this.roType === 'b2c') {
|
|
1844
|
+
if (this._beforeRemark !== afterRemarkValue) {
|
|
1845
|
+
if (!afterRemarkValue) {
|
|
1846
|
+
const remarkResult = await CustomAlert({
|
|
1847
|
+
title: i18next.t('title.removing_order_remark'),
|
|
1848
|
+
text: i18next.t('text.do_you_want_to_proceed'),
|
|
1849
|
+
confirmButton: { text: i18next.t('button.proceed') },
|
|
1850
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
1851
|
+
})
|
|
1852
|
+
|
|
1853
|
+
if (!remarkResult.value) return
|
|
1854
|
+
}
|
|
1465
1855
|
}
|
|
1466
1856
|
}
|
|
1467
1857
|
|
|
@@ -1478,8 +1868,16 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1478
1868
|
|
|
1479
1869
|
const response = await client.mutate({
|
|
1480
1870
|
mutation: gql`
|
|
1481
|
-
mutation updateReleaseGoodDetails(
|
|
1482
|
-
|
|
1871
|
+
mutation updateReleaseGoodDetails(
|
|
1872
|
+
$releaseOrder: ReleaseGoodPatch!
|
|
1873
|
+
$shippingOrder: ShippingOrderPatch
|
|
1874
|
+
$shippingOrderInfo: ShippingOrderInfoPatch
|
|
1875
|
+
) {
|
|
1876
|
+
updateReleaseGoodDetails(
|
|
1877
|
+
releaseGood: $releaseOrder
|
|
1878
|
+
shippingOrder: $shippingOrder
|
|
1879
|
+
shippingOrderInfo: $shippingOrderInfo
|
|
1880
|
+
) {
|
|
1483
1881
|
id
|
|
1484
1882
|
name
|
|
1485
1883
|
}
|
|
@@ -1492,11 +1890,14 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1492
1890
|
name: this._releaseOrderNo,
|
|
1493
1891
|
ownTransport: this._importCargo ? true : this._ownTransport
|
|
1494
1892
|
},
|
|
1495
|
-
shippingOrder
|
|
1893
|
+
shippingOrder,
|
|
1894
|
+
shippingOrderInfo: shippingOrderInfo ? shippingOrderInfo : null
|
|
1496
1895
|
}
|
|
1497
1896
|
})
|
|
1498
1897
|
|
|
1499
1898
|
if (!response.errors) {
|
|
1899
|
+
this.matchDeliveryAddressInput.checked = false
|
|
1900
|
+
this._disableBillingAddress = false
|
|
1500
1901
|
this._showToast({ message: i18next.t('text.release_order_details_updated') })
|
|
1501
1902
|
await this._fetchReleaseOrder()
|
|
1502
1903
|
}
|
|
@@ -1505,6 +1906,157 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1505
1906
|
}
|
|
1506
1907
|
}
|
|
1507
1908
|
|
|
1909
|
+
_openContactPointSelector() {
|
|
1910
|
+
openPopup(
|
|
1911
|
+
html`
|
|
1912
|
+
<contact-points-popup
|
|
1913
|
+
@selected="${e => {
|
|
1914
|
+
this._companyName = e.detail.companyName
|
|
1915
|
+
this._attentionTo = e.detail.name
|
|
1916
|
+
this._deliveryCountry = 'MALAYSIA'
|
|
1917
|
+
this._deliveryCity = e.detail.city ? e.detail.city : ''
|
|
1918
|
+
this._deliveryState = e.detail.state ? e.detail.state : ''
|
|
1919
|
+
this._selectedPostCode = e.detail.postCode ? e.detail.postCode : ''
|
|
1920
|
+
this._deliveryContact = e.detail.phone ? e.detail.phone : ''
|
|
1921
|
+
this._deliveryFullAddress = e.detail.address
|
|
1922
|
+
? e.detail.address
|
|
1923
|
+
: '' + e.detail.address2
|
|
1924
|
+
? e.detail.address2
|
|
1925
|
+
: ''
|
|
1926
|
+
this._billingFullAddress = e.detail.billingAddress
|
|
1927
|
+
|
|
1928
|
+
const deliveryAddressInfo = {
|
|
1929
|
+
deliveryCountry: 'Malaysia',
|
|
1930
|
+
deliveryState: e.detail.state ? e.detail.state : '',
|
|
1931
|
+
deliveryCity: e.detail.city ? e.detail.city : '',
|
|
1932
|
+
deliveryFullAddress: e.detail.address
|
|
1933
|
+
? e.detail.address
|
|
1934
|
+
: '' + e.detail.address2
|
|
1935
|
+
? e.detail.address2
|
|
1936
|
+
: '',
|
|
1937
|
+
deliveryContact: e.detail.phone ? e.detail.phone : '',
|
|
1938
|
+
deliveryPostalCode: e.detail.postCode ? e.detail.postCode : ''
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
this._fillupDAForm(deliveryAddressInfo)
|
|
1942
|
+
}}"
|
|
1943
|
+
></contact-points-popup>
|
|
1944
|
+
`,
|
|
1945
|
+
{
|
|
1946
|
+
backdrop: true,
|
|
1947
|
+
size: 'large',
|
|
1948
|
+
title: i18next.t('title.select_destination')
|
|
1949
|
+
}
|
|
1950
|
+
)
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
matchDeliveryAddress() {
|
|
1954
|
+
this._billingFullAddress = ''
|
|
1955
|
+
this._billingState = ''
|
|
1956
|
+
this._billingCity = ''
|
|
1957
|
+
this.billingPostalCodeInput.value = ''
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
async _getAllPostCode() {
|
|
1961
|
+
try {
|
|
1962
|
+
const response = await client.query({
|
|
1963
|
+
query: gql`
|
|
1964
|
+
query geoAreasAllPostCode {
|
|
1965
|
+
geoAreasAllPostCode {
|
|
1966
|
+
items {
|
|
1967
|
+
postalCode
|
|
1968
|
+
}
|
|
1969
|
+
total
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
`
|
|
1973
|
+
})
|
|
1974
|
+
|
|
1975
|
+
if (!response.errors) {
|
|
1976
|
+
const items = response.data.geoAreasAllPostCode.items
|
|
1977
|
+
this._deliveryPostCode = items
|
|
1978
|
+
this._billingPostCode = items
|
|
1979
|
+
|
|
1980
|
+
return true
|
|
1981
|
+
}
|
|
1982
|
+
} catch (e) {
|
|
1983
|
+
this._showToast(e)
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
async _getStateAndCityByPostCode(value, name) {
|
|
1988
|
+
const postCode = value
|
|
1989
|
+
|
|
1990
|
+
if (postCode == '') {
|
|
1991
|
+
if (name == 'deliveryPostalCode') {
|
|
1992
|
+
this._deliveryState = ''
|
|
1993
|
+
this._deliveryCity = ''
|
|
1994
|
+
return
|
|
1995
|
+
} else if (name == 'billingPostalCode') {
|
|
1996
|
+
this._billingState = ''
|
|
1997
|
+
this._billingCity = ''
|
|
1998
|
+
return
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
try {
|
|
2003
|
+
const response = await client.query({
|
|
2004
|
+
query: gql`
|
|
2005
|
+
query geoAreasGetStateAndCityByPosCode($postCode: String!) {
|
|
2006
|
+
geoAreasGetStateAndCityByPosCode(postCode: $postCode) {
|
|
2007
|
+
stateName
|
|
2008
|
+
cityName
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
`,
|
|
2012
|
+
variables: {
|
|
2013
|
+
postCode
|
|
2014
|
+
}
|
|
2015
|
+
})
|
|
2016
|
+
|
|
2017
|
+
if (!response.errors) {
|
|
2018
|
+
const { stateName, cityName } = response.data.geoAreasGetStateAndCityByPosCode
|
|
2019
|
+
|
|
2020
|
+
switch (name) {
|
|
2021
|
+
case 'deliveryPostalCode':
|
|
2022
|
+
this._deliveryState = stateName
|
|
2023
|
+
this._deliveryCity = cityName.toUpperCase()
|
|
2024
|
+
break
|
|
2025
|
+
|
|
2026
|
+
case 'billingPostalCode':
|
|
2027
|
+
this._billingState = stateName
|
|
2028
|
+
this._billingCity = cityName.toUpperCase()
|
|
2029
|
+
|
|
2030
|
+
default:
|
|
2031
|
+
break
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
} catch (error) {
|
|
2035
|
+
this._showToast(e)
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
async fetchCountry() {
|
|
2040
|
+
const response = await client.query({
|
|
2041
|
+
query: gql`
|
|
2042
|
+
query geoCountriesWithoutParam {
|
|
2043
|
+
geoCountriesWithoutParam {
|
|
2044
|
+
items {
|
|
2045
|
+
id
|
|
2046
|
+
name
|
|
2047
|
+
description
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
`
|
|
2052
|
+
})
|
|
2053
|
+
|
|
2054
|
+
if (!response.error) {
|
|
2055
|
+
this._billingAllCountry = response.data.geoCountriesWithoutParam.items
|
|
2056
|
+
this._deliveryAllCountry = response.data.geoCountriesWithoutParam.items
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
|
|
1508
2060
|
_getFormInfo() {
|
|
1509
2061
|
let formData = this._serializeForm(this.releaseOrderForm)
|
|
1510
2062
|
delete formData.importedOrder
|
|
@@ -1523,6 +2075,17 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1523
2075
|
return obj
|
|
1524
2076
|
}
|
|
1525
2077
|
|
|
2078
|
+
_serializeFormRO(form) {
|
|
2079
|
+
let obj = {}
|
|
2080
|
+
Array.from(form.querySelectorAll('input, select')).forEach(field => {
|
|
2081
|
+
if (!field.hasAttribute('hidden') && field.value) {
|
|
2082
|
+
obj[field.name] = field.type === 'checkbox' ? field.checked : field.value
|
|
2083
|
+
}
|
|
2084
|
+
})
|
|
2085
|
+
|
|
2086
|
+
return obj
|
|
2087
|
+
}
|
|
2088
|
+
|
|
1526
2089
|
_validateTransport() {
|
|
1527
2090
|
//Check if warehouse provide transport
|
|
1528
2091
|
if (this._enableTransportationServiceSetting != undefined && !this._enableTransportationServiceSetting) {
|
|
@@ -1561,6 +2124,34 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1561
2124
|
date.setDate(date.getDate())
|
|
1562
2125
|
return date.toISOString().split('T')[0]
|
|
1563
2126
|
}
|
|
2127
|
+
|
|
2128
|
+
_tabChange(key) {
|
|
2129
|
+
if (key == 'order') {
|
|
2130
|
+
this._showReleasedOrderInfo = false
|
|
2131
|
+
this._showShippingInfo = true
|
|
2132
|
+
} else {
|
|
2133
|
+
this._showReleasedOrderInfo = true
|
|
2134
|
+
this._showShippingInfo = false
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
_validateCountry(e) {
|
|
2139
|
+
if (e.target.value != 'MALAYSIA') {
|
|
2140
|
+
this._switchDeliveryCountryInput = true
|
|
2141
|
+
} else {
|
|
2142
|
+
this._switchDeliveryCountryInput = false
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
_validateBillingCountry(e) {
|
|
2147
|
+
if (e.target.value != 'MALAYSIA') {
|
|
2148
|
+
this._switchBillingCountryInput = true
|
|
2149
|
+
this._selectedBillingCountry = e.target.value
|
|
2150
|
+
} else {
|
|
2151
|
+
this._switchBillingCountryInput = false
|
|
2152
|
+
this._selectedBillingCountry = e.target.value
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
1564
2155
|
}
|
|
1565
2156
|
|
|
1566
2157
|
window.customElements.define('release-order-detail', ReleaseOrderDetail)
|