<!DOCTYPE html> <#include "/layout/meta.ftl"> <h3>渠道手续费结算</h3> <div class="searchCenter"> <#if actionMessage??> <div class="warning icon_error">${(actionMessage)!''}</div> </#if> <#if actionSuccessMessage??> <div class="warning icon_ok ">${(actionSuccessMessage)!''}</div> </#if> <form id='submitForm' method='post' action="${ctx}/report/settle/query.do" name="f0"> <div class="searchBtn" style="width: 200px;margin-right: 20px;"> <button id="query-btn" type="button"> <span><span>查询</span></span> </button> <#if ((resultList??) && (resultList?size>0))> <button id="checkPayment" type="button" title="合并付款"> <span><span>合并付款</span></span> </button> </#if> <button id="downBtn" type="button" οnclick="doExportCsv();"> <span><span>下载</span></span> </button> </div> <input id="settleNoList" name="settleNoList" type="hidden" value="${(condition.settleNoList)!''}" /> <table class='searTabBg'> <tr> <td class="tdNameBig">SAPID:</td> <td> <input name="sapId" value="${(condition.sapId)!''}" class="inputIn"/> </td> <td class="tdNameBig">银行类型:</td> <td> <@ui.select list=summaryBankTypeList listKey='bankType' listValue='bankType' emptyValue="" path="condition.bankType" attributes='class=inputSelt'/> </td> </tr> <tr> <td class="tdNameBig">手续费结算单号:</td> <td> <input name="settleNo" value="${(condition.settleNo)!''}" class="inputIn"/> </td> <td class="tdNameBig">付款状态:</td> <td> <@ui.select list=settleStatusList listKey='code' listValue='description' emptyValue="" path="condition.status" attributes='class=inputSelt'/> </td> </tr> <tr> <td class="tdNameBig"><span class="star">*</span>结算开始时间:</td> <td> <input type="text" id="startDateStr" name="startDateStr" value="${(condition.startDateStr)!''}" class="Wdate" οnfοcus="WdatePicker({dateFmt:'yyyyMM'});"/> </td> <td class="tdNameBig"><span class="star">*</span>结算结束时间:</td> <td> <input type="text" id="endDateStr" name="endDateStr" value="${(condition.endDateStr)!''}" class="Wdate" οnfοcus="WdatePicker({dateFmt:'yyyyMM'});"/> </td> </tr> <tr> <td colspan="6"> </td> </tr> </table> </form> </div> <#if resultList??> <div id='data'> <table class="list" width="100%"> <thead> <tr> <th></th> <th>序号</th> <th>手续费结算单号</th> <th>结算状态</th> <th>SAPID</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> <#list resultList as item> <tr> <td> <#if item.status='02'> <input id="ayment${item_index+1}" type="checkbox" name="ke" value="${item.settleNo}"> </#if> </td> <td>${item_index+1}</td> <td> <#if item.settleNo??> <a href="javascript:void(0)" id="orderNoResult" οnclick="showOrderNoResultList('${item.settleNo}')" class="blueLink">${(item.settleNo)!''}</a> </#if> </td> <td>${item.statusDesc}</td> <td>${item.sapId}</td> <td>${item.channelName}</td> <td>${item.bankType}</td> <td>${item.settleYearMonth}</td> <td> ${(item.consumeAmount)?string(',##0.00')} </td> <td> ${(item.refundAmount)?string(',##0.00')} </td> <td> ${(item.poundageAmount)?string(',##0.00')} </td> <td>${item.settleCycleDesc}</td> <td>${item.settleTypeDesc}</td> <td>${item.ticketTypeDesc}</td> <td>${item.bpNo}</td> <td> <#if item.status='01'> <input id="confirmAmount${item_index+1}" value="${item.confirmAmount?string('0.00')}"> </input> <#else>${(item.confirmAmount)?string(',##0.00')} </#if> </td> <td>${item.remark}</td> <td> <#if item.status='01'> <a href="javascript:void(0)" id="confirm${item_index+1}" οnclick="confirmAmount('${item.settleNo}','${item.poundageAmount}', $('#confirmAmount${item_index+1}').val(), this)" class="blueLink">确认</a> <#elseif item.status='02'||item.status='04'||item.status='05'> <a href="javascript:void(0)" id="payment${item_index+1}" οnclick="payment('${item.settleNo}', this)" name="pay${item.settleNo}" class="blueLink">付款</a> <a href="javascript:void(0)" id="giveup${item_index+1}" οnclick="giveupPayment('${item.settleNo}', this)" class="blueLink">放弃付款</a> </#if> <#-- <a href="javascript:void(0)" οnclick="showDetailedInfo('${item.settleNo}')" class="blueLink">操作日志</a>--> </td> </tr> </#list> </tbody> </table> <@ui.page formId="f0"/> </div> </#if> <script language="javascript" type="text/javascript"> $(function () { checkedNos = $("#settleNoList").val(); paymentIds= ""; //通用方法 define_csb_common_method(); $("form[name='f0']").validate({ rules: { startDateStr: "required", endDateStr: {year: true} }, messages: { startDateStr: '请输入结算开始时间', endDateStr: {required: '请输入结算结束时间', year: '查询时间不能超过1年'} } }); $("input[name=ke]").click(function(){ if(this.checked==true){ var pay="pay"+this.value; //避免重复添加(若存在元素时,不添加) if(!contains(checkedNos,this.value)){ checkedNos+=this.value+","; paymentIds +=pay+","; } } else { var pay="pay"+this.value; if(contains(checkedNos,this.value)){ checkedNos=checkedNos.replace((this.value+","),""); paymentIds =paymentIds.replace((pay+","),""); } } $("#settleNoList").val(checkedNos); }); //查询 $("#query-btn").click(function(){ if ($("form[name='f0']").valid()) { var formObj = $("form[name='f0']"); formObj.attr("action", "${ctx}/report/settle/query.do"); formObj.submit(); } }); //合并付款 $("#checkPayment").click(function () { $("#checkPayment").attr("disabled","disabled"); if (checkedNos == ""){ alert("合并付款选择不可为空"); $('#checkPayment').removeAttr("disabled"); return; } var selected=subStrArray(checkedNos); var payment=subStrArray(paymentIds); $.ajax({ url:"${ctx}/report/settle/checkMergePayment.do", type: 'post', data: { settleNos:selected }, traditional: true, success: function(result){ $('#checkPayment').removeAttr("disabled"); if(result.success){ getValueByName(payment); alert("操作成功"); }else { alert('合并付款失败【'+ result.errorCode+"-"+ result.message + '】'); } }, error: function () { alert("系统异常"); location.reload(); } }) }); }); //初始化checkbox window.οnlοad=function (){ var selected=subStrArray(checkedNos); $("input[name=ke]").each(function () { if (isInArray(selected,this.value)){ // var pay="pay"+this.value; // changeValueByName(pay); this.checked = true; } }); }; /** * 功能描述: <br> *<赋值> * * @param * @return * @author 88395515 */ function changeValueByName(value){ var val = document.getElementsByName(value); $(val).removeAttr("href"); $(val).removeAttr("onclick"); $(val).css({'cursor':'default'}); $(val).text('处理中..'); } /** * 功能描述: <br> *<遍历赋值> * * @param * @return * @author 88395515 */ function getValueByName(payment){ $.each(payment,function(index,value){ changeValueByName(value); }); } //确认金额 function confirmAmount(settleNo, poundageAmount, confirmAmount, confirm){ if(parseFloat(confirmAmount) > parseFloat(poundageAmount)){ alert("请确认付款金额是否小于等于手续费总金额"); return; } $.post("${ctx}/report/settle/confirm.do?settleno="+settleNo+"£ageAmount="+poundageAmount+"&confirmAmount="+confirmAmount+"&radom="+Math.random(),function(data){ var result = eval(data); if(result!=null){ if(result.success){ alert("操作成功"); $("#"+confirm.id).removeAttr("href"); $("#"+confirm.id).removeAttr("onclick"); $("#"+confirm.id).css({'cursor':'default'}); $("#"+confirm.id).text('处理中..'); }else{ alert("操作失败【"+result.message+"】") } } }); } //付款 function payment(settleNo, payment){ var settleNos=new Array() settleNos[0]=settleNo; $.post("${ctx}/report/settle/checkMergePayment.do?settleNos="+settleNos+"&radom="+Math.random(),function(data){ var result = eval(data); if(result!=null){ if(result.success){ alert("操作成功"); $("#"+payment.id).removeAttr("href"); $("#"+payment.id).removeAttr("onclick"); $("#"+payment.id).css({'cursor':'default'}); $("#"+payment.id).text('处理中..'); }else{ alert("操作失败【"+result.message+"】") } } }); } //放弃付款 function giveupPayment(settleNo, giveup){ $.post("${ctx}/report/settle/unpay.do?settleno="+settleNo+"&radom="+Math.random(),function(data){ var result = eval(data); if(result!=null){ if(result.success){ alert("操作成功"); $("#"+giveup.id).removeAttr("href"); $("#"+giveup.id).removeAttr("onclick"); $("#"+giveup.id).css({'cursor':'default'}); $("#"+giveup.id).text('处理中..'); }else{ alert("操作失败【"+result.message+"】") } } }); } var styleinfo = "height=300,width=900,top=200,left=200,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no"; /** * 操作明细 * @param serialNo */ function showDetailedInfo(settleNo){ window.open("${ctx}/psOperateSerial/settleOperateView.do?operateKey="+settleNo+"&radom="+Math.random(),'',styleinfo); } /** * 功能描述: <br> *< 出款单号> * * @param settleNo */ function showOrderNoResultList(settleNo) { window.open("${ctx}/report/settle/showOrderNoDetail.do?settleNo="+settleNo+"&radom="+Math.random(),'',"height=370,width=870,top=200,left=200,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no"); } //下载CSV function doExportCsv(){ var dataJudge = $('#data').find('tr:eq(1)').find('td').length; if(dataJudge == 0){ alert("请先查询数据!"); }else{ window.location.href="${ctx}/report/settle/downloadCSV.do?"+$("#submitForm").serialize(); } } function contains(obj, ele) { if(obj=="" || obj.indexOf(",") < 0){ return; } var arr = obj.split(","); var i = arr.length; while (i--) { if (arr[i] == ele) { return true; } } return false; } /** * 使用循环的方式判断一个元素是否存在于一个数组中 * @param {Object} arr 数组 * @param {Object} value 元素值 */ function isInArray(arr,value){ for(var i = 0; i < arr.length; i++){ if(value === arr[i]){ return true; } } return false; } /** * 功能描述: <br> *<字符串去掉“,”转数组> * * @param * @return * @author 88395515 */ function subStrArray(checkedNos) { var checkenos=checkedNos.substring(0,checkedNos.length-1); var selected=checkenos.split(","); return selected; } </script>
checkbox翻页多选
最新推荐文章于 2024-07-16 14:35:21 发布