yxj
2023-09-12 27d6c2ea62c90adb74cc63db4985bbe3e848b325
WebTM/views/¼Æ»®¹ÜÀí/¹¤ÒÕ·Ïß/Gy_RoutingBill.html
@@ -142,39 +142,36 @@
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline" id="HIDDEN" style="display:none;">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">工序</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" lay-verify="HMainProcIDName" name="HMainProcIDName" id="HMainProcIDName"  value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HMainProcID" id="HMainProcID" lay-verify="HMainProcID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchProc" id="btnSearchProc" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <!--<div class="layui-inline">
            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">工序</label>
            <div class="layui-input-block" style="margin-left: 77px;">
                <input type="text" class="layui-input" lay-verify="HMainProcIDName" name="HMainProcIDName" id="HMainProcIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                <input type="hidden" class="layui-input" name="HMainProcID" id="HMainProcID" lay-verify="HMainProcID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchProc" id="btnSearchProc" style="padding: 0 10px;float: right;margin-right: 3px;">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" ></i>
                </button>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">工作中心</label>
            <div class="layui-input-block" style="margin-left: 77px;">
                <input type="text" class="layui-input" lay-verify="HMainCenterIDName" name="HMainCenterIDName" id="HMainCenterIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                <input type="hidden" class="layui-input" name="HMainCenterID" lay-verify="HMainCenterID" id="HMainCenterID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnWorkCenter" id="btnWorkCenter" style="padding: 0 10px;float: right;margin-right: 3px;">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                </button>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">生产班组</label>
            <div class="layui-input-block" style="margin-left: 77px;">
                <input type="text" class="layui-input" name="HGroupIDName" lay-verify="HGroupIDName" id="HGroupIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                <input type="hidden" class="layui-input" name="HGroupID" lay-verify="HGroupID" id="HGroupID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnGroup" id="" style="padding: 0 10px;float: right;margin-right: 3px;">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                </button>
            </div>
        </div>-->
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">工作中心</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" lay-verify="HMainCenterIDName" name="HMainCenterIDName" id="HMainCenterIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HMainCenterID" lay-verify="HMainCenterID" id="HMainCenterID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnWorkCenter" id="btnWorkCenter" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">生产班组</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HGroupIDName" lay-verify="HGroupIDName" id="HGroupIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HGroupID" lay-verify="HGroupID" id="HGroupID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnGroup" id="" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
                                        </div>-->
                                    </div>
                                    <div class="layui-row">
                                        <!--<div class="layui-inline">
@@ -492,7 +489,10 @@
                , "HBeginDayQty": 0, "HBeginFixQty": 0, "HFixWorkDays": 0, "HTrunWorkDays": 0, "HReadyTimes": 0
                , "HICMOReadyTimes": 0, "HAutoTrunFlag": false, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
                , "HProcWorkNum": "", "HBadWHID": 0, "HBadWHName": "", "HWasterWHID": 0, "HWasterWHName": ""
                , "HWHID": 0, "HWHName": "","HRemark":""
                , "HWHID": 0, "HWHName": "", "HRemark": ""
                , "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
                , "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
                , "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
            }];
            var HModName = "Gy_RoutingBill";
            //#endregion
@@ -533,6 +533,17 @@
                    //, { field: 'HTimeUnit', title: '时间单位', edit: 'text' }
                    //, { field: 'HUnitTime', title: '运行时间', edit: 'text' }
                    , { field: 'HWorkQty', title: '加工数量', edit: 'text' }//默认
                    , { field: 'HQCSchemeID_Fst', title: '首件检验方案ID', hide: true }//f7
                    , { field: 'HQCSchemeNumber_Fst', title: '首件检验方案代码', edit: 'text', event: "HQCSchemeNumber_Fst",width:125 }
                    , { field: 'HQCSchemeName_Fst', title: '首件检验方案名称', width: 125 }//f7
                    , { field: 'HQCSchemeID_Proc', title: '转序检验方案ID', hide: true }//f7
                    , { field: 'HQCSchemeNumber_Proc', title: '转序检验方案代码', edit: 'text', event: "HQCSchemeNumber_Proc", width: 125}
                    , { field: 'HQCSchemeName_Proc', title: '转序检验方案名称', width: 125}//f7
                    , { field: 'HQCSchemeID_Patrol', title: '巡检检验方案ID', hide: true }//f7
                    , { field: 'HQCSchemeNumber_Patrol', title: '巡检检验方案代码', edit: 'text', event: "HQCSchemeNumber_Patrol", width: 125}
                    , { field: 'HQCSchemeName_Patrol', title: '巡检检验方案名称', width: 125}//f7
                    //, { field: 'HPassRate', title: '良率', edit: 'text' }//默认
                    //, { field: 'HProcID_S', title: '工段', edit: 'text' }
                    ////, { field: 'HCenterID_S', title: '产线中心id', hide: true }//hide: true
