From 1a40b7a8d4e6e24db362715b030ca9dfc1e2035e Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期三, 03 四月 2024 10:19:26 +0800
Subject: [PATCH] 销售出库明细报表:分组合计增加千分号、控制小数位数

---
 WebTM/views/计划管理/工艺路线/Gy_RoutingBillList.html |  402 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 313 insertions(+), 89 deletions(-)

diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html"
index b2bc8bf..8d60f1c 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html"
@@ -13,6 +13,8 @@
     <script src="../../../layuiadmin/scripts/jquery-1.4.1.min.js"></script>
     <script src="../../../layuiadmin/pubcustom.js"></script>
     <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+    <script src="../../../layuiadmin/HideButton.js"></script>
+    <script src="../../../layuiadmin/soulTable.slim.js"></script>
 </head>
 <body>
     <div class="layui-fluid">
@@ -35,7 +37,7 @@
                                 </div>
                                 <div class="layui-inline">
                                     <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鐗╂枡浠g爜</label>
-                                    <div class="layui-input-block" style="margin-left: 77px;">
+                                    <div class="layui-input-block">
                                         <input type="hidden" class="layui-input" lay-verify="HMaterID" name="HMaterID" id="HMaterID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                         <input type="text" class="layui-input" lay-verify="HMaterNumber" name="HMaterNumber" id="HMaterNumber" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                         <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMaterID" id="btnHMaterID" style="padding: 0 10px;float: right;margin-right: 3px;">
@@ -51,26 +53,27 @@
                                         </select>
                                     </div>
                                 </div>
-                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
+                                <button class="layui-btn layuiadmin-btn-order" style="display:none;" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                 </button>
-                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">閲嶇疆</button>
-                                <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
-                                    <div class="layui-row" style="margin-top:10px;">
-                                        <!--鍏朵粬鏉′欢-->
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 76px;">鐗╂枡鍚嶇О</label>
-                                            <div class="layui-input-block" style="margin-left: 107px;">
-                                                <input type="text" class="layui-input" name="HMaterName" id="HMaterName">
-                                            </div>
-                                        </div>
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">瑙勬牸鍨嬪彿</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="HModel" id="HModel">
-                                            </div>
+                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding: 0 5px; display: none;">閲嶇疆</button>
+                                <div class="layui-row" style="margin-top:10px;margin-left:5%;">
+                                    <!--鍏朵粬鏉′欢-->
+                                    <div class="layui-inline">
+                                        <label class="layui-form-label" style="width: 76px;">鐗╂枡鍚嶇О</label>
+                                        <div class="layui-input-block" style="margin-left: 107px;">
+                                            <input type="text" class="layui-input" name="HMaterName" id="HMaterName">
                                         </div>
                                     </div>
+                                    <div class="layui-inline">
+                                        <label class="layui-form-label" style="width: 85px;">瑙勬牸鍨嬪彿</label>
+                                        <div class="layui-input-block" style="margin-left: 120px;">
+                                            <input type="text" class="layui-input" name="HModel" id="HModel">
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
+
                                     <div class="layui-row" style="margin-top: 10px; margin-bottom: 10px ">
                                         <div class="layui-inline">
                                             <label class="layui-form-label">杩囨护</label>
@@ -104,17 +107,24 @@
                         <table class="" id="mainTable" lay-filter="mainTable"></table>
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_Copy"><i class="layui-icon layui-icon-form"></i>澶嶅埗</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="set_AddNew" id="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="set_AddNewSub" id="set_AddNewSub"><i class="layui-icon layui-icon-file-b"></i>鏂板瀛愯矾绾�</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="set_ShowBill" id="set_ShowBill"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="set_Copy" id="set_Copy"><i class="layui-icon layui-icon-form"></i>澶嶅埗</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="set_DeleteBill" id="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="get_Refresh" id="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="get_Exit" id="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="set_CheckBill" id="CheckBill"><i class="layui-icon layui-icon-form"></i>瀹℃牳</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="set_AbandonCheck" id="AbandonCheck"><i class="layui-icon layui-icon-form"></i>鍙嶅鏍�</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="set_CloseBill" id="set_CloseBill"><i class="layui-icon layui-icon-form"></i>鍏抽棴</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="set_CancelCloseBill" id="set_CancelCloseBill"><i class="layui-icon layui-icon-form"></i>鍙嶅叧闂�</button>
                                 <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>棰勮</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>鎵撳嵃</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-audit"><i class="layui-icon layui-icon-repeat"></i>瀹℃牳</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Faudit"><i class="layui-icon layui-icon-refresh"></i>鍙嶅鏍�</button>-->
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
+        <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>鎵撳嵃</button>
+        <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-audit"><i class="layui-icon layui-icon-repeat"></i>瀹℃牳</button>
+        <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Faudit"><i class="layui-icon layui-icon-refresh"></i>鍙嶅鏍�</button>-->
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="set_HideColumn" id="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
+                                <button type="button" class="layui-btn layui-btn-sm"  style="display:none;" lay-event="get_export" id="get_export"><i class="layui-icon layui-icon-export"></i>瀵煎嚭</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_HideButton" id="set_HideButton"><i class="layui-icon layui-icon-form"></i>鎸夐挳璁剧疆</button>
                             </div>
                         </script>
                     </form>
