From 3d240d150e6e1a4e2df1a9f87d00ddd03ace4ee5 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 17 一月 2025 10:06:37 +0800
Subject: [PATCH] 增加 BOM层级展开报表,修复全程追溯报表 黑白标页签导出失败,工艺路线的表头查询优化页面排序

---
 WebTM/views/质量管理/基础建模/Gy_ErrMsgBackType.html |  185 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 176 insertions(+), 9 deletions(-)

diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\237\272\347\241\200\345\273\272\346\250\241/Gy_ErrMsgBackType.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\237\272\347\241\200\345\273\272\346\250\241/Gy_ErrMsgBackType.html"
index 5e18b2d..fa52266 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\237\272\347\241\200\345\273\272\346\250\241/Gy_ErrMsgBackType.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\237\272\347\241\200\345\273\272\346\250\241/Gy_ErrMsgBackType.html"
@@ -28,16 +28,16 @@
                                         <span>鏇村</span>
                                     </div>
                                 </div>
-                                <div class="layui-inline">
-                                    <label class="layui-form-label" style="width: 85px;">寮傚父鍙嶉绫诲瀷浠g爜</label>
+                                <div class="layui-inline" style="width:400px">
+                                    <label class="layui-form-label" style="white-space: nowrap;width:100px">寮傚父鍙嶉绫诲瀷浠g爜</label>
                                     <div class="layui-input-block" style="margin-left: 120px;">
-                                        <input type="text" class="layui-input" name="HNumber" id="HNumber">
+                                        <input type="text" class="layui-input" name="HNumber" id="HNumber" style="width:200px">
                                     </div>
                                 </div>
-                                <div class="layui-inline">
-                                    <label class="layui-form-label" style="width: 85px;">寮傚父鍙嶉绫诲瀷鍚嶇О</label>
+                                <div class="layui-inline" style="width:400px">
+                                    <label class="layui-form-label"  style="white-space: nowrap;width:100px">寮傚父鍙嶉绫诲瀷鍚嶇О</label>
                                     <div class="layui-input-block" style="margin-left: 120px;">
-                                        <input type="text" class="layui-input" name="HName" id="HName">
+                                        <input type="text" class="layui-input" name="HName" id="HName" style="width:200px">
                                     </div>
                                 </div>
                                 <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
@@ -72,6 +72,60 @@
                                             <input type="text" class="layui-input" value="" name="ColContent" id="ColContent">
                                         </div>
                                     </div>
+                                    <div class="layui-row" style="margin-top:5px">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">杩囨护</label>
+                                            <div class="layui-input-block">
+                                                <select name="ColName1" id="ColName1" lay-filter="ColName1" style="width:190px;">
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <select name="Comparator1" id="Comparator1" 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" value="" name="ColContent1" id="ColContent1">
+                                        </div>
+                                    </div>
+                                    <div class="layui-row" style="margin-top:5px">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">杩囨护</label>
+                                            <div class="layui-input-block">
+                                                <select name="ColName2" id="ColName2" lay-filter="ColName2" style="width:190px;">
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <select name="Comparator2" id="Comparator2" 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" value="" name="ColContent2" id="ColContent2">
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                         </div>
@@ -81,6 +135,7 @@
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add" id="AddButton"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit" id="EditButton"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete" id="DeleteButton"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_SouceExcel"><i class="layui-icon layui-icon-delete"></i>瀵煎叆</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh" id="RefreshButton"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit" id="AuditButton"><i class="layui-icon layui-icon-radio"></i>瀹℃牳</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit" id="DeAuditButton"><i class="layui-icon layui-icon-circle"></i>鍙嶅鏍�</button>
@@ -143,6 +198,9 @@
                         break;
                     //鍒犻櫎
                     case 'btn-Delete': set_DeleteBill();
+                        break;
+                    //瀵煎叆
+                    case 'set_SouceExcel': set_SouceExcel();
                         break;
                     //鍒锋柊
                     case 'get_Refresh': get_Refresh();
@@ -217,6 +275,38 @@
             });
             //#endregion
 
