liujie
2 天以前 f86a01ae84b7ac759f009f751076814ee71cff14
推广活动
4个文件已修改
5个文件已添加
922 ■■■■■ 已修改文件
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverRankVo.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderCrossCity.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderPrivateCar.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderTaxi.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TUser.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tDriverPromotionActivity/tDriverPromotionActivityUser.html 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tDriverPromotionActivity/tDriverPromotionActivity_detail.html 384 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tDriverPromotionActivity/tDriverPromotionActivity1.js 196 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tDriverPromotionActivity/tDriverPromotionActivity2.js 191 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverRankVo.java
New file
@@ -0,0 +1,16 @@
package com.stylefeng.guns.modular.system.model;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class DriverRankVo {
    private Integer driverId;
    private String driverName;
    private Integer userNum;
    private BigDecimal money;
}
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderCrossCity.java
@@ -307,6 +307,26 @@
    private String abnormalRemark;
    private Integer promotionDriverId;
    private BigDecimal promotionMoney;
    public BigDecimal getPromotionMoney() {
        return promotionMoney;
    }
    public void setPromotionMoney(BigDecimal promotionMoney) {
        this.promotionMoney = promotionMoney;
    }
    public Integer getPromotionDriverId() {
        return promotionDriverId;
    }
    public void setPromotionDriverId(Integer promotionDriverId) {
        this.promotionDriverId = promotionDriverId;
    }
    public Integer getAbnormalStatus() {
        return abnormalStatus;
    }
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderPrivateCar.java
@@ -344,6 +344,28 @@
    private String abnormalRemark;
    private Integer promotionDriverId;
    private BigDecimal promotionMoney;
    public BigDecimal getPromotionMoney() {
        return promotionMoney;
    }
    public void setPromotionMoney(BigDecimal promotionMoney) {
        this.promotionMoney = promotionMoney;
    }
    public Integer getPromotionDriverId() {
        return promotionDriverId;
    }
    public void setPromotionDriverId(Integer promotionDriverId) {
        this.promotionDriverId = promotionDriverId;
    }
    public Integer getAbnormalStatus() {
        return abnormalStatus;
    }
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderTaxi.java
@@ -310,6 +310,26 @@
    private BigDecimal responsibilityMoney;
    private Integer promotionDriverId;
    private BigDecimal promotionMoney;
    public BigDecimal getPromotionMoney() {
        return promotionMoney;
    }
    public void setPromotionMoney(BigDecimal promotionMoney) {
        this.promotionMoney = promotionMoney;
    }
    public Integer getPromotionDriverId() {
        return promotionDriverId;
    }
    public void setPromotionDriverId(Integer promotionDriverId) {
        this.promotionDriverId = promotionDriverId;
    }
    public Integer getAbnormalStatus() {
        return abnormalStatus;
    }
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TUser.java
@@ -139,8 +139,37 @@
     * 实名认证照片
     */
    private String certificationImg;
    private Integer bindDriverId;
    private Date bindDate;
    private Date bindExpireDate;
    public Date getBindDate() {
        return bindDate;
    }
    public void setBindDate(Date bindDate) {
        this.bindDate = bindDate;
    }
    public Date getBindExpireDate() {
        return bindExpireDate;
    }
    public void setBindExpireDate(Date bindExpireDate) {
        this.bindExpireDate = bindExpireDate;
    }
    public Integer getBindDriverId() {
        return bindDriverId;
    }
    public void setBindDriverId(Integer bindDriverId) {
        this.bindDriverId = bindDriverId;
    }
    public Integer getId() {
        return id;
    }
ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tDriverPromotionActivity/tDriverPromotionActivityUser.html
New file
@@ -0,0 +1,40 @@
@layout("/common/_container.html"){
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>司机推广下级用户</h5>
            </div>
            <div class="ibox-content">
                <div class="row row-lg">
                    <input type="hidden" id="driverId" value="${driverId}"/>
                    <div class="col-sm-12">
                        <div class="row">
                            <div class="col-sm-3">
                                <#NameCon id="name" name="用户姓名" />
                            </div>
                            <div class="col-sm-3">
                                <#button name="重置" icon="" clickFun="TDriverPromotionActivity.research()"/>
                                <#button name="搜索" icon="" clickFun="TDriverPromotionActivity.search()"/>
                            </div>
                        </div>
                        <div class="hidden-xs" id="TDriverPromotionActivityTableToolbar" role="group">
                            <#button name="导出Excel" icon="" clickFun="TDriverPromotionActivity.exportExcel()" space="true"/>
                        </div>
                        <#table id="TDriverPromotionActivityTable"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/system/tDriverPromotionActivity/tDriverPromotionActivity2.js"></script>
<script>
    laydate.render({
        elem: '#insertTime'
        ,range: true
    });
</script>
@}
ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tDriverPromotionActivity/tDriverPromotionActivity_detail.html
New file
@@ -0,0 +1,384 @@
@layout("/common/_container.html"){
<head>
    <meta charset="UTF-8">
    <title>处理异常订单</title>
    <style>
        body {
            background: #888;
            margin: 0;
            padding: 0;
        }
        .container {
            background: #fff;
            margin: 20px auto;
            padding: 20px 30px;
            border-radius: 10px;
            max-width: 98vw;
            min-width: 1200px;
        }
        .title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 20px;
        }
        .order-table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 30px;
        }
        .order-table th,
        .order-table td {
            border: 1px solid #e0e0e0;
            padding: 8px 6px;
            text-align: center;
            font-size: 13px;
        }
        .order-table th {
            background: #f8f8f8;
            font-weight: 600;
        }
        .section-title {
            font-size: 16px;
            font-weight: bold;
            margin: 30px 0 10px 0;
        }
        .desc-row {
            margin-bottom: 10px;
        }
        .desc-label {
            font-weight: bold;
            margin-right: 10px;
        }
        .img-list {
            display: flex;
            gap: 20px;
            margin: 10px 0 20px 0;
        }
        .img-list img {
            width: 120px;
            height: 80px;
            object-fit: cover;
            border-radius: 6px;
            border: 1px solid #ccc;
        }
        .order-link {
            color: #1976d2;
            text-decoration: underline;
            cursor: pointer;
        }
        input[type="radio"] {
            accent-color: #1976d2;
            width: 18px;
            height: 18px;
            vertical-align: middle;
            margin-right: 4px;
        }
        .radio-group label {
            margin-right: 18px;
            font-size: 15px;
            cursor: pointer;
        }
        #duty-selector {
            display: flex;
            margin-bottom: 18px;
            border: 1px solid #ccc;
            border-radius: 4px;
            overflow: hidden;
            width: fit-content;
        }
        .duty-btn {
            flex: 1 1 0;
            padding: 12px 32px;
            border: none;
            background: #fff;
            color: #222;
            font-size: 16px;
            cursor: pointer;
            outline: none;
            border-right: 1px solid #ccc;
            transition: background 0.2s, color 0.2s;
            height: 62px;
            line-height: 24px;
        }
        .duty-btn:last-child {
            border-right: none;
        }
        .duty-btn.active {
            background: #1976d2;
            color: #fff;
            font-weight: bold;
        }
        .action-btn {
            min-width: 140px;
            height: 48px;
            background: #1976d2;
            color: #fff;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            font-weight: bold;
            margin-right: 18px;
            cursor: pointer;
            transition: background 0.2s, box-shadow 0.2s;
            box-shadow: 0 2px 6px rgba(25, 118, 210, 0.08);
        }
        .action-btn:last-child {
            margin-right: 0;
        }
        .action-btn:hover {
            background: #1565c0;
        }
        #action-btns {
            margin-top: 32px;
            display: flex;
            align-items: center;
        }
    </style>
