WebTM/views/Éú²ú¹ÜÀí/Éú²úÍ£¹¤µ¥/Sc_Add_MESStopWorkBillList.html
@@ -88,6 +88,7 @@
                            <div class="layui-btn-group">
                                <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
                                <button type="button" id="VerIfySaver" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="VerIfySaver">审核</button>
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button>
                            </div>
@@ -336,6 +337,7 @@
        var HSourceEntryID = "";  //源单子内码
        var HSourceBillNo = "";   //源单单号
        var HSourceBillType = "";  //源单类型
        var refSav = "";   //提交类型
        //获取页面跳转参数  //单据编辑状态: 1.无源单新增  Â 2.有源单新增  Â 3.编辑  4.浏览  5.变更
        var params = get_UrlVars();
        if (typeof (params[params[0]]) == "undefined") {
@@ -437,6 +439,7 @@
            //有源单新增
            function set_AddNew() {
                refSav = "Add";
                //初始基本信息赋值
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //单据日期
                $("#HStopBeginWorkTime").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"))  //开始时间
@@ -508,6 +511,7 @@
            //编辑
            function set_EditFromGrid() {
                refSav = "Update";
                //加源单类型区分(可以写不同的方法)
                $('#HProcName').attr("disabled", true);
                $('#HMaterCode').attr("disabled", true);
@@ -607,6 +611,7 @@
            //保存提交
            form.on('submit(Saver)', function (data) {
                var sMainStr = JSON.stringify(data.field);
                var sMainSub = sMainStr + ';' + sessionStorage["HUserName"] + ';' + refSav;
                if (!AllowLoadData())//数据验证
                {
                    return false;
@@ -614,14 +619,23 @@
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Sc_MESStopWorkBill/SaveGetMESStopFrom", //方法所在页面和方法名
                    async: true,
                    data: { "msg": sMainStr },
                    async: false,
                    data: { "msg": sMainSub },
                    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();
                            $("#HInterID").val(data.HInterID);//获取提交成功返回的单据主ID
                            layer.confirm(data.Message, {
                                btn: ['确认']
                            }, function (index) {
                                if (data.Verify == "Y") //自动审核
                                {
                                    layer.close(index);
                                    SaveVerify(); //审核
                                }
                                else {
                                    layer.close(index);
                                }
                            });
                        }
                        else {
@@ -634,9 +648,45 @@
                })
            });
            //审核按钮提交
            form.on('submit(VerIfySaver)', function (data) {
                SaveVerify();
            });
            //审核提交
            function SaveVerify() {
                var InterID = $("#HInterID").val();
                if (!AllowLoadData())//数据验证
                {
                    return false;
                }
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Sc_MESStopWorkBill/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 })
                    }
                })
            }
            //退出
            form.on('submit(Exit)', function (data) {
                Pub_Close(1);
                window.parent.location.reload();
            });