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 |  147 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 143 insertions(+), 4 deletions(-)

diff --git a/web/web/GwClient.aspx b/web/web/GwClient.aspx
index 05a73a2..2a28525 100644
--- a/web/web/GwClient.aspx
+++ b/web/web/GwClient.aspx
@@ -14,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);
@@ -32,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;
@@ -57,6 +119,11 @@
                     $("#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() {
@@ -333,6 +400,77 @@
             </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">&times;</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>&nbsp;&nbsp;
+                    <button class="btn btn-primary action-client-save">
+                        纭畾鎺ㄩ��</button>
+                </div>
+            </div>
+        </div>
+        </form>
     </div>
 
     <form name="queryForm" method="post" id="queryForm" class="form-inline">
@@ -368,8 +506,9 @@
     </div>
     <div class="form-group">
         <div class="input-group m-b">
-            <input type="button" value="鏌ヨ" class="btn btn-primary action-query" />&nbsp
-            <input class="btn btn-success action-modal-create" value="鍒涘缓瀹㈡埛" type="button" />
+            <input type="button" value="鏌ヨ" class="btn btn-primary action-query" />&nbsp;&nbsp;
+            <input class="btn btn-success action-modal-create" value="鍒涘缓瀹㈡埛" type="button" />&nbsp;&nbsp;
+            <input class="btn btn-success action-modal-client-product" value="鎺ㄩ�佽处鎴蜂骇鍝�" type="button" />
         </div>
         
     </div>

--
Gitblit v1.9.1