From 3558b1019464c2daa10eaa8f169ab531f502deba Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期三, 12 三月 2025 14:30:15 +0800
Subject: [PATCH] 供应商:增加联系人 子表

---
 WebTM/views/基础资料/采购基础资料/Gy_Supplier_Edit.html     |  317 +++++++++++++++++++++++++++++++++++++++++++---------
 WebTM/Properties/PublishProfiles/JFTM.pubxml.user |    6 
 2 files changed, 263 insertions(+), 60 deletions(-)

diff --git a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
index fbcdf80..311576c 100644
--- a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
+++ b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -3862,13 +3862,13 @@
       <publishTime>01/10/2025 16:08:00</publishTime>
     </File>
     <File Include="views/鍩虹璧勬枡/閲囪喘鍩虹璧勬枡/Gy_Supplier_Edit.html">
-      <publishTime>12/31/2024 10:12:44</publishTime>
+      <publishTime>03/12/2025 13:32:20</publishTime>
     </File>
     <File Include="views/鍩虹璧勬枡/閲囪喘鍩虹璧勬枡/Gy_Supplier_Edit.html">
-      <publishTime>12/31/2024 10:12:44</publishTime>
+      <publishTime>03/12/2025 13:32:20</publishTime>
     </File>
     <File Include="views/鍩虹璧勬枡/閲囪喘鍩虹璧勬枡/Gy_Supplier_Edit.html">
-      <publishTime>12/31/2024 10:12:44</publishTime>
+      <publishTime>03/12/2025 13:32:20</publishTime>
     </File>
     <File Include="views/鍩虹璧勬枡/閲囪喘鍩虹璧勬枡/Gy_Supplier_Excel.html">
       <publishTime>01/10/2025 16:08:00</publishTime>
diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\207\207\350\264\255\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Supplier_Edit.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\207\207\350\264\255\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Supplier_Edit.html"
index 578e6a0..2669576 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\207\207\350\264\255\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Supplier_Edit.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\207\207\350\264\255\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Supplier_Edit.html"
@@ -341,11 +341,24 @@
                     <input type="hidden" name="HMaker" id="HMaker"><!--鍒跺崟浜�-->
                     <div class="layui-tab" lay-filter="tab-POStockInBill">
                         <ul class="layui-tab-title" lay-filter="tab-all">
-                            <li lay-id="1" style="padding:1px;" class="layui-this">浠樻璁″垝</li>
+                            <li lay-id="1" style="padding:1px;" class="layui-this">鑱旂郴浜�</li>
+                            <li lay-id="2" style="padding:1px;">浠樻璁″垝</li>
                         </ul>
                         <div class="layui-tab-content">
-                            <!--瀛愯〃-->
+                            <!--鑱旂郴浜�-->
                             <div class="layui-tab-item layui-show">
+                                <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
+                                <script type="text/html" id="toolbarDemo1">
+                                    <div class="layui-btn-container">
+                                        <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button>
+                                        <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button>
+                                        <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Up"><i class="layui-icon layui-icon-form"></i>涓婄Щ</button>
+                                        <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Under"><i class="layui-icon layui-icon-form"></i>涓嬬Щ</button>
+                                    </div>
+                                </script>
+                            </div>
+                            <!--浠樻璁″垝-->
+                            <div class="layui-tab-item">
                                 <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                                 <script type="text/html" id="toolbarDemo">
                                     <div class="layui-btn-container">
@@ -360,6 +373,11 @@
             </div>
         </div>
     </div>
+    <!--椤圭洰闃舵琛細鍒犻櫎-->
+    <script type="text/html" id="barDemo1">
+        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">缂栬緫</a>-->
+        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+    </script>
     <!--椤圭洰闃舵琛細鍒犻櫎-->
     <script type="text/html" id="barDemo">
         <!--<a class="layui-btn layui-btn-xs" lay-event="edit">缂栬緫</a>-->
@@ -400,6 +418,7 @@
             //#endregion
 
             var option;
