1
yangle
2024-05-13 1c6a4c87cc53dfe72d4af0cff53e627d406589eb
WebTM/views/É豸¹ÜÀí/Sb_EquipDotCheckBillEdit.html
@@ -13,15 +13,24 @@
    <script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/PageTitle.js"></script>
    <script src="../../layuiadmin/PageTitle.js"></script>
    <style type="text/css">
        .layui-form-label {
            width: 95px;
        }
        /* é˜²æ­¢ä¸‹æ‹‰æ¡†çš„下拉列表被隐藏---必须设置--- */
        .layui-table-cell {
            overflow: visible !important;
        }
        /* ä½¿å¾—下拉框与单元格刚好合适 */
        td .layui-form-select {
            margin-top: -10px;
            margin-left: -15px;
            margin-right: -15px;
        }
    </style>
</head>
<body>
    <div id="layout1" class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
@@ -29,13 +38,9 @@
                    <form id="form0" class="layui-form" lay-filter="component-form-group" action="">
                        <div class="layui-card-header">
                            <div class="layui-btn-group">
                                <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_SaveBill">保存</button>
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Cancel">退出</button>
                            </div>
                        </div>
                        <div class="layui-card-body">
                            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
@@ -50,7 +55,7 @@
                                            <div class="layui-inline">
                                                <label class="layui-form-label">单据号</label>
                                                <div class="layui-input-inline">
                                                    <input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo"  style="background-color:#efefef4d;" readonly>
                                                    <input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                    <input id="HInterID" name="HInterID" type="hidden" />
                                                    <input id="HMaker" name="HMaker" type="hidden" /><!--制单人-->
                                                </div>
@@ -71,7 +76,7 @@
                                                <label class="layui-form-label">设备<label style="color:red"> * </label></label>
                                                <div class="layui-input-inline">
                                                    <input type="hidden" name="HEquipID" id="HEquipID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="text" name="HEquipName" id="HEquipName" class="layui-input" value="" style="float:left;width:150px;background-color:#efefef4d;"readonly="readonly">
                                                    <input type="text" name="HEquipName" id="HEquipName" class="layui-input" value="" style="float:left;width:150px;background-color:#efefef4d;" readonly="readonly">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="ProductModulList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
@@ -117,6 +122,36 @@
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">异常情况记录</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HErrNote" id="HErrNote" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">重大安全<br />隐患记录</label>
                                                <div class="layui-input-inline" style="margin-top:10px;">
                                                    <input type="text" name="HBigSafeNote" id="HBigSafeNote" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">点检数据</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HDotCheckNote" id="HDotCheckNote" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">生产班次</label>
                                                <div class="layui-input-inline">
                                                    <input type="hidden" name="HShiftsID" id="HShiftsID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <input type="text" name="HShiftsName" id="HShiftsName" class="layui-input" value="" style="float:left;width:150px;background-color:#efefef4d;" readonly="readonly">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="btnHShifts" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <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>
@@ -126,6 +161,13 @@
                                                <label class="layui-form-label">备注</label>
                                                <div class="layui-input-inline">
                                                    <textarea placeholder="请输入备注" class="layui-textarea" name="HRemark" id="HRemark"></textarea>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">最终结论</label>
                                                <div class="layui-input-inline">
                                                    <input type="radio" name="HLastResult" id="HLastResult" value="OK" title="OK" checked>
                                                    <input type="radio" name="HLastResult" id="HLastResult" value="NG" title="NG">
                                                </div>
                                            </div>
                                        </div>
@@ -154,6 +196,14 @@
    <script type="text/html" id="barDemo">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <!--行下拉选择(点检结果)-->
    <script type="text/html" id="HDotCheckResult">
        <select name="HDotCheckResult" lay-filter="HDotCheckResult" id="HDotCheckResult{{d.LAY_TABLE_INDEX+1}}">
            <!--<option value="">请选择</option>-->
            <option value="Y" selected>Y</option>
            <option value="X">X</option>
        </select>
    </script>
    <script>
        var OptionData = [];
