Commit 57ce75b9 authored by agping's avatar agping

1

parent 72b9252e
......@@ -26,6 +26,15 @@
width:100%;
line-height: 30px;
}
.user-ul-office,.user-ul-store{
float: right;
position: relative;
overflow-y:scroll ;
height:100px;
left: 8px;
width:100%;
line-height: 30px;
}
.user-ul li,.user-ul-office li,.user-ul-store li{
list-style: none;
line-height: 20px;
......@@ -247,7 +256,7 @@
<label for="inputEmail3" class="col-sm-4 control-label">费用类型:</label>
<div class="col-sm-8">
<select class="form-control left-width" id="cost_type_add">
<option value="">费用类型</option>
<option value="-1">费用类型</option>
<option value="0">办公室成本</option>
<option value="1">总部成本</option>
<option value="2">分部成本</option>
......@@ -265,7 +274,7 @@
<option value="101" class="choose_office_add">水电费</option>
<option value="102" class="choose_office_add">其他费用</option>
<!--总部成本类型-->
<option value="102" class="choose_total_add">其他费用</option>
<option value="202" class="choose_total_add">其他费用</option>
<!--分部成本类型-->
<option value="10002" class="choose_siteID_add">杭州</option>
......@@ -387,7 +396,7 @@
</div>
<!-- 费用详情审核 编辑 -->
<div class="modal fade" id="modal-addPic" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-body-width-du" style="width: 920px;">
<div class="modal-dialog modal-body-width-du" style="width: 900px;">
<div class="modal-content">
<iframe src="" frameborder="0" class="publicCostDetails" style="width: 900px;height: 680px;"></iframe>
</div>
......
......@@ -9,6 +9,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
checkUrl: '',//审核url
agent_id_phone:'',
agent_id_office:'',
agent_site_office:'',
main_index:0,
init: function() {
......@@ -213,6 +214,8 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$(document).on("input", "#comit_office", function() {
if($("#comit_office").val() == '') {
that.agent_id_office='';
that.agent_site_office='';
$(".user-ul-office").html('');
} else {
that.search_office();
......@@ -225,6 +228,8 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$(document).on("input", "#comit_store", function() {
if($("#comit_name_store").val() == '') {
that.agent_id_store='';
that.agent_site_office='';
$(".user-ul-store").html('');
} else {
that.search_store();
......@@ -269,9 +274,9 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
}
});
});
$(document).on('click','.add-pic',function(e){
$(document).on('click','.checkCost',function(e){//点击审核按钮 调整审核页面
var id = e.target.dataset.id;
$(".publicCostDetails").attr('src','/index/publicCostDetails?cost_id='+ id + '&cost_status=' + cost.main_index)
$(".publicCostDetails").attr('src','/index/publicCostDetails?cost_id='+ id + '&is_self=0')
});
},
......@@ -338,13 +343,13 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
var user_ul = "";
if(data.data.list){
$.each(data.data.list, function(i, item) {
user_ul += '<li class="addphoneOffice" data-id="' + item.id + '">' + item.office_address + ';-ID:' + item.id + '</li>';
user_ul += '<li class="addphoneOffice" data-site="' + item.site_id + '" data-id="' + item.id + '">' + item.office_address + ';-ID:' + item.id + '</li>';
});
}
$(".user-ul-office").html(user_ul);
$(".user-ul-office").show();
} else {
alert(data.msg);
// alert(data.msg);
}
}
......@@ -352,37 +357,23 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
},
search_store: function() { //搜索门店
$.ajax({
url: '/index/getOfficeList',
type: 'POST',
url: '/index/getStoreOffice',
type: 'GET',
async: true,
data: {
"pageNo": 1,
"pageSize": 100,
"pageNo": $("#comit_name_office").val(),
"store_name": $("#comit_store").val(),
},
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="addphone" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + status + '</li>';
user_ul += '<li class="addphoneStore" data-site="' + item.site_id + '" data-id="' + item.id + '">' + item.store_name + ';-ID:' + item.id + '</li>';
});
$(".user-ul").html(user_ul);
$(".user-ul").show();
$(".user-ul-store").html(user_ul);
$(".user-ul-store").show();
} else {
alert(data.msg);
// alert(data.msg);
}
}
......@@ -396,6 +387,8 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$(".user-ul-office").html('');
$(".user-ul-office").hide();
that.agent_id_office = $(obj).attr("data-id");
that.agent_site_office = $(obj).attr("data-site");
},
//将li里的值 赋给input(门店)
addphoneStore: function(obj) {//新增客户 input赋值
......@@ -404,7 +397,9 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$("#comit_store").val(user_ht);
$(".user-ul-store").html('');
$(".user-ul-store").hide();
that.agent_id_phone = $(obj).attr("data-id");
that.agent_id_store = $(obj).attr("data-id");
that.agent_site_office = $(obj).attr("data-site");
},
getDistrict: function(fn) {
$.ajax({
......@@ -468,22 +463,49 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
}
});
},
//新增报销
addCost: function() {
var params = {};
//默认 办公室 门店 id=0
params.store_id = 0;
params.office_id = 0;
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
//费用项目 切换
if($('#cost_type_add').val() == 2){
params.site_id = $('#fee_item_add').val();
}else{
params.fee_item = $('#fee_item_add').val();
}
//门店 办公室 传递参数
if($('#cost_type_add').val() == 0){//办公室
if($('#comit_office').val()){
params.office_id = cost.agent_id_office;
params.site_id = cost.agent_site_office;//办公室所在城市
}else{
alert("请选择办公室地址")
}
}else if($('#cost_type_add').val() == 3){//门店
if($('#comit_store').val()){
params.store_id = cost.agent_id_store;
params.site_id = cost.agent_site_office;//门店所在城市
}else{
alert("请选择门店")
}
}else if($('#cost_type_add').val() == 1){//总部
params.site_id = 10001;//默认上海
}
var imgname = [];//图片
for(var i = 0; i < $('.result').length; i++) {
imgname[i] = $('.result>img').eq(i).attr('data-imgname');
};
// params.img_arr = imgname.join(',');
params.img_arr = imgname;
params.img_arr = JSON.stringify(imgname);
if($('#total_fee').val()){
params.total_fee = $('#total_fee').val();
......@@ -491,7 +513,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
alert('请选择费用总金额');
return;
}
if($('#cost_type_add').val()){
if($('#cost_type_add').val() != -1){
params.type = $('#cost_type_add').val();
}else{
alert('请选择费用类型');
......@@ -503,7 +525,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
return;
}
if($('#count_time_add').val()){
params.count_time = $('#count_time_add').val();
params.count_time = $('#count_time_add').val()+'-01';
}else{
alert('请选择计入月份');
return;
......@@ -513,10 +535,12 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
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;
$.ajax({
url: '/index/addApplyFor',
......@@ -526,7 +550,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
alert(data.msg);
alert('提交成功');
$(".modal").modal('hide');//新增成功 关闭弹窗
cost.getList(cost.pageNo);//重新获取列表
} else {
......@@ -549,17 +573,6 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
var temp = document.getElementById('cost_check_template_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#order_list").html(doTtmpl(data.data.list));
//列表 按钮显示隐藏
if(cost.url == '/index/getCostList'){//全部
$('.add-pic').hide();
$('.is_del').hide();
}else if(cost.url == '/index/getCostListFive/4'){//三审
$('.add-pic').show();
$('.is_del').hide();
}else{
$('.add-pic').show();
$('.is_del').show();
}
/*分页代码*/
add_page(data.data.total, no, that.pageSize, that.getList);
} else {
......@@ -588,6 +601,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$('#comit_office').val("");
that.agent_id_office="";
that.agent_id_store="";
that.agent_site_office="";
},
//重置搜索条件
......
......@@ -343,6 +343,8 @@ function switchFeeItem(str){
return '其他费用';
case '201':
return '总部固定成本';
case '202':
return '其他费用';
case '301':
return '分部固定成本';
case '401':
......
This diff is collapsed.
......@@ -56,8 +56,10 @@
[% } %]
<td>
<a class="btn1 btn-success add-pic" href="#modal-addPic" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-status='[%= it[item]["status"] %]'>审核</a>
<a class="btn1 btn-success checkCost" href="#modal-addPic" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-status='[%= it[item]["status"] %]'>审核</a>
[% if(it[item]['status'] != 4) { %]
<a class="btn1 btn-success is_del" href="#modal-delete" data-toggle="modal" data-id='[%= it[item]["id"] %]'>删除</a>
[% } %]
</td>
</tr>
[% } %]
......@@ -67,3 +69,34 @@
</tr>
[% } %]
</script>
<!--详情 门店明细-->
<script id="mingxi_template_tpl" type="text/template">
[% if(it && it.length) { %]
[% for(var item in it){ %]
<tr class="text-left">
<td style="border: 0;">成本明细ID[%= it[item]['id'] %]
费用承担门店:[%= it[item]['store_name'] %] ([%= it[item]['store_attendance_num'] %])
费用承担金额:[%= it[item]['assume_fee'] %] </td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="15" style="text-align:left;border: 0;"> 暂无数据</td>
</tr>
[% } %]
</script>
<!--详情 审核记录-->
<script id="check_template_tpl" type="text/template">
[% if(it && it.length) { %]
[% for(var item in it){ %]
<tr class="text-left">
<td style="border: 0;">[%= it[item]['name'] %] [%= it[item]['create_time'] %] 备注:[%= it[item]['remark'] %]</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="15" style="text-align:left;border: 0;"> 暂无数据</td>
</tr>
[% } %]
</script>
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