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.

661 lines
26 KiB
HTML

<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="请输入公司名称搜索">&nbsp;
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="pay_status" name="pay_status" class="select_gallery" >
<option value="">打款状态</option>
<volist name="PayStatus" id="vo">
<option value="{$key}" <if condition="isset($_GET['pay_status']) && $key eq I('pay_status')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="statement_pool_num" class="search-input" value="{:I('statement_pool_num')}" placeholder="请输入汇总单号">&nbsp;
</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">
<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 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" data-pay_check="{$data['pay_check']}" 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.surplus_amount}</td>
<td>{$data.platform_amount}</td>
<td>{$data.pay_check_str}</td>
<td>{$data.payment}</td>
<td><a class="viewPool" data-id="{$data['pool_id']}" >{$data.statement_num}</a></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;">待打款金额:&nbsp;{$count.statement_money}&nbsp;&nbsp;&nbsp;&nbsp;打款成功金额:&nbsp;{$count.success_money}&nbsp;&nbsp;&nbsp;&nbsp;打款失败金额:&nbsp;{$count.error_money}</td></tr>
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['list_export'=>1],I('get.')))}" target="_blank">导出</a>
{$_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(){
$(".viewPool").click(function () {
var id = $(this).data("id");
var url = "{:U('CompanyStatementPool/viewPool')}"+"&id="+id
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['100%', '100%'],
content: url
});
});
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();
$("#setPayment").on('click',function(){
var tip = 0;
var unpay = false;
var pay = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if ($(elem).data("pay_check") == 2) {
unpay = true;
}
if ($(elem).data("pay_check") == 0) {
pay = true;
}
if($(elem).data("pay_check") == 0 || ($(elem).data("pay_check") == 2&&$(elem).data("paystatus")==2)){
return $(elem).val();
} else {
tip = 1;
}
}).get();
if(tip == 1) {
layer.msg("<font style='color: white'>请选择打款信息未确认的单子</font>");
return;
}
var textLength = text.length;
text = text.join(",");
if (!text) {
layer.msg("<font style='color: white'>没有符合打款确认的打款单,请重新选择</font>");
return;
}
if(unpay && pay) {
layer.msg("<font style='color: white'>部分确认的打款单不能与确认的打款单一起确认</font>");
return;
}
var url = "{:U('setPartPayment')}"+"&id="+text;
if(!unpay && pay) {
layer.confirm('【提示】是否全部打款', {
btn: ['是','否'],
title:false
}, function(){
layer.closeAll();
url = "{:U('setPayment')}"+"&id="+text;
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['100%', '100%'],
content: url
});
}, function(){
if (textLength > 1) {
layer.msg("<font style='color: white'>部分确认的单子一次不能处理超过两条</font>");
return;
}
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['100%', '100%'],
content: url
});
});
} else if(unpay) {
// url = "{:U('setPayment')}"+"&id="+text;
if (textLength > 1) {
layer.msg("<font style='color: white'>部分确认的单子一次不能处理超过两条</font>");
return;
}
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['100%', '100%'],
content: url
});
}
});
$(".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
});
});
$("#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).val();
}
if($(elem).data("pay_check") == 2 && $(elem).data("paystatus") == 0){
return $(elem).val();
}
if ($(elem).data("pay_check") == 0) {
tip = 1;
}
if ($(elem).data("paystatus") == 1) {
paystatustip = 1;
}
}).get();
console.log(text);
if(tip == 1) {
layer.msg("<font style='color: white'>请选择打款信息已确认的单子</font>");
return;
}
if(paystatustip == 1) {
layer.msg("<font style='color: white'>请选择未打款的单子</font>");
return;
}
if (text.length<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 id = $(this).attr("id");
var pay_check_tip = 0;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if(($(elem).data("paystatus") == 0&&$(elem).data("pay_check") == 1)
|| ($(elem).data("paystatus") == 0&&$(elem).data("pay_check") == 2)
|| ($(elem).data("paystatus") == 2&&$(elem).data("pay_check") == 1)
|| ($(elem).data("paystatus") == 2&&$(elem).data("pay_check") == 2)
){
return $(elem).val();
}
if ($(elem).data("pay_check") == 0) {
pay_check_tip = 1;
}
}).get();
// console.log(text);return;
if (pay_check_tip == 1) {
layer.msg("<font style='color:white'>请选择打款信息已经确认的单子</font>");
return;
}
if(text.length < 1){
layer.msg("<font style='color:white'>无需要进行确认打款确认操作的数据</font>");
return;
}
text = text.join(",");
var date = false;
layer.open({
title : '打款时间确认',
content : `<input type="text" readonly id="deposit_recept_time" value="" placeholder="打款时间"/>`,
success : function() {
$('#deposit_recept_time').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$("#deposit_recept_time").datetimepicker("setDate", new Date());
},
yes : function(index, layero) {
date = $('#deposit_recept_time').val();
if (!date) {
layer.msg('请选择打款时间');
return true;
}
_doAgreeApply();
return true;
}
});
function _doAgreeApply(){
//执行
$.ajax({
type: "POST",
url: "{:U('doPayment')}",
dataType: 'json',
async: false,
data: {ids:text,payment_time:date},
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)
});
})
$("#export_all").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 = $('#search').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;
}
if ($("#company_type").val()) {
url += "&export=1&export_company_type=" + $("#company_type").val();
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel);
return ;
}
url += "&export=1&export_company_type=1";
var iframeExcel1 = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel1);
url += "&export=1&export_company_type=2";
var iframeExcel2 = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel2);
url += "&export=1&export_company_type=3";
var iframeExcel3 = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>";
$("body").append(iframeExcel3);
});
$("#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>
<style>
.layui-layer-close2{
display: none!important;
}
</style>
</block>