@@ -221,7 +271,7 @@
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var NewRow = { "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "" };
                var NewRow = { "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "","HDotCheckResult":"Y"};
                switch (obj.event) {
                    //新增一行
                    case 'btn-AddLine': btnAddLine(NewRow);
@@ -272,6 +322,42 @@
                    }
                });
            });
            //表头信息生产班次弹窗
            form.on('submit(btnHShifts)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '生产班次列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true
                    , content: ['../基础资料/生产基础资料/Gy_ShiftsList.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('请选择数据');
                        }
                        $("#HShiftsID").val(checkStatus.data[0].HItemID);
                        $("#HShiftsName").val(checkStatus.data[0].班次名称);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //获取设备点检规程
            function get_DocCheckItem() {
                $.ajax({
@@ -283,7 +369,7 @@
                            if (result.count == 1) {
                                var DJData = result;//
                                var rowdate1 = layui.table.cache["mainTable"];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " " }];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " ", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"}];
                                table.render(option);
                                $("#HEquipDotCheckRuleInterID").val(DJData.data[0].HInterID);
                                $("#HEquipDotCheckRuleInterNo").val(DJData.data[0].HBillNo);
@@ -294,17 +380,20 @@
                                        var checkrow = {
                                            "HDotCheckItemID": DJData.data[i].HDotCheckItemID, "HDotCheckCode": DJData.data[i].HDotCheckCode, "HDotCheckItem": DJData.data[i].HDotCheckItem,
                                            "HDotCheckPart": DJData.data[i].HDotCheckPart, "HManagerID": DJData.data[i].HManagerID, "HManagerCode": DJData.data[i].HManagerCode,
                                            "HManagerName": DJData.data[i].HManagerName
                                            "HManagerName": DJData.data[i].HManagerName, "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
                                    table.reload("mainTable", {
                                        data: buttonArr    //将数据重新载入表格
                                    })
                                    option.data = buttonArr;
                                    table.render(option);
                                    //table.reload("mainTable", {
                                    //    data: buttonArr    //将数据重新载入表格
                                    //})
                                }
                            }
                            else {
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y" }];
                                table.render(option);
                                //layer.alert("该设备暂无默认点检记录", { icon: 5 });
                            }
@@ -348,6 +437,39 @@
                    }
                });
            });
            //行选择处理(点检结果)
            form.on('select(HDotCheckResult)', function (data) {
                //获取下拉框选中的值
                var elem = data.othis.parents('tr');
                var dataindex = elem.attr("data-index");
                $.each(option.data, function (index, value) {
                    if (value.LAY_TABLE_INDEX == dataindex) {
                        value.HDotCheckResult = data.value;//把选中下拉框id值赋值给表格缓存
                    }
                });
                //for (var i = 1; i <= option.data.length; i++) {
                //    $('#HDotCheckResult' + i + '').find("option[value='" + option.data[i - 1].HDotCheckResult + "']").attr("selected", true);
                //}
                //form.render('select');
                console.log(table.cache['mainTable']);
                var HQty = 0;//表体行不合格数量
                for (let i = 0; i < table.cache['mainTable'].length; i++) {
                    if (table.cache['mainTable'][i].HDotCheckResult == "X") {
                        HQty++;
                    }
                }
                if (HQty > 0) {
                    document.querySelectorAll("[name='HLastResult']")[0].removeAttribute('checked'); //删除选择属性
                    $("input:radio[name=HLastResult][value=" + "NG" + "]").attr("checked", "true"); //添加选择属性
                } else {
                    document.querySelectorAll("[name='HLastResult']")[1].removeAttribute('checked'); //删除选择属性
                    $("input:radio[name=HLastResult][value=" + "OK" + "]").attr("checked", "true"); //添加选择属性
                }
                form.render('radio');
            });
            window.get_DocCheckItem2 = function () {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetDotCheckRuleItemByDotCheckRuleID",
@@ -358,7 +480,7 @@
                            if (result.count == 1) {
                                var DJData = result;//
                                var rowdate1 = layui.table.cache["mainTable"];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " " }];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " ", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"}];
                                table.render(option);
                                if (DJData.data.length != 0)  //表体数据为空时
