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
5c0b496b
Commit
5c0b496b
authored
May 06, 2019
by
qiankunpingtai
Browse files
修改经手人管理js效率低下的问题
parent
5a7a0f77
Changes
1
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/materials/person.html
View file @
5c0b496b
...
...
@@ -169,10 +169,17 @@
{
title
:
'
姓名
'
,
field
:
'
name
'
,
width
:
180
},
{
title
:
'
类型
'
,
field
:
'
type
'
,
width
:
180
},
{
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/6 9:33
* website:https://qiankunpingtai.cn
* description:
* 修改效率低下的js实现
*/
var
str
=
''
;
var
rowInfo
=
rec
.
id
+
'
AaBb
'
+
rec
.
name
+
'
AaBb
'
+
rec
.
type
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editPerson(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="editPerson(
\'
'
+
rowInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>
'
;
//
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.type;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editPerson(
\'
'
+
index
+
'
\'
);"/> <a onclick="editPerson(
\'
'
+
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="deletePerson(
'
+
rec
.
id
+
'
);"/> <a onclick="deletePerson(
'
+
rec
.
id
+
'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>
'
;
return
str
;
}
...
...
@@ -417,19 +424,20 @@
});
//编辑信息
function
editPerson
(
personTotalInfo
)
{
var
personInfo
=
personTotalInfo
.
split
(
"
AaBb
"
);
$
(
"
#Name
"
).
val
(
personInfo
[
1
]);
$
(
"
#Type
"
).
val
(
personInfo
[
2
]);
function
editPerson
(
index
)
{
// var personInfo = personTotalInfo.split("AaBb");
//获取当前行
var
rowsdata
=
$
(
"
#tableData
"
).
datagrid
(
"
getRows
"
)[
index
];
$
(
"
#Name
"
).
val
(
rowsdata
.
name
);
$
(
"
#Type
"
).
val
(
rowsdata
.
type
);
//oldPerson = personInfo[1];
$
(
'
#personDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑经手人信息
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
personID
=
personInfo
[
0
]
;
personID
=
rowsdata
.
id
;
//焦点在名称输入框==定焦在输入文字后面
$
(
"
#Name
"
).
val
(
""
).
focus
().
val
(
personInfo
[
1
]
);
url
=
'
/person/update?id=
'
+
personInfo
[
0
]
;
$
(
"
#Name
"
).
val
(
""
).
focus
().
val
(
rowsdata
.
name
);
url
=
'
/person/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