@@ -128,7 +138,7 @@
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
             index: 'lib/index', //涓诲叆鍙fā鍧�
-        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
+        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
 
             //#region 鍏叡鍙橀噺
             var $ = layui.$
@@ -139,11 +149,32 @@
                 , element = layui.element
                 , laypage = layui.laypage
                 , laydate = layui.laydate
+                , soulTable = layui.soulTable
             //var sWhere = " 浜у搧浠g爜 = 'BX0002'";
             var sWhere = "";
             var option = [];
+            var ins;                        //鐢ㄤ簬瀵煎嚭excel
             var HModName = "Gy_RoutingBillList";
 
+            //鑾峰彇鍙傛暟
+            function getUrlVars() {
+                var vars = [], hash;
+                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
+                for (var i = 0; i < hashes.length; i++) {
+                    hash = hashes[i].split('=');
+                    vars.push(hash[0]);
+                    vars[hash[0]] = hash[1];
+                }
+                return vars;
+            }
+
+            var HMaterID = "";
+            var HProID = 0;
+            var params = getUrlVars();
+            if (params[params[0]] != "undefined") {
+                HMaterID = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇
+                HProID = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇
+            }
             //#endregion
 
             //#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -161,7 +192,10 @@
             table.on('toolbar(mainTable)', function (obj) {
                 switch (obj.event) {
                     //鏂板
-                    case 'set_AddNew': set_AddNew();
+                    case 'set_AddNew': set_AddNew(); 
+                        break;
+                    //鏂板瀛愯矾绾�
+                    case 'set_AddNewSub': set_AddNewSub();
                         break;
                     //缂栬緫
                     case 'set_ShowBill': set_ShowBill();
@@ -178,11 +212,32 @@
                     //鍒锋柊
                     case 'get_Refresh': get_Refresh();
                         break;
+                    //瀹℃牳
+                    case 'set_CheckBill': set_CheckBill(1);
+                        break;
+                    //鍙嶅鏍�
+                    case 'set_AbandonCheck': set_CheckBill(2);
+                        break;
+                    //鍏抽棴
+                    case 'set_CloseBill': set_CloseBill(1);
+                        break;
+                    //鍙嶅叧闂�
+                    case 'set_CancelCloseBill': set_CloseBill(2);
+                        break;
                     //閫�鍑烘寜閽�
                     case 'get_Exit': Pub_Close(2);
                         break;
                     //鍒楄缃�
                     case 'set_HideColumn': get_HideColumn();
+                        break;
+                    //瀵煎嚭excel
+                    case 'get_export':
+                        get_Export();
+                        break;
+                    //鎸夐挳璁剧疆
+                    case 'set_HideButton':
+                        var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                        get_HideButton(btns, "3301", HModName, sessionStorage["HUserName"]);
                         break;
                 };
             });
@@ -250,64 +305,90 @@
                     , toolbar: '#toolbarDemo'
                     , height: 'full-50'
                     , page: true
-                    , cellMinWidth: 90
+                    //, cellMinWidth: 90
                     , limit: 50
+                    , totalRow: true
                     , limits: [50, 500, 5000, 20000]
