| | |
| | | */ |
| | | RegistrationRecord.initColumn = function () { |
| | | let columns = [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, 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: 'already', align: 'center', valign: 'middle'}, |
| | | {title: '缺课次数', field: 'absencesNumber', align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'status', align: 'center', valign: 'middle', |
| | | {field: 'selectItem', checkbox: true}, |
| | | {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status ==7){ |
| | | return '<div style="color: blue;">' + value + '</div>'; |
| | | } |
| | | else { |
| | | return value; |
| | | } |
| | | }}, |
| | | {title: '购买用户', field: 'userName', align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status ==7){ |
| | | return '<div style="color: blue;">' + value + '</div>'; |
| | | } |
| | | else { |
| | | return value; |
| | | } |
| | | }}, |
| | | {title: '联系方式', field: 'phone', align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status ==7){ |
| | | return '<div style="color: blue;">' + value + '</div>'; |
| | | } |
| | | else { |
| | | return value; |
| | | } |
| | | }}, |
| | | {title: '购课学员', field: 'studentName', align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status ==7){ |
| | | return '<div style="color: blue;">' + value + '</div>'; |
| | | } |
| | | else { |
| | | return value; |
| | | } |
| | | }}, |
| | | {title: '报名时间', field: 'insertTime', align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status ==7){ |
| | | return '<div style="color: blue;">' + value + '</div>'; |
| | | } |
| | | else { |
| | | return value; |
| | | } |
| | | }}, |
| | | {title: '总课时数', field: 'totalClassHours', align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status ==7){ |
| | | return '<div style="color: blue;">' + value + '</div>'; |
| | | } |
| | | else { |
| | | return value; |
| | | } |
| | | }}, |
| | | { |
| | | title: '剩余课时数', |
| | | field: 'laveClassHours', |
| | | align: 'center', |
| | | valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (value < 3) { |
| | | return '<div style="color: red;">' + value + '</div>'; |
| | | }else if (row.status ==7){ |
| | | return '<div style="color: blue;">' + value + '</div>'; |
| | | } |
| | | else { |
| | | return value; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '已上课时数', |
| | | field: 'already', |
| | | align: 'center', |
| | | valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status ==7){ |
| | | return '<div style="color: blue;">' + value + '</div>'; |
| | | } |
| | | else { |
| | | return value; |
| | | } |
| | | } |
| | | // , |
| | | // formatter: function (value, row) { |
| | | // var totalClassHours = row.totalClassHours; |
| | | // var laveClassHours = row.laveClassHours; |
| | | // var alreadyClassHours = totalClassHours - laveClassHours; |
| | | // return alreadyClassHours; |
| | | // } |
| | | }, |
| | | {title: '请假次数', field: 'absencesNumber', align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status ==7){ |
| | | return '<div style="color: blue;">' + value + '</div>'; |
| | | } |
| | | else { |
| | | return value; |
| | | } |
| | | }}, |
| | | { |
| | | title: '状态', |
| | | field: 'status', |
| | | align: 'center', |
| | | valign: 'middle', |
| | | formatter: function (v) { |
| | | switch (v) { |
| | | case 1: |
| | | return '正常'; |
| | | case 2: |
| | | return '<a href="#" onclick="">已退课-查看凭证</a>'; |
| | | return '已退课'; |
| | | case 3: |
| | | return '换课中'; |
| | | case 4: |
| | | return '申请退费中'; |
| | | case 5: |
| | | return '已转移'; |
| | | case 6: |
| | | return '已赠课' |
| | | case 7: |
| | | return '体验购课'; |
| | | default: |
| | | return ''; |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | RegistrationRecord.check = function () { |
| | | let selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | if (selected.length > 1) { |
| | | Feng.info("只能选中表格中的一条记录!"); |
| | | return false; |
| | | } else { |
| | | RegistrationRecord.seItem = selected[0]; |
| | | RegistrationRecord.seItem1 = selected; |
| | | |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | RegistrationRecord.check1 = 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; |
| | | } |
| | | }; |
| | |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | |
| | | RegistrationRecord.holiClass = function () { |
| | | if (this.check1()) { |
| | | var ids = RegistrationRecord.seItem1.map(function(item) { |
| | | return item.studentId; |
| | | }).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.studentId; |
| | | }).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; |
| | | } |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 点击修改按钮时 |
| | |
| | | RegistrationRecord.makeUpMissedLessons = function () { |
| | | if (this.check()) { |
| | | let operation = function(){ |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/makeUpMissedLessons", function () { |
| | | Feng.success("补课成功!"); |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/makeUpMissedLessons", function (data) { |
| | | Feng.success(data.msg); |
| | | RegistrationRecord.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("补课失败!" + data.responseJSON.message + "!"); |