修改考场分配页面
This commit is contained in:
parent
4e649f5c1a
commit
cd946a1b02
@ -150,68 +150,73 @@
|
||||
var dataForm = {};
|
||||
var stationArray;
|
||||
var classPlanArray;
|
||||
var dataLength = 0;
|
||||
var planLength = 0;
|
||||
|
||||
// 初始化开班计划
|
||||
function initDistributionClassPlans() {
|
||||
classPlanArray = new Array();
|
||||
top.restAjax.get(top.restAjax.path('api/classplan/list?classPlanIdListIds={classPlanIds}', [ planId ]), {}, null, function (code, data, args) {
|
||||
planLength = data.length;
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var planData = {index: i, data: data[i]};
|
||||
top.restAjax.get(top.restAjax.path('api/applystudents/list-by-classid/{planId}', [ data[i].classPlanId ]), {}, planData, function (code, userData, args) {
|
||||
var user = args.data;
|
||||
user.applyCount = userData.length;
|
||||
classPlanArray.push(user);
|
||||
if (args.index == planLength - 1) {
|
||||
laytpl(document.getElementById('distributionClassPlansBoxTemplate').innerHTML).render(classPlanArray, function (html) {
|
||||
console.log(classPlanArray);
|
||||
document.getElementById('distributionClassPlansBox').innerHTML = html;
|
||||
});
|
||||
form.render('checkbox', 'distributionClassPlansBox');
|
||||
}
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
$.ajax({
|
||||
url:'api/classplan/list?classPlanIdListIds=' + planId,
|
||||
async:false,
|
||||
type:'get',
|
||||
dataType:'json',
|
||||
success: function (data) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
$.ajax({
|
||||
url: 'api/applystudents/list-by-classid/' + data[i].classPlanId,
|
||||
async: false,
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
success: function (userData) {
|
||||
data[i].applyCount = userData.length;
|
||||
classPlanArray.push( data[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
laytpl(document.getElementById('distributionClassPlansBoxTemplate').innerHTML).render(classPlanArray, function (html) {
|
||||
console.log(classPlanArray);
|
||||
document.getElementById('distributionClassPlansBox').innerHTML = html;
|
||||
});
|
||||
form.render('checkbox', 'distributionClassPlansBox');
|
||||
}
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化考场
|
||||
function initDistributionFields() {
|
||||
stationArray = new Array();
|
||||
top.restAjax.get(top.restAjax.path('api/institution/list?institutionType=考点信息', []), {}, null, function(code, data, args) {
|
||||
dataLength = data.length;
|
||||
for(var i = 0 ; i < data.length ; i++) {
|
||||
var institutionData = {index:i, data:data[i]};
|
||||
top.restAjax.get(top.restAjax.path('api/organization/list?organizationType={organizationType}', [data[i].institutionId]), {}, institutionData, function(code, orgData, args) {
|
||||
// 回显 , 选中
|
||||
for(var a = 0 ; a < orgData.length; a++) {
|
||||
console.log(dataForm);
|
||||
for(var j = 0 ; j < dataForm.distributionFieldList.length; j++) {
|
||||
if(orgData[a].organizationId == dataForm.distributionFieldList[j].fieldId) {
|
||||
orgData[a].checked = 'checked="checked"';
|
||||
$.ajax({
|
||||
url:'api/institution/list?institutionType=考点信息',
|
||||
async:false,
|
||||
type:'get',
|
||||
dataType:'json',
|
||||
success: function (data) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
$.ajax({
|
||||
url: 'api/organization/list?organizationType=' + data[i].institutionId,
|
||||
async: false,
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
success: function (orgData) {
|
||||
// 回显 , 选中
|
||||
for (var a = 0; a < orgData.length; a++) {
|
||||
console.log(dataForm);
|
||||
for (var j = 0; j < dataForm.distributionFieldList.length; j++) {
|
||||
if (orgData[a].organizationId == dataForm.distributionFieldList[j].fieldId) {
|
||||
orgData[a].checked = 'checked="checked"';
|
||||
}
|
||||
}
|
||||
}
|
||||
var stationData = {stationName: data[i].institutionName, fieldArray: orgData};
|
||||
stationArray.push(stationData);
|
||||
}
|
||||
}
|
||||
var stationData = {stationName:args.data.institutionName, fieldArray:orgData};
|
||||
stationArray.push(stationData);
|
||||
if(args.index == dataLength - 1) {
|
||||
laytpl(document.getElementById('distributionFieldsBoxTemplate').innerHTML).render(stationArray, function(html) {
|
||||
console.log(stationArray);
|
||||
document.getElementById('distributionFieldsBox').innerHTML = html;
|
||||
});
|
||||
form.render('checkbox', 'distributionFieldsBox');
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
laytpl(document.getElementById('distributionFieldsBoxTemplate').innerHTML).render(stationArray, function (html) {
|
||||
console.log(stationArray);
|
||||
document.getElementById('distributionFieldsBox').innerHTML = html;
|
||||
});
|
||||
form.render('checkbox', 'distributionFieldsBox');
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -150,62 +150,125 @@
|
||||
|
||||
var stationArray;
|
||||
var classPlanArray;
|
||||
var dataLength = 0;
|
||||
var planLength = 0;
|
||||
|
||||
// 初始化开班计划
|
||||
function initDistributionClassPlans() {
|
||||
classPlanArray = new Array();
|
||||
top.restAjax.get(top.restAjax.path('api/classplan/list?classPlanIdListIds={classPlanIds}', [ planId ]), {}, null, function (code, data, args) {
|
||||
planLength = data.length;
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var planData = {index: i, data: data[i]};
|
||||
top.restAjax.get(top.restAjax.path('api/applystudents/list-by-classid/{planId}', [ data[i].classPlanId ]), {}, planData, function (code, userData, args) {
|
||||
var user = args.data;
|
||||
user.applyCount = userData.length;
|
||||
classPlanArray.push(user);
|
||||
if (args.index == planLength - 1) {
|
||||
laytpl(document.getElementById('distributionClassPlansBoxTemplate').innerHTML).render(classPlanArray, function (html) {
|
||||
console.log(classPlanArray);
|
||||
document.getElementById('distributionClassPlansBox').innerHTML = html;
|
||||
});
|
||||
form.render('checkbox', 'distributionClassPlansBox');
|
||||
}
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
$.ajax({
|
||||
url:'api/classplan/list?classPlanIdListIds=' + planId,
|
||||
async:false,
|
||||
type:'get',
|
||||
dataType:'json',
|
||||
success: function (data) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
$.ajax({
|
||||
url: 'api/applystudents/list-by-classid/' + data[i].classPlanId,
|
||||
async: false,
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
success: function (userData) {
|
||||
data[i].applyCount = userData.length;
|
||||
classPlanArray.push( data[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
laytpl(document.getElementById('distributionClassPlansBoxTemplate').innerHTML).render(classPlanArray, function (html) {
|
||||
console.log(classPlanArray);
|
||||
document.getElementById('distributionClassPlansBox').innerHTML = html;
|
||||
});
|
||||
form.render('checkbox', 'distributionClassPlansBox');
|
||||
}
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化考场
|
||||
function initDistributionFields() {
|
||||
stationArray = new Array();
|
||||
top.restAjax.get(top.restAjax.path('api/institution/list?institutionType=考点信息', []), {}, null, function(code, data, args) {
|
||||
dataLength = data.length;
|
||||
for(var i = 0 ; i < data.length ; i++) {
|
||||
var institutionData = {index:i, data:data[i]};
|
||||
top.restAjax.get(top.restAjax.path('api/organization/list?organizationType={organizationType}', [data[i].institutionId]), {}, institutionData, function(code, orgData, args) {
|
||||
var stationData = {stationName:args.data.institutionName, fieldArray:orgData};
|
||||
stationArray.push(stationData);
|
||||
if(args.index == dataLength - 1) {
|
||||
laytpl(document.getElementById('distributionFieldsBoxTemplate').innerHTML).render(stationArray, function(html) {
|
||||
console.log(stationArray);
|
||||
document.getElementById('distributionFieldsBox').innerHTML = html;
|
||||
});
|
||||
form.render('checkbox', 'distributionFieldsBox');
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
$.ajax({
|
||||
url:'api/institution/list?institutionType=考点信息',
|
||||
async:false,
|
||||
type:'get',
|
||||
dataType:'json',
|
||||
success: function (data) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
$.ajax({
|
||||
url: 'api/organization/list?organizationType=' + data[i].institutionId,
|
||||
async: false,
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
success: function (orgData) {
|
||||
var stationData = {stationName: data[i].institutionName, fieldArray: orgData};
|
||||
stationArray.push(stationData);
|
||||
}
|
||||
});
|
||||
}
|
||||
laytpl(document.getElementById('distributionFieldsBoxTemplate').innerHTML).render(stationArray, function (html) {
|
||||
console.log(stationArray);
|
||||
document.getElementById('distributionFieldsBox').innerHTML = html;
|
||||
});
|
||||
form.render('checkbox', 'distributionFieldsBox');
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// var stationArray;
|
||||
// var classPlanArray;
|
||||
// var dataLength = 0;
|
||||
// var planLength = 0;
|
||||
//
|
||||
// // 初始化开班计划
|
||||
// function initDistributionClassPlans() {
|
||||
// classPlanArray = new Array();
|
||||
// top.restAjax.get(top.restAjax.path('api/classplan/list?classPlanIdListIds={classPlanIds}', [ planId ]), {}, null, function (code, data, args) {
|
||||
// planLength = data.length;
|
||||
// for (var i = 0; i < data.length; i++) {
|
||||
// var planData = {index: i, data: data[i]};
|
||||
// top.restAjax.get(top.restAjax.path('api/applystudents/list-by-classid/{planId}', [ data[i].classPlanId ]), {}, planData, function (code, userData, args) {
|
||||
// var user = args.data;
|
||||
// user.applyCount = userData.length;
|
||||
// classPlanArray.push(user);
|
||||
// if (args.index == planLength - 1) {
|
||||
// laytpl(document.getElementById('distributionClassPlansBoxTemplate').innerHTML).render(classPlanArray, function (html) {
|
||||
// console.log(classPlanArray);
|
||||
// document.getElementById('distributionClassPlansBox').innerHTML = html;
|
||||
// });
|
||||
// form.render('checkbox', 'distributionClassPlansBox');
|
||||
// }
|
||||
// }, function (code, data) {
|
||||
// top.dialog.msg(data.msg);
|
||||
// });
|
||||
// }
|
||||
// }, function (code, data) {
|
||||
// top.dialog.msg(data.msg);
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// // 初始化考场
|
||||
// function initDistributionFields() {
|
||||
// stationArray = new Array();
|
||||
// top.restAjax.get(top.restAjax.path('api/institution/list?institutionType=考点信息', []), {}, null, function(code, data, args) {
|
||||
// dataLength = data.length;
|
||||
// for(var i = 0 ; i < data.length ; i++) {
|
||||
// var institutionData = {index:i, data:data[i]};
|
||||
// top.restAjax.get(top.restAjax.path('api/organization/list?organizationType={organizationType}', [data[i].institutionId]), {}, institutionData, function(code, orgData, args) {
|
||||
// var stationData = {stationName:args.data.institutionName, fieldArray:orgData};
|
||||
// stationArray.push(stationData);
|
||||
// if(args.index == dataLength - 1) {
|
||||
// laytpl(document.getElementById('distributionFieldsBoxTemplate').innerHTML).render(stationArray, function(html) {
|
||||
// console.log(stationArray);
|
||||
// document.getElementById('distributionFieldsBox').innerHTML = html;
|
||||
// });
|
||||
// form.render('checkbox', 'distributionFieldsBox');
|
||||
// }
|
||||
// }, function(code, data) {
|
||||
// top.dialog.msg(data.msg);
|
||||
// });
|
||||
// }
|
||||
// }, function(code, data) {
|
||||
// top.dialog.msg(data.msg);
|
||||
// });
|
||||
// }
|
||||
|
||||
// 初始化成立日期时间戳
|
||||
function initDistributionAllotTime() {
|
||||
laydate.render({
|
||||
|
Loading…
Reference in New Issue
Block a user