@things-factory/operato-wms 4.3.767 → 4.3.769
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/validate-gan-popup.js +2 -2
- package/client/pages/inventory/inventory-adjustment.js +46 -43
- package/client/pages/order/arrival-notice/create-arrival-notice.js +209 -206
- package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +132 -129
- package/client/pages/order/arrival-notice/edit-product-popup.js +97 -92
- package/package.json +5 -5
|
@@ -212,16 +212,16 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
212
212
|
?checked="${this._ownTransport}"
|
|
213
213
|
?disabled="${this._disableTransport}"
|
|
214
214
|
@change="${e => {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
215
|
+
this._ownTransport = e.currentTarget.checked
|
|
216
|
+
if (this._ownTransport) {
|
|
217
|
+
this._warehouseTransportInput.checked = false
|
|
218
|
+
this._warehouseTransport = false
|
|
219
|
+
} else {
|
|
220
|
+
this._warehouseTransportInput.checked = true
|
|
221
|
+
this._warehouseTransport = true
|
|
222
|
+
}
|
|
223
|
+
this._validateTransport()
|
|
224
|
+
}}"
|
|
225
225
|
/>
|
|
226
226
|
<label for="ownTransport">${i18next.t('label.own_transport')}</label>
|
|
227
227
|
|
|
@@ -232,16 +232,16 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
232
232
|
?disabled="${this._disableTransport}"
|
|
233
233
|
?checked="${this._warehouseTransport}"
|
|
234
234
|
@change="${e => {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
235
|
+
this._warehouseTransport = e.currentTarget.checked
|
|
236
|
+
if (this._warehouseTransport) {
|
|
237
|
+
this._ownTransportInput.checked = false
|
|
238
|
+
this._ownTransport = false
|
|
239
|
+
} else {
|
|
240
|
+
this._ownTransportInput.checked = true
|
|
241
|
+
this._ownTransport = true
|
|
242
|
+
}
|
|
243
|
+
this._validateTransport()
|
|
244
|
+
}}"
|
|
245
245
|
/>
|
|
246
246
|
<label for="warehouseTransport">${i18next.t('label.warehouse_transport')}</label>
|
|
247
247
|
|
|
@@ -251,8 +251,8 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
251
251
|
name="container"
|
|
252
252
|
?checked="${this._hasContainer}"
|
|
253
253
|
@change="${e => {
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
this._hasContainer = e.currentTarget.checked
|
|
255
|
+
}}"
|
|
256
256
|
?hidden="${!this._checkTransport}"
|
|
257
257
|
/>
|
|
258
258
|
<label for="container" ?hidden="${!this._checkTransport}">${i18next.t('label.container')}</label>
|
|
@@ -272,9 +272,9 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
272
272
|
name="importCargo"
|
|
273
273
|
?checked="${this._importedOrder}"
|
|
274
274
|
@change="${e => {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
this._importedOrder = e.currentTarget.checked
|
|
276
|
+
this._validateImportCargo()
|
|
277
|
+
}}"
|
|
278
278
|
?hidden="${!this._checkTransport}"
|
|
279
279
|
/>
|
|
280
280
|
<label for="importedOrder" ?hidden="${!this._checkTransport}">${i18next.t('label.import_cargo')}</label>
|
|
@@ -320,8 +320,8 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
320
320
|
<select name="containerSize" ?hidden="${!this._hasContainer}">
|
|
321
321
|
<option value="">--${i18next.t('label.please_select_a_container_size')}--</option>
|
|
322
322
|
${(this.containerSizes || []).map(
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
containerSize =>
|
|
324
|
+
html`
|
|
325
325
|
<option
|
|
326
326
|
?selected=${this._containerSize === containerSize.name}
|
|
327
327
|
value="${containerSize && containerSize.name}"
|
|
@@ -329,7 +329,7 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
329
329
|
${containerSize && containerSize.name}
|
|
330
330
|
</option>
|
|
331
331
|
`
|
|
332
|
-
|
|
332
|
+
)}
|
|
333
333
|
</select>
|
|
334
334
|
|
|
335
335
|
<label ?hidden="${!this._ownTransport}">${i18next.t('label.do_no')}</label>
|
|
@@ -376,8 +376,8 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
376
376
|
|
|
377
377
|
<h2
|
|
378
378
|
@click="${e => {
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
this._vasExpanded = !this._vasExpanded
|
|
380
|
+
}}"
|
|
381
381
|
class="vas-title"
|
|
382
382
|
>
|
|
383
383
|
<mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}<mwc-icon
|
|
@@ -762,15 +762,15 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
762
762
|
.bizplaceId="${this._bizplaceId}"
|
|
763
763
|
.selectMultipleProducts="${this._showAddProducts}"
|
|
764
764
|
@selected="${e => {
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
765
|
+
let newRecords = []
|
|
766
|
+
for (let i = 0; i < e.detail.multipleProducts.length; i++) {
|
|
767
|
+
newRecords.push(e.detail.multipleProducts[i])
|
|
768
|
+
}
|
|
769
|
+
this.productData = {
|
|
770
|
+
...this.productData,
|
|
771
|
+
records: [...this.productGrist.dirtyData.records, ...newRecords]
|
|
772
|
+
}
|
|
773
|
+
}}"
|
|
774
774
|
></select-product-popup>
|
|
775
775
|
`,
|
|
776
776
|
{
|
|
@@ -791,39 +791,39 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
791
791
|
<select-product-popup
|
|
792
792
|
.bizplaceId="${this._bizplaceId}"
|
|
793
793
|
@selected="${e => {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
this.productGrist.dirtyData.records = this.productGrist.dirtyData.records.map(item => {
|
|
805
|
-
return {
|
|
806
|
-
...item,
|
|
807
|
-
totalUomValue:
|
|
808
|
-
item?.packQty > 0
|
|
809
|
-
? item?.totalUomValue
|
|
810
|
-
? item.totalUomValue
|
|
811
|
-
: `${parseFloat(item.packQty * e.detail.uomValue).toFixed(3)} ${e.detail.uom}`
|
|
812
|
-
: null
|
|
813
|
-
}
|
|
814
|
-
})
|
|
794
|
+
// let newRecord = []
|
|
795
|
+
// newRecord.push(e.detail)
|
|
796
|
+
|
|
797
|
+
if (this.productGrist.dirtyData.records.length !== rowIndex) {
|
|
798
|
+
// update existing product data records
|
|
799
|
+
this.productGrist.dirtyData.records.splice(rowIndex, 1, {
|
|
800
|
+
...this.productGrist.dirtyData.records[rowIndex],
|
|
801
|
+
...e.detail
|
|
802
|
+
})
|
|
815
803
|
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
804
|
+
this.productGrist.dirtyData.records = this.productGrist.dirtyData.records.map(item => {
|
|
805
|
+
return {
|
|
806
|
+
...item,
|
|
807
|
+
totalUomValue:
|
|
808
|
+
item?.packQty > 0
|
|
809
|
+
? item?.totalUomValue
|
|
810
|
+
? item.totalUomValue
|
|
811
|
+
: `${parseFloat(item.packQty * e.detail.uomValue).toFixed(3)} ${e.detail.uom}`
|
|
812
|
+
: null
|
|
824
813
|
}
|
|
814
|
+
})
|
|
815
|
+
|
|
816
|
+
this.productData = {
|
|
817
|
+
...this.productData,
|
|
818
|
+
records: [...this.productGrist.dirtyData.records]
|
|
819
|
+
}
|
|
820
|
+
} else {
|
|
821
|
+
this.productData = {
|
|
822
|
+
...this.productData,
|
|
823
|
+
records: [...this.productGrist.dirtyData.records, e.detail]
|
|
825
824
|
}
|
|
826
|
-
}
|
|
825
|
+
}
|
|
826
|
+
}}"
|
|
827
827
|
></select-product-popup>
|
|
828
828
|
`,
|
|
829
829
|
{
|
|
@@ -1426,8 +1426,8 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1426
1426
|
_getOrderProducts() {
|
|
1427
1427
|
return this.productGrist.dirtyData.records.map(record => {
|
|
1428
1428
|
let orderProduct = {
|
|
1429
|
-
batchId: record.batchId,
|
|
1430
|
-
batchIdRef: record?.batchIdRef ? record.batchIdRef : null,
|
|
1429
|
+
batchId: record.batchId ? record.batchId.trim() : null,
|
|
1430
|
+
batchIdRef: record?.batchIdRef ? record.batchIdRef.trim() : null,
|
|
1431
1431
|
product: { id: record.product.id },
|
|
1432
1432
|
productDetail: { id: record?.productDetailId || record?.productDetail?.id },
|
|
1433
1433
|
packingType: record.packingType,
|
|
@@ -1526,65 +1526,65 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1526
1526
|
html`
|
|
1527
1527
|
<vas-create-popup
|
|
1528
1528
|
.targetList="${this.productGrist.dirtyData.records
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1529
|
+
.map(record => {
|
|
1530
|
+
let packQty = record.packQty - (record.releaseQty || 0)
|
|
1531
|
+
|
|
1532
|
+
if (this.vasData.records.length > 0) {
|
|
1533
|
+
const existVasData = this.vasData.records.filter(vasRecord => {
|
|
1534
|
+
switch (vasRecord.targetType) {
|
|
1535
|
+
case VAS_BATCH_AND_PRODUCT_TYPE:
|
|
1536
|
+
return (
|
|
1537
|
+
record.batchId === vasRecord.target.batchId &&
|
|
1538
|
+
record.product.id === vasRecord.target.productId
|
|
1539
|
+
)
|
|
1540
|
+
case VAS_BATCH_NO_TYPE:
|
|
1541
|
+
return record.batchId === vasRecord.target
|
|
1542
|
+
case VAS_PRODUCT_TYPE:
|
|
1543
|
+
return record.product.id === vasRecord.target
|
|
1544
|
+
}
|
|
1545
|
+
})
|
|
1546
1546
|
|
|
1547
|
-
|
|
1548
|
-
|
|
1547
|
+
if (existVasData.length > 0) {
|
|
1548
|
+
let assignedQty = 0
|
|
1549
1549
|
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1550
|
+
existVasData.forEach(dt => {
|
|
1551
|
+
assignedQty += dt.qty
|
|
1552
|
+
})
|
|
1553
1553
|
|
|
1554
|
-
|
|
1555
|
-
}
|
|
1554
|
+
packQty -= assignedQty
|
|
1556
1555
|
}
|
|
1556
|
+
}
|
|
1557
1557
|
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1558
|
+
delete record.__dirty__
|
|
1559
|
+
delete record.__dirtyfields__
|
|
1560
|
+
return {
|
|
1561
|
+
...record,
|
|
1562
|
+
packQty,
|
|
1563
|
+
unitUomValue: record.uomValue,
|
|
1564
|
+
totalUomValue: record.uomValue * packQty
|
|
1565
|
+
}
|
|
1566
|
+
})
|
|
1567
|
+
.filter(record => record.packQty > 0)}"
|
|
1568
1568
|
.vasList="${this.vasData.records}"
|
|
1569
1569
|
.record="${record}"
|
|
1570
1570
|
@completed="${e => {
|
|
1571
|
-
|
|
1571
|
+
const newRecords = e.detail
|
|
1572
1572
|
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1573
|
+
if (this.vasGrist.dirtyData.records.length !== this._selectedVasRecordIdx) {
|
|
1574
|
+
// update existing vasData records
|
|
1575
|
+
this.vasGrist.dirtyData.records.splice(this._selectedVasRecordIdx, 1, ...newRecords)
|
|
1576
1576
|
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
}
|
|
1577
|
+
this.vasData = {
|
|
1578
|
+
...this.vasData,
|
|
1579
|
+
records: [...this.vasGrist.dirtyData.records]
|
|
1580
|
+
}
|
|
1581
|
+
} else {
|
|
1582
|
+
this.vasData = {
|
|
1583
|
+
...this.vasData,
|
|
1584
|
+
records: [...this.vasGrist.dirtyData.records, ...newRecords]
|
|
1586
1585
|
}
|
|
1587
|
-
}
|
|
1586
|
+
}
|
|
1587
|
+
}}"
|
|
1588
1588
|
></vas-create-popup>
|
|
1589
1589
|
`,
|
|
1590
1590
|
{
|
|
@@ -1625,13 +1625,13 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1625
1625
|
html`
|
|
1626
1626
|
<popup-partner-bizplaces-selector
|
|
1627
1627
|
@selected="${e => {
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1628
|
+
this._bizplaceId = e.detail.id
|
|
1629
|
+
this._bizplaceName = e.detail.name
|
|
1630
|
+
this.productGrist.reset()
|
|
1631
|
+
this.vasGrist.reset()
|
|
1632
|
+
this._configureProductGrist()
|
|
1633
|
+
this._showAddProducts = true
|
|
1634
|
+
}}"
|
|
1635
1635
|
></popup-partner-bizplaces-selector>
|
|
1636
1636
|
`,
|
|
1637
1637
|
{
|
|
@@ -1792,6 +1792,9 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1792
1792
|
|
|
1793
1793
|
async importHandler(patches) {
|
|
1794
1794
|
patches.map(itm => {
|
|
1795
|
+
if (itm?.batchId) itm.batchId = itm.batchId.trim()
|
|
1796
|
+
if (itm?.batchIdRef) itm.batchIdRef = itm.batchIdRef.trim()
|
|
1797
|
+
|
|
1795
1798
|
itm.unitPrice = parseFloat(itm.unitPrice) || ''
|
|
1796
1799
|
if (itm.manufactureDate) {
|
|
1797
1800
|
let mdt = new Date(itm.manufactureDate)
|
|
@@ -1837,9 +1840,9 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1837
1840
|
<import-pop-up
|
|
1838
1841
|
.records=${records}
|
|
1839
1842
|
.config=${{
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
+
rows: this.productGristConfig.rows,
|
|
1844
|
+
columns: [...this.excelColumns().filter(column => column.imex !== undefined)]
|
|
1845
|
+
}}
|
|
1843
1846
|
.importHandler="${await this.importHandler.bind(this)}"
|
|
1844
1847
|
></import-pop-up>
|
|
1845
1848
|
`,
|
|
@@ -118,8 +118,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
118
118
|
raised
|
|
119
119
|
danger
|
|
120
120
|
@click=${() => {
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
history.back()
|
|
122
|
+
}}
|
|
123
123
|
label="${i18next.t('button.cancel')}"
|
|
124
124
|
></mwc-button>
|
|
125
125
|
<mwc-button
|
|
@@ -242,15 +242,15 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
242
242
|
},
|
|
243
243
|
...(this._enableLotIdInput
|
|
244
244
|
? [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
245
|
+
{
|
|
246
|
+
type: 'string',
|
|
247
|
+
name: 'palletId',
|
|
248
|
+
header: i18next.t('field.lot_id'),
|
|
249
|
+
imex: { header: i18next.t('field.lot_id'), key: 'palletId', width: 25, type: 'string' },
|
|
250
|
+
record: { editable: true },
|
|
251
|
+
width: 150
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
254
|
: []),
|
|
255
255
|
{
|
|
256
256
|
type: 'date',
|
|
@@ -451,13 +451,13 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
451
451
|
},
|
|
452
452
|
...(this.enableLotIdInput
|
|
453
453
|
? [
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
454
|
+
{
|
|
455
|
+
type: 'string',
|
|
456
|
+
name: 'palletId',
|
|
457
|
+
header: i18next.t('field.lot_id'),
|
|
458
|
+
width: 80
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
461
|
: []),
|
|
462
462
|
{
|
|
463
463
|
type: 'date',
|
|
@@ -712,32 +712,32 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
712
712
|
.data="${this.productData}"
|
|
713
713
|
.enableDirectInbound="${this.enableDirectInbound}"
|
|
714
714
|
@selected="${async e => {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
715
|
+
this.editProductGrist.dirtyData.records[rowIndex].location = { id: e.detail.id, name: e.detail.name }
|
|
716
|
+
this.editProductGrist.dirtyData.records[rowIndex].warehouse = {
|
|
717
|
+
id: e.detail.warehouse.id,
|
|
718
|
+
name: e.detail.warehouse.name
|
|
719
|
+
}
|
|
720
|
+
this.editProductGrist.dirtyData.records[rowIndex].__dirty__ = true
|
|
721
721
|
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
722
|
+
if (this.editProductGrist.dirtyData.records.length !== rowIndex) {
|
|
723
|
+
// update existing product data records
|
|
724
|
+
this.editProductGrist.dirtyData.records.splice(rowIndex, 1, {
|
|
725
|
+
...this.editProductGrist.dirtyData.records[rowIndex]
|
|
726
|
+
})
|
|
727
727
|
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
728
|
+
this.productData = {
|
|
729
|
+
...this.productData,
|
|
730
|
+
records: [...this.editProductGrist.dirtyData.records]
|
|
731
|
+
}
|
|
732
732
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
}
|
|
733
|
+
this.editProductGrist.data.records = this.editProductGrist.dirtyData.records
|
|
734
|
+
} else {
|
|
735
|
+
this.productData = {
|
|
736
|
+
...this.productData,
|
|
737
|
+
records: [...this.editProductGrist.dirtyData.records]
|
|
739
738
|
}
|
|
740
|
-
}
|
|
739
|
+
}
|
|
740
|
+
}}"
|
|
741
741
|
></buffer-location-selector>
|
|
742
742
|
`,
|
|
743
743
|
{
|
|
@@ -756,32 +756,32 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
756
756
|
.data="${this.newProductData}"
|
|
757
757
|
.enableDirectInbound="${this.enableDirectInbound}"
|
|
758
758
|
@selected="${async e => {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
759
|
+
this.addProductGrist.dirtyData.records[rowIndex].location = { id: e.detail.id, name: e.detail.name }
|
|
760
|
+
this.addProductGrist.dirtyData.records[rowIndex].warehouse = {
|
|
761
|
+
id: e.detail.warehouse.id,
|
|
762
|
+
name: e.detail.warehouse.name
|
|
763
|
+
}
|
|
764
|
+
this.addProductGrist.dirtyData.records[rowIndex].__dirty__ = true
|
|
765
765
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
766
|
+
if (this.addProductGrist.dirtyData.records.length !== rowIndex) {
|
|
767
|
+
// update existing product data records
|
|
768
|
+
this.addProductGrist.dirtyData.records.splice(rowIndex, 1, {
|
|
769
|
+
...this.addProductGrist.dirtyData.records[rowIndex]
|
|
770
|
+
})
|
|
771
771
|
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
772
|
+
this.newProductData = {
|
|
773
|
+
...this.newProductData,
|
|
774
|
+
records: [...this.addProductGrist.dirtyData.records]
|
|
775
|
+
}
|
|
776
776
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
}
|
|
777
|
+
this.addProductGrist.data.records = this.addProductGrist.dirtyData.records
|
|
778
|
+
} else {
|
|
779
|
+
this.newProductData = {
|
|
780
|
+
...this.newProductData,
|
|
781
|
+
records: [...this.addProductGrist.dirtyData.records]
|
|
783
782
|
}
|
|
784
|
-
}
|
|
783
|
+
}
|
|
784
|
+
}}"
|
|
785
785
|
></buffer-location-selector>
|
|
786
786
|
`,
|
|
787
787
|
{
|
|
@@ -807,27 +807,27 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
807
807
|
<select-product-popup
|
|
808
808
|
.bizplaceId="${this.bizplace.id}"
|
|
809
809
|
@selected="${e => {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
}
|
|
824
|
-
} else {
|
|
825
|
-
this.newProductData = {
|
|
826
|
-
...this.newProductData,
|
|
827
|
-
records: [...this.addProductGrist.dirtyData.records, e.detail]
|
|
828
|
-
}
|
|
810
|
+
// let newRecord = []
|
|
811
|
+
// newRecord.push(e.detail)
|
|
812
|
+
|
|
813
|
+
if (this.addProductGrist.dirtyData.records.length !== rowIndex) {
|
|
814
|
+
// update existing product data records
|
|
815
|
+
this.addProductGrist.dirtyData.records.splice(rowIndex, 1, {
|
|
816
|
+
...this.addProductGrist.dirtyData.records[rowIndex],
|
|
817
|
+
...e.detail
|
|
818
|
+
})
|
|
819
|
+
|
|
820
|
+
this.newProductData = {
|
|
821
|
+
...this.newProductData,
|
|
822
|
+
records: [...this.addProductGrist.dirtyData.records]
|
|
829
823
|
}
|
|
830
|
-
}
|
|
824
|
+
} else {
|
|
825
|
+
this.newProductData = {
|
|
826
|
+
...this.newProductData,
|
|
827
|
+
records: [...this.addProductGrist.dirtyData.records, e.detail]
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}}"
|
|
831
831
|
></select-product-popup>
|
|
832
832
|
`,
|
|
833
833
|
{
|
|
@@ -910,9 +910,12 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
910
910
|
return this.addProductGrist.dirtyData.records.map(record => {
|
|
911
911
|
record.unitPrice = parseFloat(record.unitPrice) || 0
|
|
912
912
|
|
|
913
|
+
let batchId = record.batchId ? record.batchId.trim() : null
|
|
914
|
+
let batchIdRef = record.batchIdRef ? record.batchIdRef.trim() : null
|
|
915
|
+
|
|
913
916
|
return {
|
|
914
|
-
batchId: isStatusPending ?
|
|
915
|
-
adjustedBatchId: !isStatusPending ?
|
|
917
|
+
batchId: isStatusPending ? batchId : `N/A`,
|
|
918
|
+
adjustedBatchId: !isStatusPending ? batchId : null,
|
|
916
919
|
palletQty: isStatusPending ? (record.palletQty ? record.palletQty : 0) : 0,
|
|
917
920
|
adjustedPalletQty: !isStatusPending ? (record?.palletQty ? record.palletQty : null) : null,
|
|
918
921
|
palletId: record.palletId ? record.palletId : null,
|
|
@@ -930,8 +933,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
930
933
|
totalUomValue: isStatusPending ? record.totalUomValue : 'N/A',
|
|
931
934
|
adjustedTotalUomValue: record?.totalUomValue && !isStatusPending ? record.totalUomValue : 'N/A',
|
|
932
935
|
manufactureDate: record?.manufactureDate ? record.manufactureDate : null,
|
|
933
|
-
batchIdRef: isStatusPending ?
|
|
934
|
-
adjustedBatchIdRef: record?.batchIdRef && !isStatusPending ?
|
|
936
|
+
batchIdRef: isStatusPending ? batchIdRef : 'N/A',
|
|
937
|
+
adjustedBatchIdRef: record?.batchIdRef && !isStatusPending ? batchIdRef : null,
|
|
935
938
|
unitPrice: isStatusPending ? record.unitPrice : 0,
|
|
936
939
|
adjustedUnitPrice: record?.unitPrice && !isStatusPending ? record.unitPrice : null,
|
|
937
940
|
remark: record?.remark ? record.remark : null,
|
|
@@ -949,18 +952,20 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
949
952
|
if (this.editProductGrist.dirtyData.records.some(record => record.__dirty__)) {
|
|
950
953
|
this.editProductGrist.dirtyData.records.map(record => {
|
|
951
954
|
record.unitPrice = parseFloat(record.unitPrice)
|
|
955
|
+
let batchId = record.batchId ? record.batchId.trim() : null
|
|
956
|
+
let batchIdRef = record.batchIdRef ? record.batchIdRef.trim() : null
|
|
952
957
|
|
|
953
958
|
editedOrderProducts.push({
|
|
954
959
|
id: record.id,
|
|
955
960
|
adjustedBatchId: !isStatusPending
|
|
956
|
-
?
|
|
961
|
+
? batchId === record.__origin__.batchId
|
|
957
962
|
? null
|
|
958
|
-
:
|
|
963
|
+
: batchId
|
|
959
964
|
: null,
|
|
960
965
|
adjustedBatchIdRef: !isStatusPending
|
|
961
|
-
?
|
|
966
|
+
? batchIdRef === record.__origin__.batchIdRef
|
|
962
967
|
? null
|
|
963
|
-
:
|
|
968
|
+
: batchIdRef
|
|
964
969
|
: null,
|
|
965
970
|
adjustedPalletQty: !isStatusPending
|
|
966
971
|
? record.palletQty === record.__origin__.palletQty
|
|
@@ -1011,13 +1016,13 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
1011
1016
|
remark: record?.remark ? record.remark : null,
|
|
1012
1017
|
...(isStatusPending && {
|
|
1013
1018
|
unitPrice: record.unitPrice,
|
|
1014
|
-
batchIdRef:
|
|
1019
|
+
batchIdRef: batchIdRef,
|
|
1015
1020
|
packingType: record.packingType,
|
|
1016
1021
|
packQty: record.packQty,
|
|
1017
1022
|
palletQty: record.palletQty,
|
|
1018
1023
|
uomValue: record.uomValue,
|
|
1019
1024
|
uom: record.uom,
|
|
1020
|
-
batchId:
|
|
1025
|
+
batchId: batchId,
|
|
1021
1026
|
totalUomValue: record.totalUomValue,
|
|
1022
1027
|
expDate: record.__origin__.expDate,
|
|
1023
1028
|
location: record.__origin__.location,
|