|
|
|
|
<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;
|
|
|
|
|
}
|
|
|
|
|
.main-place .question_content:before{
|
|
|
|
|
right: 20px;
|
|
|
|
|
left: auto;
|
|
|
|
|
}
|
|
|
|
|
</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 class="question" style="float: right;margin-right: 20px;">
|
|
|
|
|
<i class="question_mark">?</i>
|
|
|
|
|
<ul class="question_content" style="right: -20px;left: auto;">
|
|
|
|
|
<li class="question_title">数据相关说明</li>
|
|
|
|
|
<li class="question_list">
|
|
|
|
|
<span class="">重算金额:</span>
|
|
|
|
|
<span class="">仅会重算当前公司,当前时间的结算金额</span>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="question_list">
|
|
|
|
|
<span class="">撤销汇总:</span>
|
|
|
|
|
<span class="">需要进行重算才可以再次汇总</span>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="question_list">
|
|
|
|
|
<span class="">新增结算:</span>
|
|
|
|
|
<span class="">对新增绑定的公司进行结算,仅统计当月数据(不含下游个人)</span>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="question_list">
|
|
|
|
|
<span class="">上游cp结算:</span>
|
|
|
|
|
<span class="">上游CP的结算流水包含聚合的流水</span>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="cf top_nav_list" style="height: 38px;">
|
|
|
|
|
<!-- 高级搜索 -->
|
|
|
|
|
<div class="jssearch fl cf search_list" style="margin-bottom: 15px;">
|
|
|
|
|
<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-list-promote search_label_rehab">
|
|
|
|
|
<select id="company_id" name="company_id" class="select_gallery" >
|
|
|
|
|
<option value="">请先选择公司类型</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
|
|
<div class="input-list input-list-promote search_label_rehab">
|
|
|
|
|
<select id="company_belong" name="company_belong" class="select_gallery" >
|
|
|
|
|
<option value="">结算单类型</option>
|
|
|
|
|
<volist name="CompanyBelong" id="vo">
|
|
|
|
|
<option value="{$key}" <if condition="isset($_GET['company_belong']) && $key eq I('company_belong')">selected</if> >{$vo}</option>
|
|
|
|
|
</volist>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="input-list input-list-promote search_label_rehab">
|
|
|
|
|
<select id="withdraw_type" name="withdraw_type" class="select_gallery" style="width:150px;">
|
|
|
|
|
<option value="">结算周期</option>
|
|
|
|
|
<option value="0">周结</option>
|
|
|
|
|
<option value="1">月结</option>
|
|
|
|
|
|
|
|
|
|
<option value="3">其他</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="input-list input-list-promote search_label_rehab">
|
|
|
|
|
<select id="withdraw_type" name="withdraw_type2" class="select_gallery" style="width:150px;">
|
|
|
|
|
<option value="">结算类型</option>
|
|
|
|
|
<option value="1">正常计算</option>
|
|
|
|
|
<option value="2">补点</option>
|
|
|
|
|
<option value="3">特殊补点</option>
|
|
|
|
|
</select>
|
|
|
|
|
</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 input-list-promote search_label_rehab">
|
|
|
|
|
<select id="verify_status" name="verify_status" class="select_gallery" >
|
|
|
|
|
<option value="">请选择审核状态</option>
|
|
|
|
|
<volist name="VerifyStatus" id="vo">
|
|
|
|
|
<option value="{$key}" <if condition="isset($_GET['verify_status']) && $key eq I('verify_status')">selected</if> >{$vo}</option>
|
|
|
|
|
</volist>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="input-list input-list-promote search_label_rehab">
|
|
|
|
|
<select id="confirm_status" name="confirm_status" class="select_gallery" >
|
|
|
|
|
<option value="">请选择确认状态</option>
|
|
|
|
|
<volist name="ConfirmStatus" id="vo">
|
|
|
|
|
<option value="{$key}" <if condition="isset($_GET['confirm_status']) && $key eq I('confirm_status')">selected</if> >{$vo}</option>
|
|
|
|
|
</volist>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="input-list">
|
|
|
|
|
<input type="text" readonly id="time_start2" name="time_start2" class="" value="{:I('time_start2')}" placeholder="操作开始时间" />
|
|
|
|
|
-
|
|
|
|
|
<div class="input-append date" id="datetimepicker2" style="display:inline-block">
|
|
|
|
|
<input type="text" readonly id="time_end2" name="time_end2" class="" value="{:I('time_end2')}" 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>结算流水</th>
|
|
|
|
|
<th>创建记录</th>
|
|
|
|
|
<th>管理员审核</th>
|
|
|
|
|
<th>汇总状态</th>
|
|
|
|
|
<th>对外发起</th>
|
|
|
|
|
<th>合作确认</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" data-status="{$data.verify_status}" data-type="{$data.withdraw_type}" data-confirm="{$data.confirm_status}" value="{$data['id']}" name="ids[]"></td>
|
|
|
|
|
<td>{$data.company_name}</td>
|
|
|
|
|
<td>{$data.company_belong}</td>
|
|
|
|
|
<td>{$data.valid}</td>
|
|
|
|
|
<td>{$data.withdraw_type_1}</td>
|
|
|
|
|
<td>{$data.withdraw_type_2}</td>
|
|
|
|
|
<td>{$data.statement_money}</td>
|
|
|
|
|
<td>{$data.platform_amount}</td>
|
|
|
|
|
<td>{$data.create}</td>
|
|
|
|
|
<td>
|
|
|
|
|
<if condition="$data.verify_status eq -1 ">
|
|
|
|
|
<div style="line-height: 2;color: red;">
|
|
|
|
|
{$data.admin}
|
|
|
|
|
</div>
|
|
|
|
|
<else />
|
|
|
|
|
<div style="line-height: 2;">
|
|
|
|
|
{$data.admin}
|
|
|
|
|
</div>
|
|
|
|
|
</if>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<if condition="$data.verify_status eq -2 ">
|
|
|
|
|
<div style="line-height: 2;color: red;">
|
|
|
|
|
{$data.pool}
|
|
|
|
|
</div>
|
|
|
|
|
<else />
|
|
|
|
|
<div style="line-height: 2;">
|
|
|
|
|
{$data.pool}
|
|
|
|
|
</div>
|
|
|
|
|
</if>
|
|
|
|
|
</td>
|
|
|
|
|
<td>{$data.launch}</td>
|
|
|
|
|
<td>{$data.confirm}</td>
|
|
|
|
|
<td>
|
|
|
|
|
<foreach name="data.oplist" item="vo" >
|
|
|
|
|
{$vo}
|
|
|
|
|
</foreach>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</volist>
|
|
|
|
|
<tr><td style="line-height: 42px;">合计</td><td colspan="14" style="line-height: 42px;">结算总金额: {$count.statement_money} 结算总流水: {$count['platform_amount']} (补点不重复统计在内)</td></tr>
|
|
|
|
|
</notemtpy>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
|
|
|
|
{$_page|default=''}
|
|
|
|
|
</div>
|
|
|
|
|
<div style="width: 100vw;height: 100vh;padding: 0;position: absolute;top: 0;z-index: 9999;display: none;" id="creat_msg">
|
|
|
|
|
<div class="layui-layer layui-layer-dialog layui-layer-border layui-layer-msg layui-layer-hui"
|
|
|
|
|
type="dialog" times="1" showtime="50000" contype="string" style="z-index: 19891015; top:30%; left:45%;">
|
|
|
|
|
<div class="layui-layer-content" style="padding: 15px 0 5px;font-size: 20px;font-weight: 600;color: white;">执行进度</div>
|
|
|
|
|
<div id="tip_msg" class="layui-layer-content" style="color: white;">开始时间与结束时间都不允许为空</div>
|
|
|
|
|
<div class="layui-layer-content" style="padding: 5px 10px 15px;font-size: 10px;color: #BBB;">TIP:未执行完成之前请勿刷新或关闭此页面</div>
|
|
|
|
|
<span class="layui-layer-setwin"></span>
|
|
|
|
|
</div>
|
|
|
|
|
</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();
|
|
|
|
|
var DATA={};
|
|
|
|
|
var MSG={
|
|
|
|
|
showmsg:function(str){
|
|
|
|
|
$("#creat_msg").show();
|
|
|
|
|
$("#tip_msg").html(str);
|
|
|
|
|
},
|
|
|
|
|
hidemsg:function(){
|
|
|
|
|
$("#creat_msg").hide();
|
|
|
|
|
$("#tip_msg").html('');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var COMPARE={
|
|
|
|
|
publiucAjax:function(url,senddata,callback){
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'post',
|
|
|
|
|
url: url,
|
|
|
|
|
data:senddata,
|
|
|
|
|
success: function(data) {
|
|
|
|
|
if(data.success){
|
|
|
|
|
callback(data.data);
|
|
|
|
|
}else{
|
|
|
|
|
MSG.hidemsg();
|
|
|
|
|
layer.alert(data.error);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
|
|
|
|
MSG.hidemsg();
|
|
|
|
|
layer.alert("网络错误或超时");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//获取基础参数
|
|
|
|
|
getNewStatement:function(callback){
|
|
|
|
|
MSG.showmsg("初始化获取校验中....");
|
|
|
|
|
COMPARE.publiucAjax("{:U('getNewStatement')}",{},function(data){
|
|
|
|
|
DATA = data;
|
|
|
|
|
DATA.now = 1;
|
|
|
|
|
MSG.showmsg("校验通过,开始统计 [0/"+DATA.count+"] ......");
|
|
|
|
|
callback();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//开始统计
|
|
|
|
|
updateNewStatement:function(callback){
|
|
|
|
|
var senddata = {date:DATA.datelist[(DATA.now-1)],up_company_id:DATA.up_company_id,dowm_company_id:DATA.dowm_company_id};
|
|
|
|
|
console.log(senddata);
|
|
|
|
|
COMPARE.publiucAjax("{:U('updateNewStatement')}",senddata,function(){
|
|
|
|
|
MSG.showmsg("开始统计 ["+DATA.now+"/"+DATA.count+"] ......");
|
|
|
|
|
DATA.now ++;
|
|
|
|
|
if( DATA.now > DATA.count){
|
|
|
|
|
callback();
|
|
|
|
|
}else{
|
|
|
|
|
COMPARE.updateNewStatement(callback)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
//导航高亮
|
|
|
|
|
highlight_subnav("{:U('CompanyStatement/lists')}");
|
|
|
|
|
function reload() {
|
|
|
|
|
window.location.reload();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
|
var loop = 1;
|
|
|
|
|
var company_id = "{$_GET['company_id']??0}";
|
|
|
|
|
$("#company_type").on("change",function(){
|
|
|
|
|
var type = $(this).find("option:selected").val();
|
|
|
|
|
if(type != ''){
|
|
|
|
|
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 && loop==1){
|
|
|
|
|
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();
|
|
|
|
|
loop++;
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
var companystr = '<option value="">请先选择合作公司</option>';
|
|
|
|
|
$("#company_id").html(companystr);
|
|
|
|
|
$("#company_id").select2();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
$("#company_type").change();
|
|
|
|
|
|
|
|
|
|
//设置对账网址
|
|
|
|
|
var order_url = window.location.protocol+"//"+window.location.host+"/admin.php?s=/Public/cp_login.html";
|
|
|
|
|
$("#order_url").html("流程说明:结算自动生成对账单--->管理员审核--->财务审核对账单--->发起汇总 / 确认流程: 发起对外对账--->合作方进行确认【合作方确认地址:"+order_url+"】");
|
|
|
|
|
|
|
|
|
|
$("#updateNewStatement").on("click",function(){
|
|
|
|
|
layer.confirm("新增结算需要花费2分钟左右时间,并且只计算一个月内的新增结算,请勿在中途关闭页面,无需新增结算请取消",{title:false}, function(index){
|
|
|
|
|
COMPARE.getNewStatement(function(){
|
|
|
|
|
COMPARE.updateNewStatement(function(){
|
|
|
|
|
MSG.showmsg("统计完成,等待跳转中....");
|
|
|
|
|
setTimeout(function(){
|
|
|
|
|
window.location.reload();
|
|
|
|
|
},2000)
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
layer.close(index);
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
$(".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: ['70%', '80%'],
|
|
|
|
|
content: url
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#viewSpecialComplement").click(function () {
|
|
|
|
|
var id = $(this).data("id");
|
|
|
|
|
var url = "{:U('viewSpecialComplement')}"+"&id="+id
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 2,
|
|
|
|
|
title: "海南万盟天下科技有限公司",
|
|
|
|
|
shadeClose: true,
|
|
|
|
|
shade: 0.8,
|
|
|
|
|
area: ['70%', '80%'],
|
|
|
|
|
content: url
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".editStatement").click(function () {
|
|
|
|
|
var id = $(this).data("id");
|
|
|
|
|
var url = "{:U('editStatement')}"+"&id="+id
|
|
|
|
|
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 2,
|
|
|
|
|
title: "海南万盟天下科技有限公司",
|
|
|
|
|
shadeClose: true,
|
|
|
|
|
shade: 0.8,
|
|
|
|
|
area: ['70%', '80%'],
|
|
|
|
|
content: url
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#adminAgree,#adminRefuse,#verifyAgree,#verifyRefuse,#pool,#updateStatement,#delStatement").on("click",function(){
|
|
|
|
|
var id = $(this).attr("id");
|
|
|
|
|
if(id == "adminAgree"){
|
|
|
|
|
var opname = "管理员审批通过";
|
|
|
|
|
var opurl = "{:U('adminAgree')}";
|
|
|
|
|
var opst ="[未进行审批]";
|
|
|
|
|
var status = [0];
|
|
|
|
|
}else if(id=="adminRefuse"){
|
|
|
|
|
var opname = "管理员审批拒绝";
|
|
|
|
|
var opurl = "{:U('adminRefuse')}";
|
|
|
|
|
var opst ="[未进行审批]";
|
|
|
|
|
var status = [0];
|
|
|
|
|
}else if(id=="pool"){
|
|
|
|
|
var opname = "发起汇总";
|
|
|
|
|
var opurl = "{:U('pool')}";
|
|
|
|
|
var opst ="[审批通过]";
|
|
|
|
|
var status = [1];
|
|
|
|
|
}else if(id=="updateStatement"){
|
|
|
|
|
var opname = "重算金额";
|
|
|
|
|
var opurl = "{:U('updateStatement')}";
|
|
|
|
|
var opst ="[汇总撤销,管理员审批拒绝,未进行审批,管理员审批通过,非特殊补点]";
|
|
|
|
|
var status = [-3,-2,-1,0,1];
|
|
|
|
|
var confirm = true;
|
|
|
|
|
}else if(id=="delStatement"){
|
|
|
|
|
var opname = "批量删除";
|
|
|
|
|
var opurl = "{:U('delStatement')}";
|
|
|
|
|
var opst ="[未进行审批]";
|
|
|
|
|
var status = [0];
|
|
|
|
|
var confirm = true;
|
|
|
|
|
}
|
|
|
|
|
var confirm = confirm ? confirm :false;
|
|
|
|
|
var flag = false;
|
|
|
|
|
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
|
|
|
|
|
|
|
|
|
|
if($.inArray( $(elem).data("status"),status) == -1||(id=="updateStatement" && $(elem).data("type")==3)){
|
|
|
|
|
flag = true;
|
|
|
|
|
}else{
|
|
|
|
|
return $(elem).val();
|
|
|
|
|
}
|
|
|
|
|
}).get();
|
|
|
|
|
|
|
|
|
|
if(text.length > 40){
|
|
|
|
|
layer.msg("<font style='color:white'>" + '为保证效率暂不支持超过40条的批量操作' + "</font>");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(text.length < 1){
|
|
|
|
|
layer.msg("<font style='color:white'>" + '无需要'+opname+'的申请,仅'+opst+'状态可以进行'+opname+"</font>");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
text = text.join(",");
|
|
|
|
|
|
|
|
|
|
if(flag){
|
|
|
|
|
layer.confirm(opname+"仅会对"+opst+"的申请进行处理,选择中包含其他的状态的申请将被忽略,点击取消停止操作",{title:false}, function(index){
|
|
|
|
|
layer.close(index);
|
|
|
|
|
_doAgreeApply();
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
if(confirm){
|
|
|
|
|
layer.confirm('【警告】'+opname+'将不可回退,如需继续请点击确认', {
|
|
|
|
|
btn: ['确认','取消'],
|
|
|
|
|
title:false
|
|
|
|
|
}, function(index){
|
|
|
|
|
layer.close(index);
|
|
|
|
|
_doAgreeApply();
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
_doAgreeApply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function _doAgreeApply(){
|
|
|
|
|
//执行
|
|
|
|
|
layer.load(2);
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: opurl,
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
async: true,
|
|
|
|
|
data: {ids:text},
|
|
|
|
|
success:function(data){
|
|
|
|
|
layer.closeAll('loading');
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
$("#launch").on("click",function(){
|
|
|
|
|
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
|
|
|
|
|
if($(elem).data("confirm") == 0){
|
|
|
|
|
return $(elem).val();
|
|
|
|
|
}
|
|
|
|
|
}).get();
|
|
|
|
|
if(text.length < 1){
|
|
|
|
|
layer.msg("<font style='color:white'>" + '无需要进行[对外发起]的申请,仅[未发起]状态可以进行[对外发起]操作</font>');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
text = text.join(",");
|
|
|
|
|
layer.confirm('【警告】[对外发起]将不可回退,如需继续请点击确认', {
|
|
|
|
|
btn: ['确认','取消'],
|
|
|
|
|
title:false
|
|
|
|
|
}, function(index){
|
|
|
|
|
layer.close(index);
|
|
|
|
|
_doAgreeApply();
|
|
|
|
|
});
|
|
|
|
|
function _doAgreeApply(){
|
|
|
|
|
//执行
|
|
|
|
|
layer.load(2);
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: "{:U('launch')}",
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
async: true,
|
|
|
|
|
data: {ids:text},
|
|
|
|
|
success:function(data){
|
|
|
|
|
layer.closeAll('loading');
|
|
|
|
|
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 text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
|
|
|
|
|
return $(elem).val();
|
|
|
|
|
}).get();
|
|
|
|
|
|
|
|
|
|
if(text.length > 20){
|
|
|
|
|
layer.msg("<font style='color:white'>" + '暂不支持超过20条的批量导出' + "</font>");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(text.length < 1){
|
|
|
|
|
layer.msg("<font style='color:white'>" + '请先选择要导出的结算单' + "</font>");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
for (var index = 0; index < text.length; index++) {
|
|
|
|
|
var id = text[index];
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
//新增批注
|
|
|
|
|
$(".addRemark").click(function(){
|
|
|
|
|
var id = $(this).data("id");
|
|
|
|
|
layer.prompt({
|
|
|
|
|
formType: 2,
|
|
|
|
|
value: '',
|
|
|
|
|
title: '输入备注',
|
|
|
|
|
area: ['360px', '300px'] //自定义文本域宽高
|
|
|
|
|
}, function(value, index, elem){
|
|
|
|
|
if(value != ''){
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: "{:U('saveRemark')}",
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
async: true,
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
//编辑批注
|
|
|
|
|
$(".editRemark").click(function(){
|
|
|
|
|
var id = $(this).data("id");
|
|
|
|
|
var remark = $(this).data("remark");
|
|
|
|
|
layer.prompt({
|
|
|
|
|
formType: 2,
|
|
|
|
|
title: '修改备注',
|
|
|
|
|
value:remark,
|
|
|
|
|
area: ['360px', '300px'],
|
|
|
|
|
btnAlign: 'c',
|
|
|
|
|
id: 'prompt',
|
|
|
|
|
yes: function (index, layero) {
|
|
|
|
|
// 获取文本框输入的值
|
|
|
|
|
var value = layero.find(".layui-layer-input").val();
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: "{:U('saveRemark')}",
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
async: true,
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
//查看批注
|
|
|
|
|
$(".viewRemark").click(function () {
|
|
|
|
|
var remark = $(this).data("remark");
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 1,
|
|
|
|
|
title:false,
|
|
|
|
|
content:"<div style='width: 300;height:auto;margin: auto;padding:20px;'>"+remark+"</div>"
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#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 start2 = $("#time_start2").val();
|
|
|
|
|
var end2 = $("#time_end2").val();
|
|
|
|
|
if(start2 !='' && end2 != ''){
|
|
|
|
|
if (Date.parse(start2) > Date.parse(end2)){
|
|
|
|
|
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'
|
|
|
|
|
})
|
|
|
|
|
$('#time_start2').datetimepicker({
|
|
|
|
|
format: 'yyyy-mm-dd',
|
|
|
|
|
language: "zh-CN",
|
|
|
|
|
minView: 2,
|
|
|
|
|
autoclose: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('#datetimepicker2').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>
|