From 8a36bbee40f5e1069b15a98b1e64ac9719ee8a46 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期二, 23 四月 2024 17:17:13 +0800
Subject: [PATCH] 1.销售出库单 增加 反写源单 销售订单和发货通知单   超出 关联数量  关闭源单 2.应收单 增加  反写源单 销售出库单 和 销售订单  超出关联数量  关闭源单 3.动态获取源单增加参数 Num 0蓝单   1红单  2全部 4.销售流程的测试并完善功能; 销售订单-》发货通知单-》销售出库单-》应收单 (注意: 源单类型的下拉框 需要 根据数据库 表动态加载, 关联数量 要准确 , 审核 且 未关闭 未行关闭的行 才能下推 ,关联数量超额后,要 反写 关闭 源单 )

---
 WebTM/views/生产管理/产量汇报单/Sc_Add_ProductReportBillList.html |   75 +++++++++++++++++++++++++++----------
 1 files changed, 55 insertions(+), 20 deletions(-)

diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html"
index 732dfe4..5e6dc5d 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html"
@@ -336,6 +336,7 @@
         var HSourceEntryID = "";  //婧愬崟瀛愬唴鐮�
         var HSourceBillNo = "";   //婧愬崟鍗曞彿
         var HSourceBillType = "";  //婧愬崟绫诲瀷
