Commit 1c62df0d authored by agping's avatar agping

审核

parent 15a16892
......@@ -276,10 +276,10 @@
</form>
</div>
<div class="modal-footer pic-con2">
<button type="button btn2" class="btn btn-primary" id="savePayBtn" data-dismiss="modal">
<button type="button btn2" class="btn btn-primary" id="save_cost" data-dismiss="modal">
保存
</button>
<button type="button btn2" class="btn btn-primary" id="savePayBtn" data-dismiss="modal">
<button type="button btn2" class="btn btn-primary" id="pass_check" data-dismiss="modal">
审核通过
</button>
</div>
......
......@@ -6,7 +6,9 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
/*每页显示多少条*/
id: '',
url: '',
checkUrl: '',//审核url
agent_id_phone:'',
main_index:0,
init: function() {
//初始化dot
$(document.body).append(template);
......@@ -57,8 +59,10 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
_doc.on('click','.choose_btn',function(e){
$(this).removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
cost.url = e.target.dataset.value;
cost.main_index = $(this).index();
cost.getList(1);
});
//搜索
$(document).on('click','#search',function(e){
that.getList(1);
......@@ -95,9 +99,6 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$('.choose_store').show();
};
});
//获取报销id
$(document).on('click','.is_del',function(e){
......@@ -181,7 +182,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
});
$(document).on('click','.add-pic',function(e){
var id = e.target.dataset.id;
$(".publicCostDetails").attr('src','/index/publicCostDetails')
$(".publicCostDetails").attr('src','/index/publicCostDetails?cost_id='+ id + '&cost_status=' + cost.main_index)
});
},
......@@ -308,7 +309,17 @@ 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 {
......
......@@ -4,15 +4,8 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
checkUrl: '',
id: '',
house_id: '',
house_fatherid: '',
collection_del_id:'',
listData :"",
moneyTotal : "" ,
agent_id_phone : '',
check_status : 1 ,
deleteRefundId:'',
init: function() {
//初始化dot
$(document.body).append(template);
......@@ -22,6 +15,18 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
event: function() {
var that = cost;
var _doc = $(document);
//从连接拿数据
cost.id = getUrlParam('cost_id');
var status = getUrlParam('cost_status');
if(status == 4){
cost.checkUrl = '/index/checkCostTwo/1'
}else if(status == 0){
cost.checkUrl = '/index/checkCostThree/2'
}else if(status == 1){
cost.checkUrl = '/index/checkCostFour/3'
}else if(status == 2){
cost.checkUrl = '/index/checkCostFive/4'
}
//初始化
$('.pic-con2').show();
$('.pic-con1').hide();
......@@ -38,6 +43,10 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$(document).on('click','#export',function(e){
that.exportExcel();
});
//审核通过
$(document).on('click','#pass_check',function(e){
that.checkCost();
});
//新增报销 上传图片
$('#file_input_pic').on('change', function(){
var _this = $(this);
......@@ -134,15 +143,14 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
})
},
//删除退款
deleteRefund: function(id) {
//审核通过
checkCost: function() {
$.ajax({
url: '/index/delRefund',
url: cost.checkUrl,
type: 'POST',
async: true,
data: {
"refund_id": id
"id": cost.id
},
dataType: 'json',
success: function(data) {
......
......@@ -56,9 +56,8 @@
[% } %]
<td>
<a class="btn1 btn-success add-pic" href="#modal-addPic" data-toggle="modal" data-id='[%= it[item]["id"] %]'>审核</a>
<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 is_del" href="#modal-delete" data-toggle="modal" data-id='[%= it[item]["id"] %]'>删除</a>
</td>
</tr>
[% } %]
......
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