/** * 系统管理--用户管理的单例对象 */ let RegistrationRecord = { id: "managerTable",//表格id seItem: null, //选中的条目 table: null, layerIndex: -1 }; let language =$("#language").val() /** * 初始化表格的列 */ RegistrationRecord.initColumn = function () { let columns = [ {field: 'selectItem', checkbox: true}, {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, {title: '购买用户', field: 'userName', align: 'center', valign: 'middle'}, {title: '联系方式', field: 'phone', align: 'center', valign: 'middle'}, {title: '购课学员', field: 'studentName', align: 'center', valign: 'middle'}, {title: '报名时间', field: 'insertTime', align: 'center', valign: 'middle'}, // {title: '总课时数', field: 'totalClassHours', align: 'center', valign: 'middle'}, // {title: '剩余课时数', field: 'laveClassHours', align: 'center', valign: 'middle',rowStyle: function(row, index) { // // 参数说明: // //row, 行,row.xxx,能获取某个字段的值 // //index,索引,第几行 // // // 逻辑判断 // // ..... // return {"background-color":'rgba(208,9,9,0.7)'}; // } // }, // {title: '已上课时数', field: 'already', align: 'center', valign: 'middle'}, {title: '请假次数', field: 'absencesNumber', align: 'center', valign: 'middle'}, {title: '状态', field: 'status', align: 'center', valign: 'middle', formatter: function (v) { switch (v) { case 1: return '正常'; case 2: return '已退课-查看凭证'; } } } ]; return columns; }; /** * 检查是否选中 */ RegistrationRecord.check = function () { let selected = $('#' + this.id).bootstrapTable('getSelections'); if (selected.length == 0) { Feng.info("请先选中表格中的某一记录!"); return false; } else { RegistrationRecord.seItem = selected[0]; RegistrationRecord.seItem1 = selected; return true; } }; /** * 上课记录 */ RegistrationRecord.classRecord = function () { let index = layer.open({ type: 2, title: '上课记录', area: ['100%', '100%'], //宽高 fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/coursePackage/openClassRecord1?id=' + $('#id').val() }); this.layerIndex = index; }; RegistrationRecord.holiClass = function () { if (this.check()) { var ids = RegistrationRecord.seItem1.map(function(item) { return item.id; }).join(","); let index = layer.open({ type: 2, title: '报名信息', area: ['50%', '50%'], //宽高 fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/tStudent/TTT?ids='+ids+'&id='+$('#id').val() }); this.layerIndex = index; } }; RegistrationRecord.transClass = function () { if (this.check()) { var ids = RegistrationRecord.seItem1.map(function(item) { return item.id; }).join(","); let index = layer.open({ type: 2, title: '报名信息', area: ['50%', '50%'], //宽高 fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/tStudent/trans?ids='+ids+'&id='+$('#id').val() }); this.layerIndex = index; } }; /** * 点击修改按钮时 * @param userId 管理员id */ RegistrationRecord.dropClass = function () { if (this.check()) { if(ClassRecord.seItem.status == 2){ Feng.error("不能重复退课"); return } let htmlStr = '