我的两个名称/值对kpiRecordedMissesNoPlannerMatch
和goodShipmentPlannerSaidMissed
包含对象数组。
这是我用来进行ajax调用的代码。
var urlString = '../api/APILPlus/APILPlusMissingComments/PS/DMPSPM/2018-11-01/2018-11-30';
$.ajax({
type: 'GET',
dataType: 'json',
contentType: "application/json",
url: urlString,
success: function (json) {
console.log('json'); console.log(json);
}
});
当我对来自浏览器的相同JSON输出进行硬编码时,数组将按预期填充。
var manualJson = [{ "dels": 116, "kpiRecordedMissesNoPlannerMatch": [{ "delivery": "1188724924", "material": "0281006949562", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188771856", "material": "0281006949562", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188644995", "material": "0281006950562", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188740584", "material": "02810075106RY", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188740588", "material": "02810075106RY", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188711251", "material": "02810079346RY", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188772925", "material": "02810079346RY", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188644995", "material": "0281006954562", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188786351", "material": "02810072632G9", "materialDesc": "Particulate matter p", "sum": 50.00, "cause": "No Planner answer." }, { "delivery": "1188740585", "material": "02810069446RY", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188740582", "material": "02810075146RY", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188770521", "material": "02810078782G9", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188805487", "material": "02810065116RY", "materialDesc": "Particulate matter p", "sum": 50.00, "cause": "No Planner answer." }, { "delivery": "1188740583", "material": "02810075126RY", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188711238", "material": "02810079366RY", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }, { "delivery": "1188772925", "material": "02810079366RY", "materialDesc": "Particulate matter p", "sum": 0.00, "cause": "No Planner answer." }], "goodShipmentPlannerSaidMissed": [{ "delivery": "1188691604", "material": "02810072632G9", "materialDesc": "Particulate matter p", "sum": 100.00, "cause": "Supplier Backlog/ Late", "m11": 100.00 }, { "delivery": "1188659715", "material": "02810074965UR", "materialDesc": "Particulate matter p", "sum": 100.00, "cause": "Supplier Backlog/ Late", "m11": 100.00 }] }];
console.log('manualJson'); console.log(manualJson);
我不明白我在想什么。帮助一如既往!