From 015d1ac7f2ddedd864be733947ed680a2249f1ff Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 22 十一月 2024 16:20:28 +0800
Subject: [PATCH] 应收单应付单明细网格bug解决

---
 WebTM/views/销售管理/应收单/Xs_ReceivableBill.html      |   14 +++---
 WebTM/views/采购管理/应付单/Cg_PayableBill.html         |   14 +++---
 WebTM/views/采购管理/应付单/Cg_PayableBillList.html     |    2 
 WebTM/views/销售管理/应收单/Xs_ReceivableBillQuery.html |   35 +++++++++++------
 WebTM/layuiadmin/Scripts/webConfig.js            |    2 
 5 files changed, 39 insertions(+), 28 deletions(-)

diff --git a/WebTM/layuiadmin/Scripts/webConfig.js b/WebTM/layuiadmin/Scripts/webConfig.js
index 88be8f6..0739881 100644
--- a/WebTM/layuiadmin/Scripts/webConfig.js
+++ b/WebTM/layuiadmin/Scripts/webConfig.js
@@ -7,7 +7,7 @@
     //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //鏉ㄤ箰鏈湴閰嶇疆
  /*   var WEBURL = "http://localhost:8082/API/";    //鏉滆春鏈湴閰嶇疆*/
     var WEBURL = "http://localhost:8082/API/";    //寮犵憺骞挎湰鍦伴厤缃�
-   /* var WEBURL = "http://localhost:81/API/"    //缈佹稕娑涙湰鍦伴厤缃�*/
+    var WEBURL = "http://localhost:81/API/"    //缈佹稕娑涙湰鍦伴厤缃�
     //var WEBURL = "http://47.96.97.237/API/";          //鏅轰簯鏈嶅姟鍣�
    /* var WEBURL = "http://localhost:8082/LuBaoAPI/";   //浣欐�濇澃鏈湴閰嶇疆*/
     //var WEBURL = "http://localhost:8088/ARAPI/";      //浣欐�濇澃鏈湴閰嶇疆(瀹夌憺)
diff --git "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBill.html" "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBill.html"
index b7b835d..8942b59 100644
--- "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBill.html"
+++ "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBill.html"
@@ -717,7 +717,7 @@
                                             }
                                         );
                                     }
-                                    optionEntry.data = rowdataEntry;
+                                    optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                                     table.render(optionEntry);
                                     //瀛愯〃姹囨��
                                     for (var i = 0; i < rowdataEntry.length; i++) {
@@ -818,7 +818,7 @@
                                             }
                                         );
                                     }
-                                    optionEntry.data = rowdataEntry;
+                                    optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                                     table.render(optionEntry);
                                     //瀛愯〃姹囨��
                                     for (var i = 0; i < rowdataEntry.length; i++) {
@@ -1457,7 +1457,7 @@
                                         }
                                     );
                                 }
-                                optionEntry.data = rowdataEntry;
+                                optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                                 table.render(optionEntry);
                                 //瀛愯〃姹囨��
                                 for (var i = 0; i < rowdataEntry.length; i++) {
@@ -1580,7 +1580,7 @@
                                         }
                                     );
                                 }
-                                optionEntry.data = rowdataEntry;
+                                optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                                 table.render(optionEntry);
                                 //瀛愯〃姹囨��
                                 for (var i = 0; i < rowdataEntry.length; i++) {
@@ -2414,7 +2414,7 @@
                     $("#HUpDateDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));
                 }
                 var sMainStr = JSON.stringify(data.field);
-
+                debugger
                 //鑾峰彇瀛愯〃鏁版嵁
                 var num = [];
                 for (var i = 0; i < table.cache["mainTable"].length; i++) {
@@ -3266,7 +3266,7 @@
                         }
                     );
                 }
-                optionEntry.data = rowdataEntry;
+                optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                 table.render(optionEntry);
                 //瀛愯〃姹囨��
                 for (var i = 0; i < rowdataEntry.length; i++) {
@@ -3400,7 +3400,7 @@
                         }
                     );
                 }
