From 203edd6bbdf883e897a0075037a4ef68cd519ac9 Mon Sep 17 00:00:00 2001 From: yzh <snbbt@21cn.com> Date: 星期四, 23 六月 2022 00:07:56 +0800 Subject: [PATCH] 系统账户管理列表用户角色显示优化 --- web/web/Bin/Dao.dll | 0 web/web/Bin/Common.pdb | 0 web/Lib/Common.dll | 0 web/Lib/Model.pdb | 0 web/Model/Model/SysUser.cs | 6 web/web/GwClient.aspx.cs | 2 web/Dao/GwClientDao.cs | 2 web/Lib/Dao.dll | 0 web/Lib/Common.pdb | 0 web/web/SysUser.aspx | 6 web/web/Bin/Common.dll | 0 web/web/Bin/Model.pdb | 0 web/.vs/Web/v16/.suo | 0 web/Lib/Model.dll | 0 web/Dao/UserDao.cs | 18 web/web/GwClient.aspx | 965 ++++++++++++++++++++++++++++---------------------------- web/web/GwOrderCreate.aspx | 2 web/web/GwOrderAudit.aspx | 3 web/web/Bin/Model.dll | 0 web/Lib/Dao.pdb | 0 web/web/Bin/Dao.pdb | 0 web/Common/DataConverter.cs | 2 22 files changed, 518 insertions(+), 488 deletions(-) diff --git a/web/.vs/Web/v16/.suo b/web/.vs/Web/v16/.suo index b55a07d..7f0360c 100644 --- a/web/.vs/Web/v16/.suo +++ b/web/.vs/Web/v16/.suo Binary files differ diff --git a/web/Common/DataConverter.cs b/web/Common/DataConverter.cs index 652c45d..39c3785 100644 --- a/web/Common/DataConverter.cs +++ b/web/Common/DataConverter.cs @@ -252,7 +252,7 @@ //妫�鏌ユ暟缁勬牸寮忓瓧绗︿覆涓槸鍚﹀寘鍚煇鍏冪礌 public static bool checkStrForArrayStr(object str, string arrayStr ) { - return stringToArray(arrayStr).Contains(str); + return stringToArray(arrayStr).Contains(str.ToString() ); } //妫�鏌ユ暟缁勪腑鏄惁鍖呭惈鏌愬厓绱� diff --git a/web/Dao/GwClientDao.cs b/web/Dao/GwClientDao.cs index a8de674..93929f7 100644 --- a/web/Dao/GwClientDao.cs +++ b/web/Dao/GwClientDao.cs @@ -543,7 +543,7 @@ /** * 鍑芥暟鎻忚堪锛� 鏍规嵁瀹㈡埛ID鑾峰彇鍒嗛厤鐨勪釜鎬т骇鍝� * clientId: 瀹㈡埛鎴稩D - * userType: 鐢ㄦ埛绫诲瀷锛�1-绠$悊鍛�;2-涓氬姟鍛�--鍏ㄥ憳;3-涓氬姟涓荤;4-涓氬姟鎬荤洃;5-瀹㈡湇浜哄憳;6-璐㈠姟浜哄憳;99-鍏朵粬 + * userType: 鐢ㄦ埛绫诲瀷锛屽涓椂浠モ��,鈥濆垎闅旓細1-绠$悊鍛�;2-涓氬姟鍛�--鍏ㄥ憳;3-瀹㈡埛缁忕悊;4-瀹㈡湇浜哄憳;5-璐㈠姟浜哄憳 * return: SQL瀛楃涓� * */ diff --git a/web/Dao/UserDao.cs b/web/Dao/UserDao.cs index 8ae5992..3e8e6d3 100644 --- a/web/Dao/UserDao.cs +++ b/web/Dao/UserDao.cs @@ -34,12 +34,25 @@ { List<SysUser> list = new List<SysUser>(); recordCount = 0; - using (OracleDataReader reader = OracleHelper.ExecuteReader("select count(*) as count from Sys_User", OracleHelper.Connection)) + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append(" FROM ( "); + stringBuilder.Append(" SELECT su.*, t.ROLE_NAMES FROM sys_user su "); + stringBuilder.Append(" LEFT JOIN ( "); + stringBuilder.Append(" select su.user_id, wm_concat( sdd.dict_label) ROLE_NAMES from sys_user su "); + stringBuilder.Append(" LEFT JOIN (select DICT_VALUE, DICT_LABEL from sys_dict_data where dict_type='USER_ROLE' ) sdd "); + stringBuilder.Append(" on INSTR (user_type, sdd.dict_value) > 0 "); + stringBuilder.Append(" GROUP BY su.user_id "); + stringBuilder.Append(" ) t on t.user_id = su.user_id "); + stringBuilder.Append(" ) "); + + //using (OracleDataReader reader = OracleHelper.ExecuteReader("select count(*) as count from Sys_User", OracleHelper.Connection)) + using (OracleDataReader reader = OracleHelper.ExecuteReader("select count(*) as count " + stringBuilder.ToString(), OracleHelper.Connection)) { while (((DbDataReader)reader).Read()) recordCount = this.ReadCount(reader); } - using (OracleDataReader reader = OracleHelper.ExecuteReader(PubConstant.doOracleSql(pageIndex, pageSize, recordCount, "select * from Sys_User").ToString(), OracleHelper.Connection)) + //using (OracleDataReader reader = OracleHelper.ExecuteReader(PubConstant.doOracleSql(pageIndex, pageSize, recordCount, "select * from Sys_User").ToString(), OracleHelper.Connection)) + using (OracleDataReader reader = OracleHelper.ExecuteReader(PubConstant.doOracleSql(pageIndex, pageSize, recordCount, "select * " + stringBuilder.ToString() ).ToString(), OracleHelper.Connection)) { while (((DbDataReader)reader).Read()) { @@ -197,6 +210,7 @@ e.Salt = oracleReaderWrapper.GetString("SALT", ""); e.UserName = oracleReaderWrapper.GetString("USER_NAME", ""); e.UserType = oracleReaderWrapper.GetString("USER_TYPE", ""); + e.RoleNames = oracleReaderWrapper.GetString("ROLE_NAMES", ""); e.ExpireTime = oracleReaderWrapper.GetDateTime("EXPIRE_TIME"); e.CreateTime = oracleReaderWrapper.GetDateTime("CREATE_TIME"); e.Remark = oracleReaderWrapper.GetString("REMARK", ""); diff --git a/web/Lib/Common.dll b/web/Lib/Common.dll index f246c47..81f812b 100644 --- a/web/Lib/Common.dll +++ b/web/Lib/Common.dll Binary files differ diff --git a/web/Lib/Common.pdb b/web/Lib/Common.pdb index 5690ec3..64958ca 100644 --- a/web/Lib/Common.pdb +++ b/web/Lib/Common.pdb Binary files differ diff --git a/web/Lib/Dao.dll b/web/Lib/Dao.dll index ab96b82..13df0d2 100644 --- a/web/Lib/Dao.dll +++ b/web/Lib/Dao.dll Binary files differ diff --git a/web/Lib/Dao.pdb b/web/Lib/Dao.pdb index 87cb143..4c8353c 100644 --- a/web/Lib/Dao.pdb +++ b/web/Lib/Dao.pdb Binary files differ diff --git a/web/Lib/Model.dll b/web/Lib/Model.dll index 2ea70b8..809b332 100644 --- a/web/Lib/Model.dll +++ b/web/Lib/Model.dll Binary files differ diff --git a/web/Lib/Model.pdb b/web/Lib/Model.pdb index ddc6ae1..022af82 100644 --- a/web/Lib/Model.pdb +++ b/web/Lib/Model.pdb Binary files differ diff --git a/web/Model/Model/SysUser.cs b/web/Model/Model/SysUser.cs index 9058685..f2e474f 100644 --- a/web/Model/Model/SysUser.cs +++ b/web/Model/Model/SysUser.cs @@ -41,10 +41,12 @@ public string ClientIp { get; set; } public int Status { get; set; } - - //public int UserType { get; set; } //鐢ㄦ埛绫诲瀷:1-绠$悊鍛�;2-涓氬姟鍛�--鍏ㄥ憳;3-涓氬姟涓荤;4-涓氬姟鎬荤洃;5-瀹㈡湇浜哄憳;6-璐㈠姟浜哄憳;99-鍏朵粬 + + //public int UserType { get; set; } //鐢ㄦ埛绫诲瀷锛屽涓椂浠モ��,鈥濆垎闅旓細1-绠$悊鍛�;2-涓氬姟鍛�--鍏ㄥ憳;3-瀹㈡埛缁忕悊;4-瀹㈡湇浜哄憳;5-璐㈠姟浜哄憳 public string UserType { get; set; } //鍏宠仈瀛楀吀鏁版嵁琛ㄧ殑绫诲瀷涓猴細USER_ROLE銆傚涓鑹叉椂浠ュ崐瑙掆��,鈥濆垎闅斻�� + public string RoleNames { get; set; } //瑙掕壊鍚嶇О锛氬涓鑹叉椂浠ュ崐瑙掆��,鈥濆垎闅斻�� + public Dictionary<string, SysUserMenu> MenuIDList { get; set; } public bool HasRight(string code) diff --git a/web/web/Bin/Common.dll b/web/web/Bin/Common.dll index f246c47..81f812b 100644 --- a/web/web/Bin/Common.dll +++ b/web/web/Bin/Common.dll Binary files differ diff --git a/web/web/Bin/Common.pdb b/web/web/Bin/Common.pdb index 5690ec3..64958ca 100644 --- a/web/web/Bin/Common.pdb +++ b/web/web/Bin/Common.pdb Binary files differ diff --git a/web/web/Bin/Dao.dll b/web/web/Bin/Dao.dll index ab96b82..13df0d2 100644 --- a/web/web/Bin/Dao.dll +++ b/web/web/Bin/Dao.dll Binary files differ diff --git a/web/web/Bin/Dao.pdb b/web/web/Bin/Dao.pdb index 87cb143..4c8353c 100644 --- a/web/web/Bin/Dao.pdb +++ b/web/web/Bin/Dao.pdb Binary files differ diff --git a/web/web/Bin/Model.dll b/web/web/Bin/Model.dll index 2ea70b8..809b332 100644 --- a/web/web/Bin/Model.dll +++ b/web/web/Bin/Model.dll Binary files differ diff --git a/web/web/Bin/Model.pdb b/web/web/Bin/Model.pdb index ddc6ae1..022af82 100644 --- a/web/web/Bin/Model.pdb +++ b/web/web/Bin/Model.pdb Binary files differ diff --git a/web/web/GwClient.aspx b/web/web/GwClient.aspx index 987c26f..0b50c2b 100644 --- a/web/web/GwClient.aspx +++ b/web/web/GwClient.aspx @@ -4,513 +4,521 @@ <%--<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"> @@ -800,7 +808,7 @@ 鏄惁鍚敤鐧藉悕鍗� </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> @@ -1061,12 +1069,17 @@ <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> diff --git a/web/web/GwClient.aspx.cs b/web/web/GwClient.aspx.cs index a1f8810..11ff8cb 100644 --- a/web/web/GwClient.aspx.cs +++ b/web/web/GwClient.aspx.cs @@ -274,7 +274,7 @@ //妫�鏌ユ暟缁勬牸寮忓瓧绗︿覆涓槸鍚﹀寘鍚煇鍏冪礌 public static bool checkStrForArrayStr(object str, string arrayStr) { - return stringToArray(arrayStr).Contains(str); + return stringToArray(arrayStr).Contains(str.ToString()); } //瀛楃涓茶浆鏁扮粍 diff --git a/web/web/GwOrderAudit.aspx b/web/web/GwOrderAudit.aspx index 959674b..b19e7fd 100644 --- a/web/web/GwOrderAudit.aspx +++ b/web/web/GwOrderAudit.aspx @@ -189,8 +189,7 @@ mytek.alert(result.Message, result.OK, function () { loadPageList(); }); - }, - "json"); + }, "json"); } }); }); diff --git a/web/web/GwOrderCreate.aspx b/web/web/GwOrderCreate.aspx index 05c5cfb..542861c 100644 --- a/web/web/GwOrderCreate.aspx +++ b/web/web/GwOrderCreate.aspx @@ -186,7 +186,7 @@ mytek.alert(r.Message, r.OK, function () { if (r.OK) { - window.location = "GwSp.aspx"; + window.location = "<%=backUrl%>"; } else { mytek.alert(r.Message, false); } diff --git a/web/web/SysUser.aspx b/web/web/SysUser.aspx index 1cf539a..baf8456 100644 --- a/web/web/SysUser.aspx +++ b/web/web/SysUser.aspx @@ -18,8 +18,10 @@ var html = []; $.each(result.Message.Table, function(i) { html.push("<tr>"); - html.push("<td>" + this.Account + "</td>"); + html.push("<td>" + this.Account + "</td>"); html.push("<td>" + this.UserName + "</td>"); + html.push("<td>" + this.RoleNames + "</td>"); + /** if (this.UserType == 1) { html.push("<td>" + "绠$悊鍛�" + "</td>"); } @@ -43,7 +45,7 @@ } else { html.push("<td>" + "" + "</td>"); - } + }**/ html.push("<td>" + this.Mobile + "</td>"); html.push("<td>" + formatFlagIcon(this.MobileFlag) + "</td>"); -- Gitblit v1.9.1