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.

663 lines
28 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;}
.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;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">联运平台汇总结算单管理</h3>
<p class="description_text">结算单发起汇总后生成汇总单--->汇总单财务审核--->提交打款信息--->打款审批</p>
</div>
<div class="cf top_nav_list" style="height: 38px;">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list" style="margin-bottom: 15px;">
5 years ago
<div class="input-list">
<input type="text" name="statement_num" class="" placeholder="请输入订单号" value="{:I('statement_num')}" />&nbsp;
</div>
<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="is_payment" name="is_payment" class="select_gallery" >
<option value="">请选择是否打款</option>
<volist name="IsPayment" id="vo">
<option value="{$key}" <if condition="isset($_GET['is_payment']) && $key eq I('is_payment')">selected</if> >{$vo}</option>
</volist>
</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="withdraw_type" name="withdraw_type" class="select_gallery" >
<option value="">结算周期</option>
<volist name="WithdrawType" id="vo">
<option value="{$key}" <if condition="isset($_GET['withdraw_type']) && $key eq I('withdraw_type')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
5 years ago
<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">
<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>
5 years ago
<th>是否打款</th>
<th>结算金额</th>
<!-- <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>
4 years ago
<td ><input class="ids" type="checkbox" data-status="{$data.verify_status}" data-export="{$data.can_export}" value="{$data['id']}" name="ids[]"></td>
5 years ago
<td>{$data.statement_num}</td>
<td>{$data.valid}</td>
4 years ago
<td>{$data.company_type_str}</td>
<td>{$data.withdraw_type}</td>
5 years ago
<td>{$data.is_payment_str}</td>
<td>{$data.statement_money}</td>
<!-- <td>{$data.platform_amount}</td> -->
<td>{$data.lack_statement_money}</td>
5 years ago
<td>{$data.create}</td>
<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>
<td>
<if condition="$data.verify_status eq -2 ">
<div style="line-height: 2;color: red;">
{$data.payment}
</div>
<else />
<div style="line-height: 2;">
{$data.payment}
</div>
</if>
</td>
<td>{$data.ext_file_type}</td>
<td>
<foreach name="data.oplist" item="vo" >
{$vo}
</foreach>
</td>
</tr>
</volist>
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">结算总金额:&nbsp;{$count.statement_money}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;不结算总金额:{$count.lack_statement_money}&nbsp;&nbsp;&nbsp;</td></tr>
5 years ago
</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> -->
5 years ago
</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">
//导航高亮
5 years ago
highlight_subnav("{:U('lists')}");
5 years ago
function reload() {
window.location.reload();
}
$(function(){
var company_id = "{$_GET['company_id']??0}";
$("#company_type").on("change",function(){
var type = $(this).find("option:selected").val();
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();
5 years ago
$(".viewPool").click(function () {
5 years ago
var id = $(this).data("id");
5 years ago
var url = "{:U('viewPool')}"+"&id="+id
5 years ago
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
4 years ago
area: ['100%', '100%'],
5 years ago
content: url
});
});
4 years ago
$("#verifyAgree,#verifyRefuse").on("click",function(){
5 years ago
var id = $(this).attr("id");
if(id == "verifyAgree"){
var opname = "审批通过";
var opurl = "{:U('verifyAgree')}";
var opst ="[未进行审批]";
var status = [0];
}else if(id=="verifyRefuse"){
var opname = "审批拒绝";
var opurl = "{:U('verifyRefuse')}";
var opst ="[未进行审批]";
var status = [0];
}
5 years ago
5 years ago
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){
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){
_doAgreeApply();
layer.close(index);
});
}else{
if(confirm){
layer.confirm('【警告】'+opname+'将不可回退,如需继续请点击确认', {
btn: ['确认','取消'],
title:false
}, function(){
_doAgreeApply();
});
}else{
_doAgreeApply();
}
}
function _doAgreeApply(){
//执行
$.ajax({
type: "POST",
url: opurl,
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 () {
4 years ago
var flag = false;
5 years ago
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
4 years ago
if($(elem).data("export") == 1){
return $(elem).val();
}else{
flag = true;
}
5 years ago
}).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;
}
4 years ago
if(flag){
layer.confirm("仅结算金额不等于0的会进行导出将忽略结算金额等于0的汇总单点击取消停止操作",{title:false}, function(index){
_export();
layer.close(index);
});
}else{
_export();
}
function _export(){
for (var index = 0; index < text.length; index++) {
var id = text[index];
var url ="{:U('viewPool')}"+"&id="+id+"&export=1";
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
}
})
4 years ago
//撤销汇总
$(".cancelPool,.reCount").on("click",function(){
4 years ago
var id = $(this).data('id');
var url = "{:U('cancelPool')}";
4 years ago
layer.confirm("撤销汇总/重算都是不可逆操作,请慎重选择",{title:false}, function(index){
layer.close(index);
cancelPoolAjax(url,{id:id});
});
4 years ago
})
//线下打款
$(".setUlPayment").on("click",function(){
var id = $(this).data('id');
var url = "{:U('setUlPayment')}";
cancelPoolAjax(url,{ids:id});
})
$(".setPayment,.editPayment").on("click",function(){
var id = $(this).data("id");
var url = "{:U('setPayment')}"+"&id="+id
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: url
});
})
$(".viewPayment").on("click",function(){
var id = $(this).data("id");
var url = "{:U('viewPayment')}"+"&id="+id
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: url
});
})
4 years ago
function cancelPoolAjax(opurl,senddata){
//执行
4 years ago
layer.load(2);
4 years ago
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
4 years ago
async: true,
4 years ago
data: senddata,
success:function(data){
4 years ago
layer.closeAll('loading');
4 years ago
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;
}
}
});
}
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',
async: false,
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: false,
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
//上传凭证
$(".uploadVoucher").click(function () {
var id = $(this).data("id");
layer.open({
type: 2,
title: "上传凭证",
shadeClose: true,
shade: 0.8,
area: ['60%', '60%'],
content:'/admin.php?s=/CompanyStatementPool/uploadVoucher/id/'+id,
end:function(){
reload();
}
});
});
//查看凭证
$(".viewVoucher").click(function () {
var img = $(this).data("img");
layer.open({
type: 1,
title:false,
content:"<img src='"+img+"' style='width: auto;height: 450px;margin: auto;'>"
});
});
//编辑凭证
$(".editVoucher").click(function () {
var id = $(this).data("id");
layer.open({
type: 2,
title: "编辑凭证",
shadeClose: true,
shade: 0.8,
area: ['60%', '60%'],
content:'/admin.php?s=/CompanyStatementPool/editVoucher/id/'+id,
end:function(){
reload();
}
});
});
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 start2 = $("#time_start2").val();
var end2 = $("#time_end2").val();
if(start2 !='' && end2 != ''){
if (Date.parse(start2) > Date.parse(end2)){
layer.msg('操作开始时间必须小于等于结束时间');
5 years ago
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>