From dbcc87f39f85b6ec81d53e6dc66e9f51cd34b5d8 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 01 十一月 2023 13:30:37 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI

---
 WebTM/views/设备管理/Sb_EquipMaintainPlanBillList.html |  169 ++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 127 insertions(+), 42 deletions(-)

diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillList.html"
index dc06ca1..aca2b8d 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillList.html"
@@ -9,6 +9,8 @@
     <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
     <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
     <script src="../../layuiadmin/layui/layui.js"></script>
+    <script src="../../layuiadmin/HideButton.js"></script>
+    <script src="../../../layuiadmin/soulTable.slim.js"></script>
     <style type="text/css">
         input.layui-input.layui-unselect {
             padding-right: 0;
@@ -94,9 +96,14 @@
 
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-edit"></i>缂栬緫</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add" id="Add"><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit" id="Edit"><i class="layui-icon layui-icon-edit"></i>缂栬緫</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete" id="Delete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view" id="view"><i class="layui-icon layui-icon-tips"></i>棰勮</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print" id="print"><i class="layui-icon layui-icon-print"></i>鎵撳嵃</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh" id="Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>鎸夐挳璁剧疆</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit" id="Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
                             </div>
                         </script>
 
@@ -116,12 +123,14 @@
     <script src="../../layuiadmin/Scripts/json2.js"></script>
     <script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
     <script src="../../layuiadmin/Scripts/webConfig.js"></script>
+    <script src="../../layuiadmin/PubCustom.js"></script>
+    <script 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
@@ -134,11 +143,13 @@
                 , laypage = layui.laypage
                 , laydate = layui.laydate
                 , util = layui.util
+                , soulTable = layui.soulTable
             //鏌ヨ鏉′欢
             var sWhere = "";
             var option = [];
             var option1 = [];
             var option2 = [];
+            var HModName = "Sb_EquipMaintainPlanBillList";
             //#endregion
 
             //#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -160,17 +171,42 @@
                     case 'btn-Edit':
                         set_ShowBill();
                         break;
+                    //鍒犻櫎
                     case 'btn-Delete':
                         set_DeleteBill();
                         break;
+                    //娴忚
+                    case 'btn-view':
+                        get_ViewReport();
+                        break;
+                    //鎵撳嵃
+                    case 'btn-print':
+                        get_PrintReport();
+                        break;
+                    //鍒锋柊
+                    case 'get_Refresh':
+                        set_Refresh();
+                        break;
+                    //鎸夐挳璁剧疆
+                    case 'set_HideButton':
+                        var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                        var HBillType = "3902";
+                        get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+                        break;
+
+                    //閫�鍑�
+                    case 'get_Exit':
+                        Pub_Close(2);
+                        break;
                 };
             });
