Commit da49e5ec authored by 刘丹's avatar 刘丹

经纪人列表

parent 377e6b5f
{layout name="global/frame_tpl" /} {layout name="global/frame_tpl" /}
<body> <!--商铺标签页面-->
3453 <input type="hidden" class="page-load" id="label" />
</body> <div id="page-content-wrapper">
</html> <div class="container">
\ No newline at end of file <div class="row">
<div class="col-lg-10 col-lg-offset-0">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li><a href="#">商铺标签</a></li>
<li class="active">新增</li>
<div class="pull-right">
<ul class="bread_btn">
<li>
<a href="#modal-edit" data-toggle="modal" class="btn btn-default edit_add"><i class="icon-plus"></i>
新增</a>
</li>
</ul>
</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed text-center">
<thead>
<tr>
<th class="text-center">标签ID</th>
<th class="text-center">标签名称</th>
<th class="text-center">新增时间</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody id="label_list">
</tbody>
</table>
</div>
<!-- /#page-content-wrapper//分页 -->
<div class="text-right pageinfo" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--编辑-->
<div class="modal fade" id="modal-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
角色信息
</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-3 control-label">新增标签:</label>
<input class="form-control btn6" data-rule-buga="false" data-rule-required="true" name="title" placeholder="不能多于5个字" type="text" value="" id="title">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary submit_edit" data-dismiss="modal">
提交
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
...@@ -303,7 +303,7 @@ ...@@ -303,7 +303,7 @@
× ×
</button> </button>
<h4 class="modal-title"> <h4 class="modal-title">
门店列表 门店绑定的经纪人
</h4> </h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
......
define (['doT', 'text!temp/label_template_tpl.html', 'css!style/home.css','pagination','bootstrapJs'], function (doT, template) {
label = {
pageNo: 1, /*第几页*/
pageSize: 10, /*每页显示多少条*/
pageNum:10,
init: function () {
//初始化dot
$ ("body").append (template);
label.getList ();
label.event ();
},
event: function () {
$ (document).delegate (".edit", "click", function () {//点击编辑
label.house_id = $ (this).attr ("data-id");
label.Edit();
});
$ (document).delegate (".submit_edit", "click", function () {//提交编辑
label.Submit_edit();
label.getList();
});
},
Edit:function(){//获取
$.ajax({
'type': 'GET',
'url' : '/index/labelEdit',//获取编辑数据
data: {"id":label.house_id},
dataType: "json",
success: function(data){
if (data.data) {
$("input[name = title]").val(data.data.name);
}
else {
alert('获取失败!');
}
}
});
},
Submit_edit:function(){//提交编辑的信息
var par={};
par.id= label.house_id;
par.name=$("input[name =title]").val();
par.type="0";
$.ajax({
'type': 'POST',
'url' : '/index/labelEdit',
data:par,
dataType: "json",
success: function(data){
if(data.code==200){
}else{
alert(data.msg);
}
}
});
},
getList: function (pageNo) {
label.pageNo = pageNo;
var params = {};
params.pageNo = label.pageNo;
params.pageSize = label.pageSize;
$.ajax ({
url: '/index/getLabelsList',//列表数据
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function (data) {
var temp = document.getElementById ('label_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#label_list").html (doTtmpl (data.data.list));
/*分页代码*/
$ ("#pagediv").pagination ({
length: data.data.total,
current: pageNo,
every: label.pageSize,
onClick: function (el) {
label.getList (el.num.current);
}
});
}
});
}
};
return label;
});
\ No newline at end of file
...@@ -252,14 +252,14 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -252,14 +252,14 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
var mend_table=""; var mend_table="";
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
'url' : '/index/getDistrictStoreList',//门店 'url' : '/index/getBrokerList',//门店
data: {"id":district.house_id}, data: {"store_id":store.house_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) {
$.each(data.data,function(i,item){ $.each(data.data,function(i,item){
mend_table+='<tr><td>'+item.create_time+'</td> <td>'+item.id+'</td> <td>'+item.store_name+'</td><td>'+item.agents_name+'</td> <td>'+item.agents_total+'</td></tr>' mend_table+='<tr><td>'+item.create_time+'</td> <td>'+item.id+'</td> <td>'+item.name+'</td><td>'+item.phone+'</td> </tr>'
}) })
$("#mend_table").html(mend_table); $("#mend_table").html(mend_table);
} }
......
<script id="label_list_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr>
<td>[%= it[item]["id"] %]</td>
<td>[%= it[item]["name"] %]</td>
<td>[%= it[item]["create_time"] %]</td>
<td>
<a class="btn1 btn-success edit" href="#modal-edit" data-toggle="modal" data-id='[%= it[item]["id"] %]'>编辑</a>
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment