1
duhe
2025-07-02 86edf5829b69a4cdd93ec443871f9d2ecb6702b2
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨_PDA/IpadIndex_PDA.html
@@ -239,7 +239,9 @@
        var HBadQty = [];       //不良数量
        var HBadReason = [];       //不良原因
        var HEmpName = "";      //操作员
        var HManagerID = 0;
        var HManagerName = "";      //负责人
        var HGroupID = 0;         //班组ID
        var HGroupName = "";      //班组
        var HProcID = 0;      //工序
        var HSBName = "";   //设备名称
@@ -265,12 +267,11 @@
            } else {
                OperationType = params[params[0]];//操作类型
                linterid = params[params[1]];//源单id
                HGroupID = params[params[2]];//班组ID
            }
            fetchButtonsData();
            fetchListData(linterid);
        });
        var HManagerID = 0;
        var HGroupID = 0;
        //加载当前用户按钮
        function fetchButtonsData() {
@@ -354,6 +355,7 @@
        function fetchListData(HSourceID) {
            if (HSourceID != "0" && HSourceID != null && HSourceID!="") {
                $('.ctop').removeClass('check');  //删除不同父级clss样式相同的所有元素
                HSourceID1 = HSourceID;
                //执行联动事件
                $.ajax({
                    url: GetWEBURL() + "/ReportPlatForm/SearchGetWorkBillList",
@@ -645,7 +647,8 @@
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                        "HSourceBillType": HSourceBillType,
                        "HGroupID": HGroupID
                    });
                    //通过索引获取到当前iframe弹出层
@@ -653,6 +656,156 @@
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //快捷开工
        function OpenFastWork(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/FastBeginWorkBill", //方法所在页面和方法名
                        data: { "HBillType": HBillType, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "user": sessionStorage["HUserName"] },
                        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 });
                        }
                    });
                }
            });
        }
        //快捷完工
        function OpenFastEnd(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_MESEndWorkBill/FastEndWorkBill", //方法所在页面和方法名
                        data: { "HBillType": HBillType, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "user": sessionStorage["HUserName"] },
                        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 });
                        }
                    });
                }
            });
        }
        //快捷停工
        function OpenFastStop(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_MESStopWorkBill/FastStopWorkBill", //方法所在页面和方法名
                        data: { "HBillType": HBillType, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "user": sessionStorage["HUserName"] },
                        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 });
                        }
                    });
                }
            });
        }
@@ -759,7 +912,8 @@
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                        "HSourceBillType": HSourceBillType,
                        "HGroupID": HGroupID
                    });
                    //通过索引获取到当前iframe弹出层
@@ -798,7 +952,8 @@
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                        "HSourceBillType": HSourceBillType,
                        "HGroupID": HGroupID
                    });
                    //通过索引获取到当前iframe弹出层
@@ -837,7 +992,8 @@
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                        "HSourceBillType": HSourceBillType,
                        "HGroupID": HGroupID
                    });
                    //通过索引获取到当前iframe弹出层
@@ -1038,14 +1194,28 @@
                , shade: 0.6
                , maxmin: false
                , anim: 0
                , content: ['生产管理/质量汇报单/Sc_QualityReportBill.html?OperationType=2&linterid=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HSourceEntryID, 'yes']
                , content: ['../../生产管理/报工平台_PDA/质量汇报/Sc_QualityReportBill_PDA.html?OperationType=2&linterid=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HSourceEntryID, 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
                ,success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType,
                        "HGroupID": HGroupID
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            })
        }
@@ -1221,7 +1391,7 @@
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/异常反馈单/Sc_MESExecptFeedBackBillType.html',
                content: '../../生产管理/异常反馈单/Sc_MESExecptFeedBackBillType.html',
                end: function () {
                },
@@ -1446,6 +1616,78 @@
                    });
                    return flag;
                case "快捷开工":
                    sWhere = { "HSourceID": HSourceID1, "HICMOBillNo": workcode, "HInterID": HSourceInterID,"type":"开工"}
                    $.ajax({
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus",
                        type: "GET",
                        data: { "sWhere": JSON.stringify(sWhere) },
                        dataType: "json",//数据类型可以为 text xml json  script  jsonp
                        async: false,
                        success: function (data) {
                            if (data.count > 0) {
                                flag = true;
                            }
                            else {
                                flag = false;
                            }
                        },
                        error: function (err) {
                            flag = false;
                        }
                    });
                    return flag;
                case "快捷停工":
                    sWhere = { "HSourceID": HSourceID1, "HICMOBillNo": workcode, "HInterID": HSourceInterID, "type": "停工" }
                    $.ajax({
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus",
                        type: "GET",
                        data: { "sWhere": JSON.stringify(sWhere) },
                        dataType: "json",//数据类型可以为 text xml json  script  jsonp
                        async: false,
                        success: function (data) {
                            if (data.count > 0) {
                                flag = true;
                            }
                            else {
                                flag = false;
                            }
                        },
                        error: function (err) {
                            flag = false;
                        }
                    });
                    return flag;
                case "快捷完工":
                    sWhere = { "HSourceID": HSourceID1, "HICMOBillNo": workcode, "HInterID": HSourceInterID, "type": "完工" }
                    $.ajax({
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus",
                        type: "GET",
                        data: { "sWhere": JSON.stringify(sWhere) },
                        dataType: "json",//数据类型可以为 text xml json  script  jsonp
                        async: false,
                        success: function (data) {
                            if (data.count > 0) {
                                flag = true;
                            }
                            else {
                                flag = false;
                            }
                        },
                        error: function (err) {
                            flag = false;
                        }
                    });
                    return flag;
            }
        }
    </script>