SOURCE

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) { // "",null,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');


    // 输入与转化的方法 start
    // 输入与转化的方法 start
    // 输入与转化的方法 start
    function inputOut(key, name, qz, hz) {
        // 定义可选参数,前缀和后缀,有填则取值,没有则为空
        this.qz = qz || '';
        this.hz = hz || '';
        // 在data里面定义一个值
        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 命令行工具 X clear

                    
>
console