zrg
2024-03-12 ec0faa25ea2f4f7a7585ea70afd0e5207d6ba916
WebTM/views/ÑéÊÕÈë¿â/²úÆ·Èë¿â/Kf_ProductInBillList.html
@@ -16,6 +16,8 @@
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/HideButton.js"></script>
    <script src="../../../layuiadmin/soulTable.slim.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
@@ -108,17 +110,23 @@
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-WmsSub"><i class="layui-icon layui-icon-form"></i>明细</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-Add" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-Edit" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-Delete" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-WmsSub" lay-event="btn-WmsSub"><i class="layui-icon layui-icon-form"></i>明细</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="get_Refresh" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CheckBill" id="CheckBill"><i class="layui-icon layui-icon-form"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_AbandonCheck" id="AbandonCheck"><i class="layui-icon layui-icon-form"></i>反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CloseBill" id="set_CloseBill"><i class="layui-icon layui-icon-form"></i>关闭</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CancelCloseBill" id="set_CancelCloseBill"><i class="layui-icon layui-icon-form"></i>反关闭</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Drop" id="Drop"><i class="layui-icon layui-icon-radio"></i>作废</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeDrop" id="DeDrop"><i class="layui-icon layui-icon-radio"></i>反作废</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-view" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-print" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="set_HideColumn" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-BarCodeDetail" lay-event="btn-BarCodeDetail"><i class="layui-icon layui-icon-form"></i>条码明细</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>按钮设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="get_Exit" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                            </div>
                        </script>
                    </form>
@@ -131,7 +139,7 @@
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
            //#region  å…¬å…±å˜é‡
            var $ = layui.$
@@ -143,6 +151,7 @@
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
                , soulTable = layui.soulTable
            //查询条件
            var sWhere = "";
            var option = [];
@@ -217,7 +226,8 @@
                        } else {
                            layer.msg('请选择一行数据编辑!');
                        }
                        break;
                    case 'btn-BarCodeDetail': get_BarCodeDetail();
                        break;
                    case 'btn-Delete':
                        var checkStatus = table.checkStatus('mainTable')
@@ -254,18 +264,44 @@
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                    //明细
                    //条码明细
                    case 'btn-WmsSub':
                        getWmsSub();
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //审核
                    case 'set_CheckBill': set_CheckBill(1);
                        break;
                    //反审核
                    case 'set_AbandonCheck': set_CheckBill(2);
                        break;
                    //关闭
                    case 'set_CloseBill': set_CloseBill(1);
                        break;
                    //反关闭
                    case 'set_CancelCloseBill': set_CloseBill(2);
                        break;
                    //作废按钮        ï¼ˆ1:作废、2:反作废)
                    case 'btn-Drop':
                        set_DropBill(1);
                        break;
                    //反作废按钮
                    case 'btn-DeDrop':
                        set_DropBill(2);
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                    //列设置
                    case 'set_HideColumn': get_HideColumn();
                        break;
                    //按钮设置
                    case 'set_HideButton':
                        var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                        var HBillType = "1202";
                        get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                        break;
                };
            });
