| | |
| | | CoursePackageStudent.initColumn = function () { |
| | | let columns = [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所属用户', field: 'userName', align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'studentName', align: 'center', valign: 'middle'}, |
| | | {title: '联系电话', field: 'phone', align: 'center', valign: 'middle'}, |
| | | {title: '年龄', field: 'age', align: 'center', valign: 'middle'}, |
| | | {title: '性别', field: 'sex', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | if(v == 1){ |
| | | if (v == 1) { |
| | | return '男'; |
| | | }else{ |
| | | } else { |
| | | return '女'; |
| | | } |
| | | } |
| | | }, |
| | | {title: '到课状态', field: 'signInOrNot', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | switch (v) { |
| | | case 0: |
| | | return '未到'; |
| | | case 1: |
| | | return '已到'; |
| | | formatter: function (v, row) { |
| | | if (row.signInOrNot === 2) { |
| | | return '请假'; |
| | | } else { |
| | | switch (v) { |
| | | case 0: |
| | | return '旷课'; |
| | | case 1: |
| | | return '已到'; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | {title: '预定状态', field: 'reservationStatus', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | if(v == 0){ |
| | | return '已取消'; |
| | | }else{ |
| | | return '正常'; |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | ]; |
| | | return columns; |
| | | }; |
| | |
| | | |
| | | /** |
| | | * 取消预约 |
| | | * if(CoursePackageStudent.seItem.signInOrNot == 1){ |
| | | Feng.error("不能取消预约操作"); |
| | | return |
| | | } |
| | | */ |
| | | CoursePackageStudent.cancelReservation = function () { |
| | | if (this.check()) { |
| | |
| | | Feng.error("不能重复操作"); |
| | | return |
| | | } |
| | | if(CoursePackageStudent.seItem.signInOrNot == 1){ |
| | | Feng.error("不能取消预约操作"); |
| | | return |
| | | } |
| | | |
| | | let operation = function(){ |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/cancelReservation", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("取消成功!"); |
| | | Feng.success("请假成功!"); |
| | | CoursePackageStudent.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("取消失败!" + data.responseJSON.message + "!"); |
| | | Feng.error("请假失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", CoursePackageStudent.seItem.id); |
| | | ajax.start(); |
| | | }; |
| | | Feng.confirm("是否取消预约",operation); |
| | | Feng.confirm("是否请假",operation); |
| | | } |
| | | }; |
| | | |
| | |
| | | return |
| | | } |
| | | if(CoursePackageStudent.seItem.reservationStatus == 0){ |
| | | Feng.error("该数据已取消预约"); |
| | | Feng.error("当前学员已请假"); |
| | | return |
| | | } |
| | | let operation = function(){ |