3金币
数组是这样
[{"FEntryID":8022056,"FMaterialId.FNumber":"03010070005","物料名称":"丙烷气","应收数量":245,"FREALQTY":245,"源单类型":" UR_ReceiveBill","源单编号":"CGSL022406036001","源单行内码":0,"备注":"有立项单,财务编码DMZG2302002","仓库":13786609,"仓位":221003,"单据状态":"D","内码":2167267},{"FEntryID":8022058,"FMaterialId.FNumber":"03010010001","物料名称":"液氮","应收数量":100000,"FREALQTY":100000,"源单类型":" UR_ReceiveBill","源单编号":"CGSL022406036001","源单行内码":0,"备注":" ","仓库":13786609,"仓位":221003,"单据状态":"D","内码":2167267},{"FEntryID":8022057,"FMaterialId.FNumber":"03010070005","物料名称":"丙烷气","应收数量":220,"FREALQTY":220,"源单类型":" UR_ReceiveBill","源单编号":"CGSL022406036001","源单行内码":0,"备注":"有立项单,财务编码DMZG2302002","仓库":13786609,"仓位":221003,"单据状态":"D","内码":2167267}]
我想变成这样
[{"FEntryID":8022056,"FMaterialId.FNumber":"03010070005,"FREALQTY":245,},
{"FEntryID":8022058,"FMaterialId.FNumber":"03010010001,"FREALQTY":100000},
{"FEntryID":8022057,"FMaterialId.FNumber":"03010070005","FREALQTY":220}]
请各位大佬伸出援助之手![](https://gcdn-cdn.grapecity.com.cn/static/image/smiley/default/hug.gif) ![](https://gcdn-cdn.grapecity.com.cn/static/image/smiley/default/hug.gif)
|
最佳答案
查看完整内容
写句代码吧,最简单
const newArray = oldArray.map(function(item) {
return {
FEntryID: item.FEntryID,
['FMaterialId.FNumber']: item['FMaterialId.FNumber'],
FREALQTY: item.FREALQTY
};
});
[/backcolor]
|