</head>
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">
            <input type="hidden" id="id" value="${item.id!}"/>
            <div id="duty-selector">
                <button type="button" class="duty-btn active" data-type="platformAll">活动基础信息</button>
                <button type="button" class="duty-btn" data-type="driverAll">推广情况</button>
            </div>
            <div id="s1">
                <div class="row">
                    <div class="col-sm-4">
                        <#input id="activityTitle" name="推广活动标题" value="${item.activityTitle}"/>
                    </div>
                </div>
                <div class="row" style="margin-left: -24px">
                    <label class="col-sm-1 control-label">关联业务:</label>
                    <div class="col-sm-3">
                        <label class="checkbox-inline">
                            <input type="checkbox" name="bizType" value="1"> 专车
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" name="bizType" value="2"> 出租车
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" name="bizType" value="3"> 城际
                        </label>
                    </div>
                </div>
                <div class="row" style="margin-top: 10px">
                    <label class="col-sm-1 control-label">活动区域:</label>
                    <div class="col-sm-2">
                        <select class="form-control" id="province" onchange="provinceChange(this)">
                            <option value="">选择省</option>
                            @for(obj in provinceList){
                            <option value="${obj.code}" ${obj.code== item.provinceCode ?
                            'selected=selected' : ''}>${obj.name}</option>
                            @}
                        </select>
                    </div>
                    <div class="col-sm-2">
                        <select class="form-control" id="city" onchange="cityChage(this)">
                            <option value="">选择市</option>
                            @for(obj in cityList){
                            <option value="${obj.code}" ${obj.code== item.cityCode ?
                            'selected=selected' : ''}>${obj.name}</option>
                            @}
                        </select>
                    </div>
                    <div class="col-sm-2">
                        <select class="form-control" id="area">
                            <option value="">选择区</option>
                            @for(obj in areaList){
                            <option value="${obj.code}" ${obj.code== item.districtCode ?
                            'selected=selected' : ''}>${obj.name}</option>
                            @}
                        </select>
                    </div>
                </div>
                <div class="row" style="margin-top: 10px">
                    <div class="col-sm-3">
                        <#input id="time" name="活动时间" isTime="false"/>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-3">
                        <#input id="commissionRatio" name="抽佣比例" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-3">
                        <#input id="bindingDays" name="绑定有效期" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-3">
                        <label style="font-weight:700">推广活动说明:</label>
                        <div class="tab-content">
                            <div id="tab-1" class="tab-pane active">
                                <div class="panel-body">
                                    <textarea id="editor_1" type="text/plain"
                                              style="width:1200px;height:400px;"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="s2">
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="col-sm-12">
                        <div class="row">
                            <div class="col-sm-3">
                                <#NameCon id="driverName" name="司机姓名" />
                            </div>
                            <div class="col-sm-3">
                                <#button name="搜索" icon="fa-search" clickFun="TDriverPromotionActivity.search()"/>
                                <#button name="重置" icon="fa-trash" clickFun="TDriverPromotionActivity.resetSearch()"
                                space="true"/>
                            </div>
                        </div>
                        <div class="hidden-xs" id="TOrderPrivateCarTableToolbar" role="group">
                            <#button name="导出Excel" icon="" clickFun="TDriverPromotionActivity.exportExcel()" space="true"/>
                        </div>
                        <#table id="TDriverPromotionActivityTable"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<script src="${ctxPath}/static/modular/system/tDriverPromotionActivity/tDriverPromotionActivity1.js"></script>
