Commit 9fcc7e72 authored by 刘丹's avatar 刘丹 Committed by hujun

绑定

parent 72909462
号码池 {layout name="global/frame_tpl" /}
\ No newline at end of file <input type="hidden" class="page-load" id="phone_list" />
<div id="page-content-wrapper">
<div class="container">
<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>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<td colspan="11">
<form id="form_search">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="industry_type" placeholder="A号码" type="text" value="" name="groupname">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish" placeholder="B号码" type="text" value="" name="store_name">
<span class="btn btn-default btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-default btn3 ld-Marheight" id="reset">重置</span>
<!--变更角色-->
</form>
</td>
</tr>
<tr>
<th class="text-center">隐私号码</th>
<th class="text-center">A号码</th>
<th class="text-center">B号码</th>
<th class="text-center">绑定有效期</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="text-center" id="phonelist_list">
<!--<tr>-->
<!--<td>212</td>-->
<!--<td>商场</td>-->
<!--<td>长兴</td>-->
<!--<td>1000</td>-->
<!--<td>是</td>-->
<!--<td>2018-01-16 17:02:00</td>-->
<!--<td>已租</td>-->
<!--<td>张娜张-->
<!--<a data-toggle="modal" data-id="77" href="#modal-watch" class="btn1 btn-danger add_applies">修改</a>-->
<!--</td>-->
<!--<td>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">编辑</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">推荐至首页</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">设置案场权限人</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">是否独家</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">操作记录</a>-->
<!--<a data-toggle="modal" data-id="77" href="#modal-watch" class="btn1 btn-danger add_applies" onclick="delete_house(4720)">删除</a>-->
<!--</td>-->
<!--</tr>-->
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--是否绑定-->
<div class="modal fade" id="modal-dujia" 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="exclusive" placeholder="请输入隐私号码" type="text" value="" id="exclusive">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">A号码:</label>
<input class="form-control btn6" data-rule-buga="false" data-rule-required="true" name="exclusive" placeholder="请输入A号码" type="text" value="" id="exclusiveA">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">B号码:</label>
<input class="form-control btn6" data-rule-buga="false" data-rule-required="true" name="exclusive" placeholder="请输入A号码" type="text" value="" id="exclusiveB">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">失效时间:</label>
<input class="form-control btn5 " data-rule-phoneus="false" data-rule-required="false" id="start_date_dujia" name="start_date_dujia" type="date">
</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_follow2" data-dismiss="modal">
提交
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
\ No newline at end of file
/**
* Created by 刘丹 on 2018/3/1.
*/
define (['doT', 'text!temp/phonelist_template_tpl.html', 'css!style/home.css','ckfinder','ckfinderStart','pagination','bootstrapJs'], function (doT, template) {
phonelist = {
pageNo: 1, /*第几页*/
pageSize: 10, /*每页显示多少条*/
id : '',
house_id:'',
type:'',
valueCurrent:'',
ajaxObj:'',
stopstatus:true,
boxphoto:'',
init: function () {
//初始化dot
$ ("body").append (template);
phonelist.getList ();
phonelist.event ();
},
event: function () {
$("#search").click(function () {
phonelist.getList(1);
});
$("#reset").click(function () {//重置
document.getElementById("form_search").reset();
});
$ (document).delegate (".is_show", "click", function () {//绑定
if (!confirm('是否继续?')) {
return ;
}
business.id = $ (this).attr ("data-id");
var params ={
};
params.id = $ (this).attr ("data-id");
var str = $.trim($(this).html());
if (str === "绑定") {
params.type = 1;
$(this).html('已绑定');
} else {
params.type = 0;
$(this).html('解绑');
}
$.ajax({//推荐至首页
'type': 'POST',
'url' : '/index/carefullyChosen',
data: {"houses_id":business.id},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
}
} else {
alert("推荐失败!")
}
}
});
});
},
getList: function (pageNo) {
phonelist.pageNo = pageNo;
var params = {};
params.pageNo = phonelist.pageNo;
params.pageSize = phonelist.pageSize;
params.phone_a = $('#industry_type') .val();
params.phone_b = $('#dish') .val();
$.ajax ({
url: '/index/bindPhoneList',//获取列表
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function (data) {
var temp = document.getElementById ('phonelist_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#phonelist_list").html (doTtmpl (data.data.list));
/*分页代码*/
$ ("#pagediv").pagination ({
length: data.data.total,
current: pageNo,
every: phonelist.pageSize,
onClick: function (el) {
phonelist.getList (el.num.current);
}
});
}
});
}
};
return phonelist;
});
\ No newline at end of file
<script id="phonelist_list_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr class="text-center">
<td>[%= it[item]['phone_x'] %]</td>
<td>[%= it[item]['phone_a'] %]</td>
<td>[%= it[item]['phone_b'] %]</td>
<td>[%= it[item]['create_time'] %] </td>
<td>
<a class="btn1 btn-success is_show" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-target="#modal-dujia">绑定</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