1
llj
2026-02-25 3aafc15f780b8bf1030f1b2a9553e65a1880a8ac
WebTM/views/IpadIndex.html
@@ -20,6 +20,7 @@
    <script src="../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script>
        var wktag = 0;
        var workcode = "";          //工单号
@@ -89,71 +90,131 @@
                    {
                        HSBName = LoadData[0].HSourceName;
                        for (var i = 1; i <= LoadData.length + 1; i++) {
                            if (i <= LoadData.length) {
                                var html1 = '';
                                html1 += '<div class="layui-col-sm12 layui-col-md3">';
                                html1 += '<div class="cnt ctop" id="ts' + i + '" onclick="Check(this,' + i + ')">';
                                html1 += '<dl>';
                                html1 += '<dd>';
                                html1 += '<h1 style="display:none;"><span>资源ID:</span><span id="eqpid' + i + '">' + LoadData[i - 1].HSourceID + '</span></h1>';
                                html1 += '<h1><span>设备编号:</span><span id="eqp' + i + '">' + LoadData[i - 1].HSourceName + '</span></h1>';
                                html1 += '<h1><span>设备代码:</span><span id="eqp' + i + '">' + LoadData[i - 1].HSourceNumber + '</span></h1>';
                                html1 += '<h1><span>操作员:</span><span id="HEmpName' + i + '">' + LoadData[i - 1].HUserName + '</span></h1>';
                                html1 += '<h1><span>生产班组:</span><span id="HGroupName' + i + '">' + LoadData[i - 1].GroupName + '</span></h1>';
                                //html1 += '<h1><span>当前工单:</span><span id="po' + i + '">' + (LoadData[i - 1].HSourceBillNo == null ? '' : LoadData[i - 1].HSourceBillNo) + '</span></h1>';
                                //html1 += '<h1><span>产品名称:</span><span id="ptn' + i + '">' + (LoadData[i - 1].HName == null ? '' : LoadData[i - 1].HName) + '</span></h1>';
                                //html1 += '<h1><span>产品规格:</span><span id="pts' + i + '">' + (LoadData[i - 1].HModel == null ? '' : LoadData[i - 1].HModel) + '</span></h1>';
                                html1 += '<h1><span>负责人:</span><span id="us' + i + '">' + LoadData[i - 1].HEmpName + '</span></h1>';
                                switch (LoadData[i - 1].HStatus) {
                                    case "空闲":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border6"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "开机":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border4"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "停机":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border3"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "生产":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border2"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "维修进行中":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border5"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "维修结束":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "维修终止":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    default:
                                }
                                html1 += '<h1 hidden> <span id="HGroupID' + i + '">' + LoadData[i - 1].HGroupID + '</span></h1>';
                                html1 += '<h1 hidden> <span id="HManagerID' + i + '">' + LoadData[i - 1].HManagerID + '</span></h1>';
                                html1 += '</dd>';
                                html1 += '</dl>';
                                html1 += '</div>';
                                html1 += '</div>';
                                $("#topleft").append(html1);
                                $("#ts" + i + "").append('<span class="layui-icon layui-icon-delete delete"  onclick="Delete(event,this,' + i + ')"></span>'); //在当前div后追加加一个span删除
                            if (sessionStorage["Organization"] == "宁波市华舟包装有限公司") {
                                if (i <= LoadData.length) {
                                    var html1 = '';
                                    html1 += '<div class="layui-col-sm12 layui-col-md2">';
                                    html1 += '<div class="cnt1 ctop" id="ts' + i + '" onclick="Check(this,' + i + ')">';
                                    html1 += '<dl>';
                                    html1 += '<dd>';
                                    html1 += '<h1 style="display:none;"><span>资源ID:</span><span id="eqpid' + i + '">' + LoadData[i - 1].HSourceID + '</span></h1>';
                                    html1 += '<h1><span>设备编号:</span><span id="eqp' + i + '">' + LoadData[i - 1].HSourceName + '</span></h1>';
                                    html1 += '<h1><span>设备代码:</span><span id="eqp' + i + '">' + LoadData[i - 1].HSourceNumber + '</span></h1>';
                                    switch (LoadData[i - 1].HStatus) {
                                        case "空闲":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border6"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "开机":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border4"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "停机":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border3"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "生产":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border2"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "维修进行中":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border5"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "维修结束":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "维修终止":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        default:
                                    }
                                    html1 += '<h1 hidden> <span id="HGroupID' + i + '">' + LoadData[i - 1].HGroupID + '</span></h1>';
                                    html1 += '<h1 hidden> <span id="HManagerID' + i + '">' + LoadData[i - 1].HManagerID + '</span></h1>';
                                    html1 += '</dd>';
                                    html1 += '</dl>';
                                    html1 += '</div>';
                                    html1 += '</div>';
                                    $("#topleft").append(html1);
                                    $("#ts" + i + "").append('<span class="layui-icon layui-icon-delete delete"  onclick="Delete(event,this,' + i + ')"></span>'); //在当前div后追加加一个span删除
                                //根据返回的 选中标志HNowFlag设置选中的资源
                                if (LoadData[i - 1].HNowFlag) {
                                    $('.ctop').removeClass('check');  //删除不同父级clss样式相同的所有元素
                                    $("#ts" + i + "").addClass('check'); // 添加当前元素的样式
                                    Check(this, i);
                                    //根据返回的 选中标志HNowFlag设置选中的资源
                                    if (LoadData[i - 1].HNowFlag) {
                                        $('.ctop').removeClass('check');  //删除不同父级clss样式相同的所有元素
                                        $("#ts" + i + "").addClass('check'); // 添加当前元素的样式
                                        Check(this, i);
                                    }
                                }
                                else {
                                    var html1 = '';
                                    html1 += '<div class="layui-col-sm12 layui-col-md2">';
                                    html1 += '<div class="cnt1 ctop" id="ts' + i + '" onclick="Check(this,' + i + ')">';
                                    html1 += '<span class="layui-icon layui-icon-addition imgicon0" onclick="Add(event,this,' + i + ')"></span>';
                                    html1 += '</div>';
                                    html1 += '</div>';
                                    $("#topleft").append(html1);
                                }
                            } else {
                                if (i <= LoadData.length) {
                                    var html1 = '';
                                    html1 += '<div class="layui-col-sm12 layui-col-md3">';
                                    html1 += '<div class="cnt ctop" id="ts' + i + '" onclick="Check(this,' + i + ')">';
                                    html1 += '<dl>';
                                    html1 += '<dd>';
                                    html1 += '<h1 style="display:none;"><span>资源ID:</span><span id="eqpid' + i + '">' + LoadData[i - 1].HSourceID + '</span></h1>';
                                    html1 += '<h1><span>设备编号:</span><span id="eqp' + i + '">' + LoadData[i - 1].HSourceName + '</span></h1>';
                                    html1 += '<h1><span>设备代码:</span><span id="eqp' + i + '">' + LoadData[i - 1].HSourceNumber + '</span></h1>';
                                    html1 += '<h1><span>操作员:</span><span id="HEmpName' + i + '">' + LoadData[i - 1].HUserName + '</span></h1>';
                                    html1 += '<h1><span>生产班组:</span><span id="HGroupName' + i + '">' + LoadData[i - 1].GroupName + '</span></h1>';
                                    html1 += '<h1><span>负责人:</span><span id="us' + i + '">' + LoadData[i - 1].HEmpName + '</span></h1>';
                                    switch (LoadData[i - 1].HStatus) {
                                        case "空闲":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border6"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "开机":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border4"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "停机":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border3"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "生产":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border2"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "维修进行中":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border5"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "维修结束":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        case "维修终止":
                                            html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                            break;
                                        default:
                                    }
                                    html1 += '<h1 hidden> <span id="HGroupID' + i + '">' + LoadData[i - 1].HGroupID + '</span></h1>';
                                    html1 += '<h1 hidden> <span id="HManagerID' + i + '">' + LoadData[i - 1].HManagerID + '</span></h1>';
                                    html1 += '</dd>';
                                    html1 += '</dl>';
                                    html1 += '</div>';
                                    html1 += '</div>';
                                    $("#topleft").append(html1);
                                    $("#ts" + i + "").append('<span class="layui-icon layui-icon-delete delete"  onclick="Delete(event,this,' + i + ')"></span>'); //在当前div后追加加一个span删除
                                    //根据返回的 选中标志HNowFlag设置选中的资源
                                    if (LoadData[i - 1].HNowFlag) {
                                        $('.ctop').removeClass('check');  //删除不同父级clss样式相同的所有元素
                                        $("#ts" + i + "").addClass('check'); // 添加当前元素的样式
                                        Check(this, i);
                                    }
                                }
                                else {
                                    var html1 = '';
                                    html1 += '<div class="layui-col-sm12 layui-col-md3">';
                                    html1 += '<div class="cnt ctop" id="ts' + i + '" onclick="Check(this,' + i + ')">';
                                    html1 += '<span class="layui-icon layui-icon-addition imgicon0" onclick="Add(event,this,' + i + ')"></span>';
                                    html1 += '</div>';
                                    html1 += '</div>';
                                    $("#topleft").append(html1);
                                }
                            }
                            else {
                                var html1 = '';
                                html1 += '<div class="layui-col-sm12 layui-col-md3">';
                                html1 += '<div class="cnt ctop" id="ts' + i + '" onclick="Check(this,' + i + ')">';
                                html1 += '<span class="layui-icon layui-icon-addition imgicon0" onclick="Add(event,this,' + i + ')"></span>';
                                html1 += '</div>';
                                html1 += '</div>';
                                $("#topleft").append(html1);
                            }
                        }
                    }
                    else {
@@ -426,7 +487,8 @@
                                html1 += '<h1 style="display:none;"><span>工序ID:</span><span id="procid' + (i + 1) + '">' + LoadData1[i].HProcID + '</span></h1>';
                                html1 += '<h1><span>产品名称:</span><span id="ptn' + (i + 1) + '">[' + LoadData1[i].HMaterNumber + ']-[' + LoadData1[i].HMaterName + ']</span></h1>';
                                html1 += '<h1><span>产品型号:</span><span id="pts' + (i + 1) + '">' + LoadData1[i].HModel + '</span></h1>';
                                html1 += '<h1><span>计划数量:</span><span>' + LoadData1[i].HDatePlanQty + '</span><span style="margin-left:20px;">汇报总数:</span><span>' + LoadData1[i].HDateFinishQty + '</span></h1>';
                                html1 += '<h1><span>计划数量:</span><span>' + LoadData1[i].HDatePlanQty + '</span><span style="margin-left:20px;">数采总数:</span><span>' + LoadData1[i].HDateFinishQty + '</span></h1>';
                                html1 += '<h1><span>汇报总数:</span><span id="pts' + (i + 1) + '">' + LoadData1[i].HWCHQty + '</span></h1>';
                                switch (LoadData1[i].HICMOStatus) {
                                    case "待生产":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border3"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
@@ -927,9 +989,30 @@
                },
            });
            /* window.open("../../../views/生产管理/作业指导书/Gy_SOPBill_Video.html?OperationType=5&HMaterID=" + HMaterID + "&HSourceNo=" + workcode + "&HSourceEntryID=" + HSourceEntryID);*/
        }
        //SIP 作业指导书
        function SIP(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            var HTypes = "SIP";
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '作业指导书',
                closeBtn: 1,
                shift: 2,
                area: ['95%', '95%'],
                maxmin: true,
                content: '生产管理/作业指导书/Gy_SOPBill_Video.html?OperationType=5&HMaterID=' + HMaterID + '&HSourceNo=' + workcode + '&HSourceEntryID=' + HSourceEntryID + '&HProcID=' + HProcID + '&HTypes=' + HTypes,
                end: function () {
                }
            });
        }
        //汇报按钮点击事件
        function OpenReport(event, obj) {
@@ -1152,6 +1235,47 @@
            });
        }
        // 停工恢复单
        function OpenMESStopRestoreWorkBill() {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "停工恢复")) {
                layer.alert("单据状态不满足停工恢复条件!", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增停工恢复单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/报工台工序/停工恢复单/Sc_MESStopRestoreWorkBill.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //首检检验
        function OpenFistCheck(event, obj) {
            if (wktag == 0) {
@@ -1184,11 +1308,34 @@
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '工序检验单-编辑'
                , title: '巡检检验单-编辑'
                , shade: 0.6
                , maxmin: false
                , anim: 0
                , content: ['质量管理/巡检记录单/QC_Add_Edit_PatrolProcCheckOtherill.html?OperationType=2&linterid=' + HProcExchInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID + '&HSourceEntryID=' + HSourceEntryID + '', 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //末检
        function ProcessCheck(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '工序检验单-编辑'
                , shade: 0.6
                , maxmin: false
                , anim: 0
                , content: ['质量管理/工序检验单/QC_ProcessCheckBill.html?OperationType=2&linterid=' + HProcExchInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID + '&HSourceEntryID=' + HSourceEntryID + '', 'yes']
                , resize: false
                , cancel: function () {
@@ -1579,52 +1726,57 @@
        //单据状态验证
        function WorkStaus(HSourceID1, workcode, HSourceInterID, btn) {
            var flag = false;
            var sWhere = "";
            switch (btn) {
                case "开工":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('0','2')";   //是否有不为开工开工状态、停工状态
                    break;
                case "完工":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、完工状态
                    break;
                case "停工":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1')";   //是否有不为停工挂起状态
                    break;
                case "汇报":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、停工挂起状态
                    break;
                case "斯莫尔汇报":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HSourceBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、停工挂起状态
                    break;
                case "报检申请":
                    //        break;
                    //    default:
                    //}
                    $.ajax({
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus",
                        type: "GET",
                        data: { "sWhere": JSON.stringify(sWhere) },
                        dataType: "json",//数据类型可以为 text xml json  script  jsonp
                        async: false,
                        success: function (data) {
                            if (data.count > 0) {
                                flag = true;
                            }
                            else {
                                flag = false;
                            }
                        },
                        error: function (err) {
                            flag = false;
                        }
                    });
                    return flag;
            var sWhere = "";    //后续在存储过程加控制  方法是 h_p_IpadIndexButton
            sWhere = {
                HSourceID: HSourceID1
                , HICMOBillNo: workcode
                , HInterID: HSourceInterID
                , type: btn
            }
            //switch (btn) {
            //    case "开工":
            //        sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('0','2')";   //是否有不为开工开工状态、停工状态
            //        break;
            //    case "停工恢复":
            //        sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus in('2')";   //是否为停工挂起状态
            //        break;
            //    case "完工":
            //        sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、完工状态
            //        break;
            //    case "停工":
            //        sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1')";   //是否有不为停工挂起状态
            //        break;
            //    case "汇报":
            //        sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、停工挂起状态
            //        break;
            //    case "斯莫尔汇报":
            //        sWhere = " where HSourceID='" + HSourceID1 + "' and HSourceBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、停工挂起状态
            //        break;
            //}
            $.ajax({
                url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus",
                type: "GET",
                data: { "sWhere": JSON.stringify(sWhere) },
                dataType: "json",//数据类型可以为 text xml json  script  jsonp
                async: false,
                success: function (data) {
                    if (data.count > 0) {
                        flag = true;
                    }
                    else {
                        flag = false;
                    }
                },
                error: function (err) {
                    flag = false;
                }
            });
            return flag;
        }
    </script>
</head>
@@ -1742,8 +1894,8 @@
                                    <span class="imgtitle">巡检</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4">
                                <div class="cnt bottomright" style="pointer-events:none; background-color:rgb(0 0 0 / 10%);display:none;">
                            <div class="layui-col-sm12 layui-col-md4" onclick="ProcessCheck(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-search imgicon"></span>
                                    <span class="imgtitle">末检</span>
                                </div>