<script src="${ctxPath}/static/modular/system/tDriverPromotionActivity/tDriverPromotionActivity_info.js"></script>
<script>
    // 在现有的 script 标签内添加以下代码
    $(document).ready(function () {
        // 处理 duty-selector 按钮点击事件
        $('#duty-selector .duty-btn').on('click', function () {
            // 移除所有按钮的 active 类
            $('#duty-selector .duty-btn').removeClass('active');
            // 为当前点击的按钮添加 active 类
            $(this).addClass('active');
            // 可以根据 data-type 值执行不同的操作
            var selectedType = $(this).data('type');
            if (selectedType === 'platformAll') {
                // 处理活动基础信息选中逻辑
                console.log('活动基础信息被选中');
                $("#s1").show();
                $("#s2").hide();
            } else if (selectedType === 'driverAll') {
                // 处理推广情况选中逻辑
                console.log('推广情况被选中');
                $("#s1").hide();
                $("#s2").show();
            }
        });
    });
    $(function () {
        $("#s1").show();
        $("#s2").hide();
        // 初始化编辑器
        editor_1 = UE.getEditor('editor_1');
        // 初始化活动时间
        laydate.render({
            elem: '#time',
            range: true
        });
        // 回显关联业务
        var bizTypeStr = "${item.bizType!}"; // 获取业务类型字符串
        if (bizTypeStr) {
            var bizTypes = bizTypeStr.split(',');
            $('input[name="bizType"]').each(function () {
                if (bizTypes.indexOf($(this).val()) !== -1) {
                    $(this).prop('checked', true);
                }
            });
        }
        // 回显活动时间
        $("#time").val("${time!}");
        // 回显抽佣比例和绑定有效期
        $("#commissionRatio").val("${item.commissionRatio!}");
        $("#bindingDays").val("${item.bindingDays!}");
        // 回显活动说明
        setTimeout(function () {
            editor_1.ready(function () {
                editor_1.setContent('${item.activityDesc!}');
            });
        }, 100);
    });
    function provinceChange(e) {
        var provinceCode = $(e).val();
        var ajax = new $ax(Feng.ctxPath + "/tCompany/change", function (data) {
            if (data != null) {
                var content = '<option value="">选择市</option>';
                $.each(data, function (k, v) {
                    content += "<option value='" + v.code + "'>" + v.name + "</option>";
                });
                $("#city").empty().append(content);
                $("#area").empty().append('<option value="">选择区</option>');
            }
        });
        ajax.set("code", provinceCode);
        ajax.start();
    }
    function cityChage(e) {
        var cityCode = $(e).val();
        var ajax = new $ax(Feng.ctxPath + "/tCompany/change", function (data) {
            if (data != null) {
                var content = '<option value="">选择区</option>';
                $.each(data, function (k, v) {
                    content += "<option value='" + v.code + "'>" + v.name + "</option>";
                });
                $("#area").empty().append(content);
            }
        });
        ajax.set("code", cityCode);
        ajax.start();
    }
