let arguments =[
{
"shipmentNum": "ck1555471138510848002",
"pageNumber": "第1/1页",
"receivingAddress": "中堂镇潢涌商业路5号10栋101室",
"hab": "广东楷诚纸业有限公司",
"productCount": 2,
"operator": "jiangqiang",
"allPage": 1,
"planNum": "0800020",
"total": 775.5,
"allProductCount": 2,
"companyPhone": "0769-38841601",
"routeBz": null,
"bz": "",
"allSquareNum": 2161,
"lines": 6,
"day": "2022-08-05",
"qq": null,
"address": "广东省东莞市洪梅镇望沙路红梅段66号",
"weightPrintVoList": [
{
"num": 1,
"product": "1*1200",
"name": "加工90克地龙再生牛卡+12克光膜",
"unit2": "mm",
"width": 1800
},
{
"num": 1,
"product": "1*1",
"name": "加工90克地龙再生牛卡+12克光膜",
"unit2": "mm",
"width": null
}
],
"signatoryPhone": "13751322083",
"list": [
{
"companyAlias": "1564",
"unit2": "平方",
"units": "m²",
"productCount": 1,
"specifications": null,
"productName": "加工90克地龙再生牛卡+12克光膜",
"number": "",
"sizeOther1": null,
"bz": "",
"planId": "1555471138510848002",
"sizeLength": 1200,
"sizeWidth": 1800,
"weight": "1*1200+",
"productBz": null,
"sizeWeight": 226,
"associatedPo": "",
"subtotal": "712.8",
"squareUnitPrice": 0.33,
"salesman": "聂红梅",
"squareNum": "2160"
},
{
"companyAlias": "1564",
"unit2": "kg",
"units": "kg",
"productCount": 1,
"specifications": null,
"productName": "加工90克地龙再生牛卡+12克光膜",
"number": null,
"sizeOther1": null,
"bz": "",
"planId": "1555471138510848002",
"sizeLength": null,
"sizeWidth": null,
"weight": "1*1+",
"productBz": null,
"sizeWeight": 1,
"associatedPo": "",
"subtotal": "62.7",
"squareUnitPrice": 62.7,
"salesman": "聂红梅",
"squareNum": "1"
}
],
"companyContacts": "505",
"allTotal": 775.5,
"contactsPhone": "13751322083",
"capitalChineseAllTotal": "柒佰柒拾伍元伍角",
"associatedPo": "",
"capitalChineseTotal": "柒佰柒拾伍元伍角",
"customerTo": "1564",
"shippingAddress": "中堂镇潢涌商业路5号10栋101室",
"salesman": "聂红梅",
"signatory": "505",
"currentPage": 1,
"totalSquareNum": 2161,
"customer": "东莞市庆源纸品有限公司"
}
]
let data = arguments[0]; //获取传入的原始数据
//你的代码,推荐在线编辑器https://jsrun.net/
// 定义弹框的内容
let detail = data["list"];
function alertInput(text,acquiesce,name){
let str = prompt(text, acquiesce);
let t;
if(str != null){
t = str;
}
// 把新字段塞到列表里面去
data[name + ""] = t;
// 把规格详细数据拿出来并组合
for(let i = 0;i < detail.length;i++){
let d = detail[i];
// 把新字段塞到明细里面去
if(d.productName){
data["list"][i]["" + name] = t;
}
}
}
// 1、为弹框的提醒文字; 2、为填写的默认文字 3、为返回字段的英文字符
// alertInput("请输入税率", "13","tax");
// alertInput("请输入操作人", "张三","man");
console.log(data["list"]);
console.log(data);
console