TG.WXCRM.V4/WEB/Views/WeiXin/SzzyOrderRefund/ViewContract.cshtml

326 lines
14 KiB
Plaintext

@model CRM.Core.DTO.Ord.RefundContractInfoDto
@{
ViewBag.Title = "查看合同";
Layout = "~/Views/Shared/_content.cshtml";
}
<style>
.mnas li {
line-height: 25px;
}
a:link, a:visited {
color: white !important;
}
.idcardInfo {
display: none;
}
</style>
@if (Model == null)
{
<span>参数错误</span>
}
else
{
if (Model.htUrl == null)
{
<span>@Model.errInfo</span>
}
else
{
<div class="x-body" style="padding:10px;">
<div class="layui-form">
<table class="layui-table">
<colgroup>
<col width="120">
<col>
</colgroup>
<tbody>
<tr>
<td>订单号:</td>
<td>@Model.orderId</td>
</tr>
<tr>
<td>合同地址:</td>
<td>
@if (Model.showCancle == true)
{
<font color="#ffb800">此退款申请已经废弃</font>
}
else
{
<textarea rows="10" cols="50" class="layui-textarea" disabled>@Html.Raw(Model.htUrl)</textarea>
}
</td>
</tr>
@if (Model.showCancelUrl == 1)
{
<tr>
<td>作废协议:</td>
<td>
<textarea class="layui-textarea" disabled>@Html.Raw(Model.cancelHtUrl)</textarea>
</td>
</tr>
}
@if (!string.IsNullOrEmpty(Model.contract))
{
<tr>
<td>合同号:</td>
<td>@Html.Raw(Model.contract)</td>
</tr>
<tr>
<td>合同:</td>
<td>
<ul class="mnas">
<li><a href="@Model.tkpdf" target="_blank" class="layui-btn layui-btn-normal layui-btn-sm">退款协议.pdf</a></li>
@if (Model.showCancle == true)
{
<li><a href="@Model.untkpdf" target="_blank" class="layui-btn layui-btn-normal layui-btn-sm layui-bg-orange">关于退款协议的作废声明.pdf</a></li>
}
</ul>
</td>
</tr>
}
@if (!string.IsNullOrEmpty(Model.idCardName))
{
<tr class="idcardInfo">
<td>身份证姓名:</td>
<td class="userimg">@Model.idCardName</td>
</tr>
}
@if (!string.IsNullOrEmpty(Model.idCardTypeDescribe))
{
<tr class="idcardInfo">
<td>身份证类型:</td>
<td class="userimg">@Model.idCardTypeDescribe</td>
</tr>
}
@if (!string.IsNullOrEmpty(Model.idCardNo))
{
<tr class="idcardInfo">
<td>身份证号码:</td>
<td class="userimg">@Model.idCardNo</td>
</tr>
}
@if (!string.IsNullOrEmpty(Model.cardFrontFile))
{
<tr class="idcardInfo">
<td>身份证正面:</td>
<td class="userimg"><img src="@Model.cardFrontFile" class="showPicture" /></td>
</tr>
}
@if (!string.IsNullOrEmpty(Model.cardReverseSideFile))
{
<tr class="idcardInfo">
<td>身份证反面:</td>
<td class="userimg"><img src="@Model.cardReverseSideFile" class="showPicture" /></td>
</tr>
}
@if (((!string.IsNullOrEmpty(Model.cardFrontFile) || !string.IsNullOrEmpty(Model.cardReverseSideFile)) && (Model.IdCardStatus == 0 || Model.IdCardStatus == null || (Model.IdCardStatus == -1 && Model.status == "1"))))
{
<tr>
<td>身份证信息审核:</td>
<td>
<button class="layui-btn layui-btn-xs" id="idcard-pass">确定</button>
<button class="layui-btn layui-btn-xs layui-bg-orange" id="idcard-reject">驳回</button>
</td>
</tr>
}
<tr>
<td>身份证状态:</td>
<td>
<div class="contract">
@if (Model.IdCardStatus == null || Model.IdCardStatus == 0 || (Model.IdCardStatus == -1 && Model.status == "1"))
{
<p class="red">未审核</p>
}
else if (Model.IdCardStatus == 1)
{
<p class="green">已通过</p>
}
else
{
<p class="red">已驳回 <button class="layui-btn layui-btn-xs" style="margin-left:20px;" id="idcard-more">更多</button></p>
}
</div>
</td>
</tr>
<tr>
<td>身份证驳回备注:</td>
<td>
@if (Model.IdCardStatus == -1)
{
@Html.Raw(Model.IdCardRemark)
}
</td>
</tr>
<tr>
<td>合规状态:</td>
<td>
@if (Model.contractstatus == -1)
{
<span style="color:orange; font-weight:bold;padding-right:20px;">未通过</span>
}
else if (Model.contractstatus == 0)
{
<span style="font-weight:bold;">待审核</span>
}
else if (Model.contractstatus == 1)
{
<span style="font-weight:bold;">分部审核,总部待审核</span>
}
else if (Model.contractstatus == 2)
{
<span style="color: green; font-weight:bold;">已通过</span>
}
else
{
<span>未知</span>
}
@if (ViewBag.Show)
{
<input type="button" class="layui-btn" style="margin-left:250px" value="二次退款合同解锁" id="ResetRefund" />
}
</td>
</tr>
</tbody>
</table>
<div id="rejectContract" class="layui-form" style="display:none;">
<div class="">
<textarea placeholder="请输入身份证审核备注" class="layui-textarea" id="rejectContractRemark" lay-filter="rejectContractRemark"></textarea>
</div>
</div>
<button class="layui-btn" id="save">确定</button>
</div>
</div>
<script>
$(function () {
var staus = '@Model.IdCardStatus';
var idstatus = '@Model.status';
if (staus == -1 && idstatus==0) {
$(".idcardInfo").hide();
} else {
$(".idcardInfo").show();
}
layui.use('layer', function () {
var orderId = @Model.orderId;
var layer = layui.layer;
$("#save").click(function () {
$.r_ajax({
url: "/WeiXin/SzzyOrderRefund/AuditRefundContract",
type: "Post",
data: { orderId: @Model.orderId },
dataType: "json",
loading: true,
success: function (data) {
debugger
if (data.type == 1) {
window.parent.frameReturnByReload();
}
else {
layer.alert(data.message);
}
}
});
});
$("#ResetRefund").click(function () {
$.r_ajax({
url: "/WeiXin/SzzyOrderRefund/ResetRefundInfo",
type: "Post",
data: { orderId: @Model.orderId },
dataType: "json",
loading: true,
success: function (data) {
if (data.type == 1) {
window.parent.frameReturnByMes('提交成功');
window.parent.frameReturnByReload(true);
window.parent.frameReturnByClose();
}
else {
$.messager.alert("警告", data.message, "error");
}
}
});
});
$("#btnpass").click(function () {
$.r_post('/SzzyOrderRefund/ContractPass', { orderId: orderId, status: 2 }, function (result) {
if (result.result) {
layer.msg('操作成功!', { icon: 1 }, function () { window.location.reload() });
} else {
layer.msg('操作失败!' + result.retmsg, { icon: 2 });
}
});
});
$("#idcard-reject").on('click', function () {
layer.open({
type: 1
, content: $('#rejectContract')
, area: ['400px', '220px']
, btn: ['确定', '取消']
, yes: function (index, layer0) {
if ($("#rejectContractRemark").val() == "") {
layer.msg('身份证驳回备注不能为空!', { icon: 2 });
return;
}
idCardAudit(-1, index, true);
}
})
})
$('#idcard-more').on('click', function () {
$(".idcardInfo").show();
$("#idcard-more").hide();
});
$('#idcard-pass').on('click', function () {
layer.confirm('确定审核通过吗?', { icon: 3, title: '提示' }, function (index) {
idCardAudit(1, index);
})
});
$(".showPicture").click(function () {
winindex = layer.open({
type: 1,
content: '<img src=' + this.src + ' style="width:100%" ></img>',
area: ['500px', '500px']
});
});
function idCardAudit(status, index, updateOrder) {
var remark = $("#rejectContractRemark").val();
var data = {
orderId: orderId,
status: status,
remark: remark
}
var loadingindex = layer.load(3, { shade: true });
$.ajax({
type: "POST",
url: '/SzzyOrderRefund/IdCardAudit',
data: JSON.stringify(data),
dataType: "json",
contentType: "application/json",
success: function (da) {
layer.close(loadingindex);
if (da.data) {
if (index) {
layer.close(index);
}
layer.msg('操作成功!', { icon: 1 }, function () {
parent.layer.closeAll();
});
parent.TableReload();
} else {
layer.msg(da.message, { icon: 2 });
}
},
error: function () {
layer.close(loadingindex);
layer.msg('操作失败!', { icon: 2 });
}
});
}
});
});
</script>
}
}