|
|
@ -185,25 +185,34 @@ |
|
|
|
url:ctx + "erp/material/getCateMaterialSelList", |
|
|
|
dataType:"json", |
|
|
|
delay:250, |
|
|
|
timeout: 10000, // 设置超时时间为10秒 |
|
|
|
cache:true, |
|
|
|
processResults: function (res, params) { |
|
|
|
var options = []; |
|
|
|
if(res.code==0){ |
|
|
|
var resultList = res.data; |
|
|
|
console.log(resultList); |
|
|
|
for(var i= 0, len=resultList.length;i<len;i++){ |
|
|
|
var option = resultList[i]; |
|
|
|
option.id = resultList[i]["materialNo"]; |
|
|
|
option.text = resultList[i]["materialNo"]; |
|
|
|
options.push(option); |
|
|
|
// for(var i= 0, len=resultList.length;i<len;i++){ |
|
|
|
// var option = resultList[i]; |
|
|
|
// option.id = resultList[i]["materialNo"]; |
|
|
|
// option.text = resultList[i]["materialNo"]; |
|
|
|
// options.push(option); |
|
|
|
// } |
|
|
|
return { |
|
|
|
results: resultList.map(function (item) { |
|
|
|
return { |
|
|
|
id: item.materialNo, |
|
|
|
text: item.materialNo |
|
|
|
}; |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
return { |
|
|
|
results: options |
|
|
|
results: [] |
|
|
|
}; |
|
|
|
}, |
|
|
|
escapeMarkup: function (markup) { return markup; }, |
|
|
|
minimumInputLength: 1 |
|
|
|
minimumInputLength: 1, |
|
|
|
} |
|
|
|
}); |
|
|
|
$('#materialNo').on('select2:select', function (e) { |
|
|
|