给收入、支出单增加账户默认功能

This commit is contained in:
季圣华
2020-08-09 23:46:56 +08:00
parent 2fe61482d3
commit 5da91bd05b

View File

@@ -1,4 +1,5 @@
//初始化界面 //初始化界面
var defaultAccountId = 0; //默认账户id
$(function(){ $(function(){
var accountList = null; var accountList = null;
var accountID = null; var accountID = null;
@@ -25,7 +26,6 @@
initSystemData_person(); //经手人数据 initSystemData_person(); //经手人数据
initSelectInfo_person(); //经手人信息 initSelectInfo_person(); //经手人信息
initSystemData_account(); //账户数据 initSystemData_account(); //账户数据
initSelectInfo_account(); //账户信息
initSupplier(); //供应商 initSupplier(); //供应商
initTableData(); initTableData();
ininPager(); ininPager();
@@ -106,25 +106,22 @@
if(res && res.code === 200) { if(res && res.code === 200) {
if(res.data) { if(res.data) {
accountList = res.data.accountList; accountList = res.data.accountList;
var options = "";
if(accountList !=null) {
for(var i = 0 ;i < accountList.length; i++) {
var account = accountList[i];
options += '<option value="' + account.id + '" data-currentAmount="' + account.currentAmount + '">' + account.name + '</option>';
if(account.isDefault) {
defaultAccountId = account.id; //给账户赋值默认id
}
}
$("#AccountId").empty().append(options);
}
} }
} }
} }
}); });
} }
//获取账户信息
function initSelectInfo_account(){
var options = "";
if(accountList !=null)
{
options = "";
for(var i = 0 ;i < accountList.length; i++)
{
var account = accountList[i];
options += '<option value="' + account.id + '">' + account.name + '</option>';
}
$("#AccountId").empty().append(options);
}
}
//初始化单位信息 //初始化单位信息
function initSupplier(){ function initSupplier(){
@@ -673,6 +670,7 @@
$("#BillTime").val(thisDateTime); $("#BillTime").val(thisDateTime);
var thisNumber = getNowFormatDateNum(); //根据时间生成编号 var thisNumber = getNowFormatDateNum(); //根据时间生成编号
$("#BillNo").val(amountNum + thisNumber).focus(); $("#BillNo").val(amountNum + thisNumber).focus();
$("#AccountId").val(defaultAccountId); //初始化默认的账户Id
var addTitle = listTitle.replace("列表","信息"); var addTitle = listTitle.replace("列表","信息");
$('#accountHeadDlg').dialog('open').dialog('setTitle','<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;增加' + addTitle); $('#accountHeadDlg').dialog('open').dialog('setTitle','<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;增加' + addTitle);
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({ width: webW ,height: webH});
@@ -706,6 +704,7 @@
$('#OrganId').combobox('setValue', res.organId); $('#OrganId').combobox('setValue', res.organId);
$("#HandsPersonId").val(res.handsPersonId); $("#HandsPersonId").val(res.handsPersonId);
$("#ChangeAmount").val(res.changeAmount); $("#ChangeAmount").val(res.changeAmount);
$("#AccountId").val(defaultAccountId); //初始化默认的账户Id
var TotalPrice = res.totalPrice; var TotalPrice = res.totalPrice;
preTotalPrice = res.totalPrice; //记录前一次合计金额,用于收预付款 preTotalPrice = res.totalPrice; //记录前一次合计金额,用于收预付款
var editTitle = listTitle.replace("列表","信息"); var editTitle = listTitle.replace("列表","信息");