From 30cc3b174a0ff8e40f25a7a0bd4e7dc53a7e5286 Mon Sep 17 00:00:00 2001
From: black-goat-me <226547893@qq.com>
Date: 星期六, 20 五月 2023 04:31:32 +0800
Subject: [PATCH] 白坯发布汇总、明细报表:列宽自适应

---
 WebTM/views/生产管理/报工台工序/产量汇报/Sc_ProductReportStepBillList_Web.html |  154 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 135 insertions(+), 19 deletions(-)

diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList_Web.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList_Web.html"
index 3641ad7..63cbbe6 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList_Web.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/\344\272\247\351\207\217\346\261\207\346\212\245/Sc_ProductReportStepBillList_Web.html"
@@ -67,24 +67,58 @@
                                         <input type="text" class="layui-input" name="Part" id="Part" style="width:190px;">
                                     </div>
                                 </div>
+                                <div class="layui-inline">
+                                    <label class="layui-form-label" style="width: 85px;">缁勭粐</label>
+                                    <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
+                                        <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
+                                            <!--鍔ㄦ�佹覆鏌撶粍缁�-->
+                                        </select>
+                                    </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-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 class="layui-inline">
+                                            <label class="layui-form-label">鐢熶骇璧勬簮</label>
+                                            <div class="layui-input-block">
+                                                <input type="text" class="layui-input" name="Source" id="Source" style="width:190px;">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">杩囨护</label>
+                                            <div class="layui-input-block">
+                                                <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;">
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;">
+                                                <option value="0" selected="selected"></option>
+                                                <option value="=">=</option>
+                                                <option value=">=">>=</option>
+                                                <option value=">">></option>
+                                                <option value="<="><=</option>
+                                                <option value="<"><</option>
+                                                <option value="<>"><></option>
+                                                <option value="7">鍖呭惈</option>
+                                                <option value="8">宸﹀寘鍚�</option>
+                                                <option value="9">鍙冲寘鍚�</option>
+                                                <option value="10">涓嶅寘鍚�</option>
+                                            </select>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <input type="text" class="layui-input" value="" name="ColContent" id="ColContent">
                                         </div>
                                     </div>
-                                    <div class="layui-inline">
-                                        <label class="layui-form-label">鐢熶骇璧勬簮</label>
-                                        <div class="layui-input-block">
-                                            <input type="text" class="layui-input" name="Source" id="Source" style="width:190px;">
-                                        </div>
-                                    </div>
-
                                 </div>
                             </div>
                         </div>
@@ -198,11 +232,18 @@
 
             //閲嶇疆鎸夐挳
             form.on('submit(btnReSearch)', function (data) {
-                $("#HDate").val("");//寮�濮嬫棩鏈�
-                $("#HDate1").val("");//缁撴潫鏃ユ湡
+                $("#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("");
                 $("#Part").val("");
                 $("#Source").val("");
+                $("#ColContent").val("");
+                $("#ColName").val("0");
+                $("#Comparator").val("0");
+                $("#HOrgID").val(sessionStorage["OrganizationID"]);
+                form.render('select');
+                sWhere = "";
+             
             });
         //#endregion
 
@@ -214,6 +255,7 @@
                 set_InitGrid();
                 //鏌ヨ
                 get_Display(sWhere);
+                Organ();
 
             }
 
@@ -244,6 +286,7 @@
                                 }
                             }
                         }
+                        , { field: '缁勭粐', title: '缁勭粐', width: 200 }
                         , {
                             field: 'HBillStatus', title: '鍗曟嵁鐘舵��', width: 200, templet: function (d) {
                                 switch (d.HBillStatus) {
@@ -335,10 +378,32 @@
                         , { 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: 'HReportType', title: '姹囨姤绫诲瀷', width: 200 }
+                        //, { field: 'HReportType', title: '姹囨姤绫诲瀷', width: 200 }
                         , { field: 'HRelationInterID', title: '鏄惁鎶ユ鐢宠', width: 200, hide: true }
                     ]]
                 };
+            }
+
+            //鑾峰彇缁勭粐
+            function Organ() {
+                //鑾峰彇鐧诲綍椤电粍缁囧垪
+                $.ajax({
+                    type: "get",
+                    url: GetWEBURL() + "/Web/GetOrganizations",
+                    success: function (result) {
+                        var Organization = "";
+                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data;
+                            for (var i = 0; i < data.length; i++) {
+                                Organization += '<option  style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
+                            }
+                            $("#HOrgID").append(Organization);
+                            $("#HOrgID").val(sessionStorage["OrganizationID"])
+                            form.render('select');
+                        }
+                        layer.closeAll("loading");
+                    }
+                })
             }
 
             //鏌ヨ鏁版嵁
