yangle
2022-12-29 ad34837d286cf0bca0801b40ea6ca8ba99d4cb36
设备点检计划 记录  设备保养记录单
5个文件已修改
244 ■■■■ 已修改文件
WebTM/views/设备管理/Sb_EquipDotCheckBillEdit.html 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/设备管理/Sb_EquipDotCheckBillList.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/设备管理/Sb_EquipDotCheckPlanBillEdit.html 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/设备管理/Sb_EquipMaintainBillEdit.html 96 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/设备管理/Sb_EquipMaintainBillList.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/É豸¹ÜÀí/Sb_EquipDotCheckBillEdit.html
@@ -391,27 +391,61 @@
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        if (checkStatus.data.length != 1) {
                            return layer.msg('请选择一条数据');
                        }
                        $("#HPlanName").val(checkStatus.data[0].单据号);
                        $("#HPlanNo").val(checkStatus.data[0].hmainid);
                        $("#HEquipName").val(checkStatus.data[0].设备名称);
                        $("#HEquipID").val(checkStatus.data[0].设备ID);
                        get_DocCheckItem();
                        layer.close(layer.index);  //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                        $("#HEquipDotCheckRuleInterID").val(checkStatus.data[0].HMouldDotCheckRuleID);
                        $("#HEquipDotCheckRuleInterNo").val(checkStatus.data[0].设备点检规程);
                        layer.close(index);  //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        get_DocCheckItem3();
                    }
                });
            });
            function get_DocCheckItem3() {
                $.ajax({
                    url: GetWEBURL() + "/Sb_EquipDotCheckPlanBill/Sb_EquipDotCheckPlanBillListProjectDetai",
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + $("#HPlanNo").val()},
                    success: function (result) {
                        if (result != null) {
                            if (result.count == 1) {
                                var BYData = result;//
                                var rowdate1 = layui.table.cache["mainTable"];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " " }];
                                table.render(option);
                                if (BYData.data.length != 0)  //表体数据为空时
                                {
                                    buttonArr = [];//清空数组
                                    for (var i = 0; i < BYData.data.length; i++) {
                                        var checkrow = {
                                            "HDotCheckItemID": BYData.data[i].HDotCheckItemID, "HDotCheckCode": BYData.data[i].HDotCheckCode, "HDotCheckItem": BYData.data[i].HDotCheckItem,
                                            "HDotCheckPart": BYData.data[i].HDotCheckPart, "HClaim": BYData.data[i].HClaim, "HManagerID": BYData.data[i].HManagerID, "HManagerCode": BYData.data[i].HManagerCode,
                                            "HManagerCode": BYData.data[i].HManagerCode, "HManagerName": BYData.data[i].HManagerName, "HRemark": BYData.data[i].HRemark
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
                                    table.reload("mainTable", {
                                        data: buttonArr    //将数据重新载入表格
                                    })
                                }
                            }
                            else {
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
                                table.render(option);
                                layer.alert("该设备暂无默认点检记录", { icon: 5 });
                            }
                        }
                    }
                })
            }
            // æäº¤ä¿å­˜
            form.on('submit(set_SaveBill)', function (data) {//保存
                //debugger;
WebTM/views/É豸¹ÜÀí/Sb_EquipDotCheckBillList.html
@@ -302,7 +302,7 @@
                                , toolbar: '#toolbarDemo'
                                , cols: [col]
                                , data: data1.data
                                , height: 550
                                , height: 800
                                , page: true
                                , cellMinWidth: 90
                                , limit: 50
WebTM/views/É豸¹ÜÀí/Sb_EquipDotCheckPlanBillEdit.html
@@ -105,6 +105,16 @@
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width:95px;">器具点检规程<label style="color:red"> * </label></label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HMouldDotCheckRuleName" id="HMouldDotCheckRuleName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HMouldDotCheckRuleID" id="HMouldDotCheckRuleID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="btnHMouldDotCheckRule" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">摘要</label>
                                                <div class="layui-input-inline">
                                                    <textarea placeholder="请输入摘要" class="layui-textarea" name="HExplanation" id="HExplanation"></textarea>
@@ -303,6 +313,36 @@
                    }
                });
            });
            //表头设备点检规程信息
            form.on('submit(btnHMouldDotCheckRule)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '设备点检规程列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../设备管理/设备规程单/Sb_EquipDotCheckRuleList.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        console.log(checkStatus);
                        $("#HMouldDotCheckRuleName").val(checkStatus.data[0].单据号);
                        $("#HMouldDotCheckRuleID").val(checkStatus.data[0].hmainid);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        get_DocCheckItem2(checkStatus.data[0].hmainid);
                    }
                });
            });
            //#endregion
