Commit 2fee6c70 authored by agping's avatar agping

日报修改

parent 27a69abd
...@@ -31,6 +31,29 @@ ...@@ -31,6 +31,29 @@
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
} }
/*经纪人 姓名 下拉式列表*/
.user-ul{
height: auto;
float: left;
position: absolute;
width: 230px;
background: #fff;
border: 1px solid #ccc;
border-top:0;
left: 3px;
}
.user-ul li{
list-style: none;
line-height: 30px;
margin-left: -20px;
}
.left-phone{
width: 236px;
float: left;
margin-top: 7px;
margin-left: 10px;
position: relative;
}
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
<div class="container"> <div class="container">
...@@ -58,7 +81,10 @@ ...@@ -58,7 +81,10 @@
</select> </select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value=""> <select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</select> </select>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="report_agent_name" placeholder="选择经纪人" type="text" value=""> <div class="left-phone">
<input class="form-control" data-rule-phoneus="false" data-rule-required="false" id="partical_name" placeholder="分佣方姓名" type="text" value="">
<ul class="user-ul"></ul>
</div>
<select class="form-control btn2 ld-Marheight" id="shop_type"> <select class="form-control btn2 ld-Marheight" id="shop_type">
<option value="">日报类型</option> <option value="">日报类型</option>
<option value="0">总监日报</option> <option value="0">总监日报</option>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
stopstatus: true, stopstatus: true,
boxphoto: '', boxphoto: '',
report_id:'', report_id:'',
agent_id_phone:'',//经纪人 姓名搜索
init: function() { init: function() {
//初始化dot //初始化dot
$(document.body).append(template); $(document.body).append(template);
...@@ -42,6 +43,19 @@ ...@@ -42,6 +43,19 @@
$ (document).delegate (".review-images", "click", function () {//提交 $ (document).delegate (".review-images", "click", function () {//提交
$('.review-images2').attr('src',$(this).attr ("data-img")); $('.review-images2').attr('src',$(this).attr ("data-img"));
}); });
//分佣方 姓名下拉式
$(document).on("input", "#partical_name", function() { //手机号新增搜索客方
if($("#partical_name").val() == '') {
report.agent_id_phone='';
$(".user-ul").html('');
} else {
report.search_phone();
}
});
//点击li 列表消失
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
report.addphone(this);
});
//删除 //删除
$("#confirm_delete").click(function(){ $("#confirm_delete").click(function(){
var params = {}; var params = {};
...@@ -63,88 +77,47 @@ ...@@ -63,88 +77,47 @@
$('#guest_stores').html(''); $('#guest_stores').html('');
}); });
$ (document).delegate (".review-images", "click", function () {//提交 $ (document).delegate (".review-images", "click", function () {//提交
console.log($(this).attr ("data-img")); console.log($(this).attr ("data-img"));
}); });
$("#export").click(function() { //导出列表 $("#export").click(function() { //导出列表
report.exportList(); report.exportList();
}); });
$ (document).delegate (".submit_edit2", "click", function () {//提交
report.house_id2 = $ (this).attr ("data-id");
console.log(report.house_id2);
$("#real_money").val($(this).attr ("data-money"));
});
$ (document).delegate (".submit_edit", "click", function () {//提交
report.Submit_follow();
});
$ (document).on ("input","#cus_fang", function () {//手机号搜索客方2
if($("#cus_fang").val()==''){
$(".user-ul2").html('');
}else{
report.search_phone2();
}
});
$ (document).delegate (".addphone2", "click", function () {//list2消失
report.addphone2(this);
});
}, },
addphone2:function(obj){ //经纪人 姓名搜索
var user_ht=$(obj).html(); search_phone: function() { //手机号新增客户
$("#cus_fang").val(user_ht); $.ajax({
$(".user-ul2").html(''); url: '/index/getBroker_new',
report.agent_id = $ (obj).attr ("data-id"); type: 'GET',
},
search_phone2:function(){//手机号
$.ajax ({
url: '/index/select_by_phone',
type: 'POST',
async: true, async: true,
data: { data: {
"phone":$("#cus_fang").val() "district_id": $("#district_id").val(),//部门
"store_id": $("#guest_stores").val(),//门店
"phone": $("#partical_name").val()
}, },
dataType: 'json', dataType: 'json',
success: function (data) { success: function(data) {
if (data.code == 200) { if(data.code == 200) {
var user_ul2 = ""; var user_ul = "";
$.each(data.data, function(i,item) { $.each(data.data, function(i, item) {
user_ul2+='<li class="addphone2" data-id="'+item.id+'">'+item.id+'-'+item.realname+'-'+item.phone+'</li>'; user_ul += '<li class="addphone" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + '</li>';
}); });
$(".user-ul2").html(user_ul2); $(".user-ul").html(user_ul);
} else { } else {
alert(data.msg); alert(data.msg);
} }
} }
}); });
}, },
//将li里的值 赋给input(经纪人 姓名)
Submit_follow: function() { //提交 addphone: function(obj) {//新增客户 input赋值
$.ajax({ var user_ht = $(obj).html();
'type': 'POST', $("#partical_name").val(user_ht);
'url': '/index/addRealMoney', $(".user-ul").html('');
data: { report.agent_id_phone = $(obj).attr("data-id");
"collection_id": report.house_id2,
"real_money": $("#real_money").val(),
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
report.getList(0);
} else {
}
}
});
}, },
getList: function(pageNo) { getList: function(pageNo) {
console.log($('#customer_name').val());
console.log($('#start_date').val());
console.log($('#shop_name').val());
report.pageNo = pageNo; report.pageNo = pageNo;
var params = {}; var params = {};
params.create_time_start =$('#create_time_start').val(); params.create_time_start =$('#create_time_start').val();
......
...@@ -63,88 +63,12 @@ ...@@ -63,88 +63,12 @@
$('#guest_stores').html(''); $('#guest_stores').html('');
}); });
$ (document).delegate (".review-images", "click", function () {//提交 $ (document).delegate (".review-images", "click", function () {//提交
console.log($(this).attr ("data-img")); console.log($(this).attr ("data-img"));
}); });
$("#export").click(function() { //导出列表
report.exportList();
});
$ (document).delegate (".submit_edit2", "click", function () {//提交
report.house_id2 = $ (this).attr ("data-id");
console.log(report.house_id2);
$("#real_money").val($(this).attr ("data-money"));
});
$ (document).delegate (".submit_edit", "click", function () {//提交
report.Submit_follow();
});
$ (document).on ("input","#cus_fang", function () {//手机号搜索客方2
if($("#cus_fang").val()==''){
$(".user-ul2").html('');
}else{
report.search_phone2();
}
});
$ (document).delegate (".addphone2", "click", function () {//list2消失
report.addphone2(this);
});
},
addphone2:function(obj){
var user_ht=$(obj).html();
$("#cus_fang").val(user_ht);
$(".user-ul2").html('');
report.agent_id = $ (obj).attr ("data-id");
},
search_phone2:function(){//手机号
$.ajax ({
url: '/index/select_by_phone',
type: 'POST',
async: true,
data: {
"phone":$("#cus_fang").val()
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
var user_ul2 = "";
$.each(data.data, function(i,item) {
user_ul2+='<li class="addphone2" data-id="'+item.id+'">'+item.id+'-'+item.realname+'-'+item.phone+'</li>';
});
$(".user-ul2").html(user_ul2);
} else {
alert(data.msg);
}
}
});
},
Submit_follow: function() { //提交
$.ajax({
'type': 'POST',
'url': '/index/addRealMoney',
data: {
"collection_id": report.house_id2,
"real_money": $("#real_money").val(),
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
report.getList(0);
} else {
}
}
});
}, },
getList: function(pageNo) { getList: function(pageNo) {
console.log($('#customer_name').val());
console.log($('#start_date').val());
console.log($('#shop_name').val());
report.pageNo = pageNo; report.pageNo = pageNo;
var params = {}; var params = {};
params.create_time_start =$('#create_time_start').val(); params.create_time_start =$('#create_time_start').val();
......
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