ComplianceServer/oldcode/WEB/Views/WeiXin/JZOrder/ApplyOrderRefund.cshtml

221 lines
8.6 KiB
Plaintext
Raw Permalink 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.

@model CRM.Core.DTO.Ord.OrderRefundDto
@using WX.CRM.WebHelper;
@{
ViewBag.Title = "退款申请";
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}
<style>
.layui-table td, .layui-table th {
padding: 5px 15px;
}
</style>
<div class="mvctool bgb">
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
</div>
@using (Html.BeginForm("AddOrderPay", "JZOrder", null, FormMethod.Post, new { Id = "CreateForm" }))
{
@Html.ValidationSummary(true)
<table class="fromEditTable ">
<tr>
<td style="width:120px;">订单号:</td>
<td style="width:310px">
<input type="text" value="@Html.DisplayFor(m => m.orderid)" disabled readonly>
<input type="hidden" id="orderid" name="orderid" value="@Html.DisplayFor(m => m.orderid)" />
</td>
<td width="120px"></td>
</tr>
<tr>
<td>类型:</td>
<td>
<input type="radio" value="1" name="isacturalrefund" id="isacturalrefund1" checked onchange="ShowAllHidden()" /> <label for="isacturalrefund1">需实际退款</label>
<input type="radio" value="0" name="isacturalrefund" id="isacturalrefund0" onchange="ShowAllHidden()" /> <label for="isacturalrefund0">退回可用余额</label>
</td>
<td></td>
</tr>
<tr id="tr_paytype">
<td style="width:120px;">支付类型:</td>
<td style="width:310px">
@Html.DropDownListFor(m => m.refundtype, new List<SelectListItem>() {
new SelectListItem(){Text="支付宝",Value="1",Selected=true},
new SelectListItem(){Text="银行转账",Value="3"},
new SelectListItem(){Text="财富通",Value="2"},
new SelectListItem(){Text="微信支付",Value="5"},
new SelectListItem(){Text="网银支付",Value="4"},
new SelectListItem(){Text="支付宝银联",Value="6"},
new SelectListItem(){Text="苹果支付",Value="11"},
new SelectListItem(){Text="华为支付",Value="12"},
new SelectListItem(){Text="魅族支付",Value="13"}
})
</td>
<td width="120px"></td>
</tr>
<tr id="tr_account">
<td style="width:120px;">退款人账号:</td>
<td style="width:310px">
<input type="text" id="account" name="account">
</td>
<td width="120px"></td>
</tr>
<tr id="tr_name">
<td style="width:120px;">退款人姓名:</td>
<td style="width:310px">
<input type="text" id="username" name="username">
</td>
<td width="120px"></td>
</tr>
<tr>
<td>退款金额:</td>
<td>
<input type="text" id="refundprice" name="refundprice" placeholder="¥" value='@Model.refundprice'>
</td>
<td></td>
</tr>
<tr>
<td style="width:120px;">退款日期:</td>
<td style="width:310px">
<input id="refunddate" name='refunddate' class='Wdate' type='text' value='@DateTime.Now.ToString("yyy-MM-dd")' onclick='javascript: WdatePicker();' />
</td>
<td width="120px"></td>
</tr>
<tr style="display:none;">
<td>附件:</td>
<td><input type="file" id="att" name="att" /></td>
<td></td>
</tr>
<tr>
<td style="width:120px;">退款说明:</td>
<td style="width:310px">
<textarea placeholder="请输入内容" id="remark" name="remark" class="layui-textarea" rows="5" style=" width: 250px;"></textarea>
</td>
<td width="120px"></td>
</tr>
</table>
<div id="modalwindow" class="easyui-window" data-options="modal:true,closed:true,minimizable:false,shadow:false"></div>
}
<script type="text/javascript">
$(function () {
$("#btnSave").click(function () {
if ($("#CreateForm").valid()) {
var orderarrypay="@ViewBag.OrderArryPay";
var orderid = $("#orderid").val();
var refundtype = $("#refundtype").val();
var account = $("#account").val();
var username = $("#username").val();
var refundprice = $("#refundprice").val();
var refunddate = $("#refunddate").val();
var remark = $("#remark").val();
if (orderid == "") {
$.messager.alert("错误", "订单ID不能为空", "error");
return;
}
if (refundprice == "") {
$.messager.alert("错误", "退款金额不能为空!", "error");
return;
}
else {
if (!validate(refundprice)) {
$.messager.alert("错误", "请输入数字!", "error");
return;
}
else {
if (refundprice > 1000000) {
$.messager.alert("错误", "金额太大了!", "error");
return;
}
}
}
if (orderarrypay && parseFloat(orderarrypay) < parseFloat(refundprice)) {
$.messager.alert("错误", "退款金额不能超过到账金额!", "error");
return;
}
if (refunddate == "") {
$.messager.alert("错误", "退款日期不能为空!", "error");
return;
}
if (remark == "") {
$.messager.alert("错误", "退款说明不能为空!", "error");
return;
}
var isacturalrefund= $('input[name="isacturalrefund"]:checked').val();
var para = new FormData();
para.append("orderId", orderid);
para.append("refundtype", refundtype);
if (account != "") {
para.append("account", account);
}
if (username != "") {
para.append("username", username);
}
para.append("refundprice", refundprice);
para.append("refunddate", refunddate);
para.append("isacturalrefund", isacturalrefund);//退款类型
var file = $("#att")[0].files[0];
//console.log(file);
if (file != undefined) {
para.append("att", $("#att")[0].files[0]);
}
para.append("remark", remark);
$.r_ajax({
url: "/WeiXin/JZOrder/ApplyOrderRefund",
type: "Post",
cache: false,
//data: $("#CreateForm").serialize(),
data: para,
dataType: "json",
contentType: false,
loading: true,
processData: false,
success: function (data) {
if (data.type == 1) {
//window.parent.frameReturnByMes(data.message);
window.parent.frameReturnByMes('提交成功');
window.parent.frameReturnByReload(true);
window.parent.frameReturnByClose();
}
else {
$.messager.alert("警告", data.message, "error");
}
}
});
}
return false;
});
});
function ShowAllHidden() {
var isacturalrefund = $('input[name="isacturalrefund"]:checked').val();
if (isacturalrefund == "0") {
$("#tr_account").hide();
$("#tr_name").hide();
//$("#tr_paytype").hide();
} else {
$("#tr_account").show();
$("#tr_name").show();
//$("#tr_paytype").show();
}
}
function validate(num) {
var reg = /^\d+(?=\.{0,1}\d+$|$)/
if (reg.test(num)) return true;
return false;
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
}
function frameReturnByClose() {
$("#modalwindow").window('close');
}
</script>