You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dongfeng-pay/boss/views/order_profit.html

305 lines
13 KiB
Go

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
<script src="../static/js/filter.js"></script>
<script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="../static/js/basic.js"></script>
<style>
.order-record .search{
margin: 0;
padding: 0;
}
.search label {
font-weight: normal;
padding-right: 20px;
}
.order-profit-record .search div {
height: 20px;
}
#search-order-status, #search-order-pay-way-code,#search-order-supplier-name {
height: 30px;
margin-right: 15px;
}
#order-table-body tr {
height: 30px;
line-height: 30px;
}
#supplierProfit, #platformProfit, #agentProfit {
display: inline-block;
padding-right: 50px;
}
.menu-table {
margin-top: 10px;
}
#order-search {
background-color: skyblue;
width: 120px;
margin-right: 30px;
}
</style>
</head>
<body>
<div class="order-record">
<div class="search form-inline" style="font-weight: normal;">
<label for="" style="font-weight: normal;">
<span></span>
<input type="text" name="" value="" id="search-order-start-time" class="start-time" value="">
</label>
<label for="" style="font-weight: normal;">
<span></span>
<input type="text" name="" value="" id="search-order-end-time" class="end-time" value="">
</label>
<label for="" style="font-weight: normal;">
<span></span>
<input type="text" id="search-order-merchant-name" placeholder="模糊匹配">
</label>
<label for="">
<span></span>
<input type="text" name="" value="" id="search-order-agent-name" placeholder="模糊匹配">
</label>
<label style="font-weight: normal;">
<span></span>
<input type="text" id="search-order-bank-order-id" value="" >
</label>
<label for="" style="font-weight: normal;">
<select name="" id="search-order-supplier-name">
</select>
</label>
<label for="" style="font-weight: normal;">
<select name="" id="search-order-status">
<option value=""></option>
<option value="success"></option>
<option value="wait"></option>
<option value="fail"></option>
<option value="cancel"></option>
</select>
</label>
<label for="" style="font-weight: normal;">
<select name="" id="search-order-pay-way-code">
<option value=""></option>
<option value="WEIXIN_SCAN"></option>
<option value="WEIXIN_H5">H5</option>
<option value="WEIXIN_SYT"></option>
<option value="ALI_SCAN"></option>
<option value="ALI_H5">H5</option>
<option value="ALI_SYT"></option>
<option value="QQ_SCAN">QQ</option>
<option value="QQ_H5">QQ-H5</option>
<option value="QQ_SYT">QQ</option>
<option value="UNION_SCAN"></option>
<option value="UNION_H5">H5</option>
<option value="UNION_PC_WAP">pc-web</option>
<option value="UNION_SYT"></option>
<option value="UNION_FAST"></option>
<option value="BAIDU_SCAN"></option>
<option value="BAIDU_H5">H5</option>
<option value="BAIDU_SYT"></option>
<option value="JD_SCAN"></option>
<option value="JD_H5">H5</option>
<option value="JD_SYT"></option>
</select>
</label>
{{/*<br>*/}}
<label class="color-red" style="font-weight: normal;">
<span id="supplierProfit"></span>
</label>
<label class="color-red" style="font-weight: normal;">
<span id="platformProfit"></span>
</label>
<label class="color-red" style="font-weight: normal;">
<span id="agentProfit"></span>
</label>
<button type="button" class="btn btn-default" id="order-search"></button>
</div>
<div class="menu-table table-responsive">
<table>
<thead class="thead-dark">
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody id="order-table-body">
</tbody>
</table>
</div>
<!-- -->
<div class="cut_page">
<li>
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page"></li>
<li class="next_page"></li>
<li class="jump_page"> <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li>
</div>
</div>
<script>
//获取搜索去的参数
function getOrderProfitSearchValues() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
let startTime = $("#search-order-start-time").val();
let endTime = $("#search-order-end-time").val();
let merchantName = $("#search-order-merchant-name").val();
let agentName = $("#search-order-agent-name").val();
let bankOrderId = $("#search-order-bank-order-id").val();
let orderStatus = $("#search-order-status").val();
let supplierUid = $("#search-order-supplier-name").val();
let payWayCode = $("#search-order-pay-way-code").val();
return {
"displayCount":displayCount,
"currentPage":currentPage,
"totalPage":totalPage,
"jumpPage":jumpPage,
"startTime":startTime,
"endTime":endTime,
"merchantName":merchantName,
"agentName":agentName,
"bankOrderId":bankOrderId,
"orderStatus":orderStatus,
"supplierUid":supplierUid,
"payWayCode":payWayCode
};
}
function setOrderCutPageValues(res) {
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function() {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
}
function showOrderProfitList(res) {
setOrderCutPageValues(res);
let str = "";
for (let i = 0; i < res.List.length; i ++) {
let v = res.List[i];
let tmp = "<tr>";
if (v.Status == "success") {
tmp = "<tr style='color: blue;'>"
} else if (v.Status == "fail") {
tmp = "<tr style='color: red;'>"
}
tmp = tmp + "<th>" + (res.StartIndex+i+1) + "</th>" +
"<th>" + v.MerchantName + "</th>" + "<th>" + v.AgentName + "</th>" + "<th>" + v.BankOrderId + "</th>" +
"<th>" + v.FactAmount + "</th>" + "<th>" + v.Status + "</th>" + "<th>" + v.SupplierProfit + "</th>" +
"<th>" + v.PlatformProfit + "</th>" + "<th>" + v.AgentProfit + "</th>" + "<th>" + v.PayTypeName + "</th>" +
"<th>" + v.PayProductName + "</th>";
tmp = tmp.replace("wait", "等待支付").replace("success", "支付成功").replace("fail", "支付失败").replace("cancel", "放弃支付");
tmp = tmp + '</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#order-all-amount").html(res.AllAmount);
$("#success-rate").html(res.SuccessRate);
$("#order-table-body").html(str);
$("#supplierProfit").html(res.SupplierProfit);
$("#platformProfit").html(res.PlatformProfit);
$("#agentProfit").html(res.AgentProfit);
}
function AjaxOrderProfitList(dataJSON) {
$.ajax({
url:"/get/orderProfit",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
} else {
showOrderProfitList(res);
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}
$("#order-search").click(function () {
let dataJSON = getOrderProfitSearchValues();
AjaxOrderProfitList(dataJSON);
});
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
let dataJSON = getOrderProfitSearchValues();
AjaxOrderProfitList(dataJSON);
});
//点击上一页的按钮
$(".pre_page").click(function() {
let dataJSON = getOrderProfitSearchValues();
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
AjaxOrderProfitList(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function() {
let dataJSON = getOrderProfitSearchValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
AjaxOrderProfitList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getOrderProfitSearchValues();
if (dataJSON["jumpPage"].length <= 0) {
return;
}
AjaxOrderProfitList(dataJSON);
});
$(function () {
let day = new Date(new Date().getTime() - 86400000);
let s = dateFtt("yyyy-MM-dd hh:mm:ss", day);
$("#search-order-start-time").val();
setSupplier();
let dataJSON = getOrderProfitSearchValues();
AjaxOrderProfitList(dataJSON);
})
</script>
</body>
</html>