+                    , done: function (res, curr, count) {
+                        soulTable.render(this);
+                    }
                     , cols: [[
                         { type: 'checkbox', fixed: 'left' }
                         /*    { field: 'hmainid', title: 'hmainid', width: 110 }*/
                         , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 165 }
-                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷' }
-                        , { field: '宸ヨ壓鍚嶇О', title: '宸ヨ壓鍚嶇О', width: 170 }
-                        //, { field: 'hmaterid', title: 'hmaterid', width: 165 }
-                        , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', width: 160 }
-                        , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', width: 160 }
-                        , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 215 }
-                        , { field: '璁¢噺鍗曚綅浠g爜', title: '璁¢噺鍗曚綅浠g爜', width: 115 }
-                        , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅' }
-                        , { field: '榛樿宸ヨ壓', title: '榛樿宸ヨ壓' }
-                        , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞' }
-                        , { field: '缁勭粐', title: '缁勭粐' }
-                        //, { field: 'hsubid', title: 'hsubid', width: 80 }
-                        , { field: '宸ュ簭鍙�', title: '宸ュ簭鍙�' }
-                        , { field: '濮斿鏍囪', title: '濮斿鏍囪' }
-                        //, { field: 'hprocid', title: 'hprocid', width: 105 }
-                        , { field: '宸ュ簭浠g爜', title: '宸ュ簭浠g爜' }
-                        , { field: '宸ュ簭', title: '宸ュ簭' }
-                        //, { field: 'HSupID', title: 'HSupID', width: 105 }
-                        , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�' }
-                        , { field: '渚涘簲鍟�', title: '渚涘簲鍟�' }
-                        //, { field: 'HCenterID', title: 'HCenterID', width: 105 }
-                        , { field: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜', width: 115 }
-                        , { field: '宸ヤ綔涓績鍚嶇О', title: '宸ヤ綔涓績鍚嶇О', width: 115 }
-                        , { field: '鏃堕棿鍗曚綅', title: '鏃堕棿鍗曚綅' }
-                        , { field: '杩愯鏃堕棿', title: '杩愯鏃堕棿' }
-                        , { field: '鍔犲伐鏁伴噺', title: '鍔犲伐鏁伴噺' }
-                        , { field: '鍑嗗鏃堕棿', title: '鍑嗗鏃堕棿' }
-                        , { field: '鎺掗槦鏃堕棿', title: '鎺掗槦鏃堕棿' }
-                        , { field: '杞Щ鏃堕棿', title: '杞Щ鏃堕棿' }
-                        , { field: '鑹巼', title: '鑹巼' }
-                        , { field: '绱鑹巼', title: '绱鑹巼' }
-                        , { field: '琛ㄤ綋澶囨敞', title: '琛ㄤ綋澶囨敞' }
-                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�' }
-                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 195 }
-                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�' }
-                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 180 }
-                        , { field: '淇敼浜�', title: '淇敼浜�' }
-                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', width: 180 }
-                        , { field: '浣滃簾浜�', title: '浣滃簾浜�' }
-                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡' }
-                        //, { field: 'HDayWorkQty', title: 'HDayWorkQty', width: 105 }
-                        //, { field: 'HGroupID', title: 'HGroupID', width: 105 }
-                        //, { field: 'HWorkerID', title: 'HWorkerID', width: 105 }
-                        //, { field: 'HSourceID', title: 'HSourceID', width: 105 }
-                        , { field: '鍔犲伐鍗曚环', title: '鍔犲伐鍗曚环' }
-                        //, { field: 'HNextProcFlag', title: 'HNextProcFlag', width: 105 }
-                        , { field: '涓嬮亾娴佽浆宸ュ簭', title: '涓嬮亾娴佽浆宸ュ簭', width: 150 }
-                        , { field: '娴佽浆宸ュ簭', title: '娴佽浆宸ュ簭' }
+                        , { field: '宸ヨ壓鍚嶇О', title: '宸ヨ壓鍚嶇О', width: 170, sort: true }
+                        , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', width: 160, sort: true }
+                        , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', width: 160, sort: true }
+                        , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 160, sort: true }
+                        , { field: '璁¢噺鍗曚綅浠g爜', title: '璁¢噺鍗曚綅浠g爜', width: 115, sort: true }
+                        , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', sort: true }
+                        , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞', sort: true }
+                        , { field: '宸ュ簭鍙�', title: '宸ュ簭鍙�', sort: true }
+                        , { field: '宸ュ簭浠g爜', title: '宸ュ簭浠g爜', sort: true }
+                        , { field: '宸ュ簭', title: '宸ュ簭', sort: true }
+                        , { field: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜', width: 115, sort: true }
+                        , { field: '宸ヤ綔涓績鍚嶇О', title: '宸ヤ綔涓績鍚嶇О', width: 115, sort: true }
+                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', sort: true }
+                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 195, sort: true }
+                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', sort: true }
+                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 180, sort: true }
+                        , { field: '淇敼浜�', title: '淇敼浜�', sort: true }
+                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', width: 180, sort: true }
+                        , { field: '榛樿宸ヨ壓', title: '榛樿宸ヨ壓', sort: true }
+                        //, { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷' }
+                        ////, { field: 'hmaterid', title: 'hmaterid', width: 165 }
+                        //, { field: '缁勭粐', title: '缁勭粐' }
+                        ////, { field: 'hsubid', title: 'hsubid', width: 80 }
+                        //, { field: '濮斿鏍囪', title: '濮斿鏍囪' }
+                        ////, { field: 'hprocid', title: 'hprocid', width: 105 }
+                        ////, { field: 'HSupID', title: 'HSupID', width: 105 }
+                        //, { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�' }
+                        //, { field: '渚涘簲鍟�', title: '渚涘簲鍟�' }
+                        ////, { field: 'HCenterID', title: 'HCenterID', width: 105 }
+                        //, { field: '鏃堕棿鍗曚綅', title: '鏃堕棿鍗曚綅' }
+                        //, { field: '杩愯鏃堕棿', title: '杩愯鏃堕棿' }
+                        //, { field: '鍔犲伐鏁伴噺', title: '鍔犲伐鏁伴噺' }
+                        //, { field: '鍑嗗鏃堕棿', title: '鍑嗗鏃堕棿' }
+                        //, { field: '鎺掗槦鏃堕棿', title: '鎺掗槦鏃堕棿' }
+                        //, { field: '杞Щ鏃堕棿', title: '杞Щ鏃堕棿' }
+                        //, { field: '鑹巼', title: '鑹巼' }
+                        //, { field: '绱鑹巼', title: '绱鑹巼' }
+                        //, { field: '琛ㄤ綋澶囨敞', title: '琛ㄤ綋澶囨敞' }
+                        //, { field: '浣滃簾浜�', title: '浣滃簾浜�' }
+                        //, { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡' }
+                        ////, { field: 'HDayWorkQty', title: 'HDayWorkQty', width: 105 }
+                        ////, { field: 'HGroupID', title: 'HGroupID', width: 105 }
+                        ////, { field: 'HWorkerID', title: 'HWorkerID', width: 105 }
+                        ////, { field: 'HSourceID', title: 'HSourceID', width: 105 }
+                        //, { field: '鍔犲伐鍗曚环', title: '鍔犲伐鍗曚环' }
+                        ////, { field: 'HNextProcFlag', title: 'HNextProcFlag', width: 105 }
+                        //, { field: '涓嬮亾娴佽浆宸ュ簭', title: '涓嬮亾娴佽浆宸ュ簭', width: 150 }
+                        //, { field: '娴佽浆宸ュ簭', title: '娴佽浆宸ュ簭' }
                     ]]
                 };
             }
