From 8e2b58a4bbe75ed3d29f14d004d9dc69e73f2a1d Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期四, 25 四月 2024 11:06:00 +0800
Subject: [PATCH] 指导书

---
 WebTM/views/设备管理/设备档案/Gy_EquipFileMainList.html |  462 ++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 320 insertions(+), 142 deletions(-)

diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\346\241\243\346\241\210/Gy_EquipFileMainList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\346\241\243\346\241\210/Gy_EquipFileMainList.html"
index 93dbe2a..6d8e980 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\346\241\243\346\241\210/Gy_EquipFileMainList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\346\241\243\346\241\210/Gy_EquipFileMainList.html"
@@ -8,8 +8,18 @@
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
     <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
     <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
-    <style type="text/css"></style>
     <script src="../../../layuiadmin/layui/layui.js"></script>
+    <script src="../../../layuiadmin/layui/layui1.js"></script>
+    <script src="../../../layuiadmin/Scripts/json2.js"></script>
+    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
+    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+    <script src="../../../layuiadmin/layui/lay/modules/table.js"></script>
+    <style>
+        /*鏍戠姸鍥剧偣鍑婚珮浜彉鑹�*/
+        .layui-tree-set-active > .layui-tree-entry .layui-tree-main {
+            background: #aef0f7;
+        }
+    </style>
 </head>
 <body>
     <div class="layui-fluid">
@@ -44,20 +54,29 @@
 
                             </div>
                         </div>
-                        <table class="" id="mainTable" lay-filter="mainTable"></table>
+                        <div class="layui-row" style="padding:10px 0">
+                            <div class="layui-col-xs3 layui-inline" style="border: solid 1.5px #e0d6d64d;">
+                                <div id="TreeTable" class="demo-tree demo-tree-box"></div>
+                            </div>
+                            <div class="layui-col-xs8 layui-inline" style="padding-left: 10px; width: 73%">
+                                <div>
+                                    <table class="" id="mainTable" lay-filter="mainTable"></table>
+                                </div>
+                            </div>
+                        </div>
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btnAdd"><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btnModify"><i class="layui-icon layui-icon-edit"></i>缂栬緫</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btndelete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
-                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>瀹℃牳</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit"><i class="layui-icon layui-icon-circle"></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="set_CheckBill" id="CheckBill"><i class="layui-icon layui-icon-form"></i>瀹℃牳</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AbandonCheck" id="AbandonCheck"><i class="layui-icon layui-icon-form"></i>鍙嶅鏍�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" 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" 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="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>
-
-
-
-
                             </div>
                         </script>
                     </form>
@@ -65,26 +84,23 @@
             </div>
         </div>
     </div>
-    <script src="../../../layuiadmin/layui/layui.js"></script>
-    <script src="../../../layuiadmin/Scripts/json2.js"></script>
-    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
-    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
-    <script src="../../../layuiadmin/PubCustom.js"></script>
     <script>
         layui.config({
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
             index: 'lib/index', //涓诲叆鍙fā鍧�
-        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
+        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate', 'soulTable', 'tree'], function () {
             //#region 鍏叡鍙橀噺
             var $ = layui.$
-            , admin = layui.admin
-            , layer = layui.layer
-            , table = layui.table
-            , form = layui.form
-            , element = layui.element
-            , laypage = layui.laypage
-            , laydate = layui.laydate
+                , admin = layui.admin
+                , layer = layui.layer
+                , table = layui.table
+                , form = layui.form
+                , element = layui.element
+                , laypage = layui.laypage
+                , laydate = layui.laydate
+                , soulTable = layui.soulTable
+                , tree = layui.tree
             var sWhere = "";
             var option = [];
             //#endregion
@@ -103,14 +119,26 @@
                     //缂栬緫鎸夐挳
                     case 'btnModify': set_ShowBill();
                         break;
+                    //棰勮
+                    case 'btn-view': get_ViewReport();
+                        break;
+                    //鎵撳嵃
+                    case 'btn-print': get_PrintReport();
+                        break;
                     //鍒犻櫎鎸夐挳
                     case 'btndelete': set_DeleteBill();
                         break;
-                    //瀹℃牳鎸夐挳
-                    case 'btn-Audit': set_CheckBill();
+                    //瀹℃牳
+                    case 'set_CheckBill': set_CheckBill(1);
                         break;
-                    //鍙嶅鏍告寜閽�
-                    case 'btn-DeAudit': set_AbandonCheck();
+                    //鍙嶅鏍�
+                    case 'set_AbandonCheck': set_CheckBill(2);
+                        break;
+                    //鍏抽棴
+                    case 'set_CloseBill': set_CloseBill(1);
+                        break;
+                    //鍙嶅叧闂�
+                    case 'set_CancelCloseBill': set_CloseBill(2);
                         break;
                     //鍒锋柊
                     case 'get_Refresh': get_Refresh();
@@ -125,7 +153,20 @@
                 get_FastQuery();
             });
 
