1
duhe
2024-08-15 40cd70d9a9d13001c1b6c2269334e8a363c562c3
WebTM/views/IpadIndex.html
@@ -36,6 +36,17 @@
        var HICMOInterID = "";     //生产订单主内码
        var HICMOEntryID = "";     //生产订单子内码
        var HICMOBillNo = "";      //任务单号
        var HMaterName = "";      //产品名称
        var HMaterID = 0;          //产品ID
        var HProQty = [];       //时间点产量
        var HBadQty = [];       //不良数量
        var HBadReason = [];       //不良原因
        var HEmpName = "";      //操作员
        var HManagerName = "";      //负责人
        var HGroupName = "";      //班组
        var HProcID = 0;      //工序
        var HSBName = "";   //设备名称
        //注意:选项卡 依赖 element 模块,否则无法进行功能性操作
        layui.config({
            base: '../layuiadmin/' //静态资源所在路径
@@ -49,9 +60,9 @@
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            var mychart1 = echarts.init(document.getElementById('mychart1'));
            var mychart2 = echarts.init(document.getElementById('mychart2'));
            //window 全局变量
            window.mychart1 = echarts.init(document.getElementById('mychart1'));
            window.mychart2 = echarts.init(document.getElementById('mychart2'));
            element.on('tab(TabTest)', function (data) {
                Mychart(mychart1, mychart2);
@@ -63,7 +74,7 @@
        });
        function TSLoad() {
            $("#topleft").html("");
            var HUserName = "Admin" //sessionStorage["HUserName"];     //默认当前登录人员
            var HUserName = sessionStorage["HUserName"];  //sessionStorage["HUserName"];     //默认当前登录人员
            $.ajax({
                url: GetWEBURL() + "/ReportPlatForm/SearchGetLineBindBillList",
                type: "GET",
@@ -71,8 +82,10 @@
                dataType: "json",//数据类型可以为 text xml json  script  jsonp
                success: function (data) {
                    var LoadData = data.data.h_p_JIT_GetSourceInfoByUser;
                    if (LoadData.length > 0)// 说明验证成功了,
                    {
                        HSBName = LoadData[0].HSourceName;
                        for (var i = 1; i <= LoadData.length + 1; i++) {
                            if (i <= LoadData.length) {
                                var html1 = '';
@@ -82,8 +95,15 @@
                                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="po' + i + '">' + (LoadData[i - 1].HSourceBillNo == null ? '' : LoadData[i - 1].HSourceBillNo) + '</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>';
                                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>';
@@ -111,8 +131,13 @@
                        }
                    }
                    else {
                        layer.alert(data.Message, { icon: 5 });
                        return false;
                        var html1 = '';
                        html1 += '<div class="layui-col-sm12 layui-col-md3">';
                        html1 += '<div class="cnt ctop" id="ts1" onclick="Check(this,1)">';
                        html1 += '<span class="layui-icon layui-icon-addition imgicon0" onclick="Add(event,this,1)"></span>';
                        html1 += '</div>';
                        html1 += '</div>';
                        $("#topleft").append(html1);
                    }
                },
                error: function (err) {
@@ -121,117 +146,174 @@
                }
            });
        }
        var HManagerID = 0;
        var HGroupID = 0;
        //选中资源
        function Check(obj, i) {
                $("#btomleft").html("");
                $("#topright").html("");
                var partid = $(obj).parent().attr("id");   //获取父级id
                var eqpid = "eqpid" + i;                   //获取指定资源样式ID
                var HSourceID = $("#" + eqpid + "").html(); //通过样式ID获取html内容(资源ID)
                HSourceID1 = $("#" + eqpid + "").html(); //通过样式ID获取html内容(资源ID)
                var eqp = "eqp" + i;                       //获取指定资源样式ID
                var HSourceName = $("#" + eqp + "").html(); //通过样式ID获取html内容(资源)
                HSourceName1 = $("#" + eqp + "").html(); //通过样式ID获取html内容(资源)
                if (HSourceID != "" && HSourceID != null) {
                        $('.ctop').removeClass('check');  //删除不同父级clss样式相同的所有元素
                        $("#ts" + i + "").addClass('check'); // 添加当前元素的样式
                        //执行联动事件
                        $.ajax({
                            url: GetWEBURL() + "/ReportPlatForm/SearchGetWorkBillList",
                            type: "GET",
                            data: { "HSourceID": HSourceID },
                            dataType: "json",//数据类型可以为 text xml json  script  jsonp
                            success: function (data) {
                                var LoadData1 = data.data.h_p_JIT_GetWorkBillListInfoBySource;
                                var LoadData2 = data.data.h_p_JIT_GetWorkBillListInfoBySource1;
                                if (LoadData1.length > 0)  //工单列表数据
                                {
            wktag = 0;
            $("#btomleft").html("");
            $("#topright").html("");
            HProQty = [];       //时间点产量
            HBadQty = [];       //不良数量
            HBadReason = [];       //不良原因
            var partid = $(obj).parent().attr("id");   //获取父级id
            var eqpid = "eqpid" + i;                   //获取指定资源样式ID
            var HSourceID = $("#" + eqpid + "").html(); //通过样式ID获取html内容(资源ID)
            HSourceID1 = $("#" + eqpid + "").html(); //通过样式ID获取html内容(资源ID)
            var eqp = "eqp" + i;                       //获取指定资源样式ID
            var HSourceName = $("#" + eqp + "").html(); //通过样式ID获取html内容(资源)
            HSourceName1 = $("#" + eqp + "").html(); //通过样式ID获取html内容(资源)
            var emp = "HEmpName" + i;                   //获取指定资源样式ID
            var us = "us" + i;                   //获取指定资源样式ID
            var gro = "HGroupName" + i;                   //获取指定资源样式ID
            HEmpName = $("#" + emp + "").html(); //通过样式ID获取html内容(资源ID)
            HManagerName = $("#" + us + "").html(); //通过样式ID获取html内容(资源ID)
            HGroupName = $("#" + gro + "").html(); //通过样式ID获取html内容(资源ID)
            HManagerID = "HManagerID" + i;
            HGroupID = "HGroupID" + i;
            HManagerID = $("#" + HManagerID + "").html();
            HGroupID = $("#" + HGroupID + "").html();
                                    for (var i = 0; i < LoadData1.length; i++) {
                                        var html1 = '';
                                        html1 += '<div class="layui-col-sm12 layui-col-md3">';
                                        html1 += '<div class="cns" id="bs' + (i + 1) + '" onclick="CheckBtom(this,' + (i + 1)+ ')">';
                                        html1 += '<dl>';
                                        html1 += '<dd class="tcenter">';
                                        html1 += '<h1 style="display:none;"><span>单据类型:</span><span id="ty' + (i + 1) + '">' + LoadData1[i].HBillType + '</span></h1>';
                                        //HSourceInterID实际取值:Sc_ICMOBillStatus_Tmp  HInterID(单据主ID)
                                        html1 += '<h1 style="display:none;"><span>源单主内码:</span><span id="sm' + (i + 1) + '">' + LoadData1[i].HSourceInterID + '</span></h1>';
                                        html1 += '<h1 style="display:none;"><span>源单子内码:</span><span id="sb' + (i + 1) + '">' + LoadData1[i].HSourceEntryID + '</span></h1>';
                                        html1 += '<h1 style="display:none;"><span>源单单号:</span><span id="sw' + (i + 1) + '">' + LoadData1[i].HSourceBillNo + '</span></h1>';
                                        html1 += '<h1 style="display:none;"><span>源单类型:</span><span id="st' + (i + 1) + '">' + LoadData1[i].HSourceBillType + '</span></h1>';
                                        html1 += '<h1><span>工单号:</span><span id="wk' + (i + 1) + '">' + LoadData1[i].HICMOBillNo + '</span></h1>';
                                        switch (LoadData1[i].HICMOStatus) {
                                            case "待生产":
                                                html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border3"></span><span>' + LoadData1[i].HICMOStatus + '</span></h1>';
                                                break;
                                            case "生产中":
                                                html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border2"></span><span>' + LoadData1[i].HICMOStatus + '</span></h1>';
                                                break;
                                            case "挂起":
                                                html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData1[i].HICMOStatus + '</span></h1>';
                                                break;
                                            case "完工":
                                                html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border4"></span><span>' + LoadData1[i].HICMOStatus + '</span></h1>';
                                                break;
                                            default:
                                        }
                                        html1 += '<span class="prs">生产进度:</span>';
                                        html1 += '<div class="layui-progress layui-progress-big" lay-showPercent="yes">';
                                        html1 += '<div class="layui-progress-bar" lay-percent="' + LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty + '%" style="width:' + LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty + '%;">';
                                        html1 += '<span class="layui-progress-text">' + LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty + '%</span>';
                                        html1 += '</div > ';
                                        html1 += '</div>';
                                        html1 += '</dd>';
                                        html1 += '</dl>';
                                        html1 += '</div>';
                                        html1 += '</div>';
                                        $("#btomleft").append(html1);
                                    }
            if (HSourceID != "" && HSourceID != null) {
                $('.ctop').removeClass('check');  //删除不同父级clss样式相同的所有元素
                $("#ts" + i + "").addClass('check'); // 添加当前元素的样式
                //执行联动事件
                $.ajax({
                    url: GetWEBURL() + "/ReportPlatForm/SearchGetWorkBillList",
                    type: "GET",
                    data: { "HSourceID": HSourceID },
                    dataType: "json",//数据类型可以为 text xml json  script  jsonp
                    success: function (data) {
                        var LoadData1 = data.data.h_p_JIT_GetWorkBillListInfoBySource;
                        var LoadData2 = data.data.h_p_JIT_GetWorkBillListInfoBySource1;
                        var LoadData3 = data.data.h_p_JIT_GetWorkBillListInfoBySource2; //时间点产量
                        var LoadData4 = data.data.h_p_JIT_GetWorkBillListInfoBySource3; //不良分析
                        if (LoadData1.length > 0)  //工单列表数据
                        {
                            for (var i = 0; i < LoadData1.length; i++) {
                                var html1 = '';
                                //汇报总数大于计划数量,调整背景色提示
                                if (LoadData1[i].HDateFinishQty > LoadData1[i].HDatePlanQty) {
                                    html1 += '<div class="layui-col-sm12 layui-col-md3" style="background-color:#F595A0;border-radius: 3%;">';
                                } else {
                                    html1 += '<div class="layui-col-sm12 layui-col-md3">';
                                }
                                if (LoadData2.length > 0)  //当前状态数据
                                {
                                    for (var i = 0; i < LoadData2.length; i++) {
                                        var html1 = '';
                                        html1 += '<div class="layui-col-sm12 layui-col-md12">';
                                        html1 += '<dl class="topright">;'
                                        html1 += '<dt>';
                                        html1 += '<img src="../layuiadmin/layui/images/device.png" onError="this.src="../ layuiadmin/layui/images/erro.png";">';
                                        html1 += '</dt>';
                                        html1 += '<dd>';
                                        html1 += '<h1><span>当前设备:</span><span>' + LoadData2[i].HSourceName + '</span></h1>';
                                        html1 += '<h1><span>当前订单:</span><span>' + LoadData2[i].HSourceBillNo + '</span></h1>';
                                        html1 += '<h1><span>物料名称:</span><span>' + LoadData2[i].HMaterName + '</span></h1>';
                                        html1 += '<h1><span>计划数量:</span><span>' + LoadData2[i].HPlanQty + '</span></h1>';
                                        html1 += '<h1><span>以汇报数量:</span><span>' + LoadData2[i].HRelationQty + '</span></h1>';
                                        if (LoadData2[i].HRelationQty == 0 || LoadData2[i].HRelationQty == null)
                                        {
                                            html1 += '<h1><span>进度:</span><span>0%</span></h1>';
                                        }
                                        else
                                        {
                                            html1 += '<h1><span>进度:</span><span>' + (LoadData2[i].HRelationQty / LoadData2[i].HPlanQty) * 100 + '%</span></h1>';
                                        }
                                        html1 += '<h1><span>本单运行时间:</span><span>' + getSeconds(LoadData2[i].HSumTimes)+'</span></h1>';
                                        html1 += '<h1><span>本资源运行时间:</span><span>' + getSeconds(LoadData2[i].HSourceWorkTime) +'</span></h1>';
                                        html1 += '</dd>';
                                        html1 += '</dl>';
                                        html1 += '</div>';
                                        $("#topright").append(html1);
                                    }
                                html1 += '<div class="cns" id="bs' + (i + 1) + '" onclick="CheckBtom(this,' + (i + 1) + ')">';
                                html1 += '<dl>';
                                html1 += '<dd class="tcenter">';
                                html1 += '<h1 style="display:none;"><span>单据类型:</span><span id="ty' + (i + 1) + '">' + LoadData1[i].HBillType + '</span></h1>';
                                //HSourceInterID实际取值:Sc_ICMOBillStatus_Tmp  HInterID(单据主ID)
                                html1 += '<h1 style="display:none;"><span>源单主内码:</span><span id="sm' + (i + 1) + '">' + LoadData1[i].HSourceInterID + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>源单子内码:</span><span id="sb' + (i + 1) + '">' + LoadData1[i].HSourceEntryID + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>源单单号:</span><span id="sw' + (i + 1) + '">' + LoadData1[i].HSourceBillNo + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>源单类型:</span><span id="st' + (i + 1) + '">' + LoadData1[i].HSourceBillType + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>生产订单号主ID:</span><span id="df' + (i + 1) + '">' + LoadData1[i].HICMOInterID + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>生产订单子ID:</span><span id="ds' + (i + 1) + '">' + LoadData1[i].HICMOEntryID + '</span></h1>';
                                html1 += '<h1><span>工单号:</span><span id="wk' + (i + 1) + '">' + LoadData1[i].HICMOBillNo + '</span><span style="margin-left:25px;">日期:</span><span>' + LoadData1[i].计划日期 + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>产品ID:</span><span id="materid' + (i + 1) + '">' + LoadData1[i].HMaterID + '</span></h1>';
                                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>';
                                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>';
                                        break;
                                    case "生产中":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border2"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
                                        break;
                                    case "挂起":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
                                        break;
                                    case "完工":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border4"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
                                        break;
                                    default:
                                }
                            },
                            error: function (err) {
                                layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
                                return false;
                                html1 += '<span class="prs">生产进度:</span>';
                                html1 += '<div class="layui-progress layui-progress-big" lay-showPercent="yes">';
                                html1 += '<div class="layui-progress-bar" lay-percent="' + ((LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty) * 100).toFixed(2) + '%" style="width:' + ((LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty) * 100).toFixed(2) + '%;">';
                                html1 += '<span class="layui-progress-text">' + ((LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty) * 100).toFixed(2) + '%</span>';
                                html1 += '</div > ';
                                html1 += '</div>';
                                html1 += '</dd>';
                                html1 += '</dl>';
                                html1 += '</div>';
                                html1 += '</div>';
                                $("#btomleft").append(html1);
                            }
                        });
                }
                        }
                        if (LoadData2.length > 0)  //当前状态数据
                        {
                            HSBName = LoadData2[0].HSourceName;
                            for (var i = 0; i < LoadData2.length; i++) {
                                var html1 = '';
                                html1 += '<div class="layui-col-sm12 layui-col-md12">';
                                html1 += '<dl class="topright">'
                                html1 += '<dt>';
                                html1 += '<img src="../layuiadmin/layui/images/device.png" onError="this.src="../layuiadmin/layui/images/erro.png";">'
                                html1 += '</dt>';
                                html1 += '<dd>';
                                html1 += '<h1 style="display:none;"><span>设备编号:</span><span id="HEquipCode' + (i + 1) + '">' + LoadData2[i].HSourceCode + '</span></h1>';
                                html1 += '<h1><span>当前设备:</span><span id="HEquipName' + (i + 1) + '">' + LoadData2[i].HSourceName + '</span><div style="margin-left:25px;float:right"><span >首检次数:</span><span>' + LoadData2[i].首检次数 + '</span></div></h1>';
                                html1 += '<h1><span>当前订单:</span><span>' + LoadData2[i].HSourceBillNo + '</span><div style="margin-left:25px;float:right"><span >巡检次数:</span><span>' + LoadData2[i].巡检次数 + '</span></div></h1>';
                                html1 += '<h1><span>物料名称:</span><span>' + LoadData2[i].HMaterName + '</span><div style="margin-left:25px;float:right"><span >过程检次数:</span><span>' + LoadData2[i].过程检次数 + '</span></div></h1>';
                                html1 += '<h1><span>计划数量:</span><span>' + LoadData2[i].HPlanQty + '</span><div style="margin-left:25px;float:right"><span >当日点检时间:</span><span>' + LoadData2[i].当日点检时间 + '</span></div></h1>';
                                html1 += '<h1><span>已汇报数量:</span><span>' + LoadData2[i].HRelationQty + '</span><div style="margin-left:25px;float:right"><span >最后保养时间:</span><span>' + LoadData2[i].最后保养时间 + '</span></div></h1>';
                                if (LoadData2[i].HRelationQty == 0 || LoadData2[i].HRelationQty == null) {
                                    html1 += '<h1><span>进度:</span><span>0%</span><div style="margin-left:25px;float:right"><span >点检完成情况:</span><span>' + LoadData2[i].当日点检完成情况 + '</span></div></h1>';
                                }
                                else {
                                    html1 += '<h1><span>进度:</span><span>' + ((LoadData2[i].HRelationQty / LoadData2[i].HPlanQty) * 100).toFixed(2) + '%</span><div style="margin-left:25px;float:right"><span >点检完成情况:</span><span>' + LoadData2[i].当日点检完成情况 + '</span></div></h1>';
                                }
                                html1 += '<h1><span>本单运行时间:</span><span>' + getSeconds(LoadData2[i].HSumTimes) + '</span></h1>';
                                html1 += '<h1><span>本资源运行时间:</span><span>' + getSeconds(LoadData2[i].HSourceWorkTime) + '</span></h1>';
                                html1 += '</dd>';
                                html1 += '</dl>';
                                html1 += '</div>';
                                $("#topright").append(html1);
                            }
                        }
                        if (LoadData3.length > 0)  //当前状态数据
                        {
                            let k = 0; //LoadData3 数据数组的下标
                            for (let i = 8; i < 21; i++) {
                                let IsAdd = false; //是否要累加 LoadData3 数据数组的下标值
                                for (let j = 0; j < LoadData3.length; k) {
                                    if (i == LoadData3[k].时间点) { //如果 i(8--20) 时间点有产量,则把产量写入数组 HProQty,否则写入 0
                                        HProQty.push(LoadData3[k].产量)
                                        IsAdd = true;
                                        break;
                                    } else {
                                        HProQty.push(0)
                                        break;
                                    }
                                }
                                if (k < LoadData3.length - 1 && IsAdd == true) {
                                    k++;
                                }
                            }
                        }
                        if (LoadData4.length > 0) {
                            for (let i = 0; i < LoadData4.length; i++) {
                                HBadReason.push(LoadData4[i].不良原因);
                                HBadQty.push(LoadData4[i].不良数量);
                            }
                        }
                        //刷新图表数据
                        Mychart(mychart1, mychart2);
                    },
                    error: function (err) {
                        layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
                        return false;
                    }
                });
            }
        }
        //添加资源
        function Add(event, obj, i) {
@@ -255,7 +337,7 @@
                    {
                        return false;
                    }
                    var HUserName = "Admin";
                    var HUserName = sessionStorage["HUserName"];
                    var HSourceID = body.find("#HSourceID").val();
                    var HSourceCode = body.find("#HSourceCode").val();
                    var HSourceName = body.find("#HSourceName").val();
@@ -325,23 +407,20 @@
            var eqpid = "eqpid" + i;                   //获取指定资源样式ID
            HSourceID = $("#" + eqpid + "").html(); //通过样式ID获取html内容(资源ID)
            //逻辑删除方法
            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index)
            {
            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                $.ajax({
                    url: GetWEBURL() + "/ReportPlatForm/DeleteGetLineBindBillList",
                    type: "GET",
                    data: { "HSourceID": HSourceID },
                    data: { "HSourceID": HSourceID, "user": sessionStorage["HUserName"] },
                    dataType: "json",//数据类型可以为 text xml json  script  jsonp
                    success: function (data) {
                        if (data.count > 0)
                        {
                        if (data.count > 0) {
                            TSLoad(); //执行查询过程
                            layer.close(index);
                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 });
                            return false;
                        }
                        else
                        {
                        else {
                            layer.alert(data.Message, { time: 1 * 2000, icon: 5 });
                            return false;
                        }
@@ -355,8 +434,7 @@
        }
        //工单列表选中
        function CheckBtom(obj, i)
        {
        function CheckBtom(obj, i) {
            var partid = $(obj).parent().attr("id");   //获取父级id
            workcode = $("#wk" + i + "").html(); //通过样式ID获取html内容(工单号)
            HBillType = $("#ty" + i + "").html(); //通过样式ID获取html内容(单据类型)
@@ -364,7 +442,12 @@
            HSourceEntryID = $("#sb" + i + "").html(); //通过样式ID获取html内容(源单子内吗)
            HSourceBillNo = $("#sw" + i + "").html(); //通过样式ID获取html内容(源单单号)
            HSourceBillType = $("#st" + i + "").html(); //通过样式ID获取html内容(源单类型)
            HICMOInterID = $("#df" + i + "").html();     //生产订单主内码
            HICMOEntryID = $("#ds" + i + "").html();     //生产订单子内码
            HICMOBillNo = $("#wk" + i + "").html();     //生产订单号
            HMaterName = $("#ptn" + i + "").html();     //产品名称
            HMaterID = $("#materid" + i + "").html();     //产品ID
            HProcID = $("#procid" + i + "").html();     //工序ID
            if (workcode != "" && workcode != null) {
                $('.cns').removeClass('check1');  //删除不同父级clss样式相同的所有元素
@@ -375,6 +458,7 @@
        function Mychart(mychart1, mychart2) {
            //生产效率
            option1 = {
                title: {
                    text: '当前设备日生产效率'
@@ -399,7 +483,7 @@
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: ['08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00']
                    data: ['08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00']
                },
                yAxis: {
                    type: 'value'
@@ -409,14 +493,14 @@
                        name: '当前设备日生产效率',
                        type: 'line',
                        stack: '总量',
                        data: [120, 132, 101, 134, 90, 230, 210]
                        data: HProQty
                    }
                ]
            };
            //不良分析
            option2 = {
                title: {
                    text: '当前设备当日不良原因对比'
                    text: '当前设备本周不良原因对比'
                },
                legend: {
                    data: ['不良原因']
@@ -428,7 +512,7 @@
                    containLabel: true
                },
                xAxis: {
                    data: ['不良1', '不良二', '不良三', '不良四']
                    data: HBadReason
                },
                yAxis: {},
                series: [{
@@ -437,7 +521,7 @@
                    itemStyle: {
                        normal: {
                            color: function (params) {
                                var colorList = ['#2eddc1', '#FCCE10', '#E87C25', '#27727B', '#9efdc6'];
                                var colorList = ['#2eddc1', '#FCCE10', '#E87C25', '#27727B', '#9efdc6', '#F00DC6', '#8317E5', '#29086A', '#D8E848', '#17ADE5', '#FF1F86', '#A27E90', '#71BCCE', '#11715012', '#DBF7B2',];
                                return colorList[params.dataIndex]
                            },
                            label: {
@@ -447,7 +531,7 @@
                            }
                        }
                    },
                    data: [220, 182, 191, 234]
                    data: HBadQty
                }]
            };
@@ -522,18 +606,14 @@
            }
            return result;
        }
        //开工按钮点击事件
        function OpenWork(event, obj)
        {
            if (wktag == 0)
            {
                layer.alert("请选择工单列表", {icon: 5 });
        function OpenWork(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "开工"))
            {
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "开工")) {
                layer.alert("单据状态不满足开工条件!", { icon: 5 });
                return false;
            }
@@ -545,20 +625,20 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/生产开工单/Sc_Add_MESBeginWorkBillList.html?hID=&Type=2',
                content: '生产管理/生产开工单/Sc_Add_MESBeginWorkBillList.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
                        });
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
@@ -567,10 +647,88 @@
            });
        }
        //快速开工
        function KSOpenWork(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "开工")) {
                layer.alert("单据状态不满足开工条件!", { icon: 5 });
                return false;
            }
            var indexOpen = layer.open({
                type: 1
                , title: "确认开工吗?"
                , closeBtn: false
                , area: '300px;'
                , shade: 0.8
                , id: 'LAY_layuipro' //设定一个id,防止重复弹出
                , btn: ['确定', '取消']
                , btnAlign: 'c'
                , moveType: 1 //拖拽模式,0或者1
                , content: '<div style="padding: 50px; line-height: 22px; font-weight: 300;text-align:center;">设备编号:' + HSourceName1 + '<br>工单号:' + workcode + '<br>产品名称:' + HMaterName + '<br></div>'
                , btn1: function (index, layero, e) {
                    //新增开工单
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/SaveGetMESBeginWorkFrom_KS", //方法所在页面和方法名
                        data: { "HBillType": HBillType, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "user": sessionStorage["HUserName"], "HSourceBillType": HSourceBillType },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // 得到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    //window.location.reload();
                                });
                                layer.close(indexOpen);
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
            });
        }
        //SOP 作业指导书
        function SOP(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            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,
                end: function () {
                },
            });
            /* window.open("../../../views/生产管理/作业指导书/Gy_SOPBill_Video.html?OperationType=5&HMaterID=" + HMaterID + "&HSourceNo=" + workcode + "&HSourceEntryID=" + HSourceEntryID);*/
        }
        //汇报按钮点击事件
        function OpenReport(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "汇报")) {
                layer.alert("单据状态不满足汇报条件!", { icon: 5 });
                return false;
            }
            layer.open({
@@ -581,7 +739,7 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/产量汇报单/Sc_Add_ProductReportBillList.html?hID=&Type=2',
                content: '生产管理/产量汇报单/Sc_Add_ProductReportBillList.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
@@ -608,8 +766,7 @@
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "完工"))
            {
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "完工")) {
                layer.alert("单据状态不满足完工条件!", { icon: 5 });
                return false;
            }
