You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dongfeng-pay/boss/views/self_plus_sub.html

194 lines
7.0 KiB
Go

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
<script src="../static/js/filter.js"></script>
<script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="../static/js/basic.js"></script>
<style>
.panel-body label {
font-weight: normal;
margin-right: 10px;
}
#select-self-name {
height: 30px;
line-height: 30px;
}
</style>
</head>
<body>
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title"></h3>
</div>
<div class="panel-body">
<label for="">
<span></span>
<select name="" id="select-self-name">
</select>
</label>
<label for="">
<span></span>
<select name="" id="select-self-type">
<option value=""></option>
<option value="plus_amount"></option>
<option value="sub_amount"></option>
<option value="freeze_amount"></option>
<option value="unfreeze_amount"></option>
</select>
</label>
<label for="">
<span></span>
<input type="text" id="select-self-amount" placeholder="单位:元">
</label>
<input type="button" class="btn btn-primary" value="执行" onclick="selfOperateAccount();">
</div>
</div>
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title"></h3>
</div>
<div class="panel-body">
<table class="table table-responsive table-bordered">
<thead>
<tr>
<td class="algin-right"></td><td><span id="operate-result">......</span></td>
</tr>
</thead>
<tbody>
<tr>
<td class="algin-right"></td><td><span id="balance"> </span></td>
</tr>
<tr>
<td class="algin-right"></td><td><span id="settle-amount"></span></td>
</tr>
<tr>
<td class="algin-right"></td><td><span id="wait-amount"></span></td>
</tr>
<tr>
<td class="algin-right"></td><td><span id="freeze-amount"></span></td>
</tr>
<tr>
<td class="algin-right"></td><td><span id="loan-amount"></span></td>
</tr>
<tr>
<td class="algin-right"></td><td><span id="payfor-amount"></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<script>
function getValues() {
let accountUid = $("#select-self-name").val();
let accountOperator = $("#select-self-type").val();
let amount = $("#select-self-amount").val();
return {
"accountUid":accountUid,
"accountOperator":accountOperator,
"amount":amount
};
}
function clearResult() {
$("#operate-result").html("待处理......");
$("#balance").html("");
$("#settle-amount").html("");
$("#wait-amount").html("");
$("#freeze-amount").html("");
$("#loan-amount").html("");
$("#payfor-amount").html("");
}
function randResult(res) {
let account = res.AccountList[0];
$("#operate-result").html(res.Msg);
$("#balance").html(account.Balance);
$("#settle-amount").html(account.SettleAmount);
$("#wait-amount").html(account.WaitAmount);
$("#freeze-amount").html(account.FreezeAmount);
$("#loan-amount").html(account.LoanAmount);
$("#payfor-amount").html(account.PayforAmount);
}
function selfOperateAccount() {
clearResult();
let dataJSON = getValues();
$.ajax({
url:"/account/operator",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
$("#operate-result").html(res.Msg);
} else {
randResult(res);
alert("当前用户的信息如下......");
}
},
error: function () {
alert("系统异常,请稍后再试")
}
});
}
function getAccount() {
let dataJSON = getValues();
$.ajax({
url:"/get/one/account",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
$("#operate-result").html(res.Msg);
} else {
randResult(res);
}
},
error: function () {
alert("系统异常,请稍后再试")
}
});
}
$("#select-self-name").change(function () {
clearResult();
let accountUid = $("#select-self-name").val();
if (accountUid === "" || accountUid.length <= 0) {
return false;
}
getAccount();
});
$("#select-self-type").click(function () {
// clearResult();
});
function setAccount() {
$.ajax({
url: "/get/all/account",
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
let str = '<option value="' + "" + '">' + "请选择" + '</option>';
for (let i = 0; i < res.AccountList.length; i ++) {
let account = res.AccountList[i];
str = str + '<option value="' + account.AccountUid + '">' + account.AccountName + '</option>';
}
$("#select-self-name").html(str);
}
}
});
}
$(function () {
setAccount();
});
</script>
</body>
</html>