Commit 7e822032 authored by agping's avatar agping

修改

parent 7ce0c3b9
...@@ -255,11 +255,45 @@ ...@@ -255,11 +255,45 @@
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭 </div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!--绑定电脑-->
<div class="modal fade" id="modal-pcbundling" 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> </button>
<button type="button" class="btn btn-primary submit_user" data-dismiss="modal"> <h4 class="modal-title">
提交 绑定电脑
</button>--> </h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<th>绑定电脑</th>
<th>请求时间</th>
<th>电脑绑定状态</th>
</tr>
</thead>
<tbody id='agent_pc_binding'>
</tbody>
</table>
</div>
</form>
</div>
<div class="modal-footer">
</div> </div>
</div> </div>
<!-- /.modal-content --> <!-- /.modal-content -->
......
...@@ -16,10 +16,13 @@ ...@@ -16,10 +16,13 @@
<span>[</span> <span>[</span>
<span class="story_font_span2">{{deal_time}}</span> <span class="story_font_span2">{{deal_time}}</span>
<span>]</span> <span>]</span>
<span class="story_font_span2">成功下定</span>
</div> </div>
<div class="story_font2"> <div class="story_font2 story_font2_width">
<span class="story_font_span3">{{deal_type}}</span> <!--<span class="story_font_span3">{{deal_type}}</span>-->
<!--<span class="story_font_span3">成功下定</span>-->
<span class="story_font_span4">{{deal_shop}}</span> <span class="story_font_span4">{{deal_shop}}</span>
<span class="story_font_span5">商铺一套!</span> <span class="story_font_span5">商铺一套!</span>
</div> </div>
...@@ -136,6 +139,8 @@ ...@@ -136,6 +139,8 @@
responseType: 'json', responseType: 'json',
data: { data: {
'id': _this.feed_id, 'id': _this.feed_id,
'type': 1
} }
}) })
.then(function(response) { .then(function(response) {
...@@ -240,11 +245,10 @@ ...@@ -240,11 +245,10 @@
} }
.chengjiaojiandan_pic { .chengjiaojiandan_pic {
width: 4.7rem; width: 5.2rem;
height: 0.5rem;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
margin-top: 0.46rem; margin-top: 0.80rem;
} }
.story_font { .story_font {
...@@ -263,7 +267,7 @@ ...@@ -263,7 +267,7 @@
} }
.story_font_span2 { .story_font_span2 {
font-style: oblique; /*font-style: oblique;*/
} }
.story_font_span3 { .story_font_span3 {
...@@ -273,36 +277,38 @@ ...@@ -273,36 +277,38 @@
} }
.story_font_span5 { .story_font_span5 {
float: left; /*float: left;*/
line-height: 0.88rem; line-height: 0.88rem;
} }
.story_font_span4 { .story_font_span4 {
float: left; float: left;
height: 0.6rem; height: 0.6rem;
border-radius: 0.3rem;
border: 1.5px solid #ec4804;
margin-left: 0.1rem; margin-left: 0.1rem;
margin-right: 0.1rem; margin-right: 0.1rem;
font-weight: 900; font-weight: 800;
font-size: 0.3rem; font-size: 0.26rem;
text-align: center; text-align: center;
margin-top: 0.1rem; margin-top: 0.1rem;
width: 2.4rem; width: 2rem;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
border-bottom: 1px solid #ec4804;
} }
.story_font2 { .story_font2 {
width: 100%; /*width: 4rem;*/
text-align: center; text-align: center;
margin: 0 auto; margin: 0 auto;
overflow: hidden;
}
.story_font2_width{
width: 3.6rem;
} }
.story_font3 { .story_font3 {
width: 100%; width: 100%;
margin-top: 0.2rem; margin-top: 0.3rem;
float: left; float: left;
} }
...@@ -311,6 +317,7 @@ ...@@ -311,6 +317,7 @@
height: 0.26rem; height: 0.26rem;
float: left; float: left;
margin-left: 1.3rem; margin-left: 1.3rem;
margin-top: 0.05rem;
} }
.ic_star_span { .ic_star_span {
......
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','text!temp/pcBinding_template_tpl.html', 'css!style/home.css', 'pagination', 'bootstrapJs', 'ckfinder', 'ckfinderStart', 'blow-up'], function(doT, template, template_binding,pctemplate_binding) {
var agent = { var agent = {
pageNo: 1, pageNo: 1,
pageSize: 15, pageSize: 15,
...@@ -6,7 +6,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -6,7 +6,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
idArray: '', idArray: '',
init: function() { init: function() {
//初始化dot //初始化dot
$("body").append(template + template_binding); $("body").append(template + template_binding + pctemplate_binding);
agent.getList(); agent.getList();
agent.event(); agent.event();
}, },
...@@ -84,10 +84,14 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -84,10 +84,14 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
$(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).on("click", ".pc-bundling", function() {//点击绑定电脑
agent.agent_id = $(this).attr("data-id");
agent.getPcBindingList();
});
$(document).delegate(".submit_edit", "click", function(e) { //提交编辑 $(document).delegate(".submit_edit", "click", function(e) { //提交编辑
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
...@@ -172,13 +176,46 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -172,13 +176,46 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
"operator_id": user_info_obj.id, "operator_id": user_info_obj.id,
"is_forbidden": params.type "is_forbidden": params.type
}, },
/* $params = array( dataType: "json",
"agent_id" => 1,//解绑或者绑定的经纪人id success: function(data) {
"id" => 1, //关系id if(data.code != 200) {
"operator_id" => 12,//操作人id 登陆后台的经纪人id alert("禁用失败!")
"is_forbidden" => 0,//0正常 1禁止 }
);*/ }
});
});
//电脑绑定状态切换
$(document).delegate(".is_showpc", "click", function() { //点击禁用
if(!confirm('是否继续?')) {
return;
}
agent.id = $(this).attr("data-id");
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
// console.log(user_info_obj);
var params = {
};
params.id = $(this).attr("data-id");
var str = $.trim($(this).html());
if(str === "允许") {
$(this).attr('class', 'btn1 btn-default is_showpc');
params.type = 0;
$(this).html('解绑');
} else if(str === "解绑") {
$(this).attr('class', 'btn1 btn-info is_showpc');
params.type = 1;
$(this).html('允许');
};
$.ajax({ //禁用
'type': 'POST',
'url': '/index/updateDevice',
data: {
"agent_id": agent.agent_id,
"id": params.id,
"operator_id": user_info_obj.id,
"is_forbidden": params.type
},
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {
if(data.code != 200) { if(data.code != 200) {
...@@ -378,6 +415,27 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -378,6 +415,27 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
} }
}) })
}, },
//电脑绑定权限
getPcBindingList: function(pageNo) {
var params = {};
params.agent_id = agent.agent_id;
console.log(agent.agent_id);
$.ajax({
url: '/index/deviceList',//电脑绑定权限
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function(data) {
var temp = document.getElementById('pc_binding_tpl').innerHTML;
var doTempl = doT.template(temp);
$("#agent_pc_binding").html(doTempl(data.data));
/*分页代码*/
add_page(data.data.total, pageNo, agent.pageSize, agent.getList);
$('.J_preview').preview();
}
})
},
getRole: function(tempval) { getRole: function(tempval) {
$.ajax({ $.ajax({
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
<a class="btn1 btn-success phone-bundling" href="#modal-phonebundling" data-toggle="modal" data-id='[%= it[item]["id"] %]'>绑定手机</a> <a class="btn1 btn-success phone-bundling" href="#modal-phonebundling" data-toggle="modal" data-id='[%= it[item]["id"] %]'>绑定手机</a>
[% } %] [% } %]
<a class="btn1 btn-success pc-bundling" href="#modal-pcbundling" data-toggle="modal" data-id='[%= it[item]["id"] %]'>绑定电脑</a>
</td> </td>
......
<script id="pc_binding_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr class="text-center">
<td>[%= it[item]["model"] %]</td>
<td>[%= it[item]["create_time"] %]</td>
<td>
[% if(it[item]["is_forbidden"] == 0) { %]
<a class="btn1 btn-default is_showpc" data-toggle="modal" data-id='[%= it[item]["id"] %]'>解绑</a>
[% }else if(it[item]["is_forbidden"] == 1) { %]
<a class="btn1 btn-info is_showpc" data-toggle="modal" data-id='[%= it[item]["id"] %]'>允许</a>
[% }else{ %]
<a class="btn1 btn-default" data-toggle="modal" data-id='[%= it[item]["id"] %]'>离职</a>
[% } %]
<!--<a class="btn1 btn-info review-images" href="#modal-time" data-toggle="modal" data-img='[%= it[item]["scene_photo"] %]'>允许</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