@@ -355,6 +420,10 @@
                             option.data = data1.data;
                             table.render(option);
                             layer.close(ajaxLoad);
+
+                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+                                ColFilter();
+                            }
                         } else {
                             layer.close(ajaxLoad);
                             layer.alert(data1.code + data1.Message, { icon: 5 });
@@ -368,13 +437,46 @@
             }
 
             // 蹇�熻繃婊�
-            function get_FastQuery() {
+            function get_FastQuery(number) {
                 var HDate = $("#HDate").val();//寮�濮嬫棩鏈�
                 var HDate1 = $("#HDate1").val();//缁撴潫鏃ユ湡
                 var HBillNo = $("#HBillNo").val(); //鍗曟嵁鍙�
                 var Part = $("#Part").val();       //鐗╂枡淇℃伅
                 var Source = $("#Source").val();  //璧勬簮
+                var ColName = $("#ColName").val();//澶嶉�夋
+                var Comparator = $("#Comparator").val()
+                var ColContent = $("#ColContent").val();
+                var HOrgID = ""; //缁勭粐
                 sWhere += SchWhere;
+
+                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 (number == 1) {
+                    HOrgID = sessionStorage["OrganizationID"];
+                }
+                else {
+                    HOrgID = $("#HOrgID").val();//缁勭粐
+                }
                 if (HDate) {
                     sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
                 }
@@ -390,7 +492,9 @@
                 if (Source) {
                     sWhere += " and 鐢熶骇璧勬簮 like '%" + Dept + "%'";
                 }
-
+                if (HOrgID) {
+                    sWhere += " and HOrgID = '" + HOrgID + "'";
+                }
                 get_Display(sWhere);
                 //璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
                 sWhere = "";
@@ -423,7 +527,7 @@
                     var HInterID = data[0].HInterID;
                     var HICMOInID = data[0].HSourceInterID;
                     var HICMOEnID = data[0].HSourceEntryID;
-                    var HRelationInterID = data[0].HRelationInterID;
+                    var HRelationInterID = data[0].HRelationInterID;    
                     if (HRelationInterID == 1) {
                         layer.msg('鍗曟嵁宸叉姤妫�瀹℃牳鏃犳硶淇敼锛�');
                         return false;
@@ -461,8 +565,8 @@
                     var InterID = data[0].HInterID.toString();
                     var HICMOInID = data[0].HSourceInterID.toString();
                     var HICMOEnID = data[0].HSourceEntryID.toString();
-                    var HRelationInterID = data[0].HRelationInterID.toString();
-                    if (HRelationInterID == 1) {
+                    var HBillStatus = data[0].HBillStatus.toString();
+                    if (HBillStatus == 2) {
                         layer.msg('鍗曟嵁宸叉姤妫�瀹℃牳鏃犳硶鍒犻櫎锛�');
                         return false;
                     }
@@ -516,7 +620,6 @@
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;
                 if (checkStatus.data.length === 1) {
-                    console.log(JSON.stringify(data))
                     var HBillStatus = data[0].HBillStatus.toString(); //鍗曟嵁鐘舵��
                     var HSourceID = data[0].HSourceID.toString();  //鐢熶骇璧勬簮ID
                     var HSourceInterID = data[0].HSourceInterID.toString(); //婧愬崟涓诲唴鐮�
@@ -573,7 +676,7 @@
                     var HICMOInterID = data[0].HICMOInterID.toString();//鐢熶骇璁㈠崟涓籌D
                     var HICMOEntryID = data[0].HICMOEntryID.toString();//鐢熶骇璁㈠崟瀛怚D
                     var HInterID = data[0].HInterID.toString();//浜ч噺姹囨姤涓存椂琛ㄤ富ID
-                    if (HBillStatus = 1 || HBillStatus>2) {
+                    if (HBillStatus == 1 || HBillStatus>2) {
                         layer.msg('鍗曟嵁鏈鏍革紝涓嶉渶瑕佸弽瀹℃牳鎴栬�呭崟鎹凡鐢熸晥涓嶅厑璁稿弽瀹℃牳锛�');
                         return false;
                     }
@@ -607,6 +710,19 @@
 
             }
 
+            //鍒楁槑鏄剧ず涓嬫媺妗�
+            function ColFilter() {
+                var Organization = '<option  value="0" selected="selected" ></option>';
+                for (var i = 1; i < option.cols[0].length; i++) {
+                    if (option.cols[0][i].hide != true) {
+                        Organization += '<option  style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
+                    }
+                }
+                $("#ColName").empty();
+                $("#ColName").append(Organization);
+                form.render('select');
+            }
+
 
            // #endregion
             //浠ヤ笂鏄痩ayui妯″潡

--
Gitblit v1.9.1