apzl_leasing/WebContent/Tenwa/Lease/Flow/CollectionAudit/LcReviewAuditRentPlanByHandleList.jsp
2020-08-28 12:50:11 +08:00

207 lines
7.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@page import="com.tenwa.comm.util.date.DateAssistant"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
Author: undefined 2017-09-20
Content:
History Log:
*/
String plan_date = DateAssistant.getToday();
ASObjectModel doTemp = new ASObjectModel("ViLcReviewAuditRentPlanList3");
// doTemp.setJboWhere(" O.AUDIT_STATE = 'N'");
//默认预查询
//只有计划日期未收款的都可以收款
doTemp.setJboWhereWhenNoFilter(" and O.PLAN_DATE <= '"+plan_date+"' and O.COLLECT_STATUS in ('未收款','部分收款','代偿')");
// doTemp.setJboWhereWhenNoFilter(" and O.COLLECT_STATUS in ('未收款','部分收款') ");
if(CurUser.hasRole("401")){
String orgId = CurUser.getOrgID();
String distributorId = Sqlca.getString(new SqlObject("select distributor_no from distributor_info where orgid='"+orgId+"'"));
doTemp.appendJboWhere("DISTRIBUTOR_ID='"+distributorId+"'");
}
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.MultiSelect = true; //多选b
dwTemp.ReadOnly = "0"; //只读模式
dwTemp.ShowSummary = "1"; //显示小计
dwTemp.setPageSize(pageSize==null?10:Integer.parseInt(pageSize));
dwTemp.genHTMLObjectWindow("");
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","All","Button","手动卡扣","手动扣款","batchCollect()","","","","btn_icon_add",""},
// //{"true","All","Button","实时扣款","实时扣款","timelyCollect()","","","","btn_icon_add",""},
// {"true","All","Button","手工核销","手工扣款","afterCollectManage()","","","","btn_icon_add",""},
// {"true","All","Button","手动刷新","手动刷新","queryBatchCollect()","","","","btn_icon_add",""},
// //{"true","","Button","退回","审核未通过,退回初审","if(confirm('确定要退回吗?')){viewAndEdit()}","","","","btn_icon_detail",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
window.onload=function(){
initFilter();
}
function initFilter(){
filterValues["myiframe0"][TableFactory.getTableColIndexFromDZ("myiframe0",getColIndex(0,"COLLECT_STATUS"))] = "未收款||部分收款";
setFilterAreaValue(0,"plan_date","<%=plan_date%>");
setFilterAreaOption(0,"plan_date","Equals");
//submitFilterArea();
}
//批量代收
function batchCollect(){
//校验所选数据是否是一个主体
var subjectids = getItemValueArray(0,"SUBJECTID");
var oneSubjectId = "";
for(var i = 0;i < subjectids.length; i++){
if(i == 0){
oneSubjectId = subjectids[i];
}else{
if(oneSubjectId != subjectids[i]){
alert("所选数据不能有多个主体,请重新选择!");
return;
}
}
}
if(confirm('确实要执行手动收款操作吗?')){
var sParm_id = getItemValueArray(0,"id");
var sParm_money = getItemValueArray(0,"collect_money");
var sParm_rent = getItemValueArray(0,"rent");
var sParm_penalty = getItemValueArray(0,"penalty");
if(typeof(sParm_id) == "undefined" || sParm_id.length == 0 ){
alert("请至少选择一条记录!");
return;
}
var fileSavePath = "<%=CurConfig.getConfigure("InterfaceFileSavePath")%>";
var ids = "";
var collect_moneys ="";
var json={};
for(var i = 0;i < sParm_id.length; i++){
if(ids.length == 0 ||i==0){
ids = sParm_id[0];
collect_moneys = sParm_money[0];
var rent_moneys = sParm_rent[0];
var penalty_moneys = sParm_penalty[0];
var sum_moneys = eval(rent_moneys+"+"+penalty_moneys);
if(collect_moneys==""||collect_moneys==0){
alert("所选扣款金额不能为空或者为0");
return;
}
if(sum_moneys*100<collect_moneys*100){
alert("扣款金额不能大于租金加罚息金额");
return;
}
json[sParm_id[0]] = sParm_money[0];
}else{
ids += "@" + sParm_id[i];
collect_moneys += "@" + sParm_money[i];
if(sParm_money[i]==""||sParm_money[i]==0){
alert("所选扣款金额不能为空或者为0");
return;
}
var sum_moneyi = eval(sParm_rent[i]+"+"+sParm_penalty[i])
if(sum_moneyi*100<sParm_money[i]*100){
alert("扣款金额不能大于租金加罚息金额");
return;
}
json[sParm_id[i]] = sParm_money[i];
}
}
var jsonStr = JSON.stringify(json);
jsonStr = jsonStr.replace(/,/g,'@');
//扣款前提校验
var result_crii = RunJavaMethodTrans("com.tenwa.collectaudit.cache.CollectAuditInfoCache", "checkRentIsIncome", "id="+ids);
var value = result_crii.split("@");
if (value[0] == "error") {
alert(value[1]);
return;
}
//是否正在执行定时任务校验
var jobName = "f1e947de8bc9447fba53775f8aa3ca7f";
var result_ir = RunJavaMethod("com.tenwa.collectaudit.cache.CollectAuditInfoCache", "isRunning", "jobName="+jobName);
if(result_ir=="using"){
alert("定时任务正在执行,请稍后再试。");
return;
}
//校验当天扣款次数
var result_gcc = RunJavaMethod("com.tenwa.collectaudit.cache.CollectAuditInfoCache", "getCollectCount", "id="+ids);
if(result_gcc==""||result_gcc==null||result_gcc=="error"){
alert("获取当日扣款次数错误");
return;
}
if(result_gcc=="false"){
alert("所选中期次当日手动扣款不能超过2次");
return;
}
var parm = "id="+ids+",fileSavePath="+fileSavePath+",inputuserid="+"<%=CurUser.getUserID()%>"+",inputorgid="+"<%=CurUser.getOrgID()%>";
var parm = parm +",collectStyle=manual,datas="+jsonStr;
//进行拆分调用天津接口或者深圳
if("aa740e4111c111eaaa0000163e0e11e6"==oneSubjectId){
var res = RunJavaMethodTrans("com.tenwa.collectaudit.cache.CollectAuditInfoCache", "batchCollectManageManual", parm);
alert(res);
}else if("d989246c11c111eaaa0000163e0e11e6"==oneSubjectId){
var res = RunJavaMethodTrans("com.tenwa.collectaudit.cache.CollectAuditInfoCacheTj", "batchCollectManage", parm);
alert(res);
}else{
alert("未查询到对应的主体方法!");
}
location.reload();
}
}
function queryBatchCollect(){
//校验所选数据是否是一个主体
var subjectids = getItemValueArray(0,"SUBJECTID");
var oneSubjectId = "";
for(var i = 0;i < subjectids.length; i++){
if(i == 0){
oneSubjectId = subjectids[i];
}else{
if(oneSubjectId != subjectids[i]){
alert("所选数据不能有多个主体,请重新选择!");
return;
}
}
}
if(confirm('确实要执行手动刷新操作吗?')){
var sParm = getItemValueArray(0, "id");
var fileSavePath = "<%=CurConfig.getConfigure("InterfaceFileSavePath")%>";
if(typeof(sParm) == "undefined" || sParm.length == 0 )
{
alert("请至少选择一条记录!");
return;
}
var ids = "";
for(var i = 0;i < sParm.length; i++){
if(ids.length == 0){
ids += sParm[i] +"@";
}else{
ids += sParm[i] +"@";
}
}
var parm = "id="+ids+",fileSavePath="+fileSavePath+",inputuserid="+"<%=CurUser.getUserID()%>"+",inputorgid="+"<%=CurUser.getOrgID()%>";
//进行拆分调用天津接口或者深圳
if("aa740e4111c111eaaa0000163e0e11e6"==oneSubjectId){
var res = RunJavaMethodTrans("com.tenwa.collectaudit.cache.CollectAuditInfoCache", "queryBatchCollectStatus",parm);
console.log(res);
}else if("d989246c11c111eaaa0000163e0e11e6"==oneSubjectId){
var res = RunJavaMethodTrans("com.tenwa.collectaudit.cache.CollectAuditInfoCacheTj", "queryBatchCollectStatus",parm);
console.log(res);
}else{
alert("为查询到对应的主体方法!");
}
// reloadSelf();
location.reload();
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>