@@ -384,6 +424,46 @@
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
                table.render(option);
            }
            // ç‚¹æ£€ä¿¡æ¯
            function get_DocCheckItem2(data) {
                $.ajax({
                    url: GetWEBURL() + "/Sb_EquipDotCheckRuleBill/Sb_EquipDotCheckRuleBillListProjectDetai",
                    type: "GET",
                    async: false,
                    data: { "sqlWhere": "and hmainid=" + data  },
                    success: function (result) {
                        if (result != null) {
                            if (result.count == 1) {
                                var BYData = result.data;//点检
                                var rowdate1 = layui.table.cache["mainTable"];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
                                table.render(option);
                                if (BYData.length != 0)  //表体数据不为空时
                                {
                                    buttonArr = [];//清空数组
                                    for (var i = 0; i < BYData.length; i++) {
                                        var checkrow = {
                                            "HDotCheckItemID": BYData[i].HDotCheckItemID, "HDotCheckCode": BYData[i].点检项目代码, "HDotCheckItem": BYData[i].HDotCheckItem, "HDotCheckPart": BYData[i].HDotCheckPart,
                                            "HClaim": BYData[i].HClaim, "HManagerID": BYData[i].HManagerID, "HManagerCode": BYData[i].HManagerNumber,
                                            "HManagerName": BYData[i].HManagerName, "HRemark": BYData[i].HRemark
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
                                    table.reload("mainTable", {
                                        data: buttonArr    //将数据重新载入表格
                                    })
                                }
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }
                    }
                })
            }
            //编辑加载表头
            function set_EditForm(linterid) {
                //查询检验方案单是否存在
@@ -410,6 +490,8 @@
                                , "HEndDate": data.结束日期
                                , "HExplanation": data.摘要
                                , "HRemark": data.表头备注
                                , "HMouldDotCheckRuleID": data.HMouldDotCheckRuleID
                                , "HMouldDotCheckRuleName": data.设备点检规程
                            });
                        } else {
WebTM/views/É豸¹ÜÀí/Sb_EquipMaintainBillEdit.html
@@ -100,7 +100,7 @@
                                            <div class="layui-inline">
                                                <label class="layui-form-label">设备保养规程<label style="color:red"> * </label></label>
                                                <div class="layui-input-inline">
                                                    <input type="hidden" name="HEquipMaintainRuleInterID" id="HEquipMaintainRuleInterID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HEquipMaintainRuleInterID" id="HEquipMaintainRuleInterID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <input type="text" name="HEquipMaintainRuleInterNo" id="HEquipMaintainRuleInterNo" class="layui-input" value="" style="float:left;width:150px;background-color:#efefef4d;" readonly="readonly">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HEquipMaintainRuleInterList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
@@ -252,7 +252,7 @@
            table.on('toolbar(mainTable1)', function (obj) {
                var checkStatus = table.checkStatus('mainTable1')
                    , data = checkStatus.data;
                var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" };
                var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" };
                switch (obj.event) {
                    //新增一行
                    case 'btn-AddLine1': btnAddLine1(NewRow);
@@ -321,7 +321,7 @@
                                var rowdate1 = layui.table.cache["mainTable"];
                                var rowdate2 = layui.table.cache["mainTable1"];
                                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
                                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }];
                                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }];
                                table.render(option);
                                table.render(option1);
                                $("#HEquipMaintainRuleInterID").val(BYData[0].HInterID);
@@ -352,7 +352,6 @@
                                            "HMaterID": PJData[i].HMaterID, "HMaterNumber": PJData[i].HMaterNumber, "HMaterName": PJData[i].HMaterName,
                                            "HUnitID": PJData[i].HUnitID, "HUnitNumber": PJData[i].HUnitNumber,
                                            "HUnitName": PJData[i].HUnitName, "HQty": PJData[i].HQty,
                                            "HManagerID": rowdate2[i].HManagerID, "HManagerNumber": rowdate2[i].HManagerNumber, "HManagerName": rowdate2[i].HManagerName,
                                            "HRemark": rowdate2[i].HRemark
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
@@ -405,6 +404,7 @@
                    }
                });
            });
            //选择保养规程的时候带出数据
            function get_MaintainItem2() {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMaintainItemtemByMaintainRuleID",
@@ -418,7 +418,7 @@
                                var rowdate1 = layui.table.cache["mainTable"];
                                var rowdate2 = layui.table.cache["mainTable1"];
                                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
                                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }];
                                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }];
                                table.render(option);
                                table.render(option1);
