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

368 lines
15 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>*@
@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","")
}
}
)
</div>
<div id="mytoolbar">
订金ID
<div class="layui-inline">
<input type="text" name="txt_Id" placeholder="请输入" class="layui-input" value="@Request.QueryString["id"]">
</div>
客户ID
<div class="layui-inline">
<input type="text" name="txt_resId" placeholder="请输入" class="layui-input" value="@Request.QueryString["resid"]">
</div>
支付流水:<div class="layui-inline">
<input type="text" name="txt_payno" placeholder="请输入" 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="2">财富通</option>*@
<option value="3">银行转账</option>
@*<option value="4">网银支付</option>*@
<option value="5">微信支付</option>
@*<option value="6">支付宝银联</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>
使用状态:<div class="layui-inline">
<select name="txt_useStatus" style="height:35px;">
<option value="">请选择</option>
<option value="0">未使用</option>
<option value="1">已使用</option>
<option value="-1">已开通</option>
<option value="1,-1">已使用+已开通</option>
<option value="2">已退款</option>
</select>
</div>
<button class="layui-btn" data-type="reload">搜索</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'], function () {
var table = layui.table
, laydate = layui.laydate;
laydate.render({ elem: '#start' });
laydate.render({ elem: '#end' });
table.render({
id: 'testReload',//列表别名ID
elem: '#tabl1',//表ID
url: '/OrderDeposit/Index',
method: 'POST',
totalRow: true,
cols: [[
{
field: 'id', title: '订金ID', width: 100, templet: function (res) { if (res.id == 0) return "合计:"; else return res.id; }
}
, {
field: 'resid', title: '客户ID', width: 180 , templet: function (d) {
var html = "";
html += "<a style='color:blue;' href='javascript:parent.openUseLog(\"" + d.resid + "\")'>" + d.resid + "</a>"
return html;
}
}
, { field: 'payno', title: '流水号', width: 260 }
, { field: 'deptcode', title: '事业部', width:150 }
, { field: 'paytypename', title: '支付类型', width: 100}
, { field: 'paydate', title: '支付时间', width: 120 }
, { field: 'payprice', title: '支付金额', width: 150 }
, { field: 'useprice', title: '使用金额', width: 120}
, { field: 'lastprice', title: '剩余金额', width: 120 }
, { field: 'payname', title: '付款人姓名', width: 100}
, { field: 'remark', title: '备注', width: 100}
//, { field: 'isuse', title: '是否使用', templet: '#isuseTpl' }
, { field: 'auditstatus', title: '状态', templet: '#auditTpl', width: 100 }
, { field: 'orderid', title: '订单ID', width: 100 }
, { field: 'checkreslut', title: '自动对账结果', width: 100 }
, {
field: 'checkpaytime', title: '对账支付时间', width: 160, templet:
function (res) {
if (res.checkpaytime == null || res.checkpaytime == "0001-01-01 00:00:00")
return '';
else
return res.checkpaytime;
}
}
, { field: 'rejectremark', title: '说明', width: 100}
, { field: 'ctime', title: '创建时间', width: 160}
]]
, page: {
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
, groups: 5 //只显示 1 个连续页码
}
, where: GetParams("mytoolbar")
, done: function (res, curr, count) {
//console.log(res);
//$(".layui-table-total .layui-table td:eq(6) 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
});
selectRow = {};
});
//监听行单击事件
table.on('row(tabl1)', function (obj) {
var data = obj.data;
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
selectRow = data;
});
});
function openUseLog(resid) {
layer.open({
type: 2,
content: '/OrderDeposit/UsePayLog?resid=' + resid,
area: ['90%', '90%']
});
}
layui.use('layer', function () {
var layer = layui.layer;
var active = {
other1: function () {
if (selectRow.id === "undefined" || selectRow.id == null) {
layer.msg('请先选中一条记录!');
return;
}
layer.open({
type: 2,
content: '/OrderDeposit/Audit?id=' + selectRow.id,
area: ['40%', '70%']
});
selectRow = {};
},
other2: function () {
if (selectRow.id === "undefined" || selectRow.id == null) {
layer.msg('请先选中一条记录!');
return;
}
layer.confirm('您确认要取消到账吗?', function (index, layero) {
$.r_post('/OrderDeposit/Delete', { id: selectRow.id }, function (rsp) {
if (rsp.result) {
layer.msg('操作成功!', { icon: 1 }, function () {
$(".layui-laypage-refresh")[0].click();
});
}
else {
if (rsp.retmsg == "notexists") {
layer.msg("参数错误!");
}
else if (rsp.retmsg == "isuse") {
layer.msg("订金已经使用不能执行改操作!");
}
else if (rsp.retmsg == "notauditcantcacel") {
layer.msg('未审核,不能够取消!');
} else if (rsp.retmsg == "hasrefun") {
layer.msg('这条流水被退款过,不能取消到账!');
} else if (rsp.retcode == 220) {
layer.msg(rsp.retmsg);
}
else {
layer.msg("操作失败,请重试!");
}
}
}, "json");
selectRow = {};
}, function (index) {
//按钮【取消】的回调
});
},
other3: function () {
if (selectRow.id === "undefined" || selectRow.id == null) {
layer.msg('请先选中一条记录!');
return;
}
//只是取消使用,到账的状态不变
layer.confirm('您确定要取消此订金所有使用吗?', function (index, layero) {
$.r_post('/OrderDeposit/CancelUse', { id: selectRow.id }, function (rsp) {
if (rsp.result) {
//layer.msg('操作成功!', { icon: 1 }, function () { parent.window.location.reload(); });
layer.msg('操作成功!', { icon: 1 }, function () {
parent.layer.closeAll();
parent.$(".layui-laypage-refresh")[0].click();
});
}
else {
if (rsp.retmsg == "isaudit") {
layer.msg('已经确认了,不能执行该操作!');
}
else if (rsp.retmsg == "exists") {
layer.msg('已经驳回了,不需要重复操作!');
}
else if (rsp.retmsg == "error") {
layer.msg('出错了,请稍后重试!');
}
else if (rsp.retmsg == "para") {
layer.msg('参数错误,请稍后重试!');
}
else if (rsp.retmsg == "notauditcantcacel") {
layer.msg('未审核,不能够取消!');
}
else if (rsp.retcode == 220) {
layer.msg(rsp.retmsg);
}
else {
layer.msg('未知错误,请稍后重试!');
}
}
});
selectRow = {};
return false;
}, function (index) {
//按钮【取消】的回调
});
},
other4: function () {
console.log(selectRow);
if (selectRow.id === "undefined" || selectRow.id == null) {
//layer.alert("请先选中一条记录!", { title: '提示' });
layer.msg('请先选中一条记录!');
return;
}
layer.open({
type: 1,
content: $("#setUserNameDiv"),
area: ['30%', '40%']
});
$("#setUserNameDiv").show();
}
};
$("#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();
});
$("#payusername").val('');
selectRow = {};
$("#setUserNameDiv").hide();
});
$('.layui-btn-group .layui-btn').on('click', function () {
var othis = $(this), method = othis.data('method');
active[method] ? active[method].call(this, othis) : '';
});
});
</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 { }}
未确认
{{# } }}
</script>
<script type="text/html" id="isuseTpl">
{{# if(d.isuse == '1'){ }}
已使用
{{# } else if(d.isuse == '0'){ }}
未使用
{{# } else if(d.isuse == '-1'){ }}
已开通
{{# } else if(d.isuse == '2'){ }}
已退款
{{# } else { }}
未知
{{# } }}
</script>