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
0d3f31e4
Commit
0d3f31e4
authored
Jul 19, 2019
by
agping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解绑 新增门店
parent
067d01fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
11 deletions
+69
-11
costOffice.html
application/index/view/cost/costOffice.html
+3
-3
costOffice.js
public/resource/js/costOffice.js
+66
-8
No files found.
application/index/view/cost/costOffice.html
View file @
0d3f31e4
...
...
@@ -438,7 +438,7 @@
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<a
class=
"btn btn-info"
href=
"#modal_addStore"
data-toggle=
"modal"
>
新增门店
</a>
<a
class=
"btn btn-info
newStore
"
href=
"#modal_addStore"
data-toggle=
"modal"
>
新增门店
</a>
</div>
</div>
<!-- /.modal-content -->
...
...
@@ -460,7 +460,7 @@
</div>
<div
class=
"modal-body modal-body-one"
>
<br>
<input
class=
"form-control ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"comit_name"
placeholder=
"请输入门店名称进行搜索"
type=
"text"
value=
""
style=
"width:
2
00px;"
>
<input
class=
"form-control ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"comit_name"
placeholder=
"请输入门店名称进行搜索"
type=
"text"
value=
""
style=
"width:
3
00px;"
>
<ul
class=
"user-ul"
style=
"display:none"
></ul>
<br><br><br>
...
...
@@ -468,7 +468,7 @@
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary"
id=
"
add
Store"
data-dismiss=
"modal"
>
<button
type=
"button"
class=
"btn btn-primary"
id=
"
save
Store"
data-dismiss=
"modal"
>
确定
</button>
</div>
...
...
public/resource/js/costOffice.js
View file @
0d3f31e4
...
...
@@ -6,6 +6,8 @@ define(['doT', 'text!temp/cost_office_template_tpl.html','text!temp/storeBinding
/*每页显示多少条*/
id
:
''
,
isAdd
:
0
,
agent_id_phone
:
''
,
store_id
:
''
,
init
:
function
()
{
//初始化dot
$
(
document
.
body
).
append
(
template
+
template1
);
...
...
@@ -52,12 +54,28 @@ define(['doT', 'text!temp/cost_office_template_tpl.html','text!temp/storeBinding
cost
.
id
=
$
(
this
).
attr
(
'data-id'
)
that
.
storeList
();
});
//点击li 列表消失
$
(
document
).
delegate
(
".addphone"
,
"click"
,
function
()
{
//list消失新增客户 点击li事件 获取id ul消失
//点击新增门店 置空数据
$
(
document
).
delegate
(
".newStore"
,
"click"
,
function
()
{
cost
.
agent_id_phone
=
''
;
$
(
"#comit_name"
).
val
(
''
);
});
//点击保存新增门店
$
(
document
).
delegate
(
"#saveStore"
,
"click"
,
function
()
{
that
.
saveStore
();
});
//解绑门店
$
(
document
).
delegate
(
".is_jiebang"
,
"click"
,
function
()
{
cost
.
store_id
=
$
(
this
).
attr
(
'data-id'
);
that
.
delStore
();
});
//点击li 门店列表消失
$
(
document
).
delegate
(
".addphone"
,
"click"
,
function
()
{
that
.
addphone
(
this
);
});
//分佣方 姓名下拉式
//搜索门店名字
$
(
document
).
on
(
"input"
,
"#comit_name"
,
function
()
{
//手机号新增搜索客方
if
(
$
(
"#comit_name"
).
val
()
==
''
)
{
that
.
agent_id_phone
=
''
;
...
...
@@ -153,6 +171,47 @@ define(['doT', 'text!temp/cost_office_template_tpl.html','text!temp/storeBinding
}
})
},
//新增门店
saveStore
:
function
()
{
var
params
=
{};
params
.
store_id
=
cost
.
agent_id_phone
;
params
.
office_id
=
cost
.
id
;
$
.
ajax
({
url
:
'/index/bindStore'
,
type
:
'POST'
,
async
:
true
,
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
){
// $('.modal').modal("hide");
cost
.
storeList
();
}
alert
(
data
.
msg
)
}
})
},
//解绑门店
delStore
:
function
()
{
var
params
=
{};
params
.
store_id
=
cost
.
store_id
;
params
.
office_id
=
0
;
$
.
ajax
({
url
:
'/index/bindStore'
,
type
:
'POST'
,
async
:
true
,
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
){
// $('.modal').modal("hide");
cost
.
storeList
();
}
alert
(
data
.
msg
)
}
})
},
//获取列表
getList
:
function
(
no
){
var
that
=
cost
;
...
...
@@ -198,7 +257,7 @@ define(['doT', 'text!temp/cost_office_template_tpl.html','text!temp/storeBinding
if
(
data
.
code
==
200
)
{
var
user_ul
=
""
;
$
.
each
(
data
.
data
,
function
(
i
,
item
)
{
user_ul
+=
'<li class="addphone" data-id="'
+
item
.
id
+
'">'
+
item
.
id
+
'-'
+
item
.
name
+
'-'
+
item
.
phone
+
status
+
'</li>'
;
user_ul
+=
'<li class="addphone" data-id="'
+
item
.
id
+
'">'
+
item
.
store_name
+
',门店ID:'
+
item
.
id
+
'</li>'
;
});
$
(
".user-ul"
).
html
(
user_ul
);
$
(
".user-ul"
).
show
();
...
...
@@ -212,9 +271,8 @@ define(['doT', 'text!temp/cost_office_template_tpl.html','text!temp/storeBinding
//将li里的值 赋给input(分佣方姓名)
addphone
:
function
(
obj
)
{
//新增客户 input赋值
var
that
=
cost
;
var
user_ht
=
$
(
obj
).
html
()
+
''
;
var
user_ht_str
=
user_ht
.
substring
(
0
,
user_ht
.
length
-
3
);
$
(
"#comit_name"
).
val
(
user_ht_str
);
var
user_ht
=
$
(
obj
).
html
()
$
(
"#comit_name"
).
val
(
user_ht
);
$
(
".user-ul"
).
html
(
''
);
$
(
".user-ul"
).
hide
();
that
.
agent_id_phone
=
$
(
obj
).
attr
(
"data-id"
);
...
...
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