+            //閲嶇疆鎸夐挳
+            form.on('submit(btnReSearch)', function (data) {
+                get_Refresh();
+            });
 
+            //#region 鍙屽嚮杩斿洖鏁版嵁
+            table.on('rowDouble(mainTable)', function (obj) {
+                var data = [];
+                data.push(obj.data);
+                parent.GetEquipFileValue(data);
+                var index = parent.layer.getFrameIndex(window.name);
+                parent.layer.close(index);
+            });
+            //#endregion
 
             //#endregion
 
@@ -136,6 +177,8 @@
 
                 //鏌ヨ
                 get_Display(sWhere);
+                //鏌ヨ璁惧鍒嗙被
+                get_Display_Tree();
             }
 
             //鍒濆鍖栬〃鏍�
@@ -146,62 +189,86 @@
                     , toolbar: '#toolbarDemo'
                     , height: 'full-50'
                     , page: true
-                    , limits: [50,200,500,1000,5000,10000]
+                    , totalRow: true
+                    , limits: [50, 500, 5000, 20000]
                     , limit: 50 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
                     , cellMinWidth: 200
-                    , limit: 50
-                    , limits: [50, 200, 500, 1000, 5000, 10000]
+                    , done: function (res, curr, count) {
+                        soulTable.render(this);
+                    }
                     , cols: [[
-                        { type: 'checkbox', fixed: 'left' }
+                        { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' }
                         , { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
-                        , { field: '鏃ユ湡', title: '鏃ユ湡', templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '鏉″舰鐮�', title: '鏉$爜缂栧彿' }
-                        , { field: 'HMaterID', title: 'HMaterID', hide: true }
-                        , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О' }
-                        , { field: '璁惧浠g爜', title: '璁惧浠g爜' }
-                        , { field: '璁惧缂栫爜', title: '璁惧缂栫爜' }
-                        , { field: '璁惧鍚嶇О', title: '璁惧鍚嶇О' }
-                        , { field: '璁惧瑙勬牸', title: '璁惧瑙勬牸' }
-                        , { field: '璁惧鍨嬪彿', title: '璁惧鍨嬪彿' }
-                        , { field: 'HUnitID', title: 'HUnitID', hide: true }
-                        , { field: '鍗曚綅', title: '鍗曚綅' }
-                        , { field: '璁惧鍑哄巶鏃ユ湡', title: '璁惧鍑哄巶鏃ユ湡', templet: "<div>{{d.璁惧鍑哄巶鏃ユ湡 ==null ?'':layui.util.toDateString(d.璁惧鍑哄巶鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '璁惧鍑哄巶缂栧彿', title: '璁惧鍑哄巶缂栧彿' }
-                        , { field: 'HDeptID', title: 'HDeptID', hide: true }
-                        , { field: '浣跨敤閮ㄩ棬', title: '浣跨敤閮ㄩ棬' }
-                        , { field: 'HUseEmpID', title: 'HUseEmpID', hide: true }
-                        , { field: '浣跨敤璐熻矗浜�', title: '浣跨敤璐熻矗浜�' }
-                        , { field: 'HRepairEmpID', title: 'HRepairEmpID', hide: true }
-                        , { field: '缁存姢璐熻矗浜�', title: '缁存姢璐熻矗浜�' }
-                        , { field: '瀹夎鍦扮偣', title: '瀹夎鍦扮偣' }
-                        , { field: '瀹夎鏃ユ湡', title: '瀹夎鏃ユ湡', templet: "<div>{{d.瀹夎鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹夎鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '杩愯寮�濮嬫棩鏈�', title: '杩愯寮�濮嬫棩鏈�', templet: "<div>{{d.杩愯寮�濮嬫棩鏈� ==null ?'':layui.util.toDateString(d.杩愯寮�濮嬫棩鏈�, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '褰撳墠鐘舵��', title: '褰撳墠鐘舵��' }
-                        , { field: 'HEquipFileTypeID', title: 'HEquipFileTypeID', hide: true }
-                        , { field: '璁惧绫诲瀷', title: '璁惧绫诲瀷' }
-                        , { field: '宸ョ▼缂栫爜', title: '宸ョ▼缂栫爜' }
-                        , { field: '浜у搧', title: '浜у搧' }
-                        , { field: '鍝佺墝', title: '鍝佺墝' }
-                        , { field: 'HSellSupID', title: 'HSellSupID', hide: true }
-                        , { field: '渚涘簲鍟�', title: '渚涘簲鍟�' }
-                        , { field: 'HMakeSupID', title: 'HMakeSupID', hide: true }
-                        , { field: '鍒堕�犲晢', title: '鍒堕�犲晢' }
-                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�' }
-                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�' }
-                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', templet: "<div>{{d.瀹℃牳鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹℃牳鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '淇敼浜�', title: '淇敼浜�' }
-                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', templet: "<div>{{d.淇敼鏃ユ湡 ==null ?'':layui.util.toDateString(d.淇敼鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�' }
-                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', templet: "<div>{{d.鍏抽棴鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍏抽棴鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: 'hbilltype', title: 'hbilltype', hide: true }
-                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�' }
-                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷' }
-                        , { field: 'HMoudType', title: 'HMoudType', hide: true }
-                        , { field: 'hsubid', title: 'hsubid', hide: true }
+                        , { field: '鏃ユ湡', title: '鏃ユ湡', templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鏉″舰鐮�', title: '鏉$爜缂栧彿', sort: true }
+                        , { field: 'HMaterID', title: 'HMaterID', hide: true, sort: true }
+                        , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', sort: true }
+                        , { field: '璁惧浠g爜', title: '璁惧浠g爜', sort: true }
+                        , { field: '璁惧缂栫爜', title: '璁惧缂栫爜', sort: true }
+                        , { field: '璁惧鍚嶇О', title: '璁惧鍚嶇О', sort: true }
+                        , { field: '璁惧瑙勬牸', title: '璁惧瑙勬牸', sort: true }
+                        , { field: '璁惧鍨嬪彿', title: '璁惧鍨嬪彿', sort: true }
+                        , { field: 'HUnitID', title: 'HUnitID', hide: true, sort: true }
+                        , { field: '鍗曚綅', title: '鍗曚綅', sort: true }
+                        , { field: '璁惧鍑哄巶鏃ユ湡', title: '璁惧鍑哄巶鏃ユ湡', templet: "<div>{{d.璁惧鍑哄巶鏃ユ湡 ==null ?'':layui.util.toDateString(d.璁惧鍑哄巶鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '璁惧鍑哄巶缂栧彿', title: '璁惧鍑哄巶缂栧彿', sort: true }
+                        , { field: 'HDeptID', title: 'HDeptID', hide: true, sort: true }
+                        , { field: '浣跨敤閮ㄩ棬', title: '浣跨敤閮ㄩ棬', sort: true }
+                        , { field: 'HUseEmpID', title: 'HUseEmpID', hide: true, sort: true }
+                        , { field: '浣跨敤璐熻矗浜�', title: '浣跨敤璐熻矗浜�', sort: true }
+                        , { field: 'HRepairEmpID', title: 'HRepairEmpID', hide: true, sort: true }
+                        , { field: '缁存姢璐熻矗浜�', title: '缁存姢璐熻矗浜�', sort: true }
+                        , { field: '瀹夎鍦扮偣', title: '瀹夎鍦扮偣', sort: true }
+                        , { field: '瀹夎鏃ユ湡', title: '瀹夎鏃ユ湡', templet: "<div>{{d.瀹夎鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹夎鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '杩愯寮�濮嬫棩鏈�', title: '杩愯寮�濮嬫棩鏈�', templet: "<div>{{d.杩愯寮�濮嬫棩鏈� ==null ?'':layui.util.toDateString(d.杩愯寮�濮嬫棩鏈�, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '褰撳墠鐘舵��', title: '褰撳墠鐘舵��', sort: true }
+                        , { field: 'HEquipFileTypeID', title: 'HEquipFileTypeID', hide: true, sort: true }
+                        , { field: '璁惧绫诲瀷', title: '璁惧绫诲瀷', sort: true }
+                        , { field: '宸ョ▼缂栫爜', title: '宸ョ▼缂栫爜', sort: true }
+                        , { field: '浜у搧', title: '浜у搧', sort: true }
+                        , { field: '鍝佺墝', title: '鍝佺墝', sort: true }
+                        , { field: 'HSellSupID', title: 'HSellSupID', hide: true, sort: true }
+                        , { field: '渚涘簲鍟�', title: '渚涘簲鍟�', sort: true }
+                        , { field: 'HMakeSupID', title: 'HMakeSupID', hide: true, sort: true }
+                        , { field: '鍒堕�犲晢', title: '鍒堕�犲晢', sort: true }
+                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', sort: true }
+                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', sort: true }
+                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', templet: "<div>{{d.瀹℃牳鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹℃牳鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '淇敼浜�', title: '淇敼浜�', sort: true }
+                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', templet: "<div>{{d.淇敼鏃ユ湡 ==null ?'':layui.util.toDateString(d.淇敼鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', sort: true }
+                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', templet: "<div>{{d.鍏抽棴鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍏抽棴鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: 'hbilltype', title: 'hbilltype', hide: true, sort: true }
+                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true }
+                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷', sort: true }
+                        , { field: 'HMoudType', title: 'HMoudType', hide: true, sort: true }
+                        , { field: 'hsubid', title: 'hsubid', hide: true, sort: true }
                     ]]
                 };
             }
+
+
+            //#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
 
             //鏌ヨ
             function get_Display(sWhere) {
@@ -211,7 +278,7 @@
                 $.ajax({
                     url: GetWEBURL() + '/Gy_EquipFileMain/GetList',
                     type: "GET",
-                    data: { "sWhere": sWhere},
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
                     success: function (data1) {
                         if (data1.count == 1) {
                             option.data = data1.data;
@@ -228,12 +295,13 @@
                 });
             }
 
+
             //蹇�熻繃婊�
             function get_FastQuery() {
                 var HNumber = $("#HNumber").val();
                 var HName = $("#HName").val();
                 if (HNumber) {
-                    sWhere += " and 璁惧缂栧彿 like '%" + HNumber + "%'";
+                    sWhere += " and 璁惧浠g爜 like '%" + HNumber + "%'";
                 }
                 if (HName) {
                     sWhere += " and 璁惧鍚嶇О like '%" + HName + "%'";
@@ -307,7 +375,7 @@
                         $.ajax({
                             type: "GET",
                             url: GetWEBURL() + '/Gy_EquipFileMain/Delete_EquipFile',
-                            data: { "HItemID": HInterID},
+                            data: { "HItemID": HInterID, "user": sessionStorage["HUserName"]},
                             success: function (result) {
                                 if (result.count == 1) {
                                     layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
@@ -335,85 +403,195 @@
                 }
             }
 
-            //瀹℃牳
-            function set_CheckBill() {
+            //瀹℃牳/鍙嶅鏍�
+            function set_CheckBill(num) {
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;
-                if (checkStatus.data.length === 1) {
-                    var HBillStatus = data[0].HBillStatus.toString(); //鍗曟嵁鐘舵��
-                    var HInterID = data[0].hmainid.toString();
-                    if (HBillStatus > 0) {
-                        layer.msg('鍗曟嵁涓嶄负鏈鏍哥姸鎬侊紒');
-                        return false;
-                    }
-                    //閫昏緫瀹℃牳鏂规硶
-                    $.ajax({
-                        type: "GET",
-                        url: GetWEBURL() + "/Gy_Mould/AuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                        data: { "HInterID": HInterID,"IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
-                        success: function (result) {
-                            if (result.count == 1) {
-                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
-                                    // 寰楀埌frame绱㈠紩
-                                    var index = layer.getFrameIndex(window.name);
-                                    //鍏抽棴褰撳墠frame
-                                    layer.close(index);
-                                    //淇敼涓哄姛鍚庡埛鏂扮晫闈�
-                                    $("#btnSearch").trigger('click');
-                                });
 
-                            } else {
-                                layer.alert(result.code + result.Message, { icon: 5 });
+                if (data.length == 1) {
+                    layer.confirm("纭瑕佸鏍稿悧?", function (index) {
+                        var wait = layer.load();
+                        var HInterID = data[0].hmainid;
+                        $.ajax({
+                            url: GetWEBURL() + '/Gy_EquipFileBill/CheckGy_EquipFileBill',
+                            type: "GET",
+                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"] },
+                            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);
                             }
-                        }, error: function () {
-                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
-                        }
-                    });
-                }
-                else {
-                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹鏍革紒');
+                        });
+                    })
+                } else {
+                    layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
                 }
             }
 
-            //鍙嶅鏍�
-            function set_AbandonCheck() {
+            //鍏抽棴/鍙嶅叧闂�
+            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_EquipFileBill/CloseGy_EquipFileBill',
+                            type: "GET",
+                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"] },
+                            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("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                }
+            }  
+
+            //棰勮
+            function get_ViewReport() {
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;
                 if (checkStatus.data.length === 1) {
-                    var HBillStatus = data[0].HBillStatus.toString(); //鍗曟嵁鐘舵��
-                    var HInterID = data[0].hmainid.toString();
-                    if (HBillStatus = 0) {
-                        layer.msg('鍗曟嵁宸蹭负鏈鏍哥姸鎬�,鏃犻渶鍙嶅鏍革紒');
-                        return false;
-                    }
-                    //閫昏緫瀹℃牳鏂规硶
-                    $.ajax({
-                        type: "GET",
-                        url: GetWEBURL() + "/Gy_Mould/AuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                        data: { "HInterID": HInterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
-                        success: function (result) {
-                            if (result.count == 1) {
-                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
-                                    // 寰楀埌frame绱㈠紩
-                                    var index = layer.getFrameIndex(window.name);
-                                    //鍏抽棴褰撳墠frame
-                                    layer.close(index);
-                                    //淇敼涓哄姛鍚庡埛鏂扮晫闈�
-                                    $("#btnSearch").trigger('click');
-                                });
-
-                            } else {
-                                layer.alert(result.code + result.Message, { icon: 5 });
-                            }
-                        }, error: function () {
-                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
-                        }
-                    });
+                    layer.open({
+                        type: 2
+                        , area: ['50%', '50%']
+                        , title: '鎵撳嵃妯$増閫夋嫨'
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: false //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HEquipFileMainBill', 'yes']
+                        , resize: false
+                    })
                 }
                 else {
-                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹鏍革紒');
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹墦鍗帮紒');
                 }
+            }
 
+            //鎵撳嵃
+            function get_PrintReport() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    layer.open({
+                        type: 2
+                        , area: ['50%', '50%']
+                        , title: '鎵撳嵃妯$増閫夋嫨'
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: false //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HEquipFileMainBill', 'yes']
+                        , resize: false
+                    })
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹墦鍗帮紒');
+                }
+            }
+
+            // 鏍戠姸鍥炬煡璇�
+            function get_Display_Tree() {
+                var ajaxLoad = layer.load();
+                $.ajax({
+                    url: GetWEBURL() + '/Gy_EquipFileMain/TreeGetList',
+                    type: "GET",
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
+                    success: function (data1) {
+                        if (data1.count == 1) {
+                            layer.close(ajaxLoad);
+                            var data = JSON.parse(data1.data);
+                            MenuMain(data);
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(data1.code + data1.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+            }
+
+            //閬嶅巻鐢熸垚涓昏彍鍗�
+            function MenuMain(data) {
+                var liStr = '[';
+                //閬嶅巻鐢熸垚涓昏彍鍗�
+                for (var i = 0; i < data.length; i++) {
+                    // 鍒ゆ柇鏄惁瀛樺湪瀛愯彍鍗�
+                    if (data[i].children != null && data[i].children.length > 0) {
+                        liStr += '{"title": "' + data[i].id + "-" + data[i].title + '", "id": "' + data[i].id + '","spread":true, "children":[ ';
+                        // 閬嶅巻鑾峰彇瀛愯彍鍗�
+                        for (var k = 0; k < data[i].children.length; k++) {
+                            liStr += getChildMenu(data[i].children[k], 0);
+                        }
+                        liStr = liStr.substring(0, liStr.length - 1);
+                        liStr += ']},';
+                    } else {
+                        liStr += '{"title": "' + data[i].id + "-" + data[i].title + '", "id": "' + data[i].id + '"},';
+                    }
+                };
+                liStr = liStr.substring(0, liStr.length - 1);
+                liStr += "]";
+                var treeTable = JSON.parse(liStr);
+                tree.render({
+                    elem: '#TreeTable' //榛樿鏄偣鍑昏妭鐐瑰彲杩涜鏀剁缉
+                    , data: treeTable
+                    , click: function (obj) {
+                        //楂樹寒鍙樿壊
+                        $(".layui-tree-set").removeClass('layui-tree-set-active');
+                        obj.elem.addClass('layui-tree-set-active');
+
+                        var data = obj.data;  //鑾峰彇褰撳墠鐐瑰嚮鐨勮妭鐐规暟鎹�
+                        var sql = "";
+                        if (data.id == "0") {
+                            sql = "";
+                        } else {
+                            sql = " and HEquipFileTypeID='" + data.id + "' ";
+                        }
+                        get_Display(sql);
+                    }
+                });
+            }
+
+            // 閫掑綊鐢熸垚瀛愯彍鍗�
+            function getChildMenu(subMenu, num) {
+                num++;
+                var subStr = '';
+                if (subMenu.children != null && subMenu.children.length > 0) {
+                    subStr += '{"title": "' + subMenu.id + "-" + subMenu.title + '", "id": "' + subMenu.id + '", "children":[';
+                    for (var j = 0; j < subMenu.children.length; j++) {
+                        subStr += getChildMenu(subMenu.children[j], num);
+                        if (j + 1 == subMenu.children.length) {
+                            subStr = subStr.substring(0, subStr.length - 1);
+                        }
+                    }
+                    subStr += ']},';
+                } else {
+                    subStr += '{"title": "' + subMenu.id + "-" + subMenu.title + '", "id": "' + subMenu.id + '"},';
+                }
+                return subStr;
             }
 
             //鍒锋柊

--
Gitblit v1.9.1