let arguments =
[
{
"shipmentNum": "ck1598229636864122881",
"receivingAddress": null,
"hab": "广州市晖远新材料有限公司",
"operator": "admin",
"total": 2764.8,
"creditCode": null,
"companyPhone": null,
"legalPerson": null,
"bz": "",
"day": "2022-12-01",
"email": null,
"bankCardCode": null,
"qq": null,
"address": "广东省广州市增城区新塘镇官道站前路12号1栋402",
"signatoryPhone": null,
"paymentBz": null,
"openAccountBank": null,
"list": [
{
"unit2": "平方",
"units": "m²",
"productCount": 1,
"specifications": "1024mm * 1000m * 1R",
"productName": "75热敏合成/水胶/60白格底-04",
"sizeOther3": 2764.8,
"returnBy": "admin",
"updateBy": "admin",
"planBz": "",
"productBz": null,
"sizeWeight": null,
"subtotal": "2764.8",
"squareUnitPrice": "2.7",
"squareNum": "1024"
},
{
"sizeWeight": "/",
"subtotal": "/",
"productBz": "/",
"units": "/",
"productCount": "/",
"specifications": "/",
"productName": "/",
"squareNum": "/"
},
{
"sizeWeight": "/",
"subtotal": "/",
"productBz": "/",
"units": "/",
"productCount": "/",
"specifications": "/",
"productName": "/",
"squareNum": "/"
},
{
"sizeWeight": "/",
"subtotal": "/",
"productBz": "/",
"units": "/",
"productCount": "/",
"specifications": "/",
"productName": "/",
"squareNum": "/"
},
{
"sizeWeight": "/",
"subtotal": "/",
"productBz": "/",
"units": "/",
"productCount": "/",
"specifications": "/",
"productName": "/",
"squareNum": "/"
},
{
"sizeWeight": "/",
"subtotal": "/",
"productBz": "/",
"units": "/",
"productCount": "/",
"specifications": "/",
"productName": "/",
"squareNum": "/"
},
{
"sizeWeight": "/",
"subtotal": "/",
"productBz": "/",
"units": "/",
"productCount": "/",
"specifications": "/",
"productName": "/",
"squareNum": "/"
},
{
"sizeWeight": "/",
"subtotal": "/",
"productBz": "/",
"units": "/",
"productCount": "/",
"specifications": "/",
"productName": "/",
"squareNum": "/"
}
],
"companyContacts": null,
"taxRate": null,
"capitalChineseTotal": "贰仟柒佰陆拾肆元捌角",
"companyAddress": null,
"faxNumber": null,
"signatory": null,
"customer": "肇庆金德辉新材料科技有限公司"
}
]
let data = arguments[0];
let dataList = data['list'];
// 如果有明细才进行判断和排序
for (let i = 0; i < dataList.length; i++) {
let base = dataList[i];
let spe = base.specifications.split(" * ")
let width = spe[0] == '/'||undefined ? '':spe[0]
let height = spe[1]? spe[1]:''
data['list'][i].width = width
data['list'][i].height = height
}
console