无关风月
2025-05-08 9486766c806fe1d9e082b2fd02ea1cc558f1b443
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/**
 * 系统管理--用户管理的单例对象
 */
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();
});