From 57e698ff50b2dbd3ca9bb73932fba21dfe828e9a Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 04 九月 2025 11:09:59 +0800
Subject: [PATCH] 1

---
 WebTM/views/验收入库/委外入库/Kf_EntrustInBillList.html | 1262 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 1,160 insertions(+), 102 deletions(-)

diff --git "a/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\247\224\345\244\226\345\205\245\345\272\223/Kf_EntrustInBillList.html" "b/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\247\224\345\244\226\345\205\245\345\272\223/Kf_EntrustInBillList.html"
index 0ecfd4b..915109f 100644
--- "a/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\247\224\345\244\226\345\205\245\345\272\223/Kf_EntrustInBillList.html"
+++ "b/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\247\224\345\244\226\345\205\245\345\272\223/Kf_EntrustInBillList.html"
@@ -14,6 +14,9 @@
     <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
     <script src="../../../layuiadmin/PubCustom.js"></script>
     <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
+    <script src="../../../layuiadmin/HideButton.js"></script>
+    <script src="../../../layuiadmin/soulTable.slim.js"></script>
+    <script src="../../../layuiadmin/PageTitle.js"></script>
     <style type="text/css">
         input.layui-input.layui-unselect {
             padding-right: 0;
@@ -34,69 +37,165 @@
                                     </div>
                                 </div>
                                 <div class="layui-inline">
+                                    <label class="layui-form-label">鏃ユ湡闂撮殧</label>
+                                    <div class="layui-input-block">
+                                        <select name="HInitTimeCycle" id="HInitTimeCycle" class="ForFilteringSchemes" lay-filter="HInitTimeCycle" style="width:190px;">
+                                        </select>
+                                    </div>
+                                </div>
+                                <div class="layui-inline">
                                     <label class="layui-form-label">寮�濮嬫棩鏈�</label>
                                     <div class="layui-input-block">
-                                        <input type="date" class="layui-input" id="HBeginDate" style="width:190px;">
+                                        <input type="date" class="layui-input ForFilteringSchemes" id="HBeginDate" style="width:190px;">
                                     </div>
                                 </div>
                                 <div class="layui-inline">
                                     <label class="layui-form-label">缁撴潫鏃ユ湡</label>
                                     <div class="layui-input-block">
-                                        <input type="date" class="layui-input" id="HEndDate" style="width:190px;">
+                                        <input type="date" class="layui-input ForFilteringSchemes" id="HEndDate" style="width:190px;">
                                     </div>
                                 </div>
                                 <div class="layui-inline">
                                     <label class="layui-form-label">鍗曟嵁鍙�</label>
                                     <div class="layui-input-block">
-                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="width:190px;">
+                                        <input type="text" class="layui-input ForFilteringSchemes" name="HBillNo" id="HBillNo" style="width:190px;">
                                     </div>
                                 </div>
                                 <button class="layui-btn layuiadmin-btn-order" 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-inline" style="margin-left:5px;">
+                                    <div style="text-align:center;font-size:15px;font-weight:bold;color:#fc9393" id="HFilterScheme_Now"></div>
+                                </div>
                                 <div class="layui-colla-content">
                                     <div class="layui-inline">
                                         <label class="layui-form-label">閮ㄩ棬</label>
                                         <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="HDeptID" id="HDeptID" style="width:190px;">
+                                            <input type="text" class="layui-input ForFilteringSchemes" name="HDeptID" id="HDeptID" style="width:190px;">
                                         </div>
                                     </div>
                                     <div class="layui-inline">
                                         <label class="layui-form-label">鐗╂枡浠g爜</label>
                                         <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="MaterialCode" id="MaterialCode" style="width:190px;">
+                                            <input type="text" class="layui-input ForFilteringSchemes" name="MaterialCode" id="MaterialCode" style="width:190px;">
                                         </div>
                                     </div>
                                     <!--<hr />-->
                                     <div class="layui-inline">
                                         <label class="layui-form-label">鐗╂枡鍚嶇О</label>
                                         <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="MaterialName" id="MaterialName" style="width:190px;">
+                                            <input type="text" class="layui-input ForFilteringSchemes" name="MaterialName" id="MaterialName" style="width:190px;">
                                         </div>
                                     </div>
                                     <div class="layui-inline">
                                         <label class="layui-form-label">瑙勬牸鍨嬪彿</label>
                                         <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="SpecificationModel" id="SpecificationModel" style="width:190px;">
+                                            <input type="text" class="layui-input ForFilteringSchemes" name="SpecificationModel" id="SpecificationModel" style="width:190px;">
                                         </div>
                                     </div>
                                     <div class="layui-inline">
                                         <label class="layui-form-label">婧愬崟鍗曞彿</label>
                                         <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="HSourceBillNo" id="HSourceBillNo" style="width:190px;">
+                                            <input type="text" class="layui-input ForFilteringSchemes" name="HSourceBillNo" id="HSourceBillNo" style="width:190px;">
                                         </div>
                                     </div>
                                     <div class="layui-inline">
                                         <label class="layui-form-label">浠撳簱</label>
                                         <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="Warehouse" id="Warehouse" style="width:190px;">
+                                            <input type="text" class="layui-input ForFilteringSchemes" name="Warehouse" id="Warehouse" style="width:190px;">
                                         </div>
                                     </div>
                                     <div class="layui-inline">
                                         <label class="layui-form-label">鍒跺崟浜�</label>
                                         <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="Hmaker" id="Hmaker" style="width:190px;">
+                                            <input type="text" class="layui-input ForFilteringSchemes" name="Hmaker" id="Hmaker" style="width:190px;">
+                                        </div>
+                                    </div>
+
+                                    <hr />
+                                    <div class="layui-row" style=" margin-top: 10px; margin-left: 70px;">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">杩囨护</label>
+                                            <div class="layui-input-block">
+                                                <select name="ColName" id="ColName" class="ForFilteringSchemes" lay-filter="ColName" style="width:190px;">
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <select name="Comparator" id="Comparator" class="ForFilteringSchemes" 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 ForFilteringSchemes" value="" name="ColContent" id="ColContent">
+                                        </div>
+                                    </div>
+
+                                    <div class="layui-row" style=" margin-top: 10px; margin-left: 70px;">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">杩囨护</label>
+                                            <div class="layui-input-block">
+                                                <select name="ColName1" id="ColName1" class="ForFilteringSchemes" lay-filter="ColName1" style="width:190px;">
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <select name="Comparator1" id="Comparator1" class="ForFilteringSchemes" lay-filter="Comparator1" 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 ForFilteringSchemes" value="" name="ColContent1" id="ColContent1">
+                                        </div>
+                                    </div>
+
+                                    <div class="layui-row" style=" margin-top: 10px; margin-left: 70px;">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">杩囨护</label>
+                                            <div class="layui-input-block">
+                                                <select name="ColName2" id="ColName2" class="ForFilteringSchemes" lay-filter="ColName2" style="width:190px;">
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <select name="Comparator2" id="Comparator2" class="ForFilteringSchemes" lay-filter="Comparator2" 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 ForFilteringSchemes" value="" name="ColContent2" id="ColContent2">
                                         </div>
                                     </div>
                                 </div>
@@ -106,20 +205,24 @@
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
                                 <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>棰勮</button>-->
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></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="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-confirm" id="btn_confirm"><i class="layui-icon layui-icon-ok-circle"></i>纭</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back" id="btn_back"><i class="layui-icon layui-icon-close-fill"></i>椹冲洖</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>璇︽儏</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>鐢熸垚閫佽揣鍗�</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></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" style="display:none;" id="btn-Add" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-Edit" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="set_DeleteBill" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="get_Refresh" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-Audit" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>瀹℃牳</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-DeAudit" 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-Close" id="Close"><i class="layui-icon layui-icon-radio"></i>鍏抽棴</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeClose" id="DeClose"><i class="layui-icon layui-icon-radio"></i>鍙嶅叧闂�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Drop" id="Drop"><i class="layui-icon layui-icon-radio"></i>浣滃簾</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeDrop" id="DeDrop"><i class="layui-icon layui-icon-radio"></i>鍙嶄綔搴�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-view" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>棰勮</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-print" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>鎵撳嵃</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="set_HideColumn" lay-event="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="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>鎸夐挳璁剧疆</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-BarCodeDetail" lay-event="btn-BarCodeDetail"><i class="layui-icon layui-icon-form"></i>鏉$爜鏄庣粏</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="get_Exit" 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_SaveScheme" id="set_SaveScheme"><i class="layui-icon layui-icon-template"></i>淇濆瓨鏂规</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_ReadScheme" id="set_ReadScheme"><i class="layui-icon layui-icon-set"></i>璇诲彇鏂规</button>
                             </div>
                         </script>
                     </form>
@@ -133,7 +236,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.$
@@ -145,6 +248,7 @@
                 , laypage = layui.laypage
                 , laydate = layui.laydate
                 , util = layui.util
+                , soulTable = layui.soulTable
             //鏌ヨ鏉′欢
             var sWhere = "";
             var option = [];
@@ -153,12 +257,124 @@
 
             //#region 杩涘叆椤甸潰鍗冲姞杞�
 
+            //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般��
+            var HModuleType = "1210";
+            //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js
+            var HPageTitle = get_PageTitle(HModuleType) == "" ? document.title : get_PageTitle(HModuleType);
+            //#endregion 
+            var titleData = ["HMaterID", "HUnitID", "HICMOEmpID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+            //#region 銆愯繃婊ゆ柟妗堛��
+
+            //杩囨护鏉′欢鐨刢lass绫�
+            var HClassTag = "ForFilteringSchemes";
+            //妯″潡鍚嶇О锛堜腑鏂囩増锛� 姣忎釜妯″潡椤甸潰閮介渶瑕佷慨鏀�
+            window.HModuleName = "濮斿鍔犲伐鍏ュ簱鍗曠淮鎶�";
+            //鏄惁宸茬粡閫夋嫨浜嗚繃婊ゆ柟妗堬紙鍏ㄥ眬鍙橀噺锛�
+            window.HDefaultFilter = "";
+            //閫夋嫨鐨勮繃婊ゆ柟妗堝唴鐮侊紙鍏ㄥ眬鍙橀噺锛�
+            window.HInterID_Choose = 0;
+
+            //#endregion
+
+            var HModName = "Kf_EntrustInBillList";
             //鍒濆鍖栫晫闈�
             set_ClearBill();
             //#endregion
 
             //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+            //#region 澶村伐鍏锋爮浜嬩欢
+            table.on('toolbar(mainTable)', function (obj) {
+                switch (obj.event) {
+                    //鏂板
+                    case 'set_AddNew': set_AddNew();
+                        break;
+                    //缂栬緫
+                    case 'set_ShowBill': set_ShowBill();
+                        break;
+                    //鍒犻櫎
+                    case 'set_DeleteBill':
+                        var checkStatus = table.checkStatus('mainTable')
+                        , data = checkStatus.data;
+                        if (checkStatus.data.length === 1) {
+                            var InterID = data[0].hmainid.toString();
+                            //閫昏緫鍒犻櫎鏂规硶
+                            layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) {
+                                $.ajax({
+                                    type: "GET",
+                                    url: GetWEBURL() + "Kf_EntrustInBill/DeleteKf_EntrustInBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                                    data: { "HInterID": InterID, "user": 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);
+                                                //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                                window.location.reload();
+                                            });
 
+                                        } else {
+                                            layer.alert(result.code + result.Message, { icon: 5 });
+                                        }
+                                    }, error: function () {
+                                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                                    }
+                                });
+                            })
+                        }
+                        else {
+                            layer.msg('璇烽�夋嫨涓�琛屾暟鎹垹闄わ紒');
+                        }
+                        break;
+                    //瀹℃牳鎸夐挳
+                    case 'btn-Audit':
+                        set_CheckBill(1);
+                        break;
+                    //鍙嶅鏍告寜閽�
+                    case 'btn-DeAudit':
+                        set_CheckBill(2);
+                        break;
+                    //鍏抽棴鎸夐挳        锛�1:鍏抽棴銆�2:鍙嶅叧闂級
+                    case 'btn-Close':
+                        set_CloseBill(1);
+                        break;
+                    //鍙嶅叧闂寜閽�
+                    case 'btn-DeClose':
+                        set_CloseBill(2);
+                        break;
+                    //浣滃簾鎸夐挳        锛�1:浣滃簾銆�2:鍙嶄綔搴燂級
+                    case 'btn-Drop':
+                        set_DropBill(1);
+                        break;
+                    //鍙嶄綔搴熸寜閽�
+                    case 'btn-DeDrop':
+                        set_DropBill(2);
+                        break;
+                    //鍏抽棴
+                    case 'set_CloseBill': set_CloseBill();
+                        break;
+                    //鍒楄缃�
+                    case 'set_HideColumn': get_HideColumn();
+                        break;
+                    case 'btn-BarCodeDetail': get_BarCodeDetail();
+                        break;
+                    //鎸夐挳璁剧疆
+                    case 'set_HideButton':
+                        var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                        var HBillType = "1210";
+                        get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+                        break;
+                    //淇濆瓨鏂规
+                    case 'set_SaveScheme': set_SaveScheme();
+                        break;
+                    //璇诲彇鏂规
+                    case 'set_ReadScheme': set_ReadScheme();
+                        break;
+                };
+            });
+
+        //#endregion
             //鏌ヨ鎸夐挳
             form.on('submit(btnSearch)', function (data) {
                 get_FastQuery();
@@ -173,34 +389,153 @@
             table.on('rowDouble(mainTable)', function (obj) {
                 layer.alert("鍙屽嚮浜嬩欢", { icon: 1 });
             });
+
+            //鏃ユ湡闂撮殧涓嬫媺鍒楄〃鐩戝惉
+            form.on('select(HInitTimeCycle)', function (data) {
+                var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
+                //鑻ユ棩鏈熼棿闅斾笉涓� 浠绘剰闂撮殧锛屽垯绂佺敤寮�濮嬫棩鏈熶笌缁撴潫鏃ユ湡鐨勯�夋嫨
+                if (HInitTimeCycle != -1) {
+                    $('#HBeginDate').prop('disabled', true);
+                    $('#HEndDate').prop('disabled', true);
+
+                    $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
+                    $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+
+                    //鎵ц鏌ヨ鏂规硶
+                    get_FastQuery();
+                } else {
+                    $('#HBeginDate').prop('disabled', false);
+                    $('#HEndDate').prop('disabled', false);
+                }
+            });
+
              //#endregion
 
             //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
 
             // 鍒濆鍖栫晫闈�
             function set_ClearBill() {
+                //鍒濆鍖栨棩鏈熼棿闅斻�佸紑濮嬫棩鏈熴�佺粨鏉熸棩鏈�
+                setSelect_HInitTimeCycle();
+                //鑻ユ棩鏈熼棿闅斾笉涓� 浠绘剰闂撮殧锛屽垯绂佺敤寮�濮嬫棩鏈熶笌缁撴潫鏃ユ湡鐨勯�夋嫨
+                var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
+                if (HInitTimeCycle != -1) {
+                    $('#HBeginDate').prop('disabled', true);
+                    $('#HEndDate').prop('disabled', true);
+                } else {
+                    $('#HBeginDate').prop('disabled', false);
+                    $('#HEndDate').prop('disabled', false);
+                }
+
+                //鏍规嵁鏃ユ湡闂撮殧璁剧疆寮�濮嬫椂闂翠笌缁撴潫鏃堕棿
+                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
+                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                 //鍒濆鍖栬〃鏍�
                 set_InitGrid();
                 //鏌ヨ
                 get_Display(sWhere);
-                //鍒濆鍖栨棩鏈�
-                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
-                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
-            }
 
+                //浠绘剰瀛楁杩囨护涓嬫媺妗嗗垵濮嬪寲
+                ColFilter();
+
+                //鏌ヨ褰撳墠鐧诲綍鐢ㄦ埛鏈夋病鏈夊湪褰撳墠妯″潡璁剧疆榛樿杩囨护鏂规
+                get_DefaultModule();
+            }
+            //#endregion  鐩戝惉缃戞牸琛ㄤ綋浜嬩欢
+            table.on('tool(mainTable)', function (obj) {
+                var data = obj.data;
+
+                //鍗曟嵁鍙疯秴閾炬帴
+                if (obj.event == '鍗曟嵁鍙�') {                  //妫�鏌� obj.event 鏄惁绛変簬瀛楃涓� '鍗曟嵁鍙�'銆傚鏋滅瓑浜庯紝鍒欐墽琛宨f寰幆
+                    var linterid = data.hmainid.toString();    //澹版槑鍙橀噺linterid 涓� data.hmainid   
+                    //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
+                    layer.open({                //浣跨敤 layer鐨刼pen鎵撳紑寮瑰嚭 灞� 
+                        type: 2                         //琛ㄧず寮瑰嚭灞傜殑鍐呭鏄竴涓� iframe
+                        , area: ['100%', '100%']
+                        , title: '缂栬緫' + HPageTitle  //璁剧疆寮瑰嚭灞傜殑鍚嶅瓧鍜屽彉閲�
+                        , closeBtn: 1//鏄剧ず鍏抽棴鎸夐挳
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: './Kf_EntrustInBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0&closeType=1'  //璁剧疆 iframe 鐨� URL锛孶RL 涓寘鍚簡鏌ヨ鍙傛暟锛屾潵璋冪敤鎵�闇�瑕佺殑鍊�
+
+                        , resize: false,  //鏄惁鍏佽鐢ㄦ埛璋冩暣寮瑰嚭澶у皬
+                        end: function () {  //褰撳叧闂椂璋冪敤
+                            get_FastQuery(table, option);
+                        }
+                        , cancel: function () {  //鐐瑰嚮鍙栨秷鏃朵娇鐢ㄥ洖璋�
+                            //$(".layui-btn").removeClass("layui-btn-disabled");
+                        }
+                    })
+                }
+            });
+             //#endregion
             //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
             function get_Display(sWhere) {
                 var index = layer.load();
-                $.ajax({
-                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
+                $.ajax({ 
                     url: GetWEBURL() + '/Kf_EntrustInBill/GetEntrustInBill',
                     type: "GET",
-                    data: { "sWhere": sWhere },
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
                     success: function (data1) {
                         if (data1.count == 1) {
+                            var data = [];//鍒楀瓧娈垫暟鎹�
+                            var col = [];
+                            var totalArray = [];
+                            //缁欑┖鐨勬暟缁勮祴鍊�
+                            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', totalRowText: '鍚堣' });
+                            for (var i = 0; i < data.length; i++) {//閬嶅巻data鏁扮粍閲嶇殑鏁版嵁
+                                // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
+                                if ($.inArray(data[i].name, titleData) > -1) {//妫�鏌ata銆恑銆�.name鏄惁鍦ㄦ暟缁勪腑  //璁$畻鍒�
+                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
+                                }
+                                else if ($.inArray(data[i].name, totalArray) > -1) { //璁$畻鍒�  
+                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
+                                } else if (data[i].name == '鍗曟嵁鍙�') {
+                                    col.push({
+                                        field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '鍗曟嵁鍙�', templet: function (d) {
+                                            return '<span style="color: blue;">' + d.鍗曟嵁鍙� + '</span>'
+                                        }, style: 'cursor: pointer;' });
+                                } 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 == "琛屽叧闂棩鏈�" ? "琛屽叧闂汉" : data[i].name) + " ==''?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</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: 800
+                                , page: true
+                                , totalRow: true
+                                , cellMinWidth: 90
+                                , limit: 50
+                                , limits: [50, 500, 5000, 20000]
+                                , done: function (res, curr, count) {
+                                    soulTable.render(this);
+                                }
+                            }
+
                             option.data = data1.data;
                             table.render(option);
                             layer.close(index);
+
+                            //鍒锋柊鎸夐挳鏄剧ず
+                            var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                            var HBillType = "1210";
+                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                         } else {
                             layer.close(index);
                             layer.alert(data1.code + data1.Message, { icon: 5 });
@@ -210,84 +545,420 @@
                         layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
                     }
                 });
+                DisPlay_HideColumn();
+            }
+            //闅愯棌鍒楄缃�
+            function get_HideColumn() {
+                var colName = "";
+                for (var i = 1; i < option.cols[0].length - 1; i++) {
+                    colName += option.cols[0][i]["title"] + ",";
+                }
+
+                colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜
+                layer.open({
+                    type: 2
+                    , skin: "layui-layer-rim" //鍔犱笂杈规
+                    , title: "闅愯棌鍒楄缃�"  //鏍囬
+                    , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , area: ["50%", "90%"] //绐椾綋澶у皬
+                    , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                    , content: ['../../鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index, laero) {
+                        //鍒锋柊琛ㄦ牸鏁版嵁
+                        DisPlay_HideColumn();
+                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                        layer.close(index);//鍏抽棴寮圭獥
+                    }
+                })
+            }
+
+            //鏂板
+            function set_AddNew() {
+                layer.open({
+                    type: 2,
+                    skin: 'layui-layer-rim', //鍔犱笂杈规
+                    title: '鏂板濮斿鍗�',
+                    closeBtn: 1,
+                    shift: 2,
+                    area: ['100%', '100%'],
+                    maxmin: true,
+                    content: './Kf_EntrustInBill.html?OperationType=1&linterid=&HSouceBillType=0&closeType=1',
+                    end: function () {
+                        //鍒锋柊椤甸潰,
+                        get_FastQuery(table, option);
+                    },
+                    success: function (layero, index) {
+
+                    }
+                });
+            }
+            //缂栬緫鍗曟嵁
+            function set_ShowBill() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var linterid = data[0].hmainid.toString();
+                    //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '缂栬緫濮斿鍑哄簱鍗�'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: './Kf_EntrustInBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0&closeType=1'
+                        , resize: false,
+                        end: function () {
+                            get_FastQuery(table, option);
+                        }
+                        , cancel: function () {
+                            //$(".layui-btn").removeClass("layui-btn-disabled");
+                        }
+                    })
+                } else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
+                }
+            }
+
+
+            //#region 鍙嶅鏍�/瀹℃牳鏁版嵁
+            function set_CheckBill(num) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var InterID = data[0].hmainid.toString();
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Kf_EntrustInBill/AuditKf_EntrustInBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "Type": num, "user": 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 });
+                        }
+                    });
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹鏍革紒');
+                }
+            }
+            //#endregion
+
+            //#region 鍙嶅叧闂�/鍏抽棴鏁版嵁
+            function set_CloseBill(num) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var InterID = data[0].hmainid.toString();
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Kf_EntrustInBill/CloseKf_EntrustInBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "Type": num, "user": 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 });
+                        }
+                    });
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹鏍革紒');
+                }
+            }
+            //#endregion
+
+            //#region 鍙嶄綔搴�/浣滃簾鏁版嵁
+            function set_DropBill(num) {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var InterID = data[0].hmainid.toString();
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Kf_EntrustInBill/DropKf_EntrustInBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "Type": num, "user": 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 });
+                        }
+                    });
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹鏍革紒');
+                }
+            }
+            //#endregion
+
+
+            //#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_BarCodeDetail() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var HInterID = data[0].hmainid;
+                    var HBillType = '1210';
+                    var HBillNo = data[0]["鍗曟嵁鍙�"];
+                    //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
+                    layer.open({
+                        type: 2
+                        , area: ['90%', '90%']
+                        , title: '濮斿鍏ュ簱鍗曟潯鐮佹槑缁�'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../../鏉$爜鏄庣粏/Kf_BarCodeDetailQuery.html?HInterID=' + HInterID + '&HBillType=' + HBillType + '&HBillNo=' + HBillNo
+                        , resize: false
+                        , btn: ["纭畾", "鍙栨秷"]
+                        , end: function () {
+                            //鍒锋柊椤甸潰,
+                            //location.reload();
+                        }
+                        , cancel: function () {
+                            //$(".layui-btn").removeClass("layui-btn-disabled");
+                        }
+                    })
+
+                } else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
+                }
+            }
+
+            //鏄剧ず鍒楁暟鎹�
+            function DisPlay_HideColumn() {
+                $.ajax({
+                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+                    type: "GET",
+                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+                    success: function (data1) {
+                        if (data1.data.length != 0) {
+
+
+                            var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+                            var titleData = ["HMaterID", "HUnitID", "HICMOEmpID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+                            dataCol = data1.data[0].HGridString.split(',');
+
+                            for (var i = 0; i < option.cols[0].length - 2; i++) {
+                                var dataCols = dataCol[i].split('|');
+                                //闅愯棌鍒�
+                                if (dataCols[1] == 1) {
+                                    option.cols[0][i + 1]["hide"] = true;
+                                }
+                                //璁剧疆鍒楀
+                                if (dataCols[3] > 0) {
+                                    option.cols[0][i + 1]["width"] = dataCols[3];
+                                }
+                                //璁剧疆鍐呭瀛椾綋澶у皬
+                                if (data1.data[0].HFontSize != 0) {
+                                    option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
+                                } else {
+                                    option.cols[0][i + 1]["style"] = "font-size:100%";
+                                }
+                                //璁剧疆鍒楀
+                                //if (data1.data[0].HColumnWidth != 0) {
+                                //    option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
+                                //} else {
+                                //    option.cols[0][i + 1]["width"] = "";
+                                //}
+                                //鏄剧ず鍒�
+                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
+                                    option.cols[0][i + 1]["hide"] = false;
+                                }
+                                //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�)
+                                switch (dataCols[2]) {
+                                    case "L":
+                                        option.cols[0][i + 1]["align"] = "left";
+                                        break;
+                                    case "M":
+                                        option.cols[0][i + 1]["align"] = "center";
+                                        break;
+                                    case "R":
+                                        option.cols[0][i + 1]["align"] = "right";
+                                        break;
+                                }
+                            }
+
+                            //鍙栨秷鍐荤粨鍒�
+                            for (var i = 1; i < option.cols[0].length - 1; i++) {
+                                if (option.cols[0][i]["fixed"] != null) {
+                                    option.cols[0][i]["fixed"] = null;
+                                }
+                                else {
+                                    break;
+                                }
+                            }
+                            //鍐荤粨鍒�
+                            if (data1.data[0].HFixCols != 0) {
+                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
+                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
+                                        data1.data[0].HFixCols += 1;
+                                    }
+                                    option.cols[0][i + 1]["fixed"] = "left";
+                                }
+                            }
+                            table.render(option);
+                        } else {
+                            table.render(option);
+                        }
+
+                        //鍒锋柊鎸夐挳鏄剧ず
+                        var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                        var HBillType = "1210";
+                        Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                })
             }
 
             // 鍒濆鍖栬〃鏍兼柟娉�
             function set_InitGrid() {
                 option = {
                     elem: '#mainTable'
-                    //, toolbar: '#toolbarDemo'
+                    , toolbar: '#toolbarDemo'
                     , height: 'full-50'
                     , page: true
+                    , totalRow: true
                     , cellMinWidth: 90
+                    , limit: 50
+                    , limits: [50, 500, 5000, 20000]
+                    , done: function (res, curr, count) {
+                        soulTable.render(this);
+                    }
                     , cols: [[
-                        { field: 'hmainid', title: '鍗曟嵁ID', hide: true }
-                        , { field: '鏃ユ湡', title: '鏃ユ湡', width: 160 }
-                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', width: 160 }
-                        , { field: 'hsupid', title: 'hsupid', width: 160, hide: true }
-                        , { field: '鍔犲伐鍗曚綅浠g爜', title: '鍔犲伐鍗曚綅浠g爜', width: 200 }
-                        , { field: '鍔犲伐鍗曚綅鍚嶇О', title: '鍔犲伐鍗曚綅鍚嶇О', width: 200 }
-                        , { field: 'HEmpID', title: 'HEmpID', width: 200, hide: true }
-                        , { field: '涓氬姟鍛樹唬鐮�', title: '涓氬姟鍛樹唬鐮�', width: 200 }
-                        , { field: '涓氬姟鍛�', title: '涓氬姟鍛�', width: 200 }
-                        , { field: 'hmanagerid', title: 'hmanagerid', width: 200, hide: true }
-                        , { field: '涓荤浠g爜', title: '涓荤浠g爜', width: 160 }
-                        , { field: '涓荤', title: '涓荤', width: 160 }
-                        , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 160, hide: true }
-                        , { field: '楠屾敹鍛樹唬鐮�', title: '楠屾敹鍛樹唬鐮�', width: 200 }
-                        , { field: '楠屾敹鍛�', title: '楠屾敹鍛�', width: 200 }
-                        , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true }
-                        , { field: '淇濈鍛樹唬鐮�', title: '淇濈鍛樹唬鐮�', width: 200 }
-                        , { field: '淇濈鍛�', title: '淇濈鍛�', width: 200 }
-                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
-                        , { field: '閮ㄩ棬浠g爜', title: '閮ㄩ棬浠g爜', width: 200 }
-                        , { field: '閮ㄩ棬', title: '閮ㄩ棬', width: 115 }
-                        , { field: '鎽樿', title: '鎽樿', width: 115 }
-                        , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞', width: 200 }
-                        , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�', width: 200 }
-                        , { field: '绾㈣摑鍗曟爣璁�', title: '绾㈣摑鍗曟爣璁�', width: 115 }
-                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 200 }
-                        , { 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 }
-                        , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 200 }
-                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 200 }
-                        , { field: 'hsubid', title: 'hsubid', width: 115, hide: true }
-                        , { field: 'hmaterid', title: 'hmaterid', 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: 'hunitid', title: 'hunitid', 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: '閲戦', title: '閲戦', width: 200 }
-                        , { field: 'hwhid', title: 'hwhid', 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: '婧愬崟涓诲唴鐮�', title: '婧愬崟涓诲唴鐮�', width: 200, hide: true }
-                        , { field: '婧愬崟瀛愬唴鐮�', title: '婧愬崟瀛愬唴鐮�', width: 200 }
-                        , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿', width: 200 }
-                        , { field: '婧愬崟绫诲瀷', title: '婧愬崟绫诲瀷', width: 200 }
-                        , { field: '閲囪喘璁㈠崟涓籌D', title: '閲囪喘璁㈠崟涓籌D', width: 200, hide: true }
-                        , { field: '閲囪喘璁㈠崟瀛怚D', title: '閲囪喘璁㈠崟瀛怚D', width: 200, hide: true }
-                        , { field: '閲囪喘璁㈠崟鍙�', title: '閲囪喘璁㈠崟鍙�', width: 200 }
-                        , { field: '閿�鍞鍗曚富ID', title: '閿�鍞鍗曚富ID', width: 200, hide: true }
-                        , { field: '閿�鍞鍗曞瓙ID', title: '閿�鍞鍗曞瓙ID', width: 200, hide: true }
-                        , { field: '閿�鍞鍗曞彿', title: '閿�鍞鍗曞彿', width: 200 }
-                        , { field: '鍏宠仈鏁伴噺', title: '鍏宠仈鏁伴噺', width: 200 }
-                        , { field: 'HBillType', title: 'HBillType', width: 200, hide: true }
+                        { type: 'checkbox', fixed: 'left' }
+                        , { field: 'hmainid', title: '鍗曟嵁ID', hide: true, sort: true }
+                        , { field: '鏃ユ湡', title: '鏃ユ湡', width: 160, sort: true }
+                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', width: 160, sort: true }
+                        , { field: 'hsupid', title: 'hsupid', width: 160, hide: true, sort: true }
+                        , { field: '鍔犲伐鍗曚綅浠g爜', title: '鍔犲伐鍗曚綅浠g爜', width: 200, sort: true }
+                        , { field: '鍔犲伐鍗曚綅鍚嶇О', title: '鍔犲伐鍗曚綅鍚嶇О', width: 200, sort: true }
+                        , { field: 'HEmpID', title: 'HEmpID', width: 200, hide: true, sort: true }
+                        , { field: '涓氬姟鍛樹唬鐮�', title: '涓氬姟鍛樹唬鐮�', width: 200, sort: true }
+                        , { field: '涓氬姟鍛�', title: '涓氬姟鍛�', width: 200, sort: true }
+                        , { field: 'hmanagerid', title: 'hmanagerid', width: 200, hide: true, sort: true }
+                        , { field: '涓荤浠g爜', title: '涓荤浠g爜', width: 160, sort: true }
+                        , { field: '涓荤', title: '涓荤', width: 160, sort: true }
+                        , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 160, hide: true, sort: true }
+                        , { field: '楠屾敹鍛樹唬鐮�', title: '楠屾敹鍛樹唬鐮�', width: 200, sort: true }
+                        , { field: '楠屾敹鍛�', title: '楠屾敹鍛�', width: 200, sort: true }
+                        , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true, sort: true }
+                        , { field: '淇濈鍛樹唬鐮�', title: '淇濈鍛樹唬鐮�', width: 200, sort: true }
+                        , { field: '淇濈鍛�', title: '淇濈鍛�', width: 200, sort: true }
+                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true, sort: true }
+                        , { field: '閮ㄩ棬浠g爜', title: '閮ㄩ棬浠g爜', width: 200, sort: true }
+                        , { field: '閮ㄩ棬', title: '閮ㄩ棬', width: 115, sort: true }
+                        , { field: '鎽樿', title: '鎽樿', width: 115, sort: true }
+                        , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞', width: 200, sort: true }
+                        , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�', width: 200, sort: true }
+                        , { field: '绾㈣摑鍗曟爣璁�', title: '绾㈣摑鍗曟爣璁�', width: 115, 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: 200, sort: true }
+                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', width: 115, sort: true }
+                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 200, sort: true }
+                        , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 200, sort: true }
+                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 200, sort: true }
+                        , { field: 'hsubid', title: 'hsubid', width: 115, hide: true, sort: true }
+                        , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true, sort: true }
+                        , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', 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: 'hunitid', title: 'hunitid', width: 200, hide: true, sort: true }
+                        , { field: '璁¢噺鍗曚綅浠g爜', title: '璁¢噺鍗曚綅浠g爜', 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: 200, sort: true }
+                        , { field: 'hwhid', title: 'hwhid', width: 200, hide: true, sort: true }
+                        , { field: '鍙戣揣浠撳簱浠g爜', title: '鍙戣揣浠撳簱浠g爜', 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: 200, hide: true, sort: true }
+                        , { field: '婧愬崟瀛愬唴鐮�', title: '婧愬崟瀛愬唴鐮�', width: 200, sort: true }
+                        , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿', width: 200, sort: true }
+                        , { field: '婧愬崟绫诲瀷', title: '婧愬崟绫诲瀷', width: 200, sort: true }
+                        , { field: '閲囪喘璁㈠崟涓籌D', title: '閲囪喘璁㈠崟涓籌D', width: 200, hide: true, sort: true }
+                        , { field: '閲囪喘璁㈠崟瀛怚D', title: '閲囪喘璁㈠崟瀛怚D', width: 200, hide: true, sort: true }
+                        , { field: '閲囪喘璁㈠崟鍙�', title: '閲囪喘璁㈠崟鍙�', width: 200, sort: true }
+                        , { field: '閿�鍞鍗曚富ID', title: '閿�鍞鍗曚富ID', width: 200, hide: true, sort: true }
+                        , { field: '閿�鍞鍗曞瓙ID', title: '閿�鍞鍗曞瓙ID', width: 200, hide: true, sort: true }
+                        , { field: '閿�鍞鍗曞彿', title: '閿�鍞鍗曞彿', width: 200, sort: true }
+                        , { field: '鍏宠仈鏁伴噺', title: '鍏宠仈鏁伴噺', width: 200, sort: true }
+                        , { field: 'HBillType', title: 'HBillType', width: 200, hide: true, sort: true }
                     ]]
                 };
             }
