420 lines
18 KiB
Plaintext
420 lines
18 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="audit">确认退款</button>
|
||
<span style="padding-right:20px"></span>
|
||
<button class="layui-btn layui-btn-danger" data-method="delete">删除</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","",true) ,
|
||
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other2, "查看退款协议", "layui-btn-danger","",true) ,
|
||
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other3, "导出", "layui-btn-normal","",true) ,
|
||
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other4, "上传非原路退款证明", "layui-btn-normal","",true) ,
|
||
}
|
||
}
|
||
)
|
||
</div>
|
||
<div id="mytoolbar">
|
||
客户ID:
|
||
<div class="layui-inline">
|
||
<input type="text" name="txt_UMID" placeholder="请输入" autocomplete="off" class="layui-input">
|
||
</div>
|
||
@*<div class="layui-inline">
|
||
<input type="text" name="txt_resId" placeholder="请输入" autocomplete="off" class="layui-input">
|
||
</div>*@
|
||
订单号:<div class="layui-inline">
|
||
<input type="text" name="txt_orderId" placeholder="请输入" autocomplete="off" class="layui-input">
|
||
</div>
|
||
类型:
|
||
<div class="layui-inline">
|
||
<select name="slt_isacturalrefund" style="height:35px;">
|
||
<option value="">全部</option>
|
||
<option value="1">需要实际退款</option>
|
||
<option value="0" title="不需要实际退款">退回可用余额</option>
|
||
</select>
|
||
</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">
|
||
<input type="text" name="txt_price" placeholder="请输入" autocomplete="off" class="layui-input">
|
||
</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="2">已作废</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="slt_innamelist" style="height:35px;">
|
||
<option value="">全部</option>
|
||
<option value="0">不在名单</option>
|
||
<option value="1">在拉回退款名单</option>
|
||
</select>
|
||
</div>
|
||
<button class="layui-btn" data-type="reload">搜索</button>
|
||
</div>
|
||
|
||
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
|
||
<div class="layui-form" id="retrace_refund_div" style="display:none">
|
||
<table class="layui-table">
|
||
<tr>
|
||
<td>
|
||
<div id="Retrace_refund_uploaddiv">
|
||
<input name="Retrace_refund" id="Retrace_refund" autocomplete="off" class="layui-hide" type="hidden">
|
||
<button type="button" class="layui-btn layui-btn-sm" id="Retrace_refundUpload">上传</button>
|
||
<a href="" id="Retrace_refund_file" style="display:none" target="_blank"> 附件</a>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
var selectRow = {};
|
||
var tableCols;
|
||
|
||
tableCols = [[
|
||
{
|
||
field: 'orderid', title: '订单号', width: 95,
|
||
templet: function (res) { return "<a href=\"javascript:void(0)\" style=\"color:blue\" onclick=\"parent.gotoOrderPay(" + res.orderid + ")\">" + res.orderid + "</a>"; }
|
||
}
|
||
, { field: 'UMID', title: '客户ID', width: 180 }
|
||
, { field: 'CompanyName', title: '事业部', width: 140 }
|
||
, {
|
||
field: 'applytype', title: '申请类型', width: 140, templet: function (d) {
|
||
if (d.applytype == "1") {
|
||
return "合规申请";
|
||
} else {
|
||
return "业务申请";
|
||
}
|
||
}
|
||
}
|
||
, { field: 'refundtypename', title: '支付类型', width: 95 }
|
||
, { field: 'account', title: '退款人账号', width: 120 }
|
||
, { field: 'username', title: '退款人姓名', width: 120 }
|
||
, { field: 'refundprice', title: '退款金额', width: 120 }
|
||
, { field: 'refunddate', title: '退款时间', width: 120 }
|
||
, { field: 'auditorname', title: '确认人', width: 120 }
|
||
, { field: 'auditstatus', title: '退款状态', templet: '#auditTpl', width: 95 }
|
||
, { field: 'audittime', title: '确认时间', width: 120 }
|
||
, { field: 'customer_cancel_time', title: '作废时间', width: 120 }
|
||
, {
|
||
field: 'retrace_refund_file', title: '非原路退款协议', templet: function (d) {
|
||
if (d.retrace_refund_file) {
|
||
return "<a href='http://qm.dn8188.com:8099/" + d.retrace_refund_file + "' target='_blank' style='color: blue'>下载</a>";
|
||
} else return "";
|
||
|
||
}, width: 120
|
||
}
|
||
, { field: 'att', title: '附件', templet: '#attTpl', width: 120 }
|
||
, { field: 'remark', title: '退款说明', width: 120 }
|
||
, { field: 'att2', title: '凭证', templet: '#att2Tpl', width: 120 }
|
||
, { field: 'isacturalrefund', title: '类型', templet: '#isacturalrefundTPL', width: 120 }
|
||
, {
|
||
field: 'innamelist', title: '拉回退款名单', templet: function (d) {
|
||
if (d.innamelist) {
|
||
return "在名单";
|
||
} else {
|
||
return "";
|
||
}
|
||
}, width: 120
|
||
}
|
||
, {
|
||
field: 'contracttime', title: '签约时间', width: 160, fixed: 'right', templet: function (d) {
|
||
if (d.contractKey != "pass") {
|
||
if (d.contracttime == null)
|
||
return "";
|
||
else
|
||
return d.contracttime;
|
||
} else {
|
||
return "";
|
||
}
|
||
}
|
||
}
|
||
, {
|
||
field: 'contractstatus', title: '协议状态', width: 100, fixed: 'right', templet: function (d) {
|
||
if (!d.contractstatus) {
|
||
return "";
|
||
} else if (d.contractstatus == 1) {
|
||
return '<font color="green">事业部通过 </font>';
|
||
} else if (d.contractstatus == 2) {
|
||
return '<font color="green">总部通过 </font>';
|
||
} else {
|
||
return '<font>未通过</font>';
|
||
}
|
||
}
|
||
}
|
||
//, { field: 'contract', title: '退款协议' }
|
||
//, { field: 'contractstatus', title: '退款协议状态', templet: function (res) { if (res.contractstatus == 2) { return "<span style='color:green;'>已审核</span>" } else { return "<span style='color:red;'>未审核</span>" } } }
|
||
]]
|
||
|
||
layui.use(['table', 'laydate'], function () {
|
||
var table = layui.table
|
||
, laydate = layui.laydate;
|
||
|
||
laydate.render({ elem: '#start' });
|
||
|
||
laydate.render({ elem: '#end' });
|
||
var param = GetParams("mytoolbar");
|
||
table.render({
|
||
id: 'tableRefund',//列表别名ID
|
||
elem: '#tabl1',//表ID
|
||
url: '/OrderRefund/Index',
|
||
method: 'POST',
|
||
totalRow: true,
|
||
cols: tableCols
|
||
, page: { //支持传入 laypage 组件的所有参数(某些参数除外,如:jump/elem) - 详见文档
|
||
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
|
||
//,curr: 5 //设定初始在第 5 页
|
||
, groups: 5 //只显示 1 个连续页码
|
||
|
||
}, where: param
|
||
});
|
||
|
||
$('#mytoolbar .layui-btn').on('click', function (data) {
|
||
var param = GetParams("mytoolbar");
|
||
table.reload('tableRefund', {
|
||
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;
|
||
});
|
||
|
||
});
|
||
|
||
layui.use(['layer', 'upload'], function () {
|
||
var layer = layui.layer,upload = layui.upload;
|
||
var token = $.cookie("AuthToken");
|
||
var active = {
|
||
other1: function () {
|
||
//if (selectRow.id === "undefined" || selectRow.id == null) {
|
||
// layer.alert("请先选中一条记录!", { title: '提示' });
|
||
// return;
|
||
//}
|
||
////var title = "退款";
|
||
////if (selectRow.isacturalrefund == 0) {
|
||
//// title = "<font color='#FFB800'>退回余额</font>";
|
||
////}
|
||
layer.open({
|
||
type: 2,
|
||
title: "退款申请",
|
||
content: '/OrderRefund/Add',
|
||
area: ['650px', '610px']
|
||
});
|
||
},
|
||
other2: function () {
|
||
if (selectRow.id === "undefined" || selectRow.id == null) {
|
||
layer.alert("请先选中一条记录!", { title: '提示' });
|
||
return;
|
||
}
|
||
if (selectRow.orderid.toString().indexOf("2") == 0) {
|
||
layer.alert("定金退款没有协议!", { title: '提示' });
|
||
return;
|
||
}
|
||
////var title = "退款";
|
||
////if (selectRow.isacturalrefund == 0) {
|
||
//// title = "<font color='#FFB800'>退回余额</font>";
|
||
////}
|
||
layer.open({
|
||
type: 2,
|
||
title: "查看退款协议",
|
||
content: '/OrderRefund/Contract?orderid=' + selectRow.orderid + "&id=" + selectRow.id,
|
||
area: ['650px', '610px']
|
||
});
|
||
},
|
||
other3: function () {
|
||
var param = GetParams("mytoolbar");
|
||
var hastime = $("#hastime").is(':checked');
|
||
console.log("hastime:" + hastime);
|
||
if (hastime) {
|
||
param["hastime"] = 1;
|
||
}
|
||
else {
|
||
param["hastime"] = 0;
|
||
}
|
||
if (param.UMID == "" && param.orderId == "" && param.isacturalrefund == "-3" && param.channel == "" && param.price == "" && param.stime == "" && param.etime == "" && param.innamelist == "" ) {
|
||
layer.msg("筛选条件不能全为空");
|
||
return;
|
||
}
|
||
layer.open({
|
||
title: '<i class="layui-icon layui-icon-export" style="font-size: 20px; color: #1E9FFF;"></i> 导出',
|
||
type: 2,
|
||
content: "/Control/ExcelExport_cookie?Query=" + encodeURIComponent("/OrderRefund/ExportData?param=" + JSON.stringify(param)),
|
||
area: ['850px', '400px']
|
||
});
|
||
//$("#BillOpen").attr("src", "/ComplianceOrder/ExportData?param=" + JSON.stringify(param));
|
||
}, other4: function () {
|
||
if (selectRow.id === "undefined" || selectRow.id == null) {
|
||
layer.alert("请先选中一条记录!", { title: '提示' });
|
||
return;
|
||
}
|
||
var title = "退款";
|
||
if (selectRow.isacturalrefund == 0) {
|
||
title = "<font color='#FFB800'>退回余额</font>";
|
||
}
|
||
layer.open({
|
||
type: 1,
|
||
title: title,
|
||
content: $('#retrace_refund_div'),
|
||
area: ['650px', '550px']
|
||
});
|
||
}
|
||
, delete: function () {
|
||
//$('#mytoolbar .layui-btn').click();
|
||
if (selectRow.id === "undefined" || selectRow.id == null) {
|
||
layer.alert("请先选中一条记录!", { title: '提示' });
|
||
return;
|
||
}
|
||
layer.confirm('确定删除?', { icon: 3, title: '提示' }, function (index) {
|
||
$.r_post('Delete', { id: selectRow.id }, function (res) {
|
||
if (res.result) {
|
||
layer.msg('操作成功!', { icon: 1 }, function () { $('#mytoolbar .layui-btn').click(); });
|
||
}
|
||
else {
|
||
if (res.retmsg == "audit") {
|
||
layer.msg('已审核退款记录,不能删除!', { icon: 2 });
|
||
}
|
||
else {
|
||
layer.msg('操作失败,请重试!', { icon: 2 });
|
||
}
|
||
}
|
||
});
|
||
|
||
layer.close(index);
|
||
});
|
||
}
|
||
};
|
||
|
||
|
||
upload.render({
|
||
elem: '#Retrace_refundUpload'
|
||
, url: '@ViewBag.ApiUrl/InvoiceHandler.ashx'
|
||
, data: { action: 'upload', FileName: 'Retrace_refund', SavePath: "contract/Refund" }
|
||
, headers: { auth: token }
|
||
, auto: true
|
||
, accept: 'file'
|
||
, exts:'doc|docx|xls|xlsx|pdf|zip|jpg|png|gif|bmp|jpeg|'
|
||
, before: function (obj) {
|
||
//预读本地文件示例,不支持ie8
|
||
obj.preview(function (index, file, result) {
|
||
console.log(result);
|
||
// $("#Retrace_refund_file").attr('href', +@ViewBag.ZxdCoreUrl+res.retmsg); //图片链接(base64)
|
||
});
|
||
}
|
||
, done: function (res) {
|
||
//如果上传失败
|
||
if (!res.result) {
|
||
return layer.msg('上传失败');
|
||
}
|
||
//上传成功的一些操作
|
||
console.log(res);
|
||
|
||
$("#Retrace_refund_file").attr('href', res.retmsg); //图片链接(base64)
|
||
$("#Retrace_refund").val(res.retmsg);
|
||
$("#Retrace_refund_file").show();
|
||
|
||
$.r_post('/OrderRefund/UploadRetraceRefundFile', { id: selectRow.id, retrace_refund_file: res.retmsg }, function (result) {
|
||
if (result.result) {
|
||
layer.msg("操作成功!");
|
||
} else {
|
||
layer.msg(result.retmsg);
|
||
}
|
||
});
|
||
}
|
||
, error: function () {
|
||
$("#Retrace_refund_file").removeAttr('src');
|
||
layer.msg('上传失败,请重试!');
|
||
|
||
}
|
||
|
||
});
|
||
|
||
|
||
$('.layui-btn-group .layui-btn').on('click', function () {
|
||
var othis = $(this), method = othis.data('method');
|
||
active[method] ? active[method].call(this, othis) : '';
|
||
}).after("<span style='padding-right:20px;'></span>");
|
||
|
||
});
|
||
//获取datagrid头部及字段
|
||
function getDataGridHeader() {
|
||
var newcolumns = [];
|
||
var columns = tableCols[0];
|
||
for (var i = 0; i < columns.length; i++) {
|
||
if (columns[i].field != "checkbox" && columns[i].type != "numbers" && columns[i].field != "call" && columns[i].field != "wx" && columns[i].field != "screenRecord") {
|
||
newcolumns.push(columns[i])
|
||
};
|
||
}
|
||
return newcolumns;
|
||
}
|
||
</script>
|
||
<script type="text/html" id="auditTpl">
|
||
{{# if(d.auditstatus == '1'){ }}
|
||
<font color="green">
|
||
已确认
|
||
</font>
|
||
{{# } else if(d.auditstatus == '2') { }}
|
||
<font color="orange">
|
||
已作废
|
||
</font>
|
||
{{# } else { }}
|
||
未确认
|
||
{{# } }}
|
||
</script>
|
||
<script type="text/html" id="isacturalrefundTPL">
|
||
{{# if(d.isacturalrefund == '0'){ }}
|
||
<font color="#FFB800">
|
||
退回余额
|
||
</font>
|
||
{{# } else { }}
|
||
需实际退款
|
||
{{# } }}
|
||
</script>
|
||
<script type="text/html" id="attTpl">
|
||
{{# if(d.att != null){ }}
|
||
<a href="{{d.att}}" target="_blank" style="color: blue">下载</a>
|
||
{{# } }}
|
||
</script>
|
||
<script type="text/html" id="att2Tpl">
|
||
{{# if(d.att2 != null && d.att2 != ''){ }}
|
||
<a href="{{d.att2}}" target="_blank" style="color: blue">下载</a>
|
||
{{# } }}
|
||
</script> |