yangle
2024-09-25 badb75b05113a648326a4be376cd1d2fda55e26f
WebTM/views/É豸¹ÜÀí/Sb_EquipConkBookBill_PDA.html
@@ -83,7 +83,7 @@
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>故障类别</th>
                                            <th>故障类别<span style="color:red">*</span></th>
                                            <td class="bz_td">
                                                <input type="text" name="HConkTypeName" class="layui-input" id="HConkTypeName" placeholder="选择故障类别" style="background-color:#efefef4d;">
                                                <input type="hidden" name="HConkTypeID" id="HConkTypeID" value="0" autocomplete="off" class="layui-input">
@@ -91,7 +91,7 @@
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>故障原因</th>
                                            <th>故障原因<span style="color:red">*</span></th>
                                            <td class="bz_td">
                                                <input type="text" name="HConkReasonName" class="layui-input" id="HConkReasonName" placeholder="选择故障原因" style="background-color:#efefef4d;">
                                                <input type="hidden" name="HConkReasonID" id="HConkReasonID" value="0" autocomplete="off" class="layui-input">
@@ -118,7 +118,7 @@
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>部门</th>
                                            <th>部门<span style="color:red">*</span></th>
                                            <td class="bz_td">
                                                <input type="text" name="HDeptName" class="layui-input" id="HDeptName" placeholder="选择部门" style="background-color:#efefef4d;">
                                                <input type="hidden" name="HDeptID" id="HDeptID" value="0" autocomplete="off" class="layui-input">
@@ -126,7 +126,7 @@
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>发现人</th>
                                            <th>发现人<span style="color:red">*</span></th>
                                            <td class="bz_td">
                                                <input type="text" name="HEmpName" class="layui-input" id="HEmpName" placeholder="选择发现人" style="background-color:#efefef4d;">
                                                <input type="hidden" name="HEmpID" id="HEmpID" value="0" autocomplete="off" class="layui-input">
@@ -134,7 +134,7 @@
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>负责人</th>
                                            <th>负责人<span style="color:red">*</span></th>
                                            <td class="bz_td">
                                                <input type="text" name="HManagerName" class="layui-input" id="HManagerName" placeholder="选择负责人" style="background-color:#efefef4d;">
                                                <input type="hidden" name="HManagerID" id="HManagerID" value="0" autocomplete="off" class="layui-input">
@@ -375,53 +375,11 @@
                GetMeesageByBarCode();
            });
            //条形码回车方法
            $('#HBarCode').on('keydown', function (event) {
                var HBarCode = $('#HBarCode').val();
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg("条形码不能为空!")
                        return;
                    }
                    var index = layer.load();
                    $.ajax({
                        url: GetWEBURL() + "/Sb_PDA_EqpRepairWorkBill/txtHBarCode_KeyDown",
                        type: "GET",
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) {
                                var data = result.data[0];
                                form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                    "HEquipID": data.HInterID,
                                    "HBarName": data.HName,
                                    "HBarSpec": data.HModel,
                                    "HBarModel": data.HModel2,
                                    "HQty": "1"
                                });
                                $("#HBarCode").attr("readonly", "readonly");//条形码只读
                                $("#HBarCode").css("background-color", "#efefef4d");
                                HProcExchBillNoFlag = true;
                                layer.close(index);
                            }
                            else {
                                layer.close(index);
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                        },
                        error: function (err) {
                            layer.close(index);
                            layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    });
                }
            });
            //退出-关闭页面方法
            $('#Cancel').on('click', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../views/index_Mobile.html";
                    parent.location.href = "../../views/index_Mobile.html";
                });
            })
@@ -456,7 +414,6 @@
                            }
                        },
                        error: function (err) {
                            layer.close(index);
                            layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    });
@@ -466,40 +423,43 @@
            //新增
            form.on('submit(Add)', function (data) {
                $('#Saver').addClass("buttom_box_little");
                $('#Saver').addClass("layui-btn-disabled").attr("disabled", false);
                $("#HBarCode").removeAttr("readonly");//条形码清除只读
                $("#HBarCode").removeAttr("background-color");//条形码清除背景色
                layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
                    $('#Saver').addClass("buttom_box_little");
                    $('#Saver').addClass("layui-btn-disabled").attr("disabled", false);
                    $("#HBarCode").removeAttr("readonly");//条形码清除只读
                    $("#HBarCode").removeAttr("background-color");//条形码清除背景色
                // æ¸…空表单 ï¼ˆâ€œformData”是表单的id)
                $("#formData")[0].reset();
                layui.form.render();
                option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "" }];
                table.render(option);
                    // æ¸…空表单 ï¼ˆâ€œformData”是表单的id)
                    $("#formData")[0].reset();
                    layui.form.render();
                    option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "" }];
                    table.render(option);
                $("#HBarCode").focus();
                //获取最大单据号
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3907' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val("0");
                        $("#HBillNo").val(d.data[0].HBillNo);
                    }
                });
                $("#HConkBeginDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //维修开始时间
                $("#HRepairEndDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));    //维修结束时间
                $("#HDate").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"]);     //创建人
                    $("#HBarCode").focus();
                    //获取最大单据号
                    $.ajax({
                        url: GetWEBURL() + "/Web/GetMAXNum",
                        type: "GET",
                        data: { "HBillType": '3907' },
                        success: function (d) {
                            //console.log(d.data);
                            $("#HInterID").val("0");
                            $("#HBillNo").val(d.data[0].HBillNo);
                        }
                    });
                    $("#HConkBeginDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //维修开始时间
                    $("#HRepairEndDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));    //维修结束时间
                    $("#HDate").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"]);     //创建人
                    layer.close(index);
                });
            })
            //#region é€€å‡ºæŒ‰é’®
            form.on('submit(Cancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../views/index_Mobile.html";
                    parent.location.href = "../../views/index_Mobile.html";
                });
            })
            //#endregion
@@ -896,7 +856,19 @@
                    layer.msg("故障类别没有选择!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HConkReasonID").val() == 0) {
                    layer.msg("故障原因没有选择!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HDeptID").val() == 0) {
                    layer.msg("部门没有选择!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HEmpID").val() == 0) {
                    layer.msg("发现人没有选择!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if (typeof (sSubStr) == "undefined" || sSubStr == "" || sSubStr == "[]") {
                    layer.msg("没有设备明细记录", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
@@ -928,18 +900,18 @@
                }
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Sb_PDA_EqpRepairWorkBill/txtHBarCode_KeyDown",
                    url: GetWEBURL() + "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_List",
                    type: "GET",
                    data: { "HBarCode": HBarCode },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data[0];
                            $("#HEquipID").val(data.HInterID);
                            $("#HBarName").val(data.HName);
                            $("#HBarSpec").val(data.HModel);
                            $("#HBarModel").val(data.HModel2);
                            $("#HEquipID").val(data.hmainid);
                            $("#HBarName").val(data.设备名称);
                            $("#HBarSpec").val(data.设备规格);
                            $("#HBarModel").val(data.设备型号);
                            $("#HManagerID").val(data.HRepairEmpID);
                            $("#HManagerName").val(data.负责人);
                            $("#HManagerName").val(data.维护负责人);
                            $("#HQty").val(1);
                            $("#HBarCode").attr("readonly", "readonly");//条形码只读
                            $("#HBarCode").css("background-color", "#efefef4d");
@@ -948,11 +920,13 @@
                            layer.close(index);
                        }
                        else {
                            $("#HBarCode").val("");
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        $("#HBarCode").val("");
                        layer.close(index);
                        layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }