From 7de00c5824ecfd39fec748386298ba0cedd4504e Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期二, 16 一月 2024 16:06:10 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI

---
 WebTM/views/设备管理/设备规程单/Sb_EquipMaintainRuleList.html |  339 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 282 insertions(+), 57 deletions(-)

diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipMaintainRuleList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipMaintainRuleList.html"
index 33d9892..3092f05 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipMaintainRuleList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipMaintainRuleList.html"
@@ -9,6 +9,7 @@
     <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/soulTable.slim.js"></script>
     <style type="text/css">
         input.layui-input.layui-unselect {
             padding-right: 0;
@@ -57,9 +58,38 @@
                                 </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">
-                                    <div class="layui-inline">
+                                    <div class="layui-row">
                                         <div class="layui-inline">
-                                            <span>鍏朵粬鏉′欢></span>
+                                            <div class="layui-inline">
+                                                <span>鍏朵粬鏉′欢></span>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">杩囨护</label>
+                                            <div class="layui-input-block">
+                                                <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;">
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;">
+                                                <option value="0" selected="selected"></option>
+                                                <option value="=">=</option>
+                                                <option value=">=">>=</option>
+                                                <option value=">">></option>
+                                                <option value="<="><=</option>
+                                                <option value="<"><</option>
+                                                <option value="<>"><></option>
+                                                <option value="7">鍖呭惈</option>
+                                                <option value="8">宸﹀寘鍚�</option>
+                                                <option value="9">鍙冲寘鍚�</option>
+                                                <option value="10">涓嶅寘鍚�</option>
+                                            </select>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <input type="text" class="layui-input" value="" name="ColContent" id="ColContent">
                                         </div>
                                     </div>
                                 </div>
@@ -88,8 +118,12 @@
                                 <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="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="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_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
                             </div>
@@ -118,7 +152,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
@@ -131,12 +165,14 @@
                 , laypage = layui.laypage
                 , laydate = layui.laydate
                 , util = layui.util
+                , soulTable = layui.soulTable
             //鏌ヨ鏉′欢
             var sWhere = "";
             var option = [];
             var option1 = [];
             var option2 = [];
             var HModName = "Sb_EquipMaintainRuleList";
+            var titleData = ["hmainid", "鍗曟嵁绫诲瀷", "閰嶄欢ID", "鍗曚綅ID", "璐熻矗浜轰唬鐮�", "琛屽叧闂汉", "浣滃簾鏃ユ湡", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�","鍐呴儴鍗曟嵁鍙�","hsubid","淇濆吇椤圭洰ID","璐熻矗浜篒D"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
             //#endregion
 
 
@@ -182,6 +218,18 @@
                     case 'set_HideColumn':
                         get_HideColumn();
                         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;
                 };
             });
 
@@ -208,6 +256,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();
@@ -220,6 +287,8 @@
 
             //#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)
@@ -239,48 +308,48 @@
                     , cellMinWidth: 90
                     , limit: 50
                     , limits: [50, 500, 5000, 20000]
