You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

685 lines
30 KiB
HTML

5 years ago
<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;}
.layui-layer-dialog .layui-layer-content{color:red}
.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;
}
5 years ago
.data_list table td{
line-height: 2;
}
5 years ago
.layui-layer-title {
text-align: center;
height: 42px;
line-height: 42px;
font-weight: 400;
font-size: 14px;
}
5 years ago
.main-place .question_content:before{
right: 20px;
left: auto;
}
5 years ago
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">联运平台结算单管理</h3>
5 years ago
<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>
</ul>
</div>
5 years ago
</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-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>
</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>
</select>
</div>
<div class="input-list">
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="结算开始时间" />
&nbsp;-&nbsp;
<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 type="text" readonly id="time_start2" name="time_start2" class="" value="{:I('time_start2')}" placeholder="操作开始时间" />
&nbsp;-&nbsp;
<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">
5 years ago
<foreach name="menubtn" item="vo" >
{$vo}
</foreach>
5 years ago
</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>
5 years ago
<th>结算流水</th>
<th>创建记录</th>
5 years ago
<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>
5 years ago
<td ><input class="ids" type="checkbox" data-status="{$data.verify_status}" value="{$data['id']}" name="ids[]"></td>
5 years ago
<td>{$data.company_name}</td>
5 years ago
<td>{$data.company_belong}</td>
<td>{$data.valid}</td>
<td>{$data.withdraw_type_1}</td>
<td>{$data.withdraw_type_2}</td>
5 years ago
<td>{$data.statement_money}</td>
5 years ago
<td>{$data.platform_amount}</td>
<td>{$data.create}</td>
5 years ago
<td>
<if condition="$data.verify_status eq -1 ">
<div style="line-height: 2;color: red;">
{$data.verify}
</div>
<else />
<div style="line-height: 2;">
{$data.verify}
</div>
</if>
</td>
5 years ago
<td>{$data.launch}</td>
<td>{$data.confirm}</td>
5 years ago
<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>
5 years ago
<td>
5 years ago
<foreach name="data.oplist" item="vo" >
{$vo}
</foreach>
5 years ago
</td>
</tr>
</volist>
5 years ago
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">结算总金额:&nbsp;{$count.statement_money}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;结算总流水:&nbsp;{$count['platform_amount']}&nbsp;(补点不重复统计在内)</td></tr>
5 years ago
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="page">
{$_page|default=''}
</div>
5 years ago
<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>
5 years ago
</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>
5 years ago
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
5 years ago
<script type="text/javascript">
</script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
5 years ago
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){
5 years ago
var senddata = {date:DATA.datelist[(DATA.now-1)],up_company_id:DATA.up_company_id,dowm_company_id:DATA.dowm_company_id};
5 years ago
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)
}
});
}
}
5 years ago
</script>
<script type="text/javascript">
//导航高亮
5 years ago
highlight_subnav("{:U('CompanyStatement/lists')}");
5 years ago
function reload() {
window.location.reload();
}
$(function(){
5 years ago
var loop = 1;
5 years ago
var company_id = "{$_GET['company_id']??0}";
$("#company_type").on("change",function(){
var type = $(this).find("option:selected").val();
5 years ago
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>"
}
5 years ago
}
5 years ago
$("#company_id").html(companystr);
$("#company_id").select2();
loop++;
})
}else{
var companystr = '<option value="">请先选择合作公司</option>';
5 years ago
$("#company_id").html(companystr);
$("#company_id").select2();
5 years ago
}
5 years ago
})
$("#company_type").change();
//设置对账网址
var order_url = window.location.protocol+"//"+window.location.host+"/admin.php?s=/Public/cp_login.html";
$("#order_url").html("流程说明:结算自动生成对账单--->财务审核对账单--->发起对外对账--->合作方进行确认--->进入报销流程【合作方确认地址:"+order_url+"】");
5 years ago
$("#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);
});
})
5 years ago
$(".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
});
});
$(".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
});
});
5 years ago
$("#verifyAgree,#verifyRefuse,#launch,#pool,#updateStatement").on("click",function(){
5 years ago
var id = $(this).attr("id");
if(id == "verifyAgree"){
var opname = "审批通过";
var opurl = "{:U('verifyAgree')}";
var opst ="[未进行审批]";
5 years ago
var status = [0];
5 years ago
}else if(id=="verifyRefuse"){
var opname = "审批拒绝";
var opurl = "{:U('verifyRefuse')}";
var opst ="[未进行审批]";
5 years ago
var status = [0];
5 years ago
}else if(id=="launch"){
var opname = "对外发起";
var opurl = "{:U('launch')}";
var opst ="[审批通过]";
5 years ago
var status = [1];
5 years ago
}else if(id=="pool"){
var opname = "发起汇总";
var opurl = "{:U('pool')}";
var opst ="[合作方确认]";
5 years ago
var status = [3];
}else if(id=="updateStatement"){
var opname = "重算金额";
var opurl = "{:U('updateStatement')}";
var opst ="[汇总撤销,审批拒绝,未进行审批,审批通过,对外发起]";
var status = [-2,-1,0,1,2];
var confirm = true;
5 years ago
}
5 years ago
var confirm = confirm ? confirm :false;
5 years ago
var flag = false;
5 years ago
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
5 years ago
if($.inArray( $(elem).data("status"),status) == -1){
5 years ago
flag = true;
}else{
return $(elem).val();
5 years ago
}
5 years ago
}).get();
if(text.length > 40){
layer.msg("<font style='color:white'>" + '为保证效率暂不支持超过40条的批量操作' + "</font>");
5 years ago
return;
}
if(text.length < 1){
5 years ago
layer.msg("<font style='color:white'>" + '无需要'+opname+'的申请,仅'+opst+'状态可以进行'+opname+"</font>");
return;
}
5 years ago
text = text.join(",");
5 years ago
if(flag){
layer.confirm(opname+"仅会对"+opst+"的申请进行处理,选择中包含其他的状态的申请将被忽略,点击取消停止操作",{title:false}, function(index){
layer.close(index);
5 years ago
_doAgreeApply();
5 years ago
});
}else{
5 years ago
if(confirm){
layer.confirm('【警告】'+opname+'将不可回退,如需继续请点击确认', {
btn: ['确认','取消'],
title:false
5 years ago
}, function(index){
layer.close(index);
5 years ago
_doAgreeApply();
});
}else{
_doAgreeApply();
}
5 years ago
}
function _doAgreeApply(){
//执行
5 years ago
layer.load(2);
5 years ago
$.ajax({
5 years ago
type: "POST",
url: opurl,
5 years ago
dataType: 'json',
5 years ago
async: true,
5 years ago
data: {ids:text},
success:function(data){
5 years ago
layer.closeAll('loading');
5 years ago
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
5 years ago
setTimeout(function(){
5 years ago
window.location.reload();
5 years ago
},1500);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
5 years ago
}
}
});
5 years ago
}
5 years ago
})
5 years ago
$("#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)
}
})
5 years ago
//新增批注
$(".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',
5 years ago
async: true,
5 years ago
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',
5 years ago
async: true,
5 years ago
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>"
});
});
5 years ago
$("#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'
})
$('#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();
}
});
5 years ago
5 years ago
})
</script>
</block>