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
e4dd6739
Commit
e4dd6739
authored
Jun 13, 2018
by
clone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test'
parents
4e86c667
f7fd99c7
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
254 additions
and
108 deletions
+254
-108
Client.php
application/api_broker/controller/Client.php
+3
-2
OrderLog.php
application/api_broker/controller/OrderLog.php
+1
-1
Agent.php
application/index/controller/Agent.php
+6
-4
Finance.php
application/index/controller/Finance.php
+9
-8
Member.php
application/index/controller/Member.php
+6
-0
Remark.php
application/index/controller/Remark.php
+0
-3
agent.html
application/index/view/agent/agent.html
+10
-2
users_list.html
application/index/view/member/users_list.html
+22
-12
index.html
application/index/view/store/index.html
+1
-2
OBargainModel.php
application/model/OBargainModel.php
+9
-4
agent.js
public/resource/js/agent.js
+94
-7
storeList.js
public/resource/js/storeList.js
+51
-33
user.js
public/resource/js/user.js
+42
-30
No files found.
application/api_broker/controller/Client.php
View file @
e4dd6739
...
...
@@ -277,9 +277,9 @@ class Client extends Basic
if
(
$search_type
==
'0'
)
{
//客户电话
$conditions
[
'user_phone'
]
=
[
'LIKE'
,
$phone_or_name
.
'%'
];
$conditions
[
'user_phone'
]
=
[
'LIKE'
,
'%'
.
$phone_or_name
.
'%'
];
}
elseif
(
$search_type
==
'1'
){
//客户
$conditions
[
'user_name'
]
=
[
'LIKE'
,
$phone_or_name
.
'%'
];
$conditions
[
'user_name'
]
=
[
'LIKE'
,
'%'
.
$phone_or_name
.
'%'
];
}
elseif
(
$search_type
==
'3'
){
//客户
$conditions
[
'id'
]
=
$phone_or_name
;
...
...
@@ -297,6 +297,7 @@ class Client extends Basic
}
}
$user
=
new
Users
();
$conditions
[
'status'
]
=
[
'<'
,
2
];
$user_res
=
$user
->
all_user
(
$conditions
,
$pagesize
,
$pagenum
);
$total
=
$user
->
all_user_count
(
$conditions
);
}
else
{
...
...
application/api_broker/controller/OrderLog.php
View file @
e4dd6739
...
...
@@ -538,7 +538,7 @@ class OrderLog extends Basic
}
$source
=
empty
(
$this
->
params
[
'source'
])
?
0
:
$this
->
params
[
'source'
];
$bargain
=
new
OBargainModel
();
$data
[
'data'
]
=
$bargain
->
addBargainCommission
(
$this
->
params
[
'id'
],
$this
->
user
Id
,
$this
->
params
[
'agent_id'
],
$data
[
'data'
]
=
$bargain
->
addBargainCommission
(
$this
->
params
[
'id'
],
$this
->
agent
Id
,
$this
->
params
[
'agent_id'
],
$this
->
params
[
'role'
],
$this
->
params
[
'scale_fee'
],
$this
->
params
[
'scale'
],
$source
);
if
(
$data
[
'data'
]
==
0
)
{
...
...
application/index/controller/Agent.php
View file @
e4dd6739
...
...
@@ -125,6 +125,10 @@ class Agent extends Basic
return
$this
->
response
(
101
,
'门店id为空!'
);
}
if
(
empty
(
$this
->
params
[
'district_id'
]))
{
return
$this
->
response
(
101
,
'部门id为空!'
);
}
$num
=
0
;
//判断重复手机号
//新增或者编辑数据
...
...
@@ -157,9 +161,7 @@ class Agent extends Basic
return
$this
->
response
(
101
,
'手机号重复'
);
}
$store
=
new
AStore
();
$data
[
'district_id'
]
=
$store
->
getStoreKeyById
(
'district_id'
,
[
'id'
=>
$this
->
params
[
'store_id'
]]);
$data
[
'district_id'
]
=
$this
->
params
[
'district_id'
];
$data
[
'name'
]
=
trim
(
$this
->
params
[
'name'
]);
$data
[
'store_id'
]
=
$this
->
params
[
'store_id'
];
$data
[
'phone'
]
=
trim
(
$this
->
params
[
'phone'
]);
...
...
@@ -174,7 +176,7 @@ class Agent extends Basic
}
}
else
{
//查看
$info
=
$m_agent
->
verifyUser
(
'id,name,phone,password,store_id,sex,admin_off,remarks'
,
''
,
[
'id'
=>
$id
]);
$info
=
$m_agent
->
verifyUser
(
'id,name,phone,password,
district_id,
store_id,sex,admin_off,remarks'
,
''
,
[
'id'
=>
$id
]);
return
$this
->
response
(
200
,
'查看'
,
$info
);
}
}
...
...
application/index/controller/Finance.php
View file @
e4dd6739
...
...
@@ -675,7 +675,7 @@ class Finance extends Basic
}
$m_bargain
=
new
OBargainModel
();
$bargain_data
=
$m_bargain
->
getCheckBargain
(
'
id,agent_id,
role'
,
$this
->
params
[
'bargain_id'
]);
$bargain_data
=
$m_bargain
->
getCheckBargain
(
'
a.id,a.agent_id,a.
role'
,
$this
->
params
[
'bargain_id'
]);
//排除成交报告其它状态
if
(
empty
(
$bargain_data
[
'id'
]))
{
...
...
@@ -686,7 +686,6 @@ class Finance extends Basic
$m_partial
=
new
OPartialCommission
();
$data
=
$this
->
params
[
"commission_date"
];
$add_arr
=
$update_arr
=
[];
$i
=
$j
=
0
;
foreach
(
$data
as
$item
)
{
...
...
@@ -810,7 +809,7 @@ class Finance extends Basic
}
$m_bargain
=
new
OBargainModel
();
$bargain_data
=
$m_bargain
->
getCheckBargain
(
'id'
,
$this
->
params
[
'bargain_id'
]);
$bargain_data
=
$m_bargain
->
getCheckBargain
(
'
a.
id'
,
$this
->
params
[
'bargain_id'
]);
//排除成交报告其它状态
if
(
empty
(
$bargain_data
[
'id'
]))
{
...
...
@@ -942,7 +941,7 @@ class Finance extends Basic
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$fields
=
'a.id,a.create_time,e.name,e.phone,a.fee,b.house_number,d.internal_address,
b
.agent_id,b.father_id,b.order_id'
;
$fields
=
'a.id,a.create_time,e.name,e.phone,a.fee,b.house_number,d.internal_address,
a
.agent_id,b.father_id,b.order_id'
;
$where
[
'c.is_del'
]
=
0
;
$where
[
'b.status'
]
=
[
'in'
,
10
,
11
];
//10已提交 11审核成功
...
...
@@ -1258,8 +1257,8 @@ class Finance extends Basic
}
//商铺地址
if
(
!
empty
(
$this
->
params
[
'
house
_address'
]))
{
$where
[
'a.step_content'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'
house
_address'
]
.
'%'
];
if
(
!
empty
(
$this
->
params
[
'
internal
_address'
]))
{
$where
[
'a.step_content'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'
internal
_address'
]
.
'%'
];
}
//经纪人名字
...
...
@@ -1294,9 +1293,11 @@ class Finance extends Basic
*/
public
function
editRecordLog
(
int
$bargain_id
,
string
$step_content
=
''
,
int
$type
=
1
,
string
$house_number
=
''
,
int
$is_open
=
0
)
{
if
(
empty
(
$house_number
))
{
$m_bargain
=
new
OBargainModel
();
$house_number
=
$m_bargain
->
getCheckBargain
(
'house_number'
,
(
int
)
$bargain_id
);
$house_number
=
$m_bargain
->
getCheckBargain
(
'a.house_number,c.internal_address'
,
(
int
)
$bargain_id
);
$step_content
.=
"[
{
$house_number
[
'internal_address'
]
}
]"
;
if
(
empty
(
$house_number
))
{
$house_number
=
$house_number
[
'house_number'
];
}
...
...
application/index/controller/Member.php
View file @
e4dd6739
...
...
@@ -228,6 +228,12 @@ class Member extends Basic{
$type
=
4
;
}
//客方手机号
if
(
!
empty
(
$params
[
'user_agent'
]))
{
$where
[
'b.phone'
]
=
$params
[
'user_agent'
];
$type
=
3
;
}
$fields
=
'a.id,a.user_nick,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.registration_time,a.user_name,a.last_login_ip,a.status'
;
$data
[
'list'
]
=
$this
->
user
->
getUserAgent
(
$pageNo
,
$pageSize
,
'a.id DESC'
,
$fields
,
$where
,
$type
);
$data
[
'total'
]
=
$this
->
user
->
getUserAgentTotal
(
$where
,
$type
);
...
...
application/index/controller/Remark.php
View file @
e4dd6739
...
...
@@ -41,9 +41,6 @@ class Remark extends Basic
$u_phone_follow
=
new
UPhoneFollowPp
();
$where
[
'e.store_name'
]
=
[
'NULL'
];
$where
[
'f.district_name'
]
=
[
'NULL'
];
if
(
!
empty
(
$this
->
params
[
'start_date'
])
&&
empty
(
$this
->
params
[
'end_date'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_date'
]
.
' 00:00:00'
];
}
...
...
application/index/view/agent/agent.html
View file @
e4dd6739
...
...
@@ -96,8 +96,16 @@
<input
type=
"text"
class=
"form-control btn6"
name=
"password"
id=
"password"
value=
"44444"
placeholder=
"填写密码"
>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
绑定门店ID:
</label>
<input
type=
"number"
class=
"form-control btn6"
name=
"store_id"
value=
""
placeholder=
"填写门店ID"
>
<label
class=
"col-sm-3 control-label"
>
所属部门:
</label>
<select
name=
"district_id"
class=
"form-control btn6"
>
<option
value=
""
>
选择所属部门
</option>
</select>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
所属门店:
</label>
<select
name=
"store_id"
class=
"form-control btn6"
>
</select>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
性别:
</label>
...
...
application/index/view/member/users_list.html
View file @
e4dd6739
...
...
@@ -156,7 +156,7 @@
<input
class=
"form-control btn2 margin-top-ld"
data-rule-phoneus=
"false"
data-rule-required=
"false"
name=
"phone"
placeholder=
"客户姓名或手机号"
type=
"text"
value=
""
>
<input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
name=
"invite_phone"
placeholder=
"邀请人(C端用户)手机号"
type=
"text"
value=
""
>
<input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
name=
"invite_agent_phone"
placeholder=
"邀请人(经纪人)手机号"
type=
"text"
value=
""
>
<!--业态选择-->
<select
class=
"form-control btn2 margin-top-ld"
name=
"industry_type"
>
...
...
@@ -199,30 +199,40 @@
<option
value=
"2"
>
否
</option>
<option
value=
"1"
>
是
</option>
</select>
<select
class=
"form-control btn2 margin-top-ld input"
name=
""
id=
"district_id"
placeholder=
""
title=
"
<select
class=
"form-control btn2 margin-top-ld"
name=
"public_status"
>
<option
value=
"2"
>
客户状态
</option>
<option
value=
"0"
>
求租
</option>
<option
value=
"1"
>
已租
</option>
<option
value=
"-1"
>
无效
</option>
</select>
<select
class=
"form-control btn2 margin-top-ld input"
name=
""
id=
"district_id"
title=
"
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项"
>
<option
value=
""
>
客方所属部门
</option>
</select>
<input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"guest_stores"
placeholder=
"客方所属门店"
type=
"text"
value=
""
title=
"
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项"
>
<select
class=
"form-control btn2 margin-top-ld input"
name=
""
id=
"guest_stores"
title=
"
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项"
value=
""
>
</select>
<input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
name=
"user_agent"
placeholder=
"客方手机号"
type=
"text"
value=
""
>
<!--邀请人-->
<select
class=
"form-control btn2 margin-top-ld input"
name=
""
id=
"district_id2"
placeholder=
""
title=
"
<select
class=
"form-control btn2 margin-top-ld input"
name=
""
id=
"district_id2"
title=
"
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项"
>
<option
value=
""
>
邀请人所属部门
</option>
</select>
<
input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"guest_stores2"
placeholder=
"邀请人所属门店"
type=
"text"
value=
"
"
title=
"
<
select
class=
"form-control btn2 margin-top-ld input"
name=
""
id=
"guest_stores2
"
title=
"
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项"
>
</select>
<input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
name=
"invite_agent_phone"
placeholder=
"邀请人(经纪人)手机号"
type=
"text"
value=
""
>
<!--<div class="clear"></div>-->
<!--<span class='left bottom'>(注:客方所属部门,客方所属门店与邀请人所属部门,邀请人所属门店不作为并列筛选项)</span>-->
<select
class=
"form-control btn2 margin-top-ld"
name=
"public_status"
>
<option
value=
"2"
>
客户状态
</option>
<option
value=
"0"
>
求租
</option>
<option
value=
"1"
>
已租
</option>
<option
value=
"-1"
>
无效
</option>
</select>
<div
class=
"clear"
></div>
...
...
application/index/view/store/index.html
View file @
e4dd6739
...
...
@@ -194,8 +194,7 @@
<select
name=
"qx-store"
class=
"form-control btn2"
id=
"qx-store"
>
<option
value=
""
selected=
"selected"
>
选择部门
</option>
</select>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"mend_name"
placeholder=
"门店名称"
type=
"text"
value=
""
>
<select
name=
"mend_name"
class=
"form-control btn2"
id=
"mend_name"
></select>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"name"
placeholder=
"店长姓名"
type=
"text"
value=
""
>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"phone"
placeholder=
"店长手机号"
type=
"text"
value=
""
>
<span
class=
"btn btn-default btn3"
id=
"search"
>
搜索
</span>
...
...
application/model/OBargainModel.php
View file @
e4dd6739
...
...
@@ -446,7 +446,8 @@ class OBargainModel extends Model
if
(
$data
[
'audit_level'
]
==
2
&&
$status
==
10
)
{
$update_data
[
'status'
]
=
13
;
$update_data
[
'account_statement'
]
=
1
;
$update_data
[
'account_time'
]
=
time
();
$update_data
[
'account_time'
]
=
date
(
'Y-m-d H:i:s'
);
$this
->
where
(
'id'
,
$bargain_data
[
'id'
])
->
whereOr
(
'father_id'
,
$bargain_data
[
'id'
])
->
update
(
$update_data
);
$this
->
save
(
$update_data
,
[
'id'
=>
$bargain_data
[
'id'
]
]);
}
else
{
$update_data
[
'status'
]
=
11
;
...
...
@@ -709,6 +710,7 @@ class OBargainModel extends Model
$insert_data
[
'account_statement'
]
=
$bargain_data
[
'account_statement'
];
$insert_data
[
'is_commission'
]
=
$bargain_data
[
'is_commission'
];
$insert_data
[
'content'
]
=
$bargain_data
[
'content'
];
$insert_data
[
'industry_type'
]
=
$bargain_data
[
'industry_type'
];
$result
=
$this
->
insert
(
$insert_data
);
if
(
$result
==
1
)
{
$this
->
commit
();
...
...
@@ -943,9 +945,11 @@ class OBargainModel extends Model
*/
public
function
getCheckBargain
(
string
$field
,
int
$id
)
{
return
$this
->
field
(
$field
)
->
where
(
'status'
,
'in'
,
'10,11'
)
->
where
(
'id'
,
$id
)
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_order b'
,
'a.order_id=b.id'
,
'left'
)
->
join
(
'g_houses c'
,
'b.house_id=c.id'
,
'left'
)
->
where
(
'a.status'
,
'in'
,
'10,11'
)
->
where
(
'a.id'
,
$id
)
->
find
();
}
}
\ No newline at end of file
public/resource/js/agent.js
View file @
e4dd6739
...
...
@@ -10,7 +10,25 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
agent
.
event
();
},
event
:
function
()
{
var
_doc
=
$
(
document
);
agent
.
getDistrict
(
function
(){
_doc
.
on
(
'input'
,
'[name=district_id]'
,
function
(){
var
_this
=
$
(
this
);
var
_id
=
_this
.
val
();
var
_objTemp
=
_this
.
parent
().
next
().
find
(
'select'
);
_objTemp
.
html
(
''
);
//先清空
if
(
_id
&&
_id
!=
'0'
){
agent
.
getDistrictStoreList
(
_id
,
function
(
_data
){
var
_str
=
''
;
$
.
each
(
_data
,
function
(
i
,
item
)
{
_str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
store_name
+
'</option>'
;
});
_objTemp
.
html
(
_str
);
});
}
else
{
};
});
})
$
(
'#search'
).
click
(
function
(
pageNo
)
{
agent
.
getList
(
1
);
});
...
...
@@ -23,6 +41,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
$
(
"#title"
).
html
(
"新增经纪人"
);
$
(
"#password"
).
parent
().
addClass
(
'hide'
);
//新增不显示密码
$
(
".form-horizontal"
)[
0
].
reset
();
//重置表单
agent
.
emptyInput
();
//清空表单
});
$
(
document
).
delegate
(
".edit"
,
"click"
,
function
()
{
//点击编辑
...
...
@@ -31,6 +50,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
agent
.
agent_id
=
$
(
this
).
attr
(
"data-id"
);
$
(
"#password"
).
parent
().
removeClass
(
'hide'
);
//编辑显示密码
$
(
"#password"
).
attr
(
'type'
,
'text'
);
agent
.
emptyInput
();
//清空表单
agent
.
Edit
();
});
...
...
@@ -112,16 +132,26 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
){
$
(
"input[name = id]"
).
val
(
data
.
data
.
id
);
$
(
"input[name = phone]"
).
val
(
data
.
data
.
phone
);
$
(
"input[name = name]"
).
val
(
data
.
data
.
name
);
$
(
"input[name = store_id]"
).
val
(
data
.
data
.
store_id
);
$
(
"#admin_off"
).
val
(
data
.
data
.
admin_off
);
$
(
"[name = district_id]"
).
val
(
data
.
data
.
district_id
);
if
(
data
.
data
.
district_id
){
agent
.
getDistrictStoreList
(
data
.
data
.
district_id
,
function
(
_data
){
var
_str
=
''
;
$
.
each
(
_data
,
function
(
i
,
item
)
{
_str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
store_name
+
'</option>'
;
});
$
(
"[name = store_id]"
).
html
(
_str
).
val
(
data
.
data
.
store_id
);
});
}
else
{
}
$
(
"#remarks"
).
val
(
data
.
data
.
remarks
);
$
(
"#password"
).
val
(
data
.
data
.
password
);
$
(
"input[name='password']"
).
attr
(
'form-group'
);
// store.getDistrict(data.data.district_name);
if
(
data
.
data
.
sex
==
'0'
)
{
$
(
"#sex0"
).
attr
(
'checked'
,
true
);
}
else
if
(
data
.
data
.
sex
==
'1'
)
{
...
...
@@ -129,6 +159,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
}
else
{
$
(
"#sex2"
).
attr
(
'checked'
,
true
);
}
}
}
else
{
alert
(
'获取经纪人数据失败'
);
}
...
...
@@ -142,7 +174,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
params
.
id
=
agent
.
agent_id
;
params
.
name
=
$
(
"input[name = name]"
).
val
();
params
.
password
=
$
(
"#password"
).
val
();
params
.
store_id
=
$
(
"input[name = store_id]"
).
val
();
params
.
district_id
=
$
(
"[name = district_id]"
).
val
();
params
.
store_id
=
$
(
"[name = store_id]"
).
val
();
params
.
phone
=
$
(
"input[name = phone]"
).
val
();
params
.
admin_off
=
$
(
"#admin_off"
).
val
();
params
.
sex
=
$
(
"input[name =sex]:checked"
).
val
();
...
...
@@ -156,8 +189,15 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
return
false
;
}
if
(
params
.
district_id
==
''
)
{
alert
(
'所属部门必填'
);
$
(
"#modal-edit"
).
show
();
return
false
;
}
if
(
params
.
store_id
==
''
)
{
alert
(
'
绑定门店ID
必填'
);
alert
(
'
所属门店
必填'
);
$
(
"#modal-edit"
).
show
();
return
false
;
}
...
...
@@ -184,6 +224,17 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
});
},
emptyInput
:
function
(){
console
.
count
(
'emptyInput'
);
$
(
"input[name = name]"
).
val
(
''
);
$
(
"input[name = phone]"
).
val
(
''
);
$
(
"#password"
).
val
(
''
);
$
(
"[name = district_id]"
).
val
(
''
);
$
(
"[name = store_id]"
).
html
(
''
);
$
(
"input[name =sex]"
).
val
(
'0'
);
$
(
"#admin_off"
).
val
(
'0'
);
$
(
"#remarks"
).
val
(
''
);
},
getList
:
function
(
pageNo
)
{
agent
.
pageNo
=
pageNo
;
var
params
=
{};
...
...
@@ -229,6 +280,42 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
}
});
},
getDistrict
:
function
(
fn
)
{
$
.
ajax
({
url
:
'/index/getDistrict'
,
type
:
'GET'
,
async
:
true
,
data
:
{
"pageSize"
:
1000
},
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
var
str
=
''
;
$
.
each
(
data
.
data
,
function
(
i
,
item
)
{
str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
district_name
+
'</option>'
;
});
$
(
'[name=district_id]'
).
append
(
str
);
fn
&&
fn
();
}
}
});
},
getDistrictStoreList
:
function
(
id
,
fn
){
$
.
ajax
({
url
:
'/index/getDistrictStoreList'
,
type
:
'GET'
,
async
:
true
,
data
:
{
'id'
:
id
,
"pageSize"
:
1000
},
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
fn
&&
fn
(
data
.
data
);
}
}
});
}
};
return
agent
;
...
...
public/resource/js/storeList.js
View file @
e4dd6739
...
...
@@ -21,16 +21,37 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
$
(
"body"
).
append
(
template
);
store
.
getList
();
store
.
event
();
store
.
getRegionsDisc
();
store
.
getDistrict
();
},
event
:
function
()
{
var
_doc
=
$
(
document
);
$
(
"#search"
).
click
(
function
()
{
store
.
getList
(
1
);
});
$
(
"#reset"
).
click
(
function
()
{
//重置
document
.
getElementById
(
"form_search"
).
reset
();
$
(
'#mend_name'
).
html
(
''
);
});
store
.
getDistrict
({
'type'
:
1
},
function
(){
_doc
.
on
(
'input'
,
'#qx-store'
,
function
(){
var
_this
=
$
(
this
);
var
_id
=
_this
.
val
();
_this
.
next
().
html
(
''
);
//先清空
if
(
_id
&&
_id
!=
'0'
){
store
.
getDistrictStoreList
(
_id
,
function
(
_data
){
var
_str
=
''
;
$
.
each
(
_data
,
function
(
i
,
item
)
{
_str
+=
'<option value="'
+
item
.
store_name
+
'">'
+
item
.
store_name
+
'</option>'
;
});
_this
.
next
().
html
(
_str
);
});
}
else
{
};
});
});
$
(
document
).
delegate
(
".del_modal"
,
"click"
,
function
()
{
...
...
@@ -67,7 +88,6 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
$
(
document
).
delegate
(
".add"
,
"click"
,
function
()
{
//list2消失
document
.
getElementById
(
'form_id'
).
reset
();
store
.
getDistrict
();
});
/************************************************百度地址定位相关*************************************************************/
...
...
@@ -185,29 +205,6 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
/************************************************百度地址定位相关****结束*************************************************************/
},
getRegionsDisc
:
function
(
name
)
{
var
params
=
{};
params
.
parent_code
=
310100
;
$
.
ajax
({
url
:
'/index/regions'
,
type
:
'GET'
,
async
:
true
,
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
var
_html
=
''
;
$
.
each
(
data
.
data
,
function
(
i
,
n
)
{
_html
+=
'<option value="'
+
n
.
fullName
+
'">'
+
n
.
fullName
+
'</option>'
;
});
$
(
"#area"
).
append
(
_html
);
}
else
{
alert
(
'请求省市区错误'
);
}
}
});
},
Edit
:
function
(){
//获取编辑的数据
$
.
ajax
({
'type'
:
'GET'
,
...
...
@@ -229,7 +226,10 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
$
(
"#latitude"
).
val
(
data
.
data
.
latitude
)
//经纬度
store
.
agents_id
=
data
.
data
.
agents_id
;
//经纪人id
store
.
district_id
=
data
.
data
.
district_id
;
//部门id
store
.
getDistrict
(
data
.
data
.
district_name
);
store
.
getDistrict
({
'type'
:
2
,
'name'
:
data
.
data
.
district_name
});
}
else
{
alert
(
'获取失败!'
);
...
...
@@ -350,7 +350,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
}
});
},
getDistrict
:
function
(
name
)
{
getDistrict
:
function
(
obj
,
fn
)
{
$
.
ajax
({
url
:
'/index/getDistrictListByName'
,
type
:
'GET'
,
...
...
@@ -359,24 +359,42 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
var
_html
=
'
<option value="" selected="selected">请选择</option>
'
;
var
_html
=
''
;
$
.
each
(
data
.
data
,
function
(
i
,
n
)
{
if
(
n
.
district_name
==
name
&&
(
typeof
name
!=
undefined
)
)
{
if
(
obj
.
type
==
'2'
&&
n
.
district_name
==
obj
.
name
)
{
_html
+=
'<option selected="selected" value="'
+
n
.
id
+
'">'
+
n
.
district_name
+
'</option>'
;
}
else
{
_html
+=
'<option value="'
+
n
.
id
+
'">'
+
n
.
district_name
+
'</option>'
;
}
});
if
(
obj
.
type
==
'2'
){
$
(
"#ss-store"
).
html
(
_html
);
}
else
if
(
obj
.
type
==
'1'
){
$
(
"#qx-store"
).
append
(
_html
);
// $("#qx-store").html(_html);
}
else
{}
fn
&&
fn
();
}
else
{
alert
(
'获取部门信息失败'
);
}
}
});
},
getDistrictStoreList
:
function
(
id
,
fn
){
$
.
ajax
({
url
:
'/index/getDistrictStoreList'
,
type
:
'GET'
,
async
:
true
,
data
:
{
'id'
:
id
,
"pageSize"
:
1000
},
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
fn
&&
fn
(
data
.
data
);
}
}
});
}
};
return
store
;
...
...
public/resource/js/user.js
View file @
e4dd6739
...
...
@@ -11,8 +11,6 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
$
(
"body"
).
append
(
template
);
user
.
getList
();
user
.
event
();
user
.
getDistrict
();
user
.
getDistricttwo
();
//时间控件初始化
/* $('#datetimepicker').datetimepicker({
format: 'yyyy-MM-dd',
...
...
@@ -24,6 +22,23 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
},
event
:
function
()
{
var
_doc
=
$
(
document
);
user
.
getDistrict
(
function
(){
_doc
.
on
(
'input'
,
'#district_id, #district_id2'
,
function
(){
var
_this
=
$
(
this
);
var
_id
=
_this
.
val
();
_this
.
next
().
html
(
''
);
//先清空
if
(
_id
&&
_id
!=
'0'
){
user
.
getDistrictStoreList
(
_id
,
function
(
_data
){
var
_str
=
''
;
$
.
each
(
_data
,
function
(
i
,
item
)
{
_str
+=
'<option value="'
+
item
.
store_name
+
'">'
+
item
.
store_name
+
'</option>'
;
});
_this
.
next
().
html
(
_str
);
});
}
else
{
};
});
});
$
(
".Bannertu"
).
click
(
function
()
{
BrowseServer
(
'cover_image'
);
});
...
...
@@ -33,6 +48,8 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
$
(
"#reset"
).
click
(
function
()
{
document
.
getElementById
(
"form_search"
).
reset
();
$
(
'#guest_stores'
).
html
(
''
);
$
(
'#guest_stores2'
).
html
(
''
);
});
...
...
@@ -174,6 +191,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
});
// ===================
},
addphone
:
function
(
obj
){
var
user_ht
=
$
(
obj
).
html
();
...
...
@@ -377,15 +395,14 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
getList
:
function
(
pageNo
)
{
user
.
pageNo
=
pageNo
;
var
params
=
{};
console
.
log
(
$
(
"#start_date"
).
val
());
if
(
$
(
"#district_id"
).
val
()
!=
0
||
$
(
"#guest_stores"
).
val
()
!=
''
){
$
(
"#district_id2"
).
val
(
'0'
);
$
(
"#guest_stores2"
).
val
(
''
);
};
if
(
$
(
"#district_id2"
).
val
()
!=
0
||
$
(
"#guest_stores2"
).
val
()
!=
''
){
$
(
"#district_id1"
).
val
(
'0'
);
$
(
"#guest_stores1"
).
val
(
''
);
};
// if($("#district_id").val()!=0||$("#guest_stores").val()!=''){
// $("#district_id2").val('0');
// $("#guest_stores2").val('');
// };
// if($("#district_id2").val()!=0||$("#guest_stores2").val()!=''){
// $("#district_id1").val('0');
// $("#guest_stores1").val('');
// };
// 输入 name
// params.name = $("input[name='user']").val();
params
.
phone
=
$
(
"input[name='phone']"
).
val
();
...
...
@@ -408,6 +425,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
params
.
activate
=
$
(
"select[name=activate]"
).
val
();
params
.
pageNo
=
user
.
pageNo
;
params
.
pageSize
=
user
.
pageSize
;
params
.
user_agent
=
$
(
"input[name='user_agent']"
).
val
();
params
.
invite_agent_phone
=
$
(
"input[name='invite_agent_phone']"
).
val
();
params
.
area_type
=
$
(
"select[name=area_type]"
).
val
();
params
.
price_type
=
$
(
"select[name=price_type]"
).
val
();
...
...
@@ -430,11 +448,6 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
/*分页代码*/
add_page
(
data
.
data
.
total
,
pageNo
,
user
.
pageSize
,
user
.
getList
);
$
(
"#total_page"
).
html
(
data
.
data
.
total
);
console
.
log
(
data
.
data
.
total
);
console
.
log
(
user
.
pageSize
);
console
.
log
(
pageNo
);
}
});
},
...
...
@@ -520,40 +533,39 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
}
});
},
getDistrict
:
function
()
{
getDistrict
:
function
(
fn
)
{
$
.
ajax
({
url
:
'/index/getDistrict'
,
type
:
'GET'
,
async
:
true
,
data
:
{
"pageSize"
:
5
0
},
data
:
{
"pageSize"
:
100
0
},
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
var
str
=
'
<option value="0">客方所属部门</option>
'
;
var
str
=
''
;
$
.
each
(
data
.
data
,
function
(
i
,
item
)
{
str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
district_name
+
'</option>'
;
});
$
(
"#district_id"
).
html
(
str
);
$
(
"#district_id"
).
append
(
str
);
$
(
"#district_id2"
).
append
(
str
);
fn
&&
fn
();
}
}
});
},
getDistricttwo
:
function
()
{
getDistrictStoreList
:
function
(
id
,
fn
)
{
$
.
ajax
({
url
:
'/index/getDistrict'
,
url
:
'/index/getDistrict
StoreList
'
,
type
:
'GET'
,
async
:
true
,
data
:
{
"pageSize"
:
50
},
data
:
{
'id'
:
id
,
"pageSize"
:
1000
},
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
var
str
=
'<option value="0">邀请人所属部门</option>'
;
$
.
each
(
data
.
data
,
function
(
i
,
item
)
{
str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
district_name
+
'</option>'
;
});
$
(
"#district_id2"
).
html
(
str
);
fn
&&
fn
(
data
.
data
);
}
}
});
...
...
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