ch
2022-01-02 43a843bc96530149741647cf6bc54b28a2cadba5
WebTM/views/ÑéÊÕÈë¿â/²úÆ·Èë¿â/Kf_ProductInBillList.html
@@ -113,10 +113,10 @@
                                <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="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></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" lay-event="set_CheckBill"><i class="layui-icon layui-icon-search"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AbandonCheck"><i class="layui-icon layui-icon-search"></i>反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_PrintReport"><i class="layui-icon layui-icon-search"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event=""><i class="layui-icon layui-icon-search"></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>
                            </div>
                        </script>
                    </form>
@@ -134,6 +134,8 @@
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
            //#region  å…¬å…±å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
@@ -146,112 +148,24 @@
            //查询条件
            var sWhere = "";
            var option = [];
            //初始化界面
            set_ClearBill();
            //#endregion
            //#region é‡ç½®æŒ‰é’®
            //#region  åˆå§‹åŒ–界面
            //初始化界面
            set_ClearBill();
            //#endregion
            //#region  è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            // é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
            //#region æŸ¥è¯¢æŒ‰é’®
            // æŸ¥è¯¢æŒ‰é’®
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery(table, option);
                get_FastQuery();
            });
            //#endregion
            //#region åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                get_Display(sWhere);
            }
            //#endregion
            //#region åˆå§‹åŒ–表格方法
            $("#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'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                       ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                       ,{ field: '单据号', title: '单据号', hide: true }
                        , { field: '日期', title: '日期', width: 160 }
                        , { 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>" }
                    ]]
                };
            }
            //进入页面显示的缓存列表
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Kf_ProductInBill/GetProductInBill',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
@@ -350,9 +264,98 @@
                };
            });
            //#endregion
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery(table, option) {
            //#region  æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
            // åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                get_Display(sWhere);
                //初始化日期
                $("#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'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                        , { field: '单据号', title: '单据号', hide: true }
                        , { field: '日期', title: '日期', width: 160 }
                        , { 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>" }
                    ]]
                };
            }
            //进入页面显示的缓存列表
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Kf_ProductInBill/GetProductInBill',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            // å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery() {
                var HDate = $("#HBeginDate").val();//开始日期
                var HDate1 = $("#HEndDate").val();//结束日期
                var HBillNo = $("#HBillNo").val();//单据号
@@ -396,26 +399,27 @@
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            // é‡ç½®è¿‡æ»¤æ¡ä»¶
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//
                $("#HCusID").val("");
                $("#HDeptID").val("");
                $("#HMangerID").val("");
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HBillNo").val("");//单据号
                $("#HDeptID").val();//部门
                $("#MaterialCode").val();//物料代码
                $("#MaterialName").val();//物料名称
                $("#SpecificationModel").val();//规格型号
                $("#HSourceBillNo").val();//源单单号
                $("#Warehouse").val();//仓库
                $("#Hmaker").val();//制单人
                sWhere = "";
            }
            //#endregion
            //#region åˆ·æ–°
            // åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
                get_Display(sWhere);
            }
            //#endregion
            //以上是layui模块
        });