+
             //鐐瑰嚮涓昏〃甯﹀嚭浠庤〃鏁版嵁
             table.on('row(mainTable)', function (obj) { //娉細tool 鏄伐鍏锋潯浜嬩欢鍚嶏紝test 鏄� table 鍘熷瀹瑰櫒鐨勫睘鎬� lay-filter="瀵瑰簲鐨勫��"
                 var datas = obj.data; //鑾峰緱褰撳墠琛屾暟鎹�
                 var linterid = datas.hmainid;
                 $.ajax({
-                    url: GetWEBURL() + 'Sb_EquipMaintainPlanBill/Sb_EquipMaintainBillListProjectDetaiNew',
+                    url: GetWEBURL() + 'Sb_EquipMaintainPlanBill/Sb_EquipMaintainPlanBillListProjectDetaiNew',
                     type: "GET",
                     data: { "HInterID": linterid },
                     success: function (data1) {
@@ -202,6 +238,9 @@
 
             //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
             function set_ClearBill() {
+                //鍒濆鍖栨棩鏈�
+                $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));//寮�濮嬫棩鏈�
+                $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));//缁撴潫鏃ユ湡
                 //鍒濆鍖栬〃鏍�(涓昏〃)
                 set_InitGrid();
                 //鍒濆鍖栬〃鏍�(瀛愯〃1)
@@ -219,37 +258,42 @@
                     , height: '400'
                     , page: true
                     , cellMinWidth: 90
+                    , limit: 50
+                    , limits: [50, 500, 5000, 20000]
+                    , done: function (res, curr, count) {
+                        soulTable.render(this);
+                    }
                     , cols: [[
                         { type: 'checkbox', fixed: 'left' }
-                        , { field: 'hmainid', title: 'hmainid', hide: true }
-                        , { field: '鏃ユ湡', title: '鏃ユ湡', width: 160, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', width: 160 }
-                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷', width: 160, hide: true }
-                        , { field: 'HEquipID', title: '璁惧ID', width: 160, hide: true }
-                        , { field: '璁惧浠g爜', title: '璁惧浠g爜', width: 200 }
-                        , { field: '璁惧鍚嶇О', title: '璁惧鍚嶇О', width: 200 }
-                        , { field: '寮�濮嬫棩鏈�', title: '寮�濮嬫棩鏈�', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '缁撴潫鏃ユ湡', title: '缁撴潫鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '鍛ㄦ湡鍗曚綅', title: '鍛ㄦ湡鍗曚綅', width: 200 }
-                        , { field: '淇濆吇鍛ㄦ湡', title: '淇濆吇鍛ㄦ湡', width: 200 }
-                        , { field: '鎽樿', title: '鎽樿', width: 200 }
-                        , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�', width: 200 }
-                        , { field: '澶囨敞', title: '澶囨敞', width: 200 }
-                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 115 }
-                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 200 }
-                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '淇敼浜�', title: '淇敼浜�', width: 200 }
-                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', width: 115,templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', width: 200 }
-                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 200 }
-                        , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 200, hide: true }
-                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 115, hide: true }
-                        , { field: '婧愬崟涓诲唴鐮�', title: '婧愬崟涓诲唴鐮�', width: 200, hide: true }
-                        , { field: '婧愬崟瀛愬唴鐮�', title: '婧愬崟瀛愬唴鐮�', width: 200, hide: true }
-                        , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿', width: 200 }
-                        , { field: '婧愬崟绫诲瀷', title: '婧愬崟绫诲瀷', width: 200 }
-                        , { field: 'hbilltype', title: 'hbilltype', width: 200 }
+                        , { field: 'hmainid', title: 'hmainid', hide: true, sort: true }
+                        , { field: '鏃ユ湡', title: '鏃ユ湡', width: 160, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', width: 160, sort: true }
+                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷', width: 160, hide: true, sort: true }
+                        , { field: 'HEquipID', title: '璁惧ID', width: 160, hide: true, sort: true }
+                        , { field: '璁惧浠g爜', title: '璁惧浠g爜', width: 200, sort: true }
+                        , { field: '璁惧鍚嶇О', title: '璁惧鍚嶇О', width: 200, sort: true }
+                        , { field: '寮�濮嬫棩鏈�', title: '寮�濮嬫棩鏈�', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '缁撴潫鏃ユ湡', title: '缁撴潫鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鍛ㄦ湡鍗曚綅', title: '鍛ㄦ湡鍗曚綅', width: 200, sort: true }
+                        , { field: '淇濆吇鍛ㄦ湡', title: '淇濆吇鍛ㄦ湡', width: 200, sort: true }
+                        , { field: '鎽樿', title: '鎽樿', width: 200, sort: true }
+                        , { field: '鍐呴儴鍗曟嵁鍙�', title: '鍐呴儴鍗曟嵁鍙�', width: 200, sort: true }
+                        , { field: '澶囨敞', title: '澶囨敞', width: 200, sort: true }
+                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 115, sort: true }
+                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 200, sort: true }
+                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 200, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '淇敼浜�', title: '淇敼浜�', width: 200, sort: true }
+                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', width: 115, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', width: 200, sort: true }
+                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 200, sort: true }
+                        , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 200, hide: true, sort: true }
+                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 115, hide: true, sort: true }
+                        , { field: '婧愬崟涓诲唴鐮�', title: '婧愬崟涓诲唴鐮�', width: 200, hide: true, sort: true }
+                        , { field: '婧愬崟瀛愬唴鐮�', title: '婧愬崟瀛愬唴鐮�', width: 200, hide: true, sort: true }
+                        , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿', width: 200, sort: true }
+                        , { field: '婧愬崟绫诲瀷', title: '婧愬崟绫诲瀷', width: 200, sort: true }
+                        , { field: 'hbilltype', title: 'hbilltype', width: 200, sort: true }
                     ]]
                 }
             }