@@ -621,7 +778,7 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/生产完工单/Sc_Add_MESEndWorkBillList.html?hID=&Type=2',
                content: '生产管理/生产完工单/Sc_Add_MESEndWorkBillList.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
@@ -648,8 +805,7 @@
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "停工"))
            {
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "停工")) {
                layer.alert("单据状态不满足停工条件!", { icon: 5 });
                return false;
            }
@@ -661,7 +817,7 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/生产停工单/Sc_Add_MESStopWorkBillList.html?hID=&Type=2',
                content: '生产管理/生产停工单/Sc_Add_MESStopWorkBillList.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
@@ -689,24 +845,93 @@
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            var IsCheck = false;
            //根据系统参数控制,判断生产订单是否做了首件检验单和工序检验单,如果有其中一种检验单没做,则不让做生产汇报单
            $.ajax({
                url: GetWEBURL() + "/ReportPlatForm/IsCheck",
                type: "GET",
                data: { "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID, "HICMOBillNo": HICMOBillNo },
                async: false,
                success: function (data) {
                    if (data.code == 0) {
                        layer.alert(data.Message);
                        return false;
                    } else {
                        IsCheck = true;
                    }
                },
                error: function (err) {
                    layer.alert(data.Message);
                    return false;
                }
            });
            if (IsCheck == true) {
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '产量汇报列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['100%', '100%'],
                    maxmin: true,
                    content: '生产管理/产量汇报单/Sc_ProductReportBillList.html?OperationType=2&linterid=&HSouceBillType=',
                    end: function () {
                    },
                    success: function (dom, index) {
                        var data = [];
                        data.push({
                            "workcode": workcode,
                            "HSourceID": HSourceID1,
                            "HSourceName": HSourceName1,
                            "HICMOInterID": HICMOInterID,
                            "HICMOEntryID": HICMOEntryID,
                            "HMaker": sessionStorage["HUserName"],    //sessionStorage["HUserName"]
                            "Czybm": sessionStorage["Czybm"],
                            //"HEmpID": "0",    //sessionStorage["HEmpID"]
                            "HSourceBillType": HSourceBillType
                        });
                        //通过索引获取到当前iframe弹出层
                        var iframe = window['layui-layer-iframe' + index];
                        //调用iframe弹出层内的方法
                        iframe.edit(data);
                    },
                });
            }
        }
        //上料防错单
        function OpenMaterToSource() {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '产量汇报列表',
                title: '新增上料防错单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/产量汇报单/Sc_ProductReportBillList.html?hID=&Type=2',
                content: '生产管理/上料防错单/Sc_Add_MaterToSourceBillList.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "workcode": workcode,
                        "HSourceID": HSourceID1,
                        "HSourceName": HSourceName1
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
@@ -717,26 +942,363 @@
            });
        }
        //首检检验
        function OpenFistCheck(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_Add_Edit_FirstPieceCheckBill.html?OperationType=2&linterid=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID, 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //过程检验
        function OpenProcess(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=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID, 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //不良采集
        function BadGather() {
            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: ['生产管理/质量汇报单/Sc_QualityReportBill.html?OperationType=2&linterid=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HSourceEntryID, 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //当前工单按钮点击事件
        function CurrentStatus(event, obj) {
            if (wktag == 0) {
                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_CurrentTicket.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HEquipName": $("#HEquipName1").text(),
                        "HEquipCode": $("#HEquipCode1").text(),
                        "HICMOBillNo": workcode,
                        "HICMOInterID": HICMOInterID,
                        "HICMOEntryID": HICMOEntryID,
                        "HSourceID": HSourceID1,
                        "HEmpName": HEmpName,
                        "HManagerName": HManagerName,
                        "HGroupName": HGroupName,
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //当前工单(汇报)按钮点击事件
        function CodingReport(event, obj) {
            if (wktag == 0) {
                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: '车间管理/工序出站汇报单/Cj_StationOutBill_CurrentWork.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HEquipName": $("#HEquipName1").text(),
                        "HEquipCode": $("#HEquipCode1").text(),
                        "HICMOBillNo": workcode,
                        "HICMOInterID": HICMOInterID,
                        "HICMOEntryID": HICMOEntryID,
                        "HSourceID": HSourceID1,
                        "HSourceName": HSourceName1,
                        "HEmpName": HEmpName,
                        "HManagerID": HManagerID,
                        "HManagerName": HManagerName,
                        "HGroupName": HGroupName,
                        "HGroupID": HGroupID,
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //设备启动点检按钮点击事件
        function BeginDotCheck(event, obj) {
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增设备启动点检单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '车间管理/启动点检单/Sc_WorkBeginDotCheckBill.html?OperationType=4&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HMaterID": HMaterID,
                        "HProcID": HProcID,
                        "HSourceID": HSourceID1,
                        "SCOrder": HSourceBillNo
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //异常按钮点击事件
        function Abnormal (event, obj) {
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '异常反馈类型',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/异常反馈单/Sc_MESExecptFeedBackBillType.html',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HICMOBillNo": HICMOBillNo,//工单号
                        "HSourceName": HSBName, //设备
                        "HSourceBillNo": HSourceBillNo //工序流转卡
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //防错验证清单按钮点击事件
        function PreventErrMouldCheck(event, obj) {
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增防错验证',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '车间管理/防错验证/Qc_PreventErrMouldCheckBill.html?OperationType=4&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HMaterID": HMaterID,
                        "HProcID": HProcID,
                        "SCOrder": HSourceBillNo
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //检验取样按钮点击事件
        function TakeSample(event, obj) {
            if (wktag == 0) {
                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: '质量管理/检验取样还样单/QC_Add_TakeSampleCheckBill.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 TechParam(event, obj) {
            if (wktag == 0) {
                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: '设备管理/设备工艺参数订单点检表/SB_EquipICMOTechParamBillEdit.html?OperationType=4&linterid=&HEntryID=',
                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 Esc(event, obj) {
            parent.location.href = "index.html"
        }
        //单据状态验证
        function WorkStaus(HSourceID1, workcode,HSourceInterID,btn)
        {
        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')";   //开工状态
                    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')";   //完工状态
                    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')";   //停工挂起状态
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1')";   //是否有不为停工挂起状态
                    break;
                case "汇报":
                    html1 = '';
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、停工挂起状态
                    break;
                case "报检申请":
                    break;
                default:
            }
@@ -744,26 +1306,24 @@
            $.ajax({
                url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus",
                type: "GET",
                data: { "sWhere": sWhere},
                data: { "sWhere": sWhere },
                dataType: "json",//数据类型可以为 text xml json  script  jsonp
                async: false,
                success: function (data) {
                    if (data.count > 0)
                    {
                    if (data.count > 0) {
                        flag = true;
                    }
                    else {
                        flag =false;
                        flag = false;
                    }
                },
                error: function (err)
                {
                error: function (err) {
                    flag = false;
                }
            });
            console.log(flag);
            return flag;
        }
    </script>
@@ -805,11 +1365,11 @@
                <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                    <ul class="layui-tab-title">
                        <li class="layui-this">工单列表</li>
                        <li style="pointer-events: none; background-color:rgb(0 0 0 / 10%);">效率/不良分析</li>
                        <li>效率/不良分析</li><!--style="pointer-events: none; background-color:rgb(0 0 0 / 10%);"-->
                    </ul>
                    <div class="layui-tab-content content3">
                        <div class="layui-tab-item layui-show">
                            <div class="layui-row layui-col-space10" id="btomleft">
                            <div class="layui-row layui-col-space10" id="btomleft" style="height:600px;display:block;overflow-y:auto;">
                            </div>
                        </div>
@@ -837,7 +1397,7 @@
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenWork(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-pause imgicon"></span>
                                    <span class="layui-icon layui-icon-play imgicon"></span>
                                    <span class="imgtitle">开工</span>
                                </div>
                            </div>
@@ -854,66 +1414,122 @@
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10" style="display:none;">
                            <div class="layui-col-sm12 layui-col-md4" onclick="KSOpenWork(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-pause imgicon"></span>
                                    <span class="imgtitle">快速开工</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4">
                            <div class="layui-col-sm12 layui-col-md4" onclick="SOP(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-read imgicon"></span>
                                    <span class="imgtitle">作业指导书</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenFistCheck(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-search imgicon"></span>
                                    <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%)">
                            <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;">
                                    <span class="layui-icon layui-icon-search imgicon"></span>
                                    <span class="imgtitle">巡检</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4">
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenProcess(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-search imgicon"></span>
                                    <span class="imgtitle">过程检验</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10" onclick="OpenInSpection(event,this)">
                            <div class="layui-col-sm12 layui-col-md4">
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenInSpection(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-release imgicon"></span>
                                    <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%)">
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenMaterToSource(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-engine imgicon"></span>
                                    <span class="imgtitle">上料防呆</span>
                                    <span class="imgtitle">上料防错</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4">
                            <div class="layui-col-sm12 layui-col-md4" onclick="BadGather(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-chart imgicon"></span>
                                    <span class="imgtitle">不良采集</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10" onclick="OpenStop(event,this)">
                            <div class="layui-col-sm12 layui-col-md4">
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenStop(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-play imgicon"></span>
                                    <span class="layui-icon layui-icon-pause imgicon"></span>
                                    <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%)">
                            <div class="layui-col-sm12 layui-col-md4" onclick="Abnormal(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-unlink imgicon"></span>
                                    <span class="imgtitle">异常</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4">
                            <div class="layui-col-sm12 layui-col-md4" onclick="Esc(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-close imgicon"></span>
                                    <span class="imgtitle">退出</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="CurrentStatus(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-console imgicon"></span>
                                    <span class="imgtitle">当前状态</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="CodingReport(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-console imgicon"></span>
                                    <span class="imgtitle">当前工单(汇报)</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="BeginDotCheck(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-search imgicon"></span>
                                    <span class="imgtitle">设备启动点检</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="PreventErrMouldCheck(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-engine imgicon"></span>
                                    <span class="imgtitle">防错验证</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="TakeSample(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-form imgicon"></span>
                                    <span class="imgtitle">检验取样</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="TechParam(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-tabs imgicon"></span>
                                    <span class="imgtitle">工艺参数点检</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </fieldset>
            </div>
@@ -921,4 +1537,4 @@
    </div>
</body>
</html>
</html>