yusijie
2024-12-24 e6e2e89ee594f3ffcd8512113bb2ab4ce57f37bb
WebTM/views/¼Æ»®¹ÜÀí/¹¤ÒÕ·Ïß/Gy_RoutingBill.html
@@ -77,6 +77,7 @@
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill_Flow" id="set_CheckBill_Flow">多级审核</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck_Flow" id="set_AbandonCheck_Flow">多级反审核</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_RejectCheck_Flow" id="set_RejectCheck_Flow">驳回</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_WithdrawCheck_Flow" id="set_WithdrawCheck_Flow">撤回</button>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <ul class="layui-tab-title" lay-filter="tab-all">
@@ -647,7 +648,7 @@
                    , { 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: 'HWorkQty', title: '加工数量', edit: 'text', width: 125}
                    //, { field: 'HPassRate', title: '良率', edit: 'text' }//默认
                    //, { field: 'HProcID_S', title: '工段', edit: 'text' }
                    ////, { field: 'HCenterID_S', title: '产线中心id', hide: true }//hide: true
@@ -681,7 +682,8 @@
                    //, { field: 'HAutoTrunFlag', title: '自动移转', templet: "#HAutoTrunFlag" }//chenbox
                    //, { field: 'HProcCheckNote', title: '本工序确认记录', edit: 'text' }
                    //, { field: 'HProcWorkNum', title: '程序号', edit: 'text' }
                    //, { field: 'HWorkTimes_S', title: '产品单件工时', edit: 'text' }
                    /* , { field: 'HWorkTimes_S', title: '产品单件工时', edit: 'text' }*/
                    , { field: 'HWorkTimes_S', title: '单件生产节拍', edit: 'text' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
                //, done: function (res, curr, count) {
@@ -793,6 +795,7 @@
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                        $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
                        $("#HEndDate").val(Format(new Date(2100, 12, 31), "yyyy-MM-dd"));
                    }
                });
            }
@@ -1012,7 +1015,10 @@
            form.on('submit(set_RejectCheck_Flow)', function (data) {
                set_RejectCheck_Flow();
            });
            //撤回
            form.on('submit(set_WithdrawCheck_Flow)', function (data) {
                set_WithdrawCheck_Flow();
            });
            //复制
            form.on('submit(set_Copy)', function (data) {
                set_Copy();
@@ -1183,7 +1189,7 @@
                //新增行表格数据
                var NewRow = {
                    "HProcNo": (table.cache["mainTable"].length + 1) * 10, "HProcID_S": 0, "HProcType": "主工序", "HCenterID_S": 0, "HCenterID_SName": ""
                    "HProcNo": (table.cache["mainTable"].length + 1) * 10, "HProcID_S": 0, "HProcType": "主工序", "HCenterID_S": 0, "HCenterID_SName": "","工序代码":""
                    , "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
                    , "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "工序": "","工段":""
                    , "HProcID": 0, "工作中心代码": "", "HCenterID": 0, "工作中心": "", "HSupID": 0
@@ -1372,12 +1378,12 @@
            //保存提交
            form.on('submit(btnSave)', function (data) {//提交
                const procNos = table.cache["mainTable"].map(item => item.HProcNo);
                if (isSortedAscending(procNos)) {
                if (isSortedAscending(procNos) && haveHProcNO9999()) {
                    if (AllowLoadData(data)) {
                        set_AddNew(data);
                    }
                } else {
                    layer.msg('请注意流水号次序');
                    layer.msg('请注意流水号次序或者是否有转工序');
                }
            });
            // å‡½æ•°ï¼šåˆ¤æ–­æ•°ç»„是否从小到大排序
@@ -1386,6 +1392,18 @@
                    if (arr[i] > arr[i + 1]) {
                        return false;
                    }
                }
                return true;
            }
            //复制时保证转工序存在
            function haveHProcNO9999() {
                if (OperationType == 2 || OperationType == 3) {
                    for (var i = 0; i < option.data.length; i++) {
                        if (option.data[i]["HProcNo"] == 9999 && option.data[i]["工序代码"] == 9999) {
                            return true
                        }
                    }
                    return false;
                }
                return true;
            }
@@ -1974,6 +1992,39 @@
            }
            //#endregion
            //#region æ’¤å›ž
            function set_WithdrawCheck_Flow() {
                var InterID = $("#HInterID").val();
                if (InterID != 0) {
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Gy_Routing/WithdrawCheckFlow", //方法所在页面和方法名
                        data: { "HInterID": InterID, "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);
                                });
                                //修改为功后刷新界面
                                $("#btnSearch").trigger('click');
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择在审批流的单据驳回!');
                }
            }
            //#endregion
            //#region å¤åˆ¶
            function set_Copy() {
                //制单人
@@ -1981,6 +2032,7 @@
                $("#hmakers").val(sessionStorage["HUserName"]);
                $("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(2100, 12, 31), "yyyy-MM-dd"));
                //设置hinterid
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
@@ -2907,7 +2959,9 @@
            //刷新流水号
            function btn_Refresh(data) {
                for (var i = 0; i < option.data.length; i++) {
                    option.data[i]["HProcNo"] = (i + 1) * 10;
                    if (option.data[i]["HProcNo"] != 9999) {
                        option.data[i]["HProcNo"] = (i + 1) * 10;
                    }
                }
                table.render(option);
            }
@@ -2930,8 +2984,10 @@
                                if (i >= dataCol.length) {
                                    continue;
                                }
                                var dataCols = dataCol[i].split('|');
                                if (dataCol[i]) {
                                    var dataCols = dataCol[i].split('|');
                                }
                                //隐藏列
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;