//查询路线
function getQuotation(page, limit, startTime, endTime, destination){
    layer.load(3);
    $.ajax({
        url: "/releaseCotroller/getRelease",
        type: "get",
        data: {
            "page": page,
            "limit": limit,
            "startTime": startTime,
            "endTime": endTime,
            "destination": destination
        },
        headers: {"token": token},
        dataType: "json",
        success: (data) => {
            if(data.msg == "200"){
                $(".content_div div").remove();
                $.each(data.data, (index, item) => {
                    $(".content_div").append("<div uuid="+ item.uuid +" class=\"content_column\">\n" +
                        "<div class=\"content_div_input\">\n" +
                        "<div class=\"head_name\" style=\"width: 5%;\">"+ (index + 1) +"</div>\n" +
                        "<div class=\"head_name\" style=\"width: 25%;\">"+ item.origin +"</div>\n" +
                        "<div class=\"head_name\" style=\"width: 20%;\">"+ item.destination +"</div>\n" +
                        "<div class=\"head_name\" style=\"width: 15%;\">"+ item.startTime +" - "+ item.endTime +"</div>\n" +
                        "<div class=\"head_name\" style=\"width: 15%;\">"+ item.peopleNum +"</div>\n" +
                        "<div class=\"head_name\" style=\"width: 20%;\">\n" +
                        "<button class=\"offer_button button_div_head\" onclick='offerClick(this)' data-locale=\"xiugai\"><img src=\"/images/demandForSingle/offer.png\"/>"+ paramReturn("修改", parent.type) +"</button>\n" +
                        "</div>\n" +
                        "</div>\n" +
                        "</div>")
                });
                //自定义样式分页
                laypage.render({
                    elem: 'demo2'
                    ,count: data.data.length
                    ,theme: '#1E9FFF'
                    , limit: limit
                    , curr: page
                    , jump: function (obj,first) {
                        if (!first) {
                            getQuotation(obj.curr,obj.limit, startTime, endTime, destination);
                        }
                    }
                    , prev: '<em><i class="layui-icon">&#xe603;</i></em>'
                    , next: '<em><i class="layui-icon">&#xe602;</i></em>'
                });
            }
            layer.closeAll("loading");
        },
        error: () => {
            layer.alert("服务器异常，请联系管理员", {icon: 2});
            layer.closeAll("loading");
        }
    });
}
//修改
function offerClick(obj){
    let uuid = $(obj).parent().parent().parent().attr("uuid");
    window.location.href = "/page/releaseModel?type=updateReleaseVal&uuid=" + uuid;
}