xuhy
2024-05-28 5470d21a35286abe41fafc25a7deaabefd7c55da
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
/**
 * 报销管理管理初始化
 */
var Process = {
    id: "ProcessTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 初始化表格的列
 */
Process.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '任务id', field: 'id', visible: true, align: 'center', valign: 'middle'},
        {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle'},
        {title: '金额', field: 'money', visible: true, align: 'center', valign: 'middle'},
        {title: '创建时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'},
        {title: '申请人', field: 'assignee', visible: true, align: 'center', valign: 'middle'},
        {
            title: '操作', visible: true, align: 'center', valign: 'middle', formatter: function (value, row, index) {
            if (row.selfFlag == true) {
                return '<button type="button" class="btn btn-primary button-margin" onclick="Process.pass(' + row.id + ')" id=""><i class="fa fa-edit"></i>&nbsp;通过</button>' +
                    '<button type="button" class="btn btn-danger button-margin" onclick="Process.unPass(' + row.id + ')" id=""><i class="fa fa-arrows-alt"></i>&nbsp;不通过</button>';
            } else {
                return '<button type="button" class="btn btn-primary button-margin" onclick="Process.pass(' + row.id + ')" id=""><i class="fa fa-edit"></i>&nbsp;通过</button>';
            }
        }
        }
    ];
};
 
/**
 * 通过审核
 */
Process.pass = function (id) {
    var ajax = new $ax(Feng.ctxPath + "/process/pass", function (data) {
        Feng.success("审核成功!");
        Process.table.refresh();
    }, function (data) {
        Feng.error("审核失败!" + data.responseJSON.message + "!");
    });
    ajax.set("taskId", id);
    ajax.start();
};
 
/**
 * 未通过审核
 */
Process.unPass = function (id) {
    var ajax = new $ax(Feng.ctxPath + "/process/unPass", function (data) {
        Feng.success("审核成功!");
        Process.table.refresh();
    }, function (data) {
        Feng.error("审核失败!" + data.responseJSON.message + "!");
    });
    ajax.set("taskId", id);
    ajax.start();
};
 
/**
 * 查询报销管理列表
 */
Process.search = function () {
    var queryData = {};
    queryData['condition'] = $("#condition").val();
    Process.table.refresh({query: queryData});
};
 
$(function () {
    var defaultColunms = Process.initColumn();
    var table = new BSTable(Process.id, "/process/list", defaultColunms);
    table.setPaginationType("client");
    Process.table = table.init();
});