</script>
@}
ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tDriverPromotionActivity/tDriverPromotionActivity1.js
New file
@@ -0,0 +1,196 @@
/**
 * 管理初始化
 */
var TDriverPromotionActivity = {
    id: "TDriverPromotionActivityTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
/**
 * 初始化表格的列
 */
TDriverPromotionActivity.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '推广排名', field: 'sort', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row, index) {
                // 使用序号作为排名,index从0开始,所以需要+1
                return index + 1;
            }
        },
        {title: '司机Id', field: 'driverId', visible: false, align: 'center', valign: 'middle'},
        {title: '司机姓名', field: 'driverName', visible: true, align: 'center', valign: 'middle'},
        {title: '推广用户数量', field: 'userNum', visible: true, align: 'center', valign: 'middle'},
        {title: '推广收益合计', field: 'money', visible: true, align: 'center', valign: 'middle',
        },
        {
            title: '操作', field: 'opt', visible: true, align: 'left', valign: 'middle', width: "10%",
            formatter: function (value, row) {
                    var btn = [];
                    btn += '<a href="javascript:void(0);" onclick="TDriverPromotionActivity.viewUser(' + row.driverId + ')" style="color: #0e9aef">查看下级用户</a>&nbsp;&nbsp;';
                    btn += '<a href="javascript:void(0);" onclick="TDriverPromotionActivity.info(' + row.id + ')" style="color: #0e9aef">查看收益明细</a>&nbsp;&nbsp;';
                    return btn;
                }
        }
    ];
};
/**
 * 检查是否选中
 */
TDriverPromotionActivity.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if (selected.length == 0) {
        Feng.info("请先选中表格中的某一记录!");
        return false;
    } else {
        TDriverPromotionActivity.seItem = selected[0];
        return true;
    }
};
/**
 * 点击添加
 */
