Commit 2fee6c70 authored by agping's avatar agping

日报修改

parent 27a69abd
......@@ -31,6 +31,29 @@
font-size: 16px;
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>
<div id="page-content-wrapper">
<div class="container">
......@@ -58,7 +81,10 @@
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</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">
<option value="">日报类型</option>
<option value="0">总监日报</option>
......
......@@ -12,6 +12,7 @@
stopstatus: true,
boxphoto: '',
report_id:'',
agent_id_phone:'',//经纪人 姓名搜索
init: function() {
//初始化dot
$(document.body).append(template);
......@@ -42,6 +43,19 @@
$ (document).delegate (".review-images", "click", function () {//提交
$('.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(){
var params = {};
......@@ -63,88 +77,47 @@
$('#guest_stores').html('');
});
$ (document).delegate (".review-images", "click", function () {//提交
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',
//经纪人 姓名搜索
search_phone: function() { //手机号新增客户
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone":$("#cus_fang").val()
"district_id": $("#district_id").val(),//部门
"store_id": $("#guest_stores").val(),//门店
"phone": $("#partical_name").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>';
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data, function(i, item) {
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 {
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 {
}
}
});
//将li里的值 赋给input(经纪人 姓名)
addphone: function(obj) {//新增客户 input赋值
var user_ht = $(obj).html();
$("#partical_name").val(user_ht);
$(".user-ul").html('');
report.agent_id_phone = $(obj).attr("data-id");
},
getList: function(pageNo) {
console.log($('#customer_name').val());
console.log($('#start_date').val());
console.log($('#shop_name').val());
report.pageNo = pageNo;
var params = {};
params.create_time_start =$('#create_time_start').val();
......
......@@ -20,7 +20,7 @@
},
event: function() {
var _doc = $(document);
//二级联动
//二级联动
report.getDistrict(function(){
_doc.on('input', '#district_id, #district_id2', function(){
var _this = $(this);
......@@ -63,88 +63,12 @@
$('#guest_stores').html('');
});
$ (document).delegate (".review-images", "click", function () {//提交
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) {
console.log($('#customer_name').val());
console.log($('#start_date').val());
console.log($('#shop_name').val());
report.pageNo = pageNo;
var params = {};
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