问题遇到的现象和发生背景
前端的一个表格,里面有数据库查询出来的数据,需要把选中的一行数据封装成json格式的数据
问题相关代码,请勿粘贴截图
封装格式如下:
{
"REQUEST":{
"HEAD":{
"TRANSACTIONID":"",
"COUNT":"1",
"CONSUMER":"",
"SRVLEVEL":"1",
"ACCOUNT":"",
"PASSWORD":"",
"COMPANY":""
},
"DATA":{
"ITEM":[
{
"ZID":"",
"MATNR":"",
"WERKS":"",
"AENNR":"",
"AETXT":"",
"DATUS":"",
"ITEMS":[
{
"ZWYBS":"",
"IDNRK":"",
"MENGE":"",
"AUSCH":"",
"POTX1":"",
"POXT2":"",
"DEPLINE":"",
"SORTF":"",
"ZCZZT":"",
"ZYL01":"",
"ZYL02":"",
"ZYL03":"",
"ZYL04":"",
"ZYL05":"",
"ZYL06":""
},
{
"ZWYBS":"",
"IDNRK":"",
"MENGE":"",
"AUSCH":"",
"POTX1":"",
"POXT2":"",
"DEPLINE":"",
"SORTF":"",
"ZCZZT":"",
"ZYL01":"",
"ZYL02":"",
"ZYL03":"",
"ZYL04":"",
"ZYL05":"",
"ZYL06":""
}
]
}
]
}
}
}
运行结果及报错内容
我的解答思路和尝试过的方法
使用过assign(),push()等方式
我想要达到的结果
把表格数据封装成json格式的数据