ComplianceServer/oldcode/Core.Web/Views/MonBalance/Index.cshtml

193 lines
8.5 KiB
Plaintext

@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="x-body">
<div class="layui-inline">
<select id="year" style="height:35px;">
<option>2018</option>
<option>2019</option>
<option>2020</option>
<option>2021</option>
<option>2022</option>
</select>
</div>
<div class="layui-inline">
<select id="month" style="height:35px;">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
</div>
<button class="layui-btn" data-type="reload" id="search">查询</button>
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
</div>
<script>
$(function () {
setLastMonth();
});
function setLastMonth() {
var date = new Date;
var year = date.getFullYear();
var month = date.getMonth() + 1;
/*if (month == 0) {
year = year - 1;
month = 12;
}*/
$("#year").val(year);
$("#month").val(month);
}
layui.use('table', function () {
var table = layui.table,
$ = layui.jquery;
table.render({
id: 'tableMonBalance',//列表别名ID
elem: '#tabl1',//表ID
url: '/MonBalance/Index',
method: 'POST',
where: { year: $("#year").val(), month: $("#month").val() },
totalRow: true,
height: 'full-110',
toolbar: '<div>结算列表</div>',
defaultToolbar: ['exports'],
cols: [[
{ field: 'month', title: '月份', width: 120, totalRowText: '合计', fixed: 'left' }
//, { field: 'companycode', title: '分公司编码', width: 100 }
, { field: 'companyname', title: '分公司名称', width: 120, fixed: 'left' }
, { field: 'order200', title: '已支付金额', width: 100, totalRow: true }
, { field: 'ordercount200', title: '已支付数量', width: 100, totalRow: true }
, { field: 'order220', title: '已开通金额', width: 100, totalRow: true }
, { field: 'ordercount220', title: '已开通数量', width: 100, totalRow: true }
, { field: 'alipay', title: '支付宝', width: 110, totalRow: true }
, { field: 'weixinPay', title: '微信', width: 110, totalRow: true }
, { field: 'bankPay', title: '银行转账', width: 110, totalRow: true }
, { field: 'arrivalpay', title: '订单金额', templet: '#arrivalpayTpl', width: 110, totalRow: true }
, { field: 'ordercount', title: '总单量', width: 110, totalRow: true }
, { field: 'orderpayprice', title: '订单到账金额', templet: '#orderpaypriceTpl', width: 120, totalRow: true }
, { field: 'orderpaycount', title: '订单到账笔数', width: 120, totalRow: true }
, { field: 'payprice', title: '支付到账金额', templet: '#paypriceTpl', width: 120, totalRow: true }
, { field: 'paycount', title: '支付到账笔数', width: 120, totalRow: true }
, { field: 'refundprice', title: '退款金额', templet: '#refundpriceTpl', width: 110, totalRow: true }
, { field: 'refundcount', title: '退款笔数', width: 110, totalRow: true }
, { field: 'refundpricereal', title: '实际退款金额', templet: '#refundpricerealTpl', width: 110, totalRow: true }
, { field: 'refundcountreal', title: '实际退款笔数', width: 110, totalRow: true }
//, { field: 'action', title: '操作', toolbar: '#barAction', fixed: 'right', width: 180 }
]]
});
$("#search").click(function () {
table.reload('tableMonBalance', {
where: { year: $("#year").val(), month: $("#month").val() }
});
});
table.on('tool(tabl1)', function (obj) {
var data = obj.data;
var day = new Date(data.month);
var year = day.getFullYear();
var month = day.getMonth() + 1;
var companycode = data.companycode;
//if (obj.event === 'detail') {
// layer.open({
// type: 2,
// title: '月结明细',
// maxmin: true,
// area: ['90%', '90%'],
// content: '/MonBalance/Detail?year=' + year + "&month=" + month + "&companyCode=" + companycode
// });
//} else if (obj.event === 'balance') {
// $.r_post('/MonBalance/Balance', { year: year, month: month, companycode: companycode }, function (res) {
// if (res.result) {
// layer.alert("月结执行完成!", {
// yes: function () { window.location.reload(); }
// })
// }
// else {
// if (res.message === "exists") {
// layer.alert("已经月结过了,请确认!");
// }
// else {
// layer.alert("月结执行失败,请重试!");
// }
// }
// });
//} else if (obj.event === 'unbalance') {
// $.r_post('/MonBalance/UnBalance', { year: year, month: month, companycode: companycode }, function (res) {
// if (res.result) {
// layer.alert("反月结执行完成!", {
// yes: function () { window.location.reload(); }
// })
// }
// else {
// layer.alert("反月结执行失败,请重试!");
// }
// });
//}
});
});
function View(action, yearmonth, companycode, channel) {
var day = new Date(yearmonth);
var year = day.getFullYear();
var month = day.getMonth() + 1;
//var url = '/MonBalance/' + action + '?year=' + year + "&month=" + month + "&companycode=" + companycode + "&channelmin=" + channelmin + "&channelmax=" + channelmax;
var url = '/MonBalance/' + action + '?year=' + year + "&month=" + month + "&companycode=" + companycode + "&channel=" + channel;
layer.open({
type: 2,
title: '订单明细',
maxmin: true,
area: ['90%', '90%'],
content: url
});
}
</script>
<script type="text/html" id="barAction">
{{# if(d.isbalance) { }}
<a class="layui-btn layui-btn-disabled layui-btn-xs">月结</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="unbalance">反月结</a>
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="detail">查看</a>
{{# } else { }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="balance">月结</a>
<a class="layui-btn layui-btn-disabled layui-btn-xs">反月结</a>
<a class="layui-btn layui-btn-disabled layui-btn-xs">查看</a>
{{# } }}
</script>
<script type="text/html" id="arrivalpayTpl">
<a href="javascript:void(0)" class="layui-table-link" onclick="View('OrderInfo', '{{ d.month }}','{{ d.companycode }}','{{ d.channel }}')">{{ d.arrivalpay }}</a>
</script>
<script type="text/html" id="paypriceTpl">
<a href="javascript:void(0)" class="layui-table-link" onclick="View('PayInfo', '{{ d.month }}','{{ d.companycode }}','{{ d.channel }}')">{{ d.payprice }}</a>
</script>
<script type="text/html" id="refundpriceTpl">
<a href="javascript:void(0)" class="layui-table-link" onclick="View('RefundInfo', '{{ d.month }}','{{ d.companycode }}','{{ d.channel }}')">{{ d.refundprice }}</a>
</script>
<script type="text/html" id="orderpaypriceTpl">
<a href="javascript:void(0)" class="layui-table-link" onclick="View('OrderPayPriceInfo', '{{ d.month }}','{{ d.companycode }}','{{ d.channel }}')">{{ d.orderpayprice }}</a>
</script>
<script type="text/html" id="refundpricerealTpl">
<a href="javascript:void(0)" class="layui-table-link" onclick="View('RefundRealInfo', '{{ d.month }}','{{ d.companycode }}','{{ d.channel }}')">{{ d.refundpricereal }}</a>
</script>