Ecology-Dev-chaofa/SHDJY/interface/djy/WorkflowTest.jsp

126 lines
5.1 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="weaver.general.Util" %>
<%@ page import="java.math.BigDecimal" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="bb" class="weaver.general.BaseBean" />
<%
int nodeid = Util.getIntValue(request.getParameter("nodeid"));//流程的节点id
bb.writeLog("========== 加班申请流程 nodeid ============"+ nodeid);
String sql = "select isstart from workflow_nodebase where id = " + nodeid;
rs.execute(sql);
rs.next();
int isstart = Util.getIntValue(rs.getString("isstart"));//判断是否是流程创建节点 1是 0
%>
<script type="text/javascript">
jQuery(document).ready(function(){
//本月部门/团队可使用绩效总盘
var bybmtdksyjxzp_id = WfForm.convertFieldNameToId("bybmtdksyjxzp");
//本月部门/团队绩效总盘
var bybmtdjxzp_id = WfForm.convertFieldNameToId("bybmtdjxzp");
//本月绩效奖金合计
var byjxjjhj_id = WfForm.convertFieldNameToId("byjxjjhj");
//上月剩余绩效总盘
var sysyjxzp_id = WfForm.convertFieldNameToId("sysyjxzp");
//部门/团队
var bmtd_id = WfForm.convertFieldNameToId("bmtd");
//考核月份
var khyf_id = WfForm.convertFieldNameToId("khyf");
WfForm.registerCheckEvent(WfForm.OPER_SAVE+","+WfForm.OPER_SUBMIT,function(callback){
var bybmtdksyjxzp = WfForm.getFieldValue(bybmtdksyjxzp_id);
var byjxjjhj = WfForm.getFieldValue(byjxjjhj_id);
if(parseFloat(byjxjjhj) > parseFloat(bybmtdksyjxzp)){
window.weaJs.alert("本月绩效奖金不能大于本月部门/团队可使用绩效总盘!");
return;
}else{
callback();
}
});
// 部门/团队 值变化时
WfForm.bindFieldChangeEvent(bmtd_id,function(obj,id,value){
if(value){
var nianyue = WfForm.getFieldValue(khyf_id);
var options = {
url: '/interface/djy/getLastPtygKsyjxzp.jsp',
method: 'POST',
params : {deptid:value,nianyue:nianyue}
};
window.weaJs.callApi(options).then(function(res) {
let lastresult = res.result;
WfForm.changeFieldValue(sysyjxzp_id,{value:lastresult});
});
}
});
// 考核月份 值变化时
WfForm.bindFieldChangeEvent(khyf_id,function(obj,id,value){
if(value){
var bm = WfForm.getFieldValue(bmtd_id);
var options = {
url: '/interface/djy/getLastPtygKsyjxzp.jsp',
method: 'POST',
params : {deptid:bm,nianyue:value}
};
window.weaJs.callApi(options).then(function(res) {
let lastresult = res.result;
WfForm.changeFieldValue(sysyjxzp_id,{value:lastresult});
});
}
});
// 本月部门/团队绩效总盘 值变化时
WfForm.bindFieldChangeEvent(bybmtdjxzp_id,function(obj,id,value){
if(value){
var sysyjxzp = WfForm.getFieldValue(sysyjxzp_id);
var totalvalue = parseFloat(value)+ parseFloat(sysyjxzp);
WfForm.changeFieldValue(bybmtdksyjxzp_id,{value:totalvalue});
}
});
// 上月剩余绩效总盘 值变化时
WfForm.bindFieldChangeEvent(sysyjxzp_id,function(obj,id,value){
if(value){
var bybmtdjxzp = WfForm.getFieldValue(bybmtdjxzp_id);
var totalvalue = parseFloat(value)+ parseFloat(bybmtdjxzp);
WfForm.changeFieldValue(bybmtdksyjxzp_id,{value:totalvalue});
}
});
// 部门/团队 值变化时
WfForm.bindFieldChangeEvent(bmtd_id,function(obj,id,value){
if(value){
var nianyue = WfForm.getFieldValue(khyf_id);
var options = {
url: '/interface/djy/getLastLingdaoKsyjxzp.jsp',
method: 'POST',
params : {deptid:value,nianyue:nianyue}
};
window.weaJs.callApi(options).then(function(res) {
let lastresult = res.result;
WfForm.changeFieldValue(sysyjxzp_id,{value:lastresult});
});
}
});
// 考核月份 值变化时
WfForm.bindFieldChangeEvent(khyf_id,function(obj,id,value){
if(value){
var bm = WfForm.getFieldValue(bmtd_id);
var options = {
url: '/interface/djy/getLastLingdaoKsyjxzp.jsp',
method: 'POST',
params : {deptid:bm,nianyue:value}
};
window.weaJs.callApi(options).then(function(res) {
let lastresult = res.result;
WfForm.changeFieldValue(sysyjxzp_id,{value:lastresult});
});
}
});
});
</script>