回显验证等乱七八糟

This commit is contained in:
wans 2021-05-17 17:14:40 +08:00
parent 1a5595e321
commit 8bcaf4a982
13 changed files with 326 additions and 225 deletions

View File

@ -54,7 +54,7 @@ public class ClassPlanController extends DefaultBaseController {
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update/{classPlanId}") @PutMapping("update/{classPlanId}")
@CheckRequestBodyAnnotation @CheckRequestBodyAnnotation
public SuccessResult update(@PathVariable("classPlanId") String classPlanId, @RequestBody JSONObject obj) { public SuccessResult update(@PathVariable("classPlanId") String classPlanId, @RequestBody JSONObject obj) throws Exception{
obj.put("classPlanId",classPlanId); obj.put("classPlanId",classPlanId);
classPlanService.updateJson(obj); classPlanService.updateJson(obj);
return new SuccessResult(); return new SuccessResult();
@ -154,6 +154,19 @@ public class ClassPlanController extends DefaultBaseController {
return new SuccessResult(); return new SuccessResult();
} }
@ApiOperation(value = "重新提交考试申请", notes = "重新提交考试申请接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "classPlanId", value = "ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-exam-recommit/{classPlanId}")
public SuccessResult updateExamRecommit(@PathVariable("classPlanId") String classPlanId) {
classPlanService.updateExamRecommit(classPlanId);
return new SuccessResult();
}
@ApiOperation(value = "查询考试申请详情", notes = "查询考试申请详情接口") @ApiOperation(value = "查询考试申请详情", notes = "查询考试申请详情接口")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "classPlanId", value = "ID", paramType = "path") @ApiImplicitParam(name = "classPlanId", value = "ID", paramType = "path")

View File

@ -136,10 +136,17 @@ public interface IClassPlanDao {
*/ */
void deleteClassPlanLessons(Map<String, Object> params); void deleteClassPlanLessons(Map<String, Object> params);
/**
* 逻辑删除开班计划下所有老师的授课时刻安排
* @param params
*/
void deleteTeacherLessonsTime(Map<String, Object> params);
/** /**
* 根据机构id统计计划的分类数量 * 根据机构id统计计划的分类数量
* @param params * @param params
* @return * @return
*/ */
Map<String, Object> countPlanType(Map<String, Object> params); Map<String, Object> countPlanType(Map<String, Object> params);
} }

View File

@ -26,21 +26,11 @@ public class LessonsDTO {
private String lessonType; private String lessonType;
@ApiModelProperty(name = "teachWay", value = "授课方式1面授") @ApiModelProperty(name = "teachWay", value = "授课方式1面授")
private String teachWay; private String teachWay;
@ApiModelProperty(name = "creator", value = "")
private String creator;
@ApiModelProperty(name = "gmtCreate", value = "")
private String gmtCreate;
@ApiModelProperty(name = "modifier", value = "")
private String modifier;
@ApiModelProperty(name = "gmtModified", value = "")
private String gmtModified;
@ApiModelProperty(name = "isDelete", value = "")
private Integer isDelete;
@ApiModelProperty(name = "projectCatalogName", value = "培训项目") @ApiModelProperty(name = "projectCatalogName", value = "培训项目")
private String projectCatalogName; private String projectCatalogName;
public String getLessonId() { public String getLessonId() {
return lessonId == null ? "" : lessonId.trim(); return lessonId == null ? "" : lessonId;
} }
public void setLessonId(String lessonId) { public void setLessonId(String lessonId) {
@ -56,7 +46,7 @@ public class LessonsDTO {
} }
public String getProjectCatalogId() { public String getProjectCatalogId() {
return projectCatalogId == null ? "" : projectCatalogId.trim(); return projectCatalogId == null ? "" : projectCatalogId;
} }
public void setProjectCatalogId(String projectCatalogId) { public void setProjectCatalogId(String projectCatalogId) {
@ -64,7 +54,7 @@ public class LessonsDTO {
} }
public String getLessonName() { public String getLessonName() {
return lessonName == null ? "" : lessonName.trim(); return lessonName == null ? "" : lessonName;
} }
public void setLessonName(String lessonName) { public void setLessonName(String lessonName) {
@ -72,7 +62,7 @@ public class LessonsDTO {
} }
public String getLessonType() { public String getLessonType() {
return lessonType == null ? "" : lessonType.trim(); return lessonType == null ? "" : lessonType;
} }
public void setLessonType(String lessonType) { public void setLessonType(String lessonType) {
@ -80,53 +70,13 @@ public class LessonsDTO {
} }
public String getTeachWay() { public String getTeachWay() {
return teachWay == null ? "" : teachWay.trim(); return teachWay == null ? "" : teachWay;
} }
public void setTeachWay(String teachWay) { public void setTeachWay(String teachWay) {
this.teachWay = teachWay; this.teachWay = teachWay;
} }
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
public String getProjectCatalogName() { public String getProjectCatalogName() {
return projectCatalogName == null ? "" : projectCatalogName; return projectCatalogName == null ? "" : projectCatalogName;
} }

View File

@ -103,7 +103,7 @@ public interface IClassPlanService {
* @param obj * @param obj
* @return * @return
*/ */
void updateJson(JSONObject obj); void updateJson(JSONObject obj) throws Exception;
/** /**
* 修改 * 修改
@ -271,4 +271,10 @@ public interface IClassPlanService {
* @return * @return
*/ */
Map<String, Object> getSignUserCounts(Map<String, Object> params); Map<String, Object> getSignUserCounts(Map<String, Object> params);
/**
* 重新提交考试申请
* @param classPlanId
*/
void updateExamRecommit(String classPlanId);
} }

View File

@ -231,38 +231,111 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
} }
@Override @Override
public void updateJson(JSONObject obj) { public void updateJson(JSONObject obj) throws Exception{
String classPlanId = obj.getString("classPlanId"); String classPlanId = obj.getString("classPlanId");
ClassPlanVO classPlanVO = new ClassPlanVO(); ClassPlanVO classPlanVO = new ClassPlanVO();
classPlanVO.setClassPlanId(classPlanId); classPlanVO.setClassPlanId(classPlanId);
classPlanVO.setOrgId(obj.getString("orgId")); classPlanVO.setOrgId(obj.getString("orgId"));
classPlanVO.setPlanNumber(obj.getString("planNumber")); classPlanVO.setPlanNumber(obj.getString("planNumber"));
classPlanVO.setPlanName(obj.getString("planName")); classPlanVO.setPlanName(obj.getString("planName"));
classPlanVO.setPlanType(obj.getString("planType"));
classPlanVO.setProjectCatalogId(obj.getString("projectCatalogId")); classPlanVO.setProjectCatalogId(obj.getString("projectCatalogId"));
classPlanVO.setWorkerCatalog(obj.getString("workerCatalog")); classPlanVO.setWorkerCatalog(obj.getString("workerCatalog"));
classPlanVO.setPlanPersonNum(Integer.parseInt(obj.getString("planPersonNum")));
classPlanVO.setPlanStartTime(obj.getString("planStartTime")); classPlanVO.setPlanStartTime(obj.getString("planStartTime"));
classPlanVO.setPlanEndTime(obj.getString("planEndTime")); classPlanVO.setPlanEndTime(obj.getString("planEndTime"));
classPlanVO.setSignUpStartTime(obj.getString("signUpStartTime"));
classPlanVO.setSignUpEndTime(obj.getString("signUpEndTime"));
classPlanVO.setPlanAddress(obj.getString("planAddress")); classPlanVO.setPlanAddress(obj.getString("planAddress"));
classPlanVO.setChargePerson(obj.getString("chargePerson")); classPlanVO.setChargePerson(obj.getString("chargePerson"));
classPlanVO.setChargePersonTel(obj.getString("chargePersonTel")); classPlanVO.setChargePersonTel(obj.getString("chargePersonTel"));
classPlanVO.setReportType("0");
classPlanVO.setReportReason("");
Map<String, Object> params = HashMapUtil.beanToMap(classPlanVO); Map<String, Object> params = HashMapUtil.beanToMap(classPlanVO);
setUpdateInfo(params); setUpdateInfo(params);
classPlanDao.update(params); classPlanDao.update(params);
// 更新完成后修改审核状态
ExamCheckVO checkVO = new ExamCheckVO();
checkVO.setPlanId(classPlanId);
checkVO.setOrgId(obj.getString("orgId"));
checkVO.setWorkTypeId(obj.getString("workerCatalog"));
checkVO.setCheckStatus(0);
checkVO.setReason("");
examCheckService.updateByClassPlanId(classPlanId,checkVO);
String planStartTime = obj.getString("planStartTime");
String planEndTime = obj.getString("planEndTime");
// 删除历史课程信息
classPlanDao.deleteClassPlanLessons(params); classPlanDao.deleteClassPlanLessons(params);
//保存课程及讲师 // 删除该开班计划下所有讲师授课记录
classPlanDao.deleteTeacherLessonsTime(params);
// 处理开班时间日期转换为list
List<String> dayList = new ArrayList<>();
long daySub = DateUtil.getDaySub(planStartTime, planEndTime);
if(daySub == 0L){
dayList.add(planStartTime);
} else {
for(long i = 0; i <= daySub; i++){
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
Date startDate = sd.parse(planStartTime);
String formatDate = sd.format(startDate.getTime() + (i * 24 * 60 * 60 * 1000));
dayList.add(formatDate);
}
}
// 校验每一天课程是否冲突
JSONArray array = obj.getJSONArray("lessonList"); JSONArray array = obj.getJSONArray("lessonList");
params.clear(); Map<String, Object> query = getHashMap(8);
for(int i = 0; i < array.size(); i++){ for(int i = 0; i < array.size(); i++){
JSONObject item = array.getJSONObject(i); JSONObject item = array.getJSONObject(i);
String lessonStartTime = item.getString("lessonStartTime") + ":00";
String lessonEndTime = item.getString("lessonEndTime") + ":00";
// 查询当前教师信息
TeacherDTO teacherDTO = teacher.getById(item.getString("teacherId"));
query.clear();
query.put("teacherIdCard",teacherDTO.getIdCardNumber());
List<TeacherLessonsTimeDTO> tlList = teacher.listTeacherLessonsTime(query);
if(tlList != null && tlList.size() > 0){
for(String tempDate : dayList){
String sDateTime = tempDate + " " + lessonStartTime;
String eDateTime = tempDate + " " + lessonEndTime;
for(TeacherLessonsTimeDTO tlMap : tlList){
String ssDateTime = tlMap.getStartTime();
String eeDateTime = tlMap.getStartEnd();
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if(sd.parse(eDateTime).getTime() < sd.parse(ssDateTime).getTime()
|| sd.parse(sDateTime).getTime() > sd.parse(eeDateTime).getTime()){
//...没有发生冲突
} else {
throw new SaveException(""+teacherDTO.getTeacherName()+"】与其他课程安排时间冲突 "
+ ssDateTime + "" + eeDateTime + "");
}
}
params.put("classPlanId",classPlanId);
params.put("teacherId",teacherDTO.getTeacherId());
params.put("teacherIdCard", teacherDTO.getIdCardNumber());
params.put("orgId",teacherDTO.getOrgId());
params.put("projectCatalogId",obj.getString("projectCatalogId"));
params.put("workerCatalog",obj.getString("workerCatalog"));
params.put("lessonId",item.getString("lessonId"));
params.put("startTime",sDateTime);
params.put("endTime",eDateTime);
teacher.saveTeacherLessonsTime(params);
}
} else {
for(String tempDate : dayList){
String sDateTime = tempDate + " " + lessonStartTime;
String eDateTime = tempDate + " " + lessonEndTime;
params.put("classPlanId",classPlanId);
params.put("teacherId",teacherDTO.getTeacherId());
params.put("teacherIdCard", teacherDTO.getIdCardNumber());
params.put("orgId",teacherDTO.getOrgId());
params.put("projectCatalogId",obj.getString("projectCatalogId"));
params.put("workerCatalog",obj.getString("workerCatalog"));
params.put("lessonId",item.getString("lessonId"));
params.put("startTime",sDateTime);
params.put("endTime",eDateTime);
teacher.saveTeacherLessonsTime(params);
}
}
params.clear();
params.put("classPlanId",classPlanId); params.put("classPlanId",classPlanId);
params.put("lessonId",item.getString("lessonId")); params.put("lessonId",item.getString("lessonId"));
params.put("teacherId",item.getString("teacherId")); params.put("teacherId",item.getString("teacherId"));
params.put("lessonStart",item.getString("lessonStartTime"));
params.put("lessonEnd",item.getString("lessonEndTime"));
params.put("isDelete",item.getString("teacherId")); params.put("isDelete",item.getString("teacherId"));
classPlanDao.saveClassPlanLesson(params); classPlanDao.saveClassPlanLesson(params);
} }
@ -422,6 +495,7 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
} else { } else {
// 0待审核 1审核通过 2退回 // 0待审核 1审核通过 2退回
item.setExamType(examApplyDTO.getCheckStatus() + ""); item.setExamType(examApplyDTO.getCheckStatus() + "");
item.setExamReason(examApplyDTO.getReason());
} }
//查询报名人数 //查询报名人数
if(examCheck.getCheckStatus() == 2){ if(examCheck.getCheckStatus() == 2){
@ -523,6 +597,13 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
examApplyService.save(examApplyVO); examApplyService.save(examApplyVO);
} }
@Override
public void updateExamRecommit(String classPlanId) {
ExamApplyVO examApplyVO = new ExamApplyVO();
examApplyVO.setCheckStatus(0);
examApplyService.updateStatus(classPlanId,examApplyVO);
}
@Override @Override
public ClassPlanReportExamDTO getReportExamDetail(String classPlanId) { public ClassPlanReportExamDTO getReportExamDetail(String classPlanId) {
Map<String, Object> queryMap = getHashMap(8); Map<String, Object> queryMap = getHashMap(8);

View File

@ -438,7 +438,9 @@
SELECT SELECT
t1.class_plan_id classPlanId, t1.class_plan_id classPlanId,
t1.lesson_id lessonId, t1.lesson_id lessonId,
t1.teacher_id teacherId t1.teacher_id teacherId,
t1.lesson_start lessonStart,
t1.lesson_end lessonEnd
FROM FROM
e_class_plan_lesson t1 e_class_plan_lesson t1
WHERE WHERE
@ -453,4 +455,11 @@
class_plan_id = #{classPlanId} class_plan_id = #{classPlanId}
</update> </update>
<update id="deleteTeacherLessonsTime" parameterType="map">
UPDATE e_teach_lessons_time SET
is_delete = '1'
WHERE
class_plan_id = #{classPlanId}
</update>
</mapper> </mapper>

View File

@ -9,11 +9,6 @@
<result column="lesson_name" property="lessonName"/> <result column="lesson_name" property="lessonName"/>
<result column="lesson_type" property="lessonType"/> <result column="lesson_type" property="lessonType"/>
<result column="teach_way" property="teachWay"/> <result column="teach_way" property="teachWay"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap> </resultMap>
<resultMap id="lessonsBO" type="cn.com.tenlion.pojo.bos.lessons.LessonsBO"> <resultMap id="lessonsBO" type="cn.com.tenlion.pojo.bos.lessons.LessonsBO">

View File

@ -82,7 +82,8 @@
where :{ where :{
applyInstitutionId: orgId, applyInstitutionId: orgId,
applyWorkTypeId : workerCatalog, applyWorkTypeId : workerCatalog,
applyClassId : reportType == "2" ? classPlanId : '' applyClassId : reportType == "2" ? classPlanId : '',
applyAuditStates : '2'
}, },
toolbar: false, toolbar: false,
request: { request: {
@ -152,7 +153,7 @@
applyInstitutionId: orgId, applyInstitutionId: orgId,
applyWorkTypeId : workerCatalog, applyWorkTypeId : workerCatalog,
applyClassId : reportType == "2" ? classPlanId : '', applyClassId : reportType == "2" ? classPlanId : '',
applyAuditStates:$('#applyAuditStates').val(), applyAuditStates : '2',
}, },
page: { page: {
curr: currentPage curr: currentPage

View File

@ -152,7 +152,6 @@
} else { } else {
$('#totalSignUpUser').text('预计人数'); $('#totalSignUpUser').text('预计人数');
$('#totalSignUpUserNumber').text('50 人'); $('#totalSignUpUserNumber').text('50 人');
$('#class-plan-btn-event').show();
} }
}, function (code, data) { }, function (code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);

View File

@ -115,16 +115,16 @@
return dom; return dom;
} }
if(row['reportType'] === '2' && row['examType'] === '2' ){ if(row['reportType'] === '2' && row['examType'] === '2' ){
dom += '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs">考试申请不通过</a>'; dom += '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs">考试申请驳回</a>';
return dom; return dom;
} }
if(row['reportType'] === '3'){ if(row['reportType'] === '3'){
return '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="unPassEvent">开班不通过</a>'; return '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs">开班不通过</a>';
} }
return dom; return dom;
} }
}, },
{width:120, title: '操作', fixed: 'left', align:'center', {width:160, title: '操作', fixed: 'left', align:'center',
templet: function(row) { templet: function(row) {
var dom = ''; var dom = '';
if(row['reportType'] === '0'){ if(row['reportType'] === '0'){
@ -132,23 +132,25 @@
return dom; return dom;
} }
if(row['reportType'] === '2' && row['examType'] === ''){ if(row['reportType'] === '2' && row['examType'] === ''){
dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="showEvent">查看详情</a>';
dom += '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs" lay-event="examReportEvent">申请考试</a>'; dom += '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs" lay-event="examReportEvent">申请考试</a>';
return dom; return dom;
} }
if(row['reportType'] === '2' && row['examType'] === '0'){ if(row['reportType'] === '2' && row['examType'] === '0'){
dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="showExamEvent">查看申请</a>'; dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="showEvent">查看详情</a>';
return dom; return dom;
} }
if(row['reportType'] === '2' && row['examType'] === '1'){ if(row['reportType'] === '2' && row['examType'] === '1'){
dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="showExamEvent">查看考试安排</a>'; dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="showExamEvent">查看考试安排</a>';
return dom; return dom;
} }
if(row['reportType'] === '2' && row['examType'] === '1'){ if(row['reportType'] === '2' && row['examType'] === '2'){
dom += '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="reExamEvent">再次申请考试</a>'; dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="showReasonEvent">查看原因</a>';
dom += '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="reExamEvent">重新申考</a>';
return dom; return dom;
} }
if(row['reportType'] === '3'){ if(row['reportType'] === '3'){
return '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="unPassEvent">重新审核</a>'; return '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="unPassEvent">重新编辑</a>';
} }
return dom; return dom;
} }
@ -283,29 +285,6 @@
}); });
} }
// 删除
function removeData(ids) {
top.dialog.msg(top.dataMessage.delete, {
time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
var layIndex;
top.restAjax.delete(top.restAjax.path('api/classplan/remove/{ids}', [ids]), {}, null, function (code, data) {
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
reloadTable();
}, function (code, data) {
top.dialog.msg(data.msg);
}, function () {
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
}, function () {
top.dialog.close(layIndex);
});
}
});
}
// 事件 - 页面变化 // 事件 - 页面变化
$win.on('resize', function() { $win.on('resize', function() {
clearTimeout(resizeTimeout); clearTimeout(resizeTimeout);
@ -369,7 +348,7 @@
if(layEvent == 'showEvent') { if(layEvent == 'showEvent') {
layer.open({ layer.open({
type: 2, type: 2,
title: '查看开班申请', title: '查看 【' + obj.data.workerCatalogName + '】 开班申请',
closeBtn: 1, closeBtn: 1,
area: ['90%', '90%'], area: ['90%', '90%'],
shadeClose: false, shadeClose: false,
@ -380,6 +359,21 @@
} }
}); });
} }
if(layEvent == 'showReasonEvent') {
var reason = obj.data.examReason == '' ? '未填写原因' : obj.data.examReason;
layer.open({
type: 1,
title: '申请不通过原因',
closeBtn: 1,
offset:'200px',
area: ['300px', '150px'],
shadeClose: false,
content: '<div style="padding: 20px 50px;">'+ reason +'</div>',
end: function () {
reloadTable();
}
});
}
if(layEvent == 'showExamEvent') { if(layEvent == 'showExamEvent') {
layer.open({ layer.open({
type: 2, type: 2,
@ -397,10 +391,10 @@
if(layEvent == 'unPassEvent') { if(layEvent == 'unPassEvent') {
layer.open({ layer.open({
type: 2, type: 2,
title: false, title: '重新编辑 【' +obj.data.workerCatalogName + '】 开班申请',
closeBtn: 0, closeBtn: 1,
area: ['100%', '100%'], area: ['90%', '90%'],
shadeClose: true, shadeClose: false,
anim: 2, anim: 2,
content: top.restAjax.path('route/classplan/update.html?classPlanId={classPlanId}', [obj.data.classPlanId]), content: top.restAjax.path('route/classplan/update.html?classPlanId={classPlanId}', [obj.data.classPlanId]),
end: function () { end: function () {

View File

@ -19,7 +19,7 @@
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md6"> <div class="layui-col-md6">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span></label> <label class="layui-form-label"><span style="color: red">*</span></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="planNumber" name="planNumber" class="layui-input" value="" <input type="text" id="planNumber" name="planNumber" class="layui-input" value=""
autocomplete="off" placeholder="班次不可重复" lay-verify="required" maxlength="100"> autocomplete="off" placeholder="班次不可重复" lay-verify="required" maxlength="100">
@ -147,12 +147,12 @@
<div class="test-table-reload-btn"> <div class="test-table-reload-btn">
<div class="layui-inline"> <div class="layui-inline">
<input type="text" id="date-start-{{item.lessonId}}" class="layui-input search-item lessons-date" <input type="text" id="date-start-{{item.lessonId}}" class="layui-input search-item lessons-date"
style="width: 150px" placeholder="上午" readonly> style="width: 150px" placeholder="开始时间" readonly>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<input type="text" id="date-end-{{item.lessonId}}" class="layui-input search-item lessons-date" <input type="text" id="date-end-{{item.lessonId}}" class="layui-input search-item lessons-date"
style="width: 150px" placeholder="下午" readonly> style="width: 150px" placeholder="结束时间" readonly>
</div> </div>
</div> </div>
</td> </td>
@ -417,7 +417,6 @@
var obj = {}; var obj = {};
obj['lessonId'] = $(e).attr('data-lesson-id'); obj['lessonId'] = $(e).attr('data-lesson-id');
obj['teacherId'] = $('#select-' + obj['lessonId']).val(); obj['teacherId'] = $('#select-' + obj['lessonId']).val();
obj['teacherId'] = $('#select-' + obj['lessonId']).val();
obj['lessonStartTime'] = $('#date-start-' + obj['lessonId']).val(); obj['lessonStartTime'] = $('#date-start-' + obj['lessonId']).val();
obj['lessonEndTime'] = $('#date-end-' + obj['lessonId']).val(); obj['lessonEndTime'] = $('#date-end-' + obj['lessonId']).val();
lessonList.push(obj); lessonList.push(obj);

View File

@ -12,30 +12,27 @@
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css"> <link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</head> </head>
<body> <body>
<div class="layui-fluid layui-anim layui-anim-fadein"> <div class="layui-anim layui-anim-fadein">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header">
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
<a href="javascript:void(0);"><cite>查看内容</cite></a>
</span>
</div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md6"> <div class="layui-col-md6">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">班号</label> <label class="layui-form-label"><span style="color: red">*</span>班号</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="planNumber" name="planNumber" class="layui-input" value="" readonly="readonly" maxlength="100"> <input type="text" id="planNumber" name="planNumber" class="layui-input" value="" readonly="readonly" maxlength="100">
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-md6"> </div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">班级名称</label> <label class="layui-form-label"><span style="color: red">*</span>班级名称</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="planName" name="planName" class="layui-input" value="" readonly="readonly" maxlength="255"> <input type="text" id="planName" name="planName" class="layui-input" value=""
autocomplete="off" placeholder="请输入班级名称" lay-verify="required" maxlength="255">
</div> </div>
</div> </div>
</div> </div>
@ -43,39 +40,27 @@
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md3"> <div class="layui-col-md3">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">培训类型</label> <label class="layui-form-label"><span style="color: red">*</span>培训类型</label>
<div class="layui-input-block"> <div class="layui-input-block">
<select id="planType" name="planType" readonly="readonly"> <select id="planType" name="planType" readonly="readonly">
<option value="1">初训</option> <option value="1">初训</option>
<option value="2">复训</option> <option value="2">复训</option>
<option value="3">换证</option>
</select> </select>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-md3"> <div class="layui-col-md3">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">培训项目</label> <label class="layui-form-label"><span style="color: red">*</span>培训项目</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="projectCatalogId" name="projectCatalogId" value=""> <input type="hidden" id="projectCatalogId" name="projectCatalogId" value="">
<input type="text" id="projectCatalogName" name="projectCatalogName" class="layui-input" value="" style="cursor: pointer;" readonly="readonly"> <input type="text" id="projectCatalogName" name="projectCatalogName" class="layui-input" value="" style="cursor: pointer;" lay-verify="required" placeholder="请选择培训项目" readonly="readonly">
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-md3"> <div class="layui-col-md3">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">培训工种</label> <label class="layui-form-label"><span style="color: red">*</span>开始时间</label>
<div class="layui-input-block">
<input type="hidden" id="workerCatalog" name="workerCatalog" value="">
<input type="text" id="workerCatalogName" name="workerCatalogName" class="layui-input" value="" style="cursor: pointer;" readonly="readonly">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md3">
<div class="layui-form-item">
<label class="layui-form-label">开始时间</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="planStartTime" name="planStartTime" class="layui-input" value="" placeholder="请选择培训开始时间" readonly style="cursor: pointer;" lay-verify="required"> <input type="text" id="planStartTime" name="planStartTime" class="layui-input" value="" placeholder="请选择培训开始时间" readonly style="cursor: pointer;" lay-verify="required">
</div> </div>
@ -83,7 +68,7 @@
</div> </div>
<div class="layui-col-md3"> <div class="layui-col-md3">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">结束时间</label> <label class="layui-form-label"><span style="color: red">*</span>结束时间</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="planEndTime" name="planEndTime" class="layui-input" value="" placeholder="请选择培训结束时间" readonly style="cursor: pointer;" lay-verify="required"> <input type="text" id="planEndTime" name="planEndTime" class="layui-input" value="" placeholder="请选择培训结束时间" readonly style="cursor: pointer;" lay-verify="required">
</div> </div>
@ -93,17 +78,19 @@
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md6"> <div class="layui-col-md6">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">负责人</label> <label class="layui-form-label"><span style="color: red">*</span>负责人</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="chargePerson" name="chargePerson" class="layui-input" value="" readonly="readonly" maxlength="50"> <input type="text" id="chargePerson" name="chargePerson" class="layui-input" value=""
autocomplete="off" placeholder="请输入负责人" lay-verify="required" maxlength="50">
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-md6"> <div class="layui-col-md6">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">联系方式</label> <label class="layui-form-label"><span style="color: red">*</span>联系方式</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="chargePersonTel" name="chargePersonTel" class="layui-input" value="" readonly="readonly" maxlength="255"> <input type="text" id="chargePersonTel" name="chargePersonTel" class="layui-input" value=""
autocomplete="off" placeholder="请输入联系方式" lay-verify="required" maxlength="255">
</div> </div>
</div> </div>
@ -112,9 +99,10 @@
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">培训地点</label> <label class="layui-form-label"><span style="color: red">*</span>培训地点</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="planAddress" name="planAddress" class="layui-input" value="" readonly="readonly" maxlength="255"> <input type="text" id="planAddress" name="planAddress" class="layui-input" value=""
autocomplete="off" placeholder="请输入培训地点" lay-verify="required" maxlength="255">
</div> </div>
</div> </div>
</div> </div>
@ -125,7 +113,8 @@
<thead> <thead>
<tr> <tr>
<th style="width: 50px; text-align: center"><b>确认课程</b></th> <th style="width: 50px; text-align: center"><b>确认课程</b></th>
<th style="width: 200px; text-align: center"><b>选择讲师</b></th> <th style="width: 100px; text-align: center"><b>选择讲师</b></th>
<th style="width: 200px; text-align: center"><b>授课时间</b></th>
<th style="width: 260px; text-align: center"><b>课程名称</b></th> <th style="width: 260px; text-align: center"><b>课程名称</b></th>
<th style="width: 100px; text-align: center"><b>课程类型</b></th> <th style="width: 100px; text-align: center"><b>课程类型</b></th>
<th style="width: 100px; text-align: center"><b>授课方式</b></th> <th style="width: 100px; text-align: center"><b>授课方式</b></th>
@ -146,6 +135,19 @@
{{# } }} {{# } }}
</select> </select>
</td> </td>
<td>
<div class="test-table-reload-btn">
<div class="layui-inline">
<input type="text" id="date-start-{{item.lessonId}}" value="" class="layui-input search-item lessons-date"
style="width: 150px" placeholder="开始时间" readonly>
</div>
<div class="layui-inline">
<input type="text" id="date-end-{{item.lessonId}}" value="" class="layui-input search-item lessons-date"
style="width: 150px" placeholder="结束时间" readonly>
</div>
</div>
</td>
<td style="text-align: center"> <td style="text-align: center">
{{item.lessonName}} {{item.lessonName}}
</td> </td>
@ -195,6 +197,7 @@
// 初始化内容 // 初始化内容
function initData() { function initData() {
$('.layui-card').height($win.height());
var loadLayerIndex; var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/classplan/get/{classPlanId}', [classPlanId]), {}, null, function(code, data) { top.restAjax.get(top.restAjax.path('api/classplan/get/{classPlanId}', [classPlanId]), {}, null, function(code, data) {
var dataFormData = {}; var dataFormData = {};
@ -266,6 +269,8 @@
$(checkBox).attr('checked', 'checked'); $(checkBox).attr('checked', 'checked');
$('#select-' + e.lessonId).val(e.teacherId); $('#select-' + e.lessonId).val(e.teacherId);
$('#select-' + e.lessonId).attr("disabled","disabled"); $('#select-' + e.lessonId).attr("disabled","disabled");
$('#date-start-' + e.lessonId).val(e.lessonStart);
$('#date-end-' + e.lessonId).val(e.lessonEnd);
}); });
form.render(); form.render();
} }

View File

@ -12,40 +12,28 @@
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css"> <link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</head> </head>
<body> <body>
<div class="layui-fluid layui-anim layui-anim-fadein"> <div class="layui-anim layui-anim-fadein">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header">
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
<a href="javascript:void(0);"><cite>修改计划</cite></a>
</span>
</div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<blockquote id="report-reason-block" class="layui-elem-quote" style="border-left: 5px solid #cc0200;display: none;"></blockquote> <blockquote id="report-reason-block" class="layui-elem-quote" style="border-left: 5px solid #cc0200;display: none;"></blockquote>
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<input type="hidden" id="orgId" name="orgId" value="">
<input type="hidden" id="workerCatalog" name="workerCatalog" value="">
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md6"> <div class="layui-col-md6">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>培训机构</label> <label class="layui-form-label"><span style="color: red">*</span>班号</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="orgId" name="orgId"> <input type="text" id="planNumber" name="planNumber" class="layui-input" value=""
<input type="text" id="orgName" name="orgName" class="layui-input" value="" readonly="readonly" maxlength="100"> autocomplete="off" readonly="readonly" lay-verify="required" maxlength="100">
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>计划编号</label>
<div class="layui-input-block">
<input type="text" id="planNumber" name="planNumber" class="layui-input" value="" readonly="readonly" maxlength="100">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md6"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>计划名称</label> <label class="layui-form-label"><span style="color: red">*</span>班级名称</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="planName" name="planName" class="layui-input" value="" placeholder="请输入培训计划名称" lay-verify="required" maxlength="255"> <input type="text" id="planName" name="planName" class="layui-input" value="" placeholder="请输入培训计划名称" lay-verify="required" maxlength="255">
</div> </div>
@ -57,10 +45,9 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>培训类型</label> <label class="layui-form-label"><span style="color: red">*</span>培训类型</label>
<div class="layui-input-block"> <div class="layui-input-block">
<select id="planType" name="planType" lay-verify="required"> <select id="planType" name="planType">
<option value="1">初训</option> <option value="1">初训</option>
<option value="2">复训</option> <option value="2">复训</option>
<option value="3">换证</option>
</select> </select>
</div> </div>
</div> </div>
@ -70,58 +57,23 @@
<label class="layui-form-label"><span style="color: red">*</span>培训项目</label> <label class="layui-form-label"><span style="color: red">*</span>培训项目</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="projectCatalogId" name="projectCatalogId" value=""> <input type="hidden" id="projectCatalogId" name="projectCatalogId" value="">
<input type="text" id="projectCatalogName" name="projectCatalogName" class="layui-input" value="" style="cursor: pointer;" placeholder="请选择培训项目" lay-verify="required" readonly="readonly"> <input type="text" id="projectCatalogName" name="projectCatalogName" class="layui-input" value="" style="cursor: pointer;" lay-verify="required" placeholder="请选择培训项目" readonly="readonly">
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-md3"> <div class="layui-col-md3">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>培训工种</label> <label class="layui-form-label"><span style="color: red">*</span>开班时间</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="workerCatalog" name="workerCatalog" value=""> <input type="text" id="planStartTime" name="planStartTime" class="layui-input" value="" placeholder="请选择开班时间" readonly style="cursor: pointer;" lay-verify="required">
<input type="text" id="workerCatalogName" name="workerCatalogName" class="layui-input" value="" style="cursor: pointer;" placeholder="请选择培训工种" lay-verify="required" readonly="readonly">
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-md3"> <div class="layui-col-md3">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>计划人数</label> <label class="layui-form-label"><span style="color: red">*</span>结课时间</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="number" id="planPersonNum" name="planPersonNum" class="layui-input" value="0" placeholder="请输入计划人数" lay-verify="checkPlanPersonNum"> <input type="text" id="planEndTime" name="planEndTime" class="layui-input" value="" placeholder="请选择结课时间" readonly style="cursor: pointer;" lay-verify="required">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md3">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>开始时间</label>
<div class="layui-input-block">
<input type="text" id="planStartTime" name="planStartTime" class="layui-input" value="" placeholder="请选择培训开始时间" readonly style="cursor: pointer;" lay-verify="required">
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>结束时间</label>
<div class="layui-input-block">
<input type="text" id="planEndTime" name="planEndTime" class="layui-input" value="" placeholder="请选择培训结束时间" readonly style="cursor: pointer;" lay-verify="required">
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>报名时间</label>
<div class="layui-input-block">
<input type="text" id="signUpStartTime" name="signUpStartTime" class="layui-input" value="" placeholder="请选择报名时间开始" readonly style="cursor: pointer;" lay-verify="required">
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>报名截止</label>
<div class="layui-input-block">
<input type="text" id="signUpEndTime" name="signUpEndTime" class="layui-input" value="" placeholder="请选择报名时间截止" readonly style="cursor: pointer;" lay-verify="required">
</div> </div>
</div> </div>
</div> </div>
@ -159,13 +111,14 @@
<div class="layui-col-md12"> <div class="layui-col-md12">
<table class="layui-table" id="dataTable" lay-filter="dataTable"> <table class="layui-table" id="dataTable" lay-filter="dataTable">
<thead> <thead>
<tr> <tr>
<th style="width: 50px; text-align: center"><b>确认课程</b></th> <th style="width: 50px; text-align: center"><b>确认课程</b></th>
<th style="width: 200px; text-align: center"><b>选择讲师</b></th> <th style="width: 100px; text-align: center"><b>选择讲师</b></th>
<th style="width: 260px; text-align: center"><b>课程名称</b></th> <th style="width: 200px; text-align: center"><b>授课时间</b></th>
<th style="width: 100px; text-align: center"><b>课程类型</b></th> <th style="width: 260px; text-align: center"><b>课程名称</b></th>
<th style="width: 100px; text-align: center"><b>授课方式</b></th> <th style="width: 100px; text-align: center"><b>课程类型</b></th>
</tr> <th style="width: 100px; text-align: center"><b>授课方式</b></th>
</tr>
</thead> </thead>
<tbody id="lessonTbodyBox"></tbody> <tbody id="lessonTbodyBox"></tbody>
<script type="text/html" id="lessonTbodyTemplate"> <script type="text/html" id="lessonTbodyTemplate">
@ -182,6 +135,19 @@
{{# } }} {{# } }}
</select> </select>
</td> </td>
<td>
<div class="test-table-reload-btn">
<div class="layui-inline">
<input type="text" id="date-start-{{item.lessonId}}" class="layui-input search-item lessons-date"
style="width: 150px" placeholder="开始时间" readonly>
</div>
<div class="layui-inline">
<input type="text" id="date-end-{{item.lessonId}}" class="layui-input search-item lessons-date"
style="width: 150px" placeholder="结束时间" readonly>
</div>
</div>
</td>
<td style="text-align: center"> <td style="text-align: center">
{{item.lessonName}} {{item.lessonName}}
</td> </td>
@ -239,6 +205,7 @@
// 初始化内容 // 初始化内容
function initData() { function initData() {
$('.layui-card').height($win.height());
var loadLayerIndex; var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/classplan/get/{classPlanId}', [classPlanId]), {}, null, function(code, data) { top.restAjax.get(top.restAjax.path('api/classplan/get/{classPlanId}', [classPlanId]), {}, null, function(code, data) {
var dataFormData = {}; var dataFormData = {};
@ -252,7 +219,7 @@
form.val('dataForm', dataFormData); form.val('dataForm', dataFormData);
form.render(null, 'dataForm'); form.render(null, 'dataForm');
if(dataFormData['reportReason'] != ''){ if(dataFormData['reportReason'] != ''){
$('#report-reason-block').text('报备未通过原因:' + dataFormData['reportReason']); $('#report-reason-block').text('未通过原因:' + dataFormData['reportReason']);
$('#report-reason-block').show(); $('#report-reason-block').show();
} }
initPlanStartTimeDateTime(); initPlanStartTimeDateTime();
@ -315,25 +282,84 @@
$(checkBox).attr('checked', 'checked'); $(checkBox).attr('checked', 'checked');
$('#select-' + e.lessonId).val(e.teacherId); $('#select-' + e.lessonId).val(e.teacherId);
$('#select-' + e.lessonId).attr("disabled","disabled"); $('#select-' + e.lessonId).attr("disabled","disabled");
$('#date-start-' + e.lessonId).val(e.lessonStart);
$('#date-start-' + e.lessonId).attr("disabled","disabled");
$('#date-end-' + e.lessonId).val(e.lessonEnd);
$('#date-end-' + e.lessonId).attr("disabled","disabled");
}); });
form.render(); form.render();
$.each($('.lessons-date'),function(){
var _this = this;
laydate.render({
format : 'HH:mm',
elem: _this,
type: 'time',
trigger: 'click',
min: '08:00:00',
max: '21:00:00'
});
});
} }
form.on('checkbox(lessonCheckBox)',function(data){ form.on('checkbox(lessonCheckBox)',function(data){
var lessonId = $(data.elem).attr('data-lesson-id'); var lessonId = $(data.elem).attr('data-lesson-id');
var teacherId = $('#select-' + lessonId).val(); var teacherId = $('#select-' + lessonId).val();
if(data.elem.checked == false){ var dateStartTime = $('#date-start-' + lessonId).val();
$('#select-' + lessonId).removeAttr("disabled"); var dateEndTime = $('#date-end-' + lessonId).val();
form.render();
return;
}
if(teacherId == ''){ if(teacherId == ''){
data.elem.checked = false; data.elem.checked = false;
form.render(); form.render();
layer.msg('先选择讲师'); layer.msg('先选择讲师');
return; return;
} }
if(dateStartTime == '' || dateEndTime == ''){
data.elem.checked = false;
$('#date-start-' + lessonId).removeAttr("disabled");
$('#date-end-' + lessonId).removeAttr("disabled");
form.render();
layer.msg('授课时间存在空值');
return;
}
dateStartTime = '1970-12-12 ' + dateStartTime + ':00';
dateEndTime = '1970-12-12 ' + dateEndTime + ':00';
if(verifyDate(dateStartTime,dateEndTime) != -1){
data.elem.checked = false;
$('#date-start-' + lessonId).removeAttr("disabled");
$('#date-end-' + lessonId).removeAttr("disabled");
form.render();
layer.msg('授课起止时间冲突');
return;
}
//校验所有时间是否合法
var checkedList = $('input[name="lessonCheckBox"]:checked');
var checkPass = true;
if((checkedList.length -1) != 0){
$.each(checkedList,function(i,e){
var tempLessonId = $(e).attr('data-lesson-id');
var tempTeacherId = $('#select-' + tempLessonId).val();
var _tempStart = '1970-12-12 ' + $('#date-start-' + tempLessonId).val() + ':00';
var _tempEnd = '1970-12-12 ' + $('#date-end-' + tempLessonId).val() + ':00';
if((verifyDate(dateEndTime, _tempStart) == -1)
|| (verifyDate(dateStartTime, _tempEnd) == 1)){
checkPass = true;
} else if( tempLessonId != lessonId && tempTeacherId == teacherId){
data.elem.checked = false;
layer.msg('课程时间存在冲突');
form.render();
return;
}
});
}
if(data.elem.checked == false){
$('#select-' + lessonId).removeAttr("disabled");
$('#date-start-' + lessonId).removeAttr("disabled");
$('#date-end-' + lessonId).removeAttr("disabled");
form.render();
return;
}
$('#select-' + lessonId).attr("disabled","disabled"); $('#select-' + lessonId).attr("disabled","disabled");
$('#date-start-' + lessonId).attr("disabled","disabled");
$('#date-end-' + lessonId).attr("disabled","disabled");
form.render(); form.render();
}); });
@ -425,6 +451,8 @@
var obj = {}; var obj = {};
obj['lessonId'] = $(e).attr('data-lesson-id'); obj['lessonId'] = $(e).attr('data-lesson-id');
obj['teacherId'] = $('#select-' + obj['lessonId']).val(); obj['teacherId'] = $('#select-' + obj['lessonId']).val();
obj['lessonStartTime'] = $('#date-start-' + obj['lessonId']).val();
obj['lessonEndTime'] = $('#date-end-' + obj['lessonId']).val();
lessonList.push(obj); lessonList.push(obj);
}); });
if(lessonList.length == 0){ if(lessonList.length == 0){
@ -442,7 +470,7 @@
shade: 0.3, shade: 0.3,
yes: function(index) { yes: function(index) {
top.dialog.close(index); top.dialog.close(index);
window.location.reload(); closeBox();
}, },
btn2: function() { btn2: function() {
closeBox(); closeBox();
@ -467,6 +495,20 @@
closeBox(); closeBox();
}); });
function verifyDate(value1,value2){
var v1 = new Date(Date.parse(value1.replace(/-/g,"/"))).getTime();
var v2 = new Date(Date.parse(value2.replace(/-/g,"/"))).getTime();
if( v1 < v2){
return -1;
}
if( v1 == v2){
return 0;
}
if( v1 > v2){
return 1;
}
}
// 校验 // 校验
form.verify({ form.verify({
checkPlanPersonNum : function(value){ checkPlanPersonNum : function(value){