1
13693261870
2022-09-16 762f2fb45db004618ba099aa3c0bd89dba1eb843
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
 
var temp=null;
$(function () {
 
    $('#applyjqGrid').jqGrid('clearGridData');
    $("#applyjqGrid").jqGrid({
        url: restServerBaseURL + 'sys/systeminfoapply/list?appid=' + GetQueryString("appid") + "&auditresult=" + GetQueryString("auditresult"),
        datatype: "json",
        colModel: [
            {label: '系统编号', name: 'userid', index: 'USERID', width: 20, key: true, hidden: true},
            {label: '姓名', name: 'chinesename', index: 'chinesename', width: 40, align: 'center'},
            {label: '单位', name: 'unitname', index: 'unitname', width: 50, align: 'center'},
            {
                label: (GetQueryString("auditresult") == 0 ? '操作' : '审核结果'),
                width: 30,
                sortable: false,
                align: 'center',
                formatter: function (value, grid, rows, state) {
                    var id = rows.id;
                     temp=rows;
                    var html = "";
                    if (GetQueryString("auditresult") == 0 && rows.auditresult == 0) {
                        html = '<input type="button" id="applyaudit" data-toggle="modal" data-target="#resultModal" class="btn btn-primary" value="审核" style="margin-right:5px;padding:3px 6px;" onclick="ShowAuditResult(' +
                            id + ')">';
                    }
                    if (GetQueryString("auditresult") != 0) {
                        var opition = rows.auditopinion==null?'':rows.auditopinion;
                        html = "<a data-toggle=\"modal\" data-target=\"#opinionModal\" onclick='ShowOpinion(\"" + opition + "\")' style='color: black;cursor: pointer;text-decoration:underline;'>" + (rows.auditresult == 1 ? "通过" : "不通过") + "</a>";
 
                        html +='&nbsp<a class="delete" onclick="delRecord()"  style="color: black;cursor: pointer;text-decoration:underline;">'+"删除记录"+"</a>";
                    }
                    return html;
                }
            }
        ],
        height: "auto",
        viewrecords: true,
        rowNum: 10,
        rownumbers: true,
        rownumWidth: 50,
        autowidth: true,
        multiselect: false,
        pager: "#applyjqGridPager",
        jsonReader: {
            root: "page.list",
            page: "page.currPage",
            total: "page.totalPage",
            records: "page.totalCount"
        },
        prmNames: {
            page: "page",
            rows: "limit",
            order: "order"
        },
        gridComplete: function () {
            //隐藏grid底部滚动条
            $("#applyjqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
        },
        onSortCol: function (index, colindex, sortorder) {
            jQuery("#applyjqGrid").jqGrid('setGridParam', {
                page: $(".ui-pg-input").val()
            });
        }
    }).trigger('reloadGrid');
    jQuery("#applyjqGrid").jqGrid('setLabel', 'rn', '序号', {
        'text-align': 'center',
        'vertical-align': 'middle',
        "width": "50"
    });
    $("#applyjqGrid").setGridWidth(545);
});
 
/*
 *删除记录
 */
function delRecord(){
    debugger
     console.log(temp);
     var obj=temp;
    $.ajax({
        type: "GET",
        url: restServerBaseURL + "sys/systeminfoapply/delRecord?applyid=" +obj.id + "&auditresult=3" ,
        contentType: "application/json;charset=utf-8",
        success: function (result) {
            
            layer.msg(result.msg);
            parent.$("#applyModal").modal("hide");
            parent.vm.query();
         
        },
        fail: function(result){
        
            layer.msg("发生错误,请联系管理员!");
              parent.$("#applyModal").modal("hide");
            
        }
    });
}
function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}
 
function ShowAuditResult(id) {
    $("#applyid").val(id);
}
 
function SaveAuditResult() {
    var isSelect = false;
    var status = 0;
    $("[type=radio]").each(function () {
        if ($(this).prop("checked") == true) {
            status = $(this).val();
            isSelect = true;
        }
    })
    if (!isSelect) {
        alert("请选择结果!");
        return false;
    }
    $.ajax({
        url: restServerBaseURL + 'sys/systeminfoapply/saveresult',
        type: 'post',
        dataType: "json",
        data: {'applyid': $("#applyid").val(), 'auditresult': status, 'auditopinion': $("#auditopinion").val()},
        success: function (data) {
            if (data.result == '1') {
                alert("批复成功!");
                CloseModal();
                parent.$("#applyModal").modal("hide");
                parent.vm.query();
            } else {
                alert("批复失败!");
                CloseModal();
            }
        },
        error: function (e) {
            alert(e.message);
        }
    });
}
 
function CloseModal() {
    $("#resultModal").modal("hide");
}
 
function ShowOpinion(opinion) {
    $("#opinionDiv").html(opinion);
}