@@ -368,17 +490,19 @@
                                        var checkrow = {
                                            "HDotCheckItemID": DJData.data[i].HDotCheckItemID, "HDotCheckCode": DJData.data[i].HDotCheckCode, "HDotCheckItem": DJData.data[i].HDotCheckItem,
                                            "HDotCheckPart": DJData.data[i].HDotCheckPart, "HManagerID": DJData.data[i].HManagerID, "HManagerCode": DJData.data[i].HManagerCode,
                                            "HManagerName": DJData.data[i].HManagerName
                                            "HManagerName": DJData.data[i].HManagerName, "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
                                    table.reload("mainTable", {
                                        data: buttonArr    //将数据重新载入表格
                                    })
                                    option.data = buttonArr;
                                    table.render(option);
                                    //table.reload("mainTable", {
                                    //    data: buttonArr    //将数据重新载入表格
                                    //})
                                }
                            }
                            else {
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"}];
                                table.render(option);
                                //layer.alert("该设备暂无默认点检记录", { icon: 5 });
                            }
@@ -433,7 +557,7 @@
                            if (result.count == 1) {
                                var DJData = result.data;//
                                var rowdate1 = layui.table.cache["mainTable"];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " " }];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " ", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y" }];
                                table.render(option);
                                if (DJData.length != 0)  //表体数据为空时
@@ -444,19 +568,22 @@
                                        var checkrow = {
                                            "HDotCheckItemID": DJData[i].HDotCheckID, "HDotCheckCode": DJData[i].点检项目代码, "HDotCheckItem": DJData[i].点检项目,
                                            "HDotCheckPart": DJData[i].点检部位, "HClaim": DJData[i].具体要求, "HManagerID": DJData[i].HEmployeeID,
                                            "HManagerCode": DJData[i].负责人代码, "HManagerName": DJData[i].负责人名称, "HRemark": DJData[i].HRemark
                                            "HManagerCode": DJData[i].负责人代码, "HManagerName": DJData[i].负责人名称, "HRemark": DJData[i].HRemark,
                                            "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
                                    table.reload("mainTable", {
                                        data: buttonArr    //将数据重新载入表格
                                    })
                                    option.data = buttonArr;
                                    table.render(option);
                                    //table.reload("mainTable", {
                                    //    data: buttonArr    //将数据重新载入表格
                                    //})
                                } else {
                                    layer.alert("点前时间段暂无需要点检的规划", { icon: 5 });
                                }
                            }
                            else {
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"}];
                                table.render(option);
                                //layer.alert("该设备暂无默认点检记录", { icon: 5 });
                            }
@@ -472,6 +599,7 @@
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"];
                console.log(sSubStr);
                if (AllowLoadData(sSubStr)) {
                    $.ajax(
                        {
@@ -489,9 +617,7 @@
                                    });
                                }
                                else {
                                    f_alert(data.Message);
                                    console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                                }
                                layer.closeAll("loading");
                            },
