1
duhe
2024-05-06 dc28e591aa32164c957a8e401ee6c5bdebc53384
WebTM/views/ÖÊÁ¿¹ÜÀí/»ù´¡½¨Ä£/Add_Edit_Gy_ErrMsgBackType.html
@@ -33,14 +33,14 @@
                                    <div class="layui-tab-item layui-show">
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 120px">代码:</label>
                                                <label class="layui-form-label" style="width: 120px">代码<label style="color:red"> * </label></label>
                                                <div class="layui-input-inline">
                                                    <input class="layui-input" name="HNumber" lay-verify="HNumber" id="HNumber" autocomplete="off">
                                                    <input name="HItemID" id="HItemID" autocomplete="off" type="hidden">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 120px">名称:</label>
                                                <label class="layui-form-label" style="width: 120px">名称<label style="color:red"> * </label></label>
                                                <div class="layui-input-inline">
                                                    <input class="layui-input" name="HName" id="HName" autocomplete="off">
                                                </div>
@@ -144,35 +144,36 @@
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //保存
            form.on('submit(Saver)', function (data) {//保存
                if (AllowLoadData()) {
                    var isEndCheck = document.getElementById("HStopflag").checked;
                    isEndCheck == true ? data.field.HStopflag = 'true' : data.field.HStopflag = 'false';//将数组合并成字符串
                var isEndCheck = document.getElementById("HStopflag").checked;
                isEndCheck == true ? data.field.HStopflag = 'true' : data.field.HStopflag = 'false';//将数组合并成字符串
                    var sMainStr = JSON.stringify(data.field) + ";" + sessionStorage["HUserName"];
                    $.ajax(
                        {
                            type: "POST",
                            url: GetWEBURL() + "SaveGy_ErrMsgBackType", //方法所在页面和方法名
                            async: true,
                            data: { "msg": sMainStr },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                    layer.msg(data.Message, { icon: 1 });
                                    $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                }
                                else {
                                    f_alert(data.Message);
                                    console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                                }
                                layer.closeAll("loading");
                            },
                            error: function (err) {
                var sMainStr = JSON.stringify(data.field) + ";" + sessionStorage["HUserName"];
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "SaveGy_ErrMsgBackType", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainStr },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { icon: 1 });
                                $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                f_alert("错误:" + err);
                                console.log("Reason" + sMainStr);
                            }
                            else {
                                f_alert(data.Message);
                                console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                            console.log("Reason" + sMainStr);
                        }
                    });
                        });
                }
            });
            //退出
            form.on('submit(Exit)', function (data) {//
@@ -231,12 +232,12 @@
                            $("#HNumber").val(data.异常反馈类型代码);//代码
                            $("#HName").val(data.异常反馈类型名称);//名称
                            $("#HHelpCode").val(data.助记码);//助记码
                            $("#HUSEORGID").val(data.创建组织);//使用组织
                            $("#HUSEORGID").val(data.HUSEORGID);//使用组织
                            $("#HUseFlag ").val(data.使用状态);//使用状态
                            $("#HRemark").val(data.备注);//备注
                            $("input[name='HStopflag']").attr("checked", data.禁用标志 == "是" ? true : false);//true:选中 false:不选中
                            layui.form.render();//实时渲染选中和不选中的样式,最好添加这句话
                            form.render("select");
                        } else {
                            layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
@@ -246,6 +247,22 @@
                });
            }
            //数据验证
            function AllowLoadData() {
                var HNumber = $("#HNumber").val() //代码
                var HName = $("#HName").val() //名称
                if (HNumber == null || HNumber == undefined || HNumber == "") {
                    layer.msg("请输入代码!", { icon: 5 });
                    return false;
                }
                if (HName == null || HName == undefined || HName == "") {
                    layer.msg("请输入名称!", { icon: 5 });
                    return false;
                }
                return true;
            }
            //
            function f_alert(sMsg) {
                layer.alert(sMsg, { icon: 5 });