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

309 lines
13 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@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-normal","") ,
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other2, "批量确认", "layui-btn-normal","") ,
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other3, "流水号检查", "layui-btn-normal","") ,
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other4, "到账检查", "layui-btn-normal","") ,
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other5, "修改到账名称", "layui-btn-normal","") ,
}
}
)
</div>
<div id="mytoolbar">
订单号:
<div class="layui-inline">
<input type="text" name="txt_orderId" placeholder="请输入" autocomplete="off" class="layui-input" value="@Request.QueryString["orderid"]">
</div>
微信小店单号:
<div class="layui-inline">
<input type="text" name="txt_wxShopOrderNo" placeholder="请输入" autocomplete="off" class="layui-input">
</div>
支付流水:<div class="layui-inline">
<input type="text" name="txt_payno" placeholder="请输入" autocomplete="off" class="layui-input">
</div>
事业部:
<div class="layui-inline">
<select name="txt_channel" style="height:35px;">
<option value="">请选择</option>
@foreach (var item in ViewBag.companyList as List<Bas_CompanyVirtual>)
{
<option value="@item.Channel">@item.CompanyName</option>
}
</select>
</div>
支付类型:
<div class="layui-inline">
<select name="txt_paytype" style="height:35px;">
<option value="">请选择</option>
<option value="1">支付宝</option>
<option value="3">银行转账</option>
<option value="5">微信支付</option>
<option value="11">苹果支付</option>
<option value="12">华为支付</option>
<option value="13">魅族支付</option>
<option value="15">抖音平台</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>
确认状态:<div class="layui-inline">
<select name="txt_auditStatus" style="height:35px;">
<option value="">请选择</option>
<option value="0">未确认</option>
<option value="1">已确认</option>
<option value="-1">驳回</option>
</select>
</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>
<script>
var selectRow = {};
layui.use(['table', 'laydate', 'layer'], function () {
var table = layui.table
, laydate = layui.laydate
, layer = layui.layer;
laydate.render({ elem: '#start' });
laydate.render({ elem: '#end' });
table.render({
id: 'testReload',//列表别名ID
elem: '#tabl1',//表ID
url: '/OrderPay/Index',
method: 'POST',
totalRow: true,
cols: [[
{ type: 'checkbox' }
, { field: 'orderid', title: '订单号', width: 100, templet: function (res) { if (res.orderid == 0) return "合计:"; else return res.orderid; } }
//, { field: 'wxshoporderno', title: '微信小店单号', width: 180 }
, { field: 'payno', title: '流水号', width: 260 }
, { field: 'needpay', title: '下单金额' }
, { field: 'paytypename', title: '支付类型', width: 100 }
, { field: 'paydate', title: '使用时间', templet: function (res) { if (res.paydate == "0001-01-01 00:00:00") return ''; else return res.paydate; } }
, { field: 'payprice', title: '使用金额', totalRow: true }
//, { field: 'payname', title: '付款人姓名' }
, { field: 'remark', title: '备注' }
, { field: 'rejectremark', title: '说明' }
, { field: 'checkreslut', title: '自动对账结果' }
, {
field: 'checkpaytime', title: '对账支付时间', templet:
function (res) {
if (res.checkpaytime == "0001-01-01 00:00:00" || res.checkpaytime == null)
return '';
else
return res.checkpaytime;
}
}
, { field: 'auditstatus', title: '状态', width: 100, templet: '#auditTpl' }
]]
, page: { //支持传入 laypage 组件的所有参数某些参数除外jump/elem - 详见文档
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
//,curr: 5 //设定初始在第 5 页
, groups: 5 //只显示 1 个连续页码
},
where: GetParams("mytoolbar")
/*, parseData: function (res) {
console.log(res);
return {
"code": res.code, //解析接口状态
"msg": res.msg, //解析提示文本
"count": res.count, //解析数据长度
"data": res.data //解析数据列表
};
}*/
, done: function (res, curr, count) {
//console.log(res);
//$(".layui-table-total .layui-table td:eq(5) div").text(res.totalRow.payprice);
}
});
$('#mytoolbar .layui-btn').on('click', function (data) {
var param = GetParams("mytoolbar");
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
},
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 = {
other1: function () {
if (selectRow.id === "undefined" || selectRow.id == null) {
layer.alert("请先选中一条记录!", { title: '提示' });
return;
}
layer.open({
type: 2,
content: '/OrderPay/Audit?id=' + selectRow.id,
area: ['40%', '70%']
});
},
other4: function () {
layer.open({
type: 2,
title: '到账检查',
maxmin: true,
shade: false,
area: ['90%', '90%'],
content: '/OrderPay/Import'
});
},
other3: function () {
layer.open({
type: 2,
title: '流水号检查',
maxmin: true,
shade: false,
area: ['90%', '90%'],
content: '/OrderPay/Exists'
});
},
other2: function () {
var checkStatus = table.checkStatus("testReload");
var ids = [];
$.each(checkStatus.data, function (i, j) {
ids.push(j.id);
});
if (checkStatus.data.length <= 0) {
layer.msg("请勾选要执行的记录!");
return;
}
console.log(ids);
layer.confirm('确定执行吗?', { icon: 3, title: '提示' }, function (index) {
layer.close(index);
//console.log(ids);
$.r_post('/OrderPay/Batch', { ids }, function (rsp) {
if (rsp.result) {
layer.msg('操作成功!', { icon: 1 }, function () {
var refresh = $(".layui-laypage-refresh");
if (refresh.length == 0) {
$("#search").click();
}
else {
refresh[0].click();
}
});
}
else {
//layer.msg('操作失败!' + rsp.retmsg, { icon: 2 });
layer.alert(rsp.retmsg);
}
});
});
},
other5: function () {
if (selectRow.id === "undefined" || selectRow.id == null) {
//layer.alert("请先选中一条记录!", { title: '提示' });
layer.msg('请先选中一条记录!');
return;
}
layer.open({
type: 1,
content: $("#setUserNameDiv"),
area: ['30%', '40%']
});
$("#setUserNameDiv").show();
}
};
$('.layui-btn-group .layui-btn').on('click', function () {
var othis = $(this), method = othis.data('method');
active[method] ? active[method].call(this, othis) : '';
});
$("#setname").click(function () {
var id = selectRow.id;
var payName = $("#payusername").val();
$.r_post('/OrderPay/SetPayName', { id, payName }, function (rsp) {
if (rsp.result) {
layer.msg('操作成功!', { icon: 1 }, function () {
var refresh = $(".layui-laypage-refresh");
if (refresh.length == 0) {
$("#search").click();
}
else {
refresh[0].click();
}
});
}
else {
//layer.msg('操作失败!' + rsp.retmsg, { icon: 2 });
layer.alert(rsp.retmsg);
}
layer.closeAll();
});
$("#setUserNameDiv").hide();
});
});
</script>
<script type="text/html" id="auditTpl">
{{# if(d.auditstatus == '1'){ }}
<span style="color:green">已确认</span>
{{# } else if(d.auditstatus == '-1') { }}
<span style="color:red">驳回</span>
{{# } else if(d.auditstatus == '0' && d.orderid != '0') { }}
未确认
{{# } }}
</script>