Commit 7e822032 authored by agping's avatar agping

修改

parent 7ce0c3b9
......@@ -255,11 +255,45 @@
</form>
</div>
<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 type="button" class="btn btn-primary submit_user" data-dismiss="modal">
提交
</button>-->
<h4 class="modal-title">
绑定电脑
</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>
<!-- /.modal-content -->
......
......@@ -16,10 +16,13 @@
<span>[</span>
<span class="story_font_span2">{{deal_time}}</span>
<span>]</span>
<span class="story_font_span2">成功下定</span>
</div>
<div class="story_font2">
<span class="story_font_span3">{{deal_type}}</span>
<div class="story_font2 story_font2_width">
<!--<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_span5">商铺一套!</span>
</div>
......@@ -136,6 +139,8 @@
responseType: 'json',
data: {
'id': _this.feed_id,
'type': 1
}
})
.then(function(response) {
......@@ -240,11 +245,10 @@
}
.chengjiaojiandan_pic {
width: 4.7rem;
height: 0.5rem;
width: 5.2rem;
display: block;
margin: 0 auto;
margin-top: 0.46rem;
margin-top: 0.80rem;
}
.story_font {
......@@ -263,7 +267,7 @@
}
.story_font_span2 {
font-style: oblique;
/*font-style: oblique;*/
}
.story_font_span3 {
......@@ -273,36 +277,38 @@
}
.story_font_span5 {
float: left;
/*float: left;*/
line-height: 0.88rem;
}
.story_font_span4 {
float: left;
height: 0.6rem;
border-radius: 0.3rem;
border: 1.5px solid #ec4804;
margin-left: 0.1rem;
margin-right: 0.1rem;
font-weight: 900;
font-size: 0.3rem;
font-weight: 800;
font-size: 0.26rem;
text-align: center;
margin-top: 0.1rem;
width: 2.4rem;
width: 2rem;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
border-bottom: 1px solid #ec4804;
}
.story_font2 {
width: 100%;
/*width: 4rem;*/
text-align: center;
margin: 0 auto;
overflow: hidden;
}
.story_font2_width{
width: 3.6rem;
}
.story_font3 {
width: 100%;
margin-top: 0.2rem;
margin-top: 0.3rem;
float: left;
}
......@@ -311,6 +317,7 @@
height: 0.26rem;
float: left;
margin-left: 1.3rem;
margin-top: 0.05rem;
}
.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 = {
pageNo: 1,
pageSize: 15,
......@@ -6,7 +6,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
idArray: '',
init: function() {
//初始化dot
$("body").append(template + template_binding);
$("body").append(template + template_binding + pctemplate_binding);
agent.getList();
agent.event();
},
......@@ -84,10 +84,14 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
$(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.getPhoneBindingList();
});
$(document).on("click", ".pc-bundling", function() {//点击绑定电脑
agent.agent_id = $(this).attr("data-id");
agent.getPcBindingList();
});
$(document).delegate(".submit_edit", "click", function(e) { //提交编辑
e.preventDefault();
e.stopPropagation();
......@@ -172,13 +176,46 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
"operator_id": user_info_obj.id,
"is_forbidden": params.type
},
/* $params = array(
"agent_id" => 1,//解绑或者绑定的经纪人id
"id" => 1, //关系id
"operator_id" => 12,//操作人id 登陆后台的经纪人id
"is_forbidden" => 0,//0正常 1禁止
);*/
dataType: "json",
success: function(data) {
if(data.code != 200) {
alert("禁用失败!")
}
}
});
});
//电脑绑定状态切换
$(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",
success: function(data) {
if(data.code != 200) {
......@@ -378,7 +415,28 @@ 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) {
$.ajax({
url: '/index/getAuth2',
......
......@@ -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 pc-bundling" href="#modal-pcbundling" data-toggle="modal" data-id='[%= it[item]["id"] %]'>绑定电脑</a>
</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