@@ -536,11 +662,16 @@
            function set_InitGrid() {
                //表头
                columns = [
                    { type: 'checkbox', fixed: 'left', totalRowText: '合计行'}
                    { type: 'checkbox', fixed: 'left', totalRowText: '合计行' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                    , { field: 'HDotCheckItemID', title: '点检项目ID', edit: 'text', hide: true }
                    , { field: 'HDotCheckCode', title: '点检项目代码', edit: 'text', event: "HDotCheckCode" }
                    , { field: 'HDotCheckItem', title: '点检项目', edit: 'text', event: "" }
                    , { field: 'HDotCheckItemClassID', title: '点检项目分类ID', edit: 'text', hide: true }
                    , { field: 'HDotCheckItemClassName', title: '点检项目分类', edit: 'text', event: 'HDotCheckItemClassName' }
                    , { field: 'HDotCheckItemMethodID', title: '点检方法ID', edit: 'text', hide: true }
                    , { field: 'HDotCheckItemMethodName', title: '点检方法', edit: 'text', event: 'HDotCheckItemMethodName' }
                    , { field: 'HDotCheckResult', title: '点检结果', templet: '#HDotCheckResult', event: 'HDotCheckResult' }
                    , { field: 'HDotCheckPart', title: '点检部位', edit: 'text', event: "" }
                    , { field: 'HClaim', title: '具体要求', edit: 'text' }
                    , { field: 'HManagerID', title: '负责人代码', edit: 'text', hide: true }
@@ -567,15 +698,15 @@
            //增加一行事件
            function btnAddLine(NewRow) {
                var tableBak = table.cache["mainTable"]; //获取之前编辑过的表格数据
                buttonArr = [];//清空数组
                for (var i = 0; i < tableBak.length; i++) {
                    buttonArr.push(tableBak[i]);  //将之前的数据存储
                table.cache["mainTable"].push(NewRow);
                option.data = table.cache["mainTable"];
                table.render(option);
                for (var i = 1; i <= option.data.length; i++) {
                    $('#HDotCheckResult' + i + '').find("option[value='" + option.data[i - 1].HDotCheckResult + "']").attr("selected", true);
                }
                buttonArr.push(NewRow);  //在尾部加一行
                table.reload("mainTable", {
                    data: buttonArr    //将数据重新载入表格
                })
                form.render('select');
            }
            //表格复制一行事件
            function btnCopyLine(data) {
@@ -592,6 +723,11 @@
                    table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                    option.data = table.cache["mainTable"];//将数据绑定到data上
                    table.render(option);//将数据渲染到表格上
                    for (var i = 1; i <= option.data.length; i++) {
                        $('#HDotCheckResult' + i + '').find("option[value='" + option.data[i - 1].HDotCheckResult + "']").attr("selected", true);
                    }
                    form.render('select');
                }
            }
            // è¡¨æ ¼è¡Œå†…事件删除
@@ -638,13 +774,15 @@
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    if (checkStatus.data.length === 1) {
                                        //同步更新表格和缓存对应的值
                                        obj.update({
                                            HDotCheckItemID: checkStatus.data[0].HItemID,
                                            HDotCheckCode: checkStatus.data[0].点检项目代码,
                                            HDotCheckItem: checkStatus.data[0].点检项目名称
                                            HDotCheckItem: checkStatus.data[0].点检项目名称,
                                            HDotCheckItemClassID: checkStatus.data[0].HDotCheckItemClassID,
                                            HDotCheckItemClassName: checkStatus.data[0].点检项目分类名称,
                                        });
                                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    } else {
@@ -659,15 +797,16 @@
                                        }
                                        //将批量选择的数据写入数组(多选行)
                                        for (var i = 0; i < checkStatus.data.length; i++) {
                                            buttonArr.push({ "HDotCheckItemID": checkStatus.data[i].HItemID, "HDotCheckCode": checkStatus.data[i].点检项目代码, "HDotCheckItem": checkStatus.data[i].点检项目名称, "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "" });
                                            buttonArr.push({ "HDotCheckItemID": checkStatus.data[i].HItemID, "HDotCheckCode": checkStatus.data[i].点检项目代码, "HDotCheckItem": checkStatus.data[i].点检项目名称, "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y" });
                                        }
                                        table.reload("mainTable", {
                                            data: buttonArr    //将数据重新载入表格
                                        })
                                        option.data = buttonArr;
                                        table.render(option);
                                        //table.reload("mainTable", {
                                        //    data: buttonArr    //将数据重新载入表格
                                        //})
                                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    }
                                    }
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
@@ -679,7 +818,9 @@
                                        obj.update({
                                            HDotCheckItemID: OptionData[0].HItemID,
                                            HDotCheckCode: OptionData[0].点检项目代码,
                                            HDotCheckItem: OptionData[0].点检项目名称
                                            HDotCheckItem: OptionData[0].点检项目名称,
                                            HDotCheckItemClassID: OptionData[0].HDotCheckItemClassID,
                                            HDotCheckItemClassName: OptionData[0].点检项目分类名称,
                                        });
                                        OptionData = [];
                                    }
@@ -731,6 +872,73 @@
                                }
                            });
                        }
                        if (obj.event === 'HDotCheckItemClassName')  //点检项目分类
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '点检项目分类列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true
                                , content: ['../基础资料/基础资料/Gy_DotCheckItemClassList.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('请选择数据');
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HDotCheckItemClassID: checkStatus.data[0].HItemID,
                                        HDotCheckItemClassName: checkStatus.data[0].点检项目分类名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                }
                            });
                        }
                        if (obj.event === 'HDotCheckItemMethodName')  //点检方法
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '点检方法列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true
                                , content: ['../基础资料/基础资料/Gy_DotCheckItemMethodList.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('请选择数据');
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HDotCheckItemMethodID: checkStatus.data[0].HItemID,
                                        HDotCheckItemMethodName: checkStatus.data[0].点检方法名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                }
                            });
                        }
                        obj.event = "";
                        return false;
