新增聚合操作日志

master
chenzhi 5 years ago
parent 63f5354dc3
commit 8137778ec1

@ -173,6 +173,7 @@ class AggregateFinanceStatementController extends ThinkController
$id = $_REQUEST['statement_id'];
$res = M("aggregate_statement","tab_")->where("id = '{$id}'")->save($adddata);
if($res !== false){
$this->doAddOperationLog($id,"申请开票");
$this->ajaxReturn(array("success"=>"ok","code"=>0));
}else{
$this->ajaxReturn(array("error"=>"database error","code"=>2000));
@ -333,6 +334,7 @@ class AggregateFinanceStatementController extends ThinkController
$save["admin_id"]=$this->admininfo["uid"];
}
M("aggregate_statement","tab_")->where("id = '{$id}'")->save($save);
$this->doAddOperationLog($id,"上传凭证");
$array=array(
'status' => 1,
"info"=>"上传成功",
@ -350,6 +352,7 @@ class AggregateFinanceStatementController extends ThinkController
unlink("./".$info['ext_field']);
}
M("aggregate_statement","tab_")->where("id = '{$id}'")->save(['ext_field'=>'']);
$this->doAddOperationLog($id,"删除凭证");
$this->ajaxReturn(array(
'status' => 1,
'info' => "删除成功"
@ -361,6 +364,7 @@ class AggregateFinanceStatementController extends ThinkController
$id = $_REQUEST['id'];
$remark = $_REQUEST['remark'];
M("aggregate_statement","tab_")->where("id = '{$id}'")->save(['remark'=>$remark]);
$this->doAddOperationLog($id,"新增备注");
$this->ajaxReturn(array(
'status' => 1,
'info' => "操作成功"
@ -372,6 +376,12 @@ class AggregateFinanceStatementController extends ThinkController
$ids = $_REQUEST['ids'];
$savedata = ["verify_status"=>2,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
M("aggregate_statement","tab_")->where("id in ({$ids})")->save($savedata);
$ids = explode(",",$ids);
foreach($ids as $k=>$v){
$this->doAddOperationLog($v,"审批通过");
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"审批通过成功"
@ -383,6 +393,12 @@ class AggregateFinanceStatementController extends ThinkController
$ids = $_REQUEST['ids'];
$savedata = ["verify_status"=>-1,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
M("aggregate_statement","tab_")->where("id in ({$ids})")->save($savedata);
$ids = explode(",",$ids);
foreach($ids as $k=>$v){
$this->doAddOperationLog($v,"审批拒绝");
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"审批拒绝成功"
@ -394,6 +410,12 @@ class AggregateFinanceStatementController extends ThinkController
$ids = $_REQUEST['ids'];
$savedata = ["verify_status"=>3,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
M("aggregate_statement","tab_")->where("id in ({$ids})")->save($savedata);
$ids = explode(",",$ids);
foreach($ids as $k=>$v){
$this->doAddOperationLog($v,"已开票");
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"已开票成功"
@ -405,6 +427,12 @@ class AggregateFinanceStatementController extends ThinkController
$ids = $_REQUEST['ids'];
$savedata = ["verify_status"=>5,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
M("aggregate_statement","tab_")->where("id in ({$ids})")->save($savedata);
$ids = explode(",",$ids);
foreach($ids as $k=>$v){
$this->doAddOperationLog($id,"已到账");
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"已到账成功"
@ -422,6 +450,8 @@ class AggregateFinanceStatementController extends ThinkController
'status' => 0,
"info"=>"重算结算金额失败"
));
}else{
$this->doAddOperationLog($v,"重算结算金额");
}
}
$this->ajaxReturn(array(
@ -436,6 +466,7 @@ class AggregateFinanceStatementController extends ThinkController
$id = $_REQUEST['id'];
$savedata = ["verify_status"=>1,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
M("aggregate_statement","tab_")->where("id ='{$id}'")->save($savedata);
$this->doAddOperationLog($id,"撤销审核");
$this->ajaxReturn(array(
'status' => 1,
"info"=>"撤销审核成功"
@ -454,6 +485,7 @@ class AggregateFinanceStatementController extends ThinkController
$savedata['pay_type'] =0;
}
M("aggregate_statement","tab_")->where("id ='{$id}'")->save($savedata);
$this->doAddOperationLog($id,"撤销申请");
$this->ajaxReturn(array(
'status' => 1,
"info"=>"撤销申请成功"
@ -474,6 +506,7 @@ class AggregateFinanceStatementController extends ThinkController
$big_pay_money = convertAmountToCn($data['ratio_money']);//大写
$data['receive_company'] = $data['pay_type'] ? $data['first_party_info'] : $data['second_party_info'];
$data['pay_company'] = $data['pay_type'] ? $data['second_party_info'] : $data['first_party_info'];
$this->doAddOperationLog($id,"导出");
$this->excelDownStreamTemplate($data,$big_pay_money);
}
public function excelDownStreamTemplate($data,$big_all_sum_money) {
@ -659,6 +692,27 @@ class AggregateFinanceStatementController extends ThinkController
}
return $resarr;
}
//操作日志
public function doAddOperationLog($id,$op_name)
{
$d= M("aggregate_statement","tab_")->where("id = '{$id}'")->find();
$first_party_info = json_decode($d['first_party_info'],true);
$second_party_info = json_decode($d['second_party_info'],true);
$statement_begin_time = date('Y.m.d', $d['begintime']);//对账开始时间
$statement_end_time = date('Y.m.d',$d['endtime']);//对账截止时间
$menu = "财务-结算管理-聚合渠道结算单管理";
if($d['withdraw_type'] == 1){
$m = date('Y.m', $d['begintime']);
$key = "{$second_party_info['partner']}&{$first_party_info['partner']}【{$m} 月结】";
}elseif($d['withdraw_type'] == 0){
$key ="{$second_party_info['partner']}&{$first_party_info['partner']}【{$statement_begin_time}-{$statement_end_time} 周结 正常结算】";
}else{
$key ="{$second_party_info['partner']}&{$first_party_info['partner']}【{$statement_begin_time}-{$statement_end_time} 周结 补点】";
}
addOperationLog(['op_type'=>1,'key'=>$key,"op_name"=>$op_name,'url'=>U(CONTROLLER_NAME.'/lists',$GetData),'menu'=>$menu]);
}
}

@ -398,7 +398,12 @@
//重算金额
$("#updateStatement").on("click",function(){
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
if($(elem).data("status") == 0 || $(elem).data("status") == 1 || $(elem).data("status") == -1){
return $(elem).val();
}else{
flag = true;
}
// return $(elem).val();
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要进行重新结算的结算单' + "</font>");
@ -637,34 +642,6 @@
});
}
});
// layer.prompt({
// formType: 2,
// value: remark,
// title: '修改备注',
// area: ['360px', '300px'] //自定义文本域宽高
// }, function(value, index, elem){
// if(value != ''){
// $.ajax({
// type: "POST",
// url: "{:U('saveRemark')}",
// dataType: 'json',
// async: false,
// data: {id:id,remark:value},
// success:function(data){
// if(data.status==1){
// layer.msg("<font style='color:white'>" + data.info + "</font>");
// setTimeout(function(){
// window.location.reload();
// },1500);
// }
// }
// });
// }else{
// layer.closeAll();
// }
// });
})
//查看批注
$(".viewRemark").click(function () {

Loading…
Cancel
Save