95 lines
3.4 KiB
Plaintext
95 lines
3.4 KiB
Plaintext
@model CRM.Core.DTO.Ord.OrderPayDto
|
||
@using WX.CRM.Model.Entity;
|
||
@{
|
||
ViewBag.Title = "使用金额";
|
||
Layout = "~/Views/Shared/_content.cshtml";
|
||
|
||
}
|
||
|
||
<style>
|
||
.layui-table td, .layui-table th {
|
||
padding: 5px 15px;
|
||
}
|
||
</style>
|
||
|
||
<form class="layui-form" action="" style="width:100%; height:calc(100% - 50px);overflow-y:auto;">
|
||
<div class="layui-form-item" pane="">
|
||
<label class="layui-form-label">剩余金额</label>
|
||
<div class="layui-input-block">
|
||
@{
|
||
//var list = ViewBag.OrderDepositList as IEnumerable<WX_SZZYORDERDEPOSIT>;
|
||
CRM.Core.DTO.retMsg<CRM.Core.DTO.Ord.LastPriceRspDto> ret = ViewBag.CorePayInfo;
|
||
|
||
decimal? lastPrice = 0;
|
||
decimal OrderNedPay = ViewBag.OrderNedPay;
|
||
if (ret.result)
|
||
{
|
||
lastPrice = ret.retmsg.lastprice;
|
||
}
|
||
<span class="layui-form-mid">¥@lastPrice</span>
|
||
}
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item" pane="">
|
||
<div class="layui-inline">
|
||
<label class="layui-form-label">使用金额</label>
|
||
<div class="layui-input-inline">
|
||
<input type="text" id="usePrice" name="usePrice" style="border:0px 0px 1px 0px;" readonly="readonly" value="@(OrderNedPay>lastPrice?lastPrice:OrderNedPay)" required lay-verify="required|number" placeholder="请输入金额" autocomplete="off" class="layui-input">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<div class="layui-input-block">
|
||
<button class="layui-btn layui-btn-ok" id="btnUse" lay-submit lay-filter="use">使用</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
|
||
<script type="text/javascript">
|
||
layui.use(['form', 'layer'], function () {
|
||
var form = layui.form;
|
||
var layer = layui.layer;
|
||
|
||
form.on('submit(use)', function (data) {
|
||
var usePrice = data.field.usePrice;
|
||
if (usePrice == '' || usePrice=="0") {
|
||
layer.msg('金额不能空!', { icon: 2 });
|
||
return false;
|
||
}
|
||
//console.log(data.field);
|
||
var usePriceFloat = usePrice;
|
||
if (usePriceFloat <= 0) {
|
||
layer.msg('使用金额必须大于0!', { icon: 2 });
|
||
return false;
|
||
}
|
||
|
||
var lastPrice = parseFloat("@lastPrice");
|
||
if (usePrice > lastPrice) {
|
||
layer.msg('使用金额不能大于剩余金额!', { icon: 2 });
|
||
return false;
|
||
}
|
||
|
||
$('#btnUse').addClass("layui-btn-disabled").attr("disabled", true);
|
||
|
||
$.r_post('/WeiXin/OrderDeposit/Use2', { orderId: @Request["orderId"], usePrice }, function (result) {
|
||
if (result.result) {
|
||
//layer.close(index);
|
||
layer.msg('操作成功!', { icon: 1 }, function () { window.parent.location.reload(); });
|
||
} else {
|
||
layer.msg('操作失败!' + result.retmsg, { icon: 2 });
|
||
}
|
||
$('#btnUse').removeClass("layui-btn-disabled").attr("disabled", false);
|
||
});
|
||
|
||
return false;
|
||
});
|
||
|
||
$('.layui-btn-group .layui-btn').on('click', function () {
|
||
var othis = $(this), method = othis.data('method');
|
||
active[method] ? active[method].call(this, othis) : '';
|
||
});
|
||
|
||
});
|
||
|
||
</script>
|