From dfc1961f8c3cd1bdaf7fa83843c14b0540705cf4 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 25 十二月 2023 09:35:43 +0800
Subject: [PATCH] 1

---
 WebTM/views/设备管理/Sb_EquipMaintainPlanBillList.html |  200 ++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 162 insertions(+), 38 deletions(-)

diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillList.html"
index dba5855..7071165 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillList.html"
@@ -9,6 +9,8 @@
     <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
     <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
     <script src="../../layuiadmin/layui/layui.js"></script>
+    <script src="../../layuiadmin/HideButton.js"></script>
+    <script src="../../../layuiadmin/soulTable.slim.js"></script>
     <style type="text/css">
         input.layui-input.layui-unselect {
             padding-right: 0;
@@ -94,13 +96,18 @@
 
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-edit"></i>缂栬緫</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></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="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" lay-event="btn-Add" id="Add"><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit" id="Edit"><i class="layui-icon layui-icon-edit"></i>缂栬緫</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete" id="Delete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view" id="view"><i class="layui-icon layui-icon-tips"></i>棰勮</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print" id="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" id="Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>鎸夐挳璁剧疆</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit" id="Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
                             </div>
                         </script>
 
@@ -127,7 +134,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.$
                 , admin = layui.admin
@@ -140,11 +147,13 @@
                 , laypage = layui.laypage
                 , laydate = layui.laydate
                 , util = layui.util
+                , soulTable = layui.soulTable
             //鏌ヨ鏉′欢
             var sWhere = "";
             var option = [];
             var option1 = [];
             var option2 = [];
+            var HModName = "Sb_EquipMaintainPlanBillList";
             //#endregion
 
             //#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -182,7 +191,24 @@
                     case 'get_Refresh':
                         set_Refresh();
                         break;
-
+                    //鎸夐挳璁剧疆
+                    case 'set_HideButton':
+                        var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                        var HBillType = "3902";
+                        get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+                        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);
@@ -213,6 +239,25 @@
                 });
             });
 
+            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;
+                    }
+                });
+            })
+
             //閲嶇疆鎸夐挳
             form.on('submit(btnReSearch)', function (data) {
                 set_ClearQuery();
@@ -227,6 +272,9 @@
 
             //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
             function set_ClearBill() {
+                //鍒濆鍖栨棩鏈�
+                $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));//寮�濮嬫棩鏈�
+                $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));//缁撴潫鏃ユ湡
                 //鍒濆鍖栬〃鏍�(涓昏〃)
                 set_InitGrid();
                 //鍒濆鍖栬〃鏍�(瀛愯〃1)
@@ -246,37 +294,40 @@
                     , cellMinWidth: 90
                     , limit: 50
                     , limits: [50, 500, 5000, 20000]
