修改考场分配页面

This commit is contained in:
cuibaocheng 2021-05-15 20:06:50 +08:00
parent 4e649f5c1a
commit cd946a1b02
2 changed files with 153 additions and 85 deletions

View File

@ -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;
$.ajax({
url:'api/classplan/list?classPlanIdListIds=' + planId,
async:false,
type:'get',
dataType:'json',
success: function (data) {
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) {
$.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 (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) {
$.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++) {
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) {
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:args.data.institutionName, fieldArray:orgData};
var stationData = {stationName: data[i].institutionName, fieldArray: orgData};
stationArray.push(stationData);
if(args.index == dataLength - 1) {
laytpl(document.getElementById('distributionFieldsBoxTemplate').innerHTML).render(stationArray, function(html) {
}
});
}
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);
});
}

View File

@ -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;
$.ajax({
url:'api/classplan/list?classPlanIdListIds=' + planId,
async:false,
type:'get',
dataType:'json',
success: function (data) {
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) {
$.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 (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};
$.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);
if(args.index == dataLength - 1) {
laytpl(document.getElementById('distributionFieldsBoxTemplate').innerHTML).render(stationArray, function(html) {
}
});
}
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);
});
}
// 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({