@@ -290,51 +326,55 @@
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , totalRow: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , done: function (res, curr, count) {
                        soulTable.render(this);
                    }
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                        , { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 160 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 160 }
                        , { field: 'HCusID', title: 'HCusID', width: 160, hide: true }
                        , { field: '客户', title: '客户', width: 200 }
                        , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 200, hide: true }
                        , { field: '验收员', title: '验收员', width: 200 }
                        , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true }
                        , { field: '保管员', title: '保管员', width: 200 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门', title: '部门', width: 160 }
                        , { field: '仓库', title: '仓库', width: 160 }
                        , { field: 'hsubid', title: 'hsubid', width: 160, hide: true }
                        , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true }
                        , { field: '物料代码', title: '物料代码', width: 200 }
                        , { field: '物料名称', title: '物料名称', width: 200 }
                        , { field: '规格型号', title: '规格型号', width: 200 }
                        , { field: '批次', title: '批次', width: 200 }
                        , { field: 'hunitid', title: 'hunitid', width: 200, hide: true }
                        , { field: '计量单位', title: '计量单位', width: 200 }
                        , { field: '应收数量', title: '应收数量', width: 115 }
                        , { field: '实收数量', title: '实收数量', width: 115 }
                        , { field: '出库数量', title: '出库数量', width: 200 }
                        , { field: '单价', title: '单价', width: 200 }
                        , { field: '金额', title: '金额', width: 115 }
                        , { field: 'hwhid', title: 'hwhid', width: 200, hide: true }
                        , { field: '收料仓库代码', title: '收料仓库代码', width: 200 }
                        , { field: '收料仓库', title: '收料仓库', width: 200 }
                        , { field: '表体备注', title: '表体备注', width: 200 }
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 125 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 125 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 125 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '单据号', title: '单据号', width: 160, sort: true }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 160, sort: true }
                        , { field: 'HCusID', title: 'HCusID', width: 160, hide: true, sort: true }
                        , { field: '客户', title: '客户', width: 200, sort: true }
                        , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 200, hide: true, sort: true }
                        , { field: '验收员', title: '验收员', width: 200, sort: true }
                        , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true, sort: true }
                        , { field: '保管员', title: '保管员', width: 200, sort: true }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true, sort: true }
                        , { field: '部门', title: '部门', width: 160, sort: true }
                        , { field: '仓库', title: '仓库', width: 160, sort: true }
                        , { field: 'hsubid', title: 'hsubid', width: 160, hide: true, sort: true }
                        , { field: 'hmaterid', title: 'hmaterid', width: 200, hide: true, sort: true }
                        , { field: '物料代码', title: '物料代码', width: 200, sort: true }
                        , { field: '物料名称', title: '物料名称', width: 200, sort: true }
                        , { field: '规格型号', title: '规格型号', width: 200, sort: true }
                        , { field: '批次', title: '批次', width: 200, sort: true }
                        , { field: 'hunitid', title: 'hunitid', width: 200, hide: true, sort: true }
                        , { field: '计量单位', title: '计量单位', width: 200, sort: true }
                        , { field: '应收数量', title: '应收数量', width: 115, sort: true, totalRow: true}
                        , { field: '实收数量', title: '实收数量', width: 115, sort: true, totalRow: true}
                        , { field: '出库数量', title: '出库数量', width: 200, sort: true, totalRow: true }
                        , { field: '单价', title: '单价', width: 200, sort: true, totalRow: true}
                        , { field: '金额', title: '金额', width: 115, sort: true, totalRow: true }
                        , { field: 'hwhid', title: 'hwhid', width: 200, hide: true, sort: true }
                        , { field: '收料仓库代码', title: '收料仓库代码', width: 200, sort: true }
                        , { field: '收料仓库', title: '收料仓库', width: 200, sort: true }
                        , { field: '表体备注', title: '表体备注', width: 200, sort: true }
                        , { field: '制单人', title: '制单人', width: 125, sort: true }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '审核人', title: '审核人', width: 125, sort: true }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '修改人', title: '修改人', width: 125, sort: true }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '关闭人', title: '关闭人', width: 125, sort: true }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '作废人', title: '作废人', width: 125, sort: true }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                    ]]
                };
            }
@@ -350,6 +390,11 @@
                            option.data = data1.data;
                            table.render(option);
                            layer.close(ajaxLoad);
                            //刷新按钮显示
                            var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                            var HBillType = "1202";
                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
@@ -467,12 +512,50 @@
                        } else {
                            table.render(option);
                        }
                        var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                        var HBillType = "1202";
                        Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
            //条码明细
            function get_BarCodeDetail() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var HInterID = data[0].hmainid;
                    var HBillType = '1202';
                    var HBillNo = data[0]["单据号"];
                    //if (AllowLoadData(sSubStr) != false) {//非空验证
                    layer.open({
                        type: 2
                        , area: ['90%', '90%']
                        , title: '生产入库单条码明细'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../../条码明细/Kf_BarCodeDetailQuery.html?HInterID=' + HInterID + '&HBillType=' + HBillType + '&HBillNo=' + HBillNo
                        , resize: false
                        , btn: ["确定", "取消"]
                        , end: function () {
                            //刷新页面,
                            //location.reload();
                        }
                        , cancel: function () {
                            //$(".layui-btn").removeClass("layui-btn-disabled");
                        }
                    })
                } else {
                    layer.msg('请选择一行数据编辑!');
                }
            }
            // å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery() {
@@ -568,8 +651,111 @@
                set_ClearQuery();
                get_Display(sWhere);
            }
            //审核   [1 å®¡æ ¸ã€2 åå®¡æ ¸]
            function set_CheckBill(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (data.length == 1) {
                    layer.confirm("确认要审核吗?", function (index) {
                        var wait = layer.load();
                        var HInterID = data[0].hmainid;
                        $.ajax({
                            url: GetWEBURL() + '/Kf_ProductInBill/CheckKf_ProductInBill',
                            type: "GET",
                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"] },
                            success: function (result) {
                                if (result.count == 1) {
                                    get_FastQuery();
                                    layer.msg(result.Message, { icon: 1 });
                                    layer.close(wait);
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                    layer.close(wait);
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                                layer.close(wait);
                            }
                        });
                    })
                } else {
                    layer.msg("请选择一条数据!");
                }
            }
            //关闭  [1 å…³é—­ã€2 åå…³é—­]
            function set_CloseBill(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (data.length == 1) {
                    layer.confirm("确认要关闭吗?", function (index) {
                        var wait = layer.load();
                        var HInterID = data[0].hmainid;
                        $.ajax({
                            url: GetWEBURL() + '/Kf_ProductInBill/CloseKf_ProductInBill',
                            type: "GET",
                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"] },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { icon: 1 });
                                    layer.close(wait);
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                    layer.close(wait);
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                                layer.close(wait);
                            }
                        });
                    })
                }
                else {
                    layer.msg("请选择一条数据!");
                }
            }
        //#endregion
            //#region åä½œåºŸ/作废数据
            function set_DropBill(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Kf_ProductInBill/DropKf_ProductInBill", //方法所在页面和方法名
                        data: { "HInterID": InterID, "Type": num, "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
            //以上是layui模块
        });