TDriverPromotionActivity.openAddTDriverPromotionActivity = function () {
    var index = layer.open({
        type: 2,
        title: '添加',
        area: ['100%', '100%'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/tDriverPromotionActivity/tDriverPromotionActivity_add'
    });
    this.layerIndex = index;
};
/**
 * 打开查看详情
 */
TDriverPromotionActivity.viewUser = function (e) {
    var index = layer.open({
        type: 2,
        title: '司机推广下级用户',
        area: ['100%', '100%'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/tDriverPromotionActivity/tDriverPromotionActivity_viewUser/' + e
    });
    this.layerIndex = index;
};
/**
 * 打开查看详情
 */
TDriverPromotionActivity.update = function (e) {
        var index = layer.open({
            type: 2,
            title: '编辑',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tDriverPromotionActivity/tDriverPromotionActivity_update/' + e
        });
        this.layerIndex = index;
};
TDriverPromotionActivity.info = function (e) {
        var index = layer.open({
            type: 2,
            title: '编辑',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tDriverPromotionActivity/tDriverPromotionActivity_info/' + e
        });
        this.layerIndex = index;
};
/**
 * 删除
 */
TDriverPromotionActivity.delete = function (e) {
        var ajax = new $ax(Feng.ctxPath + "/tDriverPromotionActivity/delete", function (data) {
            Feng.success("删除成功!");
            TDriverPromotionActivity.table.refresh();
        }, function (data) {
            Feng.error("删除失败!" + data.responseJSON.message + "!");
        });
        ajax.set("tDriverPromotionActivityId", e);
        ajax.start();
};
TDriverPromotionActivity.stop = function (e) {
        var ajax = new $ax(Feng.ctxPath + "/tDriverPromotionActivity/stop", function (data) {
            Feng.success("暂停成功!");
            TDriverPromotionActivity.table.refresh();
        }, function (data) {
            Feng.error("暂停失败!" + data.responseJSON.message + "!");
        });
        ajax.set("id", e);
        ajax.start();
};
TDriverPromotionActivity.start = function (e) {
    var ajax = new $ax(Feng.ctxPath + "/tDriverPromotionActivity/start", function (data) {
        Feng.success("暂停成功!");
        TDriverPromotionActivity.table.refresh();
    }, function (data) {
        Feng.error("暂停失败!" + data.responseJSON.message + "!");
    });
    ajax.set("id", e);
    ajax.start();
};
TDriverPromotionActivity.startOrStop = function () {
    if (this.check()) {
        if (TDriverPromotionActivity.seItem.status == 1) {
            TDriverPromotionActivity.stop(TDriverPromotionActivity.seItem.id);
        } else {
            TDriverPromotionActivity.start(TDriverPromotionActivity.seItem.id);
        }
    }
};
/**
 * 查询列表
 */
TDriverPromotionActivity.search = function () {
    var queryData = {};
    queryData['driverName'] = $("#driverName").val();
    queryData['id'] = $("#id").val();
    TDriverPromotionActivity.table.refresh({query: queryData});
};
TDriverPromotionActivity.resetSearch = function () {
    $("#driverName").val('');
    TDriverPromotionActivity.search()
};
TDriverPromotionActivity.exportExcel = function () {
    let p = "";
    let id = $('#id').val();
    let driverName = $('#driverName').val();
    if(null != id && '' != id){
        p += "id=" + id + "&";
    }
    if(null != driverName && '' != driverName){
        p += "driverName=" + driverName + "&";
    }
    if('' != p){
        p = "?" + p.substring(0, p.length - 1);
    }
    console.log('p['+p+']')
    window.location.href = Feng.ctxPath + '/tDriverPromotionActivity/export' + p;
};
$(function () {
    var defaultColunms = TDriverPromotionActivity.initColumn();
    var table = new BSTable(TDriverPromotionActivity.id, "/tDriverPromotionActivity/list1", defaultColunms);
    table.setPaginationType("client");
    TDriverPromotionActivity.table = table.init();
});
ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tDriverPromotionActivity/tDriverPromotionActivity2.js
New file
@@ -0,0 +1,191 @@
/**
 * 管理初始化
 */
var TDriverPromotionActivity = {
    id: "TDriverPromotionActivityTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
/**
 * 初始化表格的列
 */
TDriverPromotionActivity.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '序号', field: 'sort', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row, index) {
                // 使用序号作为排名,index从0开始,所以需要+1
                return index + 1;
            }
        },
        {title: '用户Id', field: 'userId', visible: true, align: 'center', valign: 'middle'},
        {title: '用户昵称', field: 'userName', visible: true, align: 'center', valign: 'middle'},
        {title: '用户手机号', field: 'userPhone', visible: true, align: 'center', valign: 'middle'},
        {title: '绑定时间', field: 'bindDate', visible: true, align: 'center', valign: 'middle',
        },
        {title: '有效期至', field: 'bindExpireDate', visible: true, align: 'center', valign: 'middle',
        },
        {title: '产生收益合计', field: 'money', visible: true, align: 'center', valign: 'middle',
        },
    ];
};
/**
 * 检查是否选中
 */
