1
duhe
2024-03-06 9752930859075dc5eb490151b7c9e16100dc51a8
WebTM/views/É豸¹ÜÀí/Sb_EqpMaintenanceBill_PDA.html
@@ -116,7 +116,7 @@
                    <div class="layui-form-item" style="margin: 1% 2%;text-align: right;">
                        <button type="button" lay-submit="" lay-filter="Add" class="layui-btn layui-btn-radius">新增</button>
                        <!--<button type="button" lay-submit="" lay-filter="" class="layui-btn layui-btn-radius">清空</button>-->
                        <button type="button" lay-submit="" lay-filter="Saver" class="layui-btn layui-btn-radius">保存</button>
                        <button type="button" lay-submit="" lay-filter="Saver" id="Saver" class="layui-btn layui-btn-radius">保存</button>
                        <button type="button" lay-submit="" lay-filter="Cancel" class="layui-btn layui-btn-radius layui-btn-danger">退出</button>
                    </div>
                    <div class="layui-tab layui-tab-card" lay-filter="TabTest">
@@ -192,7 +192,17 @@
                                                <textarea name="HExplanation" id="HExplanation" placeholder="请输入内容" class="layui-textarea"></textarea>
                                            </td>
                                        </tr>
                                        <tr style="display:none;">
                                        <tr>
                                            <th>源单类型</th>
                                            <td class="bz_td">
                                                <select name="HMainSourceBillType" lay-filter="HMainSourceBillType" id="HMainSourceBillType">
                                                    <option value="设备维修登记单" selected="selected">设备维修登记单</option>
                                                    <option value="手工录入">手工录入</option>
                                                    <option value="设备维修派工单">设备维修派工单</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>故障登记单</th>
                                            <td class="bz_td">
                                                <input type="text" name="HMainSourceBillNo" class="layui-input" id="HMainSourceBillNo" placeholder="选择故障登记单" style="background-color:#efefef4d;">
@@ -216,6 +226,15 @@
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>时间单位</th>
                                            <td class="bz_td">
                                                <select name="HCycleUnit" lay-filter="aihao" id="HCycleUnit" style="border-radius: 50px;">
                                                    <option value="小时">小时</option>
                                                    <option value="天">天</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>设备名称</th>
                                            <td class="bz_td">
                                                <input type="text" name="HBarName" class="layui-input LineHeight" id="HBarName" style="border-radius: 50px;background-color:#EDEDED;" readonly>
@@ -233,7 +252,7 @@
                                            <td class="bz_td">
                                                <input type="text" name="HBarModel" class="layui-input LineHeight" id="HBarModel" style="border-radius: 50px;background-color:#EDEDED;" readonly>
                                            </td>
                                        </tr>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
@@ -334,7 +353,7 @@
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                ,laydate = layui.laydate
                , laydate = layui.laydate
                , element = layui.element;
            //#region æ—¥æœŸæ—¶é—´é€‰æ‹©å™¨
