From b742f00aac8e1e1bb628232383c35e67f4a41e4e Mon Sep 17 00:00:00 2001
From: cwjbxqmz <1134865194@qq.com>
Date: 星期五, 26 一月 2024 15:21:28 +0800
Subject: [PATCH] 1

---
 WebTM/views/模治具管理/模治具管理/Sb_MouldRepairWorkBillList.html |  504 +++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 369 insertions(+), 135 deletions(-)

diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sb_MouldRepairWorkBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sb_MouldRepairWorkBillList.html"
index df8bb7f..bc10be5 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sb_MouldRepairWorkBillList.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sb_MouldRepairWorkBillList.html"
@@ -2,13 +2,15 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>鍣ㄥ叿缁翠慨宸ュ崟琛ㄥ垪琛�</title>
+    <title>鍣ㄥ叿缁翠慨璁板綍宸ュ崟琛ㄥ垪琛�</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
     <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
     <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
     <script src="../../../layuiadmin/layui/layui.js"></script>
+    <script src="../../../layuiadmin/HideButton.js"></script>
+    <script src="../../../layuiadmin/soulTable.slim.js"></script>
     <style type="text/css">
         input.layui-input.layui-unselect {
             padding-right: 0;
@@ -62,51 +64,101 @@
                                 </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-inline">
-                                        <label class="layui-form-label">鍣ㄥ叿缂栫爜</label>
-                                        <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="HMouldNumber" id="HMouldNumber" style="width:190px;">
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">鍣ㄥ叿缂栫爜</label>
+                                            <div class="layui-input-block">
+                                                <input type="text" class="layui-input" name="HMouldNumber" id="HMouldNumber" 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="HMouldName" id="HMouldName" 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="RepairItem" id="RepairItem" style="width:190px;">
+                                            </div>
                                         </div>
                                     </div>
-                                    <div class="layui-inline">
-                                        <label class="layui-form-label">鍣ㄥ叿鍚嶇О</label>
-                                        <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="HMouldName" id="HMouldName" style="width:190px;">
+                                    <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>
-                                    <div class="layui-inline">
-                                        <label class="layui-form-label">缁翠慨椤圭洰</label>
-                                        <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="RepairItem" id="RepairItem" style="width:190px;">
+                                        <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>
                             </div>
-                        </div>
-                        <table class="" id="mainTable" lay-filter="mainTable"></table>
-                        <script type="text/html" id="toolbarDemo">
-                            <div class="layui-btn-container">
-                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="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-add-1"></i>鏂板</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-edit"></i>缂栬緫</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-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-reload" style="display:none;"><i class="layui-icon layui-icon-refresh"></i>鍒锋柊</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm" id="btn_confirm" style="display:none;"><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" style="display:none;"><i class="layui-icon layui-icon-close-fill"></i>椹冲洖</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details" style="display:none;"><i class="layui-icon layui-icon-form"></i>璇︽儏</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate" style="display:none;"><i class="layui-icon layui-icon-file"></i>鐢熸垚閫佽揣鍗�</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit" style="display:none;"><i class="layui-icon layui-icon-return"></i>閫�鍑�</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_HideColumn1"><i class="layui-icon layui-icon-file-b"></i>鍒楄缃�</button>
-
+                            <table class="" id="mainTable" lay-filter="mainTable"></table>
+                            <div class="layui-tab layui-tab-card">
+                                <ul class="layui-tab-title">
+                                    <li class="layui-this">缁翠慨椤逛俊鎭�</li>
+                                    <li>閰嶄欢淇℃伅</li>
+                                </ul>
+                                <div class="layui-tab-content">
+                                    <div class="layui-tab-item layui-show">
+                                        <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
+                                    </div>
+                                    <div class="layui-tab-item">
+                                        <table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
+                                    </div>
+                                </div>
                             </div>
-                        </script>
+                            <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" style="display:none;" lay-event="btn-Add" id="btn-Add"><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
+                                    <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Edit" id="btn-Edit"><i class="layui-icon layui-icon-edit"></i>缂栬緫</button>
+                                    <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Delete" id="btn-Delete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                    <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Audit" id="btn-Audit"><i class="layui-icon layui-icon-radio"></i>瀹℃牳</button>
+                                    <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-DeAudit" id="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>鍙嶅鏍�</button>
+                                    <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-reload" id="btn-reload"><i class="layui-icon layui-icon-refresh"></i>鍒锋柊</button>
+                                    <button type="button" class="layui-btn layui-btn-sm" style="display:none;" 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" style="display:none;" 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" style="display:none;" lay-event="btn-details" id="btn-details"><i class="layui-icon layui-icon-form"></i>璇︽儏</button>
+                                    <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-generate" id="btn-generate"><i class="layui-icon layui-icon-file"></i>鐢熸垚閫佽揣鍗�</button>
+                                    <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-exit" id="btn-exit"><i class="layui-icon layui-icon-return"></i>閫�鍑�</button>
+                                    <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_HideColumn" id="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
+                                    <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>鎸夐挳璁剧疆</button>
+                                </div>
+                            </script>
+                            <script type="text/html" id="xuhao">
+                                {{d.LAY_TABLE_INDEX+1}}
+                            </script>
+                            <script type="text/html" id="xuhao1">
+                                {{d.LAY_TABLE_INDEX+1}}
+                            </script>
                     </form>
                 </div>
             </div>
@@ -116,12 +168,13 @@
     <script src="../../../layuiadmin/Scripts/json2.js"></script>
     <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
     <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
     <script>
         layui.config({
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
             index: 'lib/index', //涓诲叆鍙fā鍧�
-        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
+        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
              // #region 鍏ㄥ眬鍙橀噺
             var $ = layui.$
                 , admin = layui.admin
@@ -132,14 +185,42 @@
                 , laypage = layui.laypage
                 , laydate = layui.laydate
                 , util = layui.util
+                , soulTable = layui.soulTable
             //鏌ヨ鏉′欢
             var sWhere = "";
             var option = [];
+            var HBillType = "3807";
+            var HModName = "Sb_MouldRepairWorkBillList";
+            var titleData = ["hmainid","鍗曟嵁ID", "鍗曟嵁绫诲瀷", "HMouldID", "HEquipID", "HEmpID", "HManagerID", "HDeptID", "HSupID", "hsubid", "HRepairID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "HBillType"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
             //#endregion
-     
+
             //鍒濆鍖栭〉闈㈠姞杞�
             set_ClearBill();
-            var HModName = "Sb_MouldRepairWorkBillList";
+            ////鍒濆鍖栬〃鏍�
+            //DisPlay_HideColumn();
+
+            //鐐瑰嚮涓昏〃甯﹀嚭浠庤〃鏁版嵁
+            table.on('row(mainTable)', function (obj) { //娉細tool 鏄伐鍏锋潯浜嬩欢鍚嶏紝test 鏄� table 鍘熷瀹瑰櫒鐨勫睘鎬� lay-filter="瀵瑰簲鐨勫��"
+                var datas = obj.data; //鑾峰緱褰撳墠琛屾暟鎹�
+                var linterid = datas.hmainid;
+                $.ajax({
+                    url: GetWEBURL() + 'Sb_MouldRepairWorkBill/Sb_MouldRepairWorkBillListProjectDetai',
+                    type: "GET",
+                    data: { "sqlWhere": "and hmainid=" + linterid },
+                    success: function (data1) {
+                        if (data1.count == 1) {
+                            option1.data = data1.list[0];
+                            table.render(option1);
+                            option2.data = data1.list[1];
+                            table.render(option2);
+                        } else {
+                            layer.alert(result.code + result.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛澶辨晥!", { icon: 5 });
+                    }
+                });
+            });
 
             //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
             //澶村伐鍏锋爮浜嬩欢
@@ -163,9 +244,17 @@
                     //鍒楄缃�
                     case 'get_HideColumn1': get_HideColumn1();
                         break;
+                    //鍒楄缃�
+                    case 'set_HideColumn': get_HideColumn();
+                        break;
                     ////閫�鍑烘寜閽�
                     //case 'get_Exit': Pub_Close(2);
                     //    break;
+                    //鎸夐挳璁剧疆
+                    case 'set_HideButton':
+                        var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                        get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+                        break;
                 };
             });
 
@@ -183,9 +272,15 @@
             //#region 褰撳墠椤甸潰鍔犺浇鎵�鏈夋柟娉�
             // 鍒濆鍖栫晫闈�
             function set_ClearBill() {
-             
+                //鍒濆鍖栨棩鏈�
+                $("#HDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+                $("#HDate1").val(Format(new Date(), "yyyy-MM-dd"));
                 //鍒濆鍖栬〃鏍�
                 set_InitGrid();
+                //鍒濆鍖栬〃鏍�(瀛愯〃1)
+                set_InitGrid1();
+                //鍒濆鍖栬〃鏍�(瀛愯〃2)
+                set_InitGrid2();
                 //鏌ヨ
                 get_Display(sWhere);
             }
@@ -240,8 +335,8 @@
                         , { field: '澶囨敞', title: '澶囨敞', width: 200 }
                         , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                         , { 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: 'HRepairID', title: 'HRepairID', width: 115, hide: true }
                         , { field: '瀛愮淮淇」鐩唬鐮�', title: '瀛愮淮淇」鐩唬鐮�', width: 200 }
@@ -260,10 +355,10 @@
                         , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 200, templet: "<div>{{d.鍏抽棴鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍏抽棴鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                         , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 200 }
                         , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 200, templet: "<div>{{d.浣滃簾鏃ユ湡 ==null ?'':layui.util.toDateString(d.浣滃簾鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
-                        , { field: '婧愬崟涓诲唴鐮�', title: '婧愬崟涓诲唴鐮�', width: 200, hide: true }
-                        , { field: '婧愬崟瀛愬唴鐮�', title: '婧愬崟瀛愬唴鐮�', width: 200, hide: true }
+                        //, { field: '婧愬崟涓诲唴鐮�', title: '婧愬崟涓诲唴鐮�', width: 200, hide: true }
+                        //, { field: '婧愬崟瀛愬唴鐮�', title: '婧愬崟瀛愬唴鐮�', width: 200, hide: true }
                         , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿', width: 200 }
-                        , { field: '婧愬崟绫诲瀷', title: '婧愬崟绫诲瀷', width: 200 }
+                        //, { field: '婧愬崟绫诲瀷', title: '婧愬崟绫诲瀷', width: 200 }
                         , { field: 'HBillType', title: 'HBillType', width: 200, hide: true }
                     ]]
                 };
@@ -272,6 +367,7 @@
             //鏌ヨ
             function get_Display(sWhere) {
                 var index = layer.load(0);
+                var ajaxLoad = layer.load();
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
                 $.ajax({
                     //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
@@ -280,20 +376,127 @@
                     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:450
+                                , 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 {
-                            layer.close(index);
+                            layer.close(ajaxLoad);
                             layer.alert(data1.code + data1.Message, { icon: 5 });
                         }
                     }, error: function () {
-                        layer.close(index);
+                        layer.close(ajaxLoad);
                         layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
                     }
-
                 });
             }
