MWF.xApplication.Execution = MWF.xApplication.Execution || {}; MWF.xDesktop.requireApp("Template", "Explorer", null, false); MWF.xDesktop.requireApp("Template", "MForm", null, false); MWF.xDesktop.requireApp("Execution", "WorkForm", null, false); MWF.xApplication.Execution.WorkGather = new Class({ Extends: MWF.xApplication.Template.Explorer.PopupForm, Implements: [Options, Events], options: { //"centerWorkId" : "fc44be47-7271-469f-8f04-deebdb71d3e6", "style": "default", "width": "100%", "height": "100%", "hasTop": true, "hasIcon": false, "hasBottom": true, "title": "", "draggable": false, "closeAction": true, "isNew": false, "isEdited": true }, initialize: function (explorer, actions, data, options) { this.setOptions(options); this.explorer = explorer; this.app = explorer.app; this.lp = this.app.lp.workGather; this.actions = this.app.restActions; this.path = "/x_component_Execution/$WorkGather/"; this.cssPath = this.path + this.options.style + "/css.wcss"; this._loadCss(); this.data = data || {}; this.actions = actions; }, load: function () { //alert(JSON.stringify(this.data)) if (this.options.isNew) { this.create(); } else if (this.options.isEdited) { this.edit(); } else { this.open(); } }, createTopNode: function () { if (!this.formTopNode) { this.formTopNode = new Element("div.formTopNode", { "styles": this.css.formTopNode }).inject(this.formNode); this.formTopIconNode = new Element("div", { "styles": this.css.formTopIconNode }).inject(this.formTopNode) this.formTopTextNode = new Element("div", { "styles": this.css.formTopTextNode, "text": this.data.title }).inject(this.formTopNode) if (this.options.closeAction) { this.formTopCloseActionNode = new Element("div.formTopCloseActionNode", {"styles": this.css.formTopCloseActionNode}).inject(this.formTopNode); this.formTopCloseActionNode.addEvent("click", function () { this.close() }.bind(this)) } this.formTopContentNode = new Element("div", { "styles": this.css.formTopContentNode }).inject(this.formTopNode) this._createTopContent(); } }, _createTopContent: function () { }, _createTableContent: function (data) { this.titleDiv = new Element("div.titleDiv",{ "styles":this.css.titleDiv, "text":this.data.title }).inject(this.formTableArea) this.inforDiv = new Element("div.inforDiv",{"styles":this.css.inforDiv}).inject(this.formTableArea); //this.gatherDiv = new Element("div.gatherDiv",{"styles":this.css.gatherDiv}).inject(this.formTableArea); this.gatherJson = null; this.gatherJsonLen = 0; this.loadGather(); }, loadGather: function(){ if(this.gatherDiv) this.gatherDiv.destroy(); this.gatherDiv = new Element("div.gatherDiv",{"styles":this.css.gatherDiv}).inject(this.formTableArea); this.tabContentDiv = new Element("div.tabContentDiv",{ "styles":this.css.tabContentDiv }).inject(this.gatherDiv); this.actions.getDepartmentGather(this.data.gatherId,function(json){ if(json.data) { this.gatherJson = json.data; this.gatherJsonLen = json.data.length; } }.bind(this),null,false) if(this.gatherJsonLen>0){ this.loadTabContent(); } }, loadTabContent : function(){ for(i=0;i 0) { this.loadItemQueue--; this.loadElementList(); } }.bind(this), count); } else { this.loadItemQueue++; } } }, _removeDocument: function(documentData, all){ }, _create: function(data){ }, _openDocument: function( documentData ){ //this.workForm = new MWF.xApplication.Execution.WorkForm(this, this.actions, documentData, { // "isNew": false, // "isEdited": false //}) //this.workForm.load(); }, _queryCreateViewNode: function(){ }, _postCreateViewNode: function( viewNode ){ }, _queryCreateViewHead:function(){ }, _postCreateViewHead: function( headNode ){ } }) MWF.xApplication.Execution.WorkGather.WorkReportDocument = new Class({ Extends: MWF.xApplication.Template.Explorer.ComplexDocument, _queryCreateDocumentNode:function( itemData ){ }, _postCreateDocumentNode: function( itemNode, itemData ){ //alert(JSON.stringify(itemData)) //alert(itemNode.get("html")) if(itemData.tabName ==this.view.lp.gatherName.drafter){ cols = 4 }else if(itemData.tabName ==this.view.lp.gatherName.manager){ cols = 5 }else if(itemData.tabName ==this.view.lp.gatherName.leader){ cols = 6 } if( itemData.reports ){ itemData.reports.each(function(d){ this.view.explorer.reportDataArr.push(d); var trNode = new Element("tr.trNodeTitle",{"styles":this.view.css.trNodeTitle}).inject(this.view.viewNode); var tdNode = new Element("td.tdNodeTitle",{ "styles":this.view.css.tdNodeTitle, //"text": d.title + "(" +d.createTime+ ")", "html" : d.title + "    (" +d.createTime+ ")", "colspan":cols }).inject(trNode). addEvents({ "click":function(){ this.view.explorer.openWorkReport(d.id, d.workId); }.bind(this) }) trNode = new Element("tr.trNode",{"styles":this.view.css.trNode}).inject(this.view.viewNode) tdNode = new Element("td.tdNodeContent",{ "styles":this.view.css.tdNodeContent }).inject(trNode); //事项分解 divNode = new Element("div.divNode",{ "styles":this.view.css.divNode, "text": d.workInfo.shortProgressAction?d.workInfo.shortProgressAction:"", "title": d.workInfo.shortProgressAction?d.workInfo.shortProgressAction:"" }).inject(tdNode); //具体行动 if(itemData.tabName ==this.view.lp.gatherName.drafter){//草稿 tdNode = new Element("td.tdNodeContent",{ "styles":this.view.css.tdNodeContent }).inject(trNode); var teextareaNode = new Element("textarea.tetareaNode",{ "styles":this.view.css.textareaNode, "id":"progress"+ d.id, "value": d.progressDescription }).inject(tdNode); //截止当前 tdNode = new Element("td.tdNodeContent",{ "styles":this.view.css.tdNodeContent }).inject(trNode); var teextareaNode = new Element("textarea.tetareaNode",{ "styles":this.view.css.textareaNode, "id":"plan"+ d.id, "value": d.workPlan }).inject(tdNode); //下一步 }else if(itemData.tabName ==this.view.lp.gatherName.manager){//管理员 tdNode = new Element("td.tdNodeContent",{ "styles":this.view.css.tdNodeContent }).inject(trNode); divNode = new Element("div.divNode",{ "styles":this.view.css.divNode, "text": d.progressDescription, "title": d.progressDescription }).inject(tdNode); //截止当前 tdNode = new Element("td.tdNodeContent",{ "styles":this.view.css.tdNodeContent }).inject(trNode); divNode = new Element("div.divNode",{ "styles":this.view.css.divNode, "text": d.workPlan, "title": d.workPlan }).inject(tdNode); //下一步要点 tdNode = new Element("td.tdNodeContent",{ "styles":this.view.css.tdNodeContent }).inject(trNode); var teextareaNode = new Element("textarea.tetareaNode",{ "styles":this.view.css.textareaNode, "id":"admin"+ d.id, value: d.adminSuperviseInfo }).inject(tdNode); //管理员 }else if(itemData.tabName ==this.view.lp.gatherName.leader){ //领导 tdNode = new Element("td.tdNodeContent",{ "styles":this.view.css.tdNodeContent }).inject(trNode); divNode = new Element("div.divNode",{ "styles":this.view.css.divNode, "text": d.progressDescription, "title": d.progressDescription }).inject(tdNode); //截止当前 tdNode = new Element("td.tdNodeContent",{ "styles":this.view.css.tdNodeContent }).inject(trNode); divNode = new Element("div.divNode",{ "styles":this.view.css.divNode, "text": d.workPlan, "title": d.workPlan }).inject(tdNode); //下一步要点 tdNode = new Element("td.tdNodeContent",{ "styles":this.view.css.tdNodeContent }).inject(trNode); divNode = new Element("div.divNode", { "styles": this.view.css.divNode, "text": d.adminSuperviseInfo, "title": d.adminSuperviseInfo }).inject(tdNode); //管理员 tdNode = new Element("td.tdNodeContent",{ "styles":this.view.css.tdNodeContent }).inject(trNode); var teextareaNode = new Element("textarea.tetareaNode",{ "styles":this.view.css.textareaNode, "id":"opinion"+ d.id }).inject(tdNode); //管理员 } var tdNodeAction = new Element("td.tdNodeAction",{ "styles":this.view.css.tdNodeAction, }).inject(trNode); var actionTxt = new Element("a.actionTxt",{ "styles":this.view.css.actionTxt, "text":this.view.lp.viewSubmit }).inject(tdNodeAction) .addEvents({ "click":function(){ this.view.explorer.submit(d) }.bind(this) }) // 操作 ////管理员 //if(d.isWorkAdmin && d.processStatus == this.view.lp.activityName.manager){ // //}else{ // //} ////领导 ////this.workReportData.processStatus == this.lp.activityName.leader && this.workReportData.isReadLeader && this.processIdentity.indexOf(this.app.identity)>-1 //if(d.processStatus == this.view.lp.activityName.leader && d.isReadLeader && d.currentProcessorIdentity.indexOf(this.app.identity)>-1){ // tdNode = new Element("td.tdNodeContent",{ // "styles":this.view.css.tdNodeContent // }).inject(trNode); // var teextareaNode = new Element("textarea.tetareaNode",{ // "styles":this.view.css.textareaNode, // "id":"opinion"+ d.id // }).inject(tdNode); //}else{ // tdNode = new Element("td.tdNodeContent",{ // "styles":this.view.css.tdNodeContent, // "text": "" // }).inject(trNode); //} // //var tdNodeAction = new Element("td.tdNodeAction",{ // "styles":this.view.css.tdNodeAction, //}).inject(trNode); //var actionTxt = new Element("a.actionTxt",{ // "styles":this.view.css.actionTxt, // "text":this.view.lp.viewSubmit //}).inject(tdNodeAction) // .addEvents({ // "click":function(){ // this.view.explorer.submit(d) // }.bind(this) // }) }.bind(this)) //this.view.viewNode.getElements("textarea").setStyle("height","100%") } } })