Merge branch 'feature/finance_statement_three' of wmtx/platform into release
新增线下打款确认master
commit
25a9ea7262
@ -0,0 +1,254 @@
|
||||
<?php
|
||||
|
||||
namespace Admin\Controller;
|
||||
/**
|
||||
* 线下打款
|
||||
* @author cz
|
||||
*/
|
||||
class CompanyStatementOfflineController extends ThinkController
|
||||
{
|
||||
public $CompanyType = [
|
||||
"1"=>"下游公司",
|
||||
"2"=>"下游个人",
|
||||
"3"=>"上游公司"
|
||||
];
|
||||
public $IsPayment = [
|
||||
"1"=>"是",
|
||||
"2"=>"否"
|
||||
];
|
||||
public $PayStatus=[
|
||||
"-1"=>"打款失败",
|
||||
"0"=>"未打款",
|
||||
"1"=>"打款成功"
|
||||
];
|
||||
|
||||
public function lists() {
|
||||
$params = I('get.');
|
||||
$page = $params['p'] ? intval($params['p']) : 1;
|
||||
$row = $params['row'] ? intval($params['row']) : 10;
|
||||
//权限分配
|
||||
if(!IS_ROOT){
|
||||
$this->OpAuthList= getModuleControllerAuth();
|
||||
}
|
||||
$this->assign('menubtn',$this->menuAuth());
|
||||
|
||||
$map = [
|
||||
"c.verify_status"=>2,
|
||||
"p.verify_status"=>["GT",1]
|
||||
];
|
||||
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
|
||||
$time_start = strtotime($_REQUEST['time_start']);
|
||||
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
|
||||
$map["_string"] = "(c.statement_begin_time BETWEEN {$time_start} AND {$time_end}) OR (c.statement_end_time BETWEEN {$time_start} AND {$time_end}) OR (c.statement_begin_time <= {$time_end} AND c.statement_end_time >= {$time_end})";
|
||||
} elseif (isset($_REQUEST['time_start'])) {
|
||||
$time_start = strtotime($_REQUEST['time_start']);
|
||||
$map["_string"] = "(c.statement_begin_time >= {$time_start} ) OR (c.statement_end_time >= {$time_start})";
|
||||
} elseif (isset($_REQUEST['time_end'])) {
|
||||
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
|
||||
$map["_string"] = "(c.statement_begin_time <= {$time_end} ) OR (c.statement_end_time <= {$time_end})";
|
||||
}
|
||||
|
||||
//其他
|
||||
if(isset($_REQUEST['company_type'])){
|
||||
$map['c.company_type'] = $_REQUEST['company_type'];
|
||||
}
|
||||
if(isset($_REQUEST['company_name'])){
|
||||
$map['c.company_name'] =["LIKE","%{$_REQUEST['company_name']}%"];
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['statement_pool_num'])){
|
||||
$map['p.statement_num'] =["LIKE","%{$_REQUEST['statement_pool_num']}%"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//条件end
|
||||
$data = M("company_statement_info","tab_")
|
||||
->alias("c")
|
||||
->field("c.*,p.statement_num,p.verify_status")
|
||||
->where($map)
|
||||
|
||||
->join("tab_company_statement_pool as p ON c.pool_id = p.id")
|
||||
|
||||
->page($page,$row)
|
||||
->order("id desc")
|
||||
->select();
|
||||
|
||||
foreach($data as $k => &$v) {
|
||||
|
||||
$v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
|
||||
$v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']);
|
||||
$v['company_type_str'] = $this->CompanyType[$v['company_type']];
|
||||
$v["valid"] = "{$v['statement_begin_time']}-{$v['statement_end_time']}";
|
||||
$v["pay_status_str"] = $this->PayStatus[$v["pay_status"]];
|
||||
|
||||
$v["pay_info"] = json_decode($v['pay_info'], true);
|
||||
if(isset($v['pay_info']['payment_user'])){
|
||||
$v["payment"]= "{$v['pay_status_str']}({$v['pay_info']['payment_user']})<br>{$v['pay_info']['payment_time']}";
|
||||
}else{
|
||||
$v["payment"] = $v["pay_status_str"];
|
||||
}
|
||||
|
||||
$v['oplist'] = $this->OpAuth($v);
|
||||
}
|
||||
|
||||
$count = M("company_statement_info","tab_")->alias("c")->field("count(c.id) count,sum(c.statement_money) statement_money")->join("tab_company_statement_pool as p ON c.pool_id = p.id")->where($map)->find();
|
||||
// dd($count);
|
||||
$params['p'] = $page;
|
||||
$params['row'] = $row;
|
||||
$page = set_pagination($count['count'], $row, $params);
|
||||
if ($page) {
|
||||
$this->assign('_page', $page);
|
||||
}
|
||||
// dd($data);
|
||||
$this->assign('data',$data);
|
||||
$this->assign('count',$count);
|
||||
$this->assign('CompanyType',$this->CompanyType);
|
||||
$this->display();
|
||||
|
||||
}
|
||||
public function doPayment()
|
||||
{
|
||||
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
|
||||
$ids = $_REQUEST['ids'];
|
||||
//获取所有的母单id
|
||||
$companyStatementInfo = M("company_statement_info","tab_");
|
||||
$statementPool = $companyStatementInfo->where("id in ($ids) and pay_status <> 1")->field("pool_id,count(id) count")->group("pool_id")->select();
|
||||
$poolInfo = [];
|
||||
foreach ($statementPool as $k => $v) {
|
||||
$poolInfo[$v['pool_id']] = $v['count'];
|
||||
}
|
||||
unset($statementPool);
|
||||
|
||||
//修改info
|
||||
$saveData = [
|
||||
"pay_type"=>3,
|
||||
"pay_status"=>1,
|
||||
"pay_info"=>json_encode(["payment_user"=>$_SESSION['onethink_admin']['user_auth']["username"],"payment_time"=>date("Y-m-d H:i:s")])
|
||||
];
|
||||
$ires = $companyStatementInfo->where("id in ($ids)")->save($saveData);
|
||||
|
||||
//获取母单未支付完成订单
|
||||
$poolIds = implode(",",array_keys($poolInfo));
|
||||
$poolInfo = $companyStatementInfo->where("pool_id in ($poolIds) and pay_status <> 1")->field("pool_id,count(id) count")->group("pool_id")->select();
|
||||
|
||||
//全部就打款成功,否则打款中
|
||||
$companyStatementPool = M("company_statement_pool","tab_");
|
||||
foreach ($poolInfo as $k => $v) {
|
||||
if($v['count'] == $poolInfo[$v['pool_id']]){
|
||||
//打款成功
|
||||
$this->setOneVerifyStatus(4,"payment",$v['pool_id']);
|
||||
}else{
|
||||
//打款中
|
||||
$this->setOneVerifyStatus(3,"payment",$v['pool_id']);
|
||||
}
|
||||
}
|
||||
|
||||
$this->ajaxReturn(array(
|
||||
'status' =>1,
|
||||
"info"=>"打款确认成功"
|
||||
));
|
||||
}
|
||||
public function viewStatement()
|
||||
{
|
||||
if(!isset($_REQUEST['id'])){
|
||||
$this->error('参数错误');
|
||||
}
|
||||
$id = $_REQUEST['id'];
|
||||
$is_export= false;
|
||||
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
|
||||
$is_export = true;
|
||||
}
|
||||
//获取基本信息
|
||||
$dbres = M("company_statement_info","tab_")->where("id='{$id}'")->select();
|
||||
$title = $dbres[0]['company_name'];
|
||||
$this->assign("title",$title);
|
||||
|
||||
if($dbres[0]['company_type'] == 3){
|
||||
//上游
|
||||
A("CompanyStatementPool")->viewCpPool($dbres,$is_export);
|
||||
}elseif($dbres[0]['company_type'] == 1){
|
||||
//下游公司
|
||||
A("CompanyStatementPool")->viewPcPool($dbres,$is_export);
|
||||
}else{
|
||||
A("CompanyStatementPool")->viewPuPool($dbres,$is_export);
|
||||
}
|
||||
}
|
||||
|
||||
public function export(){
|
||||
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
|
||||
$ids = $_REQUEST['ids'];
|
||||
$dbres = M("company_statement_info","tab_")->where("id in ({$ids})")->select();
|
||||
|
||||
$is_export= false;
|
||||
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
|
||||
$is_export = true;
|
||||
}
|
||||
|
||||
if($dbres[0]['company_type'] == 3){
|
||||
//上游
|
||||
$this->assign("title","上游公司线下打款");
|
||||
A("CompanyStatementPool")->viewCpPool($dbres,$is_export);
|
||||
}elseif($dbres[0]['company_type'] == 1){
|
||||
//下游公司
|
||||
$this->assign("title","下游公司线下打款");
|
||||
A("CompanyStatementPool")->viewPcPool($dbres,$is_export);
|
||||
}else{
|
||||
$this->assign("title","下游个人线下打款");
|
||||
A("CompanyStatementPool")->viewPuPool($dbres,$is_export);
|
||||
}
|
||||
}
|
||||
|
||||
protected function setOneVerifyStatus($change_status,$op_pre,$id)
|
||||
{
|
||||
$dbres = M("company_statement_pool","tab_")->field("id,verify_status,verify_log")->where("id = {$id}")->find();
|
||||
$dbres['verify_log'] = json_decode($dbres['verify_log'],true);
|
||||
$dbres['verify_log'][$op_pre.'_user']=$_SESSION['onethink_admin']['user_auth']["username"];
|
||||
$dbres['verify_log'][$op_pre.'_time']=date("Y-m-d H:i:s");
|
||||
$dbres['verify_log'] = json_encode($dbres['verify_log']);
|
||||
$dbres['verify_status']=$change_status;
|
||||
M("company_statement_pool","tab_")->save($dbres);
|
||||
}
|
||||
|
||||
public function OpAuth($info)
|
||||
{
|
||||
$id = $info['id'];
|
||||
$type = $info['company_type'];
|
||||
//原始列表
|
||||
$opBtn = [
|
||||
"viewStatement"=>"<a class='confirm viewStatement' data-id='{$id}' data-companytype='{$type}'>查看</a>",
|
||||
];
|
||||
//操作对应菜单
|
||||
$optist = ["viewStatement"];
|
||||
$resarr = [];
|
||||
foreach ($optist as $k => $v) {
|
||||
if(IS_ROOT){
|
||||
$resarr[] = $opBtn[$v];
|
||||
}else{
|
||||
if(in_array($v,$this->OpAuthList)){
|
||||
$resarr[] = $opBtn[$v];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $resarr;
|
||||
}
|
||||
public function menuAuth()
|
||||
{
|
||||
$mentBtn = [
|
||||
"doPayment"=>"<a class='butn' id='doPayment'>打款确认</a>",
|
||||
"export"=>"<a class='butn' id='export'>批量导出</a>"
|
||||
];
|
||||
$resarr = [];
|
||||
foreach ($mentBtn as $k => $v) {
|
||||
if(IS_ROOT){
|
||||
$resarr[] = $v;
|
||||
}else{
|
||||
if(in_array($k,$this->OpAuthList)){
|
||||
$resarr[] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $resarr;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,402 @@
|
||||
<extend name="Public/base"/>
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
|
||||
<script src="__STATIC__/jquery.form.js"></script>
|
||||
<script src="__STATIC__/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
|
||||
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
|
||||
height:28px;border-radius:3px;font-size:12px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
.butnbox {padding:10px 0 10px;}
|
||||
.butnbox .butnlist {overflow:hidden;clear:both;}
|
||||
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
|
||||
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
|
||||
.butnbox .butnlist .butn.last {background:#009900;}
|
||||
.butnbox .butnlist .butn~.butn {margin-left:20px;}
|
||||
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
|
||||
.layui-layer-title {
|
||||
text-align: center;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
font-weight: 600;
|
||||
font-size: 18px;
|
||||
}
|
||||
.data_list table td{
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
.layui-layer-title {
|
||||
text-align: center;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
}
|
||||
.tooltip {
|
||||
position: relative;
|
||||
/* display: block; */
|
||||
/* color: #056dae; */
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext {
|
||||
display: none;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 10px 5px 5px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 80%;
|
||||
left: 0;
|
||||
border: #000 solid 1px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: black transparent transparent transparent;
|
||||
}
|
||||
|
||||
.tooltip:hover .tooltiptext {
|
||||
color: #333;
|
||||
display: block;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">线下打款确认</h3>
|
||||
<p class="description_text" id="order_url">仅当汇总单审批通过的单子才允许进行打款</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="cf top_nav_list" style="height: 38px;">
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list" style="margin-bottom: 0">
|
||||
|
||||
<div class="input-list input-list-promote search_label_rehab">
|
||||
<select id="company_type" name="company_type" class="select_gallery" >
|
||||
<option value="">公司类型</option>
|
||||
<volist name="CompanyType" id="vo">
|
||||
<option value="{$key}" <if condition="isset($_GET['company_type']) && $key eq I('company_type')">selected</if> >{$vo}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-list">
|
||||
<input style="width: 200px;" type="text" name="company_name" class="search-input" value="{:I('company_name')}" placeholder="请输入公司名称搜索">
|
||||
</div>
|
||||
|
||||
<div class="input-list">
|
||||
<input style="width: 200px;" type="text" name="statement_pool_num" class="search-input" value="{:I('statement_pool_num')}" placeholder="请输入汇总单号">
|
||||
</div>
|
||||
|
||||
<div class="input-list">
|
||||
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="结算开始时间" />
|
||||
-
|
||||
<div class="input-append date" id="datetimepicker" style="display:inline-block">
|
||||
<input type="text" readonly id="time_end" name="time_end" class="" value="{:I('time_end')}" placeholder="结算结束时间" />
|
||||
<span class="add-on"><i class="icon-th"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="{:U('lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="butnbox" >
|
||||
<div class="butnlist jscheckbutn" style="margin-left: 2px">
|
||||
<foreach name="menubtn" item="vo" >
|
||||
{$vo}
|
||||
</foreach>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表 -->
|
||||
<div class="data_list">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input class="check-all" type="checkbox"></th>
|
||||
<th>合作公司</th>
|
||||
<th>公司类型</th>
|
||||
<th>结算时间</th>
|
||||
<th>结算金额</th>
|
||||
<th>结算流水</th>
|
||||
|
||||
<th>打款状态</th>
|
||||
|
||||
<th class="tooltip">汇总单号<span class="tooltiptext">汇总单号</span></th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<if condition = "empty($data)">
|
||||
<tr>
|
||||
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
<notemtpy name = "data">
|
||||
<volist name="data" id="data">
|
||||
<tr>
|
||||
<td ><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]" data-companytype="{$data['company_type']}" data-paystatus="{$data['pay_status']}"></td>
|
||||
<td>{$data.company_name}</td>
|
||||
<td>{$data.company_type_str}</td>
|
||||
<td>{$data.valid}</td>
|
||||
<td>{$data.statement_money}</td>
|
||||
<td>{$data.platform_amount}</td>
|
||||
<td>{$data.payment}</td>
|
||||
<td>{$data.statement_num}</td>
|
||||
<td>
|
||||
<foreach name="data.oplist" item="vo" >
|
||||
{$vo}
|
||||
</foreach>
|
||||
</td>
|
||||
</tr>
|
||||
</volist>
|
||||
<tr><td style="line-height: 42px;">合计</td><td colspan="12" style="line-height: 42px;">结算总金额: {$count.statement_money}</td></tr>
|
||||
</notemtpy>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="page">
|
||||
<if condition="$role_export_check eq true ">
|
||||
<!-- <a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a> -->
|
||||
</if>
|
||||
{$_page|default=''}
|
||||
</div>
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<php>if(C('COLOR_STYLE')=='blue_color') echo '
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
|
||||
';
|
||||
</php>
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
|
||||
charset="UTF-8"></script>
|
||||
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
|
||||
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
<script>
|
||||
<volist name=":I('get.')" id="vo">
|
||||
Think.setValue('{$key}',"{$vo}");
|
||||
</volist>
|
||||
$(".select_gallery").select2();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav("{:U('lists')}");
|
||||
function reload() {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
|
||||
var company_id = "{$_GET['company_id']??0}";
|
||||
$("#company_type").on("change",function(){
|
||||
var val = $(this).find("option:selected").val();
|
||||
var type = 0;
|
||||
if(val == 3){
|
||||
type = 1
|
||||
}else{
|
||||
type = 2;
|
||||
}
|
||||
var url = "{:U('Ajax/getCompanyList')}"+"&company_type="+type;
|
||||
$.get(url,function(data){
|
||||
var company = data;
|
||||
var companystr = '<option value="">请选择合作公司</option>';
|
||||
for (var i in company) {
|
||||
if(company[i].id == company_id){
|
||||
companystr += "<option value='" + company[i].id + "' selected='selected'>" + company[i].name + "</option>"
|
||||
}else{
|
||||
companystr += "<option value='" + company[i].id + "'>" + company[i].name + "</option>"
|
||||
}
|
||||
}
|
||||
$("#company_id").html(companystr);
|
||||
$("#company_id").select2();
|
||||
})
|
||||
})
|
||||
$("#company_type").change();
|
||||
|
||||
$(".viewStatement").click(function () {
|
||||
var id = $(this).data("id");
|
||||
var url = "{:U('viewStatement')}"+"&id="+id
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: "海南万盟天下科技有限公司",
|
||||
shadeClose: true,
|
||||
shade: 0.8,
|
||||
area: ['100%', '100%'],
|
||||
content: url
|
||||
});
|
||||
});
|
||||
|
||||
$("#doPayment").on("click",function(){
|
||||
var id = $(this).attr("id");
|
||||
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
|
||||
if($(elem).data("paystatus") == 0){
|
||||
return $(elem).val();
|
||||
}
|
||||
}).get();
|
||||
|
||||
if(text.length < 1){
|
||||
layer.msg("<font style='color:white'>无需要进行确认打款确认操作的数据</font>");
|
||||
return;
|
||||
}
|
||||
|
||||
text = text.join(",");
|
||||
|
||||
if(confirm){
|
||||
layer.confirm('【警告】确认打款后将不可回退,如需继续请点击确认', {
|
||||
btn: ['确认','取消'],
|
||||
title:false
|
||||
}, function(){
|
||||
_doAgreeApply();
|
||||
});
|
||||
}else{
|
||||
_doAgreeApply();
|
||||
}
|
||||
|
||||
function _doAgreeApply(){
|
||||
//执行
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('doPayment')}",
|
||||
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);
|
||||
}else{
|
||||
layer.msg("<font style='color:white'>" + data.info + "</font>");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
$("#export").click(function () {
|
||||
var company = [];
|
||||
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
|
||||
var cid = $(elem).data("companytype");
|
||||
try {
|
||||
company[cid].push($(elem).val());
|
||||
} catch (error) {
|
||||
company[cid] = [];
|
||||
company[cid].push($(elem).val());
|
||||
}
|
||||
});
|
||||
company.forEach(function(e){
|
||||
var ids = e.join(",");
|
||||
var url ="{:U('export')}"+"&ids="+ids+"&export=1";
|
||||
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
|
||||
$("body").append(iframeExcel)
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
$("#search").click(function(){
|
||||
|
||||
var start = $("#time_start").val();
|
||||
var end = $("#time_end").val();
|
||||
if(start !='' && end != ''){
|
||||
if (Date.parse(start) > Date.parse(end)){
|
||||
layer.msg('开始时间必须小于等于结束时间');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.jssearch').find('input').serialize();
|
||||
query += "&"+$('.jssearch').find('select').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
|
||||
query = query.replace(/^&/g,'');
|
||||
if( url.indexOf('?')>0 ){
|
||||
url += '&' + query;
|
||||
}else{
|
||||
url += '?' + query;
|
||||
}
|
||||
window.location.href = url;
|
||||
});
|
||||
|
||||
$('#time_start').datetimepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
language: "zh-CN",
|
||||
minView: 2,
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$('#datetimepicker').datetimepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
language: "zh-CN",
|
||||
minView: 2,
|
||||
autoclose: true,
|
||||
pickerPosition: 'bottom-left'
|
||||
})
|
||||
|
||||
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
</block>
|
Loading…
Reference in New Issue