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
$(function () {
    var search = window.location.search;
    var unitid = null;
    if(search.indexOf("?") > -1){
        search = search.replace("?", "");
        unitid = search.split('=')[1];
    }
    if (unitid != null && unitid != "null" && unitid != "" ) {
        unitid = unitid
    }
    else{
        unitid = "";
    }
    $("#jqGrid").jqGrid({
        url: restServerBaseURL + 'org/unitmanager/userlist',
        datatype: "json",
        colModel: [    
            { label: '用户编号', name: 'userid', index: 'USERID', width: 50, key: true,hidden:true },
            { label: '用户中文名', name: 'chinesename', index: 'CHINESENAME', width: 50,hidden:true },
            { label: '中文名【用户名】', name: 'loginname', index: 'LOGINNAME', width: 80,align:'center',
                formatter: function(value, grid, rows, state) {
                    var loginname = rows.loginname;
                    var chinesename = rows.chinesename;
                    return chinesename + "【" + loginname + "】";
                }
            },
            { label: '手机号(接收短信)', name: 'mobileno', index: 'MOBILENO', width: 80,align:'center',
                formatter: function(value, grid, rows, state) {
                    var mobileno = rows.mobileno;
                    var isreceivemsg = rows.isreceivemsg;
                    if(mobileno != ""){
                        if(isreceivemsg == 1) {
                            return mobileno + "[是]";
                        } else if(isreceivemsg == 0){
                            return mobileno + "[否]";
                        } else {
                            return mobileno;
                        }
                    } else {
                        return "";
                    }
                }
            },
            { label: '状态', name: 'userstatus', index: 'USERSTATUS', width: 40,align:'center',
                formatter: function(value, grid, rows, state) {
                    var userstatus = rows.userstatus;
                    if(userstatus == 0) {
                        return "<span class=\"label label-success\">正常</span>";
                    } else if(userstatus == 1) {
                        return "<span class=\"label label-warning\">禁用</span>";
                    } else if(userstatus == 2) {
                        return "<span class=\"label label-warning\">删除</span>";
                    } else if(userstatus == 3) {
                        return "<span class=\"label label-warning\">申请</span>";
                    } else if(userstatus == 4) {
                        return "<span class=\"label label-warning\">拒批</span>";
                    } 
                }
            }
        ],
        postData:{'unitid':unitid},
        viewrecords: true,
        height: "100%",
        rowNum: 10,
        //rowList : [10,30,50],
        rownumbers: true, 
        rownumWidth: 50, 
        autowidth:true,
        multiselect: true,
        pager: "#jqGridPager",
        jsonReader : {
            root: "page.list",
            page: "page.currPage",
            total: "page.totalPage",
            records: "page.totalCount"
        },
        prmNames : {
            page:"page", 
            rows:"limit", 
            order: "order"
        },
        gridComplete:function(){
            //隐藏grid底部滚动条
            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" }); 
        }
    });
    $("#jqGrid").jqGrid('setLabel','rn','序号',{'text-align':'center'},'');
});
 
var vm = new Vue({
    el:'#rapp',
    data:{
        showList: true,
        title: null,
        userlist: {}
    },
    methods: {
        query: function () {
            vm.userlist.chinesename = $("#chinesename").val();
            vm.reload();
        },
        add: function(){
        },
        update: function () {
        },
        saveOrUpdate: function () {
        },
        del: function () {
        },
        getInfo: function(){
        },
        reload: function () {
            //vm.showList = fa;
            var page = $("#jqGrid").jqGrid('getGridParam','page');
            $("#jqGrid").jqGrid('setGridParam',{ 
                postData:{'chinesename':vm.userlist.chinesename},page:page
            }).trigger("reloadGrid");
        },
        refresh: function () {
            vm.showList = true;
            window.location.reload();
        }
    }
});
 
function getSelecteds(){
    var ids = $("#jqGrid").jqGrid("getGridParam","selarrrow");
    if(null == ids || ids.length == 0){
        alert("至少选择一个");
    }else{
        var names = "";
        for (var i = 0; i < ids.length; i++) {
            var data = $("#jqGrid").jqGrid("getRowData",ids[i]);
            names += data.chinesename+",";
        }
        names = names.length>0?names.substring(0,names.length-1):"";
        window.opener.unitmanagers.value=names;
        window.opener.unitmanagerIds.value=ids;
        window.close();
    }
}
 
function getClose(){
    window.close();
}