TDriverPromotionActivity.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if (selected.length == 0) {
        Feng.info("请先选中表格中的某一记录!");
        return false;
    } else {
        TDriverPromotionActivity.seItem = selected[0];
        return true;
    }
};
/**
 * 点击添加
 */
TDriverPromotionActivity.openAddTDriverPromotionActivity = function () {
    var index = layer.open({
        type: 2,
        title: '添加',
        area: ['100%', '100%'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/tDriverPromotionActivity/tDriverPromotionActivity_add'
    });
    this.layerIndex = index;
};
/**
 * 打开查看详情
 */
TDriverPromotionActivity.viewUser = function (e) {
    var index = layer.open({
        type: 2,
        title: '司机推广下级用户',
        area: ['100%', '100%'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/tDriverPromotionActivity/tDriverPromotionActivity_viewUser/' + e
    });
    this.layerIndex = index;
};
/**
 * 打开查看详情
 */
TDriverPromotionActivity.update = function (e) {
        var index = layer.open({
            type: 2,
            title: '编辑',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tDriverPromotionActivity/tDriverPromotionActivity_update/' + e
        });
        this.layerIndex = index;
};
TDriverPromotionActivity.info = function (e) {
        var index = layer.open({
            type: 2,
            title: '编辑',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tDriverPromotionActivity/tDriverPromotionActivity_info/' + e
        });
        this.layerIndex = index;
};
/**
 * 删除
 */
TDriverPromotionActivity.delete = function (e) {
        var ajax = new $ax(Feng.ctxPath + "/tDriverPromotionActivity/delete", function (data) {
            Feng.success("删除成功!");
            TDriverPromotionActivity.table.refresh();
        }, function (data) {
            Feng.error("删除失败!" + data.responseJSON.message + "!");
        });
        ajax.set("tDriverPromotionActivityId", e);
        ajax.start();
};
TDriverPromotionActivity.stop = function (e) {
        var ajax = new $ax(Feng.ctxPath + "/tDriverPromotionActivity/stop", function (data) {
            Feng.success("暂停成功!");
            TDriverPromotionActivity.table.refresh();
        }, function (data) {
            Feng.error("暂停失败!" + data.responseJSON.message + "!");
        });
        ajax.set("id", e);
        ajax.start();
};
TDriverPromotionActivity.start = function (e) {
    var ajax = new $ax(Feng.ctxPath + "/tDriverPromotionActivity/start", function (data) {
        Feng.success("暂停成功!");
        TDriverPromotionActivity.table.refresh();
    }, function (data) {
        Feng.error("暂停失败!" + data.responseJSON.message + "!");
    });
    ajax.set("id", e);
    ajax.start();
};
TDriverPromotionActivity.startOrStop = function () {
    if (this.check()) {
        if (TDriverPromotionActivity.seItem.status == 1) {
            TDriverPromotionActivity.stop(TDriverPromotionActivity.seItem.id);
        } else {
            TDriverPromotionActivity.start(TDriverPromotionActivity.seItem.id);
        }
    }
};
/**
 * 查询列表
 */
TDriverPromotionActivity.search = function () {
    var queryData = {};
    queryData['name'] = $("#name").val();
    queryData['driverId'] = $("#driverId").val();
    TDriverPromotionActivity.table.refresh({query: queryData});
};
TDriverPromotionActivity.research = function () {
    $("#name").val('');
    TDriverPromotionActivity.search()
};
TDriverPromotionActivity.exportExcel = function () {
    let p = "";
    let name = $('#name').val();
    let driverId = $('#driverId').val();
    if(null != name && '' != name){
        p += "name=" + name + "&";
    }
    if(null != driverId && '' != driverId){
        p += "driverId=" + driverId + "&";
    }
    if('' != p){
        p = "?" + p.substring(0, p.length - 1);
    }
    console.log('p['+p+']')
    window.location.href = Feng.ctxPath + '/tDriverPromotionActivity/export1' + p;
};
$(function () {
    var defaultColunms = TDriverPromotionActivity.initColumn();
    var table = new BSTable(TDriverPromotionActivity.id, "/tDriverPromotionActivity/list2", defaultColunms);
    table.setPaginationType("client");
    TDriverPromotionActivity.table = table.init();
    TDriverPromotionActivity.search()
});