12.28功能提交

master
zhengyongxing 4 years ago
parent cd46d4c685
commit 29e8421266

@ -89,6 +89,12 @@ class CompanyStatementOfflineController extends ThinkController
$v["payment"] = $v["pay_status_str"];
}
if ($v['pay_check'] == 0) {
$v['pay_check_str'] = "未确认";
} else {
$v['pay_check_str'] = "已确认";
}
$v['oplist'] = $this->OpAuth($v);
}
@ -107,6 +113,78 @@ class CompanyStatementOfflineController extends ThinkController
$this->display();
}
//打款设置
public function setPayment(){
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$CompanyInfo = M("company_statement_info","tab_")
->alias('i')
->field("i.id,i.pool_id,i.company_name,i.company_info,i.statement_money,i.remark,i.pay_status,i.verify_status,p.statement_num,i.statement_money")
->join("tab_company_statement_pool p ON p.id = i.pool_id")
->where("i.id in({$id})")
->select();
$all_money = 0;
foreach($CompanyInfo as $k=>&$v){
if($v['verify_status'] == 2){
$v['is_payment'] = 2;
}else{
$v['is_payment'] = 1;
}
$v['company_info'] = json_decode($v['company_info'],true);
$v['company_info']['ali_user'] ?? '';
$v['company_info']['ali_account'] ?? '';
$all_money += $v['statement_money'];
}
$this->assign('all_money',$all_money);
$this->assign("CompanyInfo",$CompanyInfo);
$this->assign("id",$id);
$this->display();
}
//修改打款设置
public function editPayment(){
if(!isset($_REQUEST['info'])) $this->error("参数错误");
$info = $_REQUEST['info'];
// dump($info);die();
$CompanyInfo = M("company_statement_info","tab_");
//循环保存
foreach($info as $k=>$v){
$ydata = $CompanyInfo->where("id= '{$k}'")->find();
$company_info = json_decode($ydata['company_info'],true);
if($ydata['verify_status'] == 2){
$company_info['payee_name'] = $v['payee_name'];
$company_info['bank_account'] = $v['bank_account'];
$company_info['opening_bank'] = $v['opening_bank'];
}else{
$company_info['ali_user'] = $v['ali_user'];
$company_info['ali_account'] = $v['ali_account'];
}
$savedata = [
"company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE),
"remark"=>$v['remark'],
"pay_check"=>1,
"id"=>$k
];
$CompanyInfo->save($savedata);
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"打款信息编辑成功"
));
}
public function doPayment()
{
if(!isset($_REQUEST['ids']) || !isset($_REQUEST['payment_time'])) $this->error("参数错误");
@ -236,8 +314,9 @@ class CompanyStatementOfflineController extends ThinkController
public function menuAuth()
{
$mentBtn = [
"setPayment"=>"<a class='butn' id='setPayment'>打款信息确认</a>",
"doPayment"=>"<a class='butn' id='doPayment'>打款确认</a>",
"export"=>"<a class='butn' id='export'>批量导出</a>"
"export"=>"<a class='butn' id='export'>批量导出</a>",
];
$resarr = [];
foreach ($mentBtn as $k => $v) {

@ -1151,7 +1151,7 @@ class CompanyStatementPoolController extends ThinkController
}
}
//线上打款审核状态撤回
M("company_statement_info","tab_")->where("pool_id={$id}")->save(['pay_verify_status'=>0,'verify_time'=>'','verify_member_id'=>0]);
M("company_statement_info","tab_")->where("pool_id={$id}")->save(['pay_verify_status'=>0,'verify_time'=>'','verify_member_id'=>0,'pay_check'=>0,'remark'=>'']);
//线上打款支付宝状态撤回
M("company_statement_info","tab_")->where("pool_id={$id} and verify_status != 2")->save(['verify_status'=>0]);
@ -1206,6 +1206,9 @@ class CompanyStatementPoolController extends ThinkController
if($ajaxreturn){
if ($change_status == 2) {
$this->autoSetPayment($ids);
$this->splitForPayStatementInfo();
}
@ -1233,6 +1236,62 @@ class CompanyStatementPoolController extends ThinkController
));
}
public function autoSetPayment($pool_id) {
$CompanyInfo = M("company_statement_info","tab_");
$pool_id = explode(',',$pool_id);
foreach ($pool_id as $pkey => $pvalue) {
$data = $CompanyInfo->where(['pool_id'=>['in',$pvalue]])->select();
foreach ($data as $key => $value) {
if($value['verify_status'] != 2) {
$CompanyInfo->where(['id'=>$value['id']])->save(['verify_status'=>1]);
}
}
}
//循环保存
// foreach($info as $k=>$v){
// $ydata = $CompanyInfo->where("id= '{$k}'")->find();
// $company_info = json_decode($ydata['company_info'],true);
// if($ydata['verify_status'] == 2){
// $company_info['payee_name'] = $v['payee_name'];
// $company_info['bank_account'] = $v['bank_account'];
// $company_info['opening_bank'] = $v['opening_bank'];
// }else{
// $company_info['ali_user'] = $v['ali_user'];
// $company_info['ali_account'] = $v['ali_account'];
// }
// $savedata = [
// "company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE),
// "remark"=>$v['remark'],
// "id"=>$k
// ];
// if($ydata['verify_status'] != 2){
// if(empty($v['ali_user']) || empty($v['ali_account'])){
// $savedata['verify_status'] = -1;
// }else{
// $savedata['verify_status'] = 1;
// }
// }
// $CompanyInfo->save($savedata);
// }
// $verify_status = $this->DBModel->field("verify_status")->where("id = {$pool_id}")->find()['verify_status'];
// if( $verify_status == 6){
// $this->setOneVerifyStatus(1,"payment",$_REQUEST['pool_id'],$mgs = "打款信息确认");
// }else{
// $this->ajaxReturn(array(
// 'status' => 1,
// "info"=>"打款信息编辑成功"
// ));
// }
}
//打款设置
public function setPayment(){
if(!isset($_REQUEST['id'])) $this->error("参数错误");
@ -1721,7 +1780,8 @@ class CompanyStatementPoolController extends ThinkController
$optist = ["viewPool","addRemark","viewRemark","editRemark","reCount","cancelPool"];
break;
case '6':
$optist = ["viewPool","addRemark","viewRemark","editRemark","reCount","cancelPool","setPayment"];
$optist = ["viewPool","addRemark","viewRemark","editRemark","reCount","cancelPool"];
// ,"setPayment"];
break;
default:
break;

@ -93,6 +93,17 @@ class PaymentController extends BaseController
}
// dump($map);die();
$sum = M("pay_statement_info","tab_")
->alias('c')
->field("sum(if(c.pay_status=0,c.statement_money,0)) unpay_amount,sum(if(c.pay_status>0,c.statement_money,0)) pay_amount,sum(if(c.pay_status<0,c.statement_money,0)) faild_pay_amount")
->join("left join tab_company_statement_info s on c.statement_info_id = s.id")
->where($map)
->find();
$this->assign('sum',$sum);
// dump($sum);die();
$CompanyInfo = M("company_statement_info","tab_")
->alias('s')
->field("s.*,p.statement_num statement_pool_num")
@ -118,17 +129,29 @@ class PaymentController extends BaseController
$v['verify_status_str'] .= ("/". $v['pay_type']);
}
}
$companypay_info = json_decode($v['company_info'],true);
if (empty($companypay_info['ali_user']) || empty($companypay_info['ali_account'])) {
$v['verify_status'] = -1;
$v['verify_status_str']="信息配置不全";
$v['can_pay'] = 0;
}
if($v['pay_verify_status'] == 0){
$v['verify'] = "--";
if($v['pay_check'] == 0){
$v['pay_check_detail'] = "--";
}else {
$member = M("payment_member")
->field("name")
->where(['id'=>$v['verify_member_id']])
->where(['id'=>$v['pay_check_member_id']])
->find();
$v['verify'] = (($v['pay_verify_status'] == 1)?'审核通过':'审核拒绝')."({$member['name']})<br>".date('Y-m-d H:i:s', $v['verify_time']);;
$v['pay_check_detail'] = $member['name'].(($v['pay_check'] == 1)?'已确认':'未确认')."<br>".date('Y-m-d H:i:s', $v['pay_check_time']);;
}
// if ($v['pay_check'] == 0) {
// $v['pay_check_str'] = "未确认";
// } else {
// $v['pay_check_str'] = "已确认";
// }
$v['company_type'] = $this->CompanyType[$v['company_type']];
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']);
@ -194,7 +217,6 @@ class PaymentController extends BaseController
$countmap['pay_status']=["neq",1];
$money = M("company_statement_info","tab_")->alias('s')->field("sum(statement_money) statement_money")->where($countmap)->find();
$count = M("company_statement_info","tab_")->alias('s')->field("count(id) count")->where($map)->find();
$page = set_pagination($count['count'], $row);
if ($page) {
@ -207,6 +229,75 @@ class PaymentController extends BaseController
$this->assign("PayStatus", $this->PayStatus);
$this->display();
}
//导出
public function export() {
if(!isset($_REQUEST['id'])){
$this->error('参数错误');
}
$id = $_REQUEST['id'];
$data = M("company_statement_info","tab_")
->alias('s')
->field("s.*,p.statement_num statement_pool_num")
->join("left join tab_company_statement_pool p ON p.id = s.pool_id")
->where(['s.id'=>['in',$id]])
->order("FIELD(s.pay_status,0,-1,1),s.verify_status desc")
->select();
foreach ($data as $key => $value) {
$company_info = json_decode($value['company_info'],true);
$data[$key]['ali_user'] = $company_info['ali_user'];
$data[$key]['ali_account'] = $company_info['ali_account'];
$data[$key]['statement_time'] = date("Y-m-d H:i:s",$value['statement_begin_time']).'-'.date("Y-m-d H:i:s",$value['statement_end_time']);
if($value['pay_check'] == 0){
$v['pay_check_detail'] = "--";
}else {
$member = M("payment_member")
->field("name")
->where(['id'=>$value['pay_check_member_id']])
->find();
$data[$key]['pay_check_detail'] = $member['name'].(($value['pay_check'] == 1)?'已确认':'未确认').date('Y-m-d H:i:s', $value['pay_check_time']);;
}
$data[$key]['pay_status_str'] = $value['pay_status']==1?"已打款":($value['pay_status']==-1?'打款失败':'未打款');
$data[$key]['pay_time'] = $value['pay_time']?date("Y-m-d H:i:s",$value['pay_time']):'未支付';
}
$title = [
'company_name' => '公司名称',
'statement_time' => '结算时间',
'statement_money' => '结算金额',
'ali_user' => '支付宝真实姓名',
'ali_account'=>'支付宝账号',
'remark'=>'备注',
'statement_pool_num'=>'汇总单号',
'pay_check_detail'=>'打款信息确认',
'pay_status_str'=>'打款状态',
'pay_time'=>'打款时间',];
$sum = M("pay_statement_info","tab_")
->alias('s')
->field("sum(if(s.pay_status=0,s.statement_money,0)) unpay_amount,sum(if(s.pay_status>0,s.statement_money,0)) pay_amount,sum(if(s.pay_status<0,s.statement_money,0)) faild_pay_amount")
->join("left join tab_company_statement_info c on s.statement_info_id = c.id")
->where(['statement_info_id'=>['in',$id]])
->find();
$money = M("company_statement_info","tab_")->alias('s')->field("sum(statement_money) statement_money")->where(['s.id'=>['in',$id]])->find();
$sumData = [
'company_name'=>'合计',
'statement_time' => "待打款金额: {$money['statement_money']} 打款成功: {$sum['pay_amount']} 打款失败: {$sum['faild_pay_amount']}",
];
$data = array_merge($data,[$sumData]);
// dump($data);die();
data2csv($data,'线上打款',$title);
// $this->ajaxReturn(['stauts'=>1,'msg'=>'导出成功']);
}
//查看
public function viewPool()
{
@ -329,52 +420,55 @@ class PaymentController extends BaseController
}
foreach($handle_data as $hk => $hv) {
$substract = 1;
if ($is_export) {
for (;;) {
if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]['account']) {
// if (
// $hv['account'] == 'zj9587' ||
// $hv['account'] == 'ruiyou' || $hv['account'] == 'weicheng') {
// dump($handle_data[$hk]['time']);
// foreach($handle_data as $hk => $hv) {
// $substract = 1;
// if ($is_export) {
//
// for (;;) {
//
// if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]['account']) {
//// if (
//// $hv['account'] == 'zj9587' ||
//// $hv['account'] == 'ruiyou' || $hv['account'] == 'weicheng') {
//// dump($handle_data[$hk]['time']);
//// }
//
// $week_line++;
// $substract++;
// } else {
// break;
// }
//
// }
//
// if (count($hv['game_list'])>1) {
// $week_line += count($hv['game_list'])-1;
// }
//
// $handle_data[$hk]['week_amount'] = "=ROUND(SUM(O{$old_line}:O{$week_line})+SUM(P{$old_line}:P{$week_line})-SUM(Q{$old_line}:Q{$week_line})-SUM(R{$old_line}:R{$week_line}),2)";
//
// if ($hk > 0) {
// $handle_data[0]['week_amount'] = str_replace($old_line,$week_line,$handle_data[0]['week_amount']);
// }
//
// if (count($hv['game_list'])>1) {
//
// $old_line += count($hv['game_list']);
//
// } else {
// $old_line++;
// }
//
// if(count($hv['game_list'])>1) {
//
// $week_line = $old_line ;
// } else {
// $week_line = $old_line;
// }
//
// }
//
// }
$week_line++;
$substract++;
} else {
break;
}
}
if (count($hv['game_list'])>1) {
$week_line += count($hv['game_list'])-1;
}
$handle_data[$hk]['week_amount'] = "=ROUND(SUM(O{$old_line}:O{$week_line})+SUM(P{$old_line}:P{$week_line})-SUM(Q{$old_line}:Q{$week_line})-SUM(R{$old_line}:R{$week_line}),2)";
if (count($hv['game_list'])>1) {
$old_line += count($hv['game_list']);
} else {
$old_line++;
}
if(count($hv['game_list'])>1) {
$week_line = $old_line ;
} else {
$week_line = $old_line;
}
}
}
return $handle_data?$handle_data:[];
}
@ -619,6 +713,168 @@ class PaymentController extends BaseController
$this->display("viewCpPool");
}
//打款设置
public function setPayment(){
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$CompanyInfo = M("company_statement_info","tab_")
->alias('i')
->field("i.id,i.pool_id,i.company_name,i.company_info,i.statement_money,i.remark,i.pay_status,i.verify_status,p.statement_num,i.statement_money")
->join("tab_company_statement_pool p ON p.id = i.pool_id")
->where("i.id in({$id})")
->select();
$all_money = 0;
foreach($CompanyInfo as $k=>&$v){
if($v['verify_status'] == 2){
$v['is_payment'] = 2;
}else{
$v['is_payment'] = 1;
}
$v['company_info'] = json_decode($v['company_info'],true);
$v['company_info']['ali_user'] ?? '';
$v['company_info']['ali_account'] ?? '';
$all_money += $v['statement_money'];
}
$this->assign('all_money',$all_money);
$this->assign("CompanyInfo",$CompanyInfo);
$this->assign("id",$id);
$this->display();
}
public function returnSetPayment() {
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$ids = explode(',',$ids);
$CompanyInfo = M("company_statement_info","tab_");
$CompanyInfo
->where(['id'=>['in',$ids]])
->save([
'pay_check'=>0,
'pay_check_member_id'=>0,
'pay_check_time'=>0
]);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"打款信息编辑成功"
));
}
//修改打款设置
public function editPayment(){
if(!isset($_REQUEST['info'])) $this->error("参数错误");
$info = $_REQUEST['info'];
$id = [];
$CompanyInfo = M("company_statement_info","tab_");
//循环保存
foreach($info as $k=>$v){
array_push($id,$k);
$ydata = $CompanyInfo->where("id= '{$k}'")->find();
$company_info = json_decode($ydata['company_info'],true);
if($ydata['verify_status'] == 2){
$company_info['payee_name'] = $v['payee_name'];
$company_info['bank_account'] = $v['bank_account'];
$company_info['opening_bank'] = $v['opening_bank'];
}else{
$company_info['ali_user'] = $v['ali_user'];
$company_info['ali_account'] = $v['ali_account'];
}
$savedata = [
"company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE),
"remark"=>$v['remark'],
"pay_check"=>1,
"pay_check_member_id"=>$member_id = $_SESSION['onethink_admin']['payment_user']['id'],
"id"=>$k,
"pay_check_time"=>time()
];
M("pay_statement_info","tab_")->where(['statement_info_id'=>$k])->save(["company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE)]);
$CompanyInfo->save($savedata);
}
$companyStatementInfo = M("company_statement_info","tab_")
->where([
'id'=>['in',$id]
])
->select();
foreach ($companyStatementInfo as $key => $value) {
if ($value['statement_money'] <= 0) {
$payres["remark"] = '打款金额非正,直接打款成功';
$pay_info = json_encode($payres, JSON_UNESCAPED_UNICODE);
M("company_statement_info","tab_")
->where([
'id'=>['in',$value['id']]
])
->save(['pay_status'=>1,'pay_time'=>time(),'pay_type'=>2,'pay_info'=>$pay_info]);
M("pay_statement_info","tab_")
->where([
'statement_info_id'=>['in',$value['id']]
])
->save(['pay_status'=>1,'pay_time'=>time(),'pay_type'=>2,'pay_info'=>$pay_info]);
} else {
$payres["remark"] = '打款金额非正,直接打款成功';
$pay_info = json_encode($payres, JSON_UNESCAPED_UNICODE);
M("pay_statement_info","tab_")
->where([
'statement_info_id'=>['in',$value['id']],
'statement_money'=>['elt',0]
])
->save(['pay_status'=>1,'pay_time'=>time(),'pay_type'=>2,'pay_info'=>$pay_info]);
$pay_statement_info = M("pay_statement_info","tab_")
->where([
'statement_info_id'=>['in',$value['id']]
])
->order("statement_money ASC")
->select();
$subtraction = 0;
foreach ($pay_statement_info as $sk => $sv) {
if ($sv['statement_money'] < 0) {
$subtraction += -($sv['statement_money']);
$sv['final_statement_money'] = 0;
} elseif($sv['statement_money'] > 0 && $subtraction > 0) {
if($sv['statement_money'] >= $subtraction) {
$sv['final_statement_money'] = $sv['statement_money']-$subtraction;
$subtraction = 0;
} else {
$sv['final_statement_money'] = 0;
$subtraction =-$sv['final_statement_money'];
}
}
M("pay_statement_info","tab_")
->where([
'id'=>$sv['id']
])->save($sv);
}
}
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"打款信息编辑成功"
));
}
public function transfer_set()
{
$this->getAccountMoney();
@ -900,10 +1156,16 @@ class PaymentController extends BaseController
$fund = new \Fund(C("ALI_PAYMENT"));
$dbres = M("pay_statement_info", "tab_")->where("id='{$id}'")->find();
$company_statement = M("company_statement_info", "tab_")->field("pay_check")->where(['id'=>$dbres['statement_info_id']])->find();
if ($company_statement['pay_check']!=1) {
$this->ajaxReturn(["success"=>"打款信息未确认,打款失败","data"=>["status"=>0]]);
}
$company_info = json_decode($dbres['company_info'], true);
if ($dbres['pay_status'] != 1 && $dbres['verify_status'] == 1) {
//执行打款
$title = "信息服务费";
$title = $remark;
$amount = $dbres['final_statement_money'];
$payres = $fund->transfer($company_info['ali_account'], $company_info['ali_user'], $dbres['statement_num'], $amount, $title);

@ -214,9 +214,12 @@
<if condition="session('payment_user.is_payment') eq 1">
<a class='butn' id='doPayment'>打款</a>
</if>
<a class='butn verify' data-value='1'>审核通过</a>
<a class='butn verify' data-value='2'>审核拒绝</a>
<a class='butn return_verify' data-value='0' style="background-color: red;">审核撤回</a>
<!-- <a class='butn verify' data-value='1'>审核通过</a>-->
<!-- <a class='butn verify' data-value='2'>审核拒绝</a>-->
<!-- <a class='butn return_verify' data-value='0' style="background-color: red;">审核撤回</a>-->
<a class='butn setPayment'>打款信息确认</a>
<a class='butn returnSetPayment' id="returnSetPayment">打款信息确认撤回</a>
<a class='butn' id='export'>导出</a>
</div>
</div>
@ -233,7 +236,8 @@
<th>结算时间</th>
<th>关联汇总单号</th>
<th>结算金额</th>
<th>审批状态</th>
<th>打款信息确认状态</th>
<!-- <th>审批状态</th>-->
<!-- <th>结算流水</th>-->
<th>打款状态</th>
<th>支付时间</th>
@ -252,19 +256,18 @@
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td ><input class="ids" type="checkbox" value="{$data['ids']}" data-verify_id="{$data['id']}" data-pay="{$data['can_pay']}" name="ids[]" data-paystatus="{$data.pay_status}" data-verifystatus="{$data.pay_verify_status}"></td>
<td ><input class="ids" type="checkbox" value="{$data['ids']}" data-verify_id="{$data['id']}" data-pay_check="{$data['pay_check']}" data-pay="{$data['can_pay']}" name="ids[]" data-paystatus="{$data.pay_status}" data-verify_status="{$data['verify_status']}" data-verifystatus="{$data.pay_verify_status}"></td>
<td style="text-align: left">{$data.company_name}</td>
<td>{$data.company_type}</td>
<td>{$data.valid}</td>
<td>{$data.statement_pool_num}</td>
<td>{$data.statement_money}</td>
<td>{$data.verify|default='--'}</td>
<td>{$data.pay_check_detail}</td>
<!-- <td>{$data.verify|default='&#45;&#45;'}</td>-->
<!-- <td>{$data.platform_amount}</td>-->
<if condition="($data['verify_status'] eq -1) OR ($data['pay_status'] eq -1) ">
<td style="color: red;">{$data.verify_status_str}</td>
<else />
<td style="color: red;">{$data.verify_status_str}</td><else />
<td>{$data.verify_status_str}</td>
</if>
@ -275,6 +278,9 @@
<if condition="$data['pay_status'] neq 0 and count($data['son_info']) elt 1">
<a class='confirm paymentInfo' data-id="{$data['son_info'][0]['id']}">打款详情</a>
</if>
<!-- <if condition="$data['pay_check'] eq 0">-->
<!-- <a class='confirm setPayment' data-id='{$data.id}'>打款信息确认</a>-->
<!-- </if>-->
</td>
</tr>
<volist name="data.son_info" id="s_data">
@ -289,7 +295,8 @@
<td>{$s_data.statement_pool_num}</td>
<td>{$s_data.statement_money}</td>
<td>{$data.verify|default='--'}</td>
<td>{$data.pay_check_detail}</td>
<!-- <td>{$data.verify|default='&#45;&#45;'}</td>-->
<!-- <td>{$data.platform_amount}</td>-->
<if condition="($s_data['verify_status'] eq -1) OR ($s_data['pay_status'] eq -1) ">
<td style="color: red;">{$s_data.verify_status_str}</td>
@ -309,7 +316,7 @@
</if>
</volist>
</volist>
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">待打款金额:&nbsp;{$money.statement_money}</td></tr>
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">待打款金额:&nbsp;{$sum['unpay_amount']|default='0.00'}&nbsp;&nbsp;打款成功:&nbsp;{$sum['pay_amount']|default='0.00'}&nbsp;打款失败:&nbsp;{$sum['faild_pay_amount']|default='0.00'}</td></tr>
</notemtpy>
</tbody>
</table>
@ -430,158 +437,189 @@
$(function(){
$(".return_verify").click(function () {
var status = $(this).data('value');
var verifytip = 0;
var paytip = 0;
var canpay = 0;
// $(".return_verify").click(function () {
//
// var status = $(this).data('value');
// var verifytip = 0;
// var paytip = 0;
// var canpay = 0;
//
// var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
//
// var verifystatus = $(elem).data('verifystatus');
// var pay_status = $(elem).data('paystatus');
//
// if (verifystatus == 0) {
// verifytip = 1;
// return ;
// }
//
// if (pay_status != 0) {
// paytip = 1;
// return ;
// }
//
// return $(elem).data('verify_id');
//
// }).get();
//
// if (verifytip == 1) {
// layer.msg("<font style='color:white'>" + '请选择已审核的打款单' + "</font>");
// return;
// }
//
// if (paytip == 1) {
// layer.msg("<font style='color:white'>" + '请选择未打款的打款单' + "</font>");
// return;
// }
//
// if(text.length < 1){
// layer.msg("<font style='color:white'>" + '请先选择要操作的打款单' + "</font>");
// return;
// }
//
// layer.confirm('【提示】是否取消审核'+((status==1)?'通过':'拒绝'), {
// btn: ['确认','取消'],
// title:false
// }, function(){
// $.ajax({
// type:'post',
// dataType:'json',
// data: {'id':text,'status':status},
// url:"{:U('verify')}",
// success:function(data) {
//
// if (data.status ==1) {
// //弹框
// layer.msg("<font style='color:white'>审批撤回成功</font>");
// setTimeout(function(){
// window.location.reload();
// },1500);
// } else {
// layer.msg("<font style='color:white'>审批撤回失败</font>");
// }
// },
// error:function() {
// alert('服务器开小差了,请稍后再试。');
// // checkcode(mobile);
// }
// });
//
// });
//
// });
//
//
// $(".verify").click(function () {
//
// var status = $(this).data('value');
// var verifytip = 0;
// var paytip = 0;
// var canpay = 0;
// var paychecktip = 0;
//
// var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
//
// var verifystatus = $(elem).data('verifystatus');
// var pay_status = $(elem).data('paystatus');
//
// if (verifystatus > 0) {
// verifytip = 1;
// return ;
// }
//
// if (pay_status != 0) {
// paytip = 1;
// return ;
// }
//
// if($(elem).data("pay") != 1) {
// canpay = 1;
// return;
// }
//
// if($(elem).data("pay_check") == 0) {
// paychecktip = 1;
// return;
// }
//
// return $(elem).data('verify_id');
//
// }).get();
//
// if (paychecktip == 1) {
// layer.msg("<font style='color:white'>" + '请选择打款信息已确认的打款单' + "</font>");
// return;
// }
//
// if (verifytip == 1) {
// layer.msg("<font style='color:white'>" + '请选择未审核的打款单' + "</font>");
// return;
// }
//
// if (paytip == 1) {
// layer.msg("<font style='color:white'>" + '请选择未打款的打款单' + "</font>");
// return;
// }
//
// if (canpay == 1) {
// layer.msg("<font style='color:white'>" + '请选择信息配置完全的打款单' + "</font>");
// return;
// }
//
// if(text.length < 1){
// layer.msg("<font style='color:white'>" + '请先选择要操作的打款单' + "</font>");
// return;
// }
//
// layer.confirm('【提示】是否确认审核'+((status==1)?'通过':'拒绝'), {
// btn: ['确认','取消'],
// title:false
// }, function(){
// $.ajax({
// type:'post',
// dataType:'json',
// data: {'id':text,'status':status},
// url:"{:U('verify')}",
// success:function(data) {
// layer.msg("<font style='color:white'>" + data.msg + "</font>");
// if (data.status ==1) {
// //弹框
// setTimeout(function(){
// window.location.reload();
// },1500);
// }
// },
// error:function() {
// alert('服务器开小差了,请稍后再试。');
// // checkcode(mobile);
// }
// });
//
// });
//
// });
$("#export").click(function () {
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
var verifystatus = $(elem).data('verifystatus');
var pay_status = $(elem).data('paystatus');
if (verifystatus == 0) {
verifytip = 1;
return ;
}
if (pay_status != 0) {
paytip = 1;
return ;
}
return $(elem).data('verify_id');
return $(elem).data("verify_id");
}).get();
if (verifytip == 1) {
layer.msg("<font style='color:white'>" + '请选择已审核的打款单' + "</font>");
return;
}
if (paytip == 1) {
layer.msg("<font style='color:white'>" + '请选择未打款的打款单' + "</font>");
return;
}
if(text.length < 1){
layer.msg("<font style='color:white'>" + '请先选择要操作的打款单' + "</font>");
layer.msg("<font style='color:white'>" + '请先选择要导出的打款单' + "</font>");
return;
}
layer.confirm('【提示】是否取消审核'+((status==1)?'通过':'拒绝'), {
btn: ['确认','取消'],
title:false
}, function(){
$.ajax({
type:'post',
dataType:'json',
data: {'id':text,'status':status},
url:"{:U('verify')}",
success:function(data) {
if (data.status ==1) {
//弹框
layer.msg("<font style='color:white'>审批撤回成功</font>");
setTimeout(function(){
window.location.reload();
},1500);
} else {
layer.msg("<font style='color:white'>审批撤回失败</font>");
}
},
error:function() {
alert('服务器开小差了,请稍后再试。');
// checkcode(mobile);
_export();
function _export(){
layer.alert("<font style='color:#333'>"+"指令执行成功,等待浏览器响应中..在未确认下载完成前请勿关闭此页面.."+ "</font>");
var id = text.join(",");
var url ="{:U('export')}"+"&id="+id;
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>"//添加下载的地址到iframe这里是公司信息我用**表示了。
$("body").append(iframeExcel);
}
});
});
});
$(".verify").click(function () {
var status = $(this).data('value');
var verifytip = 0;
var paytip = 0;
var canpay = 0;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
var verifystatus = $(elem).data('verifystatus');
var pay_status = $(elem).data('paystatus');
if (verifystatus > 0) {
verifytip = 1;
return ;
}
if (pay_status != 0) {
paytip = 1;
return ;
}
if($(elem).data("pay") != 1) {
canpay = 1;
return;
}
return $(elem).data('verify_id');
}).get();
if (verifytip == 1) {
layer.msg("<font style='color:white'>" + '请选择未审核的打款单' + "</font>");
return;
}
if (paytip == 1) {
layer.msg("<font style='color:white'>" + '请选择未打款的打款单' + "</font>");
return;
}
if (canpay == 1) {
layer.msg("<font style='color:white'>" + '请选择信息配置完全的打款单' + "</font>");
return;
}
if(text.length < 1){
layer.msg("<font style='color:white'>" + '请先选择要操作的打款单' + "</font>");
return;
}
layer.confirm('【提示】是否确认审核'+((status==1)?'通过':'拒绝'), {
btn: ['确认','取消'],
title:false
}, function(){
$.ajax({
type:'post',
dataType:'json',
data: {'id':text,'status':status},
url:"{:U('verify')}",
success:function(data) {
layer.msg("<font style='color:white'>" + data.msg + "</font>");
if (data.status ==1) {
//弹框
setTimeout(function(){
window.location.reload();
},1500);
}
},
error:function() {
alert('服务器开小差了,请稍后再试。');
// checkcode(mobile);
}
});
});
});
var company_id = "{$_GET['company_id']??0}";
$("#company_type").on("change",function(){
var val = $(this).find("option:selected").val();
@ -605,7 +643,7 @@
$("#company_id").html(companystr);
$("#company_id").select2();
})
})
});
$("#company_type").change();
$(".viewPool").click(function () {
@ -638,8 +676,8 @@
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
var verifystatus = $(elem).data('verifystatus');
if($(elem).data("pay") == 1 && verifystatus == 1){
// var verifystatus = $(elem).data('verifystatus');
if($(elem).data("pay") == 1 ){
return $(elem).data("verify_id");
}
@ -685,13 +723,12 @@
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
var verifystatus = $(elem).data('verifystatus');
if($(elem).data("pay") == 1 && verifystatus == 1 && $(elem).val()!=''){
if($(elem).data("pay") == 1 && $(elem).val()!=''){
return $(elem).val();
}
}).get();
console.log(text)
text = text.join(",");
if (!text) {
@ -712,26 +749,143 @@
$("#commit").on("click",function () {
doPayment();
});
$(".setPayment").on("click",function(){
// var id = $(this).data("id");
var tip = 0;
var paystatustip = 0;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if(($(elem).data("pay_check") == 0 || $(elem).data("verify_status") == -1) && $(elem).data("paystatus") != 1){
return $(elem).data("verify_id");
}
if ($(elem).data("pay_check") != 1) {
tip = 1;
}
if ($(elem).data("paystatus") == 1) {
paystatustip = 1;
}
}).get();
if(tip == 1) {
layer.msg("<font style='color: white'>请选择打款信息未确认的单子</font>");
return;
}
if(paystatustip == 1) {
layer.msg("<font style='color: white'>请选择未打款的单子</font>");
return;
}
text = text.join(",");
if (!text) {
layer.msg("<font style='color: white'>没有符合打款确认的打款单,请重新选择</font>");
return;
}
var url = "{:U('setPayment')}"+"&id="+text
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['100%', '100%'],
content: url
});
});
$("#returnSetPayment").on("click",function () {
var paystatustip = 0;
var tip = 0;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("pay_check") == 1 && $(elem).data("paystatus") != 1){
return $(elem).data("verify_id");
}
if ($(elem).data("pay_check") != 1) {
tip = 1;
}
if ($(elem).data("paystatus") == 1) {
paystatustip = 1;
}
}).get();
if(tip == 1) {
layer.msg("<font style='color: white'>请选择打款信息已确认的单子</font>");
return;
}
if(paystatustip == 1) {
layer.msg("<font style='color: white'>请选择未打款的单子</font>");
return;
}
text = text.join(",");
layer.confirm('【提示】是否确认打款信息撤回', {
btn: ['确认','取消'],
title:false
}, function(){
$.ajax({
type:'post',
dataType:'json',
data: {'ids':text},
url:"{:U('returnSetPayment')}",
success:function(data) {
if (data.status == 1) {
layer.msg("<font style='color: white'>打款信息确认撤回成功</font>");
window.location.reload();
return;
}
},
error:function() {
alert('服务器开小差了,请稍后再试。');
}
})
});
});
$("#doPayment").on("click",function(){
var verifytip = 0;
var pay_checktip = 0;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
var verifystatus = $(elem).data('verifystatus');
if($(elem).data("pay") == 1 && verifystatus == 1){
// var verifystatus = $(elem).data('verifystatus');
var pay_check = $(elem).data('pay_check');
if($(elem).data("pay") == 1 && pay_check == 1){
return $(elem).val();
}
if (verifystatus != 1) {
verifytip = 1;
// if (verifystatus != 1) {
// verifytip = 1;
// }
if (pay_check != 1) {
pay_checktip = 1;
}
}).get();
if (verifytip == 1) {
layer.msg("<font style='color:white'>审核通过方能打款</font>");
if (pay_checktip == 1) {
layer.msg("<font style='color:white'>打款确认后方能打款</font>");
return;
}
// if (verifytip == 1) {
// layer.msg("<font style='color:white'>审核通过方能打款</font>");
// return;
// }
if(text.length < 1){
layer.msg("<font style='color:white'>请先选择需要打款的结算单</font>");
return;

Loading…
Cancel
Save