| | |
| | | $.each(result.Message.Table, function(i) { |
| | | html.push("<tr>"); |
| | | html.push("<td>" + this.Account + "</td>"); |
| | | html.push("<td>" + this.UserName + "</td>"); |
| | | if (this.UserType == 1) { |
| | | html.push("<td>" + "管理员" + "</td>"); |
| | | } |
| | | else if (this.UserType == 2) { |
| | | html.push("<td>" + "业务员" + "</td>"); |
| | | } |
| | | else if (this.UserType == 3) { |
| | | html.push("<td>" + "业务主管" + "</td>"); |
| | | } |
| | | else if (this.UserType == 4) { |
| | | html.push("<td>" + "业务总监" + "</td>"); |
| | | } |
| | | else if (this.UserType == 5) { |
| | | html.push("<td>" + "客服人员" + "</td>"); |
| | | } |
| | | else if (this.UserType == 6) { |
| | | html.push("<td>" + "财务人员" + "</td>"); |
| | | } |
| | | else if (this.UserType == 99) { |
| | | html.push("<td>" + "其他" + "</td>"); |
| | | } |
| | | else { |
| | | html.push("<td>" + "" + "</td>"); |
| | | } |
| | | |
| | | html.push("<td>" + this.Mobile + "</td>"); |
| | | html.push("<td>" + formatFlagIcon(this.MobileFlag) + "</td>"); |
| | | |
| | |
| | | html.push("<td>" + this.ClientIp + "</td>"); |
| | | html.push("<td>" + (this.IsVerification == 1 ? "<span class='label label-primary'>开启</span>" : "<span class='label label-default'>关闭</span>") + "</td>"); |
| | | html.push("<td>" + this.CreateTime + "</td>"); |
| | | html.push("<td >"); |
| | | html.push("<td>" + (this.Status == 1 ? "<span class='label label-primary'>启用</span>" : "<span class='label label-default'>停用</span>") + "</td>"); |
| | | //html.push("<td>" + (this.Status == 1 ? "<a href='javascript:;' class='btn btn-primary btn-xs action-update-status' data-id=" + this.UserID + " data-status=0 ><i class='fa fa-toggle-off'></i> 启用</a>" : "<a href='javascript:;' class='btn btn-default btn-xs action-update-status' data-id=" + this.UserID + " data-status=1 ><i class='fa fa-toggle-on'></i>停用</a>") + "</td>"); |
| | | html.push("<td class='text-right' >"); |
| | | if (this.Status == 0) { |
| | | html.push("<a href='javascript:;' class='btn btn-primary btn-xs action-update-status' data-id=" + this.UserID + " data-status=1 ><i class='fa fa-toggle-off'></i>启用</a> " ); |
| | | } |
| | | else { |
| | | html.push("<a href='javascript:;' class='btn btn-default btn-xs action-update-status' data-id=" + this.UserID + " data-status=0 ><i class='fa fa-toggle-on'></i>停用</a> "); |
| | | } |
| | | html.push("<a href='javascript:;' class='btn btn-success btn-xs action-edit' data-id='" + this.UserID + "'><i class='fa fa-edit'></i> 编辑</a> "); |
| | | html.push("<a href='javascript:;' data-id='" + this.UserID + "' class='action-permission btn btn-info btn-xs'><i class='fa fa-edit'></i> 权限</a> "); |
| | | html.push("<a href='javascript:;' data-id='" + this.UserID + "' class='action-delete btn btn-default btn-xs'><i class='fa fa-trash'></i> 删除</a>"); |
| | |
| | | html.push("</tr>"); |
| | | }); |
| | | if (result.Message.TotalCount == 0) { |
| | | html.push("<tr><td colspan=\"10\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>"); |
| | | html.push("<tr><td colspan=\"11\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>"); |
| | | } |
| | | |
| | | $("#mainTable>tbody").html(html.join("")); |
| | |
| | | }); |
| | | }); |
| | | |
| | | $(document).on("click", ".action-update-status", function () { |
| | | //data的属性参数不能含有大写字母。 |
| | | var userId = $(this).data("id"); |
| | | var status = $(this).data("status"); |
| | | mytek.confirm("是否更新信息状态?", "请谨慎操作!", function (b) { |
| | | if (b) { |
| | | $.post("sysuser.ashx", { "action": "updateStatus", userId: userId, status: status }, function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | loadUserList(); |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | $(document).on("click", ".action-save", function() { |
| | | var userid = $("#userDialog").data("id"); |
| | | var account = $("#userDialog #account").val(); |
| | | var password = $("#userDialog #password").val(); |
| | | var userName = $("#userDialog #userName").val(); |
| | | var userType = $("#userDialog #userType").val(); |
| | | var mobile = $("#userDialog #mobile").val(); |
| | | var email = $("#userDialog #email").val(); |
| | | var emailFlag = $("#userDialog #emailFlag").val(); |
| | |
| | | |
| | | var clientIp = $("#userDialog #clientIp").val(); |
| | | |
| | | $.post("sysuser.ashx", { action: "saveUser", userid: userid, account: account, password: password, mobile: mobile, email: email, mobileFlag: mobileFlag, emailFlag: emailFlag, isVerification: isVerification, clientIp: clientIp }, |
| | | $.post("sysuser.ashx", { action: "saveUser", userid: userid, account: account, password: password, userName: userName, userType: userType, mobile: mobile, email: email, mobileFlag: mobileFlag, emailFlag: emailFlag, isVerification: isVerification, clientIp: clientIp }, |
| | | function(result) { |
| | | mytek.alert(result.Message, result.OK, function() { |
| | | if (result.OK) { |
| | |
| | | $("#userDialog").data("id", 0); |
| | | $("#userDialog #account").val(""); |
| | | $("#userDialog #password").val(""); |
| | | $("#userDialog #userName").val(""); |
| | | $("#userDialog #userType").val(""); |
| | | $("#userDialog #mobile").val(""); |
| | | $("#userDialog #email").val(""); |
| | | $("#userDialog input[name=isVerification]").iCheck("uncheck"); |
| | |
| | | $("#userDialog").data("id", id); |
| | | $("#userDialog #account").val(user.Account); |
| | | $("#userDialog #password").val(user.Password); |
| | | $("#userDialog #userName").val(user.UserName); |
| | | $("#userDialog #userType").val(user.UserType); |
| | | $("#userDialog #mobile").val(user.Mobile); |
| | | $("#userDialog #email").val(user.Email); |
| | | $("#userDialog #emailFlag").val(user.EmailFlag); |
| | |
| | | <div class="modal-body"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label"> |
| | | 账户</label> |
| | | 账户 <span style="color:red">*</span></label> |
| | | <div class="col-sm-10"> |
| | | <input type="text" name="account" id="account" value="" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label"> |
| | | 密码</label> |
| | | 密码 <span style="color:red">*</span></label> |
| | | <div class="col-sm-10"> |
| | | <input type="password" name="password" id="password" value="" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label"> |
| | | 账户名称 <span style="color:red">*</span></label> |
| | | <div class="col-sm-10"> |
| | | <input type="text" name="userName" id="userName" value="" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label"> |
| | | 账户类型 <span style="color:red">*</span> |
| | | </label> |
| | | <div class="col-sm-4"> |
| | | <select name="userType" id="userType" class="form-control"> |
| | | <option value=""></option> |
| | | <option value="1">管理员</option> |
| | | <option value="2">业务员</option> |
| | | <option value="3">业务主管</option> |
| | | <option value="4">业务总监</option> |
| | | <option value="5">客服人员</option> |
| | | <option value="6">财务人员</option> |
| | | <option value="99">其他</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | |
| | | 账号 |
| | | </th> |
| | | <th> |
| | | 用户名称 |
| | | </th> |
| | | <th> |
| | | 用户类型 |
| | | </th> |
| | | <th> |
| | | 手机 |
| | | </th> |
| | | <th> |
| | |
| | | <th> |
| | | 创建时间 |
| | | </th> |
| | | <th style="width: 200px;"> |
| | | <th> |
| | | 状态 |
| | | </th> |
| | | <th style="width: 240px;"> |
| | | 操作 |
| | | </th> |
| | | </tr> |