@@ -385,7 +404,7 @@
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HExplanation": "", "HRemark": ""};
                var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HEmpID": 0, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "" };
                switch (obj.event) {
                    //新增一行
                    case 'btn-AddLine': btnAddLine(NewRow);
@@ -411,15 +430,15 @@
            $("#HDeptID").val(sessionStorage["HDeptID"]);               //部门ID
            $("#HDeptName").val(sessionStorage["HDept"]);               //部门
            //$("#HEmpID").val(sessionStorage["HBillerID"]);              //维修人ID
            //$("#HEmpName").val(sessionStorage["HUserName"]);            //维修人
            $("#HEmpID").val(sessionStorage["HKeeperID"]);              //维修人ID
            $("#HEmpName").val(sessionStorage["HKeeper"]);            //维修人
            $("#HManagerID").val(sessionStorage["HManagerID"]);         //责任人ID
            $("#HManagerName").val(sessionStorage["HManagerName"]);     //责任人
            $("#HMaker").val(sessionStorage["HUserName"]);     //创建人
            //模治具条码是否扫描标记
            var HProcExchBillNoFlag = false;
            //条形码回车方法
            $('#HBarCode').on('keydown', function (event) {
@@ -484,12 +503,17 @@
            //提交
            form.on('submit(Saver)', function (data) {//提交
                option.data = [{ "HRepairID": $("#HRepairID").val(), "HRepairCode": "", "HRepairName": "", "HManagerID": $("#HManagerID").val(), "HManagerCode": "", "HManagerName": "", "HRepairExplanation": $("#HExplanation").val(), "HRemark": "", "HEmpID": $("#HEmpID").val(), "HSourceInterID": $("#HMainSourceInterID").val(), "HSourceEntryID": $("#HMainSourceEntryID").val(), "HSourceBillNo": $("#HMainSourceBillNo").val()  }];
                table.render(option);
                //var tableData = data.field;
                data.field.HMaker = sessionStorage["HUserName"];//制单人
                var oMain = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = oMain + ';' + sSubStr;
                if (AllowLoadData(sSubStr)) {
                    $('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//保存按钮禁用
                    $.ajax({
                        type: "POST",
                        url: GetWEBURL() + "/Sb_PDA_EqpRepairWorkBill/SaveGetEqpRepairWorkBillList",
@@ -503,7 +527,7 @@
                                $('#Saver').addClass("layui-btn-disabled").attr("disabled", true);
                            }
                            else {
                                layer.close(index);
                                $('#Saver').removeClass("layui-btn-disabled").attr("disabled", false);//保存按钮启用
                                layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                        },
@@ -526,7 +550,7 @@
                // æ¸…空表单 ï¼ˆâ€œformData”是表单的id)
                $("#formData")[0].reset();
                layui.form.render();
                option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HExplanation": "", "HRemark": "" }];
                option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": $("#HManagerID").val(), "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": $("#HRemark").val(), "HEmpID": 0, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "" }];
                table.render(option);
                $("#HBarCode").focus();
@@ -548,7 +572,7 @@
                $("#HMaker").val(sessionStorage["HUserName"]);     //创建人
            })
             //#region é€€å‡ºæŒ‰é’®
            //#region é€€å‡ºæŒ‰é’®
            form.on('submit(Cancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    Pub_Close(2);
@@ -754,8 +778,12 @@
                    , { field: 'HManagerID', title: 'HManagerID', edit: 'text', hide: true }
                    , { field: 'HManagerCode', title: '负责人代码', edit: 'text', event: "HManagerCode" }
                    , { field: 'HManagerName', title: '负责人', edit: 'text' }
                    , { field: 'HExplanation', title: '维修要求', edit: 'text' }
                    , { field: 'HRepairExplanation', title: '维修要求', edit: 'text' }
                    , { field: 'HRemark', title: '备注', event: "", edit: 'text' }
                    , { field: 'HEmpID', title: 'HEmpID', edit: 'text', hide: true }
                    , { field: 'HSourceInterID', title: '源单内码', edit: 'text', hide: true }
                    , { field: 'HSourceEntryID', title: '源单子内码', edit: 'text', hide: true }
                    , { field: 'HSourceBillNo', title: '源单单号', edit: 'text', hide: true }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 150 }
                ];
                option = {
@@ -772,7 +800,7 @@
                    }
                };
                option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HExplanation": "", "HRemark": "" }];
                option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HEmpID": 0, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "" }];
                table.render(option);
            }
            //增加一行
@@ -864,6 +892,11 @@
            }
            //非空验证
            function AllowLoadData(sSubStr) {
                if ($("#HManagerID").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;
@@ -901,10 +934,16 @@
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data[0];
                            $("#HEquipID").val(data.HItemID);
                            $("#HEquipID").val(data.HInterID);
                            $("#HBarName").val(data.HName);
                            $("#HBarSpec").val(data.HModel);
                            $("#HBarModel").val(data.HModel2);
                            $("#HManagerID").val(data.HRepairEmpID);
                            $("#HManagerName").val(data.负责人);
                            $("#HMainSourceBillNo").val(data.故障登记单);
                            $("#HMainSourceInterID").val(data.故障登记单ID);
                            $("#HMainSourceEntryID").val(data.故障登记单子ID);
                            $("#HQty").val(1);
                            $("#HBarCode").attr("readonly", "readonly");//条形码只读
                            $("#HBarCode").css("background-color", "#efefef4d");