| | |
| | | <%--<link href="css/plugins/bootstrap-fileinput/fileinput.min.css" rel="stylesheet"/> |
| | | <script src="js/plugins/bootstrap-fileinput/fileinput.min.js" type="text/javascript"></script>--%> |
| | | <script type="text/javascript"> |
| | | $(function () { |
| | | $(document).ready(function () { |
| | | $("textarea").numberedtextarea(); |
| | | |
| | | $("#pager").Pager({ |
| | | pageSize: 20, |
| | | onChange: function (pageIndex, pageSize) { |
| | | loadPageList(); |
| | | } |
| | | $(document).on("click", ".action-query", function () { |
| | | loadPageList(); |
| | | }); |
| | | loadPageList(); |
| | | |
| | | $(document).on("click", ".action-modal-create", function () { |
| | | $("#clientDialog .modal-title").text("创建客户信息"); |
| | | $("#clientDialog input").attr("readonly", false); |
| | | $("#clientDialog input[name=action]").val("save"); |
| | | |
| | | //$("#clientDialog #id").val(""); |
| | | $("#clientDialog #clientID").val(""); |
| | | $("#clientDialog #company").val(""); |
| | | $("#clientDialog #clientName").val(""); |
| | | $("#clientDialog #agent").val(""); |
| | | $("#clientDialog #address").val(""); |
| | | $("#clientDialog #telephone").val(""); |
| | | $("#clientDialog #chargeType").val(""); |
| | | $("#clientDialog #smsStatusReport").val(""); |
| | | $("#clientDialog #mmsStatusReport").val(""); |
| | | $("#clientDialog #customerManager").val(""); |
| | | $("#clientDialog #salesman").val(""); |
| | | $("#clientDialog #supportStaff").val(""); |
| | | $("#clientDialog #financialStaff").val(""); |
| | | $("#clientDialog #remark").val(""); |
| | | $("#clientDialog input[name=permissionData]").iCheck("uncheck"); |
| | | |
| | | $("#clientDialog input[name=isEnableWhite][value='" + 0 + "']").iCheck("check"); |
| | | $("#clientDialog input[name=isEnableBlack][value='" + 0 + "']").iCheck("check"); |
| | | $("#clientDialog input[name=isRemoteLoginNotice][value='" + 0 + "']").iCheck("check"); |
| | | $("#clientDialog input[name=isMobileCaptcha][value='" + 0 + "']").iCheck("check"); |
| | | $("#clientDialog input[name=isHideMobile][value='" + 0 + "']").iCheck("check"); |
| | | $("#clientDialog input[name=isDisplayStatus][value='" + 0 + "']").iCheck("check"); |
| | | $("#clientDialog input[name=isLoginIpRestrict][value='" + 0 + "']").iCheck("check"); |
| | | |
| | | $("#clientDialog #isLoginIpAllowGather").val(""); |
| | | $("#clientDialog input[name=isLoginCityRestrict][value='" + 0 + "']").iCheck("check"); |
| | | $("#clientDialog #isLoginCityAllowGather").val(""); |
| | | |
| | | $("#clientDialog").modal("show"); |
| | | |
| | | //刷新一次随机密码 |
| | | $("#password").val(randomString(8)); |
| | | |
| | | $(".pwdCss").show(); |
| | | |
| | | }); |
| | | |
| | | function loadPageList() { |
| | | var ClientID = $("#ClientID").val(); |
| | | var Company = $("#Company").val(); |
| | | var ClientName = $("#ClientName").val(); |
| | | var Telephone = $("#Telephone").val(); |
| | | //var Agent = $("#Agent").val(); |
| | | var Agent = ""; |
| | | var Salesman = $("#Salesman").val(); |
| | | var SupportStaff = $("#SupportStaff").val(); |
| | | var ProductId = $("#ProductId").val(); |
| | | var IsEnable = <%=IsEnable%>; |
| | | $.ajax({ |
| | | url: "GwClient.ashx", |
| | | type: "POST", |
| | | data: { action: "loadGwClientPageList", ClientID: ClientID, Company: Company, ClientName: ClientName, Telephone: Telephone, Agent: Agent, Salesman: Salesman, SupportStaff: SupportStaff, ProductId: ProductId, IsEnable: IsEnable , pageSize: $("#pager").Pager("getPageSize"), pageIndex: $("#pager").Pager("getPageIndex") }, |
| | | success: function (result) { |
| | | if (result.OK) { |
| | | $("#gwclientTable tbody").html(result.Message.Table); |
| | | $("#pager").Pager("setTotalCount", result.Message.TotalCount); |
| | | } else { |
| | | mytek.alert(result.Message, result.OK); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | //编辑 |
| | | $(document).on("click", ".action-modal-edit", function () { |
| | | $("#clientDialog .modal-title").text("修改客户资料"); |
| | | $("#clientDialog input[name=action]").val("update"); |
| | | var id = $(this).data("id"); |
| | | $.get("gwclient.ashx?action=get", { clientID: id }, function (r) { |
| | | if (r.OK) { |
| | | try { |
| | | $("#clientDialog #id").val(r.Message.Id); |
| | | $("#clientDialog #clientID").val(r.Message.ClientID); |
| | | $("#clientDialog #company").val(r.Message.Company); |
| | | //$("#clientDialog #password").val(r.Message.Password); |
| | | $("#clientDialog #password").val(""); |
| | | //编辑时密码框隐藏 |
| | | $(".pwdCss").hide(); |
| | | |
| | | function randomString(len) { |
| | | len = len || 32; |
| | | var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/ |
| | | var maxPos = $chars.length; |
| | | var pwd = ''; |
| | | for (i = 0; i < len; i++) { |
| | | pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); |
| | | } |
| | | return pwd; |
| | | } |
| | | |
| | | $(document).ready(function () { |
| | | $("textarea").numberedtextarea(); |
| | | |
| | | $(document).on("click", ".action-query", function () { |
| | | loadPageList(); |
| | | }); |
| | | loadPageList(); |
| | | |
| | | $(document).on("click", ".action-modal-create", function () { |
| | | $("#clientDialog .modal-title").text("创建客户信息"); |
| | | $("#clientDialog input").attr("readonly", false); |
| | | $("#clientDialog input[name=action]").val("save"); |
| | | |
| | | //$("#clientDialog #id").val(""); |
| | | $("#clientDialog #clientID").val(""); |
| | | $("#clientDialog #company").val(""); |
| | | $("#clientDialog #clientName").val(""); |
| | | $("#clientDialog #agent").val(""); |
| | | $("#clientDialog #address").val(""); |
| | | $("#clientDialog #telephone").val(""); |
| | | $("#clientDialog #chargeType").val(""); |
| | | $("#clientDialog #smsStatusReport").val(""); |
| | | $("#clientDialog #mmsStatusReport").val(""); |
| | | $("#clientDialog #customerManager").val(""); |
| | | $("#clientDialog #salesman").val(""); |
| | | $("#clientDialog #supportStaff").val(""); |
| | | $("#clientDialog #financialStaff").val(""); |
| | | $("#clientDialog #remark").val(""); |
| | | $("#clientDialog input[name=permissionData]").iCheck("uncheck"); |
| | | |
| | | $("#clientDialog").modal("show"); |
| | | |
| | | //刷新一次随机密码 |
| | | $("#password").val(randomString(8)); |
| | | |
| | | $(".pwdCss").show(); |
| | | |
| | | }); |
| | | |
| | | //编辑 |
| | | $(document).on("click", ".action-modal-edit", function () { |
| | | $("#clientDialog .modal-title").text("修改客户资料"); |
| | | $("#clientDialog input[name=action]").val("update"); |
| | | var id = $(this).data("id"); |
| | | $.get("gwclient.ashx?action=get", { clientID: id }, function (r) { |
| | | if (r.OK) { |
| | | try { |
| | | $("#clientDialog #id").val(r.Message.Id); |
| | | $("#clientDialog #clientID").val(r.Message.ClientID); |
| | | $("#clientDialog #company").val(r.Message.Company); |
| | | //$("#clientDialog #password").val(r.Message.Password); |
| | | $("#clientDialog #password").val(""); |
| | | //编辑时密码框隐藏 |
| | | $(".pwdCss").hide(); |
| | | |
| | | $("#clientDialog #clientName").val(r.Message.ClientName); |
| | | $("#clientDialog #agent").val(r.Message.Agent); |
| | | $("#clientDialog #address").val(r.Message.Address); |
| | | $("#clientDialog #telephone").val(r.Message.Telephone); |
| | | $("#clientDialog #chargeType").val(r.Message.ChargeType); |
| | | $("#clientDialog #smsStatusReport").val(r.Message.SmsStatusReport); |
| | | $("#clientDialog #mmsStatusReport").val(r.Message.MmsStatusReport); |
| | | $("#clientDialog #customerManager").val(r.Message.CustomerManager); |
| | | $("#clientDialog #salesman").val(r.Message.Salesman); |
| | | $("#clientDialog #supportStaff").val(r.Message.SupportStaff); |
| | | $("#clientDialog #financialStaff").val(r.Message.FinancialStaff); |
| | | $("#clientDialog #remark").val(r.Message.Remark); |
| | | var permissionData = $.evalJSON(r.Message.PermissionData); |
| | | $("#clientDialog input[name=permissionData]").iCheck("uncheck"); |
| | | $.each(permissionData, function (i) { |
| | | $("#clientDialog input[name=permissionData][value='" + this + "']").iCheck("check"); |
| | | }); |
| | | |
| | | //$("#clientDialog #isEnableWhite").val(r.Message.IsEnableWhite); |
| | | $("#clientDialog input[name=isEnableWhite]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isEnableWhite][value='" + r.Message.IsEnableWhite + "']").iCheck("check"); |
| | | |
| | | //$("#clientDialog #isEnableBlack").val(r.Message.IsEnableBlack); |
| | | $("#clientDialog input[name=isEnableBlack]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isEnableBlack][value='" + r.Message.IsEnableBlack + "']").iCheck("check"); |
| | | //$("#clientDialog #isRemoteLoginNotice").val(r.Message.IsRemoteLoginNotice); |
| | | $("#clientDialog input[name=isRemoteLoginNotice]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isRemoteLoginNotice][value='" + r.Message.IsRemoteLoginNotice + "']").iCheck("check"); |
| | | //$("#clientDialog #isMobileCaptcha").val(r.Message.IsMobileCaptcha); |
| | | $("#clientDialog input[name=isMobileCaptcha]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isMobileCaptcha][value='" + r.Message.IsMobileCaptcha + "']").iCheck("check"); |
| | | //$("#clientDialog #isHideMobile").val(r.Message.IsHideMobile); |
| | | $("#clientDialog input[name=isHideMobile]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isHideMobile][value='" + r.Message.IsHideMobile + "']").iCheck("check"); |
| | | //$("#clientDialog #isDisplayStatus").val(r.Message.IsDisplayStatus); |
| | | $("#clientDialog input[name=isDisplayStatus]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isDisplayStatus][value='" + r.Message.IsDisplayStatus + "']").iCheck("check"); |
| | | //$("#clientDialog #isLoginIpRestrict").val(r.Message.IsLoginIpRestrict); |
| | | $("#clientDialog input[name=isLoginIpRestrict]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isLoginIpRestrict][value='" + r.Message.IsLoginIpRestrict + "']").iCheck("check"); |
| | | |
| | | $("#clientDialog #isLoginIpAllowGather").val(r.Message.IsLoginIpAllowGather); |
| | | //$("#clientDialog #isLoginCityRestrict").val(r.Message.IsLoginCityRestrict); |
| | | $("#clientDialog input[name=isLoginCityRestrict]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isLoginCityRestrict][value='" + r.Message.IsLoginCityRestrict + "']").iCheck("check"); |
| | | $("#clientDialog #isLoginCityAllowGather").val(r.Message.IsLoginCityAllowGather); |
| | | } |
| | | catch (e) { |
| | | } |
| | | |
| | | $("#clientDialog").modal("show"); |
| | | } |
| | | else { |
| | | mytek.alert(r.Message, r.OK); |
| | | } |
| | | }, "json"); |
| | | }); |
| | | |
| | | //免密登录 |
| | | $(document).on("click", ".action-modal-login", function () { |
| | | var url = $(this).data("url"); |
| | | var id = $(this).data("id"); |
| | | |
| | | var milliseconds = new Date().getTime(); //获得当前时间的毫秒值 |
| | | url += "&t=" + milliseconds; |
| | | //console.log(url); |
| | | window.open(url, "_blank"); |
| | | |
| | | |
| | | }); |
| | | |
| | | //黑名单 |
| | | $(document).on("click", ".action-modal-black", function () { |
| | | var id = $(this).data("id"); |
| | | $.get("gwclient.ashx?action=getBlack", { clientID: id }, function (r) { |
| | | if (r.OK) { |
| | | $("#blackDialog input[name='clientID']").val(id); |
| | | $("#blackDialog textarea").val(r.Message); |
| | | $("#blackDialog").modal("show"); |
| | | } |
| | | else { |
| | | mytek.alert(r.Message, r.OK); |
| | | } |
| | | }, "json"); |
| | | }); |
| | | |
| | | //白名单 |
| | | $(document).on("click", ".action-modal-white", function () { |
| | | var id = $(this).data("id"); |
| | | $.get("gwclient.ashx?action=getWhite", { clientID: id }, function (r) { |
| | | if (r.OK) { |
| | | $("#whiteDialog input[name='clientID']").val(id); |
| | | $("#whiteDialog textarea").val(r.Message); |
| | | $("#whiteDialog").modal("show"); |
| | | } |
| | | else { |
| | | mytek.alert(r.Message, r.OK); |
| | | } |
| | | }, "json"); |
| | | }); |
| | | |
| | | //面板页提交:隐藏面板(白名单,黑名单,修改密码) |
| | | $("#blackForm, #whiteForm").ajaxForm({ |
| | | success: function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | $("#whiteDialog, #blackDialog").modal("hide"); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //面板页提交:重新加载列表 |
| | | $("#clientForm, #updatePwdForm").ajaxForm({ |
| | | success: function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | r.OK && (window.location.reload()); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //修改密码:打开界面 |
| | | $(document).on("click", ".action-modal-updatePwd", function () { |
| | | //$("#updatePwdDialog .modal-title").text("修改客户资料"); |
| | | $("#updatePwdDialog input[name=action]").val("updatePwd"); |
| | | var id = $(this).data("id"); |
| | | |
| | | $("#updatePwdDialog input[name='clientID']").val(id); |
| | | $("#updatePwdDialog #newPwd").val(""); |
| | | |
| | | $("#updatePwdDialog").modal("show"); |
| | | |
| | | }); |
| | | |
| | | //修改分配个性产品:显示客户对应的分配个性产品 |
| | | $(document).on("click", ".action-modal-updateProduct", function () { |
| | | var clientId = $(this).data("id"); |
| | | $.get("GwClient.ashx", { action: "getPersonalityProduct", clientId: clientId }, function (result) { |
| | | if (!result.OK) { |
| | | mytek.alert(result.Message, result.OK); |
| | | } |
| | | else { |
| | | $("#updateProductDialog input[name='clientID']").val(clientId); |
| | | $("#updateProductDialog #_ProductId").prop("checked", false); |
| | | $.each(result.Message, function (i) { |
| | | $("#updateProductDialog #_ProductId[value='" + this + "']").prop("checked", true); |
| | | }); |
| | | } |
| | | $("#updateProductDialog").modal("show"); |
| | | }, "json"); |
| | | }); |
| | | |
| | | //修改分配个性产品:修改确认 |
| | | $(document).on("click", ".action-updateProduct", function () { |
| | | var productIdArray = []; |
| | | |
| | | mytek.confirm("是否需要修改客户分配个性产品?", "确认分配个性产品,请谨慎操作!", function (b) { |
| | | if (b) { |
| | | $("#updateProductDialog #_ProductId").each(function () { |
| | | if ($(this).is(":checked")) { |
| | | productIdArray.push($(this).val()); |
| | | } |
| | | $("#clientDialog #clientName").val(r.Message.ClientName); |
| | | $("#clientDialog #agent").val(r.Message.Agent); |
| | | $("#clientDialog #address").val(r.Message.Address); |
| | | $("#clientDialog #telephone").val(r.Message.Telephone); |
| | | $("#clientDialog #chargeType").val(r.Message.ChargeType); |
| | | $("#clientDialog #smsStatusReport").val(r.Message.SmsStatusReport); |
| | | $("#clientDialog #mmsStatusReport").val(r.Message.MmsStatusReport); |
| | | $("#clientDialog #customerManager").val(r.Message.CustomerManager); |
| | | $("#clientDialog #salesman").val(r.Message.Salesman); |
| | | $("#clientDialog #supportStaff").val(r.Message.SupportStaff); |
| | | $("#clientDialog #financialStaff").val(r.Message.FinancialStaff); |
| | | $("#clientDialog #remark").val(r.Message.Remark); |
| | | var permissionData = $.evalJSON(r.Message.PermissionData); |
| | | $("#clientDialog input[name=permissionData]").iCheck("uncheck"); |
| | | $.each(permissionData, function (i) { |
| | | $("#clientDialog input[name=permissionData][value='" + this + "']").iCheck("check"); |
| | | }); |
| | | |
| | | //var clientId = $("#updateProductDialog").data("id"); |
| | | var clientId = $("#updateProductDialog input[name='clientID']").val(); |
| | | $.ajax({ |
| | | url: "GwClient.ashx", |
| | | type: "POST", |
| | | data: { action: "updateProduct", clientId: clientId, productIdArray: $.toJSON(productIdArray) }, |
| | | success: function (result) { |
| | | if (result.OK) { |
| | | $("#updateProductDialog").modal("hide"); |
| | | loadPageList(); |
| | | } else { |
| | | mytek.alert(result.Message, result.OK); |
| | | } |
| | | } |
| | | }); |
| | | //$("#clientDialog #isEnableWhite").val(r.Message.IsEnableWhite); |
| | | $("#clientDialog input[name=isEnableWhite]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isEnableWhite][value='" + r.Message.IsEnableWhite + "']").iCheck("check"); |
| | | |
| | | //$("#clientDialog #isEnableBlack").val(r.Message.IsEnableBlack); |
| | | $("#clientDialog input[name=isEnableBlack]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isEnableBlack][value='" + r.Message.IsEnableBlack + "']").iCheck("check"); |
| | | //$("#clientDialog #isRemoteLoginNotice").val(r.Message.IsRemoteLoginNotice); |
| | | $("#clientDialog input[name=isRemoteLoginNotice]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isRemoteLoginNotice][value='" + r.Message.IsRemoteLoginNotice + "']").iCheck("check"); |
| | | //$("#clientDialog #isMobileCaptcha").val(r.Message.IsMobileCaptcha); |
| | | $("#clientDialog input[name=isMobileCaptcha]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isMobileCaptcha][value='" + r.Message.IsMobileCaptcha + "']").iCheck("check"); |
| | | //$("#clientDialog #isHideMobile").val(r.Message.IsHideMobile); |
| | | $("#clientDialog input[name=isHideMobile]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isHideMobile][value='" + r.Message.IsHideMobile + "']").iCheck("check"); |
| | | //$("#clientDialog #isDisplayStatus").val(r.Message.IsDisplayStatus); |
| | | $("#clientDialog input[name=isDisplayStatus]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isDisplayStatus][value='" + r.Message.IsDisplayStatus + "']").iCheck("check"); |
| | | //$("#clientDialog #isLoginIpRestrict").val(r.Message.IsLoginIpRestrict); |
| | | $("#clientDialog input[name=isLoginIpRestrict]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isLoginIpRestrict][value='" + r.Message.IsLoginIpRestrict + "']").iCheck("check"); |
| | | |
| | | $("#clientDialog #isLoginIpAllowGather").val(r.Message.IsLoginIpAllowGather); |
| | | //$("#clientDialog #isLoginCityRestrict").val(r.Message.IsLoginCityRestrict); |
| | | $("#clientDialog input[name=isLoginCityRestrict]").iCheck("uncheck"); |
| | | $("#clientDialog input[name=isLoginCityRestrict][value='" + r.Message.IsLoginCityRestrict + "']").iCheck("check"); |
| | | $("#clientDialog #isLoginCityAllowGather").val(r.Message.IsLoginCityAllowGather); |
| | | } |
| | | }); |
| | | }); |
| | | catch (e) { |
| | | } |
| | | |
| | | |
| | | //充值 |
| | | $(document).on("click", ".action-modal-orderCreate", function () { |
| | | var clientId = $(this).data("id"); //客户账号 |
| | | //window.open("gwOrderCreate.aspx?spId=" + spID, 'gwOrderCreate'); |
| | | window.location.href = "gwOrderCreate.aspx?clientId=" + clientId; |
| | | }); |
| | | |
| | | //充值日志 |
| | | $(document).on("click", ".action-modal-orderLog", function () { |
| | | var clientId = $(this).data("id"); |
| | | window.location.href = "GwOrderList.aspx?clientId=" + clientId + ""; |
| | | }); |
| | | |
| | | //启用或停用 |
| | | $(document).on("click", ".action-modal-updateStatus", function () { |
| | | //data的属性参数不能含有大写字母。 |
| | | var clientId = $(this).data("id"); |
| | | var isEnable = $(this).data("status"); |
| | | var statusMsg = ""; |
| | | if (isEnable == 0) { |
| | | statusMsg = "【停用】"; |
| | | $("#clientDialog").modal("show"); |
| | | } |
| | | else { |
| | | statusMsg = "【启用】"; |
| | | mytek.alert(r.Message, r.OK); |
| | | } |
| | | mytek.confirm("是否需要" + statusMsg + "该信息?", "确认更新信息状态,请谨慎操作!", function (b) { |
| | | if (b) { |
| | | $.post("gwclient.ashx", { "action": "updateStatus", clientId: clientId, isEnable: isEnable }, function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | }, "json"); |
| | | }); |
| | | |
| | | //免密登录 |
| | | $(document).on("click", ".action-modal-login", function () { |
| | | var url = $(this).data("url"); |
| | | var id = $(this).data("id"); |
| | | |
| | | var milliseconds = new Date().getTime(); //获得当前时间的毫秒值 |
| | | url += "&t=" + milliseconds; |
| | | //console.log(url); |
| | | window.open(url, "_blank"); |
| | | |
| | | |
| | | }); |
| | | |
| | | //黑名单 |
| | | $(document).on("click", ".action-modal-black", function () { |
| | | var id = $(this).data("id"); |
| | | $.get("gwclient.ashx?action=getBlack", { clientID: id }, function (r) { |
| | | if (r.OK) { |
| | | $("#blackDialog input[name='clientID']").val(id); |
| | | $("#blackDialog textarea").val(r.Message); |
| | | $("#blackDialog").modal("show"); |
| | | } |
| | | else { |
| | | mytek.alert(r.Message, r.OK); |
| | | } |
| | | }, "json"); |
| | | }); |
| | | |
| | | //白名单 |
| | | $(document).on("click", ".action-modal-white", function () { |
| | | var id = $(this).data("id"); |
| | | $.get("gwclient.ashx?action=getWhite", { clientID: id }, function (r) { |
| | | if (r.OK) { |
| | | $("#whiteDialog input[name='clientID']").val(id); |
| | | $("#whiteDialog textarea").val(r.Message); |
| | | $("#whiteDialog").modal("show"); |
| | | } |
| | | else { |
| | | mytek.alert(r.Message, r.OK); |
| | | } |
| | | }, "json"); |
| | | }); |
| | | |
| | | //面板页提交:隐藏面板(白名单,黑名单,修改密码) |
| | | $("#blackForm, #whiteForm").ajaxForm({ |
| | | success: function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | $("#whiteDialog, #blackDialog").modal("hide"); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //面板页提交:重新加载列表 |
| | | $("#clientForm, #updatePwdForm").ajaxForm({ |
| | | success: function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | r.OK && (window.location.reload()); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //修改密码:打开界面 |
| | | $(document).on("click", ".action-modal-updatePwd", function () { |
| | | //$("#updatePwdDialog .modal-title").text("修改客户资料"); |
| | | $("#updatePwdDialog input[name=action]").val("updatePwd"); |
| | | var id = $(this).data("id"); |
| | | |
| | | $("#updatePwdDialog input[name='clientID']").val(id); |
| | | $("#updatePwdDialog #newPwd").val(""); |
| | | |
| | | $("#updatePwdDialog").modal("show"); |
| | | |
| | | }); |
| | | |
| | | //修改分配个性产品:显示客户对应的分配个性产品 |
| | | $(document).on("click", ".action-modal-updateProduct", function () { |
| | | var clientId = $(this).data("id"); |
| | | $.get("GwClient.ashx", { action: "getPersonalityProduct", clientId: clientId }, function (result) { |
| | | if (!result.OK) { |
| | | mytek.alert(result.Message, result.OK); |
| | | } |
| | | else { |
| | | $("#updateProductDialog input[name='clientID']").val(clientId); |
| | | $("#updateProductDialog #_ProductId").prop("checked", false); |
| | | $.each(result.Message, function (i) { |
| | | $("#updateProductDialog #_ProductId[value='" + this + "']").prop("checked", true); |
| | | }); |
| | | } |
| | | $("#updateProductDialog").modal("show"); |
| | | }, "json"); |
| | | }); |
| | | |
| | | //修改分配个性产品:修改确认 |
| | | $(document).on("click", ".action-updateProduct", function () { |
| | | var productIdArray = []; |
| | | mytek.confirm("是否需要修改客户分配个性产品?", "确认分配个性产品,请谨慎操作!", function (b) { |
| | | if (b) { |
| | | $("#updateProductDialog #_ProductId").each(function () { |
| | | if ($(this).is(":checked")) { |
| | | productIdArray.push($(this).val()); |
| | | } |
| | | }); |
| | | |
| | | //var clientId = $("#updateProductDialog").data("id"); |
| | | var clientId = $("#updateProductDialog input[name='clientID']").val(); |
| | | $.ajax({ |
| | | url: "GwClient.ashx", |
| | | type: "POST", |
| | | data: { action: "updateProduct", clientId: clientId, productIdArray: $.toJSON(productIdArray) }, |
| | | success: function (result) { |
| | | if (result.OK) { |
| | | $("#updateProductDialog").modal("hide"); |
| | | loadPageList(); |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | mytek.alert(result.Message, result.OK); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //swal.close(); |
| | | } |
| | | }); |
| | | |
| | | //删除 |
| | | $(document).on("click", ".action-delete", function () { |
| | | var id = $(this).data("id"); |
| | | mytek.confirm("是否需要删除该客户?", "客户删除后将无法恢复,请谨慎操作!", function (b) { |
| | | if (b) { |
| | | $.post("gwclient.ashx", { action: "delete", clientID: id }, function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | window.location.reload(); |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | /** |
| | | //重置密码 |
| | | $(document).on("click", ".action-modal-resetPwd", function () { |
| | | var id = $(this).data("id"); |
| | | mytek.confirm("重置密码?", "是否重置密码?请谨慎操作!", function (b) { |
| | | if (b) { |
| | | $.post("gwclient.ashx", { action: "resetPwd", clientID: id }, function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | window.location.reload(); |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | **/ |
| | | |
| | | }) |
| | | |
| | | //全选 |
| | | $("#checkAll").click(function () { |
| | | $("input[name='checkbox']").prop("checked", $(this).is(":checked")); |
| | | }); |
| | | |
| | | //批量分配个性产品:打开界面 |
| | | $(document).on("click", ".action-modal-setProduct", function () { |
| | | var idArray = []; |
| | | |
| | | $("input[name='checkbox']:checkbox:checked").each(function () { |
| | | var id = $(this).val(); |
| | | idArray.push(id); |
| | | }); |
| | | |
| | | if (idArray.length == 0) { |
| | | mytek.alert("请选择要分配个性产品的客户!", false); |
| | | return; |
| | | } |
| | | |
| | | $("#selected-op-box").text(idArray.join(",")); |
| | | |
| | | $("#setProductDialog").modal("show"); |
| | | //充值 |
| | | $(document).on("click", ".action-modal-orderCreate", function () { |
| | | var clientId = $(this).data("id"); //客户账号 |
| | | //window.open("gwOrderCreate.aspx?spId=" + spID, 'gwOrderCreate'); |
| | | window.location.href = "gwOrderCreate.aspx?clientId=" + clientId; |
| | | }); |
| | | |
| | | //批量分配客户个性产品--确认修改 |
| | | $(document).on("click", ".action-update-setProduct", function () { |
| | | var idArray = []; |
| | | //充值日志 |
| | | $(document).on("click", ".action-modal-orderLog", function () { |
| | | var clientId = $(this).data("id"); |
| | | window.location.href = "GwOrderList.aspx?clientId=" + clientId + ""; |
| | | }); |
| | | |
| | | $("input[name='checkbox']:checkbox:checked").each(function () { |
| | | var id = $(this).val(); |
| | | idArray.push(id); |
| | | }); |
| | | |
| | | if (idArray.length == 0) { |
| | | mytek.alert("请选择要分配个性产品的客户!", false); |
| | | return; |
| | | //启用或停用 |
| | | $(document).on("click", ".action-modal-updateStatus", function () { |
| | | //data的属性参数不能含有大写字母。 |
| | | var clientId = $(this).data("id"); |
| | | var isEnable = $(this).data("status"); |
| | | var statusMsg = ""; |
| | | if (isEnable == 0) { |
| | | statusMsg = "【停用】"; |
| | | } |
| | | |
| | | var productId = $("#productId").val(); |
| | | |
| | | $.ajax({ |
| | | url: "GwClient.ashx", |
| | | method: "POST", |
| | | data: { idArray: $.toJSON(idArray), productId: productId, action: "batchUpdateClientProduct" }, |
| | | success: function (result) { |
| | | mytek.alert(result.Message, result.OK, function () { |
| | | $("#setProductDialog #productId").val(""); |
| | | $("#setProductDialog").modal("hide"); |
| | | loadPageList(); |
| | | else { |
| | | statusMsg = "【启用】"; |
| | | } |
| | | mytek.confirm("是否需要" + statusMsg + "该信息?", "确认更新信息状态,请谨慎操作!", function (b) { |
| | | if (b) { |
| | | $.post("gwclient.ashx", { "action": "updateStatus", clientId: clientId, isEnable: isEnable }, function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | loadPageList(); |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | //导出数据 |
| | | $(document).on("click", ".action-export", function () { |
| | | var ClientID = $("#ClientID").val(); |
| | | var Company = $("#Company").val(); |
| | | var ClientName = $("#ClientName").val(); |
| | | var Telephone = $("#Telephone").val(); |
| | | //var Agent = $("#Agent").val(); |
| | | var Agent = ""; |
| | | var Salesman = $("#Salesman").val(); |
| | | var SupportStaff = $("#SupportStaff").val(); |
| | | var ProductId = $("#ProductId").val(); |
| | | var IsEnable = <%=IsEnable%>; |
| | | var url = "ExportDocument.aspx?action=exportGwClient&ClientID=" + ClientID + "&Company=" + Company + "&ClientName=" + ClientName + "&Telephone=" + Telephone + "&Agent=" + Agent + "&Salesman=" + Salesman + "&SupportStaff=" + SupportStaff + "&ProductId=" + ProductId + "&IsEnable=" + IsEnable + ""; |
| | | |
| | | window.location.href = url; |
| | | }); |
| | | |
| | | |
| | | //添加客户:生成密码 |
| | | $(document).on("click", ".action-generate-password", function () { |
| | | $("#password").val(randomString(8)); |
| | | }); |
| | | |
| | | //添加客户:复制密码 |
| | | $(document).on("click", ".action-copyPwd", function () { |
| | | var value = $("#password").val(); |
| | | if (value == "") { |
| | | mytek.alert("请生成密码!"); |
| | | return false; |
| | | } |
| | | // for ie |
| | | if (window.clipboardData) { |
| | | window.clipboardData.clearData(); |
| | | window.clipboardData.setData('text', value); |
| | | } |
| | | // for modern browser |
| | | else if (document.execCommand) { |
| | | var element = document.createElement('SPAN'); |
| | | element.textContent = value; |
| | | document.body.appendChild(element); |
| | | if (document.selection) { |
| | | var range = document.body.createTextRange(); |
| | | range.moveToElementText(element); |
| | | range.select(); |
| | | } else if (window.getSelection) { |
| | | var range = document.createRange(); |
| | | range.selectNode(element); |
| | | window.getSelection().removeAllRanges(); |
| | | window.getSelection().addRange(range); |
| | | //删除 |
| | | $(document).on("click", ".action-delete", function () { |
| | | var id = $(this).data("id"); |
| | | mytek.confirm("是否需要删除该客户?", "客户删除后将无法恢复,请谨慎操作!", function (b) { |
| | | if (b) { |
| | | $.post("gwclient.ashx", { action: "delete", clientID: id }, function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | window.location.reload(); |
| | | }); |
| | | }); |
| | | } |
| | | document.execCommand('copy'); |
| | | element.remove ? element.remove() : element.removeNode(true); |
| | | } |
| | | mytek.alert("复制成功!", false); |
| | | |
| | | }); |
| | | }); |
| | | |
| | | //修改密码:生成密码 |
| | | $(document).on("click", ".action-generate-newPwd", function () { |
| | | $("#newPwd").val(randomString(8)); |
| | | }); |
| | | |
| | | //修改密码:复制密码 |
| | | $(document).on("click", ".action-copyNewPwd", function () { |
| | | var value = $("#newPwd").val(); |
| | | if (value == "") { |
| | | mytek.alert("请生成密码!"); |
| | | return false; |
| | | } |
| | | |
| | | // for ie |
| | | if (window.clipboardData) { |
| | | window.clipboardData.clearData(); |
| | | window.clipboardData.setData('text', value); |
| | | } |
| | | // for modern browser |
| | | else if (document.execCommand) { |
| | | var element = document.createElement('SPAN'); |
| | | element.textContent = value; |
| | | document.body.appendChild(element); |
| | | if (document.selection) { |
| | | var range = document.body.createTextRange(); |
| | | range.moveToElementText(element); |
| | | range.select(); |
| | | } else if (window.getSelection) { |
| | | var range = document.createRange(); |
| | | range.selectNode(element); |
| | | window.getSelection().removeAllRanges(); |
| | | window.getSelection().addRange(range); |
| | | /** |
| | | //重置密码 |
| | | $(document).on("click", ".action-modal-resetPwd", function () { |
| | | var id = $(this).data("id"); |
| | | mytek.confirm("重置密码?", "是否重置密码?请谨慎操作!", function (b) { |
| | | if (b) { |
| | | $.post("gwclient.ashx", { action: "resetPwd", clientID: id }, function (r) { |
| | | mytek.alert(r.Message, r.OK, function () { |
| | | window.location.reload(); |
| | | }); |
| | | }); |
| | | } |
| | | document.execCommand('copy'); |
| | | element.remove ? element.remove() : element.removeNode(true); |
| | | } |
| | | mytek.alert("复制成功!", false); |
| | | }); |
| | | }); |
| | | **/ |
| | | |
| | | }) |
| | | |
| | | |
| | | $("#pager").Pager({ |
| | | pageSize: 20, |
| | | onChange: function (pageIndex, pageSize) { |
| | | loadPageList(); |
| | | } |
| | | }); |
| | | |
| | | function loadPageList() { |
| | | var ClientID = $("#ClientID").val(); |
| | | var Company = $("#Company").val(); |
| | | var ClientName = $("#ClientName").val(); |
| | | var Telephone = $("#Telephone").val(); |
| | | //var Agent = $("#Agent").val(); |
| | | var Agent = ""; |
| | | var Salesman = $("#Salesman").val(); |
| | | var SupportStaff = $("#SupportStaff").val(); |
| | | var ProductId = $("#ProductId").val(); |
| | | var IsEnable = <%=IsEnable%>; |
| | | $.ajax({ |
| | | url: "GwClient.ashx", |
| | | type: "POST", |
| | | data: { action: "loadGwClientPageList", ClientID: ClientID, Company: Company, ClientName: ClientName, Telephone: Telephone, Agent: Agent, Salesman: Salesman, SupportStaff: SupportStaff, ProductId: ProductId, IsEnable: IsEnable , pageSize: $("#pager").Pager("getPageSize"), pageIndex: $("#pager").Pager("getPageIndex") }, |
| | | success: function (result) { |
| | | if (result.OK) { |
| | | $("#gwclientTable tbody").html(result.Message.Table); |
| | | $("#pager").Pager("setTotalCount", result.Message.TotalCount); |
| | | } else { |
| | | mytek.alert(result.Message, result.OK); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function randomString(len) { |
| | | len = len || 32; |
| | | var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/ |
| | | var maxPos = $chars.length; |
| | | var pwd = ''; |
| | | for (i = 0; i < len; i++) { |
| | | pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); |
| | | } |
| | | return pwd; |
| | | } |
| | | |
| | | //全选 |
| | | $("#checkAll").click(function () { |
| | | $("input[name='checkbox']").prop("checked", $(this).is(":checked")); |
| | | }); |
| | | |
| | | //批量分配个性产品:打开界面 |
| | | $(document).on("click", ".action-modal-setProduct", function () { |
| | | var idArray = []; |
| | | |
| | | $("input[name='checkbox']:checkbox:checked").each(function () { |
| | | var id = $(this).val(); |
| | | idArray.push(id); |
| | | }); |
| | | |
| | | if (idArray.length == 0) { |
| | | mytek.alert("请选择要分配个性产品的客户!", false); |
| | | return; |
| | | } |
| | | |
| | | $("#selected-op-box").text(idArray.join(",")); |
| | | |
| | | $("#setProductDialog").modal("show"); |
| | | }); |
| | | |
| | | //批量分配客户个性产品--确认修改 |
| | | $(document).on("click", ".action-update-setProduct", function () { |
| | | var idArray = []; |
| | | |
| | | $("input[name='checkbox']:checkbox:checked").each(function () { |
| | | var id = $(this).val(); |
| | | idArray.push(id); |
| | | }); |
| | | |
| | | if (idArray.length == 0) { |
| | | mytek.alert("请选择要分配个性产品的客户!", false); |
| | | return; |
| | | } |
| | | |
| | | var productId = $("#productId").val(); |
| | | |
| | | $.ajax({ |
| | | url: "GwClient.ashx", |
| | | method: "POST", |
| | | data: { idArray: $.toJSON(idArray), productId: productId, action: "batchUpdateClientProduct" }, |
| | | success: function (result) { |
| | | mytek.alert(result.Message, result.OK, function () { |
| | | $("#setProductDialog #productId").val(""); |
| | | $("#setProductDialog").modal("hide"); |
| | | loadPageList(); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | //导出数据 |
| | | $(document).on("click", ".action-export", function () { |
| | | var ClientID = $("#ClientID").val(); |
| | | var Company = $("#Company").val(); |
| | | var ClientName = $("#ClientName").val(); |
| | | var Telephone = $("#Telephone").val(); |
| | | //var Agent = $("#Agent").val(); |
| | | var Agent = ""; |
| | | var Salesman = $("#Salesman").val(); |
| | | var SupportStaff = $("#SupportStaff").val(); |
| | | var ProductId = $("#ProductId").val(); |
| | | var IsEnable = <%=IsEnable%>; |
| | | var url = "ExportDocument.aspx?action=exportGwClient&ClientID=" + ClientID + "&Company=" + Company + "&ClientName=" + ClientName + "&Telephone=" + Telephone + "&Agent=" + Agent + "&Salesman=" + Salesman + "&SupportStaff=" + SupportStaff + "&ProductId=" + ProductId + "&IsEnable=" + IsEnable + ""; |
| | | |
| | | window.location.href = url; |
| | | }); |
| | | |
| | | |
| | | //添加客户:生成密码 |
| | | $(document).on("click", ".action-generate-password", function () { |
| | | $("#password").val(randomString(8)); |
| | | }); |
| | | |
| | | //添加客户:复制密码 |
| | | $(document).on("click", ".action-copyPwd", function () { |
| | | var value = $("#password").val(); |
| | | if (value == "") { |
| | | mytek.alert("请生成密码!"); |
| | | return false; |
| | | } |
| | | // for ie |
| | | if (window.clipboardData) { |
| | | window.clipboardData.clearData(); |
| | | window.clipboardData.setData('text', value); |
| | | } |
| | | // for modern browser |
| | | else if (document.execCommand) { |
| | | var element = document.createElement('SPAN'); |
| | | element.textContent = value; |
| | | document.body.appendChild(element); |
| | | if (document.selection) { |
| | | var range = document.body.createTextRange(); |
| | | range.moveToElementText(element); |
| | | range.select(); |
| | | } else if (window.getSelection) { |
| | | var range = document.createRange(); |
| | | range.selectNode(element); |
| | | window.getSelection().removeAllRanges(); |
| | | window.getSelection().addRange(range); |
| | | } |
| | | document.execCommand('copy'); |
| | | element.remove ? element.remove() : element.removeNode(true); |
| | | } |
| | | mytek.alert("复制成功!", false); |
| | | |
| | | }); |
| | | </script> |
| | | |
| | | |
| | | //修改密码:生成密码 |
| | | $(document).on("click", ".action-generate-newPwd", function () { |
| | | $("#newPwd").val(randomString(8)); |
| | | }); |
| | | |
| | | //修改密码:复制密码 |
| | | $(document).on("click", ".action-copyNewPwd", function () { |
| | | var value = $("#newPwd").val(); |
| | | if (value == "") { |
| | | mytek.alert("请生成密码!"); |
| | | return false; |
| | | } |
| | | |
| | | // for ie |
| | | if (window.clipboardData) { |
| | | window.clipboardData.clearData(); |
| | | window.clipboardData.setData('text', value); |
| | | } |
| | | // for modern browser |
| | | else if (document.execCommand) { |
| | | var element = document.createElement('SPAN'); |
| | | element.textContent = value; |
| | | document.body.appendChild(element); |
| | | if (document.selection) { |
| | | var range = document.body.createTextRange(); |
| | | range.moveToElementText(element); |
| | | range.select(); |
| | | } else if (window.getSelection) { |
| | | var range = document.createRange(); |
| | | range.selectNode(element); |
| | | window.getSelection().removeAllRanges(); |
| | | window.getSelection().addRange(range); |
| | | } |
| | | document.execCommand('copy'); |
| | | element.remove ? element.remove() : element.removeNode(true); |
| | | } |
| | | mytek.alert("复制成功!", false); |
| | | |
| | | }); |
| | | |
| | | </script> |
| | | </asp:Content> |
| | | <asp:Content ID="Content2" ContentPlaceHolderID="title" runat="Server">客户信息</asp:Content> |
| | | <asp:Content ID="Content3" ContentPlaceHolderID="content" runat="Server"> |
| | |
| | | 是否启用白名单 |
| | | </label> |
| | | <div class="col-sm-4"> |
| | | <input type="radio" class="icheck-me" name="isEnableWhite" value="0" /><label>禁用</label> |
| | | <input type="radio" class="icheck-me" name="isEnableWhite" value="0" checked="checked" /><label>禁用</label> |
| | | <input type="radio" class="icheck-me" name="isEnableWhite" value="1" /><label>启用</label> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="modal-footer"> |
| | | <button class="btn-default btn" data-dismiss="modal" aria-hidden="true"> |
| | | 取消</button> |
| | | <a class="btn btn-primary action-updateProduct"> |
| | | 保存</a> |
| | | <button class="btn btn-primary action-updateProduct" data-dismiss="modal" aria-hidden="true"> |
| | | 保存</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <!-- footBar --> |
| | | <div id="mask" class="mask"> |
| | | <span></span> |
| | | <img src="img/spinning-circles.svg" alt="载入中..." /> |
| | | </div> |
| | | </asp:Content> |
| | | |