From d9ccb1dfdb438225014b0b95d642a4e2a0c3736b Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 07 九月 2022 19:43:10 +0800
Subject: [PATCH] 隐藏列 维护 工艺路线 物料id 小写

---
 WebTM/views/生产管理/上料防错单/Sc_Add_MaterToSourceBillList.html |  799 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 420 insertions(+), 379 deletions(-)

diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\270\212\346\226\231\351\230\262\351\224\231\345\215\225/Sc_Add_MaterToSourceBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\270\212\346\226\231\351\230\262\351\224\231\345\215\225/Sc_Add_MaterToSourceBillList.html"
index efcd069..f26ae2f 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\270\212\346\226\231\351\230\262\351\224\231\345\215\225/Sc_Add_MaterToSourceBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\270\212\346\226\231\351\230\262\351\224\231\345\215\225/Sc_Add_MaterToSourceBillList.html"
@@ -383,7 +383,8 @@
         }).extend({
             index: 'lib/index' //涓诲叆鍙fā鍧�
         }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
-             //#region 鍏敤鍙橀噺
+
+            //#region 鍏敤鍙橀噺
             var $ = layui.$
                 , admin = layui.admin
                 , layer = layui.layer
@@ -396,7 +397,7 @@
             var option2;
             //#endregion
 
-           
+            //#region 杩涘叆椤甸潰鍗冲姞杞�
             //鍒濆鍖栬〃鍗曟彃浠�
             set_InitFrom();
 
@@ -418,302 +419,9 @@
                 layer.alert("鏈煡鎿嶄綔绫诲瀷锛�", { icon: 5 });
             }
 
-            //鍒濆鍖栨彃浠�
-            function set_InitFrom() {
-                //鏃ユ湡鏃堕棿閫夋嫨鍣�
-                laydate.render({
-                    elem: '#HDate'
-                    , type: 'datetime'
-                });
-                laydate.render({
-                    elem: '#HMakeDate'
-                    , type: 'datetime'
-                });
-                laydate.render({
-                    elem: '#HUpDateDate'
-                    , type: 'datetime'
-                });
-                laydate.render({
-                    elem: '#HCheckDate'
-                    , type: 'datetime'
-                });
-                laydate.render({
-                    elem: '#HCloseDate'
-                    , type: 'datetime'
-                });
-                laydate.render({
-                    elem: '#HDeleteDate'
-                    , type: 'datetime'
-                });
-            }
+            //#endregion
 
