342 lines
14 KiB
Plaintext
342 lines
14 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@{
|
||
ViewBag.Title = "Index";
|
||
Layout = "~/Views/Shared/_content.cshtml";
|
||
}
|
||
<script src="/Scripts/jquery.easyui.min.js" type="text/javascript"></script>
|
||
<link href="/Content/themes/blue/easyui.css" rel="stylesheet" />
|
||
<link href="/Content/Site.css" rel="stylesheet" />
|
||
<script src="/Scripts/common.js"></script>
|
||
<link href="/Content/data_grid_list.css" rel="stylesheet" />
|
||
<script src="/Scripts/op/jquery.rewrite.js"></script>
|
||
<div class="x-body">
|
||
<div class="layui-btn-group" style="padding-bottom:10px;">
|
||
</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">
|
||
<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>
|
||
<div class="layui-btn" data-type="reload">搜索</div>
|
||
</div>
|
||
|
||
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
|
||
</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: 'tableRefund',//列表别名ID
|
||
elem: '#tabl1',//表ID
|
||
url: '/WeiXin/SzzyOrderRefund/RefundApplyList2',
|
||
method: 'POST',
|
||
totalRow: true,
|
||
cols: [[
|
||
{
|
||
field: 'orderid', title: '订单号', width: 100
|
||
}
|
||
, { field: 'UMID', title: '客户ID', width: 190 }
|
||
//, { 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: '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: '操作', fixed: 'right', width: 100, templet: function (e) {
|
||
if (e.orderid > 80000000)
|
||
return '<button class="layui-btn layui-bg-blue layui-btn-sm " onclick="ViewContract(' + e.orderid + ',' + e.id + ')">查看合同</button>';
|
||
else
|
||
return "";
|
||
}
|
||
}
|
||
//, { field: 'contractstatus', title: '退款协议状态', templet: function (res) { if (res.contractstatus == 2) { return "<span style='color:green;'>已审核</span>" } else { return "<span style='color:red;'>未审核</span>" } } }
|
||
]]
|
||
, page: { //支持传入 laypage 组件的所有参数(某些参数除外,如:jump/elem) - 详见文档
|
||
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
|
||
//,curr: 5 //设定初始在第 5 页
|
||
, groups: 5 //只显示 1 个连续页码
|
||
|
||
}, where: GetParams("mytoolbar")
|
||
});
|
||
|
||
$('#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;
|
||
});
|
||
|
||
});
|
||
|
||
var layer;
|
||
layui.use('layer', function () {
|
||
layer = layui.layer;
|
||
|
||
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']
|
||
});
|
||
}
|
||
, 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);
|
||
});
|
||
}
|
||
};
|
||
|
||
$('.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>");
|
||
|
||
});
|
||
function frameReturnByReload() {
|
||
$(".layui-icon-refresh").click();
|
||
}
|
||
function ViewContract(orderId, id) {
|
||
if (!orderId) {
|
||
alert("参数错误!");
|
||
return;
|
||
}
|
||
layer.open({
|
||
type: 2,
|
||
title: "查看退款协议",
|
||
content: "/WeiXin/SzzyOrderRefund/ViewContract?orderId=" + orderId + "&id=" + id + "&Ieguid=" + GetGuid(),
|
||
area: ['650px', '610px']
|
||
});
|
||
}
|
||
</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>
|
||
<script>
|
||
//获取数据返回 params对象
|
||
function GetParams(toobarid) {
|
||
var params = {};
|
||
//自动遍历读取 搜索栏目的text文本框
|
||
$("#" + toobarid + " [name^='txt_']").each(function () {
|
||
//if ($(this).val() != "") {
|
||
params[$(this).attr("Name").replace("txt_", "")] = $.trim($(this).val());
|
||
//}
|
||
});
|
||
//下拉框
|
||
$("#" + toobarid + " [name^='slt_']").each(function () {
|
||
params[$(this).attr("Name").replace("slt_", "")] = $(this).val();
|
||
});
|
||
//单选框
|
||
$("#" + toobarid + " [name^='rdo_']:checked").each(function () {
|
||
params[$(this).attr("Name").replace("rdo_", "")] = $(this).val();
|
||
});
|
||
//原始输出
|
||
$("#" + toobarid + " [name^='org_']").each(function () {
|
||
params[$(this).attr("Name")] = $(this).val();
|
||
});
|
||
//复选框
|
||
var nname = "";
|
||
var nvalue = "";
|
||
$("#" + toobarid + " [name^='ckb_']:checked").each(function () {
|
||
if (nname != "" && nname !== $(this).attr("Name").replace("ckb_", "")) {
|
||
var options = { nname: nvalue };
|
||
params[nname] = nvalue;
|
||
nvalue = $(this).val();
|
||
}
|
||
else
|
||
nvalue += ("," + $(this).val());//多选 用逗号隔开
|
||
nname = $(this).attr("Name").replace("ckb_", "");
|
||
});
|
||
if (nname != "") {
|
||
params[nname] = nvalue;
|
||
}
|
||
|
||
return params;
|
||
}
|
||
</script> |