杨乐
2022-01-14 5bae5d968c46ab71245105c0021ea066d04b907e
生产用料单 审核 反审核
2个文件已修改
107 ■■■■■ 已修改文件
WebTM/views/仓存管理/扫码异常记录表/KF_PonderationBillList.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/生产投料单/Sc_PPBomBillList.html 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/²Ö´æ¹ÜÀí/ɨÂëÒì³£¼Ç¼±í/KF_PonderationBillList.html
@@ -239,7 +239,7 @@
                            //    cols_arr[0][i + 1] = { field: data[i].id, title: data[i].name, align: 'center', totalRow: true, sort: true };
                            //    break;
                            default:
                                cols_arr[0][i + 1] = { field: data[i].id, title: data[i].name, align: 'center', sort: true };
                                cols_arr[0][i + 1] = { field: data[i].id, title: data[i].name, align: 'center', sort: true, width:200 };
                        }
                    }
                }
WebTM/views/Éú²ú¹ÜÀí/Éú²úͶÁϵ¥/Sc_PPBomBillList.html
@@ -123,7 +123,7 @@
            </div>
        </div>
    </div>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -144,11 +144,11 @@
            var option = [];
            //#endregion
             //#region åˆå§‹åŒ–界面
            //#region åˆå§‹åŒ–界面
            set_ClearBill();
             //#endregion
            //#endregion
             //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //查询按钮
            form.on('submit(btnSearch)', function (data) {
@@ -161,6 +161,20 @@
                set_ClearQuery();
            });
            //头工具栏事件
            table.on("toolbar(mainTable)", function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);//获取选中行 æ•°æ®
                switch (obj.event) {
                    //审核
                    case "btn-Audit": set_AuditBill();
                        break;
                    //反审核
                    case "btn-DeAudit": set_DeAuditBill();
                        break;
                    default:
                        break;
                }
            })
             //#endregion
             //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
@@ -175,7 +189,7 @@
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            }
            //初始化表格
            function set_InitGrid() {
                option = {
                    elem: '#mainTable'
@@ -184,7 +198,8 @@
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                        { type:"checkbox",fixed:"left" }
                        ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                        , { field: '日期', title: '日期', width: 150, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 150 }
                        , { field: 'HDeptID', title: 'HDeptID', hide: true }
@@ -219,13 +234,12 @@
                        , { field: '制单人', title: '制单人' }
                        , { field: '制单日期', title: '制单日期', width: 150, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '审核人', title: '审核人' }
                        , { field: '审核日期', title: '审核日期', width: 150, templet: "<div>{{d.审核日期 ==null ?'':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd')}}</div>"  }
                        , { field: '审核日期', title: '审核日期', width: 150, templet: "<div>{{d.审核日期 ==null ?'':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '计划跟踪号', title: '计划跟踪号' }
                        , { field: '计划模式', title: '计划模式' }
                    ]]
                };
            }
            //进入页面显示的缓存列表
            function get_Display(sWhere) {
@@ -315,7 +329,80 @@
                sWhere = "";
            }
             //#endregion
            //审核
            function set_AuditBill() {
                var CheckStatus = table.checkStatus("mainTable");
                if (CheckStatus.data.length != 1) {
                    return layer.msg("请选择一条数据");
                }
                else {
                    if (CheckStatus.data[0].HBillStatus != 1) {
                        return layer.msg("当前单据处于不能审核状态");
                    }
                    else {
                        var HInterID = CheckStatus.data[0].hmainid;
                        $.ajax({
                            url: GetWEBURL() + "Sc_PPBomBill/DeOrAuditBill"
                            , type: "GET"
                            , data: { "HInterID": HInterID, "IsAudit": 0, "CurUserName": 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);
                                        //修改为功后刷新界面
                                        set_ClearBill();
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                            }
                        })
                    }
                }
            }
            //反审核
            function set_DeAuditBill() {
                var CheckStatus = table.checkStatus("mainTable");
                if (CheckStatus.data.length != 1) {
                    return layer.msg("请选择一条数据");
                }
                else {
                    if (CheckStatus.data[0].HBillStatus == 1) {
                        return layer.msg("当前单据处于未审核状态!");
                    }
                    else {
                        var HInterID = CheckStatus.data[0].hmainid;
                        $.ajax({
                            url: GetWEBURL() + "Sc_PPBomBill/DeOrAuditBill"
                            , type: "GET"
                            , data: { "HInterID": HInterID, "IsAudit": 1, "CurUserName": 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);
                                        //修改为功后刷新界面
                                        set_ClearBill();
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                            }
                        })
                    }
                }
            }
            //#endregion
            //以上是layui模块
        });