-                    , 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: '鍛ㄦ湡鍗曚綅', title: '鍛ㄦ湡鍗曚綅', width: 200 }
-                        , { field: '淇濆吇鍛ㄦ湡', title: '淇濆吇鍛ㄦ湡', width: 200 }
-                        , { field: '閰嶄欢ID', title: '閰嶄欢ID', width: 200, hide: true }
-                        , { field: '閰嶄欢浠g爜', title: '閰嶄欢浠g爜', width: 200 }
-                        , { field: '閰嶄欢鍚嶇О', title: '閰嶄欢鍚嶇О', width: 200 }
-                        , { field: '鎽樿', title: '鎽樿', width: 200 }
-                        , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�', width: 200 }
-                        , { field: '澶囨敞', title: '澶囨敞', width: 200 }
-                        , { field: '鍗曚綅ID', title: '鍗曚綅ID', width: 200,hide: true }
-                        , { field: '璁¢噺鍗曚綅鍚嶇О', title: '璁¢噺鍗曚綅鍚嶇О', width: 200 }
-                        , { field: '鐢ㄩ噺', title: '鐢ㄩ噺', width: 200 }
-                        , { field: '瀛愬娉�', title: '瀛愬娉�', width: 200 }
-                        , { field: '淇濆吇椤圭洰', title: '淇濆吇椤圭洰', width: 115}
-                        , { field: '淇濆吇閮ㄤ綅', title: '淇濆吇閮ㄤ綅', width: 200 }
-                        , { field: '鍏蜂綋瑕佹眰', title: '鍏蜂綋瑕佹眰', width: 200 }
-                        , { field: '璐熻矗浜轰唬鐮�', title: '璐熻矗浜轰唬鐮�', width: 200, hide: true }
-                        , { field: '璐熻矗浜哄悕绉�', title: '璐熻矗浜哄悕绉�', width: 200 }
-                        , { field: '琛屽叧闂汉', title: '琛屽叧闂汉', width: 115, hide: true }
-                        , { 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, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 200 }
-                        , { 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 }
-                    ]]
+                    //, 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: '鍛ㄦ湡鍗曚綅', title: '鍛ㄦ湡鍗曚綅', width: 200 }
+                    //    , { field: '淇濆吇鍛ㄦ湡', title: '淇濆吇鍛ㄦ湡', width: 200 }
+                    //    , { field: '閰嶄欢ID', title: '閰嶄欢ID', width: 200, hide: true }
+                    //    , { field: '閰嶄欢浠g爜', title: '閰嶄欢浠g爜', width: 200 }
+                    //    , { field: '閰嶄欢鍚嶇О', title: '閰嶄欢鍚嶇О', width: 200 }
+                    //    , { field: '鎽樿', title: '鎽樿', width: 200 }
+                    //    , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�', width: 200 }
+                    //    , { field: '澶囨敞', title: '澶囨敞', width: 200 }
+                    //    , { field: '鍗曚綅ID', title: '鍗曚綅ID', width: 200,hide: true }
+                    //    , { field: '璁¢噺鍗曚綅鍚嶇О', title: '璁¢噺鍗曚綅鍚嶇О', width: 200 }
+                    //    , { field: '鐢ㄩ噺', title: '鐢ㄩ噺', width: 200 }
+                    //    , { field: '瀛愬娉�', title: '瀛愬娉�', width: 200 }
+                    //    , { field: '淇濆吇椤圭洰', title: '淇濆吇椤圭洰', width: 115}
+                    //    , { field: '淇濆吇閮ㄤ綅', title: '淇濆吇閮ㄤ綅', width: 200 }
+                    //    , { field: '鍏蜂綋瑕佹眰', title: '鍏蜂綋瑕佹眰', width: 200 }
+                    //    , { field: '璐熻矗浜轰唬鐮�', title: '璐熻矗浜轰唬鐮�', width: 200, hide: true }
+                    //    , { field: '璐熻矗浜哄悕绉�', title: '璐熻矗浜哄悕绉�', width: 200 }
+                    //    , { field: '琛屽叧闂汉', title: '琛屽叧闂汉', width: 115, hide: true }
+                    //    , { 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, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
+                    //    , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 200 }
+                    //    , { 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 }
+                    //]]
                 }
             }
             //鍒濆鍖栬〃鏍�(瀛愯〃1)
@@ -294,6 +363,7 @@
                     , cellMinWidth: 90
                     , limit: 50
                     , limits: [50, 500, 5000, 20000]
