const arguments = [{
"shipmentNum": "1638064773045764097",
"qq": "196113390",
"address": "广东省广州市白云区天河区",
"companyPhone": "02084305189",
"bz": "jh2023-03-16,\t这是委外加工单备注",
"hab": "众联鼎兴",
"list": [{
"sizeLength": 400.0000,
"unit": "卷",
"sizeWidth": 150.0000,
"sizeWeight": null,
"sizeOther1": null,
"count": 1,
"productBz": "0",
"unit2": "平方",
"specifications": "150mm * 400m * 1R",
"productName": "54合成纸/100白底/水胶",
"squareNum": 60.00
}, {
"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": "/"
}]
}]
let data = arguments[0];
function getNum(str, firstStr, secondStr) {
if (str == "" || str == null || str == undefined) {
return "";
}
if (str.indexOf(firstStr) < 0) {
return "";
}
var subFirstStr = str.substring(str.indexOf(firstStr) + firstStr.length, str.length);
var subSecondStr = subFirstStr.substring(0, subFirstStr.indexOf(secondStr));
return subSecondStr;
}
let a = data.bz;
if (a) {
let pause = ',';
inputOut('jh', 'otherSize');
function inputOut(key, name, qz, hz) {
this.qz = qz || '';
this.hz = hz || '';
data[name] = "";
if (a.indexOf(key) != '-1') {
data[name] = this.qz + getNum(a, key, pause) + this.hz;
a = a.replace(key + getNum(a, key, pause) + pause, '');
data['bz'] = a;
}
}
}
console.log(data)
console