Merge branch 'feature/zs_v1.3_cash' into feature/zs_v1.3_0822
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
const cardInputMgr = (new function () {
|
||||
var winloss = 0; // 已实现盈亏
|
||||
var netFund = 0; // 初保账户
|
||||
var vmFund = 0; // 追保账户
|
||||
var transferOutMoney = 0; // 转出金额
|
||||
const cardInputMgr = (new function () {
|
||||
|
||||
var _inited = 0, _inputFlag = 0;
|
||||
|
||||
@@ -180,7 +184,18 @@ function checkSubmitData() {
|
||||
else {
|
||||
$("#Money").val($("#Money").val().replace(',', ''));
|
||||
}
|
||||
|
||||
let direction = $("#Direction").val();
|
||||
if (direction==="划转") {
|
||||
var transfer_out_account = $("#TransferOutAccount").val();
|
||||
var transfer_in_account = $("#TransferInAccount").val();
|
||||
if (transfer_out_account === transfer_in_account) {
|
||||
return main.message("转出科目与转入科目不能相同!");
|
||||
}
|
||||
var money = parseFloat($("#Money").val());
|
||||
if (money <=0) {
|
||||
return main.message("转出金额必须大于0!");
|
||||
}
|
||||
}
|
||||
return cardInputMgr.checkSubmit();
|
||||
}
|
||||
|
||||
@@ -205,16 +220,30 @@ function setDirection(isInit) {
|
||||
!isInit && cardInputMgr.changeInputType(true);
|
||||
let direction = $("#Direction").val();
|
||||
$(".changeInputBtn").toggleClass("hide", ["出金", "应付"].includes(direction));
|
||||
if (direction === "出金") {
|
||||
$("#cash_type_container").hide(); // 隐藏资金类型
|
||||
} else {
|
||||
if (direction === "入金") {
|
||||
$("#cash_type_container").show(); // 显示资金类型
|
||||
} else {
|
||||
$("#cash_type_container").hide(); // 隐藏资金类型
|
||||
}
|
||||
if (direction === "划转") {
|
||||
$("#transfer_out_container").show();
|
||||
$("#transfer_in_container").show();
|
||||
$("#transferAll").show();
|
||||
} else {
|
||||
$("#transfer_out_container").hide();
|
||||
$("#transfer_in_container").hide();
|
||||
$("#transferAll").hide();
|
||||
}
|
||||
cardInputMgr.toggle(["入金", "出金"].includes(direction));
|
||||
|
||||
cardInputMgr.updateOptions();
|
||||
}
|
||||
|
||||
// 全部转出
|
||||
function transferAll() {
|
||||
$("#MoneyStr").val(transferOutMoney);
|
||||
moneyInputMgr.onInput();
|
||||
}
|
||||
function setClientCash() {
|
||||
var clientId = $("#ClientId").val();
|
||||
if (!clientId) {
|
||||
@@ -225,9 +254,41 @@ function setClientCash() {
|
||||
$("#ClientCashCNY").val(res.CNY);
|
||||
$("#ClientCashUSD").val(res.USD);
|
||||
}
|
||||
})
|
||||
});
|
||||
main.post("/trade_span/GetClientLatestBalance", { clientId: clientId }).done(function (data) {
|
||||
winloss = data.WinLoss;
|
||||
netFund = data.NetFund;
|
||||
vmFund = data.VmFundSum;
|
||||
setTransferMoney();
|
||||
});
|
||||
}
|
||||
function setTransferMoney() {
|
||||
var clientId = $("#ClientId").val();
|
||||
if (!clientId) {
|
||||
return;
|
||||
}
|
||||
var transfer_out_account = $("#TransferOutAccount").val();
|
||||
var transfer_in_account = $("#TransferInAccount").val();
|
||||
if (transfer_out_account === "初保账户") {
|
||||
transferOutMoney = netFund;
|
||||
$("#transfer_out_account_money").text("余额:" + netFund);
|
||||
}
|
||||
else if (transfer_out_account === "追保账户") {
|
||||
transferOutMoney = vmFund;
|
||||
$("#transfer_out_account_money").text("余额:" + vmFund);
|
||||
} else {
|
||||
transferOutMoney = winloss;
|
||||
$("#transfer_out_account_money").text("余额:" + winloss);
|
||||
}
|
||||
if (transfer_in_account === "初保账户") {
|
||||
$("#transfer_in_account_money").text("余额:" + netFund);
|
||||
}
|
||||
else if (transfer_in_account === "追保账户") {
|
||||
$("#transfer_in_account_money").text("余额:" + vmFund);
|
||||
} else {
|
||||
$("#transfer_in_account_money").text("余额:" + winloss);
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
|
||||
cardInputMgr.init();
|
||||
|
||||
Reference in New Issue
Block a user