+            var option1;
             //#region 杩涘叆椤甸潰鏃㈠姞杞�
             $("#HCreator").val(sessionStorage["HUserName"]);//鍒涘缓浜�
             //鍒ゆ柇鎿嶄綔绫诲瀷
@@ -437,8 +456,8 @@
 
 
             //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
-
-            //澶村伐鍏锋爮浜嬩欢
+            //#region 瀛愯〃鐩稿叧鏂规硶-浠樻璁″垝
+            //#region 澶村伐鍏锋爮浜嬩欢
             table.on('toolbar(mainTable)', function (obj) {
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;
@@ -480,6 +499,7 @@
 
                 }
             });
+            //#endregion
 
             //#region 瀛愯〃锛氳鍐呬簨浠�
             table.on('tool(mainTable)', function (obj) {
@@ -489,6 +509,166 @@
             });
             //#endregion
 
+            //#region 琛屽唴鍒犻櫎-璁″垝琛�
+            function set_GridDelete(obj) {
+                var data = obj.data;
+                var rowIndex = $(obj.tr).attr("data-index");
+                if (obj.event === 'del') {
+                    layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
+                        console.log("绱㈠紩涓�:" + rowIndex);
+                        if (rowIndex === '0') {
+                            layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
+                        } else {
+                            var oldData = table.cache["mainTable"];
+                            oldData.splice(obj.tr.data('index'), 1)
+                            option.data = oldData;//灏嗘暟鎹粦瀹氬埌data涓�
+                            table.render(option);
+                            layer.close(index);
+                        }
+                    });
+                }
+            }
+            //#endregion
+            //#endregion
+
+            //#region 瀛愯〃鐩稿叧鏂规硶-鑱旂郴浜�
+            //#region 澶村伐鍏锋爮浜嬩欢
+            table.on('toolbar(mainTable1)', function (obj) {
+                var checkStatus = table.checkStatus('mainTable1')
+                    , data = checkStatus.data;
+                //鏂板琛岃〃鏍兼暟鎹�
+
+                var NewRow = {
+                    "HLinkMan": ""
+                    , "HLinkPhone": ""
+                    , "HRemark": ""
+                };
+                switch (obj.event) {
+                    case 'btn-AddLine':
+                        table.cache["mainTable1"].push(NewRow);
+                        option1.data = table.cache["mainTable1"];
+
+                        table.render(option1);
+                        //鍒锋柊澶嶉�夋
+                        //checkRefresh();
+                        break;
+                    case 'btn-CopyLine':
+                        var copydata = JSON.stringify(data);
+                        if (data.length <= 0) {
+                            layer.msg("璇烽�夋嫨闇�瑕佸鍒剁殑涓�琛岋紒");
+                        }
+                        else if (data.length > 1) {
+                            layer.msg("鍙兘閫夋嫨澶嶅埗涓�琛岋紒");
+                        }
+                        else {
+                            var copydata2 = copydata.substring(1, copydata.length);//鍘婚櫎棣栬瀛楃'['
+                            var copyrow = copydata2.substring(0, copydata2.length - 1);//鍘婚櫎鏈熬瀛楃']'
+                            table.cache["mainTable1"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂
+                            option1.data = table.cache["mainTable1"];//灏嗘暟鎹粦瀹氬埌data涓�
+                            table.render(option1);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+                            //鍒锋柊澶嶉�夋
+                            //checkRefresh();
+                        }
+                        break;
+                    //涓婄Щ
+                    case 'btn-Up': btn_up1();
+                        break;
+                    //涓嬬Щ
+                    case 'btn-Under': btn_under1();
+                        break;
+                }
+            });
+           //#endregion
+
+            //#region 瀛愯〃锛氳鍐呬簨浠�
+            table.on('tool(mainTable1)', function (obj) {
+                set_GridDelete1(obj);   //琛屽唴鍒犻櫎
+                /*set_GridCellCheck(obj); //琛屽唴蹇嵎閿瓫閫�*/
+            });
+            //#endregion
+
+            //#region 琛屽唴鍒犻櫎-鑱旂郴浜�
+            function set_GridDelete1(obj) {
+                var data = obj.data;
+                var rowIndex = $(obj.tr).attr("data-index");
+                if (obj.event === 'del') {
+                    layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
+                        console.log("绱㈠紩涓�:" + rowIndex);
+                        if (rowIndex === '0') {
+                            layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
+                        } else {
+                            var oldData = table.cache["mainTable1"];
+                            oldData.splice(obj.tr.data('index'), 1)
+                            option1.data = oldData;//灏嗘暟鎹粦瀹氬埌data涓�
+                            table.render(option1);
+                            layer.close(index);
+                        }
+                    });
+                }
+            }
+            //#endregion
+
+            //#region 涓婄Щ
+            function btn_up1() {
+                var checkStatus = table.checkStatus('mainTable1')
+                    , data = checkStatus.data;
+                if (data.length == 1) {
+                    var tables = [];
+                    //鑾峰彇琛ㄦ牸鐨勫叏閮ㄨ
+                    var rowList = table.cache['mainTable1'];
+                    for (var i = 0; i < rowList.length; i++) {          //閬嶅巻琛ㄦ牸鐨勮
+                        if (rowList[i].LAY_CHECKED == true) {           //鑾峰彇閫変腑琛岀殑浣嶇疆
+                            //濡傛灉鏄涓�琛屼笂绉伙紝鍒欏け璐ュ苟鎻愰啋
+                            if (i == 0) {
+                                layer.msg("绗竴琛屾暟鎹棤娉曚笂绉伙紒");
+                                return;
+                            }
+                            tables.push(option1.data[i - 1]);
+                            data[0].LAY_CHECKED = true;
+                            option1.data[i - 1] = data[0];
+                            option1.data[i] = tables[0];
+                            table.render(option1);
+                            break;
+                        }
+                    }
+                } else {
+                    layer.msg("璇烽�夋嫨涓�琛屾暟鎹紒");
+                }
+            }
+            //#endregion
+
+            //#region 涓嬬Щ
+            function btn_under1() {
+                var checkStatus = table.checkStatus('mainTable1')
+                    , data = checkStatus.data;
+                if (data.length == 1) {
+                    var tables = [];
+                    //鑾峰彇琛ㄦ牸鐨勫叏閮ㄨ
+                    var rowList = table.cache['mainTable1'];
+                    for (var i = 0; i < rowList.length; i++) {          //閬嶅巻琛ㄦ牸鐨勮
+                        if (rowList[i].LAY_CHECKED == true) {           //鑾峰彇閫変腑琛岀殑浣嶇疆
+                            //濡傛灉鏄渶鍚庝竴琛屼笅绉伙紝鍒欏け璐ュ苟鎻愰啋
+                            if (i == option1.data.length - 1) {
+                                layer.msg("鏈�鍚庝竴琛屾暟鎹棤娉曚笅绉伙紒");
+                                return;
+                            }
+
+                            tables.push(option1.data[i + 1]);
+                            data[0].LAY_CHECKED = true;
+                            option1.data[i + 1] = data[0];
+                            option1.data[i] = tables[0];
+                            table.render(option1);
+                            break;
+                        }
+                    }
+                } else {
+                    layer.msg("璇烽�夋嫨涓�琛屾暟鎹紒");
+                }
+            }
+            //#endregion
+            //#endregion
+
+            //#region 寮圭獥鐩戝惉
             //缁撶畻鏂瑰紡寮圭獥
             form.on('submit(btnSearchProc)', function () {
                 //椤甸潰灞�-鑷畾涔�
@@ -656,6 +836,18 @@
                 });
             });
 