-                optionEntry.data = rowdataEntry;
+                optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                 table.render(optionEntry);
                 //瀛愯〃姹囨��
                 for (var i = 0; i < rowdataEntry.length; i++) {
diff --git "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBillList.html" "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBillList.html"
index 069bae2..2a13bc1 100644
--- "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBillList.html"
+++ "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBillList.html"
@@ -704,7 +704,7 @@
                     layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) {
                         var wait = layer.load();
                         //閫昏緫鍒犻櫎鏂规硶
-                        if (data[0].鐘舵�� == "鍒涘缓") {
+                        if (data[0].鍗曟嵁鐘舵�� == "鍒涘缓") {
                             $.ajax({
                                 url: GetWEBURL() + '/Cg_PayableBill/delete',
                                 type: "GET",
diff --git "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\272\224\346\224\266\345\215\225/Xs_ReceivableBill.html" "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\272\224\346\224\266\345\215\225/Xs_ReceivableBill.html"
index ad2c02f..4efd2be 100644
--- "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\272\224\346\224\266\345\215\225/Xs_ReceivableBill.html"
+++ "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\272\224\346\224\266\345\215\225/Xs_ReceivableBill.html"
@@ -754,7 +754,7 @@
                                             );
                                         }
                                     }
-                                    optionEntry.data = rowdataEntry;
+                                    optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                                     table.render(optionEntry);
                                     //瀛愯〃姹囨��
                                     for (var i = 0; i < rowdataEntry.length; i++) {
@@ -892,7 +892,7 @@
                                         }
                                     }
 
-                                    optionEntry.data = rowdataEntry;
+                                    optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                                     table.render(optionEntry);
                                     //瀛愯〃姹囨��
                                     for (var i = 0; i < rowdataEntry.length; i++) {
@@ -1900,7 +1900,7 @@
                                         );
                                     }
                                 }
-                                optionEntry.data = rowdataEntry;
+                                optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                                 table.render(optionEntry);
                                 //瀛愯〃姹囨��
                                 for (var i = 0; i < rowdataEntry.length; i++) {
@@ -1957,7 +1957,7 @@
                                     , "HMangerName": dataArray[0].涓荤
                                     , "HEmpID": dataArray[0].HEmpID
                                     , "HEmpName": dataArray[0].涓氬姟鍛�
-                                    , "HCusID": dataArray[0].hsupid
+                                    , "HCusID": dataArray[0].HSupID
                                     , "HCusName": dataArray[0].瀹㈡埛
                                     , "HCurID": dataArray[0].涓昏〃甯佸埆id
                                     , "HCurName": dataArray[0].涓昏〃甯佸埆
@@ -2058,7 +2058,7 @@
                                     }
                                 }
 
-                                optionEntry.data = rowdataEntry;
+                                optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                                 table.render(optionEntry);
                                 //瀛愯〃姹囨��
                                 for (var i = 0; i < rowdataEntry.length; i++) {
@@ -3520,7 +3520,7 @@
                         );
                     }
                 }
-                optionEntry.data = rowdataEntry;
+                optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                 table.render(optionEntry);
                 //瀛愯〃姹囨��
                 for (var i = 0; i < rowdataEntry.length; i++) {
@@ -3690,7 +3690,7 @@
                     }
                 }
                 
