Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_53077510
production_ssm
提交
ed181b25
P
production_ssm
项目概览
weixin_53077510
/
production_ssm
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
production_ssm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ed181b25
编写于
11月 01, 2016
作者:
M
megagao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改了与其他模块同名的js方法,消除bug
上级
f6a0dced
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
58 addition
and
72 deletion
+58
-72
src/main/webapp/WEB-INF/jsp/custom_add.jsp
src/main/webapp/WEB-INF/jsp/custom_add.jsp
+4
-2
src/main/webapp/WEB-INF/jsp/custom_edit.jsp
src/main/webapp/WEB-INF/jsp/custom_edit.jsp
+25
-18
src/main/webapp/WEB-INF/jsp/custom_list.jsp
src/main/webapp/WEB-INF/jsp/custom_list.jsp
+29
-52
未找到文件。
src/main/webapp/WEB-INF/jsp/custom_add.jsp
浏览文件 @
ed181b25
...
...
@@ -72,7 +72,7 @@
<input
type=
"hidden"
name=
"customParams"
/>
</form>
<div
style=
"padding:5px"
>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
onclick=
"submitForm()"
>
提交
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
onclick=
"submit
CustomAdd
Form()"
>
提交
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
onclick=
"clearForm()"
>
重置
</a>
</div>
</div>
...
...
@@ -87,7 +87,7 @@
customAddEditor
=
KindEditor
.
create
(
"
#customAddForm [name=note]
"
,
TT
.
kingEditorParams
);
});
//提交表单
function
submitForm
(){
function
submit
CustomAdd
Form
(){
//有效性验证
if
(
!
$
(
'
#customAddForm
'
).
form
(
'
validate
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
表单还未填写完成!
'
);
...
...
@@ -101,6 +101,8 @@
if
(
data
.
status
==
200
){
$
.
messager
.
alert
(
'
提示
'
,
'
新增客户成功!
'
);
clearForm
();
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
data
.
msg
);
}
});
}
...
...
src/main/webapp/WEB-INF/jsp/custom_edit.jsp
浏览文件 @
ed181b25
...
...
@@ -6,12 +6,11 @@
<form
id=
"customEditForm"
class=
"customForm"
method=
"post"
>
<input
type=
"hidden"
name=
"customId"
/>
<table
cellpadding=
"5"
>
<tr>
<tr>
<td>
客户名称:
</td>
<td>
<input
class=
"easyui-textbox"
type=
"text"
name=
"customName"
data-options=
"required:true"
></input>
</td>
</tr>
<tr>
<td>
客户全称:
</td>
...
...
@@ -67,7 +66,7 @@
</table>
</form>
<div
style=
"padding:5px"
>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
onclick=
"submitForm()"
>
提交
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
onclick=
"submit
CustomEdit
Form()"
>
提交
</a>
</div>
</div>
<script
type=
"text/javascript"
>
...
...
@@ -77,20 +76,28 @@
customEditEditor
=
TAOTAO
.
createEditor
(
"
#customEditForm [name=note]
"
);
});
function
submitForm
(){
if
(
!
$
(
'
#customEditForm
'
).
form
(
'
validate
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
表单还未填写完成!
'
);
return
;
}
//同步文本框中的备注
customEditEditor
.
sync
();
$
.
post
(
"
custom/update_all
"
,
$
(
"
#customEditForm
"
).
serialize
(),
function
(
data
){
if
(
data
.
status
==
200
){
$
.
messager
.
alert
(
'
提示
'
,
'
修改客户成功!
'
,
'
info
'
,
function
(){
$
(
"
#customEditWindow
"
).
window
(
'
close
'
);
$
(
"
#customList
"
).
datagrid
(
"
reload
"
);
});
}
});
function
submitCustomEditForm
(){
$
.
get
(
"
custom/edit_judge
"
,
''
,
function
(
data
){
if
(
data
.
msg
!=
null
){
$
.
messager
.
alert
(
'
提示
'
,
data
.
msg
);
}
else
{
if
(
!
$
(
'
#customEditForm
'
).
form
(
'
validate
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
表单还未填写完成!
'
);
return
;
}
//同步文本框中的备注
customEditEditor
.
sync
();
$
.
post
(
"
custom/update_all
"
,
$
(
"
#customEditForm
"
).
serialize
(),
function
(
data
){
if
(
data
.
status
==
200
){
$
.
messager
.
alert
(
'
提示
'
,
'
修改客户成功!
'
,
'
info
'
,
function
(){
$
(
"
#customEditWindow
"
).
window
(
'
close
'
);
$
(
"
#customList
"
).
datagrid
(
"
reload
"
);
$
(
"
#customInfoWindow
"
).
window
(
'
close
'
);
});
}
});
}
});
}
</script>
src/main/webapp/WEB-INF/jsp/custom_list.jsp
浏览文件 @
ed181b25
...
...
@@ -7,16 +7,16 @@
<thead>
<tr>
<th
data-options=
"field:'ck',checkbox:true"
></th>
<th
data-options=
"field:'customId',width:100"
>
客户编号
</th>
<th
data-options=
"field:'customName',width:100"
>
客户名称
</th>
<th
data-options=
"field:'fullName',width:200"
>
客户全称
</th>
<th
data-options=
"field:'address',width:
100
"
>
地址
</th>
<th
data-options=
"field:'fax',width:100,align:'
right
'"
>
传真
</th>
<th
data-options=
"field:'email',width:100,align:'
right
'"
>
邮箱
</th>
<th
data-options=
"field:'customId',width:100
,align:'center'
"
>
客户编号
</th>
<th
data-options=
"field:'customName',width:100
,align:'center'
"
>
客户名称
</th>
<th
data-options=
"field:'fullName',width:200
,align:'center'
"
>
客户全称
</th>
<th
data-options=
"field:'address',width:
200,align:'center'
"
>
地址
</th>
<th
data-options=
"field:'fax',width:100,align:'
center
'"
>
传真
</th>
<th
data-options=
"field:'email',width:100,align:'
center
'"
>
邮箱
</th>
<th
data-options=
"field:'ownerName',width:60,align:'center'"
>
经理姓名
</th>
<th
data-options=
"field:'ownerTel',width:100,align:'center'"
>
联系电话
</th>
<th
data-options=
"field:'status',width:60,align:'center',formatter:TAOTAO.formatCustomStatus"
>
客户状态
</th>
<th
data-options=
"field:'note',width:130,align:'center', formatter:formatNote"
>
备注
</th>
<th
data-options=
"field:'note',width:130,align:'center', formatter:format
Custom
Note"
>
备注
</th>
</tr>
</thead>
</table>
...
...
@@ -24,8 +24,8 @@
</div>
<div
id=
"customAddWindow"
class=
"easyui-window"
title=
"添加客户"
data-options=
"modal:true,closed:true,resizable:true,iconCls:'icon-save',href:'custom/add'"
style=
"width:65%;height:80%;padding:10px;"
>
</div>
<div
id=
"
n
oteDialog"
class=
"easyui-dialog"
title=
"备注"
data-options=
"modal:true,closed:true,resizable:true,iconCls:'icon-save'"
style=
"width:55%;height:80%;padding:10px;"
>
<form
id=
"
n
oteForm"
class=
"itemForm"
method=
"post"
>
<div
id=
"
customN
oteDialog"
class=
"easyui-dialog"
title=
"备注"
data-options=
"modal:true,closed:true,resizable:true,iconCls:'icon-save'"
style=
"width:55%;height:80%;padding:10px;"
>
<form
id=
"
customN
oteForm"
class=
"itemForm"
method=
"post"
>
<input
type=
"hidden"
name=
"customId"
/>
<table
cellpadding=
"5"
>
<tr>
...
...
@@ -37,56 +37,56 @@
</table>
</form>
<div
style=
"padding:5px"
>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
onclick=
"updateNote()"
>
保存
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
onclick=
"update
Custom
Note()"
>
保存
</a>
</div>
</div>
<script>
var
n
oteEditor
;
var
customN
oteEditor
;
//根据index拿到该行值
function
onClickRow
(
index
)
{
function
onC
ustomC
lickRow
(
index
)
{
var
rows
=
$
(
'
#customList
'
).
datagrid
(
'
getRows
'
);
return
rows
[
index
];
}
//格式化客户介绍
function
formatNote
(
value
,
row
,
index
){
function
format
Custom
Note
(
value
,
row
,
index
){
if
(
value
!=
null
&&
value
!=
''
){
return
"
<a href=javascript:openNote(
"
+
index
+
"
)>
"
+
"
客户介绍
"
+
"
</a>
"
;
return
"
<a href=javascript:open
Custom
Note(
"
+
index
+
"
)>
"
+
"
客户介绍
"
+
"
</a>
"
;
}
else
{
return
"
无
"
;
}
}
function
openNote
(
index
){
function
open
Custom
Note
(
index
){
var
row
=
onClickRow
(
index
);
$
(
"
#
n
oteDialog
"
).
dialog
({
var
row
=
onC
ustomC
lickRow
(
index
);
$
(
"
#
customN
oteDialog
"
).
dialog
({
onOpen
:
function
(){
$
(
"
#
n
oteForm [name=customId]
"
).
val
(
row
.
customId
);
noteEditor
=
TAOTAO
.
createEditor
(
"
#n
oteForm [name=note]
"
);
n
oteEditor
.
html
(
row
.
note
);
$
(
"
#
customN
oteForm [name=customId]
"
).
val
(
row
.
customId
);
customNoteEditor
=
TAOTAO
.
createEditor
(
"
#customN
oteForm [name=note]
"
);
customN
oteEditor
.
html
(
row
.
note
);
},
onBeforeClose
:
function
(
event
,
ui
)
{
// 关闭Dialog前移除编辑器
KindEditor
.
remove
(
"
#
n
oteForm [name=note]
"
);
KindEditor
.
remove
(
"
#
customN
oteForm [name=note]
"
);
}
}).
dialog
(
"
open
"
);
};
function
updateNote
(){
function
update
Custom
Note
(){
$
.
get
(
"
custom/edit_judge
"
,
''
,
function
(
data
){
if
(
data
.
msg
!=
null
){
$
.
messager
.
alert
(
'
提示
'
,
data
.
msg
);
}
else
{
n
oteEditor
.
sync
();
$
.
post
(
"
custom/update_note
"
,
$
(
"
#
n
oteForm
"
).
serialize
(),
function
(
data
){
customN
oteEditor
.
sync
();
$
.
post
(
"
custom/update_note
"
,
$
(
"
#
customN
oteForm
"
).
serialize
(),
function
(
data
){
if
(
data
.
status
==
200
){
$
(
"
#
n
oteDialog
"
).
dialog
(
"
close
"
);
$
(
"
#
customN
oteDialog
"
).
dialog
(
"
close
"
);
$
(
"
#customList
"
).
datagrid
(
"
reload
"
);
$
.
messager
.
alert
(
"
操作提示
"
,
"
更新客户介绍成功!
"
);
}
else
{
...
...
@@ -97,7 +97,7 @@
});
}
function
getSelectionsIds
(){
function
get
Custom
SelectionsIds
(){
var
customList
=
$
(
"
#customList
"
);
var
sels
=
customList
.
datagrid
(
"
getSelections
"
);
var
ids
=
[];
...
...
@@ -129,7 +129,7 @@
if
(
data
.
msg
!=
null
){
$
.
messager
.
alert
(
'
提示
'
,
data
.
msg
);
}
else
{
var
ids
=
getSelectionsIds
();
var
ids
=
get
Custom
SelectionsIds
();
if
(
ids
.
length
==
0
){
$
.
messager
.
alert
(
'
提示
'
,
'
必须选择一个客户才能编辑!
'
);
...
...
@@ -145,8 +145,7 @@
//回显数据
var
data
=
$
(
"
#customList
"
).
datagrid
(
"
getSelections
"
)[
0
];
$
(
"
#customEditForm
"
).
form
(
"
load
"
,
data
);
noteEditor
.
html
(
data
.
note
);
customNoteEditor
.
html
(
data
.
note
);
}
}).
window
(
"
open
"
);
}
...
...
@@ -160,7 +159,7 @@
if
(
data
.
msg
!=
null
){
$
.
messager
.
alert
(
'
提示
'
,
data
.
msg
);
}
else
{
var
ids
=
getSelectionsIds
();
var
ids
=
get
Custom
SelectionsIds
();
if
(
ids
.
length
==
0
){
$
.
messager
.
alert
(
'
提示
'
,
'
未选中客户!
'
);
return
;
...
...
@@ -181,28 +180,6 @@
});
}
},
'
-
'
,{
text
:
'
下架
'
,
iconCls
:
'
icon-remove
'
,
handler
:
function
(){
var
ids
=
getSelectionsIds
();
if
(
ids
.
length
==
0
){
$
.
messager
.
alert
(
'
提示
'
,
'
未选中客户!
'
);
return
;
}
$
.
messager
.
confirm
(
'
确认
'
,
'
确定下架ID为
'
+
ids
+
'
的客户吗?
'
,
function
(
r
){
if
(
r
){
var
params
=
{
"
ids
"
:
ids
};
$
.
post
(
"
/rest/custom/instock
"
,
params
,
function
(
data
){
if
(
data
.
status
==
200
){
$
.
messager
.
alert
(
'
提示
'
,
'
下架客户成功!
'
,
undefined
,
function
(){
$
(
"
#customList
"
).
datagrid
(
"
reload
"
);
});
}
});
}
});
}
},{
text
:
'
刷新
'
,
iconCls
:
'
icon-reload
'
,
handler
:
function
(){
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录