Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
bfb1fe53
Commit
bfb1fe53
authored
Jul 05, 2017
by
季圣华
Browse files
优化账户余额的计算方法,将财务单据统计进去
parent
12ab93ae
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/action/basic/AccountAction.java
View file @
bfb1fe53
...
@@ -5,6 +5,10 @@ import java.sql.Timestamp;
...
@@ -5,6 +5,10 @@ import java.sql.Timestamp;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.text.*
;
import
com.jsh.model.po.AccountHead
;
import
com.jsh.model.po.AccountItem
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
org.springframework.dao.DataAccessException
;
import
org.springframework.dao.DataAccessException
;
...
@@ -16,6 +20,8 @@ import com.jsh.model.po.Account;
...
@@ -16,6 +20,8 @@ import com.jsh.model.po.Account;
import
com.jsh.model.vo.basic.AccountModel
;
import
com.jsh.model.vo.basic.AccountModel
;
import
com.jsh.service.basic.AccountIService
;
import
com.jsh.service.basic.AccountIService
;
import
com.jsh.service.materials.DepotHeadIService
;
import
com.jsh.service.materials.DepotHeadIService
;
import
com.jsh.service.materials.AccountHeadIService
;
import
com.jsh.service.materials.AccountItemIService
;
import
com.jsh.util.PageUtil
;
import
com.jsh.util.PageUtil
;
import
com.jsh.util.Tools
;
import
com.jsh.util.Tools
;
/**
/**
...
@@ -27,6 +33,8 @@ public class AccountAction extends BaseAction<AccountModel>
...
@@ -27,6 +33,8 @@ public class AccountAction extends BaseAction<AccountModel>
{
{
private
AccountIService
accountService
;
private
AccountIService
accountService
;
private
DepotHeadIService
depotHeadService
;
private
DepotHeadIService
depotHeadService
;
private
AccountHeadIService
accountHeadService
;
private
AccountItemIService
accountItemService
;
private
AccountModel
model
=
new
AccountModel
();
private
AccountModel
model
=
new
AccountModel
();
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
...
@@ -288,6 +296,7 @@ public class AccountAction extends BaseAction<AccountModel>
...
@@ -288,6 +296,7 @@ public class AccountAction extends BaseAction<AccountModel>
{
{
for
(
Account
account:
dataList
)
for
(
Account
account:
dataList
)
{
{
DecimalFormat
df
=
new
DecimalFormat
(
".##"
);
JSONObject
item
=
new
JSONObject
();
JSONObject
item
=
new
JSONObject
();
item
.
put
(
"id"
,
account
.
getId
());
item
.
put
(
"id"
,
account
.
getId
());
//结算账户名称
//结算账户名称
...
@@ -295,8 +304,12 @@ public class AccountAction extends BaseAction<AccountModel>
...
@@ -295,8 +304,12 @@ public class AccountAction extends BaseAction<AccountModel>
item
.
put
(
"serialNo"
,
account
.
getSerialNo
());
item
.
put
(
"serialNo"
,
account
.
getSerialNo
());
item
.
put
(
"initialAmount"
,
account
.
getInitialAmount
());
item
.
put
(
"initialAmount"
,
account
.
getInitialAmount
());
String
monthTime
=
Tools
.
getCurrentMonth
();
String
monthTime
=
Tools
.
getCurrentMonth
();
item
.
put
(
"thisMonthAmount"
,
getAccountSum
(
account
.
getId
(),
monthTime
));
//本月发生额
Double
thisMonthAmount
=
getAccountSum
(
account
.
getId
(),
monthTime
)
+
getAccountSumByHead
(
account
.
getId
(),
monthTime
)
+
getAccountSumByDetail
(
account
.
getId
(),
monthTime
);
item
.
put
(
"currentAmount"
,
getAccountSum
(
account
.
getId
(),
""
)
+
account
.
getInitialAmount
());
//当前余额
String
thisMonthAmountFmt
=
df
.
format
(
thisMonthAmount
);
item
.
put
(
"thisMonthAmount"
,
thisMonthAmountFmt
);
//本月发生额
Double
currentAmount
=
getAccountSum
(
account
.
getId
(),
""
)
+
getAccountSumByHead
(
account
.
getId
(),
""
)
+
getAccountSumByDetail
(
account
.
getId
(),
""
)
+
account
.
getInitialAmount
();
String
currentAmountFmt
=
df
.
format
(
currentAmount
);
item
.
put
(
"currentAmount"
,
currentAmountFmt
);
//当前余额
item
.
put
(
"remark"
,
account
.
getRemark
());
item
.
put
(
"remark"
,
account
.
getRemark
());
item
.
put
(
"op"
,
1
);
item
.
put
(
"op"
,
1
);
dataArray
.
add
(
item
);
dataArray
.
add
(
item
);
...
@@ -316,7 +329,7 @@ public class AccountAction extends BaseAction<AccountModel>
...
@@ -316,7 +329,7 @@ public class AccountAction extends BaseAction<AccountModel>
}
}
}
}
/**
/**
* 单个账户的金额求和
* 单个账户的金额求和
-入库和出库
* @param id
* @param id
* @return
* @return
*/
*/
...
@@ -341,6 +354,79 @@ public class AccountAction extends BaseAction<AccountModel>
...
@@ -341,6 +354,79 @@ public class AccountAction extends BaseAction<AccountModel>
return
accountSum
;
return
accountSum
;
}
}
/**
* 单个账户的金额求和-收入、支出、转账的单据表头的合计
* @param id
* @return
*/
public
Double
getAccountSumByHead
(
Long
id
,
String
monthTime
){
Double
accountSum
=
0.0
;
try
{
PageUtil
<
AccountHead
>
pageUtil
=
new
PageUtil
<
AccountHead
>();
pageUtil
.
setPageSize
(
0
);
pageUtil
.
setCurPage
(
0
);
pageUtil
.
setAdvSearch
(
getCondition_getSumByHead
(
id
,
monthTime
));
accountHeadService
.
find
(
pageUtil
);
List
<
AccountHead
>
dataList
=
pageUtil
.
getPageList
();
if
(
dataList
!=
null
){
for
(
AccountHead
accountHead:
dataList
){
accountSum
=
accountSum
+
accountHead
.
getChangeAmount
();
}
}
}
catch
(
DataAccessException
e
){
Log
.
errorFileSync
(
">>>>>>>>>查找进销存信息异常"
,
e
);
}
return
accountSum
;
}
/**
* 单个账户的金额求和-收款、付款、转账、收预付款的单据明细的合计
* @param id
* @return
*/
public
Double
getAccountSumByDetail
(
Long
id
,
String
monthTime
){
Double
accountSum
=
0.0
;
try
{
PageUtil
<
AccountHead
>
pageUtil
=
new
PageUtil
<
AccountHead
>();
pageUtil
.
setPageSize
(
0
);
pageUtil
.
setCurPage
(
0
);
pageUtil
.
setAdvSearch
(
getCondition_getSumByHead
(
monthTime
));
accountHeadService
.
find
(
pageUtil
);
List
<
AccountHead
>
dataList
=
pageUtil
.
getPageList
();
if
(
dataList
!=
null
){
String
ids
=
""
;
for
(
AccountHead
accountHead:
dataList
){
ids
=
ids
+
accountHead
.
getId
()
+
","
;
}
ids
=
ids
.
substring
(
0
,
ids
.
length
()
-
1
);
System
.
out
.
println
(
">>>>>>>>>>>>>>>>>"
+
ids
);
PageUtil
<
AccountItem
>
pageUtilOne
=
new
PageUtil
<
AccountItem
>();
pageUtilOne
.
setPageSize
(
0
);
pageUtilOne
.
setCurPage
(
0
);
pageUtilOne
.
setAdvSearch
(
getCondition_getSumByDetail
(
id
,
ids
));
accountItemService
.
find
(
pageUtilOne
);
List
<
AccountItem
>
dataListOne
=
pageUtilOne
.
getPageList
();
if
(
dataListOne
!=
null
){
for
(
AccountItem
accountItem:
dataListOne
){
accountSum
=
accountSum
+
accountItem
.
getEachAmount
();
}
}
System
.
out
.
println
(
">>>>>>>>>>>>>>>>>accountSum:"
+
accountSum
);
}
}
catch
(
DataAccessException
e
){
Log
.
errorFileSync
(
">>>>>>>>>查找进销存信息异常"
,
e
);
}
catch
(
Exception
e
){
Log
.
errorFileSync
(
">>>>>>>>>异常信息:"
,
e
);
}
return
accountSum
;
}
/**
/**
* 查找结算账户信息-下拉框
* 查找结算账户信息-下拉框
* @return
* @return
...
@@ -413,7 +499,7 @@ public class AccountAction extends BaseAction<AccountModel>
...
@@ -413,7 +499,7 @@ public class AccountAction extends BaseAction<AccountModel>
}
}
/**
/**
* 拼接搜索条件
-结算账户当前余额求和
* 拼接搜索条件
* @return
* @return
*/
*/
private
Map
<
String
,
Object
>
getCondition_getSum
(
Long
id
,
String
monthTime
)
private
Map
<
String
,
Object
>
getCondition_getSum
(
Long
id
,
String
monthTime
)
...
@@ -431,6 +517,58 @@ public class AccountAction extends BaseAction<AccountModel>
...
@@ -431,6 +517,58 @@ public class AccountAction extends BaseAction<AccountModel>
return
condition
;
return
condition
;
}
}
/**
* 拼接搜索条件
* @return
*/
private
Map
<
String
,
Object
>
getCondition_getSumByHead
(
Long
id
,
String
monthTime
)
{
/**
* 拼接搜索条件
*/
Map
<
String
,
Object
>
condition
=
new
HashMap
<
String
,
Object
>();
condition
.
put
(
"AccountId_n_eq"
,
id
);
if
(!
monthTime
.
equals
(
""
)){
condition
.
put
(
"BillTime_s_gteq"
,
monthTime
+
"-01 00:00:00"
);
condition
.
put
(
"BillTime_s_lteq"
,
monthTime
+
"-31 00:00:00"
);
}
return
condition
;
}
/**
* 拼接搜索条件
* @return
*/
private
Map
<
String
,
Object
>
getCondition_getSumByHead
(
String
monthTime
)
{
/**
* 拼接搜索条件
*/
Map
<
String
,
Object
>
condition
=
new
HashMap
<
String
,
Object
>();
if
(!
monthTime
.
equals
(
""
)){
condition
.
put
(
"BillTime_s_gteq"
,
monthTime
+
"-01 00:00:00"
);
condition
.
put
(
"BillTime_s_lteq"
,
monthTime
+
"-31 00:00:00"
);
}
return
condition
;
}
/**
* 拼接搜索条件
* @return
*/
private
Map
<
String
,
Object
>
getCondition_getSumByDetail
(
Long
id
,
String
ids
)
{
/**
* 拼接搜索条件
*/
Map
<
String
,
Object
>
condition
=
new
HashMap
<
String
,
Object
>();
condition
.
put
(
"AccountId_n_eq"
,
id
);
if
(!
ids
.
equals
(
""
)){
condition
.
put
(
"HeaderId_s_in"
,
ids
);
}
return
condition
;
}
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
@Override
@Override
public
AccountModel
getModel
()
public
AccountModel
getModel
()
...
@@ -444,4 +582,10 @@ public class AccountAction extends BaseAction<AccountModel>
...
@@ -444,4 +582,10 @@ public class AccountAction extends BaseAction<AccountModel>
public
void
setDepotHeadService
(
DepotHeadIService
depotHeadService
)
{
public
void
setDepotHeadService
(
DepotHeadIService
depotHeadService
)
{
this
.
depotHeadService
=
depotHeadService
;
this
.
depotHeadService
=
depotHeadService
;
}
}
public
void
setAccountHeadService
(
AccountHeadIService
accountHeadService
)
{
this
.
accountHeadService
=
accountHeadService
;
}
public
void
setAccountItemService
(
AccountItemIService
accountItemService
)
{
this
.
accountItemService
=
accountItemService
;
}
}
}
src/main/java/com/jsh/action/materials/AccountItemAction.java
View file @
bfb1fe53
...
@@ -39,6 +39,7 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
...
@@ -39,6 +39,7 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
try
try
{
{
Long
headerId
=
model
.
getHeaderId
();
Long
headerId
=
model
.
getHeaderId
();
String
listType
=
model
.
getListType
();
//单据类型
String
inserted
=
model
.
getInserted
();
String
inserted
=
model
.
getInserted
();
String
deleted
=
model
.
getDeleted
();
String
deleted
=
model
.
getDeleted
();
String
updated
=
model
.
getUpdated
();
String
updated
=
model
.
getUpdated
();
...
@@ -55,7 +56,13 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
...
@@ -55,7 +56,13 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
accountItem
.
setHeaderId
(
new
AccountHead
(
headerId
));
accountItem
.
setHeaderId
(
new
AccountHead
(
headerId
));
if
(
tempInsertedJson
.
get
(
"AccountId"
)!=
null
&&!
tempInsertedJson
.
get
(
"AccountId"
).
equals
(
""
)){
accountItem
.
setAccountId
(
new
Account
(
tempInsertedJson
.
getLong
(
"AccountId"
)));}
if
(
tempInsertedJson
.
get
(
"AccountId"
)!=
null
&&!
tempInsertedJson
.
get
(
"AccountId"
).
equals
(
""
)){
accountItem
.
setAccountId
(
new
Account
(
tempInsertedJson
.
getLong
(
"AccountId"
)));}
if
(
tempInsertedJson
.
get
(
"InOutItemId"
)!=
null
&&!
tempInsertedJson
.
get
(
"InOutItemId"
).
equals
(
""
)){
accountItem
.
setInOutItemId
(
new
InOutItem
(
tempInsertedJson
.
getLong
(
"InOutItemId"
)));}
if
(
tempInsertedJson
.
get
(
"InOutItemId"
)!=
null
&&!
tempInsertedJson
.
get
(
"InOutItemId"
).
equals
(
""
)){
accountItem
.
setInOutItemId
(
new
InOutItem
(
tempInsertedJson
.
getLong
(
"InOutItemId"
)));}
if
(
tempInsertedJson
.
get
(
"EachAmount"
)!=
null
){
accountItem
.
setEachAmount
(
tempInsertedJson
.
getDouble
(
"EachAmount"
));}
if
(
tempInsertedJson
.
get
(
"EachAmount"
)!=
null
){
Double
eachAmount
=
tempInsertedJson
.
getDouble
(
"EachAmount"
);
if
(
listType
.
equals
(
"付款"
))
{
eachAmount
=
0
-
eachAmount
;
}
accountItem
.
setEachAmount
(
eachAmount
);
}
accountItem
.
setRemark
(
tempInsertedJson
.
getString
(
"Remark"
));
accountItem
.
setRemark
(
tempInsertedJson
.
getString
(
"Remark"
));
accountItemService
.
create
(
accountItem
);
accountItemService
.
create
(
accountItem
);
}
}
...
@@ -77,7 +84,13 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
...
@@ -77,7 +84,13 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
accountItem
.
setHeaderId
(
new
AccountHead
(
headerId
));
accountItem
.
setHeaderId
(
new
AccountHead
(
headerId
));
if
(
tempUpdatedJson
.
get
(
"AccountId"
)!=
null
&&!
tempUpdatedJson
.
get
(
"AccountId"
).
equals
(
""
)){
accountItem
.
setAccountId
(
new
Account
(
tempUpdatedJson
.
getLong
(
"AccountId"
)));}
if
(
tempUpdatedJson
.
get
(
"AccountId"
)!=
null
&&!
tempUpdatedJson
.
get
(
"AccountId"
).
equals
(
""
)){
accountItem
.
setAccountId
(
new
Account
(
tempUpdatedJson
.
getLong
(
"AccountId"
)));}
if
(
tempUpdatedJson
.
get
(
"InOutItemId"
)!=
null
&&!
tempUpdatedJson
.
get
(
"InOutItemId"
).
equals
(
""
)){
accountItem
.
setInOutItemId
(
new
InOutItem
(
tempUpdatedJson
.
getLong
(
"InOutItemId"
)));}
if
(
tempUpdatedJson
.
get
(
"InOutItemId"
)!=
null
&&!
tempUpdatedJson
.
get
(
"InOutItemId"
).
equals
(
""
)){
accountItem
.
setInOutItemId
(
new
InOutItem
(
tempUpdatedJson
.
getLong
(
"InOutItemId"
)));}
if
(
tempUpdatedJson
.
get
(
"EachAmount"
)!=
null
){
accountItem
.
setEachAmount
(
tempUpdatedJson
.
getDouble
(
"EachAmount"
));}
if
(
tempUpdatedJson
.
get
(
"EachAmount"
)!=
null
){
Double
eachAmount
=
tempUpdatedJson
.
getDouble
(
"EachAmount"
);
if
(
listType
.
equals
(
"付款"
))
{
eachAmount
=
0
-
eachAmount
;
}
accountItem
.
setEachAmount
(
eachAmount
);
}
accountItem
.
setRemark
(
tempUpdatedJson
.
getString
(
"Remark"
));
accountItem
.
setRemark
(
tempUpdatedJson
.
getString
(
"Remark"
));
accountItemService
.
create
(
accountItem
);
accountItemService
.
create
(
accountItem
);
}
}
...
@@ -144,7 +157,8 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
...
@@ -144,7 +157,8 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
item
.
put
(
"AccountName"
,
accountItem
.
getAccountId
()==
null
?
""
:
accountItem
.
getAccountId
().
getName
());
item
.
put
(
"AccountName"
,
accountItem
.
getAccountId
()==
null
?
""
:
accountItem
.
getAccountId
().
getName
());
item
.
put
(
"InOutItemId"
,
accountItem
.
getInOutItemId
()==
null
?
""
:
accountItem
.
getInOutItemId
().
getId
());
item
.
put
(
"InOutItemId"
,
accountItem
.
getInOutItemId
()==
null
?
""
:
accountItem
.
getInOutItemId
().
getId
());
item
.
put
(
"InOutItemName"
,
accountItem
.
getInOutItemId
()==
null
?
""
:
accountItem
.
getInOutItemId
().
getName
());
item
.
put
(
"InOutItemName"
,
accountItem
.
getInOutItemId
()==
null
?
""
:
accountItem
.
getInOutItemId
().
getName
());
item
.
put
(
"EachAmount"
,
accountItem
.
getEachAmount
());
Double
eachAmount
=
accountItem
.
getEachAmount
();
item
.
put
(
"EachAmount"
,
eachAmount
<
0
?
0
-
eachAmount
:
eachAmount
);
item
.
put
(
"Remark"
,
accountItem
.
getRemark
());
item
.
put
(
"Remark"
,
accountItem
.
getRemark
());
item
.
put
(
"op"
,
1
);
item
.
put
(
"op"
,
1
);
dataArray
.
add
(
item
);
dataArray
.
add
(
item
);
...
...
src/main/java/com/jsh/model/vo/materials/AccountItemModel.java
View file @
bfb1fe53
...
@@ -20,6 +20,7 @@ public class AccountItemModel implements Serializable
...
@@ -20,6 +20,7 @@ public class AccountItemModel implements Serializable
private
String
Updated
=
""
;
//json修改记录
private
String
Updated
=
""
;
//json修改记录
private
String
HeadIds
=
""
;
//表头集合列表
private
String
HeadIds
=
""
;
//表头集合列表
private
String
ListType
=
""
;
//单据类型
private
String
MonthTime
=
""
;
//月份
private
String
MonthTime
=
""
;
//月份
private
String
browserType
=
""
;
private
String
browserType
=
""
;
/**
/**
...
@@ -157,6 +158,14 @@ public class AccountItemModel implements Serializable
...
@@ -157,6 +158,14 @@ public class AccountItemModel implements Serializable
return
HeadIds
;
return
HeadIds
;
}
}
public
String
getListType
()
{
return
ListType
;
}
public
void
setListType
(
String
listType
)
{
ListType
=
listType
;
}
public
void
setMonthTime
(
String
monthTime
)
public
void
setMonthTime
(
String
monthTime
)
{
{
MonthTime
=
monthTime
;
MonthTime
=
monthTime
;
...
...
src/main/resources/spring/basic-applicationContext.xml
View file @
bfb1fe53
...
@@ -307,6 +307,8 @@
...
@@ -307,6 +307,8 @@
<bean
id=
"accountAction"
class=
"com.jsh.action.basic.AccountAction"
scope=
"prototype"
>
<bean
id=
"accountAction"
class=
"com.jsh.action.basic.AccountAction"
scope=
"prototype"
>
<property
name=
"accountService"
ref=
"accountService"
/>
<property
name=
"accountService"
ref=
"accountService"
/>
<property
name=
"depotHeadService"
ref=
"depotHeadService"
/>
<property
name=
"depotHeadService"
ref=
"depotHeadService"
/>
<property
name=
"accountHeadService"
ref=
"accountHeadService"
/>
<property
name=
"accountItemService"
ref=
"accountItemService"
/>
<property
name=
"logService"
ref=
"logService"
/>
<property
name=
"logService"
ref=
"logService"
/>
</bean>
</bean>
<!--结算账户配置结束 -->
<!--结算账户配置结束 -->
...
...
src/main/webapp/js/pages/financial/financial_base.js
View file @
bfb1fe53
...
@@ -235,9 +235,10 @@
...
@@ -235,9 +235,10 @@
+
'
AaBb
'
+
rec
.
HandsPersonId
+
'
AaBb
'
+
rec
.
HandsPersonName
+
'
AaBb
'
+
rec
.
ChangeAmount
+
'
AaBb
'
+
rec
.
TotalPrice
;
+
'
AaBb
'
+
rec
.
HandsPersonId
+
'
AaBb
'
+
rec
.
HandsPersonName
+
'
AaBb
'
+
rec
.
ChangeAmount
+
'
AaBb
'
+
rec
.
TotalPrice
;
if
(
1
==
value
)
if
(
1
==
value
)
{
{
var
orgId
=
rec
.
OrganId
?
rec
.
OrganId
:
0
;
str
+=
'
<img src="
'
+
path
+
'
/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountHead(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="showAccountHead(
\'
'
+
rowInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">查看</a>
'
;
str
+=
'
<img src="
'
+
path
+
'
/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountHead(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="showAccountHead(
\'
'
+
rowInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">查看</a>
'
;
str
+=
'
<img src="
'
+
path
+
'
/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccountHead(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="editAccountHead(
\'
'
+
rowInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>
'
;
str
+=
'
<img src="
'
+
path
+
'
/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccountHead(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="editAccountHead(
\'
'
+
rowInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>
'
;
str
+=
'
<img src="
'
+
path
+
'
/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccountHead(
'
+
rec
.
Id
+
'
,
'
+
rec
.
Organ
Id
+
'
,
'
+
rec
.
TotalPrice
+
'
);"/> <a onclick="deleteAccountHead(
'
+
rec
.
Id
+
'
,
'
+
rec
.
Organ
Id
+
'
,
'
+
rec
.
TotalPrice
+
'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>
'
;
str
+=
'
<img src="
'
+
path
+
'
/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccountHead(
'
+
rec
.
Id
+
'
,
'
+
org
Id
+
'
,
'
+
rec
.
TotalPrice
+
'
);"/> <a onclick="deleteAccountHead(
'
+
rec
.
Id
+
'
,
'
+
org
Id
+
'
,
'
+
rec
.
TotalPrice
+
'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>
'
;
}
}
return
str
;
return
str
;
}
}
...
@@ -787,11 +788,11 @@
...
@@ -787,11 +788,11 @@
if
(
listType
!==
"
转账
"
){
if
(
listType
!==
"
转账
"
){
OrganId
=
$
(
'
#OrganId
'
).
combobox
(
'
getValue
'
);
OrganId
=
$
(
'
#OrganId
'
).
combobox
(
'
getValue
'
);
}
}
if
(
listType
===
"
支出
"
){
if
(
listType
===
"
支出
"
||
listType
===
"
转账
"
){
//支出为负数
//支出为负数
ChangeAmount
=
0
-
ChangeAmount
;
ChangeAmount
=
0
-
ChangeAmount
;
}
}
if
(
listType
===
"
支出
"
||
listType
===
"
付款
"
){
if
(
listType
===
"
支出
"
||
listType
===
"
付款
"
||
listType
===
"
转账
"
){
//支出和付款为负数
//支出和付款为负数
TotalPrice
=
0
-
TotalPrice
;
TotalPrice
=
0
-
TotalPrice
;
}
}
...
@@ -850,11 +851,11 @@
...
@@ -850,11 +851,11 @@
if
(
accountHeadID
==
0
)
if
(
accountHeadID
==
0
)
{
{
getMaxId
();
//查找最大的Id
getMaxId
();
//查找最大的Id
accept
(
accountHeadMaxId
);
//新增
accept
(
accountHeadMaxId
,
listType
);
//新增
}
}
else
else
{
{
accept
(
accountHeadID
);
//修改
accept
(
accountHeadID
,
listType
);
//修改
}
}
$
(
'
#accountHeadDlg
'
).
dialog
(
'
close
'
);
$
(
'
#accountHeadDlg
'
).
dialog
(
'
close
'
);
...
@@ -1030,7 +1031,7 @@
...
@@ -1030,7 +1031,7 @@
return
true
;
return
true
;
}
}
//保存
//保存
function
accept
(
accepId
)
{
function
accept
(
accepId
,
listType
)
{
append
();
append
();
removeit
();
removeit
();
if
(
$
(
"
#accountData
"
).
datagrid
(
'
getChanges
'
).
length
)
{
if
(
$
(
"
#accountData
"
).
datagrid
(
'
getChanges
'
).
length
)
{
...
@@ -1047,6 +1048,7 @@
...
@@ -1047,6 +1048,7 @@
Deleted
:
JSON
.
stringify
(
deleted
),
Deleted
:
JSON
.
stringify
(
deleted
),
Updated
:
JSON
.
stringify
(
updated
),
Updated
:
JSON
.
stringify
(
updated
),
HeaderId
:
accepId
,
HeaderId
:
accepId
,
ListType
:
listType
,
clientIp
:
clientIp
clientIp
:
clientIp
},
},
success
:
function
(
tipInfo
)
success
:
function
(
tipInfo
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment