zgq
2021-07-20 851454f76f475eba2b11f28d6e9703dd02bcbe13
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();
@@ -144,6 +143,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,7 +155,8 @@
                                        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>';
@@ -531,7 +532,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', //加上边框
@@ -603,6 +608,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 +646,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 +697,7 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/产量汇报/Sc_ProductReportBillList.html?hID=&Type=2',
                content: '生产管理/产量汇报单/Sc_ProductReportBillList.html?hID=&Type=2',
                end: function () {
                },
@@ -701,7 +716,56 @@
                },
            });
        }
        //单据状态验证
        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 "汇报":
                    html1 = '';
                    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;
                }
            });
            console.log(flag);
            return flag;
        }
    </script>
</head>
@@ -741,7 +805,7 @@
                <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">