+        var refSav = "";   //鎻愪氦绫诲瀷
         //鑾峰彇椤甸潰璺宠浆鍙傛暟  //鍗曟嵁缂栬緫鐘舵�侊細 1.鏃犳簮鍗曟柊澧灺� 聽2.鏈夋簮鍗曟柊澧灺� 聽3.缂栬緫聽 4.娴忚聽 5.鍙樻洿
         var params = get_UrlVars();
         if (typeof (params[params[0]]) == "undefined") {
@@ -377,9 +378,17 @@
 
             //鍒ゆ柇鎿嶄綔绫诲瀷
             if (OperationType == 1) {//鏃犳簮鍗�
+                $("#HWorkManID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛業D
+                $("#HWorkManName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛�
+                $("#HGroupID").val(sessionStorage["HGroupID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍ID
+                $("#HGroupName").val(sessionStorage["HGroup"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍
                 set_AddFNew();
             }
             else if (OperationType == 2) {//鏈夋簮鍗�
+                $("#HWorkManID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛業D
+                $("#HWorkManName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛�
+                $("#HGroupID").val(sessionStorage["HGroupID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍ID
+                $("#HGroupName").val(sessionStorage["HGroup"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍
                 set_AddNew();
             }
             else if (OperationType == 3) {//缂栬緫
@@ -436,6 +445,7 @@
 
             //鏈夋簮鍗曟柊澧�
             function set_AddNew() {
+                refSav = "Add";
                 //鍒濆鍩烘湰淇℃伅璧嬪��
                 $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //鍗曟嵁鏃ユ湡
                 $("#HWorkReportDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"))  //鎶ュ伐鏃ユ湡
@@ -485,8 +495,8 @@
                                 $("#HSourceInterID").val(LoadData[0].HSourceInterID); //婧愬崟涓诲唴鐮�(鍙栧�糎InterID)
                                 $("#HSourceEntryID").val(LoadData[0].HSourceEntryID); //婧愬崟瀛愬唴鐮�(婧愬崟琛屽彿)
                                 $("#HSourceBillType").val(HSourceBillType); //婧愬崟绫诲瀷
-                                $("#HGroupID").val(LoadData[0].HDeptID); //鐝粍ID
-                                $("#HGroupName").val(LoadData[0].HDeptName); //鐝粍
+                                //$("#HGroupID").val(LoadData[0].HDeptID); //鐝粍ID
+                                //$("#HGroupName").val(LoadData[0].HDeptName); //鐝粍
                                 $("#HICMOInterID").val(LoadData[0].HICMOInterID); //鐢熶骇璁㈠崟ID
                                 $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //鐢熶骇璁㈠崟瀛怚D
                                 $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //鐢熶骇璁㈠崟
@@ -508,6 +518,7 @@
             //缂栬緫
             function set_EditFromGrid(linterid, HICMOInID, HICMOEnID)
             {
+                refSav = "Update";
                 //鍔犳簮鍗曠被鍨嬪尯鍒�(鍙互鍐欎笉鍚岀殑鏂规硶)
                 $('#HICMOBillNo').attr("disabled", true);
                 $('#HSourceBillNo').attr("disabled", true);
@@ -669,7 +680,7 @@
                     shift: 2,
                     area: ['80%', '80%'],
                     maxmin: true,
-                    content: ['../../PublicPage/PartInformation.html', 'yes'],
+                    content: ['../../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html', 'yes'],
                     btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
 
@@ -679,8 +690,8 @@
                         if (checkStatus.data.length === 0) {
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
-                        $("#HMaterName").val(checkStatus.data[0].HName);
-                        $("#HMaterCode").val(checkStatus.data[0].HNumber);
+                        $("#HMaterName").val(checkStatus.data[0].鐗╂枡鍚嶇О);
+                        $("#HMaterCode").val(checkStatus.data[0].鐗╂枡浠g爜);
                         $("#HMaterID").val(checkStatus.data[0].HItemID);
                         layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
@@ -708,7 +719,7 @@
                     shift: 2,
                     area: ['80%', '80%'],
                     maxmin: true,
-                    content: ['../../PublicPage/SourceInformation.html', 'yes'],
+                    content: ['../../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Source.html', 'yes'],
                     btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
 
@@ -718,7 +729,7 @@
                         if (checkStatus.data.length === 0) {
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
-                        $("#HSourceName").val(checkStatus.data[0].HName);
+                        $("#HSourceName").val(checkStatus.data[0].鐢熶骇璧勬簮鍚嶇О);
                         $("#HSourceID").val(checkStatus.data[0].HItemID);
                         layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
@@ -746,7 +757,7 @@
                     shift: 2,
                     area: ['80%', '80%'],
                     maxmin: true,
-                    content: ['../../PublicPage/UserInformation.html', 'yes'],
+                    content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html?type=HEmp', 'yes'],
                     btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
 
@@ -756,7 +767,7 @@
                         if (checkStatus.data.length === 0) {
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
-                        $("#HWorkManName").val(checkStatus.data[0].HName);
+                        $("#HWorkManName").val(checkStatus.data[0].鑱屽憳鍚嶇О);
                         $("#HWorkManID").val(checkStatus.data[0].HItemID);
                         layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
@@ -786,7 +797,7 @@
                     shift: 2,
                     area: ['80%', '80%'],
                     maxmin: true,
-                    content: ['../../PublicPage/GroupInformation.html', 'yes'],
+                    content: ['../../鍩虹璧勬枡/宸ヨ祫鍩虹璧勬枡/Gy_Group.html?type=HGroup', 'yes'],
                     btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
 
@@ -796,7 +807,7 @@
                         if (checkStatus.data.length === 0) {
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
-                        $("#HGroupName").val(checkStatus.data[0].HName);
+                        $("#HGroupName").val(checkStatus.data[0].鐝粍鍚嶇О);
                         $("#HGroupID").val(checkStatus.data[0].HItemID);
                         layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
@@ -869,25 +880,40 @@
                     data.field.HWasterQty = 0;
                 }
                 var sMainStr = JSON.stringify(data.field);
-
+                var sMainSub = sMainStr + ';' + refSav;
 
                 $.ajax({
                     type: "POST",
                     url: GetWEBURL() + "/Sc_MESBeginWorkBill/SaveGetMESProductReportFrom", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    async: true,
-                    data: { "msg": sMainStr },
+                    async: false,
+                    data: { "msg": sMainSub },
                     dataType: "json",
                     success: function (data) {
                         if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
                             $("#HInterID").val(data.HInterID);//鑾峰彇鎻愪氦鎴愬姛杩斿洖鐨勫崟鎹富ID
-                            layer.confirm(data.Message, {
-                                btn: ['纭']
-                            }, function (index) {
+                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
                                 if (data.Verify == "Y") //鑷姩瀹℃牳
                                 {
+                                    layer.close(index);
                                     SaveVerify(); //瀹℃牳
                                 }
+                                else {
+                                    layer.close(index);
+                                }
                             });
+                       
+                            //layer.confirm(data.Message, {
+                            //    btn: ['纭']
+                            //}, function (index) {
+                            //    if (data.Verify == "Y") //鑷姩瀹℃牳
+                            //    {
+                            //        layer.close(index);
+                            //        SaveVerify(); //瀹℃牳
+                            //    }
+                            //    else {
+                            //        layer.close(index);
+                            //    }
+                            //});
                         }
                         else {
                             layer.alert(data.Message, { icon: 5 })
@@ -916,7 +942,7 @@
                 //閫昏緫瀹℃牳鏂规硶
                 $.ajax({
                     type: "GET",
-                    url: GetWEBURL() + "/Sc_MESBeginWorkBill/AuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    url: GetWEBURL() + "/Sc_MESBeginWorkBill/MESProductAuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
                     data: { "HSourceID": HSourceID, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID, "HInterID": HInterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                     success: function (result) {
                         if (result.count == 1) {
@@ -950,7 +976,7 @@
                 $.ajax({
                     type: "GET",
                     url: GetWEBURL() + "/Sc_MESBeginWorkBill/MESProductAuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    data: { "HSourceID": HSourceID, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID, "HInterID": HInterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
+                    data: { "HSourceID": HSourceID, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID, "HInterID": HInterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
                     success: function (result) {
                         if (result.count == 1) {
                             layer.msg(result.Message, { time: 1 * 2000, icon: 1 }, function () {
@@ -1014,7 +1040,16 @@
             return Result;
         }
 
-
+        //鎿嶄綔鍛�
+        function GetHEmpValue(obj) {
+            $("#HWorkManName").val(obj[0].鑱屽憳鍚嶇О);
+            $("#HWorkManID").val(obj[0].HItemID);
+        }
+        //鐢熶骇鐝粍
+        function GetHGroupValue(obj) {
+            $("#HGroupName").val(obj[0].鐝粍鍚嶇О);
+            $("#HGroupID").val(obj[0].HItemID);
+        }
 
 
     </script>

--
Gitblit v1.9.1