ch
2022-01-02 43a843bc96530149741647cf6bc54b28a2cadba5
WebTM/views/ÑéÊÕÈë¿â/ÆäËûÈë¿â/Kf_OtherInBillList.html
@@ -60,26 +60,46 @@
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">客户</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HCusID" id="HCusID" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">部门</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HDeptID" id="HDeptID" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">主管</label>
                                        <label class="layui-form-label">物料代码</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HMangerID" id="HMangerID" style="width:190px;">
                                            <input type="text" class="layui-input" name="MaterialCode" id="MaterialCode" style="width:190px;">
                                        </div>
                                    </div>
                                    <!--<hr />-->
                                    <div class="layui-inline">
                                        <label class="layui-form-label">物料名称</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="MaterialName" id="MaterialName" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">规格型号</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="SpecificationModel" id="SpecificationModel" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">源单单号</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HSourceBillNo" id="HSourceBillNo" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">仓库</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="Warehouse" id="Warehouse" style="width:190px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">制单人</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="Hmaker" id="Hmaker" style="width:190px;">
                                        </div>
                                    </div>
                                </div>
@@ -93,6 +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="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>
@@ -110,6 +134,8 @@
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
            //#region å…¬å…±å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
@@ -123,111 +149,27 @@
            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_OtherInBill/GetOtherInBill',
                    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);
@@ -326,15 +268,113 @@
                };
            });
            //#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_OtherInBill/GetOtherInBill',
                    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();//单据号
                var HCusID = $("#HCusID").val();
                var HDeptID = $("#HDeptID").val();
                var HMangerID = $("#HMangerID").val();
                var HDeptID = $("#HDeptID").val();//部门
                var MaterialCode = $("#MaterialCode").val();//物料代码
                var MaterialName = $("#MaterialName").val();//物料名称
                var SpecificationModel = $("#SpecificationModel").val();//规格型号
                var HSourceBillNo = $("#HSourceBillNo").val();//源单单号
                var Warehouse = $("#Warehouse").val();//仓库
                var Hmaker = $("#Hmaker").val();//制单人
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
@@ -344,36 +384,51 @@
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                if (HCusID) {
                    sWhere += " and å®¢æˆ· like '%" + HCusID + "%'";
                }
                if (HDeptID) {
                    sWhere += " and éƒ¨é—¨ like '%" + HDeptID + "%'";
                }
                if (HMangerID) {
                    sWhere += " and ä¸»ç®¡ like '%" + HMangerID + "%'";
                if (MaterialCode) {
                    sWhere += " and ç‰©æ–™ä»£ç  like '%" + MaterialCode + "%'";
                }
                if (MaterialName) {
                    sWhere += " and ç‰©æ–™åç§° like '%" + MaterialName + "%'";
                }
                if (SpecificationModel) {
                    sWhere += " and è§„格型号 like '%" + SpecificationModel + "%'";
                }
                if (HSourceBillNo) {
                    sWhere += " and æºå•单号 like '%" + HSourceBillNo + "%'";
                }
                if (Warehouse) {
                    sWhere += " and å‘货仓库 like '%" + Warehouse + "%'";
                }
                if (Hmaker) {
                    sWhere += " and åˆ¶å•人 like '%" + Hmaker + "%'";
                }
                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