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

244 lines
9.6 KiB
Plaintext

@using CRM.Core.Model.Entity
@using Core.Web.WebHelper
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="x-body">
<div class="layui-btn-group" style="padding-bottom:10px;">
@*<button class="layui-btn" data-method="other1">确认到款</button>
<button class="layui-btn" data-method="other2">批量确认</button>
<button class="layui-btn" data-method="import">导入</button>
<button class="layui-btn" data-method="other3">流水号检查</button>*@
@Html.Action("ToolBar", "Home",
new
{
area = "",
rightcode = (ViewBag.rightCode as string),
otherToolBars = new ToolBar[]
{
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other1, "导入", "layui-btn-upload1","") ,
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other2, "到账匹配导出", "layui-btn-normal",""),
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other3, "退款匹配导出", "layui-btn-normal",""),
}
}
)
</div>
<div id="mytoolbar">
年月:
<div class="layui-input-inline">
<input type="text" class="layui-input" id="yearMonth" name="txt_yearMonth" placeholder="yyyy-MM" width="200">
</div>
交易流水号:<div class="layui-inline">
<input type="text" name="txt_trade_no" placeholder="请输入" autocomplete="off" class="layui-input">
</div>
收款商户:
<div class="layui-inline">
<select name="txt_mch" style="height:35px;">
<option value="">请选择</option>
<option value="Wxpay">微信支付</option>
<option value="Alipay">支付宝</option>
<option value="Bank">银行转账</option>
</select>
</div>
交易类型:
<div class="layui-inline">
<select name="txt_trade_type" style="height:35px;">
<option value="">请选择</option>
<option value="Pay">收款</option>
<option value="Refund">退款</option>
</select>
</div>
交易时间:
<div class="layui-inline">
<input class="layui-input" placeholder="开始日" name="txt_stime" id="start" style="width:120px;">
</div>
<div class="layui-inline">
<input class="layui-input" placeholder="截止日" name="txt_etime" id="end" style="width:120px;">
</div>
<button class="layui-btn" data-type="reload" id="search">查询</button>
</div>
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
<div id="setUserNameDiv" class="layui-form" style="padding-top:10px; display:none;">
<div class="layui-form-item">
<label class="layui-form-label">名称:</label>
<div class="layui-input-block">
<input type="text" name="payusername" id="payusername" placeholder="请输入" autocomplete="off" class="layui-input" style="width:80%" />
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button type="submit" class="layui-btn" id="setname">确定</button>
</div>
</div>
</div>
</div>
<iframe id="BillOpen" width="0" height="0" scrolling="no" frameborder="0" style="display:none;"></iframe>
<script>
var selectRow = {};
layui.use(['table', 'laydate', 'layer', 'upload'], function () {
var table = layui.table
, upload = layui.upload
, laydate = layui.laydate
, layer = layui.layer;
laydate.render({ elem: '#start' });
laydate.render({ elem: '#end' });
var date = new Date();
var month = date.getMonth() + 1;
var monthStr = "";
if (month < 10) {
monthStr = "0" + month;
}
else {
monthStr = month;
}
var initYearMonth = date.getFullYear() + "-" + monthStr;
laydate.render({
elem: '#yearMonth'
, type: 'month'
, value: initYearMonth
});
table.render({
id: 'testReload',//列表别名ID
elem: '#tabl1',//表ID
url: '/Bill/Index',
method: 'POST',
toolbar: '<div>账单</div>',
defaultToolbar: ['filter', 'exports'],
totalRow: true,
cols: [[
{ field: 'mch', title: '商户', width: 90, templet: '#mch', totalRowText: "合计:", }
, { field: 'mch_id', title: '商户号' }
, { field: 'trade_no', title: '交易流水号', width: 260 }
, { field: 'trade_datetime', title: '交易时间', width: 170 }
, { field: 'trade_amount', title: '交易金额', width: 130, totalRow: true }
, { field: 'fee_amount', title: '手续费', width: 130, totalRow: true }
, { field: 'trade_type', title: '交易类型', width: 100, templet: '#trade_type' }
, { field: 'out_mch', title: '对方商户' }
, { field: 'payer_id', title: '用户id' }
, { field: 'out_mchid', title: '对方账户' }
, { field: 'main_trade_no', title: '交易主单号', }
, { field: 'creat_id', title: '创建用户', }
, { field: 'creat_datetime', title: '创建时间', }
, { field: 'last_modify_time', title: '修改时间', }
]],
page: {
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
, groups: 5 //只显示 1 个连续页码
}
,
where: GetParams("mytoolbar")
, done: function (res, curr, count) {
$('.layui-table-tool-temp').text("账单:" + res.billmsg);
}
});
$('#mytoolbar .layui-btn').on('click', function (data) {
var param = GetParams("mytoolbar");
table.reload('testReload', {
where: param
});
});
//监听行单击事件
table.on('row(tabl1)', function (obj) {
var data = obj.data;
//obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
selectRow = data;
});
var active = {
other2: function () {
var mch = $("#mch").val();
var trade_type = $("#trade_type").val();
var yearMonth = $("#yearMonth").val();
var sTime = $("#sTime").val();
var eTime = $("#eTime").val();
$("#BillOpen").attr("src", "/bill/CheckBillDepositExport?mch=" + mch + "&trade_type=" + trade_type + "&yearMonth=" + yearMonth + "&sTime=" + sTime + "&eTime=" + eTime);
},
other3: function () {
var mch = $("#mch").val();
var trade_type = $("#trade_type").val();
var yearMonth = $("#yearMonth").val();
var sTime = $("#sTime").val();
var eTime = $("#eTime").val();
$("#BillOpen").attr("src", "/bill/CheckBillRefundExport?mch=" + mch + "&trade_type=" + trade_type + "&yearMonth=" + yearMonth + "&sTime=" + sTime + "&eTime=" + eTime);
}
};
$('.layui-btn-group .layui-btn').on('click', function () {
var othis = $(this), method = othis.data('method');
active[method] ? active[method].call(this, othis) : '';
});
upload.render({ //允许上传的文件后缀
elem: '.layui-btn-upload1'
, url: '/Bill/Import'
, accept: 'file' //普通文件
, exts: 'xls|xlsx|csv|zip' //只允许上传压缩文件
, size: 100000 //限制文件大小,单位 KB
, auto: true
, done: function (res) {
layer.closeAll('loading');
if (res.result) {
layer.msg("操作成功!导入" + res.retmsg, { icon: 1, time: 6666 });
var param = GetParams("mytoolbar");
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
},
where: param
});
}
else {
if (res.retmsg != "") {
layer.msg(res.retmsg, { icon: 2, time: 6666 });
}
else {
layer.msg("操作失败了!", { icon: 2, time: 0 });
}
}
}
, error: function () {
layer.closeAll('loading');
layer.msg("操作失败了,请重新上传!", { icon: 2, time: 5000 });
}
});
});
</script>
<script type="text/html" id="trade_type">
{{# if(d.trade_type == 'Pay'){ }}
<span style="color:green">收款</span>
{{# } else if(d.trade_type == 'Refund') { }}
<span style="color:red">退款</span>
{{# } }}
</script>
<script type="text/html" id="mch">
{{# if(d.mch == 'Wxpay'){ }}
<span style="color:green">微信支付</span>
{{# } else if(d.mch == 'Alipay') { }}
<span style="color:red">支付宝</span>
{{# } else if(d.mch == 'Bank') { }}
<span style="color:red">银行</span>
{{# } }}
</script>