Last active
July 27, 2020 13:52
-
-
Save GithubMrxia/ab3b82281986aee943a14eae070bdbd5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button class="btn-primary btn" data-toggle="modal" data-contract_no="{{ $contract->contract_no }}" type="button" data-target="#refund"><i class="fa"></i> 退款处理</button> | |
<div class="modal fade" id="refund" tabindex="-1" role="dialog"> | |
<div class="modal-dialog" role="document"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span | |
aria-hidden="true">×</span></button> | |
<h4 class="modal-title">退款处理</h4> | |
</div> | |
<div class="modal-body"> | |
<form id="ccc"> | |
<input type="hidden" name="contract_no" class="contract_no" value=""> | |
<div class="form-group"> | |
<label for="contract_no">合同号</label> | |
<input type="text" class="form-control contract_no" disabled value=""> | |
</div> | |
</form> | |
</div> | |
<div class="modal-footer"> | |
<button type="button" class="btn btn-default cancel">取消</button> | |
<button type="button" class="btn btn-primary submit">保存</button> | |
</div> | |
</div><!-- /.modal-content --> | |
</div><!-- /.modal-dialog --> | |
</div> | |
<script> | |
<script> | |
$(function(){ | |
$('#refund').on('show.bs.modal', function (e) { | |
var contract_no = $(e.relatedTarget).data('contract_no'); | |
$(".contract_no").val(contract_no); | |
}) | |
$('#refund .cancel').on('click', function (e) { | |
$(e.target).parents('.modal').modal('hide'); | |
}); | |
$('#refund .submit').on('click', function (e) { | |
var params = $(e.target).parents('.modal').find('form').serialize(); | |
$.ajax({ | |
type: 'post', | |
url: '{{route('contract.refund', $contract->contract_no)}}', | |
data: params, | |
dataType: 'json', | |
success: function (data) { | |
if (data['code'] != 'RC00000') { | |
layer.msg(data['msg']); | |
return false; | |
} | |
history.go(0); | |
$(e.target).parents('.modal').modal('hide'); | |
} | |
}); | |
}) | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment