Commit 34dfc0d8 authored by agping's avatar agping

优化

parent 0f57dda8
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
新增报销费用 新增报销费用
<button type="button" class="close noprint" data-dismiss="modal" aria-hidden="true"> × </button> <button type="button" class="close noprint" data-dismiss="modal" aria-hidden="true"> × </button>
</div> </div>
<div class="modal-body" style="height:500px;"> <div class="modal-body" style="height:580px;">
<form class="form-horizontal"> <form class="form-horizontal">
<div class="form-group form-group-bottom col-sm-6"> <div class="form-group form-group-bottom col-sm-6">
<label for="inputEmail3" class="col-sm-4 control-label">费用总金额:</label> <label for="inputEmail3" class="col-sm-4 control-label">费用总金额:</label>
......
...@@ -321,10 +321,10 @@ ...@@ -321,10 +321,10 @@
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="cost_id" placeholder="费用ID" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="cost_id" placeholder="费用ID" type="text" value="">
<select class="form-control btn2 ld-Marheight" id="cost_type"> <select class="form-control btn2 ld-Marheight" id="cost_type">
<option value="">费用类型</option> <option value="">费用类型</option>
<option value="0">办公室成本</option> <option value="1">办公室成本</option>
<option value="1">总部成本</option> <option value="2">总部成本</option>
<option value="2">分公司成本</option> <option value="3">分公司成本</option>
<option value="3">门店独有成本</option> <option value="5">门店独有成本</option>
</select> </select>
<select class="form-control btn2 ld-Marheight" id="fee_item"> <select class="form-control btn2 ld-Marheight" id="fee_item">
<option value="">费用项目</option> <option value="">费用项目</option>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<style> <style>
.is_hide_details{ .is_hide_details{
display: none; /*display: none;*/
} }
div{ div{
outline:none!important; outline:none!important;
......
...@@ -6,7 +6,8 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html', ...@@ -6,7 +6,8 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html',
pageSize: 10, pageSize: 10,
/*每页显示多少条*/ /*每页显示多少条*/
store_id: '', store_id: '',
countCity:'',
countTime:'',
init: function() { init: function() {
//初始化时间 //初始化时间
var myDate = new Date(); var myDate = new Date();
...@@ -89,6 +90,10 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html', ...@@ -89,6 +90,10 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html',
if(typeof data === 'object') { if(typeof data === 'object') {
if(data.code == 200) { if(data.code == 200) {
bargain.countTime = $('#count_time').val(); bargain.countTime = $('#count_time').val();
//分部所在城市
if(data.data.store_info.length){
bargain.countCity = data.data.store_info[0].site_id
}
//办公室 //办公室
var doTtmpl = doT.template(document.getElementById('a_financial_daily_list_tpl').innerHTML); var doTtmpl = doT.template(document.getElementById('a_financial_daily_list_tpl').innerHTML);
$("#maintable_list_a").html(doTtmpl(data.data.store_list.info)); $("#maintable_list_a").html(doTtmpl(data.data.store_list.info));
...@@ -118,9 +123,6 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html', ...@@ -118,9 +123,6 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html',
$(".yingli").html(data.data.profit); $(".yingli").html(data.data.profit);
/*分页代码*/ /*分页代码*/
// add_page(data.data.total, pageNo, bargain.pageSize, bargain.getList); // add_page(data.data.total, pageNo, bargain.pageSize, bargain.getList);
...@@ -147,4 +149,4 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html', ...@@ -147,4 +149,4 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html',
}); });
var countTime=function(){return bargain.countTime}; var countTime=function(){return bargain.countTime};
var countCity=function(){return bargain.countCity};
...@@ -15,7 +15,11 @@ define(['doT', 'text!temp/cost_details_template_tpl.html', 'css!style/home.css', ...@@ -15,7 +15,11 @@ define(['doT', 'text!temp/cost_details_template_tpl.html', 'css!style/home.css',
event: function() { event: function() {
var that = cost; var that = cost;
var _doc = $(document); var _doc = $(document);
//初始化 费用项目隐藏
$('.choose_office').hide();
$('.choose_total').hide();
$('.choose_siteID').hide();
$('.choose_store').hide();
//搜索 //搜索
$(document).on('click','#search',function(e){ $(document).on('click','#search',function(e){
that.getList(1); that.getList(1);
...@@ -37,25 +41,25 @@ define(['doT', 'text!temp/cost_details_template_tpl.html', 'css!style/home.css', ...@@ -37,25 +41,25 @@ define(['doT', 'text!temp/cost_details_template_tpl.html', 'css!style/home.css',
//费用类型切换 //费用类型切换
$("#cost_type").change(function() { $("#cost_type").change(function() {
$("#fee_item").val('');//置空费用项目 $("#fee_item").val('');//置空费用项目
if($('#cost_type').val() == 0 ){ if($('#cost_type').val() == 1 ){//办公室
$('.choose_office').show(); $('.choose_office').show();
$('.choose_total').hide(); $('.choose_total').hide();
$('.choose_siteID').hide(); $('.choose_siteID').hide();
$('.choose_store').hide(); $('.choose_store').hide();
}else if($('#cost_type').val() == 1 ){ }else if($('#cost_type').val() == 2 ){//总部
$('.choose_office').hide(); $('.choose_office').hide();
$('.choose_total').show(); $('.choose_total').show();
$('.choose_siteID').hide(); $('.choose_siteID').hide();
$('.choose_store').hide(); $('.choose_store').hide();
}else if($('#cost_type').val() == 2 ){ }else if($('#cost_type').val() == 3 ){//分部
$('.choose_office').hide(); $('.choose_office').hide();
$('.choose_total').hide(); $('.choose_total').hide();
$('.choose_siteID').show(); $('.choose_siteID').show();
$('.choose_store').hide(); $('.choose_store').hide();
}else if($('#cost_type').val() == 3 ){ }else if($('#cost_type').val() == 5 ){//单独门店
$('.choose_office').hide(); $('.choose_office').hide();
$('.choose_total').hide(); $('.choose_total').hide();
$('.choose_siteID').hide(); $('.choose_siteID').hide();
...@@ -280,8 +284,8 @@ define(['doT', 'text!temp/cost_details_template_tpl.html', 'css!style/home.css', ...@@ -280,8 +284,8 @@ define(['doT', 'text!temp/cost_details_template_tpl.html', 'css!style/home.css',
paramsStr += "type=" + cost_type +'&'; paramsStr += "type=" + cost_type +'&';
} }
if ( cost_id ) { if ( cost_id ) {
params.cost_id = cost_id; params.apply_for_id = cost_id;
paramsStr += "cost_id=" + cost_id +'&'; paramsStr += "apply_for_id=" + cost_id +'&';
} }
if ( details_id ) {//明细id if ( details_id ) {//明细id
params.id = details_id; params.id = details_id;
...@@ -292,7 +296,7 @@ define(['doT', 'text!temp/cost_details_template_tpl.html', 'css!style/home.css', ...@@ -292,7 +296,7 @@ define(['doT', 'text!temp/cost_details_template_tpl.html', 'css!style/home.css',
paramsStr += "purpose=" + purpose +'&'; paramsStr += "purpose=" + purpose +'&';
} }
if ( fee_item ) {//区分分部 if ( fee_item ) {//区分分部
if(cost_type == 2){ if(cost_type == 3){
params.site_id = fee_item; params.site_id = fee_item;
paramsStr += "site_id=" + fee_item +'&'; paramsStr += "site_id=" + fee_item +'&';
}else{ }else{
......
...@@ -325,16 +325,6 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', ' ...@@ -325,16 +325,6 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
cost.checkUrl = '/index/checkCostFive/4' cost.checkUrl = '/index/checkCostFive/4'
} }
//三审通过 隐藏保存 审核通过按钮
if(data.data.status == 4){
$('.save_cost').hide();
$('.save_cost_pic').hide();
$('.pass_check').hide();
}else{
$('.save_cost').show();
$('.save_cost_pic').show();
$('.pass_check').show();
}
//备注 图片上传 //备注 图片上传
if(data.data.status == 3){ if(data.data.status == 3){
$('.is_hide_pic').show(); $('.is_hide_pic').show();
...@@ -342,8 +332,10 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', ' ...@@ -342,8 +332,10 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$('.is_hide_pic').hide(); $('.is_hide_pic').hide();
} }
//is_self == 1 隐藏 保存 审核按钮 //is_self == 1 隐藏 保存 审核按钮
if(cost.is_self == 1 || cost.main_index == 5){ if(cost.is_self == 1 || cost.main_index == 5 || data.data.status == 4){
$('.is_hide_details').hide(); $('.is_hide_details').hide();
}else{
$('.is_hide_details').show();
} }
//区分明细详情 和 报销详情 字段显示 //区分明细详情 和 报销详情 字段显示
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<td>[%= it[item]['id'] %]</td> <td>[%= it[item]['id'] %]</td>
<td></td> <td></td>
<td>[%= it[item]['apply_for_time'] %]</td> <td>[%= it[item]['apply_for_time'] %]</td>
<td>[%= switchFeeSiteId(it[item]['site_id']) %]分公司成本</td> <td>[%= switchFeeSiteId(countCity()) %]分公司成本</td>
<td>[%= switchFeeItem(it[item]['fee_item']) %]</td> <td>[%= switchFeeItem(it[item]['fee_item']) %]</td>
<td>[%= it[item]['total_fee'] %]</td> <td>[%= it[item]['total_fee'] %]</td>
<td>[%= it[item]['store_attendance_num'] %]/[%=it[item]['district_attendance_num'] %]</td> <td>[%= it[item]['store_attendance_num'] %]/[%=it[item]['district_attendance_num'] %]</td>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
[% if(check_auth('index/getDetailCost')) { %] [% if(check_auth('index/getDetailCost')) { %]
[% if(it[item]['apply_for_id'] != 0) { %] [% if(it[item]['apply_for_id'] != 0) { %]
<a class="btn1 btn-success checkCost" href="#modal-addPic" data-toggle="modal" data-id='[%= it[item]["cost_id"] %]' data-status='[%= it[item]["status"] %]'>详情</a> <a class="btn1 btn-success checkCost" href="#modal-addPic" data-toggle="modal" data-id='[%= it[item]["apply_for_id"] %]' data-status='[%= it[item]["status"] %]'>详情</a>
[% } %] [% } %]
[% } %] [% } %]
......
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