+
+            //鍒濆鍖栬〃鏍�(瀛愯〃1)
+            function set_InitGrid1() {
+                var ajaxLoad = layer.load();
+                option1 = {
+                    elem: '#mainTable1'
+                    //, toolbar: '#toolbarDemo'
+                    , height: '250'
+                    , page: true
+                    , cellMinWidth: 90
+                    , limit: 50
+                    , limits: [50, 500, 5000, 20000]
+                    , cols: [[
+                        //{ type: 'checkbox', fixed: 'left' }
+                        , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left' }
+                        , { field: 'HRepairID', title: '缁翠慨椤圭洰ID', width: 200, hide: true }
+                        , { field: 'HRepairCode', title: '缁翠慨椤圭洰浠g爜', width: 200 }
+                        , { field: 'HRepairName', title: '缁翠慨椤圭洰', width: 200 }
+                        , { field: 'HRepairExplanation', title: '缁翠慨瑕佹眰', width: 200 }
+                        , { field: 'HManagerID', title: '璐熻矗浜篒D', width: 200, hide: true }
+                        , { field: 'HManagerCode', title: '璐熻矗浜轰唬鐮�', width: 200 }
+                        , { field: 'HManagerName', title: '璐熻矗浜�', width: 200 }
+                        , { field: 'HMoney', title: '缁翠慨璐圭敤', width: 200 }
+                        , { field: 'HRemark', title: '澶囨敞', width: 200 }
+                    ]]
+                };
+                option1.data = [];
+                table.render(option1);
+                layer.close(ajaxLoad);
+            }
+
+            //鍒濆鍖栬〃鏍�(瀛愯〃2)
+            function set_InitGrid2() {
+                var ajaxLoad = layer.load();
+                option2 = {
+                    elem: '#mainTable2'
+                    //, toolbar: '#toolbarDemo'
+                    , height: '250'
+                    , page: true
+                    , cellMinWidth: 90
+                    , limit: 50
+                    , limits: [50, 500, 5000, 20000]
+                    , cols: [[
+                        //{ type: 'checkbox', fixed: 'left' }
+                        , { templet: '#xuhao1', title: '搴忓彿', sort: true, fixed: 'left' }
+                        , { field: 'HMaterID', title: '閰嶄欢ID', width: 200, hide: true }
+                        , { field: 'HMaterNumber', title: '閰嶄欢浠g爜', width: 200 }
+                        , { field: 'HMaterName', title: '閰嶄欢鍚嶇О', width: 200 }
+                        , { field: 'HMaterSpec', title: '瑙勬牸鍨嬪彿', width: 200, hide: true }
+                        , { field: 'HUnitID', title: '鍗曚綅ID', width: 200, hide: true }
+                        , { field: 'HUnitNumber', title: '鍗曚綅浠g爜', width: 200 }
+                        , { field: 'HUnitName', title: '鍗曚綅鍚嶇О', width: 200 }
+                        , { field: 'HQty', title: '瀹為檯鐢ㄩ噺', width: 200 }
+                        , { field: 'HQtyMust', title: '鏍囧噯鐢ㄩ噺', width: 200 }
+                        , { field: 'HRemark', title: '澶囨敞', width: 200 }
+                    ]]
+                };
+                option2.data = [];
+                table.render(option2);
+                layer.close(ajaxLoad);
+            }
+
 
             //鏂板
             function set_AddNew() {
@@ -457,8 +660,100 @@
                 }
             }
 