@@ -448,8 +448,69 @@
                                            "HMaterID": PJData[i].HMaterID, "HMaterNumber": PJData[i].HMaterNumber, "HMaterName": PJData[i].HMaterName,
                                            "HUnitID": PJData[i].HUnitID, "HUnitNumber": PJData[i].HUnitNumber,
                                            "HUnitName": PJData[i].HUnitName, "HQty": PJData[i].HQty,
                                            "HManagerID": rowdate2[i].HManagerID, "HManagerNumber": rowdate2[i].HManagerNumber, "HManagerName": rowdate2[i].HManagerName,
                                            "HRemark": rowdate2[i].HRemark
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
                                    table.reload("mainTable1", {
                                        data: buttonArr    //将数据重新载入表格
                                    })
                                }
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }
                    }
                })
            }
            //选择保养计划源单的时候带出数据
            function get_MaintainItem3() {
                $.ajax({
                    url: GetWEBURL() + "/Sb_EquipMaintainPlanBill/Sb_EquipMaintainPlanBillListProjectDetaiNew",
                    type: "GET",
                    async: false,
                    data: { "HInterID": $("#HPlanNo").val() },
                    success: function (result) {
                        if (result != null) {
                            if (result.count == 1) {
                                var BYData = result.list[0];//保养
                                var PJData = result.list[1];//配件
                                var rowdate1 = layui.table.cache["mainTable"];
                                var rowdate2 = layui.table.cache["mainTable1"];
                                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
                                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }];
                                table.render(option);
                                table.render(option1);
                                if (BYData.length != 0)  //表体数据为空时
                                {
                                    buttonArr = [];//清空数组
                                    for (var i = 0; i < BYData.length; i++) {
                                        var checkrow = {
                                            "HMaintainItemID": BYData[i].HMaintainItemID, "HMaintainItemNumber": BYData[i].HMaintainItemNumber, "HMaintainItem": BYData[i].HMaintainItem,
                                            "HMaintainPart": BYData[i].HMaintainPart, "HManagerID": BYData[i].HManagerID, "HManagerNumber": BYData[i].HManagerNumber,
                                            "HManagerName": BYData[i].HManagerName, "HClaim": BYData[i].HClaim, "HRemark": BYData[i].HRemark
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
                                    table.reload("mainTable", {
                                        data: buttonArr    //将数据重新载入表格
                                    })
                                }
                                if (PJData.length != 0)  //表体数据为空时
                                {
                                    buttonArr = [];//清空数组
                                    for (var i = 0; i < PJData.length; i++) {
                                        var checkrow = {
                                            "HMaterID": PJData[i].HMaterID, "HMaterNumber": PJData[i].HMaterNumber, "HMaterName": PJData[i].HMaterName,
                                            "HUnitID": PJData[i].HUnitID, "HUnitNumber": PJData[i].HUnitNumber,
                                            "HUnitName": PJData[i].HUnitName, "HQty": PJData[i].HQty,
                                            "HRemark": PJData[i].HRemark
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
@@ -490,16 +551,11 @@
                        $("#HPlanNo").val(checkStatus.data[0].hmainid);
                        $("#HEquipName").val(checkStatus.data[0].设备名称);
                        $("#HEquipID").val(checkStatus.data[0].HEquipID);
                        get_MaintainItem();
                        $("#HEquipMaintainRuleInterID").val(checkStatus.data[0].HMouldMaintainRuleID);
                        $("#HEquipMaintainRuleInterNo").val(checkStatus.data[0].保养规程);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                        get_MaintainItem3();
                    }
                });
            });
@@ -650,9 +706,9 @@
                    , { field: 'HUnitID', title: '单位ID', edit: 'text', hide: true }
                    , { field: 'HUnitNumber', title: '单位代码', edit: 'text', event: "HUnitCode" }
                    , { field: 'HUnitName', title: '单位名称', edit: 'text', event: "" }
                    , { field: 'HManagerID', title: '负责人ID', edit: 'text', hide: true }
                    , { field: 'HManagerNumber', title: '负责人代码', edit: 'text', event: 'HManagerNumber' }
                    , { field: 'HManagerName', title: '负责人', edit: 'text' }
                    //, { field: 'HManagerID', title: '负责人ID', edit: 'text', hide: true }
                    //, { field: 'HManagerNumber', title: '负责人代码', edit: 'text', event: 'HManagerNumber' }
                    //, { field: 'HManagerName', title: '负责人', edit: 'text' }
                    , { field: 'HQty', title: '用量', edit: 'text' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 150 }
@@ -677,7 +733,7 @@
                //获取最大单据号
                get_MAXNum();
                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }];
                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }];
                table.render(option);
                table.render(option1);
            }
@@ -707,7 +763,7 @@
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
                table.render(option);
                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }];
                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }];
                table.render(option1);
            }
            //编辑获取表头
WebTM/views/É豸¹ÜÀí/Sb_EquipMaintainBillList.html
@@ -375,9 +375,9 @@
                        , { field: 'HUnitID', title: '单位ID', width: 200, hide: true }
                        , { field: 'HUnitNumber', title: '单位代码', width: 200 }
                        , { field: 'HUnitName', title: '单位名称', width: 200 }
                        , { field: 'HManagerID', title: '负责人ID', width: 200, hide: true }
                        , { field: 'HManagerNumber', title: '负责人代码', width: 200 }
                        , { field: 'HManagerName', title: '负责人', width: 200 }
                        //, { field: 'HManagerID', title: '负责人ID', width: 200, hide: true }
                        //, { field: 'HManagerNumber', title: '负责人代码', width: 200 }
                        //, { field: 'HManagerName', title: '负责人', width: 200 }
                        , { field: 'HQty', title: '实际用量', width: 200 }
                        , { field: 'HQtyMust', title: '标准用量', width: 200 }
                        , { field: 'HRemark', title: '备注', width: 200 }