TG.WXCRM.V4/WEB/Views/WeiXin/OrderDeposit/Refund.cshtml

164 lines
6.2 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.

@model CRM.Core.DTO.Ord.OrderRefundDto
@using WX.CRM.WebHelper;
@{
ViewBag.Title = "退款申请";
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}
<div class="mvctool bgb">
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
</div>
@using (Html.BeginForm("Refund", "OrderDeposit", 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 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"}
})
</td>
<td width="120px"></td>
</tr>
<tr>
<td style="width:120px;">退款人账号:</td>
<td style="width:310px">
<input type="text" id="account" name="account">
</td>
<td width="120px"></td>
</tr>
<tr>
<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">
var dprice = "@Model.refundprice";//退款的最大金额
$(function () {
$("#btnSave").click(function () {
if ($("#CreateForm").valid()) {
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;
}
var noprice = parseFloat(refundprice);
if (noprice > dprice) {
$.messager.alert("错误", "退款金额不能大于剩余金额!", "error");
return;
}
if (refunddate == "") {
$.messager.alert("错误", "退款日期不能为空!", "error");
return;
}
if (remark == "") {
$.messager.alert("错误", "退款说明不能为空!", "error");
return;
}
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);
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/OrderDeposit/Refund",
type: "Post",
cache: false,
//data: $("#CreateForm").serialize(),
data: para,
dataType: "json",
contentType: false,
loading: true,
processData: false,
success: function (data) {
if (data.type == 1) {
$.messager.alert("提示", '提交成功!', "info", function () { window.parent.location.reload(); });
}
else {
$.messager.alert("警告", data.message, "error");
}
}
});
}
return false;
});
});
</script>