+            //鍒涘缓缁勭粐
+            form.on('submit(HCreateOrgID_BT)', function () {
+                HCreateOrgID_BT();
+            });
+
+            //浣跨敤缁勭粐
+            form.on('submit(HUseOrgID_BT)', function () {
+                HUseOrgID_BT();
+            });
+            //#endregion 
+
+            //#region 鎿嶄綔鎸夐挳鐩戝惉
             //淇濆瓨
             form.on('submit(Saver)', function (data) {//鎻愪氦
                 var ModRightNameAdd = 'Gy_Supplier_Edit';
@@ -674,8 +866,19 @@
                 //瀛愯〃搴忓垪鍖�
                 var sSubStr = JSON.stringify(num);
 
+                //瀛愯〃
+                var num1 = [];
+                for (var i = 0; i < table.cache["mainTable1"].length; i++) {
+                    if (table.cache["mainTable1"][i] != "") {
+                        table.cache["mainTable1"][i].LAY_TABLE_INDEX = i;
+                        num1.push(table.cache["mainTable1"][i])
+                    }
+                }
+                //瀛愯〃搴忓垪鍖�
+                var sSubStr1 = JSON.stringify(num1);
+
                 var oMain = JSON.stringify(data.field)
-                var sBillModeify = oMain + ';' + sSubStr + ';' + linterid + ';' + user + ';' + ModRightNameAdd;
+                var sBillModeify = oMain + ';' + sSubStr + ';' + linterid + ';' + user + ';' + ModRightNameAdd + ';' + sSubStr1;
                 if (AllowLoadData()) {
                     if (OperationType == "3") {
                         $.ajax({
@@ -709,7 +912,7 @@
                             type: "POST",
                             url: GetWEBURL() + "/Gy_Supplier/AddBill",
                             async: true,
-                            data: { "oMain": oMain + ';' + sSubStr },
+                            data: { "oMain": oMain + ';' + sSubStr + ';' + sSubStr1},
                             dataType: "json",
                             success: function (data) {
                                 if (data.count == 1) {
@@ -762,16 +965,7 @@
                 window.location.reload();
                 $("#HCreator").val(sessionStorage["HUserName"]);//鍒涘缓浜�
             });
-
-            //鍒涘缓缁勭粐
-            form.on('submit(HCreateOrgID_BT)', function () {
-                HCreateOrgID_BT();
-            });
-
-            //浣跨敤缁勭粐
-            form.on('submit(HUseOrgID_BT)', function () {
-                HUseOrgID_BT();
-            });
+            //#endregion
             //#endregion
 
             //#region 姝ら〉闈㈡墍鏈夋柟娉�
@@ -788,7 +982,7 @@
             }
 
             //娴佹按鍙锋柊澧炶幏鍙栫紪鐮�
-            function setHNumber(TypeID){
+            function setHNumber(TypeID) {
                 var ajaxLoad = layer.load();
                 $.ajax({
                     url: GetWEBURL() + '/Gy_Supplier/getMaxNum',
@@ -816,7 +1010,7 @@
                 $.ajax({
                     url: GetWEBURL() + 'Gy_Currency/list1',
                     type: "GET",
-                    async:false,
+                    async: false,
                     data: { "sWhere": " and 璐у竵鍚嶇О = '浜烘皯甯�'", "user": sessionStorage["HUserName"] },
                     success: function (data1) {
                         if (data1.data != null) {
@@ -834,28 +1028,7 @@
                 });
             }
 
-            //#region 璁″垝琛�
-            function set_GridDelete(obj) {
-                var data = obj.data;
-                var rowIndex = $(obj.tr).attr("data-index");
-                if (obj.event === 'del') {
-                    layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
-                        console.log("绱㈠紩涓�:" + rowIndex);
-                        if (rowIndex === '0') {
-                            layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
-                        } else {
-                            var oldData = table.cache["mainTable"];
-                            oldData.splice(obj.tr.data('index'), 1)
-                            option.data = oldData;//灏嗘暟鎹粦瀹氬埌data涓�
-                            table.render(option);
-                            layer.close(index);
-                        }
-                    });
-                }
-            }
-            //#endregion
-
-            //#region 璁″垝琛ㄥ垵濮嬪寲
+            //#region 瀛愯〃鍒濆鍖�
             function get_InitGrid() {
                 option = {
                     elem: '#mainTable'
@@ -866,8 +1039,8 @@
                     , cols: [[
                         { type: 'checkbox', totalRowText: '鍚堣琛�' }
                         , { type: 'numbers', title: '搴忓彿', style: 'background-color: #f9f9f9;' }
-                        , { field: 'HPayType', title: '浠樻闃舵', edit: 'text' }     
-                        , { field: 'HPayRate', title: '浠樻姣斾緥% ', edit: 'text'}
+                        , { field: 'HPayType', title: '浠樻闃舵', edit: 'text' }
+                        , { field: 'HPayRate', title: '浠樻姣斾緥% ', edit: 'text' }
                         , { field: 'HPayTime', title: '缁撶畻鍛ㄦ湡', edit: 'text' }
                         , { field: 'HPayRemark', title: '澶囨敞璇存槑', edit: 'text' }
                         , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
@@ -876,7 +1049,7 @@
 
                 var rowdata = [
                     {
-                          "HPayType": ""
+                        "HPayType": ""
                         , "HPayRate": "0"
                         , "HPayTime": "0"
                         , "HPayRemark": ""
@@ -884,6 +1057,32 @@
                 ];
                 option.data = rowdata;
                 table.render(option);
+
+
+                option1 = {
+                    elem: '#mainTable1'
+                    , toolbar: '#toolbarDemo1'
+                    , totalRow: true
+                    , cellMinWidth: 120
+                    , height: 400
+                    , cols: [[
+                        { type: 'checkbox', totalRowText: '鍚堣琛�' }
+                        , { type: 'numbers', title: '搴忓彿', style: 'background-color: #f9f9f9;' }
+                        , { field: 'HLinkMan', title: '鑱旂郴浜�', edit: 'text' }
+                        , { field: 'HLinkPhone', title: '鑱旂郴鐢佃瘽 ', edit: 'text' }
+                        , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
+                        , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo1' }
+                    ]]
+                }
+                var rowdata1 = [
+                    {
+                        "HLinkMan": ""
+                        , "HLinkPhone": ""
+                        , "HRemark": ""
+                    }
+                ];
+                option1.data = rowdata1;
+                table.render(option1);
             }
             //#endregion
 
@@ -940,17 +1139,14 @@
 
                         option.data = d.list[0]["Gy_Supplier_PayPlan"];
                         table.render(option);
+
+                        option1.data = d.list[1]["Gy_Supplier_Link"];
+                        table.render(option1);
                         //table.reload(layTableId, {
                         //    data: ajaxReturnData
                         //});
                     }
                 });
-            }
-
-            //杩斿洖楠屾敹
-            function GetHSecManagerValue(obj) {
-                $("#HSecManager").val(obj[0].HName);
-                $("#HSecManagerID").val(obj[0].HItemID);
             }
 
             //鏁版嵁楠岃瘉
@@ -987,7 +1183,7 @@
                     layer.msg("璇疯緭鍏ヤ緵搴斿晢鍚嶇О", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     return false;
                 }
-                 else {
+                else {
                     return true;
                 }
                 //var HTaxRate = $("#HTaxRate").val();
@@ -1089,16 +1285,23 @@
                     , btn2: function (index, layero) { }
                 })
             }
-
-            function GetHPSStyleNameValue(obj)  //杩斿洖閲囪喘鏂瑰紡
-            {
-                $("#HPSStyleName").val(obj[0].閲囪喘鏂瑰紡鍚嶇О);
-                $("#HPSStyleID").val(obj[0].HItemID);
-            }
             //#endregion
 
         });
-                //浠ヤ笂涓簂ayui妯″潡
+        //浠ヤ笂涓簂ayui妯″潡
+
+        //杩斿洖楠屾敹
+        function GetHSecManagerValue(obj) {
+            $("#HSecManager").val(obj[0].HName);
+            $("#HSecManagerID").val(obj[0].HItemID);
+        }
+
+        //杩斿洖閲囪喘鏂瑰紡
+        function GetHPSStyleNameValue(obj)  
+        {
+            $("#HPSStyleName").val(obj[0].閲囪喘鏂瑰紡鍚嶇О);
+            $("#HPSStyleID").val(obj[0].HItemID);
+        }
 
     </script>
 

--
Gitblit v1.9.1