标签:
//方法名:bcs_Nexteer_CheckTime //功能描述:开始和结束日期对比 //原作者:joe //创建时间:20141226 //版权所有(C)JOE.FAN //debugger; //-------------------------------------------------------- var startPropNm = "start_time"; var duePropNm = "end_time"; var curNm = this.name; var dualNm = (curNm == duePropNm ? startPropNm : duePropNm); var dualVal = top.aras.getItemProperty(document.item, dualNm); var newDate = top.aras.getItemProperty(document.item, curNm); var sign2Compare = (curNm == duePropNm ? -1 : 1); var errMsg = (curNm == duePropNm ? "结束时间不能早于开始时间" : "开始时间不能晚于结束时间"); var prevValsHashKey = "prevValsHashKey_7984655F176B40388EBBC2F3A8D750D2"; var doBckpDts = true; if (newDate) { if (dualVal) { if (sign2Compare * top.compareDates(newDate, dualVal) > 0) { top.aras.AlertError(errMsg); var backupVal = (document[prevValsHashKey] ? document[prevValsHashKey][curNm] : ""); if (!backupVal) {backupVal = "";} top.aras.setItemProperty(document.item, curNm, backupVal); doBckpDts = false; } } else { var newDualVal = (curNm == duePropNm ? top.decDateToFirstWorking(newDate) : top.incDateToFirstWorking(newDate)); top.aras.setItemProperty(document.item, dualNm, newDualVal); } } if (doBckpDts) { if (!document[prevValsHashKey]) {document[prevValsHashKey] = new Object();} document[prevValsHashKey][curNm] = newDate; document[prevValsHashKey][dualNm] = dualVal; } var form = document.forms.MainDataForm; if (!form) {return false;} top.aras.uiPopulateFormWithItemEx(form, document.item, document.itemType, document.isEditMode);
标签:
原文地址:http://www.cnblogs.com/fanxingthink/p/4186537.html