/**
|
* 系统管理--用户管理的单例对象
|
*/
|
let ManualReservation = {
|
id: "managerTable",//表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
/**
|
* 初始化表格的列
|
*/
|
ManualReservation.initColumn = function () {
|
let columns = [
|
{field: 'selectItem', radio: true},
|
{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){
|
return '男';
|
}else{
|
return '女';
|
}
|
}
|
}
|
];
|
return columns;
|
};
|
|
/**
|
* 检查是否选中
|
*/
|
ManualReservation.check = function () {
|
let selected = $('#' + this.id).bootstrapTable('getSelections');
|
if (selected.length == 0) {
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
} else {
|
ManualReservation.seItem = selected[0];
|
return true;
|
}
|
};
|
|
|
|
ManualReservation.submit = function () {
|
if (this.check()) {
|
let ajax = new $ax(Feng.ctxPath + "/coursePackage/courseReservation", function (res) {
|
if(res.code == 200){
|
Feng.success("预约成功!");
|
ManualReservation.table.refresh();
|
}else{
|
Feng.error(res.msg);
|
}
|
}, function (data) {
|
Feng.error("预约失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("coursePackageSchedulingId", $('#id').val());
|
ajax.set("coursePackagePaymentId", ManualReservation.seItem.id);
|
ajax.start();
|
}
|
};
|
|
|
|
|
|
ManualReservation.resetSearch = function () {
|
$('#userName').val('');
|
$('#studentName').val('');
|
ManualReservation.search();
|
}
|
|
ManualReservation.search = function () {
|
let queryData = {};
|
queryData['coursePackageSchedulingId'] = $('#id').val();
|
queryData['userName'] = $('#userName').val();
|
queryData['studentName'] = $('#studentName').val();
|
ManualReservation.table.refresh({query: queryData});
|
}
|
|
|
$(function () {
|
let defaultColunms = ManualReservation.initColumn();
|
let table = new BSTable(ManualReservation.id, "/coursePackage/queryWalkInStudentList", defaultColunms);
|
// 设置物理分页server(逻辑分页client)
|
table.setPaginationType("server");
|
table.setQueryParams({
|
coursePackageSchedulingId: $('#id').val()
|
})
|
ManualReservation.table = table.init();
|
});
|