//通过ajax获取后台的值,再循环遍历到页面上,JQ
xgweb.ajaxPost(xgweb.apiAdd() + "busSolePro/distributionSoleProSelectDep", {
}, function(res) {
var res=res.data
if (res == null) {
layer.alert("没有获取到信息!");
}
else {
$("#DeptName").html("<option></option>");
//定义变量
var htmls = "";
//遍历
for (var i = 0; i < res.length; i++) {
htmls += "<option value='" + res[i].DeptID + "'>" + res[i]. DeptName + "</option>";
}
//追加数据
$("#DeptName").append(htmls);
form.render('select');
}
})