-                optionEntry.data = rowdataEntry;
+                optionEntry.data = JSON.parse(JSON.stringify(rowdataEntry));
                 table.render(optionEntry);
                 //瀛愯〃姹囨��
                 for (var i = 0; i < rowdataEntry.length; i++) {
diff --git "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\272\224\346\224\266\345\215\225/Xs_ReceivableBillQuery.html" "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\272\224\346\224\266\345\215\225/Xs_ReceivableBillQuery.html"
index 032e904..6f50f2d 100644
--- "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\272\224\346\224\266\345\215\225/Xs_ReceivableBillQuery.html"
+++ "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\272\224\346\224\266\345\215\225/Xs_ReceivableBillQuery.html"
@@ -189,7 +189,7 @@
                                 <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_ReadScheme" id="set_ReadScheme"><i class="layui-icon layui-icon-set"></i>璇诲彇鏂规</button>
                             </div>
                         </script>
-                        <table class="" id="mainTableSub" lay-filter="mainTableSub"></table>
+                        <table class="" id="mainTableSub" lay-filter="mainTableSub" style="margin-top:30px"></table>
                         <script type="text/html" id="toolbarDemoSub">
                             <div class="layui-btn-container">
                                 <!--<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CloseRow" id="set_CloseRow"><i class="layui-icon layui-icon-form"></i>琛屽叧闂�</button>
@@ -426,7 +426,7 @@
                 //鍒濆鍖栬〃鏍�
                 set_InitGrid();
                 //鐩存帴鎵ц鍒楄〃绛涢�� 鍔犺浇鏁版嵁鍒扮綉鏍�
-                /*get_FastQuery(table, option,1)*/
+                get_FastQuery(table, option,1)
 
                 //鏌ヨ褰撳墠鐧诲綍鐢ㄦ埛鏈夋病鏈夊湪褰撳墠妯″潡璁剧疆榛樿杩囨护鏂规
                 get_DefaultModule();
@@ -452,8 +452,8 @@
                 optionSub = {
                     elem: '#mainTableSub'
                     , toolbar: '#toolbarDemoSub'
-                    , height: 'full-500'
-                    , page: true
+                    //, height: 'full-500'
+                    , page: false
                     , totalRow: true
                     , cellMinWidth: 90
                     , limit: 50
@@ -471,6 +471,7 @@
                 $.ajax({
                     url: GetWEBURL() + '/Xs_ReceivableBill/QueryList',
                     type: "GET",
+                    async: false,
                     data: { "sWhere": sWhere  , "user": sessionStorage["HUserName"]},
                     success: function (data1) {
                         if (data1.count == 1) {
@@ -489,7 +490,7 @@
                                 }
                             }
                             //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
-                            col.push({ type: 'radio', fixed: 'left', totalRowText: '鍚堣'});
+                            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '鍚堣'});
                             for (var i = 0; i < data.length; i++) {
                                 // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                 if ($.inArray(data[i].name, titleData) > -1) {
@@ -1415,14 +1416,24 @@
 
             //#region 琛岀偣鍑讳簨浠�
             table.on('row(mainTable)', function (obj) {
+                //閫変腑琛屾敼鍙橀鑹�
+                var flag = !obj.tr.find(':checkbox:first').prop('checked');
+                obj.tr.find(':checkbox').prop('checked', flag);
+                if (flag) {
+                    obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked');  //璁剧疆澶嶉�夋閫変腑鏍峰紡
+                    $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//鏀瑰彉褰撳墠tr鑳屾櫙棰滆壊鍜屽瓧浣撻鑹�
+                } else {
+                    obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//鍙栨秷澶嶉�夋閫変腑鏍峰紡
+                    $(obj.tr.selector).attr({ "style": "background:" });//鍙栨秷褰撳墠tr棰滆壊
+                }
+                //mainTable 涓鸿〃鏍糏D   娉ㄦ剰姝ゅ濡傛灉ID涓嶆纭皢瀵艰嚧浣犲湪鐩戝惉澶嶉�夋鏃惰幏鍙栦笉鍒颁綘閫夋嫨鐨勬暟鎹紝鍓嶉潰鐨勫彧鏄坊鍔犳垨鍒犻櫎閫変腑鏈�変腑鏍峰紡浠ュ強璁剧疆鑳屾櫙鑹诧紝瀛椾綋棰滆壊
+                layui.each(table.cache.mainTable, function (i, l) {
+                    if (obj.tr.index() == l.LAY_TABLE_INDEX) {
+                        l.LAY_CHECKED = flag;
+                    }
+                });
                 //鏄剧ず瀛愯〃
                 get_DisplaySub(obj.data);
-                //鍒ゆ柇鏄惁宸茬粡琚�変腑
-                if (obj.tr.find('.layui-form-radioed').length == 0) {
-                    //瑙﹀彂鍗曢�夋閫変腑浜嬩欢
-                    obj.tr.find('i[class="layui-anim layui-icon"]').trigger("click");
-                }
-
 
             })
             //瀛愯〃鍗曢��
@@ -1724,7 +1735,7 @@
                 var addSWhere = "";
 
                 if (openType == 2) {
-                    addSWhere = " and 鐘舵�� = '宸插鏍�' and 琛岀姸鎬� = '' and HOrgID = " + HOrgID;
+                    addSWhere = " and 瀹℃牳浜�! = '' and 鍏抽棴浜� = ''";
                 }
                 return addSWhere;
             }

--
Gitblit v1.9.1