From 8cc682a96aa34271ec022dfe3ee510ff81b8e934 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 13 十一月 2024 14:51:53 +0800
Subject: [PATCH] 出站汇报单导出,工序基础资料别的页面打开过滤,工艺路线编辑工序号顺序强控,批量驳回,工艺路线导出

---
 WebTM/views/计划管理/工艺路线/Gy_RoutingBill.html           |  170 +++++++++++++++++++++++++++
 WebTM/views/基础资料/生产基础资料/Gy_Process.html             |    2 
 WebTM/views/计划管理/工艺路线/Gy_RoutingBillCheckQuery.html |    9 
 WebTM/views/计划管理/工艺路线/Gy_RoutingBillList.html       |    2 
 WebTM/views/车间管理/工序出站汇报单/Cj_StationOutBillList.html |  153 +++++++++++++++++++++++++
 5 files changed, 325 insertions(+), 11 deletions(-)

diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Process.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Process.html"
index 3e2f0f5..b345950 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Process.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Process.html"
@@ -1190,7 +1190,7 @@
                 var openType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鎵撳紑鏂瑰紡  1鐩存帴鎵撳紑 2鍏跺畠椤甸潰閫氳繃閫夋嫨鎸夐挳鎵撳紑
                 var HOrgID = params[params[1]];
                 if (typeof (openType) != "undefined") {
-                    return  " and 鏄庣粏鏍囪 = 'Y' and 绂佺敤鏍囪 = 'Y'";
+                    return  " and 鏄庣粏鏍囪 = 'Y' and 绂佺敤鏍囪 != 'Y'";
                 }
                 return "";
             }
diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
index fdf75bf..32e6722 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
@@ -72,6 +72,11 @@
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">鍙嶅鏍�</button>
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CloseBill" id="set_CloseBill">鍏抽棴</button>
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CancelCloseBill" id="set_CancelCloseBill">鍙嶅叧闂�</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_Copy" id="set_Copy">澶嶅埗</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckFlowInfo" id="set_CheckFlowInfo">鏌ョ湅瀹℃壒杩涘害</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill_Flow" id="set_CheckBill_Flow">澶氱骇瀹℃牳</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck_Flow" id="set_AbandonCheck_Flow">澶氱骇鍙嶅鏍�</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_RejectCheck_Flow" id="set_RejectCheck_Flow">椹冲洖</button>
                     </div>
                     <div class="layui-tab" lay-filter="tab-POStockInBill">
                         <ul class="layui-tab-title" lay-filter="tab-all">
@@ -787,6 +792,7 @@
                         $("#HInterID").val(d.data[0].HInterID);
                         $("#HBillNo").val(d.data[0].HBillNo);
                         $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                        $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
                     }
                 });
             }
@@ -988,6 +994,29 @@
                 set_CancelCloseBill(data);
             });
 
