Commit 08f1bfa7 authored by agping's avatar agping

编辑收款人

parent 248b9d99
......@@ -239,6 +239,7 @@
<th class="text-center">费用用途</th>
<th class="text-center">状态</th>
<th class="text-center">来源</th>
<th class="text-center">收款人</th>
<th class="text-center">操作</th>
</tr>
</thead>
......
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="publicCostDetails" />
<style>
.user-ul-store-pay{
float: right;
position: relative;
overflow-y:scroll ;
height:100px;
left: 8px;
width:100%;
line-height: 30px;
}
.user-ul-store-pay li{
list-style: none;
line-height: 20px;
font-size: 12px;
}
.is_hide_details{
display: none;
}
......@@ -287,6 +300,19 @@
</div>
</div>
</div>
<div class="col-xs-12 margain-10">
<div class="col-xs-12">
<div class="form-group">
<strong><span class="col-xs-2 ld-Marheight top-5">收款人:</span></strong>
<span id="" class="col-xs-4 ld-Marheight">
<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>
</span>
</div>
</div>
</div>
<div class="col-xs-12" style="padding: 0 30px;">
<p style="font-size: 16px;font-weight: 600;">成本明细</p>
......
......@@ -11,6 +11,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
store_id:'',
main_index:'',
agent_id:'',//编辑费用的经纪人id
agent_id_store_pay:'',//收款人
init: function() {
//初始化dot
$(document.body).append(template);
......@@ -36,7 +37,18 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$(document).on('click','.close',function(e){
$(parent.document).find('.close').click();
});
//编辑报销 收款人
$(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();
}
});
//编辑 费用类型切换
$("#payType").change(function() {
......@@ -235,6 +247,8 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$('#bank').val(data.data.bank);
$('#count_time').val(data.data.count_time);
$('#kaoqin').html(data.data.office_attendance_num);//考勤
$('#comit_store_pay').val(data.data.payee_agent_name);//获取收款人
cost.agent_id_store_pay = data.data.payee_agent_id;
//根据费用类型 显示费用项目
// 费用类型 1办公室成本 2上海总部成本 3分部成本 4同联发展基金 5门店单独成本。
if(data.data.type == 1 ){//办公室
......@@ -452,6 +466,54 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
}
});
},
//收款人 编辑报销
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);
}
}
});
},
//编辑报销 收款人
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");
},
//删除图片
spandelList: function(id) {
$.ajax({
......@@ -539,6 +601,12 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
alert('请选择计入月份');
return;
}
if($("#comit_store_pay").val()){
}else{
alert('请填写收款人');
return;
}
params.card_name = $('#card_name').val();
params.bank = $('#bank').val();
params.card_no = $('#card_no').val();
......@@ -546,6 +614,8 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
params.id = cost.id;
params.agent_id = cost.agent_id;
params.store_id = cost.store_id;
params.payee_agent_id = cost.agent_id_store_pay;//收款人
// params.office_id = cost.office_id;
$.ajax({
......
......@@ -51,6 +51,7 @@
[% } else { %]
<td>--</td>
[% } %]
<td>[%= it[item]['payee_agent_name'] %]</td>
<td>
[% if(check_auth('index/getDetailCost')) { %]
......
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