Commit 248b9d99 authored by agping's avatar agping

费用报销审核 新增收款人

parent d5960cad
......@@ -16,7 +16,7 @@
line-height: 30px;
}
.user-ul,.user-ul-office,.user-ul-store{
.user-ul,.user-ul-office,.user-ul-store,.user-ul-payee{
float: right;
text-align:center;
position: relative;
......@@ -26,7 +26,7 @@
width:100%;
line-height: 30px;
}
.user-ul-office,.user-ul-store{
.user-ul-office,.user-ul-store,.user-ul-store-pay{
float: right;
position: relative;
overflow-y:scroll ;
......@@ -35,7 +35,7 @@
width:100%;
line-height: 30px;
}
.user-ul li,.user-ul-office li,.user-ul-store li{
.user-ul li,.user-ul-office li,.user-ul-store li,.user-ul-payee li,.user-ul-store-pay li{
list-style: none;
line-height: 20px;
font-size: 12px;
......@@ -212,6 +212,9 @@
<select class="form-control btn2 ld-Marheight" id="commit_shop">
<option value="">提交人所在门店</option>
</select>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="payee_name" placeholder="收款人" type="text" value="">
<ul class="user-ul-payee" style="display:none"></ul>
<span class="btn btn-info btn3 ld-Marheight" id="search_moni" style="float:left;display: none;">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="search" style="float:left">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset" style="float:left">重置</span>
......@@ -372,6 +375,14 @@
<ul class="user-ul-store" style="display:none"></ul>
</div>
</div>
<!--新增费用报销 加收款人-->
<div class="form-group form-group-bottom col-sm-6">
<label class="col-sm-4 control-label">收款人:</label>
<div class="col-sm-8">
<input class="form-control" data-rule-phoneus="false" data-rule-required="false" id="comit_store_pay" placeholder="请输入经纪人姓名进行搜索" type="text" value="">
<ul class="user-ul-store-pay" style="display:none"></ul>
</div>
</div>
</form>
<div style="clear: both;padding-left: 20px;">
<label style="font-size: 16px;margin: 20px 0px;">图片上传(至少1张,最多9张):</label>
......
......@@ -8,8 +8,10 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
url: '',
checkUrl: '',//审核url
agent_id_phone:'',
agent_id_phonePayee:'',
agent_id_office:'',
agent_site_office:'',
agent_id_store_pay:'',//新增报销 收款人
main_index:0,
init: function() {
......@@ -256,7 +258,14 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
that.addphone(this);
});
//点击li 列表消失
$(document).delegate(".addphonepayee", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
that.addphonepayee(this);
});
//新增报销 收款人
$(document).delegate(".addphoneStorePay", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
that.addphoneStorePay(this);
});
//分佣方 姓名下拉式
$(document).on("input", "#comit_name", function() { //手机号新增搜索客方
if($("#comit_name").val() == '') {
......@@ -266,6 +275,16 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
that.search_person();
}
});
//费用报销审核 收款人筛选
$(document).on("input", "#payee_name", function() { //手机号新增搜索客方
if($("#payee_name").val() == '') {
that.agent_id_phonePayee='';
$(".user-ul-payee").html('');
} else {
that.search_person_payee();
}
});
//办公室搜索
$(document).delegate(".addphoneOffice", "click", function() {
that.addphoneOffice(this);
......@@ -294,6 +313,18 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
that.search_store();
}
});
//新增报销 收款人
$(document).delegate(".addphoneStorePay", "click", function() {
that.addphoneStorePay(this);
});
$(document).on("input", "#comit_store_pay", function() {
if($("#comit_store_pay").val() == '') {
that.agent_id_store_pay='';
$(".user-ul-store-pay").html('');
} else {
that.search_store_pay();
}
});
//批量上传上传处理事件
$("#file_input").change(function(e) {
var _this = $(this);
......@@ -413,6 +444,82 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
}
});
},
//收款人 列表筛选
search_person_payee: function() { //手机号新增客户
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone": $("#payee_name").val(),
'all' : 1
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data, function(i, item) {
if(item.status == 0 || item.status == 4){
var status=' ';
};
if(item.status == 1){
var status='-长假';
};
if(item.status == 2){
var status='-离职';
};
if(item.status == 3){
var status='-转勤';
}
user_ul += '<li class="addphonepayee" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + status + '</li>';
});
$(".user-ul-payee").html(user_ul);
$(".user-ul-payee").show();
} else {
alert(data.msg);
}
}
});
},
//收款人 新增报销
search_store_pay: function() { //手机号新增客户
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone": $("#comit_store_pay").val(),
'all' : 1
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data, function(i, item) {
if(item.status == 0 || item.status == 4){
var status=' ';
};
if(item.status == 1){
var status='-长假';
};
if(item.status == 2){
var status='-离职';
};
if(item.status == 3){
var status='-转勤';
}
user_ul += '<li class="addphoneStorePay" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + status + '</li>';
});
$(".user-ul-store-pay").html(user_ul);
$(".user-ul-store-pay").show();
} else {
alert(data.msg);
}
}
});
},
//将li里的值 赋给input(分佣方姓名)
addphone: function(obj) {//新增客户 input赋值
var that = cost ;
......@@ -423,6 +530,26 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$(".user-ul").hide();
that.agent_id_phone = $(obj).attr("data-id");
},
//将li里的值 赋给input(分佣方姓名)
addphonepayee: function(obj) {//新增客户 input赋值
var that = cost ;
var user_ht = $(obj).html()+'';
var user_ht_str=user_ht.substring(0,user_ht.length-3);
$("#payee_name").val(user_ht_str);
$(".user-ul-payee").html('');
$(".user-ul-payee").hide();
that.agent_id_phonePayee = $(obj).attr("data-id");
},
//新增报销
addphoneStorePay: function(obj) {
var that = cost ;
var user_ht = $(obj).html()+'';
var user_ht_str=user_ht.substring(0,user_ht.length-3);
$("#comit_store_pay").val(user_ht_str);
$(".user-ul-store-pay").html('');
$(".user-ul-store-pay").hide();
that.agent_id_store_pay = $(obj).attr("data-id");
},
search_office: function() { //搜索办公室
$.ajax({
url: '/index/getOfficeList',
......@@ -475,6 +602,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
}
});
},
//将li里的值 赋给input(办公室)
addphoneOffice: function(obj) {//新增客户 input赋值
var that = cost ;
......@@ -633,12 +761,18 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
alert('请选择1-9张图片');
return;
}
//验证新增报销 收款人填写
if($('#comit_store_pay').val()){
}else{
alert('请填写收款人');
return;
}
params.card_name = $('#card_name_cost').val();
params.bank = $('#bank_cost').val();
params.card_no = $('#card_no_cost').val();
params.purpose = $('#yongtu').val();
params.agent_id = user_info_obj.id;
params.payee_agent_id = cost.agent_id_store_pay;//新增报销 收款人
$.ajax({
url: '/index/addApplyFor',
......@@ -707,6 +841,10 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
that.agent_site_office="";
//图片置空
$('#container_body_img_area').html('');
//收款人 置空
$('#comit_store_pay').val('');
cost.agent_id_store_pay='';
},
//重置搜索条件
resetAll : function(){
......@@ -724,6 +862,9 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$('#commit_shop').val("");
$('#comit_name').val("");
that.agent_id_phone="";
$('#payee_name').val("");
that.agent_id_phonePayee="";
},
......@@ -753,6 +894,8 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
var commit_home = $('#commit_home').val();
var commit_shop = $('#commit_shop').val();
var comit_name = that.agent_id_phone;//$('#comit_name').val();
var payee_name = that.agent_id_phonePayee;//$('#comit_name').val();
var params = {};
var paramsStr = "" ;
if ( count_time ) {
......@@ -809,6 +952,10 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
params.agent_id = comit_name;
paramsStr += "agent_id=" + comit_name +'&';
}
if ( payee_name ) {
params.payee_agent_id = payee_name;
paramsStr += "payee_agent_id=" + payee_name +'&';
}
if (is_excel) {
return paramsStr;
} else {
......
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