+                    , done: function (res, curr, count) {
+                        soulTable.render(this);
+                    }
                     , cols: [[
                         { type: 'checkbox', fixed: 'left' }
-                        , { field: 'hmainid', title: 'hmainid', hide: true }
-                        , { field: '鏃ユ湡', title: '鏃ユ湡', width: 160, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', width: 160 }
-                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷', width: 160, hide: true }
-                        , { field: 'HEquipID', title: '璁惧ID', width: 160, hide: true }
-                        , { field: '璁惧浠g爜', title: '璁惧浠g爜', width: 200 }
-                        , { field: '璁惧鍚嶇О', title: '璁惧鍚嶇О', width: 200 }
-                        , { field: '寮�濮嬫棩鏈�', title: '寮�濮嬫棩鏈�', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '缁撴潫鏃ユ湡', title: '缁撴潫鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '鍛ㄦ湡鍗曚綅', title: '鍛ㄦ湡鍗曚綅', width: 200 }
-                        , { field: '淇濆吇鍛ㄦ湡', title: '淇濆吇鍛ㄦ湡', width: 200 }
-                        , { field: '鎽樿', title: '鎽樿', width: 200 }
-                        , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�', width: 200 }
-                        , { field: '澶囨敞', title: '澶囨敞', width: 200 }
-                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 115 }
-                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 200 }
-                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '淇敼浜�', title: '淇敼浜�', width: 200 }
-                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', width: 115,templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', width: 200 }
-                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 200 }
-                        , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 200, hide: true }
-                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 115, hide: true }
-                        , { field: '婧愬崟涓诲唴鐮�', title: '婧愬崟涓诲唴鐮�', width: 200, hide: true }
-                        , { field: '婧愬崟瀛愬唴鐮�', title: '婧愬崟瀛愬唴鐮�', width: 200, hide: true }
-                        , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿', width: 200 }
-                        , { field: '婧愬崟绫诲瀷', title: '婧愬崟绫诲瀷', width: 200 }
-                        , { field: 'hbilltype', title: 'hbilltype', width: 200 }
+                        , { field: 'hmainid', title: 'hmainid', hide: true, sort: true }
+                        , { field: '鏃ユ湡', title: '鏃ユ湡', width: 160, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', width: 160, sort: true }
+                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷', width: 160, hide: true, sort: true }
+                        , { field: 'HEquipID', title: '璁惧ID', width: 160, hide: true, sort: true }
+                        , { field: '璁惧浠g爜', title: '璁惧浠g爜', width: 200, sort: true }
+                        , { field: '璁惧鍚嶇О', title: '璁惧鍚嶇О', width: 200, sort: true }
+                        , { field: '寮�濮嬫棩鏈�', title: '寮�濮嬫棩鏈�', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '缁撴潫鏃ユ湡', title: '缁撴潫鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鍛ㄦ湡鍗曚綅', title: '鍛ㄦ湡鍗曚綅', width: 200, sort: true }
+                        , { field: '淇濆吇鍛ㄦ湡', title: '淇濆吇鍛ㄦ湡', width: 200, sort: true }
+                        , { field: '鎽樿', title: '鎽樿', width: 200, sort: true }
+                        , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�', width: 200, sort: true }
+                        , { field: '澶囨敞', title: '澶囨敞', width: 200, sort: true }
+                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 115, sort: true }
+                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 200, sort: true }
+                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '淇敼浜�', title: '淇敼浜�', width: 200, sort: true }
+                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', width: 115, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', width: 200, sort: true }
+                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 200, sort: true }
+                        , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 200, hide: true, sort: true }
+                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 115, hide: true, sort: true }
+                        , { field: '婧愬崟涓诲唴鐮�', title: '婧愬崟涓诲唴鐮�', width: 200, hide: true, sort: true }
+                        , { field: '婧愬崟瀛愬唴鐮�', title: '婧愬崟瀛愬唴鐮�', width: 200, hide: true, sort: true }
+                        , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿', width: 200, sort: true }
+                        , { field: '婧愬崟绫诲瀷', title: '婧愬崟绫诲瀷', width: 200, sort: true }
+                        , { field: 'hbilltype', title: 'hbilltype', width: 200, sort: true }
                     ]]
                 }
             }
@@ -355,6 +406,12 @@
                         if (data1.count == 1) {
                             option.data = data1.data;
                             table.render(option);
+
+                            //鍒锋柊鎸夐挳鏄剧ず
+                            var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                            var HBillType = "3902";
+                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+
                             layer.close(index);
                         } else {
                             option.data = data1.data;
@@ -456,6 +513,73 @@
                     layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
                 }
             }
+
+            //瀹℃牳/鍙嶅鏍�
+            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() + '/Sb_EquipMaintainPlanBill/CheckSb_EquipMaintainPlanBill',
+                            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);
+                            }
+                        });
+                    })
+                } else {
+                    layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                }
+            }
+
+            //鍏抽棴/鍙嶅叧闂�
+            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() + '/Sb_EquipMaintainPlanBill/CloseSb_EquipMaintainPlanBill',
+                            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')

--
Gitblit v1.9.1