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
148306b3
Commit
148306b3
authored
May 05, 2019
by
qiankunpingtai
Browse files
修改收支项目js效率低下的问题
parent
2eced509
Changes
1
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/manage/inOutItem.html
View file @
148306b3
...
...
@@ -142,11 +142,18 @@
{
title
:
'
类型
'
,
field
:
'
type
'
,
width
:
100
,
align
:
"
center
"
},
{
title
:
'
描述
'
,
field
:
'
remark
'
,
width
:
200
},
{
title
:
'
操作
'
,
field
:
'
op
'
,
align
:
"
center
"
,
width
:
130
,
formatter
:
function
(
value
,
rec
)
{
title
:
'
操作
'
,
field
:
'
op
'
,
align
:
"
center
"
,
width
:
130
,
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
.
type
+
'
AaBb
'
+
rec
.
remark
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editInOutItem(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="editInOutItem(
\'
'
+
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="deleteInOutItem(
\'
'
+
r
owInfo
+
'
\'
);"/> <a onclick="deleteInOutItem(
\'
'
+
r
owInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>
'
;
//
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.type + 'AaBb' + rec.remark;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editInOutItem(
\'
'
+
index
+
'
\'
);"/> <a onclick="editInOutItem(
\'
'
+
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="deleteInOutItem(
\'
'
+
r
ec
.
id
+
'
\'
);"/> <a onclick="deleteInOutItem(
\'
'
+
r
ec
.
id
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>
'
;
return
str
;
}
}
...
...
@@ -219,16 +226,16 @@
}
//删除收支项目
function
deleteInOutItem
(
i
nOutItemInfo
)
{
function
deleteInOutItem
(
i
d
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
'
确定要删除此收支项目吗?
'
,
function
(
r
)
{
if
(
r
)
{
var
inOutItemTotalInfo
=
inOutItemInfo
.
split
(
"
AaBb
"
);
//
var inOutItemTotalInfo = inOutItemInfo.split("AaBb");
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/inOutItem/batchDeleteInOutItemByIds
"
,
dataType
:
"
json
"
,
data
:
({
ids
:
i
nOutItemTotalInfo
[
0
]
ids
:
i
d
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
==
200
)
{
...
...
@@ -236,7 +243,7 @@
}
else
{
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
i
nOutItemTotalInfo
[
0
]
;
jsondata
.
ids
=
i
d
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
single
'
;
batDeleteInOutItemForceConfirm
(
res
,
"
/inOutItem/batchDeleteInOutItemByIds
"
,
jsondata
,
type
);
...
...
@@ -398,21 +405,23 @@
});
//编辑收支项目
function
editInOutItem
(
inOutItemTotalInfo
)
{
var
inOutItemInfo
=
inOutItemTotalInfo
.
split
(
"
AaBb
"
);
function
editInOutItem
(
index
)
{
// var inOutItemInfo = inOutItemTotalInfo.split("AaBb");
//获取当前行
var
rowsdata
=
$
(
"
#tableData
"
).
datagrid
(
"
getRows
"
)[
index
];
var
row
=
{
name
:
inOutItemInfo
[
1
]
,
type
:
inOutItemInfo
[
2
]
,
remark
:
inOutItemInfo
[
3
]
name
:
rowsdata
.
name
,
type
:
rowsdata
.
type
,
remark
:
rowsdata
.
remark
};
oldInOutItem
=
inOutItemInfo
[
1
]
;
oldInOutItem
=
rowsdata
.
name
;
$
(
'
#inOutItemDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑收支项目
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
$
(
'
#inOutItemFM
'
).
form
(
'
load
'
,
row
);
inOutItemID
=
inOutItemInfo
[
0
]
;
inOutItemID
=
rowsdata
.
id
;
//焦点在名称输入框==定焦在输入文字后面
$
(
"
#inOutItem
"
).
val
(
""
).
focus
().
val
(
inOutItemInfo
[
1
]
);
url
=
'
/inOutItem/update?id=
'
+
inOutItemInfo
[
0
]
;
$
(
"
#inOutItem
"
).
val
(
""
).
focus
().
val
(
rowsdata
.
name
);
url
=
'
/inOutItem/update?id=
'
+
rowsdata
.
id
;
}
//检查收支项目 名称是否存在 ++ 重名无法提示问题需要跟进
...
...
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