1
zrg
2 天以前 de25bba1a0e289c78bc42018d97915c10bbd7381
WebTM/views/IpadIndex.html
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>报工平台</title>
@@ -49,7 +48,6 @@
        var HGroupName = "";      //班组
        var HProcID = 0;      //工序
        var HSBName = "";   //设备名称
        var HReportTotal = 0;      // 当前选中工单的汇报总数
        //注意:选项卡 依赖 element 模块,否则无法进行功能性操作
        layui.config({
@@ -63,8 +61,7 @@
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element
                ;
                , element = layui.element;
            //window 全局变量
            window.mychart1 = echarts.init(document.getElementById('mychart1'));
            window.mychart2 = echarts.init(document.getElementById('mychart2'));
@@ -88,13 +85,11 @@
                dataType: "json",//数据类型可以为 text xml json  script  jsonp
                success: function (data) {
                    var LoadData = data.data.h_p_JIT_GetSourceInfoByUser;
                    // 华舟分组内容
                    var LoadingTabsContact = {}
                    if (LoadData.length > 0)// 说明验证成功了,
                    {
                        HSBName = LoadData[0].HSourceName;
                        for (var i = 1; i <= LoadData.length + 1; i++) {
                            // sessionStorage["Organization"] == "宁波市华舟包装有限公司"
                            if (sessionStorage["Organization"] == "宁波市华舟包装有限公司") {
                                if (i <= LoadData.length) {
                                    var html1 = '';
@@ -135,9 +130,7 @@
                                    html1 += '</dl>';
                                    html1 += '</div>';
                                    html1 += '</div>';
                                    // 使用不可见对象暂存渲染的html
                                    $("#topleftTemp").append(html1);
                                    $("#topleft").append(html1);
                                    $("#ts" + i + "").append('<span class="layui-icon layui-icon-delete delete"  onclick="Delete(event,this,' + i + ')"></span>'); //在当前div后追加加一个span删除
                                    //根据返回的 选中标志HNowFlag设置选中的资源
@@ -146,31 +139,19 @@
                                        $("#ts" + i + "").addClass('check'); // 添加当前元素的样式
                                        Check(this, i);
                                    }
                                    if (LoadData[i - 1].HSourceNumber.substring(0, 2) == 'ZS') {
                                        var GroupName = LoadData[i - 1].HSourceNumber.substring(3, 4)
                                        if (!LoadingTabsContact[GroupName]) {
                                            LoadingTabsContact[GroupName] = []
                                        }
                                        LoadingTabsContact[GroupName].push($("#topleftTemp").html())
                                    }
                                    $("#topleftTemp").empty()
                                }
                                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);
                                    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 + ')">';
@@ -212,7 +193,6 @@
                                    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删除
@@ -236,50 +216,6 @@
                            }
                        }
                        if (sessionStorage["Organization"] == "宁波市华舟包装有限公司") {
                            // 华舟 使用分组标签
                            var divParent = document.createElement("div")
                            divParent.classList.add("layui-tab")
                            divParent.classList.add("layui-tab-card")
                            var tabTitle = document.createElement("ul")
                            var tabContent = document.createElement("div")
                            tabTitle.classList.add("layui-tab-title")
                            tabContent.classList.add("layui-tab-content")
                            var index = 0
                            for (var key in LoadingTabsContact) {
                                var liItem = document.createElement("li")
                                liItem.innerText = key
                                var tabItem = document.createElement("div")
                                tabItem.classList.add("layui-tab-item")
                                tabItem.classList.add("layui-row")
                                tabItem.classList.add("layui-col-space10")
                                if (index == 0) {
                                    liItem.classList.add("layui-this")
                                    tabItem.classList.add("layui-show")
                                }
                                for (var j = 0; j < LoadingTabsContact[key].length; j++) {
                                    tabItem.innerHTML += LoadingTabsContact[key][j]
                                }
                                tabTitle.appendChild(liItem)
                                tabContent.appendChild(tabItem)
                                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>';
                                tabItem.innerHTML += html1;
                                index++
                            }
                            divParent.appendChild(tabTitle)
                            divParent.appendChild(tabContent)
                            $("#topleft").append(divParent)
                        }
                    }
                    else {
                        var html1 = '';
@@ -551,8 +487,7 @@
                                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 id="qty' + (i + 1) + '">' + LoadData1[i].HWCHQty + '</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>';
@@ -788,7 +723,6 @@
            HMaterName = $("#ptn" + i + "").html();     //产品名称
            HMaterID = $("#materid" + i + "").html();     //产品ID
            HProcID = $("#procid" + i + "").html();     //工序ID
            HReportTotal = $("#qty" + i + "").html();//获取汇报总数
            if (workcode != "" && workcode != null) {
                $('.cns').removeClass('check1');  //删除不同父级clss样式相同的所有元素
@@ -962,7 +896,6 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                scrollbar: false,
                content: '生产管理/生产开工单/Sc_Add_MESBeginWorkBillList.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
@@ -1004,7 +937,6 @@
                , id: 'LAY_layuipro' //设定一个id,防止重复弹出
                , btn: ['确定', '取消']
                , btnAlign: 'c'
                , scrollbar: false
                , 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) {
@@ -1050,7 +982,6 @@
                closeBtn: 1,
                shift: 2,
                area: ['95%', '95%'],
                scrollbar: false,
                maxmin: true,
                content: '生产管理/作业指导书/Gy_SOPBill_Video.html?OperationType=5&HMaterID=' + HMaterID + '&HSourceNo=' + workcode + '&HSourceEntryID=' + HSourceEntryID + '&HProcID=' + HProcID,
                end: function () {
@@ -1139,7 +1070,6 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                scrollbar: false,
                content: '生产管理/生产完工单/Sc_Add_MESEndWorkBillList.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
@@ -1179,7 +1109,6 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                scrollbar: false,
                content: '生产管理/生产停工单/Sc_Add_MESStopWorkBillList.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
@@ -1322,7 +1251,6 @@
                title: '新增停工恢复单',
                closeBtn: 1,
                shift: 2,
                scrollbar: false,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/报工台工序/停工恢复单/Sc_MESStopRestoreWorkBill.html?OperationType=2&linterid=&HSouceBillType=',
@@ -1362,7 +1290,6 @@
                , anim: 0
                , content: ['质量管理/首件检验单/QC_Add_Edit_FirstPieceCheckBill.html?OperationType=2&linterid=' + HProcExchInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID + '&HSourceEntryID=' + HSourceEntryID + '', 'yes']
                , resize: false
                , scrollbar: false
                , cancel: function () {
                }
                , end: function () {
@@ -1437,7 +1364,6 @@
                , anim: 0
                , content: ['生产管理/质量汇报单/Sc_QualityReportBill.html?OperationType=2&linterid=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HSourceEntryID, 'yes']
                , resize: false
                , scrollbar: false
                , cancel: function () {
                }
@@ -1467,7 +1393,6 @@
                , anim: 0
                , content: ['生产管理/质量汇报单/Sc_QualityReportBill.html?OperationType=2&linterid=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HSourceEntryID + '&HBillSubType=微瑕品', 'yes']
                , resize: false
                , scrollbar: false
                , cancel: function () {
                }
@@ -1531,75 +1456,52 @@
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            //当前工单(汇报)按钮点击事件
            function CodingReport(event, obj) {
                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: '车间管理/工序出站汇报单/Cj_StationOutBill_CurrentWork.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                // 判断是否为华舟组织
                if (sessionStorage["Organization"] == "宁波市华舟包装有限公司") {
                    // 华舟组织:若汇报总数不为0则跳过状态检查,否则执行检查
                    if (parseFloat(HReportTotal) !== 0) {
                        // 汇报总数不为0,直接打开(不执行 WorkStaus 检查)
                    } else {
                        // 汇报总数等于0,执行原有的状态检查
                        if (WorkStaus(HSourceID1, workcode, HSourceInterID, "斯莫尔汇报")) {
                            layer.alert("单据状态不满足汇报条件!", { icon: 5 });
                            return false;
                        }
                    }
                } else {
                    // 非华舟组织:保持原有逻辑,直接执行 WorkStaus 检查
                    if (WorkStaus(HSourceID1, workcode, HSourceInterID, "斯莫尔汇报")) {
                        layer.alert("单据状态不满足汇报条件!", { icon: 5 });
                        return false;
                    }
                }
                },
                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 弹窗(原有代码不变)
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '当前工单',
                    closeBtn: 1,
                    shift: 2,
                    area: ['100%', '100%'],
                    maxmin: true,
                    scrollbar: false,
                    content: '车间管理/工序出站汇报单/Cj_StationOutBill_CurrentWork.html?OperationType=2&linterid=&HSouceBillType=',
                    end: function () {
                        // 可选的关闭回调
                    },
                    success: function (dom, index) {
                        var data = [{
                            "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);
                },
                        //通过索引获取到当前iframe弹出层
                        var iframe = window['layui-layer-iframe' + index];
                        //调用iframe弹出层内的方法
                        iframe.edit(data);
                    }
                });
            }
            });
        }
        //设备启动点检按钮点击事件
@@ -1643,7 +1545,6 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                scrollbar: false,
                content: '生产管理/异常反馈单/Sc_MESExecptFeedBackBillType.html',
                end: function () {
@@ -1707,7 +1608,6 @@
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                scrollbar: false,
                maxmin: true,
                content: '质量管理/检验取样还样单/QC_Add_TakeSampleCheckBill.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
@@ -1798,8 +1698,6 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                scrollbar: false,
                content: '质量管理/异常反馈/OA_ErrMsgBackSelfQuery_BGT.html?OperationType=2',
                end: function () {
@@ -1899,7 +1797,6 @@
                        <div class="layui-row layui-col-space10" id="topleft">
                        </div>
                        <div style="display: none;" id="topleftTemp"> </div>
                    </div>
                </fieldset>
            </div>
@@ -1923,8 +1820,7 @@
                    </ul>
                    <div class="layui-tab-content content3">
                        <div class="layui-tab-item layui-show">
                            <div class="layui-row layui-col-space10" id="btomleft"
                                style="height:600px;display:block;overflow-y:auto;">
                            <div class="layui-row layui-col-space10" id="btomleft" style="height:600px;display:block;overflow-y:auto;">
                            </div>
                        </div>
@@ -2117,5 +2013,4 @@
    </div>
</body>
</html>