考场分配详情页面
This commit is contained in:
parent
7a7db206a7
commit
14a249e42d
@ -80,13 +80,13 @@
|
|||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<div class="layui-col-lg6" >
|
<div class="layui-col-lg6" >
|
||||||
<label class="layui-form-label">考试开始<span style="color:red">*</span></label>
|
<label class="layui-form-label">考试开始</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" id="distributionAllotTime" readonly name="distributionAllotTime" style="cursor:pointer;" class="layui-input" value="" placeholder="请输入考试开始时间" maxlength="25" lay-verify="required">
|
<input type="text" id="distributionAllotTime" readonly name="distributionAllotTime" style="cursor:pointer;" class="layui-input" value="" placeholder="请输入考试开始时间" maxlength="25" lay-verify="required">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-lg6" >
|
<div class="layui-col-lg6" >
|
||||||
<label class="layui-form-label">考试结束<span style="color:red">*</span></label>
|
<label class="layui-form-label">考试结束</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" id="distributionAllotEndTime" readonly name="distributionAllotEndTime" style="cursor:pointer;" class="layui-input" value="" placeholder="请输入考试结束时间" maxlength="25" lay-verify="required">
|
<input type="text" id="distributionAllotEndTime" readonly name="distributionAllotEndTime" style="cursor:pointer;" class="layui-input" value="" placeholder="请输入考试结束时间" maxlength="25" lay-verify="required">
|
||||||
</div>
|
</div>
|
||||||
@ -118,9 +118,9 @@
|
|||||||
<label class="layui-form-label">{{ station.stationName }}</label>
|
<label class="layui-form-label">{{ station.stationName }}</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
{{# for(var i = 0, item; item = station.fieldArray[i++];) { }}
|
{{# for(var i = 0, item; item = station.fieldArray[i++];) { }}
|
||||||
{{# if(item.checked) {
|
{{# if(item.checked) { }}
|
||||||
<input type="checkbox" {{item.checked}} name="distributionFields[{{item.organizationId}}]" value="{{item.organizationId}}" title="{{item.organizationName}}【 {{item.organizationDesc == 1 ? '理论考场' : item.organizationDesc == 2 ? '实操考场' : '混合考场'}}】(可容纳{{item.organizationUserNum}}人)" lay-verify="required">
|
<input type="checkbox" {{item.checked}} name="distributionFields[{{item.organizationId}}]" value="{{item.organizationId}}" title="{{item.organizationName}}【 {{item.organizationDesc == 1 ? '理论考场' : item.organizationDesc == 2 ? '实操考场' : '混合考场'}}】(可容纳{{item.organizationUserNum}}人)" lay-verify="required">
|
||||||
} }}
|
{{# } }}
|
||||||
{{# } }}
|
{{# } }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -213,8 +213,9 @@
|
|||||||
type:'get',
|
type:'get',
|
||||||
dataType:'json',
|
dataType:'json',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var institutionAddress = data.institutionAddress;
|
var institutionAddress = "";
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
// 拼接考试地点的地址, 因为涉及到跨考点,因此此处可能是多个地址,需要判断拼接
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'api/organization/list?organizationType=' + data[i].institutionId,
|
url: 'api/organization/list?organizationType=' + data[i].institutionId,
|
||||||
async: false,
|
async: false,
|
||||||
@ -222,22 +223,29 @@
|
|||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (orgData) {
|
success: function (orgData) {
|
||||||
// 回显 , 选中
|
// 回显 , 选中
|
||||||
|
var checkCount = 0;
|
||||||
for (var a = 0; a < orgData.length; a++) {
|
for (var a = 0; a < orgData.length; a++) {
|
||||||
if(dataForm) {
|
if(dataForm) {
|
||||||
for (var j = 0; j < dataForm.distributionFieldList.length; j++) {
|
for (var j = 0; j < dataForm.distributionFieldList.length; j++) {
|
||||||
if (orgData[a].organizationId == dataForm.distributionFieldList[j].fieldId) {
|
if (orgData[a].organizationId == dataForm.distributionFieldList[j].fieldId) {
|
||||||
orgData[a].checked = 'checked="checked"';
|
orgData[a].checked = 'checked="checked"';
|
||||||
|
checkCount++;
|
||||||
|
if(institutionAddress.indexOf(data[i].institutionAddress) == -1) {
|
||||||
|
institutionAddress = institutionAddress.length < 1 ? institutionAddress + data[i].institutionAddress : institutionAddress + "," + data[i].institutionAddress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(checkCount > 0 ){
|
||||||
var stationData = {stationName: data[i].institutionName, fieldArray: orgData};
|
var stationData = {stationName: data[i].institutionName, fieldArray: orgData};
|
||||||
stationArray.push(stationData);
|
stationArray.push(stationData);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var inData = {address: institutionAddress , stationArray: stationArray}
|
var inData = {address: institutionAddress , stationArray: stationArray};
|
||||||
laytpl(document.getElementById('distributionFieldsBoxTemplate').innerHTML).render(stationArray, function (html) {
|
laytpl(document.getElementById('distributionFieldsBoxTemplate').innerHTML).render(inData, function (html) {
|
||||||
console.log(stationArray);
|
console.log(stationArray);
|
||||||
document.getElementById('distributionFieldsBox').innerHTML = html;
|
document.getElementById('distributionFieldsBox').innerHTML = html;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user