聚合财务子操作

master
chenzhi 5 years ago
parent 990c62b06a
commit 253b47b2a9

@ -109,7 +109,6 @@ class AggregateFinanceSetController extends Controller {
$dataurl .= $this->apihost."&".http_build_query($arr);
$html = file_get_contents($dataurl);
$rsp = json_decode($html,true);
var_dump($dataurl);
if($rsp['code'] != 1){
echo $rsp['error'].PHP_EOL;die;
}
@ -151,4 +150,5 @@ class AggregateFinanceSetController extends Controller {
}

@ -13,9 +13,15 @@ class AggregateFinanceStatementController extends ThinkController
"1"=>"申请开票",
"2"=>"审核同意",
"3"=>"已开票",
"4"=>"上传收款凭证",
"4"=>"上传凭证",
"5"=>"已到账"
];
public $admininfo;
public function _initialize()
{
$this->admininfo = $_SESSION['onethink_admin']['user_auth'];
parent::_initialize();
}
public function lists() {
$is_export= false;
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
@ -311,6 +317,8 @@ class AggregateFinanceStatementController extends ThinkController
if($info["verify_status"] == 3){
$save['verify_status'] = 4;
$save['create_time'] = time();
$save["admin_name"]=$this->admininfo["username"];
$save["admin_id"]=$this->admininfo["uid"];
}
M("aggregate_statement","tab_")->where("id = '{$id}'")->save($save);
$array=array(
@ -346,7 +354,50 @@ class AggregateFinanceStatementController extends ThinkController
'info' => "操作成功"
));
}
//审批通过
public function agreeApply(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$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);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"审批通过成功"
));
}
//审核拒绝
public function refuseApply(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$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);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"审批拒绝成功"
));
}
//已开票
public function Invoiced(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$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);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"已开票成功"
));
}
//已到账
public function Received(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$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);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"已到账成功"
));
}
//导出
public function export()
{

@ -115,9 +115,9 @@
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class="butn" id="agreeApply">审批通过</a>
<a class="butn" id="refuseApply" style="background-color: red;">审批拒绝</a>
<a class="butn" id="Invoiced">已开票</a>
<a class="butn" id="Received">已到账</a>
<a class="butn" id="upstream">已开票</a>
<a class="butn" id="upstream">已到账</a>
<a class="butn" id="upstream" style="width: 150px;background-color:green;">重算对账金额</a>
<a class="butn" id="export">批量导出</a>
@ -264,6 +264,7 @@
$("body").append(iframeExcel)
}
})
//审批通过
$("#agreeApply").on("click",function(){
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
@ -278,7 +279,7 @@
return;
}
if(flag){
layer.confirm("审批成功仅会对 已申请发票结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
layer.confirm("审批成功仅会对 [已申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
_doAgreeApply();
layer.close(index);
});
@ -287,7 +288,144 @@
}
function _doAgreeApply(){
//执行
$.ajax({
type: "POST",
url: "{:U('agreeApply')}",
dataType: 'json',
async: false,
data: {ids:text},
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}
})
//审批拒绝
$("#refuseApply").on("click",function(){
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") != 1){
flag = true;
}else{
return $(elem).val();
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要审核拒绝的结算单' + "</font>");
return;
}
if(flag){
layer.confirm("审批拒绝仅会对 [已申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
_doRefuseApply();
layer.close(index);
});
}else{
_doRefuseApply();
}
function _doRefuseApply(){
//执行
$.ajax({
type: "POST",
url: "{:U('refuseApply')}",
dataType: 'json',
async: false,
data: {ids:text},
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}
})
//已开票
$("#Invoiced").on("click",function(){
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") != 2){
flag = true;
}else{
return $(elem).val();
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要进行已开票的结算单' + "</font>");
return;
}
if(flag){
layer.confirm("已开票仅会对 [审核同意] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
_doInvoiced();
layer.close(index);
});
}else{
_doInvoiced();
}
function _doInvoiced(){
//执行
$.ajax({
type: "POST",
url: "{:U('Invoiced')}",
dataType: 'json',
async: false,
data: {ids:text},
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}
})
//已到账
$("#Received").on("click",function(){
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") == 3 || $(elem).data("status") == 4){
return $(elem).val();
}else{
flag = true;
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要进行已到账的结算单' + "</font>");
return;
}
if(flag){
layer.confirm("已到账仅会对 [已开票]或[已上传凭证] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
_doReceived();
layer.close(index);
});
}else{
_doReceived();
}
function _doReceived(){
//执行
$.ajax({
type: "POST",
url: "{:U('Received')}",
dataType: 'json',
async: false,
data: {ids:text},
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}
})
@ -509,6 +647,8 @@
});
});
$(".statement_del").click(function () {
var del = $(this).data();
layer.confirm('【警告】撤销后将不可回退,如需继续请点击确认', {

Loading…
Cancel
Save