@@ -609,15 +620,21 @@
            //}
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  1添加 ä¿å­˜  2复制  3 ç¼–辑
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  1添加 ä¿å­˜  2复制  3 ç¼–辑 4添加子工艺路线
            var linterid = params[params[1]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            //var linteridSub = params[params[3]];  //从参数获取 å­è¡¨çº§åˆ«
            //判断是否新增
            if (linterid == null || linterid == 0) {
                //linteridSub = -1;
                OperationType = 1;
                //$("#HIDDEN").hide();
                if (OperationType == null) {
                    OperationType = 1;
                } else if (OperationType == 4) {
                    //显示工序
                    $("#HIDDEN").show();
                }
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
@@ -647,6 +664,12 @@
                });
            }
            else {//如果修改则走下面 new
                if (lSourceBillType == "SUB") {
                    //显示工序
                    $("#HIDDEN").show();
                }
                //禁用组织选项
                $("#HOrgID").attr("disabled", true);
                RoadBillMain(linterid);
@@ -822,6 +845,9 @@
                    , "HICMOReadyTimes": 0, "HAutoTrunFlag": false, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
                    , "HProcWorkNum": "", "HBadWHID": 0, "HBadWHName": "", "HWasterWHID": 0, "HWasterWHName": ""
                    , "HWHID": 0, "HWHName": "", "HRemark": ""
                    , "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
                    , "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
                    , "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
                };
                switch (obj.event) {
                    case 'btn-AddLine':
@@ -958,150 +984,6 @@
                } else if (params[1] == null) {
                    Pub_Close(2);
                }
            });
            //选择不良原因
            form.on('submit(HBadReasonID-BT)', function () {//选择仓库
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '不良原因列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择工序计划单
            form.on('submit(HPlanID-BT)', function () {//选择工序计划单
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '工序计划单列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Sc_ProcessPlanViewList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择责任人
            form.on('submit(HEmployeeID-BT)', function () {//选择责任人
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择申请工序
            form.on('submit(HSQProcID-BT)', function () {//选择申请工序
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '申请工序列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择责任工序
            form.on('submit(HZRProcID-BT)', function () {//选择责任工序
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '责任工序列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //编辑
            form.on('submit(cmdModify)', function () {//编辑
                var sSubStr = table.cache['wl-table'];
                //if (AllowLoadData(sSubStr) != false) {//非空验证
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '明细列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?table=' + JSON.stringify(sSubStr), 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
                // }
            });
            form.on('submit(Cancel)', function () {
                //sessionStorage["SourceFlag"] = false;
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
            })
            form.on('submit(Saver)', function (data) { //保存
                //debugger;
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = sMainStr + ';' + sSubStr;
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "SaveBadReasonList", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { icon: 1 });
                                $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                            }
                            else {
                                f_alert(data.Message);
                                console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                            console.log("Reason" + sMainStr);
                        }
                    });
            });
            //监听提交
@@ -1325,7 +1207,6 @@
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
@@ -1580,6 +1461,9 @@
                                                , "HICMOReadyTimes": 0, "HAutoTrunFlag": false, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
                                                , "HProcWorkNum": "", "HBadWHID": 0, "HBadWHName": "", "HWasterWHID": 0, "HWasterWHName": ""
                                                , "HWHID": 0, "HWHName": "", "HRemark": ""
                                                , "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
                                                , "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
                                                , "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
                                            })
                                            j++;
                                        }
@@ -1768,6 +1652,85 @@
                                }
                            })
                        }
                        //首件检验方案
                        if (obj.event == "HQCSchemeNumber_Fst") {
                            layer.open({
                                type: 2//弹窗类型
                                , skin: 'layui-layer-rim' //加上边框
                                , area: ['90%', '90%']//大小
                                , title: '检验方案列表'//标题
                                , shift: 2//弹出动画
                                , content: ['../../Baseset/基础资料/Gy_QCCheckProjectListView.html', 'yes']
                                , btn: ['确定', '取消']
                                , btn1: function (index, layero) {//按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    obj.update({
                                        "HQCSchemeID_Fst": checkStatus.data[0].HItemID
                                        , "HQCSchemeNumber_Fst": checkStatus.data[0].检验方案代码
                                        , "HQCSchemeName_Fst": checkStatus.data[0].方案名称
                                    })
                                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) { }
                            })
                        }
                        //转序检验方案
                        if (obj.event == "HQCSchemeNumber_Proc") {
                            layer.open({
                                type: 2//弹窗类型
                                , skin: 'layui-layer-rim' //加上边框
                                , area: ['90%', '90%']//大小
                                , title: '检验方案列表'//标题
                                , shift: 2//弹出动画
                                , content: ['../../Baseset/基础资料/Gy_QCCheckProjectListView.html', 'yes']
                                , btn: ['确定', '取消']
                                , btn1: function (index, layero) {//按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    obj.update({
                                        "HQCSchemeID_Proc": checkStatus.data[0].HItemID
                                        , "HQCSchemeNumber_Proc": checkStatus.data[0].检验方案代码
                                        , "HQCSchemeName_Proc": checkStatus.data[0].方案名称
                                    })
                                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) { }
                            })
                        }
                        //巡检检验方案
                        if (obj.event == "HQCSchemeNumber_Patrol") {
                            layer.open({
                                type: 2//弹窗类型
                                , skin: 'layui-layer-rim' //加上边框
                                , area: ['90%', '90%']//大小
                                , title: '检验方案列表'//标题
                                , shift: 2//弹出动画
                                , content: ['../../Baseset/基础资料/Gy_QCCheckProjectListView.html', 'yes']
                                , btn: ['确定', '取消']
                                , btn1: function (index, layero) {//按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    obj.update({
                                        "HQCSchemeID_Patrol": checkStatus.data[0].HItemID
                                        , "HQCSchemeNumber_Patrol": checkStatus.data[0].检验方案代码
                                        , "HQCSchemeName_Patrol": checkStatus.data[0].方案名称
                                    })
                                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) { }
                            })
                        }
                        obj.event = "";
                        return false;
