Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
215c69b9
Commit
215c69b9
authored
Jul 05, 2018
by
agping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人修改
parent
d7d10da6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
225 additions
and
181 deletions
+225
-181
getCollection.html
application/index/view/collection/getCollection.html
+75
-51
agent.js
public/resource/js/agent.js
+150
-130
No files found.
application/index/view/collection/getCollection.html
View file @
215c69b9
...
@@ -97,83 +97,106 @@
...
@@ -97,83 +97,106 @@
margin-top
:
-350px
;
margin-top
:
-350px
;
}
}
/*上传图片列表 样式*/
/*上传图片列表 样式*/
.form-group
{
.form-group
{
margin
:
10px
;
margin
:
10px
;
}
}
.input-100-width
{
.input-100-width
{
width
:
100px
!important
;
width
:
100px
!important
;
}
}
.input-360-width
{
.input-360-width
{
width
:
360px
!important
;
width
:
360px
!important
;
}
}
.textarea-500-width
{
.textarea-500-width
{
width
:
500px
!important
;
width
:
500px
!important
;
}
}
.list-group-item
>
.full-width-100
+
.full-width-100
{
.list-group-item
>
.full-width-100
+
.full-width-100
{
padding-top
:
10px
;
padding-top
:
10px
;
}
}
.list-group-item
>
.full-width-100
>
label
{
.list-group-item
>
.full-width-100
>
label
{
width
:
60px
;
width
:
60px
;
}
}
.list-group-item
>
.full-pic-area
>
label
{
.list-group-item
>
.full-pic-area
>
label
{
width
:
120px
;
width
:
120px
;
}
}
.delet-pic-btn
{
color
:
red
;
.delet-pic-btn
{
}
color
:
red
;
/*css样式*/
}
.img-cont
{
/*css样式*/
width
:
1000px
;
height
:
570px
;
.img-cont
{
border
:
2px
solid
#317ef3
;
width
:
1000px
;
margin
:
50px
auto
;
height
:
570px
;
}
border
:
2px
solid
#317ef3
;
margin
:
50px
auto
;
.img-cont
>
div
{
}
width
:
300px
;
height
:
260px
;
.img-cont
>
div
{
border
:
1px
solid
#777
;
width
:
300px
;
float
:
left
;
height
:
260px
;
margin
:
20px
0
0
20px
;
border
:
1px
solid
#777
;
}
float
:
left
;
margin
:
20px
0
0
20px
;
.img-cont
>
div
>
div
{
}
width
:
300px
;
height
:
220px
;
.img-cont
>
div
>
div
{
border
:
1px
solid
red
;
width
:
300px
;
}
height
:
220px
;
border
:
1px
solid
red
;
.img-cont
>
div
>
a
{
}
width
:
60px
;
height
:
30px
;
.img-cont
>
div
>
a
{
border-radius
:
4px
;
width
:
60px
;
height
:
30px
;
border-radius
:
4px
;
line-height
:
30px
;
line-height
:
30px
;
text-align
:
center
;
text-align
:
center
;
color
:
#fff
;
color
:
#fff
;
display
:
block
;
display
:
block
;
background
:
#317ef3
;
background
:
#317ef3
;
margin
:
5px
0
0
0px
;
margin
:
5px
0
0
0px
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.hide
{
.hide
{
display
:
none
!important
;
display
:
none
!important
;
}
}
.result
{
.result
{
width
:
600px
;
width
:
600px
;
}
}
.result
>
img
{
.result
>
img
{
width
:
200px
;
width
:
200px
;
height
:
200px
;
height
:
200px
;
}
}
/*css样式*/
#container_body
{
position
:
relative
;
}
#file_input
{
opacity
:
0
;
position
:
absolute
;
top
:
0
;
left
:
145px
;
height
:
35px
;
width
:
80px
;
}
.out-style
{
position
:
absolute
;
top
:
0
;
left
:
60px
;
}
/*css样式*/
</style>
</style>
<div
id=
"page-content-wrapper"
>
<div
id=
"page-content-wrapper"
>
<div
class=
"container"
>
<div
class=
"container"
>
...
@@ -308,6 +331,7 @@
...
@@ -308,6 +331,7 @@
<!--input上传图片-->
<!--input上传图片-->
<div
id=
"container_body"
>
<div
id=
"container_body"
>
<label>
请选择一个图像文件:
</label>
<label>
请选择一个图像文件:
</label>
<button
type=
"button btn2"
class=
"btn btn-default"
>
上传图片
</button>
<input
type=
"file"
id=
"file_input"
/>
<input
type=
"file"
id=
"file_input"
/>
</div>
</div>
</div>
</div>
...
@@ -320,7 +344,7 @@
...
@@ -320,7 +344,7 @@
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>-->
</button>-->
<button
type=
"button"
class=
"btn btn-primary"
id=
"saveBtn"
data-dismiss=
"modal"
>
<button
type=
"button
btn2
"
class=
"btn btn-primary"
id=
"saveBtn"
data-dismiss=
"modal"
>
保存
保存
</button>
</button>
</div>
</div>
...
@@ -331,4 +355,4 @@
...
@@ -331,4 +355,4 @@
</div>
</div>
<div
id=
"img_mask_area"
title=
"点击任意位置可关闭"
>
<div
id=
"img_mask_area"
title=
"点击任意位置可关闭"
>
<img
/>
<img
/>
</div>
</div>
\ No newline at end of file
\ No newline at end of file
public/resource/js/agent.js
View file @
215c69b9
define
([
'doT'
,
'text!temp/agent_template_tpl.html'
,
'text!temp/phoneBinding_template_tpl.html'
,
'css!style/home.css'
,
'pagination'
,
'bootstrapJs'
,
'ckfinder'
,
'ckfinderStart'
,
'blow-up'
],
function
(
doT
,
template
,
template_binding
)
{
define
([
'doT'
,
'text!temp/agent_template_tpl.html'
,
'text!temp/phoneBinding_template_tpl.html'
,
'css!style/home.css'
,
'pagination'
,
'bootstrapJs'
,
'ckfinder'
,
'ckfinderStart'
,
'blow-up'
],
function
(
doT
,
template
,
template_binding
)
{
var
agent
=
{
var
agent
=
{
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
15
,
pageSize
:
15
,
agent_id
:
0
,
agent_id
:
0
,
init
:
function
()
{
idArray
:
''
,
init
:
function
()
{
//初始化dot
//初始化dot
$
(
"body"
).
append
(
template
+
template_binding
);
$
(
"body"
).
append
(
template
+
template_binding
);
agent
.
getList
();
agent
.
getList
();
agent
.
event
();
agent
.
event
();
},
},
event
:
function
()
{
event
:
function
()
{
var
_doc
=
$
(
document
);
var
_doc
=
$
(
document
);
agent
.
getDistrict
(
function
(){
agent
.
getDistrict
(
function
()
{
_doc
.
on
(
'input'
,
'[name=district_id]'
,
function
(){
_doc
.
on
(
'input'
,
'[name=district_id]'
,
function
()
{
var
_this
=
$
(
this
);
var
_this
=
$
(
this
);
var
_id
=
_this
.
val
();
var
_id
=
_this
.
val
();
var
_objTemp
=
_this
.
parent
().
next
().
find
(
'select'
);
var
_objTemp
=
_this
.
parent
().
next
().
find
(
'select'
);
_objTemp
.
html
(
''
);
//先清空
_objTemp
.
html
(
''
);
//先清空
if
(
_id
&&
_id
!=
'0'
){
if
(
_id
&&
_id
!=
'0'
)
{
agent
.
getDistrictStoreList
(
_id
,
function
(
_data
){
agent
.
getDistrictStoreList
(
_id
,
function
(
_data
)
{
// var _str = '';
// var _str = '';
var
_str
=
'<option value="0">全部</option>'
;
var
_str
=
'<option value="0">全部</option>'
;
$
.
each
(
_data
,
function
(
i
,
item
)
{
$
.
each
(
_data
,
function
(
i
,
item
)
{
_str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
store_name
+
'</option>'
;
_str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
store_name
+
'</option>'
;
});
});
_objTemp
.
html
(
_str
);
_objTemp
.
html
(
_str
);
});
});
}
else
{
}
else
{};
};
});
});
})
})
$
(
'#search'
).
click
(
function
(
pageNo
)
{
$
(
'#search'
).
click
(
function
(
pageNo
)
{
agent
.
getList
(
1
);
agent
.
getList
(
1
);
});
});
$
(
"#reset"
).
click
(
function
()
{
//重置
$
(
"#reset"
).
click
(
function
()
{
//重置
document
.
getElementById
(
"form_search"
).
reset
();
document
.
getElementById
(
"form_search"
).
reset
();
});
});
$
(
document
).
delegate
(
".agent_add"
,
"click"
,
function
()
{
//新增
$
(
document
).
delegate
(
".agent_add"
,
"click"
,
function
()
{
//新增
$
(
"#title"
).
html
(
"新增经纪人"
);
$
(
"#title"
).
html
(
"新增经纪人"
);
$
(
"#password"
).
parent
().
addClass
(
'hide'
);
//新增不显示密码
$
(
"#password"
).
parent
().
addClass
(
'hide'
);
//新增不显示密码
$
(
".form-horizontal"
)[
0
].
reset
();
//重置表单
$
(
".form-horizontal"
)[
0
].
reset
();
//重置表单
agent
.
emptyInput
();
//清空表单
agent
.
emptyInput
();
//清空表单
});
});
$
(
document
).
delegate
(
".edit"
,
"click"
,
function
()
{
//点击编辑
$
(
document
).
delegate
(
".edit"
,
"click"
,
function
()
{
//点击编辑
$
(
"#title"
).
html
(
"编辑经纪人"
);
$
(
"#title"
).
html
(
"编辑经纪人"
);
$
(
".form-horizontal"
)[
0
].
reset
();
//重置表单
$
(
".form-horizontal"
)[
0
].
reset
();
//重置表单
agent
.
agent_id
=
$
(
this
).
attr
(
"data-id"
);
agent
.
agent_id
=
$
(
this
).
attr
(
"data-id"
);
$
(
"#password"
).
parent
().
removeClass
(
'hide'
);
//编辑显示密码
$
(
"#password"
).
parent
().
removeClass
(
'hide'
);
//编辑显示密码
$
(
"#password"
).
attr
(
'type'
,
'text'
);
$
(
"#password"
).
attr
(
'type'
,
'text'
);
agent
.
emptyInput
();
//清空表单
agent
.
emptyInput
();
//清空表单
agent
.
Edit
();
agent
.
Edit
();
});
});
$
(
document
).
delegate
(
"#password"
,
"click"
,
function
()
{
$
(
document
).
delegate
(
"#password"
,
"click"
,
function
()
{
$
(
this
).
val
(
''
).
attr
(
'type'
,
'password'
);
$
(
this
).
val
(
''
).
attr
(
'type'
,
'password'
);
});
});
$
(
document
).
on
(
"click"
,
".phone-bundling"
,
function
()
{
$
(
document
).
on
(
"click"
,
".phone-bundling"
,
function
()
{
agent
.
agent_id
=
$
(
this
).
attr
(
"data-id"
);
agent
.
agent_id
=
$
(
this
).
attr
(
"data-id"
);
agent
.
getPhoneBindingList
();
agent
.
getPhoneBindingList
();
});
});
$
(
document
).
delegate
(
".submit_edit"
,
"click"
,
function
()
{
//提交编辑
$
(
document
).
delegate
(
".submit_edit"
,
"click"
,
function
()
{
//提交编辑
agent
.
Submit_edit
();
agent
.
Submit_edit
();
});
});
$
(
document
).
delegate
(
"#role"
,
"click"
,
function
(
e
)
{
//变更角色
$
(
document
).
delegate
(
"#role"
,
"click"
,
function
(
e
)
{
//变更角色
var
_this
=
$
(
this
);
var
_this
=
$
(
this
);
var
_tempVal
=
_this
.
closest
(
'tr'
).
attr
(
'data-groupname'
);
var
_tempVal
=
_this
.
closest
(
'tr'
).
attr
(
'data-groupname'
);
agent
.
agent_id
=
$
(
this
).
attr
(
"data-id"
);
agent
.
agent_id
=
$
(
this
).
attr
(
"data-id"
);
agent
.
getRole
(
_tempVal
);
agent
.
getRole
(
_tempVal
);
});
});
$
(
document
).
delegate
(
".submit_user"
,
"click"
,
function
()
{
//提交变更
$
(
document
).
delegate
(
".submit_user"
,
"click"
,
function
()
{
//提交变更
agent
.
Submit_user
();
agent
.
Submit_user
();
});
});
$
(
document
).
delegate
(
".is_show"
,
"click"
,
function
()
{
//点击禁用
$
(
document
).
delegate
(
".is_show"
,
"click"
,
function
()
{
//点击禁用
if
(
!
confirm
(
'是否继续?'
))
{
if
(
!
confirm
(
'是否继续?'
))
{
return
;
return
;
}
}
agent
.
id
=
$
(
this
).
attr
(
"data-id"
);
agent
.
id
=
$
(
this
).
attr
(
"data-id"
);
...
@@ -88,55 +88,63 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -88,55 +88,63 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
};
};
params
.
id
=
$
(
this
).
attr
(
"data-id"
);
params
.
id
=
$
(
this
).
attr
(
"data-id"
);
var
str
=
$
.
trim
(
$
(
this
).
html
());
var
str
=
$
.
trim
(
$
(
this
).
html
());
if
(
str
===
"正常"
)
{
if
(
str
===
"正常"
)
{
$
(
this
).
attr
(
'class'
,
'btn1 btn-default is_show'
);
$
(
this
).
attr
(
'class'
,
'btn1 btn-default is_show'
);
params
.
type
=
1
;
params
.
type
=
1
;
$
(
this
).
html
(
'冻结'
);
$
(
this
).
html
(
'冻结'
);
}
else
if
(
str
===
"冻结"
)
{
}
else
if
(
str
===
"冻结"
)
{
$
(
this
).
attr
(
'class'
,
'btn1 btn-info is_show'
);
$
(
this
).
attr
(
'class'
,
'btn1 btn-info is_show'
);
params
.
type
=
0
;
params
.
type
=
0
;
$
(
this
).
html
(
'正常'
);
$
(
this
).
html
(
'正常'
);
}
else
{
}
else
{
params
.
type
=
2
;
params
.
type
=
2
;
}
}
$
.
ajax
({
//禁用
$
.
ajax
({
//禁用
'type'
:
'POST'
,
'type'
:
'POST'
,
'url'
:
'/index/updateStatus'
,
'url'
:
'/index/updateStatus'
,
data
:
{
"ids"
:
agent
.
id
,
"status"
:
params
.
type
},
data
:
{
"ids"
:
agent
.
id
,
"status"
:
params
.
type
},
dataType
:
"json"
,
dataType
:
"json"
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
!=
200
)
{
if
(
data
.
code
!=
200
)
{
alert
(
"禁用失败!"
)
alert
(
"禁用失败!"
)
}
}
}
}
});
});
});
});
//手机绑定状态切换
//手机绑定状态切换
$
(
document
).
delegate
(
".is_show2"
,
"click"
,
function
()
{
//点击禁用
$
(
document
).
delegate
(
".is_show2"
,
"click"
,
function
()
{
//点击禁用
if
(
!
confirm
(
'是否继续?'
))
{
if
(
!
confirm
(
'是否继续?'
))
{
return
;
return
;
}
}
agent
.
id
=
$
(
this
).
attr
(
"data-id"
);
agent
.
id
=
$
(
this
).
attr
(
"data-id"
);
var
user_info_obj
=
JSON
.
parse
(
decodeURIComponent
(
sessionStorage
.
getItem
(
'pcUserInfo'
)));
//读取缓存
var
user_info_obj
=
JSON
.
parse
(
decodeURIComponent
(
sessionStorage
.
getItem
(
'pcUserInfo'
)));
//读取缓存
// console.log(user_info_obj);
// console.log(user_info_obj);
var
params
=
{
var
params
=
{
};
};
params
.
id
=
$
(
this
).
attr
(
"data-id"
);
params
.
id
=
$
(
this
).
attr
(
"data-id"
);
var
str
=
$
.
trim
(
$
(
this
).
html
());
var
str
=
$
.
trim
(
$
(
this
).
html
());
if
(
str
===
"允许"
)
{
if
(
str
===
"允许"
)
{
$
(
this
).
attr
(
'class'
,
'btn1 btn-default is_show2'
);
$
(
this
).
attr
(
'class'
,
'btn1 btn-default is_show2'
);
params
.
type
=
0
;
params
.
type
=
0
;
$
(
this
).
html
(
'解绑'
);
$
(
this
).
html
(
'解绑'
);
}
else
if
(
str
===
"解绑"
)
{
}
else
if
(
str
===
"解绑"
)
{
$
(
this
).
attr
(
'class'
,
'btn1 btn-info is_show2'
);
$
(
this
).
attr
(
'class'
,
'btn1 btn-info is_show2'
);
params
.
type
=
1
;
params
.
type
=
1
;
$
(
this
).
html
(
'允许'
);
$
(
this
).
html
(
'允许'
);
};
};
$
.
ajax
({
//禁用
$
.
ajax
({
//禁用
'type'
:
'POST'
,
'type'
:
'POST'
,
'url'
:
'/index/updateDevice'
,
'url'
:
'/index/updateDevice'
,
data
:
{
"agent_id"
:
agent
.
agent_id
,
"id"
:
params
.
id
,
"operator_id"
:
user_info_obj
.
id
,
"is_forbidden"
:
params
.
type
},
data
:
{
"agent_id"
:
agent
.
agent_id
,
"id"
:
params
.
id
,
"operator_id"
:
user_info_obj
.
id
,
"is_forbidden"
:
params
.
type
},
/* $params = array(
/* $params = array(
"agent_id" => 1,//解绑或者绑定的经纪人id
"agent_id" => 1,//解绑或者绑定的经纪人id
"id" => 1, //关系id
"id" => 1, //关系id
...
@@ -145,23 +153,26 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -145,23 +153,26 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
);*/
);*/
dataType
:
"json"
,
dataType
:
"json"
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
!=
200
)
{
if
(
data
.
code
!=
200
)
{
alert
(
"禁用失败!"
)
alert
(
"禁用失败!"
)
}
}
}
}
});
});
});
});
},
},
Submit_user
:
function
()
{
//提交变更的信息
Submit_user
:
function
()
{
//提交变更的信息
var
group_id
=
$
(
"#edit_role"
).
val
();
var
group_id
=
$
(
"#edit_role"
).
val
();
$
.
ajax
({
$
.
ajax
({
'type'
:
'POST'
,
'type'
:
'POST'
,
'url'
:
'/index/updateRole'
,
'url'
:
'/index/updateRole'
,
data
:
{
'ids'
:
agent
.
agent_id
,
'group_id'
:
group_id
},
data
:
{
'ids'
:
agent
.
agent_id
,
'group_id'
:
group_id
},
dataType
:
"json"
,
dataType
:
"json"
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
code
==
200
)
{
agent
.
getList
(
1
);
agent
.
getList
(
1
);
}
else
{
}
else
{
alert
(
"重复提交"
);
alert
(
"重复提交"
);
...
@@ -169,39 +180,41 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -169,39 +180,41 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}
}
});
});
},
},
Edit
:
function
()
{
//获取
Edit
:
function
()
{
//获取
$
.
ajax
({
$
.
ajax
({
'type'
:
'GET'
,
'type'
:
'GET'
,
'url'
:
'/index/saveAgent'
,
//获取编辑数据
'url'
:
'/index/saveAgent'
,
//获取编辑数据
data
:
{
"id"
:
agent
.
agent_id
},
data
:
{
"id"
:
agent
.
agent_id
},
dataType
:
"json"
,
dataType
:
"json"
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
if
(
data
.
data
)
{
$
(
"input[name = id]"
).
val
(
data
.
data
.
id
);
$
(
"input[name = id]"
).
val
(
data
.
data
.
id
);
$
(
"input[name = phone]"
).
val
(
data
.
data
.
phone
);
$
(
"input[name = phone]"
).
val
(
data
.
data
.
phone
);
$
(
"input[name = name]"
).
val
(
data
.
data
.
name
);
$
(
"input[name = name]"
).
val
(
data
.
data
.
name
);
$
(
"[name = district_id]"
).
val
(
data
.
data
.
district_id
);
$
(
"[name = district_id]"
).
val
(
data
.
data
.
district_id
);
if
(
data
.
data
.
district_id
)
{
if
(
data
.
data
.
district_id
)
{
agent
.
getDistrictStoreList
(
data
.
data
.
district_id
,
function
(
_data
)
{
agent
.
getDistrictStoreList
(
data
.
data
.
district_id
,
function
(
_data
)
{
// var _str = '';
// var _str = '';
var
_str
=
'<option value="0">全部</option>'
;
var
_str
=
'<option value="0">全部</option>'
;
$
.
each
(
_data
,
function
(
i
,
item
)
{
$
.
each
(
_data
,
function
(
i
,
item
)
{
_str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
store_name
+
'</option>'
;
_str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
store_name
+
'</option>'
;
});
});
$
(
"[name = store_id]"
).
html
(
_str
).
val
(
data
.
data
.
store_id
);
$
(
"[name = store_id]"
).
html
(
_str
).
val
(
data
.
data
.
store_id
);
});
});
}
else
{
}
else
{
}
}
$
(
"#remarks"
).
val
(
data
.
data
.
remarks
);
$
(
"#remarks"
).
val
(
data
.
data
.
remarks
);
$
(
"#password"
).
val
(
data
.
data
.
password
);
$
(
"#password"
).
val
(
data
.
data
.
password
);
$
(
"input[name='password']"
).
attr
(
'form-group'
);
$
(
"input[name='password']"
).
attr
(
'form-group'
);
if
(
data
.
data
.
sex
==
'0'
)
{
if
(
data
.
data
.
sex
==
'0'
)
{
$
(
"#sex0"
).
attr
(
'checked'
,
true
);
$
(
"#sex0"
).
attr
(
'checked'
,
true
);
}
else
if
(
data
.
data
.
sex
==
'1'
)
{
}
else
if
(
data
.
data
.
sex
==
'1'
)
{
$
(
"#sex1"
).
attr
(
'checked'
,
true
);
$
(
"#sex1"
).
attr
(
'checked'
,
true
);
}
else
{
}
else
{
$
(
"#sex2"
).
attr
(
'checked'
,
true
);
$
(
"#sex2"
).
attr
(
'checked'
,
true
);
...
@@ -215,7 +228,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -215,7 +228,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}
}
});
});
},
},
Submit_edit
:
function
()
{
Submit_edit
:
function
()
{
//提交编辑的信息
//提交编辑的信息
var
params
=
{}
var
params
=
{}
params
.
id
=
agent
.
agent_id
;
params
.
id
=
agent
.
agent_id
;
...
@@ -230,26 +243,24 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -230,26 +243,24 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
params
.
status
=
$
(
"#status"
).
val
();
params
.
status
=
$
(
"#status"
).
val
();
params
.
password
=
$
(
"input[name='password']"
).
val
();
params
.
password
=
$
(
"input[name='password']"
).
val
();
if
(
params
.
phone
==
''
)
{
if
(
params
.
phone
==
''
)
{
alert
(
'手机号必填!'
);
alert
(
'手机号必填!'
);
return
false
;
return
false
;
}
}
if
(
params
.
district_id
==
''
)
{
if
(
params
.
district_id
==
''
)
{
alert
(
'所属部门必填'
);
alert
(
'所属部门必填'
);
$
(
"#modal-edit"
).
show
();
$
(
"#modal-edit"
).
show
();
return
false
;
return
false
;
}
}
if
(
params
.
store_id
==
''
)
{
if
(
params
.
store_id
==
''
)
{
alert
(
'所属门店必填'
);
alert
(
'所属门店必填'
);
$
(
"#modal-edit"
).
show
();
$
(
"#modal-edit"
).
show
();
return
false
;
return
false
;
}
}
if
(
params
.
phone
.
length
!=
11
)
{
if
(
params
.
phone
.
length
!=
11
)
{
alert
(
'手机号码错误!'
);
alert
(
'手机号码错误!'
);
$
(
"#modal-edit"
).
show
();
$
(
"#modal-edit"
).
show
();
return
false
;
return
false
;
...
@@ -260,8 +271,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -260,8 +271,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
'url'
:
'/index/saveAgent'
,
'url'
:
'/index/saveAgent'
,
data
:
params
,
data
:
params
,
dataType
:
"json"
,
dataType
:
"json"
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
code
==
200
)
{
$
(
"#modal-edit"
).
modal
(
'hide'
);
$
(
"#modal-edit"
).
modal
(
'hide'
);
agent
.
getList
(
1
);
agent
.
getList
(
1
);
}
else
{
}
else
{
...
@@ -271,7 +282,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -271,7 +282,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
});
});
},
},
emptyInput
:
function
()
{
emptyInput
:
function
()
{
console
.
count
(
'emptyInput'
);
console
.
count
(
'emptyInput'
);
$
(
"input[name = name]"
).
val
(
''
);
$
(
"input[name = name]"
).
val
(
''
);
$
(
"input[name = phone]"
).
val
(
''
);
$
(
"input[name = phone]"
).
val
(
''
);
...
@@ -282,7 +293,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -282,7 +293,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
$
(
"#admin_off"
).
val
(
'0'
);
$
(
"#admin_off"
).
val
(
'0'
);
$
(
"#remarks"
).
val
(
''
);
$
(
"#remarks"
).
val
(
''
);
},
},
getList
:
function
(
pageNo
)
{
getList
:
function
(
pageNo
)
{
agent
.
pageNo
=
pageNo
;
agent
.
pageNo
=
pageNo
;
var
params
=
{};
var
params
=
{};
params
.
pageNo
=
agent
.
pageNo
;
params
.
pageNo
=
agent
.
pageNo
;
...
@@ -296,22 +307,32 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -296,22 +307,32 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
async
:
true
,
async
:
true
,
data
:
params
,
data
:
params
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
log
(
666
);
console
.
log
(
data
.
data
.
list
.
length
);
//获取对应的id
agent
.
idArray
=
new
Array
();
for
(
var
m
=
0
;
m
<
data
.
data
.
list
.
length
;
m
++
)
{
agent
.
idArray
[
m
]
=
data
.
data
.
list
[
m
].
id
;
}
// console.log(agent.idArray);
//获取对应的id
var
temp
=
document
.
getElementById
(
'agent_tpl'
).
innerHTML
;
var
temp
=
document
.
getElementById
(
'agent_tpl'
).
innerHTML
;
var
doTempl
=
doT
.
template
(
temp
);
var
doTempl
=
doT
.
template
(
temp
);
$
(
"#agentlist"
).
html
(
doTempl
(
data
.
data
.
list
));
$
(
"#agentlist"
).
html
(
doTempl
(
data
.
data
.
list
));
agent
.
getEvaluationList
(
);
agent
.
getEvaluationList
(
agent
.
idArray
);
/*分页代码*/
/*分页代码*/
add_page
(
data
.
data
.
total
,
pageNo
,
agent
.
pageSize
,
agent
.
getList
);
add_page
(
data
.
data
.
total
,
pageNo
,
agent
.
pageSize
,
agent
.
getList
);
$
(
'.J_preview'
).
preview
();
$
(
'.J_preview'
).
preview
();
}
}
})
});
},
},
//手机绑定权限
//手机绑定权限
getPhoneBindingList
:
function
(
pageNo
)
{
getPhoneBindingList
:
function
(
pageNo
)
{
var
params
=
{};
var
params
=
{};
params
.
agent_id
=
agent
.
agent_id
;
params
.
agent_id
=
agent
.
agent_id
;
console
.
log
(
agent
.
agent_id
);
console
.
log
(
agent
.
agent_id
);
$
.
ajax
({
$
.
ajax
({
url
:
'/index/deviceList'
,
url
:
'/index/deviceList'
,
...
@@ -319,30 +340,30 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -319,30 +340,30 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
async
:
true
,
async
:
true
,
data
:
params
,
data
:
params
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
var
temp
=
document
.
getElementById
(
'phone_binding_tpl'
).
innerHTML
;
var
temp
=
document
.
getElementById
(
'phone_binding_tpl'
).
innerHTML
;
var
doTempl
=
doT
.
template
(
temp
);
var
doTempl
=
doT
.
template
(
temp
);
$
(
"#agent_phone_binding"
).
html
(
doTempl
(
data
.
data
));
$
(
"#agent_phone_binding"
).
html
(
doTempl
(
data
.
data
));
/*分页代码*/
/*分页代码*/
add_page
(
data
.
data
.
total
,
pageNo
,
agent
.
pageSize
,
agent
.
getList
);
add_page
(
data
.
data
.
total
,
pageNo
,
agent
.
pageSize
,
agent
.
getList
);
$
(
'.J_preview'
).
preview
();
$
(
'.J_preview'
).
preview
();
}
}
})
})
},
},
getRole
:
function
(
tempval
)
{
getRole
:
function
(
tempval
)
{
$
.
ajax
({
$
.
ajax
({
url
:
'/index/getAuth2'
,
url
:
'/index/getAuth2'
,
type
:
'GET'
,
type
:
'GET'
,
data
:
{},
data
:
{},
async
:
true
,
async
:
true
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
var
User_add
=
""
;
var
User_add
=
""
;
var
_tempid
;
var
_tempid
;
$
.
each
(
data
.
data
.
list
,
function
(
i
,
item
)
{
$
.
each
(
data
.
data
.
list
,
function
(
i
,
item
)
{
User_add
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
title
+
'</option>'
;
User_add
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
title
+
'</option>'
;
if
(
item
.
title
==
tempval
)
{
if
(
item
.
title
==
tempval
)
{
_tempid
=
item
.
id
;
_tempid
=
item
.
id
;
console
.
log
(
item
.
id
);
console
.
log
(
item
.
id
);
};
};
...
@@ -353,18 +374,20 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -353,18 +374,20 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}
}
});
});
},
},
getDistrict
:
function
(
fn
)
{
getDistrict
:
function
(
fn
)
{
$
.
ajax
({
$
.
ajax
({
url
:
'/index/getDistrict'
,
url
:
'/index/getDistrict'
,
type
:
'GET'
,
type
:
'GET'
,
async
:
true
,
async
:
true
,
data
:
{
"pageSize"
:
1000
},
data
:
{
"pageSize"
:
1000
},
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
var
str
=
''
;
var
str
=
''
;
$
.
each
(
data
.
data
,
function
(
i
,
item
)
{
$
.
each
(
data
.
data
,
function
(
i
,
item
)
{
str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
district_name
+
'</option>'
;
str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
district_name
+
'</option>'
;
});
});
$
(
'[name=district_id]'
).
append
(
str
);
$
(
'[name=district_id]'
).
append
(
str
);
fn
&&
fn
();
fn
&&
fn
();
...
@@ -372,51 +395,48 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
...
@@ -372,51 +395,48 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}
}
});
});
},
},
getDistrictStoreList
:
function
(
id
,
fn
)
{
getDistrictStoreList
:
function
(
id
,
fn
)
{
$
.
ajax
({
$
.
ajax
({
url
:
'/index/getDistrictStoreList'
,
url
:
'/index/getDistrictStoreList'
,
type
:
'GET'
,
type
:
'GET'
,
async
:
true
,
async
:
true
,
data
:
{
data
:
{
'id'
:
id
,
'id'
:
id
,
"pageSize"
:
1000
"pageSize"
:
1000
},
},
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
fn
&&
fn
(
data
.
data
);
fn
&&
fn
(
data
.
data
);
}
}
}
}
});
});
},
},
getEvaluationList
:
function
(){
getEvaluationList
:
function
(
n
)
{
console
.
log
(
n
);
// var _data={};
// for(var i=0;i<n.length;i++){
// _data['agents_id['+i+']']=n[i];
// }
var
_data
=
{
'agents_id'
:
n
.
join
(
','
)
}
console
.
log
(
'经纪人列表加载完成'
);
console
.
log
(
'经纪人列表加载完成'
);
console
.
log
(
$
(
'.number-evaluation'
).
attr
(
"data-id"
));
$
.
ajax
({
var
_data
=
{
};
// var _imgUploadLunbo = $('#agentlist').find(tr).find(td).eq(6); //详情页轮播图ul
console
.
log
(
_imgUploadLunbo
);
// var _xiangqingPicObj = _imgUploadLunbo.find('li>img');
// var _urlCut = location.origin + '/resource/lib/Attachments/images/';//要截取的部分url
$
.
each
(
_imgUploadLunbo
,
function
(
i
,
item
)
{
_data
[
'agents_id['
+
i
+
']'
]
=
item
.
attr
(
"data-id"
);
});
// console.log(_data);
$
.
ajax
({
url
:
'/index/agentEvaluateNumAndFraction'
,
url
:
'/index/agentEvaluateNumAndFraction'
,
type
:
'GET'
,
type
:
'GET'
,
async
:
true
,
async
:
true
,
data
:
_data
,
data
:
_data
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
var
str
=
''
;
//
var str = '';
$
.
each
(
data
.
data
,
function
(
i
,
item
)
{
// $.each(data.data, function(i,
item) {
str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
district_name
+
'</option>'
;
// str += '<option value="' + item.id + '">' + item.district_name +
'</option>';
});
//
});
$
(
'[name=district_id]'
).
append
(
str
);
//
$('[name=district_id]').append(str);
fn
&&
fn
();
//
fn && fn();
}
}
}
}
});
});
...
...
Write
Preview
Markdown
is supported
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