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
82c806b8
Commit
82c806b8
authored
May 05, 2019
by
qiankunpingtai
Browse files
修改结算账户js效率低下的问题
parent
51fa5322
Changes
1
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/manage/account.html
View file @
82c806b8
...
...
@@ -134,12 +134,20 @@
},
{
title
:
'
备注
'
,
field
:
'
remark
'
,
width
:
100
},
{
title
:
'
操作
'
,
field
:
'
op
'
,
align
:
"
center
"
,
width
:
210
,
formatter
:
function
(
value
,
rec
)
{
title
:
'
操作
'
,
field
:
'
op
'
,
align
:
"
center
"
,
width
:
210
,
formatter
:
function
(
value
,
rec
,
index
)
{
/**
* create by: qiankunpingtai
* create time: 2019/5/5 10:30
* website:https://qiankunpingtai.cn
* description:
* 修改效率低下的js实现
*/
var
str
=
''
;
var
rowInfo
=
rec
.
id
+
'
AaBb
'
+
rec
.
name
+
'
AaBb
'
+
rec
.
serialno
+
'
AaBb
'
+
rec
.
initialamount
+
'
AaBb
'
+
rec
.
currentamount
+
'
AaBb
'
+
rec
.
remark
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountInOutList(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="showAccountInOutList(
\'
'
+
rowInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">流水</a>
'
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccount(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="editAccount(
\'
'
+
rowInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>
'
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccount(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="deleteAccount(
\'
'
+
rowInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>
'
;
// var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.serialno + 'AaBb' + rec.initialamount + 'AaBb' + rec.currentamount + 'AaBb' + rec.remark;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountInOutList(
\'
'
+
index
+
'
\'
);"/> <a onclick="showAccountInOutList(
\'
'
+
index
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">流水</a>
'
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccount(
\'
'
+
index
+
'
\'
);"/> <a onclick="editAccount(
\'
'
+
index
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>
'
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccount(
\'
'
+
rec
.
id
+
'
\'
);"/> <a onclick="deleteAccount(
\'
'
+
rec
.
id
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>
'
;
return
str
;
}
}
...
...
@@ -219,16 +227,16 @@
}
//删除结算账户
function
deleteAccount
(
accountInfo
)
{
function
deleteAccount
(
id
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
'
确定要删除此结算账户吗?
'
,
function
(
r
)
{
if
(
r
)
{
var
accountTotalInfo
=
accountInfo
.
split
(
"
AaBb
"
);
//
var accountTotalInfo = accountInfo.split("AaBb");
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/account/batchDeleteAccountByIds
"
,
dataType
:
"
json
"
,
data
:
({
ids
:
accountTotalInfo
[
0
]
ids
:
id
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
==
200
)
{
...
...
@@ -236,7 +244,7 @@
}
else
{
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
accountTotalInfo
[
0
]
;
jsondata
.
ids
=
id
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
single
'
;
batDeleteAccountForceConfirm
(
res
,
"
/account/batchDeleteAccountByIds
"
,
jsondata
,
type
);
...
...
@@ -441,23 +449,24 @@
});
//编辑结算账户
function
editAccount
(
accountTotalInfo
)
{
var
accountInfo
=
accountTotalInfo
.
split
(
"
AaBb
"
);
function
editAccount
(
index
)
{
var
rowsdata
=
$
(
"
#tableData
"
).
datagrid
(
"
getRows
"
)[
index
];
// var accountInfo = accountTotalInfo.split("AaBb");
var
row
=
{
name
:
accountInfo
[
1
]
,
serialNo
:
accountInfo
[
2
]
,
initialAmount
:
accountInfo
[
3
]
,
currentAmount
:
accountInfo
[
4
]
,
remark
:
accountInfo
[
5
]
name
:
rowsdata
.
name
,
serialNo
:
rowsdata
.
serialNo
,
initialAmount
:
rowsdata
.
initialamount
,
currentAmount
:
rowsdata
.
currentamount
,
remark
:
rowsdata
.
remark
};
oldAccount
=
accountInfo
[
1
]
;
oldAccount
=
rowsdata
.
name
;
$
(
'
#accountDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑结算账户
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
$
(
'
#accountFM
'
).
form
(
'
load
'
,
row
);
accountID
=
accountInfo
[
0
];
//焦点在名称输入框==定焦在输入文字后面
$
(
"
#account
"
).
val
(
""
).
focus
().
val
(
accountInfo
[
1
]
);
url
=
'
/account/update?id=
'
+
accountInfo
[
0
]
;
$
(
"
#account
"
).
val
(
""
).
focus
().
val
(
rowsdata
.
name
);
url
=
'
/account/update?id=
'
+
rowsdata
.
id
;
}
//检查结算账户 名称是否存在 ++ 重名无法提示问题需要跟进
...
...
@@ -544,10 +553,11 @@
});
}
function
showAccountInOutList
(
accountInfo
)
{
var
info
=
accountInfo
.
split
(
"
AaBb
"
);
var
accountId
=
info
[
0
];
var
initialAmount
=
info
[
3
];
function
showAccountInOutList
(
index
)
{
//获取当前行
var
rowsdata
=
$
(
"
#tableData
"
).
datagrid
(
"
getRows
"
)[
index
];
var
accountId
=
rowsdata
.
id
;
var
initialAmount
=
rowsdata
.
serialno
;
$
(
'
#accountDetailListDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 查看账户流水
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
initAccountDetailData
(
accountId
);
...
...
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