+
+
+            //#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;
+                    }
+                });
+            })
+            //#endregion
 
             //#region 閲嶇疆杩囨护鏉′欢鏂规硶
             function set_ClearQuery() {
@@ -337,7 +418,7 @@
                     , shade: 0.6 //閬僵閫忔槑搴�
                     //, maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
                     , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                    , content: ['../../Baseset/鍩虹璧勬枡/Gy_MaterialList.html', 'yes']
+                    , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html', 'yes']
                     , btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
 
@@ -348,8 +429,8 @@
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
                         $("#HMaterID").val(checkStatus.data[0].HItemID);
-                        $("#HMaterName").val(checkStatus.data[0].HName);
-                        $("#HMaterNumber").val(checkStatus.data[0].HNumber);
+                        $("#HMaterName").val(checkStatus.data[0].鐗╂枡鍚嶇О);
+                        $("#HMaterNumber").val(checkStatus.data[0].鐗╂枡浠g爜);
                         layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
                 })
@@ -358,18 +439,51 @@
             //#region 鏌ヨ
             function get_Display(sWhere) {
                 //sWhere += " and HPRDORGID=" + sessionStorage["OrganizationID"] + " ";
+                if (HMaterID != "" && HMaterID != "undefined" && HMaterID != null) {
+                    sWhere += " and HMaterID = " + HMaterID;
+                }
+                if (HProID != 0 && HProID != "undefined" && HProID != null) {
+                    sWhere += " and HMainProcID = " + HProID;
+                }
                 var ajaxLoad = layer.load();
                 $.ajax({
                     //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                     url: GetWEBURL() + '/LEMS/MES_Gy_RoutingBillList_Json',
                     type: "GET",
-                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "HBillSubType":"3301" },
                     success: function (data1) {
                         if (data1.count == 1) {
-                            option.data = data1.data;
-                            table.render(option);
+
+                            //璁剧疆鍒楄〃鍚屼竴涓崟鎹彧鏈夌涓�鏉℃暟鎹樉绀轰富琛ㄤ俊鎭紝鍏跺畠璁板綍鍙樉绀哄瓙琛ㄤ俊鎭�
+                            //鑾峰彇瀛愯〃鍒楁暟鎹�
+                            var colList = [];
+                            for (var i = 0; i < option.cols[0].length; i++) {
+                                colList.push(option.cols[0][i].field);
+                            }
+                            //璁剧疆鏁版嵁
+                            var result = data1.data;
+                            var temp = "";
+                            for (var i = 0; i < result.length; i++) {
+                                if (temp != result[i]["鍗曟嵁鍙�"]) {
+                                    temp = result[i]["鍗曟嵁鍙�"];
+                                } else {
+                                    var initIndex = $.inArray("鍗曟嵁鍙�", colList);
+                                    var lastIndex = $.inArray("宸ュ簭鍙�", colList);
+                                    for (var j = initIndex; j < lastIndex; j++) {
+                                        var fieldName = colList[j];
+                                        result[i][fieldName] = "";
+                                    }
+                                }
+                            }
+
+
+                            option.data = result;
+                            ins = table.render(option);
                             layer.close(ajaxLoad);
 
+                            //鍒锋柊鎸夐挳鏄剧ず
+                            var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                            Display_HideButton(btns, "3301", HModName, sessionStorage["HUserName"]);
                             if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                                 ColFilter();
                             }
@@ -447,7 +561,7 @@
                 if (HOrgID) {
                     sWhere += " and HOrgID = '" + HOrgID + "'";
                 }
-                sWhere += " and 宸ュ簭浠g爜 != '9999'"
+                sWhere += " and 宸ュ簭浠g爜 != '9999' and HBillSubType<>'SUB'"
                 get_Display(sWhere);
                 sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
             }
@@ -461,7 +575,7 @@
                     , area: ['100%', '100%']
                     , title: '宸ヨ壓璺嚎-鏂板'
                     , shift: 0//寮瑰嚭鍔ㄧ敾
-                    , content: '../宸ヨ壓璺嚎/Gy_RoutingBill.html?OperationType=1&linterid=&HSouceBillType=&linteridSub=-1'
+                    , content: '../宸ヨ壓璺嚎/Gy_RoutingBill.html?OperationType=1&linterid=&HSouceBillType=3301&linteridSub=-1'
                     , end: function () {
                         //鍒锋柊椤甸潰,
                         location.reload();
@@ -469,6 +583,22 @@
                 })
             }
             //#endregion