@@ -1797,6 +1760,8 @@
                        else {
                            $("input[name='checkboxHStandard']").prop("checked", false);
                        }
                        //主表
                        form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                            "HBillNo": OperationType == 2 ? "" : d.data[0].单据号
@@ -1858,6 +1823,9 @@
                                    , "HICMOReadyTimes": d.data[i].换单准备时间, "HAutoTrunFlag": d.data[i].自动移转, "HTechnologyParameter": d.data[i].工艺参数, "HPicNum": d.data[i].图纸编号, "HProcCheckNote": d.data[i].本工序确认记录
                                    , "HProcWorkNum": d.data[i].程序号, "HBadWHID": d.data[i].HBadWHID, "HBadWHName": d.data[i].HBadWHName, "HWasterWHID": d.data[i].HWasterWHID, "HWasterWHName": d.data[i].HWasterWHName
                                    , "HWHID": d.data[i].HWHID, "HWHName": d.data[i].HWHName, "HRemark": d.data[i].表体备注
                                    , "HQCSchemeID_Fst": d.data[i].HQCSchemeID_Fst, "HQCSchemeNumber_Fst": d.data[i].首件检验方案代码, "HQCSchemeName_Fst": d.data[i].首件检验方案
                                    , "HQCSchemeID_Proc": d.data[i].HQCSchemeID_Proc, "HQCSchemeNumber_Proc": d.data[i].转序检验方案代码, "HQCSchemeName_Proc": d.data[i].转序检验方案
                                    , "HQCSchemeID_Patrol": d.data[i].HQCSchemeID_Patrol, "HQCSchemeNumber_Patrol": d.data[i].巡检检验方案代码, "HQCSchemeName_Patrol": d.data[i].巡检检验方案
                                }
                            )
                        }
@@ -1903,7 +1871,7 @@
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(num);
                //var hentryid = linteridSub;//子表 æŽ’序id
                var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"];
                var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"] + ";" + lSourceBillType;
                var index = layer.load();
                $.ajax({
@@ -2217,8 +2185,6 @@
            //#endregion
        });
    </script>
</body>
</html>