WebTM/views/IpadIndex.html
@@ -54,7 +54,6 @@
            var mychart2 = echarts.init(document.getElementById('mychart2'));
            element.on('tab(TabTest)', function (data) {
                console.log(data);
                Mychart(mychart1, mychart2);
                mychart1.resize();
                mychart2.resize();
@@ -64,7 +63,7 @@
        });
        function TSLoad() {
            $("#topleft").html("");
            var HUserName = "Admin" //sessionStorage["HUserName"];     //默认当前登录人员
            var HUserName = "Admin";  //sessionStorage["HUserName"];     //默认当前登录人员
            $.ajax({
                url: GetWEBURL() + "/ReportPlatForm/SearchGetLineBindBillList",
                type: "GET",
@@ -112,8 +111,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) {
@@ -144,6 +148,7 @@
                            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)  //工单列表数据
@@ -155,11 +160,14 @@
                                        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>';
                                        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></h1>';
@@ -198,7 +206,7 @@
                                        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 += '<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>';
@@ -363,7 +371,9 @@
            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();     //生产订单子内码
            if (workcode != "" && workcode != null) {
                $('.cns').removeClass('check1');  //删除不同父级clss样式相同的所有元素
@@ -531,7 +541,11 @@
                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', //加上边框
@@ -566,6 +580,10 @@
        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({
@@ -603,6 +621,11 @@
                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', //加上边框
@@ -636,6 +659,11 @@
        function OpenStop(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "停工"))
            {
                layer.alert("单据状态不满足停工条件!", { icon: 5 });
                return false;
            }
            layer.open({
@@ -682,7 +710,7 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/产量汇报/Sc_ProductReportBillList.html?hID=&Type=2',
                content: '生产管理/产量汇报单/Sc_ProductReportBillList.html?hID=&Type=2',
                end: function () {
                },
@@ -691,7 +719,12 @@
                    data.push({
                        "workcode": workcode,
                        "HSourceID": HSourceID1,
                        "HSourceName": HSourceName1
                        "HSourceName": HSourceName1,
                        "HICMOInterID": HICMOInterID,
                        "HICMOEntryID": HICMOEntryID,
                        "HMaker": "Admin",    //sessionStorage["HUserName"]
                        //"HEmpID": "0",    //sessionStorage["HEmpID"]
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
@@ -701,7 +734,104 @@
                },
            });
        }
        //首检检验
        function OpenFistCheck(event, obj)
        {
            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, 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //过程检验
        function OpenProcess(event, obj)
        {
            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, 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //退出
        function Esc(event, obj)
        {
            parent.location.href = "index.html"
        }
        //单据状态验证
        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')";   //开工状态
                    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')";   //汇报状态
                    break;
                case "报检申请":
                    break;
                default:
            }
            $.ajax({
                url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus",
                type: "GET",
                data: { "sWhere": 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>
@@ -741,11 +871,11 @@
                <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                    <ul class="layui-tab-title">
                        <li class="layui-this">工单列表</li>
                        <li>效率/不良分析</li>
                        <li style="pointer-events: none; background-color:rgb(0 0 0 / 10%);">效率/不良分析</li>
                    </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>
@@ -791,7 +921,7 @@
                            </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="OpenFistCheck(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-search imgicon"></span>
                                    <span class="imgtitle">首检</span>
@@ -803,15 +933,15 @@
                                    <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>
@@ -824,14 +954,14 @@
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4">
                                <div class="cnt bottomright">
                                <div class="cnt bottomright" style="pointer-events:none; background-color:rgb(0 0 0 / 10%)">
                                    <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="imgtitle">停工</span>
@@ -843,7 +973,7 @@
                                    <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>