From 6c4ea53f92500f49959013c36b5c67fed25cd791 Mon Sep 17 00:00:00 2001 From: yzh <snbbt@21cn.com> Date: 星期一, 11 十月 2021 19:00:15 +0800 Subject: [PATCH] 产品分配账户 --- web/web/GwClient.aspx | 197 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 183 insertions(+), 14 deletions(-) diff --git a/web/web/GwClient.aspx b/web/web/GwClient.aspx index 83637f5..2a28525 100644 --- a/web/web/GwClient.aspx +++ b/web/web/GwClient.aspx @@ -1,6 +1,8 @@ 锘�<%@ Page Language="C#" masterpagefile="~/Main.master" AutoEventWireup="true" CodeFile="GwClient.aspx.cs" Inherits="_GwClient" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> + <%--<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> $(function() { @@ -12,14 +14,15 @@ }); function loadPageList() { - var ClientID = $("#ClientID").val(); + var ClientID = $("#ClientID").val(); + var Company = $("#Company").val(); var ClientName = $("#ClientName").val(); var Telephone = $("#Telephone").val(); var Agent = $("#Agent").val(); $.ajax({ url: "GwClient.ashx", type: "POST", - data: { action: "loadGwClientPageList", ClientID: ClientID, ClientName: ClientName, Telephone: Telephone, Agent: Agent, pageSize: $("#pager").Pager("getPageSize"), pageIndex: $("#pager").Pager("getPageIndex") }, + data: { action: "loadGwClientPageList", ClientID: ClientID, Company: Company, ClientName: ClientName, Telephone: Telephone, Agent: Agent, pageSize: $("#pager").Pager("getPageSize"), pageIndex: $("#pager").Pager("getPageIndex") }, success: function(result) { if (result.OK) { $("#gwclientTable tbody").html(result.Message.Table); @@ -30,6 +33,67 @@ } }); } + + //寰呮帹閫佽处鎴蜂骇鍝�-鏄剧ず璐︽埛鍒楄〃 + function loadClientList() { + $.ajax({ + url: "GwClient.ashx", + type: "POST", + data: { action: "loadGwClientAllPageList", pageSize: $("#clientProductPager").Pager("getPageSize"), pageIndex: $("#clientProductPager").Pager("getPageIndex") }, + success: function (result) { + if (result.OK) { + $("#gwclientProductTable tbody").html(result.Message.Table); + $("#clientProductPager").Pager("setTotalCount", result.Message.TotalCount); + } else { + mytek.alert(result.Message, result.OK); + } + } + }); + $("#clientProductDialog .modal-title").text("鎺ㄩ�佽处鎴蜂骇鍝�"); + $("#clientProductDialog input[name=action]").val("loadGwClientAllPageList"); + $("#clientProductDialog").modal("show"); + } + + //鍏ㄩ�� + $("#checkAll").click(function () { + $("input[name='checkbox']").prop("checked", $(this).is(":checked")); + }); + + //淇濆瓨寰呮帹閫佺殑璐︽埛 + $(document).on("click", ".action-client-save", 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 false; + } + + var product_id = $("#product_id").val(); + if (product_id == "") { + mytek.alert("璇烽�夋嫨瑕佸垎閰嶇殑浜у搧锛�", false); + return false; + } + + $.ajax({ + url: "GwClient.ashx", + type: "POST", + data: { action: "saveClientProduct", idArray: $.toJSON(idArray), product_id: product_id }, + success: function (result) { + if (r.OK) { + $("#clientProductDialog").modal("show"); + } + else { + mytek.alert(r.Message, r.OK); + } + } + }); + + }); function randomString(len) { len = len || 32; @@ -51,10 +115,15 @@ loadPageList(); $(document).on("click", ".action-modal-create", function() { - $("#clientDialog .modal-title").text("鍒涘缓瀹㈡埛璧勬枡"); + $("#clientDialog .modal-title").text("鍒涘缓瀹㈡埛璐︽埛"); $("#clientDialog input").attr("readonly", false); $("#clientDialog input[name=action]").val("save"); $("#clientDialog").modal("show"); + }); + + //鎺ㄩ�佽处鎴蜂骇鍝� + $(document).on("click", ".action-modal-client-product", function () { + loadClientList(); }); $(document).on("click", ".action-generate-password", function() { @@ -151,6 +220,8 @@ }); }) + + }); </script> </asp:Content> @@ -216,6 +287,8 @@ </div> </form> </div> + + <!--鍒涘缓瀹㈡埛璐︽埛闈㈡澘 --> <div class="modal inmodal fade" id="clientDialog" tabindex="-1" role="dialog" aria-hidden="true"> <form name="clientForm" method="post" action="gwclient.ashx" id="clientForm" class="form-horizontal"> <div class="modal-dialog modal-lg"> @@ -232,13 +305,25 @@ <div class="modal-body"> <div class="form-group"> <label class="control-label col-sm-2"> - 鐧诲綍璐﹀彿 + 鐧诲綍璐︽埛 </label> <div class="col-sm-4"> <input type="text" name="clientID" id="clientID" value="" class="form-control" /> </div> - <span class="help-block m-b-none"><i class="fa fa-exclamation-triangle"></i>璇疯緭鍏ュ叕鍙稿崟浣嶅悕绉�</span> + <!--<span class="help-block m-b-none"><i class="fa fa-exclamation-triangle"></i>璇疯緭鍏ュ叕鍙稿崟浣嶅悕绉�</span>--> </div> + + <div class="form-group"> + <label class="control-label col-sm-2"> + 鍏徃鍚嶇О(鍏ㄧО) + </label> + <div class="col-sm-4"> + <input type="text" name="company" id="company" value="" class="form-control" /> + </div> + <!--<span class="help-block m-b-none"><i class="fa fa-exclamation-triangle"></i>璇疯緭鍏ュ叕鍙稿崟浣嶅悕绉�</span>--> + </div> + + <div class="form-group"> <label class="control-label col-sm-2"> 鐧诲綍瀵嗙爜 @@ -275,12 +360,19 @@ </div> <div class="form-group"> <label class="control-label col-sm-2"> - 涓氬姟鍛� + 褰掑睘涓氬姟鍛� </label> <div class="col-sm-4"> <input type="text" name="agent" id="agent" value="" class="form-control" /> </div> </div> + <div class="form-group"> + <label class="control-label col-sm-2">钀ヤ笟鎵х収</label> + <div class="col-sm-4"> + <input type="file" name="txt_file" id="txt_file" class="file-loading" /> + </div> + </div> + <div class="form-group"> <label class="control-label col-sm-2"> 鏉冮檺绠$悊 @@ -308,12 +400,90 @@ </div> </div> </form> + </div> + + <!--鎺ㄩ�佽处鎴蜂骇鍝侀潰鏉� --> + <div class="modal inmodal fade" id="clientProductDialog" tabindex="-1" role="dialog" aria-hidden="true"> + <form name="clientProductForm" method="post" action="gwclient.ashx" id="clientProductForm" class="form-horizontal"> + <div class="modal-dialog modal-lg"> + <div class="modal-content "> + <input name="action" value="client-product" type="hidden" /> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal"> + <span aria-hidden="true">×</span><span class="sr-only">Close</span></button> + <h4 class="modal-title"> + 鎺ㄩ�佽处鎴蜂骇鍝� + </h4> + </div> + <div class="form-group"> + <label class="col-sm-4 control-label"> + 閫夋嫨浜у搧</label> + <div class="col-sm-6 input-group"> + <select class="form-control" name="product_id" id="product_id"> + <%=GetGwProductOptionsAll() %> + </select> + </div> + </div> + + <div class="table-responsive"> + <table class="table table-striped table-bordered table-hover" id="gwclientProductTable"> + <thead> + <tr class="header"> + <th> + <input type='checkbox' name='checkAll' id='checkAll' /> + </th> + <th> + 瀹㈡埛璐﹀彿 + </th> + <th>鍏徃鍚嶇О</th> + <th> + 鑱旂郴浜� + </th> + <th> + 鑱旂郴鐢佃瘽 + </th> + <th> + 绱鍏呭�� + </th> + + <th> + 涓氬姟鍛� + </th> + <th> + 璁よ瘉鐘舵�� + </th> + </tr> + </thead> + <tbody> + </tbody> + + </table> + </div> + <div id="clientProductPager"> + </div> + + <div class="modal-footer"> + <button class="btn btn-warning" data-dismiss="modal" aria-hidden="true"> + 鍙栨秷</button> + <button class="btn btn-primary action-client-save"> + 纭畾鎺ㄩ��</button> + </div> + </div> + </div> + </form> </div> + <form name="queryForm" method="post" id="queryForm" class="form-inline"> <div class="form-group"> <div class="input-group m-b"> <span class="input-group-addon">瀹㈡埛璐﹀彿</span> <input type="text" name="ClientID" id="ClientID" class="form-control" /> + </div> + </div> + <div class="form-group"> + <div class="input-group m-b"> + <span class="input-group-addon">鍏徃鍚嶇О</span> + <input type="text" name="Company" id="Company" class=" form-control" /> </div> </div> <div class="form-group"> @@ -336,16 +506,14 @@ </div> <div class="form-group"> <div class="input-group m-b"> - <input type="button" value="鏌ヨ" class="btn btn-primary action-query" />  - <input class="btn btn-success action-modal-create" value="鍒涘缓瀹㈡埛" type="button" /> + <input type="button" value="鏌ヨ" class="btn btn-primary action-query" /> + <input class="btn btn-success action-modal-create" value="鍒涘缓瀹㈡埛" type="button" /> + <input class="btn btn-success action-modal-client-product" value="鎺ㄩ�佽处鎴蜂骇鍝�" type="button" /> </div> - - - - </div> </form> + <div class="table-responsive"> <table class="table table-striped table-bordered table-hover" id="gwclientTable"> <thead> @@ -353,6 +521,7 @@ <th> 瀹㈡埛璐﹀彿 </th> + <th>鍏徃鍚嶇О</th> <th> 鑱旂郴浜� </th> @@ -360,14 +529,14 @@ 鑱旂郴鐢佃瘽 </th> <th> - 鎬婚噾棰�/浣欓 + 绱鍏呭�� </th> <th> 涓氬姟鍛� </th> <th> - 澶囨敞 + 璁よ瘉鐘舵�� </th> <th> 鎿嶄綔 -- Gitblit v1.9.1