+
+            //娣诲姞瀛愯矾绾�
+            function set_AddNewSub() {
+                layer.open({
+                    type: 2
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['100%', '100%']
+                    , title: '宸ヨ壓璺嚎-鏂板'
+                    , shift: 0//寮瑰嚭鍔ㄧ敾
+                    , content: '../宸ヨ壓璺嚎/Gy_RoutingBill.html?OperationType=1&linterid=&HSouceBillType=SUB&linteridSub=-1'
+                    , end: function () {
+                        //鍒锋柊椤甸潰,
+                        location.reload();
+                    }
+                })
+            }
 
             //#region 缂栬緫
             function set_ShowBill() {
@@ -484,7 +614,7 @@
                         , area: ['100%', '100%']
                         , title: '宸ヨ壓璺嚎-缂栬緫'
                         , shift: 0//寮瑰嚭鍔ㄧ敾
-                        , content: '../宸ヨ壓璺嚎/Gy_RoutingBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType='
+                        , content: '../宸ヨ壓璺嚎/Gy_RoutingBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=3301'
                         , end: function () {
                             //鍒锋柊椤甸潰,
                             location.reload();
@@ -508,7 +638,7 @@
                         $.ajax({
                             url: GetWEBURL() + '/LEMS/DeltetGy_RoutingBillSub',
                             type: "GET",
-                            data: { "lngBillKey": hmainid, "user": sessionStorage["HUserName"] },
+                            data: { "lngBillKey": hmainid, "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
                             success: function (result) {
                                 console.log('gouba' + result);
                                 if (result.count == 1) {
@@ -551,7 +681,7 @@
                         , area: ['100%', '100%']
                         , title: '宸ヨ壓璺嚎-缂栬緫'
                         , shift: 0//寮瑰嚭鍔ㄧ敾
-                        , content: '../宸ヨ壓璺嚎/Gy_RoutingBill.html?OperationType=2&linterid=' + linterid + '&HSouceBillType='
+                        , content: '../宸ヨ壓璺嚎/Gy_RoutingBill.html?OperationType=2&linterid=' + linterid + '&HSouceBillType=3301'
                         , end: function () {
                             //鍒锋柊椤甸潰,
                             location.reload();
@@ -567,6 +697,98 @@
                 set_ClearQuery();
                 get_Display(sWhere);
             }
+
+            //瀹℃牳   [1 瀹℃牳銆�2 鍙嶅鏍竇
+            function set_CheckBill(num) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+
+                if (data.length == 1) {
+                    layer.confirm("纭瑕佸鏍稿悧?", function (index) {
+                        var wait = layer.load();
+                        var HInterID = data[0].hmainid;
+                        $.ajax({
+                            url: GetWEBURL() + '/Gy_RoutingBill/CheckGy_RoutingBill',
+                            type: "GET",
+                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
+                            success: function (result) {
+                                if (result.count == 1) {
+                                    get_FastQuery();
+                                    layer.msg(result.Message, { icon: 1 });
+                                    layer.close(wait);
+                                } else {
+                                    layer.alert(result.code + result.Message, { icon: 5 });
+                                    layer.close(wait);
+                                }
+                            }, error: function () {
+                                layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                                layer.close(wait);
+                            }
+                        });
+                    })
+                } else {
+                    layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                }
+            }
+
+
+            //鍏抽棴  [1 鍏抽棴銆�2 鍙嶅叧闂璢
+            function set_CloseBill(num) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+
+                if (data.length == 1) {
+                    layer.confirm("纭瑕佸叧闂悧?", function (index) {
+                        var wait = layer.load();
+                        var HInterID = data[0].hmainid;
+                        $.ajax({
+                            url: GetWEBURL() + '/Gy_RoutingBill/CloseGy_RoutingBill_1',
+                            type: "GET",
+                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"], "HBillSubType": ""},
+                            success: function (result) {
+                                if (result.count == 1) {
+                                    layer.msg(result.Message, { icon: 1 });
+                                    layer.close(wait);
+                                } else {
+                                    layer.alert(result.code + result.Message, { icon: 5 });
+                                    layer.close(wait);
+                                }
+                            }, error: function () {
+                                layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                                layer.close(wait);
+                            }
+                        });
+                    })
+                }
+                else {
+                    layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                }
+            }
+
+
+
+            //#region 瀵煎嚭Execel
+            function get_Export() {
+                var ModRightNameCheck = "Gy_RoutingBillList_ExportExcel";
+
+                //閫昏緫瀹℃牳鏂规硶
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
+                    success: function (result) {
+                        if (result.count == 1) {
+                            table.exportFile(ins.config.id, option.data, "xls");
+                        } else {
+                            layer.alert("褰撳墠妯″潡娌℃湁瀵煎嚭鏉冮檺!", { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+            }
+            //#endregion
+
             //#endregion
             //闅愯棌鍒楄缃�
             function get_HideColumn() {
@@ -680,6 +902,8 @@
                         } else {
                             table.render(option);
                         }
+                        var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                        Display_HideButton(btns, "3301", HModName, sessionStorage["HUserName"]);
                     }, error: function () {
                         layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
                     }

--
Gitblit v1.9.1