@things-factory/product-ui 4.3.281 → 4.3.291
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/product-list.js +90 -65
- package/package.json +3 -3
|
@@ -78,7 +78,7 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
78
78
|
]
|
|
79
79
|
|
|
80
80
|
return {
|
|
81
|
-
|
|
81
|
+
title: i18next.t('title.product'),
|
|
82
82
|
actions,
|
|
83
83
|
exportable: {
|
|
84
84
|
name: i18next.t('title.product'),
|
|
@@ -387,18 +387,28 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
387
387
|
},
|
|
388
388
|
{
|
|
389
389
|
type: 'integer',
|
|
390
|
-
name: '
|
|
390
|
+
name: 'minInboundShelfLife',
|
|
391
391
|
record: { editable: true, options: { min: 0 } },
|
|
392
|
-
imex: {
|
|
392
|
+
imex: {
|
|
393
|
+
header: i18next.t('field.min_inbound_shelf_life'),
|
|
394
|
+
key: 'minInboundShelfLife',
|
|
395
|
+
width: 30,
|
|
396
|
+
type: 'integer'
|
|
397
|
+
},
|
|
393
398
|
header: i18next.t('field.min_inbound_shelf_life'),
|
|
394
399
|
sortable: true,
|
|
395
400
|
width: 140
|
|
396
401
|
},
|
|
397
402
|
{
|
|
398
403
|
type: 'integer',
|
|
399
|
-
name: '
|
|
404
|
+
name: 'minOutboundShelfLife',
|
|
400
405
|
record: { editable: true },
|
|
401
|
-
imex: {
|
|
406
|
+
imex: {
|
|
407
|
+
header: i18next.t('field.min_outbound_shelf_life'),
|
|
408
|
+
key: 'minOutboundShelfLife',
|
|
409
|
+
width: 30,
|
|
410
|
+
type: 'integer'
|
|
411
|
+
},
|
|
402
412
|
header: i18next.t('field.min_outbound_shelf_life'),
|
|
403
413
|
sortable: true,
|
|
404
414
|
width: 140
|
|
@@ -416,7 +426,12 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
416
426
|
type: 'integer',
|
|
417
427
|
name: 'productShelfLife',
|
|
418
428
|
record: { editable: true, options: { min: 0 } },
|
|
419
|
-
imex: {
|
|
429
|
+
imex: {
|
|
430
|
+
header: i18next.t('field.product_shelf_life'),
|
|
431
|
+
key: 'productShelfLife',
|
|
432
|
+
width: 30,
|
|
433
|
+
type: 'integer'
|
|
434
|
+
},
|
|
420
435
|
header: i18next.t('field.product_shelf_life'),
|
|
421
436
|
sortable: true,
|
|
422
437
|
width: 140
|
|
@@ -982,8 +997,13 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
982
997
|
return {
|
|
983
998
|
...patch,
|
|
984
999
|
minInboundShelfLife:
|
|
985
|
-
patch?.minInboundShelfLife || patch?.minInboundShelfLife == 0
|
|
986
|
-
|
|
1000
|
+
patch?.minInboundShelfLife || patch?.minInboundShelfLife == 0
|
|
1001
|
+
? parseInt(patch.minInboundShelfLife)
|
|
1002
|
+
: undefined,
|
|
1003
|
+
minOutboundShelfLife:
|
|
1004
|
+
patch?.minOutboundShelfLife || patch?.minOutboundShelfLife == 0
|
|
1005
|
+
? parseInt(patch.minOutboundShelfLife)
|
|
1006
|
+
: undefined,
|
|
987
1007
|
productRef: patch.productRef?.id ? { id: patch.productRef?.id } : undefined,
|
|
988
1008
|
parentProductRef: patch.parentProductRef?.id ? { id: patch.parentProductRef?.id } : undefined,
|
|
989
1009
|
costPrice: patch?.costPrice ? parseFloat(patch.costPrice) : undefined,
|
|
@@ -1246,12 +1266,14 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
1246
1266
|
})
|
|
1247
1267
|
|
|
1248
1268
|
const pagination = { page: 0, limit: 99999 }
|
|
1249
|
-
const sorters =[{ name: 'sku' }]
|
|
1269
|
+
const sorters = [{ name: 'sku' }]
|
|
1250
1270
|
const sortings = sorters
|
|
1251
1271
|
const filters = await this.searchForm.getQueryFilters()
|
|
1252
1272
|
|
|
1253
|
-
if(records.length > 0){
|
|
1254
|
-
const ids = records.map(record => {
|
|
1273
|
+
if (records.length > 0) {
|
|
1274
|
+
const ids = records.map(record => {
|
|
1275
|
+
return record.id
|
|
1276
|
+
})
|
|
1255
1277
|
filters.push({ name: 'id', value: ids, operator: 'in' })
|
|
1256
1278
|
}
|
|
1257
1279
|
|
|
@@ -1274,7 +1296,7 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
1274
1296
|
name
|
|
1275
1297
|
description
|
|
1276
1298
|
}
|
|
1277
|
-
productDetails{
|
|
1299
|
+
productDetails {
|
|
1278
1300
|
id
|
|
1279
1301
|
sku
|
|
1280
1302
|
name
|
|
@@ -1354,61 +1376,64 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
1354
1376
|
})
|
|
1355
1377
|
|
|
1356
1378
|
if (!response.errors) {
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1379
|
+
const exportData =
|
|
1380
|
+
response.data.myBizplaceProducts.items.map(itm => {
|
|
1381
|
+
if (itm.costPrice == NaN || itm.costPrice == null) {
|
|
1382
|
+
itm.costPrice = 0
|
|
1383
|
+
}
|
|
1384
|
+
return {
|
|
1385
|
+
...itm,
|
|
1386
|
+
productRef: { name: itm?.productRef ? '(' + itm.productRef.sku + ') ' + itm.productRef.name : '' },
|
|
1387
|
+
costPrice: parseFloat(itm?.costPrice?.isNaN || itm?.costPrice == null ? 0 : itm.costPrice).toFixed(2),
|
|
1388
|
+
commissionFee: parseFloat(
|
|
1389
|
+
itm?.commissionFee?.isNaN || itm?.commissionFee == null ? 0 : itm.commissionFee
|
|
1390
|
+
).toFixed(2),
|
|
1391
|
+
platformFee: parseFloat(itm?.platformFee?.isNaN || itm?.platformFee == null ? 0 : itm.platformFee).toFixed(
|
|
1392
|
+
2
|
|
1393
|
+
),
|
|
1394
|
+
serviceFee: parseFloat(itm?.serviceFee?.isNaN || itm?.serviceFee == null ? 0 : itm.serviceFee).toFixed(2),
|
|
1395
|
+
transactionFee: parseFloat(
|
|
1396
|
+
itm?.transactionFee?.isNaN || itm?.transactionFee == null ? 0 : itm.transactionFee
|
|
1397
|
+
).toFixed(2)
|
|
1398
|
+
}
|
|
1399
|
+
}) || []
|
|
1400
|
+
|
|
1401
|
+
const flattenedList = []
|
|
1402
|
+
for (let product of exportData) {
|
|
1403
|
+
const pds = product.productDetails.map(pd => {
|
|
1404
|
+
return {
|
|
1405
|
+
...product,
|
|
1406
|
+
name: pd.name,
|
|
1407
|
+
packingType: pd.packingType,
|
|
1408
|
+
uom: pd.uom,
|
|
1409
|
+
uomValue: pd.uomValue,
|
|
1410
|
+
gtin: pd.productBarcodes
|
|
1411
|
+
.map(pb => {
|
|
1412
|
+
return pb.gtin
|
|
1413
|
+
})
|
|
1414
|
+
.reduce((acc, cur) => acc + ',' + cur)
|
|
1393
1415
|
}
|
|
1416
|
+
})
|
|
1417
|
+
flattenedList.push(...pds)
|
|
1418
|
+
}
|
|
1394
1419
|
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1420
|
+
var data = flattenedList.map(item => {
|
|
1421
|
+
return {
|
|
1422
|
+
id: '',
|
|
1423
|
+
commissionFee: item.commissionFee,
|
|
1424
|
+
platformFee: item.platformFee,
|
|
1425
|
+
serviceFee: item.serviceFee,
|
|
1426
|
+
transactionFee: item.transactionFee,
|
|
1427
|
+
...this.productGristConfig.columns
|
|
1428
|
+
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
1429
|
+
.reduce((record, column) => {
|
|
1430
|
+
record[column.imex.key] = column.imex.key
|
|
1431
|
+
.split('.')
|
|
1432
|
+
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
1433
|
+
return record
|
|
1434
|
+
}, {})
|
|
1435
|
+
}
|
|
1436
|
+
})
|
|
1412
1437
|
}
|
|
1413
1438
|
|
|
1414
1439
|
return { header: headerSetting, data: data }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/product-ui",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.291",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@things-factory/i18n-base": "^4.3.281",
|
|
29
29
|
"@things-factory/import-ui": "^4.3.281",
|
|
30
30
|
"@things-factory/layout-base": "^4.3.281",
|
|
31
|
-
"@things-factory/product-base": "^4.3.
|
|
31
|
+
"@things-factory/product-base": "^4.3.291",
|
|
32
32
|
"@things-factory/shell": "^4.3.281"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "9c051f9164b7068f75f386f3c013c24193c6ca5c"
|
|
35
35
|
}
|