@@ -761,7 +969,7 @@
            function set_AddFNew() {
                //获取最大单据号
                get_MAXNum();
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "" }];
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y" }];
                table.render(option);
            }
@@ -769,7 +977,7 @@
            function set_EditFromGrid(linterid) {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y" }];
                table.render(option);
            }
            //编辑获取表头
@@ -797,7 +1005,22 @@
                                , "HRemark": data.表头备注                //备注
                                , "HEquipDotCheckRuleInterID": data.设备点检规程ID // è®¾å¤‡ç‚¹æ£€è§„程ID
                                , "HEquipDotCheckRuleInterNo": data.设备点检规程 // è®¾å¤‡ç‚¹æ£€è§„程
                                , "HErrNote": data.异常情况记录 //异常情况记录
                                , "HBigSafeNote": data.重大安全隐患记录 //重大安全隐患记录
                                , "HDotCheckNote": data.点检数据 //点检数据
                                , "HShiftsID": data.HShiftsID //
                                , "HShiftsName": data.班次名称 //班次名称
                                //, "HLastResult": data.最终结论 == "合格" ? "OK" : "NG" //最终结论
                            });
                            if (data.最终结论 == "不合格") {
                                document.querySelectorAll("[name='HLastResult']")[0].removeAttribute('checked'); //删除选择属性
                                $("input:radio[name=HLastResult][value=" + "NG" + "]").attr("checked", "true"); //添加选择属性
                            } else {
                                document.querySelectorAll("[name='HLastResult']")[1].removeAttribute('checked'); //删除选择属性
                                $("input:radio[name=HLastResult][value=" + "OK" + "]").attr("checked", "true"); //添加选择属性
                            }
                            form.render('radio');
                        } else {
                            layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
@@ -815,12 +1038,21 @@
                    url: GetWEBURL() + 'Sb_EquipDotCheckBill/Sb_EquipDotCheckBillListProjectDetai',
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + linterid },
                    success: function (result) {
                        console.log(result);
                    success: function (result) {
                        if (result.count == 1) {
                            option.data = result.data;
                            table.render(option);
                            var data = result.data;
                            var subarr = [];
                            for (var i = 0; i < data.length; i++) {
                                subarr.push({ "HDotCheckItemID": data[i].点检项目ID, "HDotCheckCode": data[i].点检项目代码, "HDotCheckItem": data[i].点检项目, "HDotCheckPart": data[i].点检部位, "HClaim": data[i].具体要求, "HManagerID": data[i].负责人ID, "HManagerCode": data[i].负责人编码, "HManagerName": data[i].负责人, "HRemark": data[i].表体备注, "HDotCheckItemClassID": data[i].HDotCheckItemClassID, "HDotCheckItemClassName": data[i].点检项目分类名称, "HDotCheckItemMethodID": data[i].HDotCheckItemMethodID, "HDotCheckItemMethodName": data[i].点检方法名称, "HDotCheckResult": data[i].点检结果 == "合格" ? 'Y' : 'X' });
                            }
                            option.data = subarr;
                            table.render(option);
                            for (let j = 0; j < data.length; j++) {
                                $("#HDotCheckResult" + (j + 1)).val(data[j].点检结果 == "合格" ? 'Y' : 'X')
                            }
                            form.render('select');
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
@@ -883,6 +1115,11 @@
                    return true;
                }
            }
            //错误信息
            function f_alert(sMsg) {
                layer.alert(sMsg, { icon: 5 });
            }
            //#endregion
        });