+            //鏌ョ湅瀹℃壒杩涘害
+            form.on('submit(set_CheckFlowInfo)', function (data) {
+                set_CheckFlowInfo();
+            });
+
+            //澶氱骇瀹℃牳
+            form.on('submit(set_CheckBill_Flow)', function (data) {
+                set_CheckBill_Flow(0);
+            });
+
+            //澶氱骇鍙嶅鏍�
+            form.on('submit(set_AbandonCheck_Flow)', function (data) {
+                set_CheckBill_Flow(1);
+            });
+            //椹冲洖
+            form.on('submit(set_RejectCheck_Flow)', function (data) {
+                set_RejectCheck_Flow();
+            });
+
+            //澶嶅埗
+            form.on('submit(set_Copy)', function (data) {
+                set_Copy();
+            });
 
             //鏄惁榛樿宸ヨ壓
             form.on('checkbox(checkboxHStandard)', function (data) {
@@ -1342,11 +1371,24 @@
 
             //淇濆瓨鎻愪氦
             form.on('submit(btnSave)', function (data) {//鎻愪氦
-                if (AllowLoadData(data)) {
-                    set_AddNew(data);
+                const procNos = table.cache["mainTable"].map(item => item.HProcNo);
+                if (isSortedAscending(procNos)) {
+                    if (AllowLoadData(data)) {
+                        set_AddNew(data);
+                    }
+                } else {
+                    layer.msg('璇锋敞鎰忔祦姘村彿娆″簭');
                 }
             });
-
+            // 鍑芥暟锛氬垽鏂暟缁勬槸鍚︿粠灏忓埌澶ф帓搴�
+            function isSortedAscending(arr) {
+                for (let i = 0; i < arr.length - 1; i++) {
+                    if (arr[i] > arr[i + 1]) {
+                        return false;
+                    }
+                }
+                return true;
+            }
             //閫�鍑�
             form.on('submit(btnEdit)', function (data) {
                 if (params[1] != null) {
@@ -1865,6 +1907,128 @@
                 })
             }
 
+            //#region 澶氱骇 鍙嶅鏍�/瀹℃牳鏁版嵁
+            function set_CheckBill_Flow(num) {
+                var InterID = $("#HInterID").val();
+                if (InterID != 0) {
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Gy_Routing/AuditFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"], "CurUserID": sessionStorage["Czybm"] },
+                        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_RejectCheck_Flow() {
+                var InterID = $("#HInterID").val();
+                if (InterID != 0) {
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Gy_Routing/RejectCheckFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "CurUserID": sessionStorage["Czybm"] },
+                        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_Copy() {
+                //鍒跺崟浜�
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                $("#hmakers").val(sessionStorage["HUserName"]);
+                $("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
+                //璁剧疆hinterid
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    async: false,
+                    data: { "HBillType": '3301' },
+                    success: function (d) {
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                    }
+                });
+                OperationType = 2;
+            }
+            //#endregion
+
+            //#region 鏌ョ湅瀹℃壒杩涘害
+            function set_CheckFlowInfo() {
+                var InterID = $("#HInterID").val();
+                if (InterID != 0) {
+                    layer.open({
+                        type: 2
+                        , area: ['70%', '70%']
+                        , title: '鍗曟嵁瀹℃壒杩涘害'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../../绯荤粺绠$悊/澶氱骇瀹℃壒/瀹℃壒杩涘害/Xt_CheckFlowProgressList.html?linterid=' + InterID + '&HSouceBillType=3301'
+                        , resize: false,
+                        end: function () {
+                            ////淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                            //if (get_needClose_Bar == 0) {
+                            //    $("#btnSearch").trigger('click');
+                            //} else if (get_needClose_Bar == 1) {
+                            //    $("#get_needClose").trigger('click');
+                            //}
+                        }
+                        , cancel: function () {
+
+                        }
+                    })
+                } else {
+                    layer.msg('璇烽�夋嫨姝g‘鏁版嵁鏌ョ湅锛�');
+                }
+            }
+            //#endregion
+
             //琛屽唴鍒犻櫎蹇嵎閿�
             function set_GridCellCheck(obj) {
                 $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillCheckQuery.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillCheckQuery.html"
index c9c06a7..c821fe8 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillCheckQuery.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillCheckQuery.html"
@@ -944,13 +944,14 @@
             function set_RejectCheck_Flow(tableName) {
                 var checkStatus = table.checkStatus(tableName)
                     , data = checkStatus.data;
-                if (checkStatus.data.length === 1) {
-                    var InterID = data[0].hmainid.toString();
+                if (checkStatus.data.length !=0 ) {
+                    var uniqueIds = [...new Set(data.map(obj => obj.hmainid))];//灏嗗璞℃暟缁刬d鎻愬彇鍘婚噸
+                    var queryString = uniqueIds.join(",");//灏唅ds鍙樻垚鏁扮粍
                     //閫昏緫瀹℃牳鏂规硶
                     $.ajax({
                         type: "GET",
-                        url: GetWEBURL() + "/Gy_Routing/RejectCheckFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                        data: { "HInterID": InterID, "CurUserID": sessionStorage["Czybm"] },
+                        url: GetWEBURL() + "/Gy_Routing/RejectAllCheckFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterIDS": queryString, "CurUserID": sessionStorage["Czybm"] },
                         success: function (result) {
                             if (result.count == 1) {
                                 layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html"
index 0652702..78ce1ec 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html"
@@ -1594,7 +1594,7 @@
                 return data;
 
             }
-            //#endregin
+            //#endregion
 
             //#region 鍙戣捣瀹℃壒
             function set_startCheckBill() {
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBillList.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBillList.html"
index 9599a28..46b70d7 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBillList.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBillList.html"
@@ -2424,7 +2424,7 @@
             //#region 瀵煎嚭Execel
             function get_Export() {
                 var ModRightNameCheck = "Cj_StationOutBillList_ExportExcel";
-
+                var data = getExportData();
                 //閫昏緫瀹℃牳鏂规硶
                 $.ajax({
                     type: "GET",
@@ -2432,7 +2432,6 @@
                     data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
                     success: function (result) {
                         if (result.count == 1) {
-                            var data = option.data
                             data.forEach((item) => {
                                 for (let itemobj in item) {
                                     if (item[itemobj] == null) {
@@ -2458,6 +2457,156 @@
             }
             //#endregion
 
+            //#region 鑾峰彇瀵煎嚭鏁版嵁
+            function getExportData() {
+                var data;;//瀵煎嚭鐨勬暟鎹�
+                var ajaxLoad = layer.load();
+                if (typeof (params[params[0]]) != "undefined" && lookDownBar == 0) {
+                    $("#HProcExchBillNo").val(params[params[0]]);
+                    $("#HBeginDate").val("1990-01-01");
+                    $("#HEndDate").val("2200-12-30");
+                    lookDownBar = 1;
+                }
+                var HStatus = $("select[name='HStatus']").val();//鐘舵��
+                var HBeginDate = $("#HBeginDate").val();//寮�濮嬫棩鏈�
+                var HEndDate = $("#HEndDate").val();//缁撴潫鏃ユ湡
+                var HWorkBillNo = $("#HWorkBillNo").val();
+                var HBillNo = $("#HBillNo").val();
+                var HProcExchBillNo = $("#HProcExchBillNo").val();
+                var checkHWasterQty = $("input[name='checkHWasterQty']").prop("checked");//澶嶉�夋
+                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 HNumber = $("#HNumber").val(); //浜у搧浠g爜 鍗崇墿鏂欑紪鐮�
+                var HName = $("#HName").val(); //褰撳墠宸ュ簭
+                var HEmpNumber = $("#HEmpNumber").val(); //鎿嶄綔鍛樹唬鐮�
+                var HEmpName = $("#HEmpName").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 com = "";
+                    switch (Comparator1) {
+                        case "7":
+                            com = "like'%" + ColContent1 + "%'";
+                            break;
+                        case "8":
+                            com = "like'%" + ColContent1 + "'";
+                            break;
+                        case "9":
+                            com = "like'" + ColContent1 + "%'";
+                            break;
+                        case "10":
+                            com = "not like'%" + ColContent1 + "%'";
+                            break;
+                        default:
+                            com = "" + Comparator1 + "'" + ColContent1 + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName1 + " " + com;
+                }
+
+                if (HBeginDate) {
+                    sWhere += " and CONVERT(varchar(100),鍑虹珯鏃堕棿, 23) >= '" + HBeginDate + "'";
+                }
+                if (HEndDate) {
+                    sWhere += " and CONVERT(varchar(100),鍑虹珯鏃堕棿, 23) <= '" + HEndDate + "'";
+                }
+                if (HWorkBillNo) {
+                    sWhere += " and 浠诲姟鍗� like '%" + HWorkBillNo + "%'";
+                }
+                if (HBillNo) {
+                    sWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
+                }
+                if (HProcExchBillNo) {
+                    sWhere += " and 宸ュ簭娴佽浆鍗″彿 like '%" + HProcExchBillNo + "%'";
+                }
+                if (HProcExchBillNo) {
+                    sWhere += " and 宸ュ簭娴佽浆鍗″彿 like '%" + HProcExchBillNo + "%'";
+                }
+                if (checkHWasterQty) {
+                    sWhere += "  and 鎶ュ簾鏁伴噺>0 ";
+                }
+                if (HNumber) {
+                    sWhere += " and 浜у搧浠g爜 like '%" + HNumber + "%'";
+                }
+                if (HName) {
+                    sWhere += " and 褰撳墠宸ュ簭 like '%" + HName + "%'";
+                }
+                if (HEmpNumber) {
+                    sWhere += " and 鎿嶄綔鍛樹唬鐮� like '%" + HEmpNumber + "%'";
+                }
+                if (HEmpName) {
+                    sWhere += " and 鎿嶄綔鍛� like '%" + HEmpName + "%'";
+                }
+
+                if (HStatus) {
+                    switch (HStatus) {
+                        case '-1':   //鍏ㄩ儴
+                            sWhere += "";
+                            break;
+                        case '0':    //鏈鏍�
+                            sWhere += " and 瀹℃牳浜�='";
+                            break;
+                        case '1':    //宸插鏍�
+                            sWhere += " and 瀹℃牳浜�<>'";
+                            break;
+                        case '2':    //宸插叧闂�
+                            sWhere += " and 鍏抽棴浜�<>'";
+                        default:
+                    }
+                }
+                sWhere += "  and HBillSubType<>'SUB'";
+                //鏌ヨ璇彞
+                $.ajax({
+                    url: GetWEBURL() + '/Cj_StationOutBill/get_Display',
+                    type: "GET",
+                    async: false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "HBillSubType": "3791" },
+                    success: function (data1) {
+                        if (data1.count == 1) {
+                            data = data1.data;//鍒楀瓧娈垫暟鎹�
+                            layer.close(ajaxLoad);
+                            //layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(data1.code + data1.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+                sWhere = "";
+                return data;
+
+            }
+            //#endregion
+
+
             //鍒楁槑鏄剧ず涓嬫媺妗�
             function ColFilter() {
                 var Organization = '<option  value="0" selected="selected" ></option>';

--
Gitblit v1.9.1