+            //蹇�熻繃婊�
+            function get_FastQuery() {
+                var Status = $("select[name='Status']").val();//鐘舵��
+                var HDate = $("#HDate").val();//寮�濮嬫棩鏈�
+                var HDate1 = $("#HDate1").val();//缁撴潫鏃ユ湡
+                var HBillNo = $("#HBillNo").val(); //鍗曟嵁鍙�
+                var HMouldNumber = $("#HMouldNumber").val();       //妯℃不鍏风紪鐮�
+                var HMouldName = $("#HMouldName").val();       //妯℃不鍏峰悕绉�
+                var RepairItem = $("#RepairItem").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 (Status) {
+                    switch (Status) {
+                        case '-1':   //鍏ㄩ儴
+                            sWhere += "";
+                            break;
+                        case '0':    //鏈鏍�
+                            sWhere += " and 瀹℃牳浜�=''";
+                            break;
+                        case '1':    //宸插鏍�
+                            sWhere += " and 瀹℃牳浜�<>''";
+                            break;
+                        case '2':    //宸插叧闂�
+                            sWhere += " and 鍏抽棴浜�<>''";
+                        default:
+
+                    }
+                }
+                if (HDate) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
+                }
+                if (HDate1) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HDate1 + "'";
+                }
+                if (HBillNo) {
+                    sWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
+                }
+                if (HMouldNumber) {
+                    sWhere += " and 浜у搧妯″叿浠g爜 like '%" + HMouldNumber + "%'";
+                }
+                if (HMouldName) {
+                    sWhere += " and 浜у搧妯″叿 like '%" + HMouldName + "%'";
+                }
+                if (RepairItem) {
+                    sWhere += " and 缁翠慨椤圭洰 like '%" + RepairItem + "%'";
+                }
+
+                get_Display(sWhere);
+                //璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
+                sWhere = "";
+            }
+
+            //閲嶇疆杩囨护鏉′欢鏂规硶
+            function set_ClearQuery() {
+                $('#Status').find("option[value='-1']").attr("selected", true);
+                $("#HDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+                $("#HDate1").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HBillNo").val("");
+                $("#HMouldNumber").val("");
+                $("#HMouldName").val("");
+                $("#RepairItem").val("");
+                $("#btnSearch").click();
+                $("#ColContent").val("");
+                $("#ColName").val("0");
+                $("#Comparator").val("0");
+                form.render('select');
+                sWhere = "";
+            }
+
             //闅愯棌鍒楄缃�
-            function get_HideColumn1() {
+            function get_HideColumn() {
                 var colName = "";
                 for (var i = 1; i < option.cols[0].length - 1; i++) {
                     colName += option.cols[0][i]["title"] + ",";
@@ -492,13 +787,18 @@
                     data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                     success: function (data1) {
                         if (data1.data.length != 0) {
+
+
                             var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
-                            var titleData = ["hmainid", "HMouldID", "HEquipID", "HEmpID", "HManagerID", "HDeptID", "HSupID", "hsubid", "HRepairID","HBillType"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+                            /*var titleData = ["鍗曟嵁ID", "鍗曟嵁绫诲瀷", "HMouldID", "HEquipID", "HEmpID", "HManagerID", "HDeptID", "HSupID", "hsubid", "HRepairID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "HBillType"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�*/
 
                             dataCol = data1.data[0].HGridString.split(',');
 
                             for (var i = 0; i < option.cols[0].length - 2; i++) {
-                                var dataCols = dataCol[i].split('|');
+                                //鍦ㄦ暟鎹笉涓虹┖鐨勬儏鍐典笅杩涜鍒嗗壊锛屽惁鍒欐姤閿�
+                                if (dataCol[i]) {
+                                    var dataCols = dataCol[i].split('|');
+                                }
                                 //闅愯棌鍒�
                                 if (dataCols[1] == 1) {
                                     option.cols[0][i + 1]["hide"] = true;
@@ -556,8 +856,16 @@
                                 }
                             }
                             table.render(option);
+
+                            //鍒锋柊鎸夐挳鏄剧ず
+                            var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                         } else {
                             table.render(option);
+
+                            //鍒锋柊鎸夐挳鏄剧ず
+                            var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                         }
                     }, error: function () {
                         layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
@@ -565,91 +873,17 @@
                 })
             }
 
-            //蹇�熻繃婊�
-            function get_FastQuery() {
-                var Status = $("select[name='Status']").val();//鐘舵��
-                var HDate = $("#HDate").val();//寮�濮嬫棩鏈�
-                var HDate1 = $("#HDate1").val();//缁撴潫鏃ユ湡
-                var HBillNo = $("#HBillNo").val(); //鍗曟嵁鍙�
-                var HMouldNumber = $("#HMouldNumber").val();       //妯℃不鍏风紪鐮�
-                var HMouldName = $("#HMouldName").val();       //妯℃不鍏峰悕绉�
-                var RepairItem = $("#RepairItem").val();       //缁翠慨椤圭洰
-                if (Status) {
-                    switch (Status) {
-                        case '-1':   //鍏ㄩ儴
-                            sWhere += "";
-                            break;
-                        case '0':    //鏈鏍�
-                            sWhere += " and 瀹℃牳浜�=''";
-                            break;
-                        case '1':    //宸插鏍�
-                            sWhere += " and 瀹℃牳浜�<>''";
-                            break;
-                        case '2':    //宸插叧闂�
-                            sWhere += " and 鍏抽棴浜�<>''";
-                        default:
-
+            //鍒楁槑鏄剧ず涓嬫媺妗�
+            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>';
                     }
                 }
-                if (HDate) {
-                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
-                }
-                if (HDate1) {
-                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate1 + "'";
-                }
-                if (HBillNo) {
-                    sWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
-                }
-                if (HMouldNumber) {
-                    sWhere += " and 浜у搧妯″叿浠g爜 like '%" + HMouldNumber + "%'";
-                }
-                if (HMouldName) {
-                    sWhere += " and 浜у搧妯″叿 like '%" + HMouldName + "%'";
-                }
-                if (RepairItem) {
-                    sWhere += " and 缁翠慨椤圭洰 like '%" + RepairItem + "%'";
-                }
-                var index = layer.load(0);
-                $.ajax({
-                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
-                    url: GetWEBURL() + '/Sb_MouldRepairWorkBill/GetMouldRepairWorkBillList',
-                    type: "GET",
-                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
-                    success: function (data1) {
-                        if (data1.count == 1) {
-                            option.data = data1.data;
-                            table.render(option);
-                            layer.close(index);
-                            layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
-                        } else {
-                            layer.close(index);
-                            layer.alert(data1.code + data1.Message, { icon: 5 });
-                        }
-                    }, error: function () {
-                        layer.close(index);
-                        layer.alert("鎺ュ彛澶辨晥!", { icon: 5 });
-                    }
-                });
-                //璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
-                sWhere = "";
-                //$("#HBillType").val("");//鍗曟嵁绫诲瀷
-                //$("#HBillNo").val("");//鍗曟嵁鍙�
-                //$("#HSourceBillNo").val("");//婧愬崟鍙�
-                //$("#HCreateBy").val("");//鍒跺崟浜�
-                //$("#BenginHCreateDate").val("");//寮�濮嬪埗鍗曟椂闂�
-                //$("#EndHCreateDate").val("");//缁撴潫鍒跺崟鏃堕棿
-            }
-
-            //閲嶇疆杩囨护鏉′欢鏂规硶
-            function set_ClearQuery() {
-                $('#Status').find("option[value='-1']").attr("selected", true);
-                $("#HDate").val("");//寮�濮嬫棩鏈�
-                $("#HDate1").val("");//缁撴潫鏃ユ湡
-                $("#HBillNo").val("");
-                $("#HMouldNumber").val("");
-                $("#HMouldName").val("");
-                $("#RepairItem").val("");
-                $("#btnSearch").click();
+                $("#ColName").empty();
+                $("#ColName").append(Organization);
+                form.render('select');
             }
             //#endregion
 

--
Gitblit v1.9.1