@@ -303,6 +974,81 @@
                 var HSourceBillNo = $("#HSourceBillNo").val();//婧愬崟鍗曞彿
                 var Warehouse = $("#Warehouse").val();//浠撳簱
                 var Hmaker = $("#Hmaker").val();//鍒跺崟浜�
+                var ColName = $("#ColName").val();//澶嶉�夋
+                var Comparator = $("#Comparator").val()
+                var ColContent = $("#ColContent").val();
+                var ColName1 = $("#ColName1").val();//澶嶉�夋
+                var Comparator1 = $("#Comparator1").val()
+                var ColContent1 = $("#ColContent1").val();
+                var ColName2 = $("#ColName2").val();//澶嶉�夋
+                var Comparator2 = $("#Comparator2").val()
+                var ColContent2 = $("#ColContent2").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 (ColName1 != 0 && Comparator1 != 0) {
+                    var com1 = "";
+                    switch (Comparator1) {
+                        case "7":
+                            com1 = "like'%" + ColContent1 + "%'";
+                            break;
+                        case "8":
+                            com1 = "like'%" + ColContent1 + "'";
+                            break;
+                        case "9":
+                            com1 = "like'" + ColContent1 + "%'";
+                            break;
+                        case "10":
+                            com1 = "not like'%" + ColContent1 + "%'";
+                            break;
+                        default:
+                            com1 = "" + Comparator1 + "'" + ColContent1 + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName1 + " " + com1;
+                }
+                if (ColName2 != 0 && Comparator2 != 0) {
+                    var com2 = "";
+                    switch (Comparator2) {
+                        case "7":
+                            com2 = "like'%" + ColContent2 + "%'";
+                            break;
+                        case "8":
+                            com2 = "like'%" + ColContent2 + "'";
+                            break;
+                        case "9":
+                            com2 = "like'" + ColContent2 + "%'";
+                            break;
+                        case "10":
+                            com2 = "not like'%" + ColContent2 + "%'";
+                            break;
+                        default:
+                            com2 = "" + Comparator + "'" + ColContent + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName2 + " " + com2;
+                }
 
                 if (HDate) {
                     sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
@@ -340,8 +1086,9 @@
             }
             // 閲嶇疆杩囨护鏉′欢
             function set_ClearQuery() {
-                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
-                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+                var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
+                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd")); //寮�濮嬫棩鏈�
+                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));  //缁撴潫鏃ユ湡
                 $("#HBillNo").val("");//鍗曟嵁鍙�
                 $("#HDeptID").val();//閮ㄩ棬
                 $("#MaterialCode").val();//鐗╂枡浠g爜
@@ -350,7 +1097,280 @@
                 $("#HSourceBillNo").val();//婧愬崟鍗曞彿
                 $("#Warehouse").val();//浠撳簱
                 $("#Hmaker").val();//鍒跺崟浜�
+                $("#ColContent").val("");
+                $("#ColName").val("0");
+                $("#Comparator").val("0");
+                $("#ColName1").val();//澶嶉�夋
+                $("#Comparator1").val()
+                $("#ColContent1").val();
+                $("#ColName2").val();//澶嶉�夋
+                $("#Comparator2").val()
+                $("#ColContent2").val();
                 sWhere = "";
+            }
+
+            //#endregion
+
+            //#region 鍒濆鏃ユ湡闂撮殧 涓嬫媺鍒楄〃
+            function setSelect_HInitTimeCycle() {
+                var valueList = [0, 1, 2, 3, 4, 5, 6, 29];
+                var titleList = ["浠婂ぉ", "杩戜袱澶�", "杩戜笁澶�", "杩戝洓澶�", "杩戜簲澶�", "杩戝叚澶�", "杩戜竷澶�", "杩�30澶�"];
+
+                var HInitTimeCycle_ArrayList = '<option  value="-1" selected="selected" >浠绘剰闂撮殧</option>';
+                for (var i = 0; i < valueList.length; i++) {
+                    HInitTimeCycle_ArrayList += '<option  style="color:blue;" value="' + valueList[i] + '">' + titleList[i] + '</option>';
+                }
+
+                $("#HInitTimeCycle").empty();
+                $("#HInitTimeCycle").append(HInitTimeCycle_ArrayList);
+                form.render('select');
+
+                $("#HInitTimeCycle").val("29");
+            }
+            //#endregion
+
+            //#region 浠绘剰瀛楁杩囨护锛氬垪鍚嶆樉绀轰笅鎷夋
+            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);
+                $("#ColName1").empty();
+                $("#ColName1").append(Organization);
+                  $("#ColName2").empty();
+                $("#ColName2").append(Organization);
+              
+               
+                form.render('select');
+            }
+            //#endregion
+
+            //#region 銆愯繃婊ゆ柟妗堛��
+
+            //鑾峰彇褰撳墠鐢ㄦ埛鐨勯粯璁よ繃婊ゆ柟妗�
+            function get_DefaultModule() {
+                $.ajax({
+                    url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
+                    type: "GET",
+                    data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": 0, "Type": "Default" },
+                    success: function (data1) {
+                        if (data1.count == 1) {
+                            //褰撳墠鐢ㄦ埛璁剧疆鏈夐粯璁ょ殑杩囨护鏂规
+                            var data = data1.data;
+                            //褰撳墠閫夋嫨鐨勮繃婊ゆ柟妗�
+                            HInterID_Choose = data[0].hmainid;
+                            //杩囨护鏂规鍐呯爜
+                            HInterID = data[0].hmainid
+                            //杩囨护鏂规鍚嶇О
+                            HDefaultFilter = data[0].鏂规鍚嶇О
+                            //杩囨护鏂规鐨勫娉紙鏂规淇℃伅鎻忚堪锛�
+                            var HRemark = data[0].澶囨敞
+                            //鏄剧ず鍑哄綋鍓嶇殑榛樿杩囨护鏂规
+                            document.getElementById("HFilterScheme_Now").style.display = "block";
+                            document.getElementById('HFilterScheme_Now').innerHTML = "褰撳墠杩囨护鏂规锛�" + HDefaultFilter + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + HRemark + ")" + '</span>';
+                            //鎶婅繃婊ゆ潯浠跺�煎洖鍐欏埌椤甸潰涓�
+                            for (let i = 0; i < data.length; i++) {
+                                $("#" + data[i].杩囨护瀛楁ID).val(data[i].杩囨护鍊�);
+                                if (data[i].杩囨护鏍囩绫诲瀷 == 'SELECT') {
+                                    $("#" + data[i].杩囨护瀛楁ID).find("option[value='" + data[i].杩囨护鍊� + "']").attr("selected", true);
+                                }
+                            }
+
+                            var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
+                            //鑻ユ棩鏈熼棿闅斾笉涓� 浠绘剰闂撮殧锛屽垯绂佺敤寮�濮嬫棩鏈熶笌缁撴潫鏃ユ湡鐨勯�夋嫨
+                            if (HInitTimeCycle != -1) {
+                                $('#HBeginDate').prop('disabled', true);
+                                $('#HEndDate').prop('disabled', true);
+
+                                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
+                                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+
+
+                                //鎵ц鏌ヨ鏂规硶
+                                get_FastQuery();
+                            } else {
+                                $('#HBeginDate').prop('disabled', false);
+                                $('#HEndDate').prop('disabled', false);
+                            }
+
+                            //鎵ц鏌ヨ鏂规硶
+                            get_FastQuery()
+                            form.render("select");
+                        } else {
+                            //褰撳墠鐢ㄦ埛娌℃湁璁剧疆榛樿鐨勮繃婊ゆ柟妗�
+                            //闅愯棌鏄剧ず杩囨护鏂规鐨勬爣绛句俊鎭�
+                            document.getElementById("HFilterScheme_Now").style.display = "none";
+                            ////鎵ц鏌ヨ鏂规硶
+                            //get_FastQuery()
+                            //form.render("select");
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+            }
+
+            //淇濆瓨鏂规
+            function set_SaveScheme() {
+                var index = layer.open()
+                //鍒ゆ柇鐢ㄦ埛鏄惁鐐瑰嚮浜嗗彸涓婅鐨勨�滃弶鍙封�濆叧闂脊绐楅〉闈�
+                var HIsClose_Manual = false;
+                //鑾峰彇鏈〉鎵�鏈夎繃婊ゆ潯浠跺璞�(class涓寘鍚�"ForFilteringSchemes"鐨勫厓绱�)
+                var Filter = document.getElementsByClassName(HClassTag);
+
+                var HFilterIdList = "";//杩囨护鏉′欢
+                var HFilterIdLists = "";//鎷兼帴澶氫釜杩囨护鏉′欢
+                var HValue = "";//杩囨护鍊�
+                var HElement_type = "";//杩囨护鏍囩绫诲瀷
+
+                for (var i = 0; i < Filter.length; i++) {
+                    HFilterIdList = Filter[i].id; //杩囨护鏉′欢ID
+                    HFilterIdLists += Filter[i].id + ","; //杩囨护鏉′欢ID(鎷兼帴)
+                    HValue += $("#" + HFilterIdList).val() + ","; //杩囨护鏉′欢涓緭鍏ョ殑鍊�
+                    HElement_type += document.getElementById(HFilterIdList).tagName + ",";//閫氳繃鏍囩id鑾峰彇鏍囩绫诲瀷
+                }
+
+                //鍘婚櫎鏈熬閫楀彿
+                HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
+                HValue = HValue.substring(0, HValue.length - 1);
+                HElement_type = HElement_type.substring(0, HElement_type.length - 1);
+
+                //褰撳墠椤甸潰涓婃病鏈夐�夋嫨杩囨护鏂规锛岃繘鍏ユ柊澧炴柟娉�
+                if (HDefaultFilter == "") {
+                    layer.open({
+                        type: 2
+                        , area: ['40%', '80%']
+                        , title: '杩囨护鏂规'
+                        , shift: 0//寮瑰嚭鍔ㄧ敾
+                        , content: '../../绯荤粺绠$悊/杩囨护鏂规璁剧疆/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
+                        , cancel: function () {
+                            // 鍙充笂瑙掑叧闂簨浠剁殑閫昏緫
+                            HIsClose_Manual = true;
+                        }
+                        , end: function () {
+                            if (HIsClose_Manual != true) {
+                                get_FastQuery();
+                                //鏄剧ず褰撳墠鐨勮繃婊ゆ柟妗�
+                                document.getElementById("HFilterScheme_Now").style.display = "block";
+                                document.getElementById('HFilterScheme_Now').innerHTML = "褰撳墠杩囨护鏂规锛�" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
+                            }
+                        }
+                    })
+                    layer.close(index)
+                } else {
+                    //褰撳墠椤甸潰宸叉湁杩囨护鏂规锛岀敤鎴烽�夋嫨 鏂板鎴栬�呯紪杈�
+                    layer.confirm('褰撳墠宸查�夋嫨杩囨护鏂规锛屾槸鍚︿慨鏀癸紵璇烽�夋嫨瀵瑰簲鎿嶄綔', {
+                        title: "鎿嶄綔鎻愮ず",
+                        icon: 0,
+                        btn: ['鏂板鏂规', '淇濆瓨淇敼褰撳墠鏂规', '鍙栨秷']
+                    }, function (index, layero) {
+                        //鏂板
+                        layer.open({
+                            type: 2
+                            , area: ['40%', '80%']
+                            , title: '杩囨护鏂规'
+                            , shift: 0//寮瑰嚭鍔ㄧ敾
+                            , content: '../../绯荤粺绠$悊/杩囨护鏂规璁剧疆/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
+                            , end: function () {
+                                get_FastQuery()
+                                //鏄剧ず褰撳墠鐨勮繃婊ゆ柟妗�
+                                document.getElementById("HFilterScheme_Now").style.display = "block";
+                                document.getElementById('HFilterScheme_Now').innerHTML = "褰撳墠杩囨护鏂规锛�" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
+                            }
+                        })
+                        layer.close(index)
+                    }, function (index) {
+                        //缂栬緫
+                        var Filter_Edit = document.getElementsByClassName(HClassTag); //鑾峰彇鏈〉鎵�鏈夎繃婊ゆ潯浠跺璞�(class涓寘鍚�"ForFilteringSchemes"鐨勫厓绱�)
+                        HFilterIdList = "";
+                        HFilterIdLists = "";
+                        HValue = "";
+                        HElement_type = "";
+                        for (var i = 0; i < Filter_Edit.length; i++) {
+                            HFilterIdList = Filter_Edit[i].id; //杩囨护鏉′欢ID
+                            HFilterIdLists += Filter_Edit[i].id + ","; //杩囨护鏉′欢ID(鎷兼帴)
+                            HValue += $("#" + HFilterIdList).val() + ","; //杩囨护鏉′欢涓緭鍏ョ殑鍊�
+                            HElement_type += document.getElementById(HFilterIdList).tagName + ",";//閫氳繃鏍囩id鑾峰彇鏍囩绫诲瀷
+                        }
+                        //鍘婚櫎鏈熬閫楀彿
+                        HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
+                        HValue = HValue.substring(0, HValue.length - 1);
+                        HElement_type = HElement_type.substring(0, HElement_type.length - 1);
+
+                        var sMainSub = HInterID_Choose + ';' + HFilterIdLists + ';' + HValue + ';' + HElement_type + ';' + sessionStorage["Czybm"] + ';' + 3;
+
+                        //淇敼
+                        $.ajax({
+                            type: "POST",
+                            url: GetWEBURL() + "/Xt_FastICScheme/save", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                            async: true,
+                            data: { "oMain": sMainSub },
+                            dataType: "json",
+                            success: function (data) {
+                                if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                    layer.msg(data.Message, { time: 1 * 1000, icon: 1 });
+                                }
+                                else {
+
+                                }
+                                layer.closeAll("loading");
+                            },
+                            error: function (err) {
+
+
+                            }
+                        });
+                        layer.close(index)
+                    }, function (index) {
+                        //鍙栨秷
+                        layer.alert('鍙栨秷')
+                        layer.close(index)
+                    });
+                }
+
+            }
+
+            //璇诲彇鏂规
+            function set_ReadScheme() {
+                var HIsClose_Manual = false;
+                var Filter = document.getElementsByClassName(HClassTag); //鑾峰彇鏈〉鎵�鏈夎繃婊ゆ潯浠跺璞�(class涓寘鍚�"ForFilteringSchemes"鐨勫厓绱�)
+
+                var HFilterIdList = "";
+                var HFilterIdLists = "";
+                var HValue = "";
+                var HElement_type = "";
+                for (var i = 0; i < Filter.length; i++) {
+                    HFilterIdList = Filter[i].id; //杩囨护鏉′欢ID
+                    HFilterIdLists += Filter[i].id + ","; //杩囨护鏉′欢ID(鎷兼帴)
+                    HValue += $("#" + HFilterIdList).val() + ","; //杩囨护鏉′欢涓緭鍏ョ殑鍊�
+                    HElement_type += document.getElementById(HFilterIdList).tagName + ",";//閫氳繃鏍囩id鑾峰彇鏍囩绫诲瀷
+                }
+                //鍘婚櫎鏈熬閫楀彿
+                HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
+                HValue = HValue.substring(0, HValue.length - 1);
+                HElement_type = HElement_type.substring(0, HElement_type.length - 1);
+
+                layer.open({
+                    type: 2
+                    , area: ['80%', '80%']
+                    , title: '杩囨护鏂规鍒楄〃'
+                    , shift: 0//寮瑰嚭鍔ㄧ敾
+                    , content: '../../绯荤粺绠$悊/杩囨护鏂规璁剧疆/Xt_FastICSchemeList.html?HType=Select&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type + '&HModuleName=' + HModuleName
+                    , cancel: function () {
+                        // 鍙充笂瑙掑叧闂簨浠剁殑閫昏緫
+                        HIsClose_Manual = true;
+                    }
+                    , end: function () {
+                        if (HIsClose_Manual != true) {
+                            get_FastQuery()
+                            form.render("select");
+                        }
+                    }
+                })
             }
 
             //#endregion
@@ -359,6 +1379,44 @@
 
         })
 
+        //#region 銆愯繃婊ゆ柟妗堣繑鍥炴暟鎹��
+        function HFilterScheme(obj)  //杩斿洖杩囨护鏂规
+        {
+            var HInterID = obj[0].hmainid;
+            HInterID_Choose = obj[0].hmainid;
+            $.ajax({
+                url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
+                type: "GET",
+                data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": HInterID, "Type": "Select" },
+                success: function (data1) {
+                    if (data1.count == 1) {
+                        var data = data1.data;
+                        //璧嬪�艰繃婊ゆ柟妗堝悕绉�
+                        HDefaultFilter = data[0].鏂规鍚嶇О
+                        var HRemark = data[0].澶囨敞
+                        //鏄剧ず褰撳墠鐨勮繃婊ゆ柟妗�
+                        document.getElementById("HFilterScheme_Now").style.display = "block";
+                        document.getElementById('HFilterScheme_Now').innerHTML = "褰撳墠杩囨护鏂规锛�" + HDefaultFilter + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + HRemark + ")" + '</span>';
+                        HInterID = data[0].hmainid
+                        //鏍规嵁閫夋嫨鐨勮繃婊ゆ柟妗堝洖濉暟鎹埌鍒楄〃杩囨护鏉′欢
+                        for (let i = 0; i < data.length; i++) {
+                            $("#" + data[i].杩囨护瀛楁ID).val(data[i].杩囨护鍊�);
+                            if (data[i].杩囨护鏍囩绫诲瀷 == 'SELECT') {
+                                $("#" + data[i].杩囨护瀛楁ID).find("option[value='" + data[i].杩囨护鍊� + "']").attr("selected", true);
+                            }
+                        }
+
+                    } else {
+                        layer.close(ajaxLoad);
+                        layer.alert(data1.code + data1.Message, { icon: 5 });
+                    }
+                }, error: function () {
+                    layer.close(ajaxLoad);
+                    layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                }
+            });
+        }
+        //#endregion
     </script>
 </body>
 </html>

--
Gitblit v1.9.1