+            //#region
+            table.on('tool(mainTable)', function (obj){
+                var data = obj.data;                    //鎶妎bj鏁版嵁璧嬪�肩粰 data鍙橀噺
+
+                //鍗曟嵁鍙疯秴閾炬帴
+                //鍒ゆ柇瀵硅薄浜嬩欢鏄惁涓哄崟鎹彿
+                if (obj.event == '鍗曟嵁鍙�') {                  //妫�鏌� obj.event浜嬩欢 鏄惁绛変簬瀛楃涓� '鍗曟嵁鍙�'銆傚鏋滅瓑浜庯紝鍒欐墽琛宨f寰幆     
+                    var linterid = data.hmainid.toString();    //澹版槑鍙橀噺linterid 涓� data.hmainid     鎶婅〃鍗曞崟鎹祴鍊肩粰澹版槑鍙橀噺linterid
+                    //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
+                    layer.open({                               //浣跨敤 layer鐨刼pen鎵撳紑寮瑰嚭 灞� 
+                        type: 2                                 //琛ㄧず寮瑰嚭灞傜殑鍐呭鏄竴涓� iframe       绫诲瀷涓�2
+                        , area: ['100%', '100%']                //寮瑰嚭灞傜殑澶у皬鏄�
+                        , title: '缂栬緫寮傚父鍙嶉绫诲瀷'          //璁剧疆寮瑰嚭灞傜殑鍚嶅瓧鍜屽彉閲�
+                        , closeBtn: 1                            //鏄剧ず鍏抽棴鎸夐挳
+                        , shade: 0.6                            //閬僵閫忔槑搴�                    
+                        , maxmin: true                           //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0                               //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        //璁剧疆 iframe 鐨� URL锛孶RL 涓寘鍚簡鏌ヨ鍙傛暟锛屾潵璋冪敤鎵�闇�瑕佺殑鍊�
+                        , content: '../鍩虹寤烘ā/Add_Edit_Gy_ErrMsgBackType.html?OperationType=3&linterid=' + linterid + '&HSouceBillType='
+                        , resize: false,                           //鏄惁鍏佽鐢ㄦ埛璋冩暣寮瑰嚭澶у皬
+                        end: function () {                           //褰撳叧闂椂璋冪敤
+                            get_FastQuery(table, option);           //鎵ц鏌ヨ锛堣〃鍜岄�夐」锛�
+                        }
+                        , cancel: function () {                    //鐐瑰嚮鍙栨秷鏃朵娇鐢ㄥ洖璋�
+                            //$(".layui-btn").removeClass("layui-btn-disabled");
+                        }
+                    })
+                }
+            });
+
+            
+        //#endregion
             //#region 姝ら〉闈㈡墍鏈夋柟娉�
             // 鍒濆鍖栫晫闈�
             function set_ClearBill() {
@@ -236,7 +326,7 @@
                     , toolbar: '#toolbarDemo'
                     , height: 'full-50'
                     , page: true
-                    , limits: [50, 500, 5000, 50000]
+                    , limits: [50, 500, 5000, 20000]
                     , limit: 50
                     , cellMinWidth: 90
 
@@ -257,6 +347,7 @@
                         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 });
@@ -267,6 +358,13 @@
                                 // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                 if ($.inArray(data[i].name, titleData) > -1) {
                                     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: 200 })
+                                } else if (data[i].id == '鍗曟嵁鍙�') {
+                                    col.push({
+                                        field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event:'鍗曟嵁鍙�' })
                                 }
                                 else {
                                     switch (data[i].Type) {
@@ -288,7 +386,7 @@
                                 , data: data1.data
                                 , height: 'full-80'
                                 , page: true
-                                , limits: [50, 500, 5000, 50000]
+                                , limits: [50, 500, 5000, 20000]
                                 , limit: 50
                                 , cellMinWidth: 90
                             }
@@ -325,6 +423,12 @@
                 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 = "";
@@ -347,6 +451,48 @@
                     }
                     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 (HNumber) {
                     sWhere += " and 寮傚父鍙嶉绫诲瀷浠g爜 like '%" + HNumber + "%'";
                 }
@@ -363,7 +509,12 @@
                 $("#btnSearch").click();
                 $("#ColContent").val("");
                 $("#ColName").val("0");
-                $("#Comparator").val("0");
+                $("#Comparator").val("0"); $("#ColContent2").val("");
+                $("#ColName2").val("0");
+                $("#Comparator2").val("0");
+                $("#ColContent1").val("");
+                $("#ColName1").val("0");
+                $("#Comparator1").val("0");
                 form.render('select');
 
                 sWhere = "";
@@ -372,6 +523,17 @@
             function get_Refresh() {
                 $("#btnSearch").trigger('click');
             }
+            //瀵煎叆
+            function set_SouceExcel() {
+                layer.open({
+                    type: 2
+                    , area: ['100%', '100%']
+                    , title: '宸ュ簭璧勬枡瀵煎叆'
+                    , shift: 0//寮瑰嚭鍔ㄧ敾
+                    , content: './Gy_ErrMsgBackType_Excel.html?OperationType=dao&HSouceBillType='
+                })
+            }
+
             //鏂板
             function set_AddNew() {
                 layer.open({
@@ -603,6 +765,7 @@
 
                             var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
                             //var titleData = ["鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+                            var titleData = ["HItemID", "鐭唬鐮伮�", "鐖剁骇ID", "绛夌骇", "鏈骇鏍囧織", "鍔╄鐮�", "鍒涘缓缁勭粐"];
 
                             dataCol = data1.data[0].HGridString.split(',');
 
@@ -684,6 +847,10 @@
                     }
                 }
                 $("#ColName").empty();
+                $("#ColName1").empty();
+                $("#ColName1").append(Organization);
+                $("#ColName2").empty();
+                $("#ColName2").append(Organization);
                 $("#ColName").append(Organization);
                 form.render('select');
             }

--
Gitblit v1.9.1