+                    , loading: false
                     , cols: [[
                         //{ type: 'checkbox', fixed: 'left' }
                         , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
@@ -322,6 +392,7 @@
                     , cellMinWidth: 90
                     , limit: 50
                     , limits: [50, 500, 5000, 20000]
+                    , loading: false
                     , cols: [[
                         //{ type: 'checkbox', fixed: 'left' }
                         , { templet: '#xuhao1', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
@@ -342,6 +413,7 @@
             }
             //鍔犺浇缃戞牸
             function get_Display(sWhere) {
+                var ajaxLoad = layer.load();
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
                 $.ajax({
                     //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
@@ -350,17 +422,61 @@
                     data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                     success: function (data1) {
                         if (data1.count == 1) {
-                            option.data = data1.data;
+                            var data = [];
+                            var col = [];
+                            //缁欑┖鐨勬暟缁勮祴鍊�
+                            for (var key in data1.list) {
+                                data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+                            }
+                            //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+                            col.push({ type: 'checkbox', fixed: 'left' });
+                            for (var i = 0; i < data.length; i++) {
+                                if ($.inArray(data[i].name, titleData) > -1 ) {
+                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
+                                }
+                                else {
+                                    switch (data[i].Type) {
+                                        //int
+                                        case 'DateTime':
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
+                                            break;
+                                        default:
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+                                    }
+                                }
+                            }
+
+                            //鍔ㄦ�佹樉绀哄垪鍚�
+                            option = {
+                                elem: '#mainTable'
+                                , toolbar: '#toolbarDemo'
+                                , cols: [col]
+                                , data: data1.data
+                                , height: 550
+                                , page: true
+                                , cellMinWidth: 90
+                                , limit: 50
+                                , limits: [50, 500, 5000, 20000]
+                                , done: function (res, curr, count) {
+                                    soulTable.render(this);
+                                }
+                            }
                             table.render(option);
-                            layer.close(index);
+
+                            //鍒锋柊琛ㄦ牸鏁版嵁
+                            DisPlay_HideColumn();
+
+                            layer.close(ajaxLoad);
+                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+                                ColFilter();
+                            }
+                            //layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
                         } else {
-                            option.data = data1.data;
-                            table.render(option);
-                            layer.close(index);
-                            layer.alert("娌℃湁鏁版嵁璁板綍!", { icon: 5 });
+                            layer.close(ajaxLoad);
+                            layer.alert(data1.code + data1.Message, { icon: 5 });
                         }
                     }, error: function () {
-                        layer.close(index);
+                        layer.close(ajaxLoad);
                         layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
                     }
                 })
@@ -453,6 +569,72 @@
                 }
             }
 
+            //瀹℃牳/鍙嶅鏍�
+            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_EquipMaintainRuleBill/CheckSb_EquipMaintainRuleBill',
+                            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_EquipMaintainRuleBill/CloseSb_EquipMaintainRuleBill',
+                            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')
@@ -490,6 +672,31 @@
                 var HCreateBy = $("#HCreateBy").val();//鍒跺崟浜�
                 var BenginHCreateDate = $("#BenginHCreateDate").val();//寮�濮嬪埗鍗曟椂闂�
                 var EndHCreateDate = $("#EndHCreateDate").val();//缁撴潫鍒跺崟鏃堕棿
+                var ColName = $("#ColName").val();//澶嶉�夋
+                var Comparator = $("#Comparator").val()
+                var ColContent = $("#ColContent").val();
+
+                if (ColName != 0 && Comparator != 0) {
+                    var com = "";
+                    switch (Comparator) {
+                        case "7":
+                            com = "like'%" + ColContent + "%'";
+                            break;
+                        case "8":
+                            com = "like'%" + ColContent + "'";
+                            break;
+                        case "9":
+                            com = "like'" + ColContent + "%'";
+                            break;
+                        case "10":
+                            com = "not like'%" + ColContent + "%'";
+                            break;
+                        default:
+                            com = "" + Comparator + "'" + ColContent + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName + " " + com;
+                }
                 if (HBillNo) {
                     sWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
                 }
@@ -500,7 +707,7 @@
                     sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + BenginHCreateDate + "'";
                 }
                 if (EndHCreateDate) {
-                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + EndHCreateDate + "'";
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + EndHCreateDate + "'";
                 }
                 get_Display(sWhere);
                 sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
@@ -511,10 +718,27 @@
                 $("#HBillNo").val("");//鍗曟嵁鍙�
                 $("#HSourceBillNo").val("");//婧愬崟鍙�
                 $("#HCreateBy").val("");//鍒跺崟浜�
-                $("#BenginHCreateDate").val("");//寮�濮嬪埗鍗曟椂闂�
-                $("#EndHCreateDate").val("");//缁撴潫鍒跺崟鏃堕棿
+                $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+                $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#ColContent").val("");
+                $("#ColName").val("0");
+                $("#Comparator").val("0");
+                form.render('select');
                 sWhere = "";
                 $("#btnSearch").click();
+            }
+
+            //鍒楁槑鏄剧ず涓嬫媺妗�
+            function ColFilter() {
+                var Organization = '<option  value="0" selected="selected" ></option>';
+                for (var i = 1; i < option.cols[0].length; i++) {
+                    if (option.cols[0][i].hide != true) {
+                        Organization += '<option  style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
+                    }
+                }
+                $("#ColName").empty();
+                $("#ColName").append(Organization);
+                form.render('select');
             }
 
             //闅愯棌鍒楄缃�
@@ -555,7 +779,7 @@
 
 
                             var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
-                            var titleData = ["hmainid", "鍗曟嵁绫诲瀷", "閰嶄欢ID", "鍗曚綅ID", "璐熻矗浜轰唬鐮�", "琛屽叧闂汉", "浣滃簾鏃ユ湡", "婧愬崟涓诲唴鐮�","婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+                            /*var titleData = ["hmainid", "鍗曟嵁绫诲瀷", "閰嶄欢ID", "鍗曚綅ID", "璐熻矗浜轰唬鐮�", "琛屽叧闂汉", "浣滃簾鏃ユ湡", "婧愬崟涓诲唴鐮�","婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�*/
 
                             dataCol = data1.data[0].HGridString.split(',');
 
@@ -626,6 +850,7 @@
                     }
                 })
             }
+            layer.close(index);
 
             //#endregion
         });

--
Gitblit v1.9.1