|
|
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
var form = layui.form;
|
|
|
var laydate = layui.laydate;
|
|
|
var table = layui.table;
|
|
|
var teacherOpenCourseStudentSigninSettingTable = null;
|
|
|
var view ={
|
|
|
init:function(){
|
|
|
var that = this
|
|
|
this.initTable();
|
|
|
this.initSearchForm();
|
|
|
this.initToolBar();
|
|
|
window.dataReload = function(){
|
|
|
Lib.doSearchForm($("#searchForm"),teacherOpenCourseStudentSigninSettingTable)
|
|
|
that.initToolBar();
|
|
|
}
|
|
|
},
|
|
|
initTable:function(){
|
|
|
var sx_ = localStorage.getItem("teacherOpenCourseStudentSigninSettingTable_field_"+Common.userInfoId); //筛选值显示、隐藏缓存
|
|
|
if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);}
|
|
|
teacherOpenCourseStudentSigninSettingTable = table.render({
|
|
|
elem : '#teacherOpenCourseStudentSigninSettingTable',
|
|
|
height : Lib.getTableHeight(1),
|
|
|
cellMinWidth: 100,
|
|
|
method : 'post',
|
|
|
url : Common.ctxPath + '/jlw/teacherOpenCourseStudentSigninSetting/list.json' // 数据接口
|
|
|
,page : Lib.tablePage // 开启分页
|
|
|
/*,toolbar: '#toolbar_teacherOpenCourseStudentSigninSetting' //自定义头部左侧工具栏
|
|
|
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏*/
|
|
|
,limit : 10,
|
|
|
cols : [ [ // 表头
|
|
|
{
|
|
|
type : 'numbers',
|
|
|
title : '序号',
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingStartTime',
|
|
|
title : '签到日期',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingStartTime'])?false:sx_['teacherOpenCourseStudentSigninSettingStartTime'],
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingTypeText', //数据字典类型为 student_signin_type
|
|
|
title : '签到方式',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingTypeText'])?false:sx_['teacherOpenCourseStudentSigninSettingTypeText'],
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingSessionTime',
|
|
|
title : '签到人数',
|
|
|
align:"center",
|
|
|
templet:function (d) {
|
|
|
return '33'
|
|
|
}
|
|
|
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingSessionTime',
|
|
|
title : '缺勤',
|
|
|
align:"center",
|
|
|
templet:function (d) {
|
|
|
return '1'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingSessionTime',
|
|
|
title : '总人数',
|
|
|
align:"center",
|
|
|
templet:function (d) {
|
|
|
return '34'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingSessionTime',
|
|
|
title : '到课率',
|
|
|
align:"center",
|
|
|
templet:function (d) {
|
|
|
var html = '签到人数/总人数*100%';
|
|
|
return '90%'
|
|
|
}
|
|
|
},
|
|
|
/*{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingId',
|
|
|
title : 'ID',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingId'])?false:sx_['teacherOpenCourseStudentSigninSettingId'],
|
|
|
width : 60,
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingSessionTime',
|
|
|
title : '场次时间',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingSessionTime'])?false:sx_['teacherOpenCourseStudentSigninSettingSessionTime'],
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseIdText', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
|
|
|
title : '开课ID',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseIdText'])?false:sx_['teacherOpenCourseIdText'],
|
|
|
},
|
|
|
{
|
|
|
field : 'schoolClassIdsText', //数据字典类型为 school_class.class_name.class_status=1
|
|
|
title : '班级ID集合',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['schoolClassIdsText'])?false:sx_['schoolClassIdsText'],
|
|
|
},
|
|
|
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingValue',
|
|
|
title : '设置的值:数据例子:IP: x.x.x.x-x.x.x.x,验证码:xxxx,手动签到:无需设置',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingValue'])?false:sx_['teacherOpenCourseStudentSigninSettingValue'],
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingStartTime',
|
|
|
title : '签到开始日期',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingStartTime'])?false:sx_['teacherOpenCourseStudentSigninSettingStartTime'],
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingEndTime',
|
|
|
title : '签到结束日期',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingEndTime'])?false:sx_['teacherOpenCourseStudentSigninSettingEndTime'],
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingAddTime',
|
|
|
title : '创建时间',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingAddTime'])?false:sx_['teacherOpenCourseStudentSigninSettingAddTime'],
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingStatusText', //数据字典类型为 global_status
|
|
|
title : '状态 1正常 2删除',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingStatusText'])?false:sx_['teacherOpenCourseStudentSigninSettingStatusText'],
|
|
|
},
|
|
|
{
|
|
|
field : 'teacherOpenCourseStudentSigninSettingStartStatusText', //枚举类型 StartStatusEnum
|
|
|
title : '开始状态',
|
|
|
align:"center",
|
|
|
hideField :false,
|
|
|
hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingStartStatusText'])?false:sx_['teacherOpenCourseStudentSigninSettingStartStatusText'],
|
|
|
},*/
|
|
|
{
|
|
|
field : 'operation_',title : '操作',align:"center", width : 180, templet: function (d) {
|
|
|
var htm = '';
|
|
|
/*htm += '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="startSignin">开始签到</button>';
|
|
|
htm += '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="endSignin">结束签到</button>';*/
|
|
|
htm += '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">详情</button>';
|
|
|
return htm;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
] ]
|
|
|
|
|
|
});
|
|
|
|
|
|
table.on('checkbox(teacherOpenCourseStudentSigninSettingTable)', function(obj){
|
|
|
var teacherOpenCourseStudentSigninSetting = obj.data;
|
|
|
if(obj.checked){
|
|
|
//按钮逻辑Lib.buttonEnable()
|
|
|
}else{
|
|
|
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
initSearchForm:function(){
|
|
|
Lib.initSearchForm( $("#searchForm"),teacherOpenCourseStudentSigninSettingTable,form);
|
|
|
},
|
|
|
|
|
|
initToolBar:function(){
|
|
|
toolbar = {
|
|
|
add: function () {
|
|
|
var url = "/jlw/teacherOpenCourseStudentSigninSetting/add.do";
|
|
|
Common.openDlg(url,"学生签到设置管理>新增");
|
|
|
},
|
|
|
edit: function () {
|
|
|
var data = Common.getOneFromTable(table,"teacherOpenCourseStudentSigninSettingTable");
|
|
|
if(data==null){
|
|
|
return ;
|
|
|
}
|
|
|
var url = "/jlw/teacherOpenCourseStudentSigninSetting/add.do?teacherOpenCourseStudentSigninSettingId=";
|
|
|
Common.openDlg(url,"学生签到设置管理>"+data.teacherOpenCourseStudentSigninSettingId+">编辑");
|
|
|
},
|
|
|
del: function () {
|
|
|
layui.use(['del'], function(){
|
|
|
var delView = layui.del
|
|
|
delView.delBatch();
|
|
|
});
|
|
|
},
|
|
|
search: function () {
|
|
|
Lib.doSearchForm($("#searchForm"), teacherOpenCourseStudentSigninSettingTable, 1);
|
|
|
view.initToolBar()
|
|
|
},
|
|
|
refresh: function () {
|
|
|
searchForm.reset();
|
|
|
Lib.doSearchForm($("#searchForm"), teacherOpenCourseStudentSigninSettingTable, 1);
|
|
|
view.initToolBar()
|
|
|
},
|
|
|
addButton_cancel:function () {
|
|
|
parent.Lib.tableRefresh();
|
|
|
Lib.closeFrame();
|
|
|
},
|
|
|
export:function () {
|
|
|
/*var formPara = form.serializeJson();
|
|
|
Common.downLoad("/jlw/teacherOpenCourseMergeScheduleSession/excel/export.json", formPara, 'POST')
|
|
|
*/
|
|
|
layer.confirm('是否确定导出签到汇总表吗?', function (index) {
|
|
|
window.open(Common.ctxPath + "");
|
|
|
layer.close(index);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
//触发事件
|
|
|
$('.ext-toolbar').on('click', function() {
|
|
|
var type = $(this).data('type');
|
|
|
toolbar[type] ? toolbar[type].call(this) : '';
|
|
|
});
|
|
|
|
|
|
}, initTableTool: table.on('tool(teacherOpenCourseStudentSigninSettingTable)', function (obj) {
|
|
|
var data = obj.data;
|
|
|
if (obj.event === 'edit') {
|
|
|
var url = "/jlw/teacherOpenCourseStudentSigninLog/index.do";
|
|
|
Common.openDlg(url,"/详情");
|
|
|
}else if(obj.event === "del"){
|
|
|
layer.confirm('是否确定删除该信息?', function (index) {
|
|
|
var ret = Common.postAjax("/jlw/teacherOpenCourseStudentSigninSetting/delete.json",{ids:data.teacherOpenCourseStudentSigninSettingId});
|
|
|
layer.msg(ret.code == 0?"删除成功!":ret.msg, {
|
|
|
offset: ['50%'],
|
|
|
icon: ret.code == 0?1:2,
|
|
|
time: 1500 //2秒关闭(如果不配置,默认是3秒)
|
|
|
},function (){
|
|
|
if(ret.code == 0){
|
|
|
Lib.tableRefresh();
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
// 开始签到
|
|
|
else if(obj.event == 'startSignin') {
|
|
|
layer.confirm('开始签到?', function (index) {
|
|
|
var ret = Common.postAjax(
|
|
|
"/jlw/teacherOpenCourseStudentSigninSetting/updateStatus.json",
|
|
|
{ status: 1, id: data.teacherOpenCourseStudentSigninSettingId });
|
|
|
layer.msg(ret.code == 0?"开始签到成功!":ret.msg, {
|
|
|
offset: ['50%'],
|
|
|
icon: ret.code == 0?1:2,
|
|
|
time: 1500 //2秒关闭(如果不配置,默认是3秒)
|
|
|
},function (){
|
|
|
if(ret.code == 0){
|
|
|
Lib.tableRefresh();
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
// 结束签到
|
|
|
else if(obj.event == 'endSignin') {
|
|
|
layer.confirm('结束签到?', function (index) {
|
|
|
var ret = Common.postAjax(
|
|
|
"/jlw/teacherOpenCourseStudentSigninSetting/updateStatus.json",
|
|
|
{ status: 2, id: data.teacherOpenCourseStudentSigninSettingId });
|
|
|
layer.msg(ret.code == 0?"已结束签到!":ret.msg, {
|
|
|
offset: ['50%'],
|
|
|
icon: ret.code == 0?1:2,
|
|
|
time: 1500 //2秒关闭(如果不配置,默认是3秒)
|
|
|
},function (){
|
|
|
if(ret.code == 0){
|
|
|
Lib.tableRefresh();
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
exports('index',view);
|
|
|
|
|
|
});
|