wtt
2025-04-24 b4f231bb0e3a624e23964f2fbac573da680f110f
报工平台快捷开工快捷停工快捷完工
1个文件已修改
223 ■■■■■ 已修改文件
WebTM/views/生产管理/报工平台_PDA/IpadIndex_PDA.html 223 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨_PDA/IpadIndex_PDA.html
@@ -355,6 +355,7 @@
        function fetchListData(HSourceID) {
            if (HSourceID != "0" && HSourceID != null && HSourceID!="") {
                $('.ctop').removeClass('check');  //删除不同父级clss样式相同的所有元素
                HSourceID1 = HSourceID;
                //执行联动事件
                $.ajax({
                    url: GetWEBURL() + "/ReportPlatForm/SearchGetWorkBillList",
@@ -655,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 });
                        }
                    });
                }
            });
        }
@@ -1465,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>