You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
FZ/lis-module-ind-config-web/src/main/webapp/uw/QualityDifferentiated.js

185 lines
7.8 KiB

// 该文件中包含客户端需要处理的函数和事件
var showInfo;
var mDebug="0";
var mSwitch = parent.VD.gVSwitch;
var turnPage = new turnPageClass();
var arrDataSet;
// 查询按钮
function easyQueryClick() {
//首先查询历史修改信息
// 初始化表格
initPolGrid();
if((fm.AgentCode.value==""||fm.AgentCode.value==null)){
i18nAlert("业务员代码不能为空!", "LIS-05779");
return false;
}
var tAgentCode = fm.AgentCode.value;
// 书写SQL语句
var strSQL = "";
// strSQL = "select managecom,manauwtype,agentcode,uwclass,"
// + " (select name from laagent where agentcode = LDUWDifferenceB.agentcode),"
// + " uwlevel,concat(concat(to_char(makedate2,'YYYY-MM-DD') , ' ') , maketime2)"
// + " from LDUWDifferenceB "
// + " where 1=1 and agentcode='"+tAgentCode+"'"
// + " and difftype='1'"
// + " order by makedate2,maketime2";
var sqlid1="QualityDifferentiatedSql0";
// var mySql1=new SqlClass();
// mySql1.setResourceName("uw.QualityDifferentiatedSql"); //指定使用的properties文件名
// mySql1.setSqlId(sqlid1);//指定使用的Sql的id
// mySql1.addSubPara(tAgentCode);//指定传入的参数
// strSQL=mySql1.getString();
var param=[tAgentCode];
strSQL = wrapSql("uw.QualityDifferentiatedSql", sqlid1, param, "ind_config");
// prompt("",strSQL);
//查询SQL,返回结果字符串
turnPage.queryModal(strSQL,PolGrid);
//查询业务员当前信息
//strSQL = "select uwlevel,uwclass from latree where agentcode='"+tAgentCode+"'";
var sqlid2="QualityDifferentiatedSql1";
// var mySql2=new SqlClass();
// mySql2.setResourceName("uw.QualityDifferentiatedSql"); //指定使用的properties文件名
// mySql2.setSqlId(sqlid2);//指定使用的Sql的id
// mySql2.addSubPara(tAgentCode);//指定传入的参数
// strSQL=mySql2.getString();
strSQL = wrapSql("uw.QualityDifferentiatedSql",sqlid2,[tAgentCode],"ind_config");
var arrResult = easyExecSql(strSQL);
if (arrResult != null) {
fm.UWLevel.value = arrResult[0][0];
fm.UWClass.value = arrResult[0][1];
showOneCodeName('uwlevel','UWLevel','UWLevelName');
showOneCodeName('agentuwclass','UWClass','UWClassName');
} else {
fm.UWLevel.value = "";
fm.UWClass.value = "";
}
}
//提交后操作,服务器数据返回后执行的操作
function afterSubmit( FlagStr, content ) {
showInfo.close();
if (FlagStr == "Fail" ) {
var urlStr="../common/jsp/MessagePage.jsp?picture=C&content=" + encodeURIComponent(content);
//showModalDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:350px");
var name='提示'; //网页名称,可为空;
var iWidth=550; //弹出窗口的宽度;
var iHeight=250; //弹出窗口的高度;
var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置
var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置
showInfo = window.open (urlStr,name, "status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no,height="+ iHeight+",width="+iWidth+",innerHeight="+iHeight+",innerWidth=" +iWidth+",left="+iLeft+",top="+iTop,false);
showInfo.focus();
} else {
var urlStr="../common/jsp/MessagePage.jsp?picture=S&content=" + encodeURIComponent(content);
//showModalDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:350px");
var name='提示'; //网页名称,可为空;
var iWidth=550; //弹出窗口的宽度;
var iHeight=250; //弹出窗口的高度;
var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置
var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置
showInfo = window.open (urlStr,name, "status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no,height="+ iHeight+",width="+iWidth+",innerHeight="+iHeight+",innerWidth=" +iWidth+",left="+iLeft+",top="+iTop,false);
showInfo.focus();
initForm();
}
unlockScreen('lkscreen');
}
function queryAgent() {
if(document.all('AgentCode').value == "") {
var newWindow = window.open("../sys/AgentCommonQueryMain.jsp?ManageCom="+comCode+"","AgentCommonQueryMain",'width='+screen.availWidth+',height='+screen.availHeight+',top=0,left=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0');
}
if(document.all('AgentCode').value != ""&& document.all('AgentCode').value.length==10){
var cAgentCode = fm.AgentCode.value; //保单号码
// var strSQL = "select a.AgentCode,a.AgentGroup,a.ManageCom,a.Name,c.BranchManager,b.IntroAgency,b.AgentSeries,b.AgentGrade,c.BranchAttr,b.AscriptSeries,c.name from LAAgent a,LATree b,LABranchGroup c where 1=1 "
// + "and a.AgentCode = b.AgentCode and a.AgentGroup = c.AgentGroup and a.AgentState < '03' and a.AgentCode='"+cAgentCode+"' ";//and a.managecom='"+document.all("ManageCom").value+"'";
var mySql = new SqlClass2();
mySql.api(true);
mySql.module("ind_config");
mySql.resourceName("others.Ind_Config");//指定使用的interface文件名
mySql.sqlId("QualityDifferentiated1");//指定使用的Sql的id
mySql.put("cAgentCode",cAgentCode);// 指定传入的参数
var arrResult = easyExecSql(mySql.string());
//alert(arrResult);
if (arrResult != null) {
fm.AgentGroup.value = arrResult[0][1];
fm.AgentName.value = arrResult[0][3];
} else {
fm.AgentCode.value ="";
fm.AgentGroup.value ="";
fm.AgentName.value ="";
i18nAlert("编码为:[{0}]的业务员不存在,或者不在该管理机构下,或者已经离职,请确认!", "LIS-00570", cAgentCode);
}
}
}
//查询返回时执行的函数,查询返回一个2维数组,数组下标从[0][0]开始
//为业务员代码、姓名
function afterQuery2(arrResult) {
if(arrResult!=null) {
fm.AgentCode.value = arrResult[0][0];
fm.AgentGroup.value = arrResult[0][1];
fm.AgentName.value = arrResult[0][3];
}
}
/**
* "修改"按钮
* */
function UpdateAgent(){
lockScreen('lkscreen');
if(CheckData()==false){
unlockScreen('lkscreen');
return false;
}
var showStr=i18nMessage("正在保存数据,请您稍候并且不要修改屏幕上的值或链接其他页面", "LIS-04539");
var urlStr="../common/jsp/MessagePage.jsp?picture=C&content=" + encodeURIComponent(showStr);
var name='提示'; //网页名称,可为空;
var iWidth=550; //弹出窗口的宽度;
var iHeight=250; //弹出窗口的高度;
var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置
var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置
showInfo = window.open (urlStr,name, "status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no,height="+ iHeight+",width="+iWidth+",innerHeight="+iHeight+",innerWidth=" +iWidth+",left="+iLeft+",top="+iTop,false);
showInfo.focus();
// document.getElementById("fm").submit();
fm.action = "../API/ind_config/uw/QualityDifferentiatedSave/UPDATE";
ajaxSubmit2(document.getElementById("fm"));
}
function CheckData(){
if((fm.ManageCom.value==null||fm.ManageCom.value=="")&&(fm.AgentCode.value==null||fm.AgentCode.value=="")){
i18nAlert("至少录入管理机构、业务员代码其中的一项!", "LIS-05780");
return false;
}
if(fm.UWLevel.value==null||fm.UWLevel.value==""){
if(!i18nConfirm("业务员的差异化级别为空,是否继续?", "LIS-00998")){
return false;
}
}
if(fm.ManageCom.value.length==2){
i18nAlert("不能按总公司修改,至少按二级机构修改!", "LIS-05767");
return false;
}
if((!(fm.ManageCom.value==null||fm.ManageCom.value==""))&&(fm.AgentCode.value==null||fm.AgentCode.value=="")){
if(!confirm("注意,即将修改机构"+fm.ManageCom.value+"下所有业务员差异化级别,是否继续?")){
return false;
}
}
}