提交 93319982 编写于 作者: B boomEgg

考勤管理---自定义申述流程

上级 42d240b9
......@@ -5,7 +5,7 @@
"contentStyles" : "normalTdNode",
"item" : "checkbox",
"name" : "checkbox",
"condition" : "function(d){ return d.status==0 ? true : false }",
"condition" : "function(d){ return d.status==0&&d.APPEAL_AUDIFLOWTYPE=='BUILTIN' ? true : false }",
"width" : "5%"
},
{
......@@ -102,14 +102,14 @@
"sub" : [{
"title" : "同意",
"action" : "agree",
"condition" : "function(d){ return d.APPEALABLE; }",
"condition" : "function(d){ return d.APPEALABLE&&d.APPEAL_AUDIFLOWTYPE=='BUILTIN'; }",
"styles" : "actionAgreeNode",
"overStyles" : "actionAgreeNode_over",
"downStyles" : "actionAgreeNode_down"
}, {
"title" : "不同意",
"action" : "deny",
"condition" : "function(d){ return d.APPEALABLE; }",
"condition" : "function(d){ return d.APPEALABLE&&d.APPEAL_AUDIFLOWTYPE=='BUILTIN'; }",
"styles" : "actionDenyNode",
"overStyles" : "actionDenyNode_over",
"downStyles" : "actionDenyNode_down"
......
......@@ -39,11 +39,31 @@ MWF.xApplication.Attendance.AppealExplorer = new Class({
},
loadConfig : function(){
this.config = {};
/*this.config = {};
var v;
this.actions.getSettingCode( "APPEALABLE", function(json){
v = json.data ? json.data.configValue : null
},null, false)
if( !v ){
this.config.APPEALABLE = true;
}else{
this.config.APPEALABLE = (v != "false" )
}*/
this.config = {};
var v;
//需要判断申述类型listSetting2020年6月16日 by gee
this.configSetting = new Object(null);
this.actions.listSetting(function(json){
var data = json.data;
if(!!data){
json.data.map(function(e){
this.configSetting[e.configCode]=e;
}.bind(this));
v = this.configSetting.APPEALABLE.configValue;
}else{
v = null;
}
}.bind(this),null,false);
if( !v ){
this.config.APPEALABLE = true;
}else{
......@@ -300,6 +320,7 @@ MWF.xApplication.Attendance.AppealExplorer.View = new Class({
var data = json.data;
data.each(function(d){
d.APPEALABLE = this.explorer.config.APPEALABLE;
d.APPEAL_AUDIFLOWTYPE = this.explorer.configSetting.APPEAL_AUDIFLOWTYPE.configValue;
}.bind(this));
data.sort( function( a, b ){
return parseInt( b.appealDateString.replace(/-/g,"") ) - parseInt( a.appealDateString.replace(/-/g,"") );
......@@ -315,12 +336,20 @@ MWF.xApplication.Attendance.AppealExplorer.View = new Class({
},
_openDocument: function( documentData ){
var appeal = new MWF.xApplication.Attendance.AppealExplorer.Appeal(this.explorer, documentData );
if( !documentData.status ){
appeal.edit();
if(!!documentData.appealAuditInfo){
var workid = documentData.appealAuditInfo.workId;
var options = {"workId":workid, "appId": "process.Work"+workid};
this.app.desktop.openApplication(null, "process.Work", options);
}else{
appeal.open();
var appeal = new MWF.xApplication.Attendance.AppealExplorer.Appeal(this.explorer, documentData );
if( !documentData.status ){
appeal.edit();
}else{
appeal.open();
}
}
}
})
......
......@@ -285,8 +285,15 @@ MWF.xApplication.Attendance.MyAppeal.View = new Class({
},
_openDocument: function( documentData ){
var appeal = new MWF.xApplication.Attendance.MyAppeal.Appeal(this.explorer, documentData );
appeal.open();
if(!!documentData.appealAuditInfo){
var workid = documentData.appealAuditInfo.workId;
var options = {"workId":workid, "appId": "process.Work"+workid};
this.app.desktop.openApplication(null, "process.Work", options);
}else{
var appeal = new MWF.xApplication.Attendance.MyAppeal.Appeal(this.explorer, documentData );
appeal.open();
}
}
});
......
......@@ -684,7 +684,7 @@ MWF.xApplication.Attendance.MyDetail.Document = new Class({
var form = new MWF.xApplication.Attendance.MyDetail.Appeal( this.explorer, this.data );
form.create();
}else{
this.loadProcess(this.explorer.configSetting.APPEAL_AUDIFLOW_ID.configValue,null,null);
this.loadProcess(this.explorer.configSetting.APPEAL_AUDIFLOW_ID.configValue,{record:this.data} ,null);
}
},
......@@ -706,7 +706,6 @@ MWF.xApplication.Attendance.MyDetail.Document = new Class({
afterStartProcess: function(data, title, processName){
var workInfors = [];
var currentTask = [];
data.each(function(work){
if (work.currentTaskIndex !== -1) currentTask.push(work.taskList[work.currentTaskIndex].work);
workInfors.push(this.getStartWorkInforObj(work));
......@@ -770,20 +769,21 @@ MWF.xApplication.Attendance.MyDetail.Document = new Class({
});
},
getProcess: function(id, callback){
// MWF.xDesktop.requireApp("process.ProcessManager", "Actions.RestActions", function(){
// var action = new MWF.xApplication.process.ProcessManager.Actions.RestActions();
// action.getProcess(id, function(json){
this.action = new o2.xDesktop.Actions.RestActions("", "x_processplatform_assemble_surface", "");
this.action.actions = {"getProces": {"uri": "/jaxrs/process/{id}/complex"}};
this.action.invoke({"name": "getProces", "async": false, "parameter": {"id": id}, "success": function(json){
if (callback) callback(json.data);
}.bind(this)});
// }.bind(this));
// }.bind(this));
},
seeAppeal : function(){
var form = new MWF.xApplication.Attendance.MyDetail.Appeal( this.explorer, this.data );
form.open();
if(!this.data.appealInfos){
var form = new MWF.xApplication.Attendance.MyDetail.Appeal( this.explorer, this.data );
form.open();
}else{
var workid = this.data.appealInfos[0].appealAuditInfo.workId;
var options = {"workId":workid, "appId": "process.Work"+workid};
this.app.desktop.openApplication(null, "process.Work", options);
}
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册