通过获取SAP号和werk的列数据,调取接口,获取型号和仓库数据,并赋值到对应单元格,但现在只会赋值到扩展列下面的那个单元格,数据量多的时候可以看到这个单元格赋值了很多次,这要怎么改 var matnr = ""; var werk = ""; for (i = 0; i < len; i++) { var matnr = _g().getCellValue(0, 5, i + 1); //获取F2的扩展值 var werk = _g().getCellValue(0, 32, i + 1); //获取AG2的扩展值 var wlzsj = { client: 800, function: "ZMM_TP_01_MMDATA_DISPLAY_ALL", import: { I_WERKS: werk, I_MATNR: matnr }, importTables: [] }; $.ajax({ url: "xxxx:18888/sap/ExSAPFunction", type: "POST", data: JSON.stringify(wlzsj), dataType: "json", contentType: "application/json", success: function (result) { if (result.code != '200') { FR.Msg.alert("警告","物料数据获取失败"); return false; } else { var data = result.data.exportTables; var LGORT = data[0].LGORT; var GROES = data[0].GROES; _g().setCellValue(0, 15, i + 1,LGORT); _g().setCellValue(0, 6, i + 1,GROES); } } }); } |