@@ -262,6 +306,8 @@
                     , height: '350'
                     , page: true
                     , cellMinWidth: 90
+                    , limit: 50
+                    , limits: [50, 500, 5000, 20000]
                     , cols: [[
                         //{ type: 'checkbox', fixed: 'left' }
                         , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
@@ -289,21 +335,23 @@
                     , height: '350'
                     , page: true
                     , cellMinWidth: 90
+                    , limit: 50
+                    , limits: [50, 500, 5000, 20000]
                     , cols: [[
                         //{ type: 'checkbox', fixed: 'left' }
                         , { templet: '#xuhao1', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
                         , { field: 'HMaterID', title: '閰嶄欢ID', width: 200, hide: true }
                         , { field: 'HMaterNumber', title: '閰嶄欢浠g爜', width: 200 }
                         , { field: 'HMaterName', title: '閰嶄欢鍚嶇О', width: 200 }
-                        , { field: 'HMaterSpec', 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: 'HManagerID', title: '璐熻矗浜篒D', width: 200, hide: true }
+                        , { field: 'HManagerID', title: '璐熻矗浜篒D', width: 200, hide: true}
                         , { field: 'HManagerNumber', title: '璐熻矗浜轰唬鐮�', width: 200 }
                         , { field: 'HManagerName', title: '璐熻矗浜�', width: 200 }
+                        , { field: 'HQty', title: '瀹為檯鐢ㄩ噺', width: 200 }
+                        , { field: 'HQtyMust', title: '鏍囧噯鐢ㄩ噺', width: 200 }
                         , { field: 'HRemark', title: '澶囨敞', width: 200 }
                     ]]
                 };
@@ -319,15 +367,23 @@
                     //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                     url: GetWEBURL() + '/Sb_EquipMaintainPlanBill/GetEquipMaintainPlanBillList',
                     type: "GET",
-                    data: { "sWhere": sWhere },
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                     success: function (data1) {
                         if (data1.count == 1) {
                             option.data = data1.data;
                             table.render(option);
+
+                            //鍒锋柊鎸夐挳鏄剧ず
+                            var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                            var HBillType = "3902";
+                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+
                             layer.close(index);
                         } else {
+                            option.data = data1.data;
+                            table.render(option);
                             layer.close(index);
-                            layer.alert(data1.code + data1.Message, { icon: 5 });
+                            layer.alert("鏆傛棤鏁版嵁", { icon: 5 });
                         }
                     }, error: function () {
                         layer.close(index);
@@ -369,7 +425,7 @@
                         $.ajax({
                             type: "GET",
                             url: GetWEBURL() + "/Sb_EquipMaintainPlanBill/DeltetEquipMaintainPlanBillList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                            data: { "HInterID": HInterID },
+                            data: { "HInterID": HInterID, "user": sessionStorage["HUserName"] },
                             success: function (result) {
                                 if (result.count == 1) {
                                     layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
@@ -423,6 +479,36 @@
                     layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
                 }
             }
+            //棰勮
+            function get_ViewReport() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var InterID = data[0].hmainid.toString();
+                    window.open("../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/HBarPlanPrint.html?linterid=" + InterID + "&Type=HEquipMaintainPlanBill&OpenTmp=璁惧淇濆吇璁″垝鏉$爜");
+
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹墦鍗帮紒');
+                }
+            }
+            //鎵撳嵃
+            function get_PrintReport() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var InterID = data[0].hmainid.toString();
+                    window.open("../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/HBarPlanPrint.html?linterid=" + InterID + "&Type=HEquipMaintainPlanBill&OpenTmp=璁惧淇濆吇璁″垝鏉$爜");
+
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹墦鍗帮紒');
+                }
+            }
+            //鍒锋柊
+            function set_Refresh() {
+                $("#btnSearch").click();
+            }
             //蹇�熻繃婊�
             function get_FastQuery(table, option) {
                 //var HBillType = $("#HBillType").val();//鍗曟嵁绫诲瀷
@@ -456,7 +542,6 @@
                 sWhere = "";
                 $("#btnSearch").click();
             }
-
             //#endregion
 
 

--
Gitblit v1.9.1