-            //鍒濆鍖栬〃鏍�
-            function set_InitGrid() {
-                Table1();  //淇濆吇椤瑰垪琛�
-                Table2();  //閰嶄欢椤瑰垪琛�
-
-            }
-
-            //鍒濆鍖栭厤鏂欏垪琛�
-            function Table1() {
-                //琛ㄥご
-                columns = [
-                    { type: 'checkbox', fixed: 'left' }
-                    , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
-                    , { field: 'HBarCode', title: '鎵弿鏉$爜', edit: 'text', hide: true }
-                    , { field: 'HMaterID', title: '鐗╂枡ID', edit: 'text', hide: true }
-                    , { field: 'HNumber', title: '鐗╂枡浠g爜', edit: 'text' }
-                    , { field: 'HName', title: '鐗╂枡鍚嶇О', edit: 'text' }
-                    , { field: 'HModel', title: '瑙勬牸鍨嬪彿', edit: 'text' }
-                    , { field: 'HUnitID', title: '鍗曚綅ID', edit: 'text', hide: true }
-                    , { field: 'HUnitName', title: '鍗曚綅', edit: 'text' }
-                    , { field: 'HMQty', title: '閰嶆枡鏁伴噺', edit: 'text' }
-                    , { field: 'HQty', title: '瀹為厤鏁伴噺', edit: 'text' }
-                ];
-                option = {
-                    id: 'mainTable'
-                    , elem: '#mainTable'
-                    , toolbar: '#toolbarDemo'
-                    , defaultToolbar: false  //鏄惁鏄剧ず鍙充晶宸ュ叿鏍�
-                    , page: false
-                    , cellMinWidth: 120
-                    , height: 350
-                    , cols: [columns]
-                    , done: function (res, curr, count) {
-
-                    }
-                };
-            }
-
-            //鍒濆鍖栭厤浠堕」鍒楄〃
-            function Table2() {
-                //琛ㄥご
-                columns1 = [
-                    { type: 'checkbox', fixed: 'left' }
-                    , { templet: '#xuhao1', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
-                    , { field: 'HMouldID', title: '娌诲叿ID', edit: 'text', hide: true}
-                    , { field: 'HMouldNumber', title: '娌诲叿浠g爜', edit: 'text' }
-                    , { field: 'HMouldName', title: '娌诲叿鍚嶇О', edit: 'text' }
-                    , { field: 'HMouldSpec', title: '瑙勬牸鍨嬪彿', edit: 'text' }
-                ];
-                option2 = {
-                    id: 'mainTable1'
-                    , elem: '#mainTable1'
-                    , toolbar: '#toolbarDemo1'
-                    , defaultToolbar: false  //鏄惁鏄剧ず鍙充晶宸ュ叿鏍�
-                    , page: false
-                    , cellMinWidth: 120
-                    , height: 350
-                    , cols: [columns1]
-                    , done: function (res, curr, count) {
-
-                    }
-                };
-            }
-
-            //鏃犳簮鍗曟柊澧�
-            function set_AddFNew()
-            {
-                //鍔犳簮鍗曠被鍨嬪尯鍒�(鍙互鍐欎笉鍚岀殑鏂规硶)
-               
-            }
-
-            //鏈夋簮鍗曟柊澧�
-            function set_AddNew() {
-                get_MAXNum();
-                set_SourceAdd();
-                option.data = [];
-                option2.data = [];
-                table.render(option);
-                table.render(option2);
-            }
-
-            //缂栬緫
-            function set_EditFromGrid()
-            {
-                $("#HInterID").val(linterid);//淇敼鏃朵富琛↖D
-                refSav = "Update";
-                $('#HMaterCode').attr("disabled", true);
-                $('#HMaterList').addClass("layui-btn-disabled").attr("disabled", true);
-                $('#HMaterName').attr("disabled", true);
-                $('#HMaterSpec').attr("disabled", true);
-                $('#HBeginDate').attr("disabled", true);
-                $('#HSourceName').attr("disabled", true);
-                $('#HSourceList').addClass("layui-btn-disabled").attr("disabled", true);
-                $('#HMainSourceBillNo').attr("disabled", true);
-                $('#XDHList').addClass("layui-btn-disabled").attr("disabled", true);
-         
-
-                $('#SourceType').attr("disabled", true);
-                form.render('select');
-                $('#HICMOBillNo').attr("disabled", true);
-
-                set_EditForm(linterid);  //缂栬緫鑾峰彇琛ㄥご
-                set_EditGrid(linterid);  //缂栬緫鑾峰彇琛ㄤ綋
-               
-            }
-
-            //缂栬緫鑾峰彇琛ㄥご
-            function set_EditForm(linterid) {
-                //鏌ヨ妫�楠屾柟妗堝崟鏄惁瀛樺湪
-                $.ajax({
-                    url: GetWEBURL() + "Sc_MouldMaintainBill/Sc_MouldMaintainBillListCheckDetai",
-                    type: "GET",
-                    data: {
-                        "HID": linterid
-                    },
-                    success: function (result) {
-                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            var data = result.data.h_v_Sc_MouldMaintain[0];
-                            form.val("component-form-group", {
-                                "HBillNo": data.鍗曟嵁鍙�
-                                , "HDate": formatDate(data.鏃ユ湡)
-                                , "HInnerBillNo": data.鍐呴儴鍗曟嵁鍙�
-                                , "HBeginDate": formatDate(data.淇濆吇寮�濮嬫棩鏈�)
-                                , "HEndDate": formatDate(data.淇濆吇缁撴潫鏃ユ湡)
-                                , "HExplanation": data.鎽樿
-                                , "HRemark": data.澶囨敞
-                                , "HPlanNo": data.淇濆吇璁″垝缂栧彿
-                                , "HPlanInterID": data.淇濆吇璁″垝鍐呯爜
-                                , "HMouldID": data.HMouldID
-                                , "HMouldName": data.浜у搧妯″叿
-
-                            });
-
-                        } else {
-                            layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
-                        }
-                    }, error: function () {
-                        layer.alert("鍙戠敓閿欒!", { icon: 5 });
-                    }
-                });
-            }
-
-            // 缂栬緫鑾峰彇琛ㄥご鏃舵椂闂存牸寮忕煫姝f柟寮�
-            function formatDate(date) {
-                var d = new Date(date),
-                    month = '' + (d.getMonth() + 1),
-                    day = '' + d.getDate(),
-                    year = d.getFullYear();
-
-                if (month.length < 2) month = '0' + month;
-                if (day.length < 2) day = '0' + day;
-
-                return [year, month, day].join('-');
-            }
-
-            // 缂栬緫鑾峰彇琛ㄤ綋
-            function set_EditGrid(linterid) {
-                $("#HInterID").val(linterid);//淇敼鏃朵富琛↖D
-                //缂栬緫鍔犺浇鏁版嵁
-                $.ajax({
-                    url: GetWEBURL() + 'Sc_MouldMaintainBill/Sc_MouldMaintainBillListProjectDetaiNew',
-                    type: "GET",
-                    data: { "HInterID": linterid },
-                    success: function (result) {
-                        if (result.count == 1) {
-                            option.data = result.list[0];
-                            table.render(option);
-                            option2.data = result.list[1];
-                            table.render(option2);
-
-                        } else {
-                            layer.alert(result.code + result.Message, { icon: 5 });
-                        }
-                    }, error: function () {
-                        layer.close(index0);
-                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
-                    }
-                });
-            }
-
-            //鏈夋簮鍗曟柊澧�
-            function set_SourceAdd() {
-                refSav = "Add";
-                //鍒濆鍩烘湰淇℃伅璧嬪��
-                $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //鍗曟嵁鏃ユ湡
-                $("#HWorkReportDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //鎶ュ伐鏃ユ湡
-                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //鍒跺崟鏃ユ湡
-                $("#HMaker").val(sessionStorage["HUserName"]);     //鍒跺崟浜�
-
-                //鍔犳簮鍗曠被鍨嬪尯鍒�(鍙互鍐欎笉鍚岀殑鏂规硶)
-                $('#HICMOBillNo').attr("disabled", true);
-                $('#HSourceBillNo').attr("disabled", true);
-                $('#HProcExchBillNo').attr("disabled", true);
-                $('#HProcName').attr("disabled", true);
-                $('#HMaterCode').attr("disabled", true);
-                $('#HMaterList').addClass("layui-btn-disabled").attr("disabled",true);
-                $('#HMaterName').attr("disabled", true);
-                $('#HMaterSpec').attr("disabled", true);
-                $('#HPlanQty').attr("disabled", true);
-                $('#HSourceName').attr("disabled", true);
-                $('#HSourceList').addClass("layui-btn-disabled").attr("disabled", true);
-                $('#HWorkBeginDate').attr("disabled", true);
-                $('#HWorkReportDate').attr("disabled", true);
-
-                $.ajax(
-                    {
-                        type: "GET",
-                        url: GetWEBURL() + "/Sc_MaterToSourceBill/GetMESMaterToSourceFrom", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                        async: true,
-                        data: {
-                            "HSourceInterID": HSourceInterID,
-                            "HSourceEntryID": HSourceEntryID,
-                            "HSourceBillNo": HSourceBillNo,
-                            "HSourceBillType": HBillType
-                        },
-                        dataType: "json",
-                        success: function (data) {
-                            if (data.count == 1)// 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            {
-                                var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
-                                $("#HProcID").val(LoadData[0].HProcID); //褰撳墠宸ュ簭ID
-                                $("#HProcName").val(LoadData[0].HProcName); //褰撳墠宸ュ簭
-                                $("#HMaterID").val(LoadData[0].HMaterID); //浜у搧ID
-                                $("#HMaterCode").val(LoadData[0].HMaterNumber); //浜у搧浠g爜
-                                $("#HMaterName").val(LoadData[0].HMaterName); //浜у搧鍚嶇О
-                                $("#HMaterSpec").val(LoadData[0].HModel); //浜у搧瑙勬牸
-                                $("#HSourceID").val(LoadData[0].HSourceID); //鐢熶骇璧勬簮ID
-                                $("#HSourceName").val(LoadData[0].HSourceName); //鐢熶骇璧勬簮
-                                $("#HSourceBillNo").val(LoadData[0].HICMOBillNo); //婧愬崟鍗曞彿锛堟殏鏃跺彇鍊艰鍗曠紪鍙凤級
-                                $("#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); //鐝粍
-                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //鐢熶骇璁㈠崟ID
-                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //鐢熶骇璁㈠崟瀛怚D
-                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //鐢熶骇璁㈠崟鍙�
-                                $("#HWorkBeginDate").val(LoadData[0].HBeginDate); //寮�宸ユ椂闂�
-                                $("#HPlanQty").val(LoadData[0].HDatePlanQty); //璁㈠崟鏁伴噺
-
-                            }
-                            else {
-                                layer.alert(data.Message, { icon: 5 });
-
-                            }
-                        },
-                        error: function (err) {
-                            layer.alert(err, { icon: 5 });
-                        }
-                    });
-            }
-
-            //鑾峰彇鏈�澶у崟鎹彿鍙婇粯璁ゅ�艰祴鍊�
-            function get_MAXNum() {
-                //鑾峰彇鏈�澶у崟鎹彿 new
-                $("#HInterID").val("0");
-                $("#HBillNo").val("");
-                $.ajax({
-                    url: GetWEBURL() + "/Web/GetMAXNum",
-                    type: "GET",
-                    data: { "HBillType": '3786' },
-                    success: function (d) {
-                        $("#HBillNo").val(d.data[0].HBillNo);
-                        $("#HInterID").val(0);
-                    }
-                });
-            }
+            //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
 
             //鏂板淇濆瓨
             form.on('submit(Add)', function (data) {
@@ -732,7 +440,7 @@
             form.on('submit(Saver)', function (data) {
 
                 var sMainStr = JSON.stringify(data.field);
-                var sSubStr = JSON.stringify(table.cache['mainTable']);      
+                var sSubStr = JSON.stringify(table.cache['mainTable']);
                 var sSubStr1 = JSON.stringify(table.cache['mainTable1']);
                 var sMainSub = sMainStr + ';' + sSubStr + ';' + refSav;
 
@@ -749,17 +457,18 @@
                     success: function (data) {
                         if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
                             $("#HInterID").val(data.HInterID);//鑾峰彇鎻愪氦鎴愬姛杩斿洖鐨勫崟鎹富ID
-                            layer.confirm(data.Message, {icon: 1,
+                            layer.confirm(data.Message, {
+                                icon: 1,
                                 btn: ['纭']
                             }, function (index) {
-                                    if (data.Verify == "Y") //鑷姩瀹℃牳
-                                    {
-                                        layer.close(index);
-                                        SaveVerify(); //瀹℃牳
-                                    }
-                                    else {
-                                        layer.close(index);
-                                    }
+                                if (data.Verify == "Y") //鑷姩瀹℃牳
+                                {
+                                    layer.close(index);
+                                    SaveVerify(); //瀹℃牳
+                                }
+                                else {
+                                    layer.close(index);
+                                }
                             });
                         }
                         else {
@@ -782,72 +491,6 @@
                 ReVerIfySaver();
             });
 
-            //瀹℃牳鎻愪氦
-            function SaveVerify()
-            {
-                var InterID = $("#HInterID").val();
-                var sSubStr = JSON.stringify(table.cache['mainTable']);
-                var sSubStr1 = JSON.stringify(table.cache['mainTable1']);
-                if (!AllowLoadData(sSubStr, sSubStr1))//鏁版嵁楠岃瘉
-                {
-                    return false;
-                }
-                $.ajax({
-                    type: "GET",
-                    url: GetWEBURL() + "/Sc_MaterToSourceBill/AuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    async: true,
-                    data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
-                    dataType: "json",
-                    success: function (data) {
-                        if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
-                                //layer.close(layer.index);
-                                //window.parent.location.reload();
-                            });
-                        }
-                        else {
-                            layer.alert(data.Message, { icon: 5 })
-                        }
-                    },
-                    error: function (err) {
-                        layer.alert(err, { icon: 5 })
-                    }
-                })
-            }
-
-            //鍙嶅鏍告彁浜�
-            function ReVerIfySaver() {
-                var InterID = $("#HInterID").val();
-                var sSubStr = JSON.stringify(table.cache['mainTable']);
-                var sSubStr1 = JSON.stringify(table.cache['mainTable1']);
-                if (!AllowLoadData(sSubStr, sSubStr1))//鏁版嵁楠岃瘉
-                {
-                    return false;
-                }
-                $.ajax({
-                    type: "GET",
-                    url: GetWEBURL() + "/Sc_MaterToSourceBill/AuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    async: true,
-                    data: { "HInterID": InterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
-                    dataType: "json",
-                    success: function (data) {
-                        if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
-                                //layer.close(layer.index);
-                                //window.parent.location.reload();
-                            });
-                        }
-                        else {
-                            layer.alert(data.Message, { icon: 5 })
-                        }
-                    },
-                    error: function (err) {
-                        layer.alert(err, { icon: 5 })
-                    }
-                })
-            }
-
-
             //閫�鍑�
             form.on('submit(Exit)', function (data) {
                 Pub_Close(1);
@@ -868,7 +511,7 @@
                     $.ajax({
                         url: GetWEBURL() + "/Sc_MaterToSourceBill/get_CheckTypeByBarCode_Json",
                         type: "GET",
-                        data: { "HBarCode": HBarCode, "HSourceID": "111", "HICMOInterID": "100030", "HICMOEntryID": "100050"},
+                        data: { "HBarCode": HBarCode, "HSourceID": "111", "HICMOInterID": "100030", "HICMOEntryID": "100050" },
                         success: function (result) {
                             console.info(result);
                             if (result.count == 1) {
@@ -876,8 +519,7 @@
                                     $("#HSourceID").val(result.data.Gy_Source[0].HItemID);
                                     $("#HSourceName").val(result.data.Gy_Source[0].HName);
                                 }
-                                if (result.Verify == '鐢ㄦ枡娓呭崟鐗╂枡鏉$爜')
-                                {
+                                if (result.Verify == '鐢ㄦ枡娓呭崟鐗╂枡鏉$爜') {
                                     //鍥炲啓鐢ㄦ枡娓呭崟鏁版嵁鍒楄〃
                                     // 婧愭暟鎹�
                                     tableBak = table.cache.mainTable;
@@ -889,8 +531,7 @@
                                         option.data = table.cache["mainTable"];
                                         table.render(option);
                                     }
-                                    else
-                                    {
+                                    else {
                                         // 鍘婚噸(涓嶈兘鏈夌浉鍚屾壂鐮佺墿鏂�)
                                         for (var i = 0; i < tableBak.length; i++) {
                                             console.log(tableBak[i].HMaterID, result.data[0].HMaterID);
@@ -1116,7 +757,7 @@
                 var AddRow = table.cache['mainTable'];
                 switch (obj.event) {
                     //鍒犻櫎涓�琛�
-                    case 'btn-DeleteLine': btnDeleteLine(checkStatus,data, obj);
+                    case 'btn-DeleteLine': btnDeleteLine(checkStatus, data, obj);
                         break;
                 }
             });
@@ -1133,6 +774,405 @@
                         break;
                 }
             });
+
+            //#endregion
+
+            //#region 鏈〉闈㈡墍鏈夎璋冪敤鐨勬柟娉�
+
+            //鍒濆鍖栨彃浠�
+            function set_InitFrom() {
+                //鏃ユ湡鏃堕棿閫夋嫨鍣�
+                laydate.render({
+                    elem: '#HDate'
+                    , type: 'datetime'
+                });
+                laydate.render({
+                    elem: '#HMakeDate'
+                    , type: 'datetime'
+                });
+                laydate.render({
+                    elem: '#HUpDateDate'
+                    , type: 'datetime'
+                });
+                laydate.render({
+                    elem: '#HCheckDate'
+                    , type: 'datetime'
+                });
+                laydate.render({
+                    elem: '#HCloseDate'
+                    , type: 'datetime'
+                });
+                laydate.render({
+                    elem: '#HDeleteDate'
+                    , type: 'datetime'
+                });
+            }
+
+            //鍒濆鍖栬〃鏍�
+            function set_InitGrid() {
+                Table1();  //淇濆吇椤瑰垪琛�
+                Table2();  //閰嶄欢椤瑰垪琛�
+
+            }
+
+            //鍒濆鍖栭厤鏂欏垪琛�
+            function Table1() {
+                //琛ㄥご
+                columns = [
+                    { type: 'checkbox', fixed: 'left' }
+                    , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
+                    , { field: 'HBarCode', title: '鎵弿鏉$爜', edit: 'text', hide: true }
+                    , { field: 'HMaterID', title: '鐗╂枡ID', edit: 'text', hide: true }
+                    , { field: 'HNumber', title: '鐗╂枡浠g爜', edit: 'text' }
+                    , { field: 'HName', title: '鐗╂枡鍚嶇О', edit: 'text' }
+                    , { field: 'HModel', title: '瑙勬牸鍨嬪彿', edit: 'text' }
+                    , { field: 'HUnitID', title: '鍗曚綅ID', edit: 'text', hide: true }
+                    , { field: 'HUnitName', title: '鍗曚綅', edit: 'text' }
+                    , { field: 'HMQty', title: '閰嶆枡鏁伴噺', edit: 'text' }
+                    , { field: 'HQty', title: '瀹為厤鏁伴噺', edit: 'text' }
+                ];
+                option = {
+                    id: 'mainTable'
+                    , elem: '#mainTable'
+                    , toolbar: '#toolbarDemo'
+                    , defaultToolbar: false  //鏄惁鏄剧ず鍙充晶宸ュ叿鏍�
+                    , page: false
+                    , cellMinWidth: 120
+                    , height: 350
+                    , cols: [columns]
+                    , done: function (res, curr, count) {
+
+                    }
+                };
+            }
+
+            //鍒濆鍖栭厤浠堕」鍒楄〃
+            function Table2() {
+                //琛ㄥご
+                columns1 = [
+                    { type: 'checkbox', fixed: 'left' }
+                    , { templet: '#xuhao1', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
+                    , { field: 'HMouldID', title: '娌诲叿ID', edit: 'text', hide: true}
+                    , { field: 'HMouldNumber', title: '娌诲叿浠g爜', edit: 'text' }
+                    , { field: 'HMouldName', title: '娌诲叿鍚嶇О', edit: 'text' }
+                    , { field: 'HMouldSpec', title: '瑙勬牸鍨嬪彿', edit: 'text' }
+                ];
+                option2 = {
+                    id: 'mainTable1'
+                    , elem: '#mainTable1'
+                    , toolbar: '#toolbarDemo1'
+                    , defaultToolbar: false  //鏄惁鏄剧ず鍙充晶宸ュ叿鏍�
+                    , page: false
+                    , cellMinWidth: 120
+                    , height: 350
+                    , cols: [columns1]
+                    , done: function (res, curr, count) {
+
+                    }
+                };
+            }
+
+            //鏃犳簮鍗曟柊澧�
+            function set_AddFNew()
+            {
+               //鍔犳簮鍗曠被鍨嬪尯鍒�(鍙互鍐欎笉鍚岀殑鏂规硶)
+                refSav = "Add";
+                //鍒濆鍩烘湰淇℃伅璧嬪��
+                $("#form0")[0].reset();
+                layui.form.render();
+                get_MAXNum();
+                $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //鍗曟嵁鏃ユ湡
+                $("#HWorkReportDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //鎶ュ伐鏃ユ湡
+                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //鍒跺崟鏃ユ湡
+                $("#HMaker").val(sessionStorage["HUserName"]);     //鍒跺崟浜�
+            }
+
+            //鏈夋簮鍗曟柊澧�
+            function set_AddNew() {
+                get_MAXNum();
+                set_SourceAdd();
+                option.data = [];
+                option2.data = [];
+                table.render(option);
+                table.render(option2);
+            }
+
+            //缂栬緫
+            function set_EditFromGrid()
+            {
+                $("#HInterID").val(linterid);//淇敼鏃朵富琛↖D
+                refSav = "Update";
+                $('#HMaterCode').attr("disabled", true);
+                $('#HMaterList').addClass("layui-btn-disabled").attr("disabled", true);
+                $('#HMaterName').attr("disabled", true);
+                $('#HMaterSpec').attr("disabled", true);
+                $('#HBeginDate').attr("disabled", true);
+                $('#HSourceName').attr("disabled", true);
+                $('#HSourceList').addClass("layui-btn-disabled").attr("disabled", true);
+                $('#HMainSourceBillNo').attr("disabled", true);
+                $('#XDHList').addClass("layui-btn-disabled").attr("disabled", true);
+         
+
+                $('#SourceType').attr("disabled", true);
+                form.render('select');
+                $('#HICMOBillNo').attr("disabled", true);
+
+                set_EditForm(linterid);  //缂栬緫鑾峰彇琛ㄥご
+                set_EditGrid(linterid);  //缂栬緫鑾峰彇琛ㄤ綋
+               
+            }
+
+            //缂栬緫鑾峰彇琛ㄥご
+            function set_EditForm(linterid) {
+                //鏌ヨ妫�楠屾柟妗堝崟鏄惁瀛樺湪
+                $.ajax({
+                    url: GetWEBURL() + "Sc_MaterToSourceBill/Sc_MaterToSourceBillListCheckDetai",
+                    type: "GET",
+                    data: {
+                        "HID": linterid
+                    },
+                    success: function (result) {
+                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data.h_v_Sc_MaterToSourceBillMain[0];
+                            form.val("component-form-group", {
+                                "HInterID": data.hmainid
+                                , "HBillNo": data.鍗曟嵁鍙�
+                                , "HDate": formatDate(data.鏃ユ湡)
+                                , "HPlanQty":"0"
+                                , "HICMOBillNo": data.浠诲姟鍗曞彿
+                                , "HICMOInterID": data.HICMOInterID
+                                , "HICMOEntryID": data.HICMOEntryID
+                                , "HProcExchBillNo": data.宸ュ簭娴佽浆鍗″彿
+                                , "HProcExchQty": ""
+                                , "HSourceInterID": data.HMainSourceInterID
+                                , "HSourceEntryID": data.HMainSourceEntryID
+                                , "HSourceBillNo": data.HMainSourceBillNo
+                                , "HSourceBillType": data.HMainSourceBillType
+                                , "HProcName":""
+                                , "HProcID": "0"
+                                , "HMaterCode": data.浜у搧浠g爜
+                                , "HMaterID": data.HMaterID
+                                , "HMaterName": data.浜у搧鍚嶇О
+                                , "HMaterSpec": data.瑙勬牸鍨嬪彿
+                                , "HSourceID": data.HSourceID
+                                , "HSourceName": data.鐢熶骇璧勬簮
+                                , "HGroupName": data.鐢熶骇鐝粍
+                                , "HGroupID": data.HGroupID
+                                , "HWorkerName": data.鎿嶄綔宸�
+                                , "HWorkerID": data.HWorkerID
+                                , "HMaker": data.鍒跺崟浜�                                            //鍒跺崟浜�
+                                , "HMakeDate": formatDate(data.鍒跺崟鏃ユ湡)                           //鍒跺崟鏃ユ湡
+                                , "HUpDater": sessionStorage["HUserName"]                          //淇敼浜�
+                                , "HUpDateDate": Format(new Date(), "yyyy-MM-dd hh:mm:ss")         //淇敼鏃ユ湡
+                                , "HChecker": data.瀹℃牳浜�                                          //瀹℃牳浜�
+                                , "HCheckDate": formatDate(data.瀹℃牳鏃ユ湡)                          //瀹℃牳鏃ユ湡
+                                , "HCloseMan": data.鍏抽棴浜�                                         //鍏抽棴浜�
+                                , "HCloseDate": formatDate(data.鍏抽棴鏃ユ湡)                          //鍏抽棴鏃ユ湡
+                                , "HDeleteMan": data.浣滃簾浜�                                        //浣滃簾浜�
+                                , "HDeleteDate": formatDate(data.浣滃簾鏃ユ湡)                         //浣滃簾鏃ユ湡
+
+                            });
+
+                        } else {
+                            layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                        }
+                    }, error: function () {
+                        layer.alert("鍙戠敓閿欒!", { icon: 5 });
+                    }
+                });
+            }
+
+            // 缂栬緫鑾峰彇琛ㄥご鏃舵椂闂存牸寮忕煫姝f柟寮�
+            function formatDate(date) {
+                var d = new Date(date),
+                    month = '' + (d.getMonth() + 1),
+                    day = '' + d.getDate(),
+                    year = d.getFullYear();
+
+                if (month.length < 2) month = '0' + month;
+                if (day.length < 2) day = '0' + day;
+
+                return [year, month, day].join('-');
+            }
+
+            // 缂栬緫鑾峰彇琛ㄤ綋
+            function set_EditGrid(linterid) {
+                $("#HInterID").val(linterid);//淇敼鏃朵富琛↖D
+                //缂栬緫鍔犺浇鏁版嵁
+                $.ajax({
+                    url: GetWEBURL() + 'Sc_MaterToSourceBill/Sc_MaterToSourceBillListProjectDetai',
+                    type: "GET",
+                    data: { "HInterID": linterid },
+                    success: function (result) {
+                        if (result.count == 1) {
+                            option.data = result.list[0];
+                            table.render(option);
+                            option2.data = result.list[1];
+                            table.render(option2);
+
+                        } else {
+                            layer.alert(result.code + result.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.close(index0);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+            }
+
+            //鏈夋簮鍗曟柊澧�
+            function set_SourceAdd() {
+                refSav = "Add";
+                //鍒濆鍩烘湰淇℃伅璧嬪��
+                $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //鍗曟嵁鏃ユ湡
+                $("#HWorkReportDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //鎶ュ伐鏃ユ湡
+                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //鍒跺崟鏃ユ湡
+                $("#HMaker").val(sessionStorage["HUserName"]);     //鍒跺崟浜�
+
+                //鍔犳簮鍗曠被鍨嬪尯鍒�(鍙互鍐欎笉鍚岀殑鏂规硶)
+                $('#HICMOBillNo').attr("disabled", true);
+                $('#HSourceBillNo').attr("disabled", true);
+                $('#HProcExchBillNo').attr("disabled", true);
+                $('#HProcName').attr("disabled", true);
+                $('#HMaterCode').attr("disabled", true);
+                $('#HMaterList').addClass("layui-btn-disabled").attr("disabled",true);
+                $('#HMaterName').attr("disabled", true);
+                $('#HMaterSpec').attr("disabled", true);
+                $('#HPlanQty').attr("disabled", true);
+                $('#HSourceName').attr("disabled", true);
+                $('#HSourceList').addClass("layui-btn-disabled").attr("disabled", true);
+                $('#HWorkBeginDate').attr("disabled", true);
+                $('#HWorkReportDate').attr("disabled", true);
+
+                $.ajax(
+                    {
+                        type: "GET",
+                        url: GetWEBURL() + "/Sc_MaterToSourceBill/GetMESMaterToSourceFrom", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        async: true,
+                        data: {
+                            "HSourceInterID": HSourceInterID,
+                            "HSourceEntryID": HSourceEntryID,
+                            "HSourceBillNo": HSourceBillNo,
+                            "HSourceBillType": HBillType
+                        },
+                        dataType: "json",
+                        success: function (data) {
+                            if (data.count == 1)// 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            {
+                                var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
+                                $("#HProcID").val(LoadData[0].HProcID); //褰撳墠宸ュ簭ID
+                                $("#HProcName").val(LoadData[0].HProcName); //褰撳墠宸ュ簭
+                                $("#HMaterID").val(LoadData[0].HMaterID); //浜у搧ID
+                                $("#HMaterCode").val(LoadData[0].HMaterNumber); //浜у搧浠g爜
+                                $("#HMaterName").val(LoadData[0].HMaterName); //浜у搧鍚嶇О
+                                $("#HMaterSpec").val(LoadData[0].HModel); //浜у搧瑙勬牸
+                                $("#HSourceID").val(LoadData[0].HSourceID); //鐢熶骇璧勬簮ID
+                                $("#HSourceName").val(LoadData[0].HSourceName); //鐢熶骇璧勬簮
+                                $("#HSourceBillNo").val(LoadData[0].HICMOBillNo); //婧愬崟鍗曞彿锛堟殏鏃跺彇鍊艰鍗曠紪鍙凤級
+                                $("#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); //鐝粍
+                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //鐢熶骇璁㈠崟ID
+                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //鐢熶骇璁㈠崟瀛怚D
+                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //鐢熶骇璁㈠崟鍙�
+                                $("#HWorkBeginDate").val(LoadData[0].HBeginDate); //寮�宸ユ椂闂�
+                                $("#HPlanQty").val(LoadData[0].HDatePlanQty); //璁㈠崟鏁伴噺
+
+                            }
+                            else {
+                                layer.alert(data.Message, { icon: 5 });
+
+                            }
+                        },
+                        error: function (err) {
+                            layer.alert(err, { icon: 5 });
+                        }
+                    });
+            }
+
+            //鑾峰彇鏈�澶у崟鎹彿鍙婇粯璁ゅ�艰祴鍊�
+            function get_MAXNum() {
+                //鑾峰彇鏈�澶у崟鎹彿 new
+                $("#HInterID").val("0");
+                $("#HBillNo").val("");
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    data: { "HBillType": '3786' },
+                    success: function (d) {
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HInterID").val(0);
+                    }
+                });
+            }
+
+            //瀹℃牳鎻愪氦
+            function SaveVerify()
+            {
+                var InterID = $("#HInterID").val();
+                var sSubStr = JSON.stringify(table.cache['mainTable']);
+                var sSubStr1 = JSON.stringify(table.cache['mainTable1']);
+                if (!AllowLoadData(sSubStr, sSubStr1))//鏁版嵁楠岃瘉
+                {
+                    return false;
+                }
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/Sc_MaterToSourceBill/AuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    async: true,
+                    data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
+                    dataType: "json",
+                    success: function (data) {
+                        if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
+                                //layer.close(layer.index);
+                                //window.parent.location.reload();
+                            });
+                        }
+                        else {
+                            layer.alert(data.Message, { icon: 5 })
+                        }
+                    },
+                    error: function (err) {
+                        layer.alert(err, { icon: 5 })
+                    }
+                })
+            }
+
+            //鍙嶅鏍告彁浜�
+            function ReVerIfySaver() {
+                var InterID = $("#HInterID").val();
+                var sSubStr = JSON.stringify(table.cache['mainTable']);
+                var sSubStr1 = JSON.stringify(table.cache['mainTable1']);
+                if (!AllowLoadData(sSubStr, sSubStr1))//鏁版嵁楠岃瘉
+                {
+                    return false;
+                }
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/Sc_MaterToSourceBill/AuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    async: true,
+                    data: { "HInterID": InterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
+                    dataType: "json",
+                    success: function (data) {
+                        if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
+                                //layer.close(layer.index);
+                                //window.parent.location.reload();
+                            });
+                        }
+                        else {
+                            layer.alert(data.Message, { icon: 5 })
+                        }
+                    },
+                    error: function (err) {
+                        layer.alert(err, { icon: 5 })
+                    }
+                })
+            }
+
 
             //鍒犻櫎琛�
             function btnDeleteLine(checkStatus,data) {
@@ -1182,6 +1222,7 @@
                 });
             }
 
+            //#endregion
 
             //浠ヤ笂涓簂ayui妯″潡
         });

--
Gitblit v1.9.1