Commit 92e151c1 authored by 刘丹's avatar 刘丹

经纪人列表

parent 93b8cf68
This diff is collapsed.
......@@ -115,7 +115,7 @@
<div class="col-md-6">
<textarea name="remarks" id="remarks" class="form-control" length="120" rows="5"></textarea>
<p class="help-block"><i class="fa fa-info-circle color-info1"></i> 请填写个人说明</p> </div>
</div>
</div>
<div class="form-group item_status ">
<label for="status" class="col-md-2 control-label">状态</label>
<div class="col-md-4">
......
......@@ -2,6 +2,7 @@
<!--关联js元素-->
<input type="hidden" class="page-load" id="auth_rule_box" />
<!--关联js元素-->
<div class="box box-solid" style="min-height: 1426px; width: 1035px; float: left; margin-left: 20px;">
<div class="box-body">
......
......@@ -203,4 +203,10 @@ body{
.but7{
width: 100%!important;
float: left;
}
.fl{
float: right!important;
}
.margin-top-ld{
margin-top: 15px;
}
\ No newline at end of file
......@@ -189,4 +189,4 @@ a:hover{
.ld-Marheight{
margin-top: 7px;
margin-left: 7px;
}
\ No newline at end of file
}
......@@ -12,8 +12,135 @@ define (['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css','pagin
$('#search').click(function (pageNo) {
agent.getList(1);
});
$ (document).delegate (".edit", "click", function () {//点击编辑
agent.house_id = $ (this).attr ("data-id");
agent.Edit_add();
agent.Edit();
});
$ (document).delegate (".submit_edit", "click", function () {//提交编辑
agent.Submit_edit();
agent.getList();
});
$ (document).delegate (".edit_add", "click", function () {//新增
agent.Edit_add();
});
$ (document).delegate (".User_add", "click", function () {//点击变更
//var user_check=$("input[name=ids]").is(":checked");
agent.User_add();
});
$ (document).delegate (".submit_user", "click", function () {//提交变更
agent.Submit_user();
agent.getList();
});
},
Submit_user:function(){//提交变更的信息
var v='';
var _ids='';
$("input[name=ids]:checked").each(function (i) {
v+= ','+$(this).val();
_ids= v.substring(1);
})
var group_id=$("#User_add").val();
$.ajax({
'type': 'POST',
'url' : '/index/updateRole',
data:{'ids':_ids,'group_id':group_id},
dataType: "json",
success: function(data){
if(data.code==200){
}else{
alert("重复提交");
}
}
});
},
User_add:function(){//获取变更角色
$.ajax({
url: '/index/getAuth2',
type: 'GET',
async: true,
dataType: 'json',
success: function (data) {
var User_add="";
$.each(data.data.list,function(i,item){
User_add+='<option value="'+item.id+'">'+item.title+'</option>';
});
$("#User_add").html(User_add);
}
});
},
Edit_add:function(){
$.ajax({
url: '/index/getAuth2',
type: 'GET',
async: true,
dataType: 'json',
success: function (data) {
var temp=document.getElementById('get_auth_list').innerHTML;
var doTempl=doT.template(temp);
$("#auth_group_id").html(doTempl(data.data.list));//赋值
}
});
},
Edit:function(){//获取
$.ajax({
'type': 'GET',
'url' : '/index/saveAgent/group_id/',//获取编辑数据
data: {"id":agent.house_id},
dataType: "json",
success: function (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);
$("#remarks").val(data.data.remarks);
$("#status").val(data.data.status);
$("#auth_group_id").val(data.data.auth_group_id);
if(data.data.sex=='0'){
$("#sex0").attr('checked',true);
}else if(data.data.sex=='1'){
$("#sex1").attr('checked',true);
}else{
$("#sex2").attr('checked',true);
}
}
});
},
Submit_edit:function(){//提交编辑的信息
var par={}
par.id= agent.house_id;
par.name= $("input[name = name]").val();
par.store_id= $("input[name = store_id]").val();
par.phone= $("input[name = phone]").val();
if(par.phone==''){
alert('手机号必填!');
return false;
}
par.admin_off= $("#admin_off").val();
par.district_id=$('#district_id').val();
par.sex=$("input[name =sex]:checked").val();
par.remarks=$("#remarks").val();
par.auth_group_id=$("#auth_group_id").val();
par.status=$("#status").val();
$.ajax({
'type': 'POST',
'url' : '/index/saveAgent',
data:par,
dataType: "json",
success: function(data){
if(data.code==200){
}else{
alert(data.msg);
}
}
});
},
getList:function(pageNo){
agent.pageNo =pageNo;
var params ={};
......
......@@ -2,12 +2,22 @@
[% if(it) { %]
[% for(var item in it){ %]
<tr>
<td><div class="icheckbox_minimal-blue" style="" aria-checked="false" aria-disabled="false">
<!--<input type="checkbox" name="ids[]" value="1" class="ids" style="">-->
</div>
<td>
<input type="checkbox" name="ids" value="[%= it[item]['id'] %]" >
</td>
<td>[%= it[item]["id"] %]</td>
<td><img src="./index/[%= it[item]['img'] %]" alt=""></td>
<td>
[% if(it[item]["level"] == 10) { %]
经纪人
[% }else if(it[item]["level"] == 20) { %]
店长
[% }else if(it[item]["level"] == 30) { %]
总监
[% }else{ %]
总监和店长
[% } %]
</td>
<td>[%= it[item]["name"] %]</td>
<td>[%= it[item]["phone"] %]</td>
<td>[%= it[item]["store_name"] %]</td>
......@@ -16,8 +26,8 @@
<td>[%= it[item]["status"] %]</td>
<!--<td><span class="fa fa-check text-success"></span></td>-->
<td>
<a style="margin-right:6px;" href="/index/saveAgentIndex.html?id=[%= it[item]['id'] %]" class="btn btn-primary btn-xs" title="编辑">编辑</a>
<a style="margin-right:6px;" href="" class="btn btn-warning btn-xs ajax-get confirm" title="禁用">禁用</a>
<a class="btn1 btn-success edit" href="#modal-edit" data-toggle="modal" data-id='[%= it[item]["id"] %]'>编辑</a>
<a style="margin-right:6px;" href="" class="btn btn-warning btn-xs ajax-get confirm" title="禁用">禁用</a>
</td>
</tr>
[% } %]
......@@ -26,4 +36,17 @@
<td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
<!--经纪人列表模板-->
<script id="get_auth_list" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<option value="[%= it[item]['id'] %]">[%= it[item]["title"] %]</option>
[% } %]
[% } %]
</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