var workbentch={ days:7, height:0.5, width: 0.5, setWidth: function(width){ this.width = width; }, setHeight: function(height){ this.height = height; }, setDays:function(days){ this.days=days; }, WorkDaily:function(){ var me = this.workbench || this; return Ext.create('Ext.panel.Panel', { title: '工作日报'+ '
更多工作日报
', bodyStyle: 'background: #f1f1f1', id: 'WorkDaily', iconCls: 'main-news', contentEl:'mydairy', columnWidth: 1/3, height: me.height*0.4 }); }, Agenda:function(){ var me = this.workbench || this; return Ext.create('Ext.panel.Panel', { title: '工作计划'+ '
更多工作计划
', bodyStyle: 'background: #f1f1f1', id: 'plan', contentEl:'myworkplan', iconCls: 'main-news', columnWidth: 1/3, height: me.height*0.4 }); }, WorkAttendance:function(){ var me = this.workbench || this; return Ext.create('Ext.panel.Panel', { title: '考勤', bodyStyle: 'background: #f1f1f1', id: 'WorkAttendance', iconCls: 'main-news', columnWidth: 1/3, height: me.height*0.4 }); }, JProcess2DealByMe:function(){ var me = this.workbench || this; return Ext.create('Ext.panel.Panel', { title: '待审批的流程', bodyStyle: 'background: #f1f1f1', id: 'JProcess2DealByMe', iconCls: 'main-news', columnWidth: 1/3, height: me.height*0.4 }); }, JProcessDeal:function(){ var me = this.workbench || this; return Ext.create('Ext.panel.Panel', { title: '发起的流程', bodyStyle: 'background: #f1f1f1', id: 'JProcessDeal', iconCls: 'main-news', columnWidth: 1/3, height: me.height*0.4 }); }, ProjectPlan:function(){ var me = this.workbench || this; return Ext.create('Ext.panel.Panel', { title: '未完成的项目', bodyStyle: 'background: #f1f1f1', id: 'ProjectPlan', iconCls: 'main-news', columnWidth: 1/3, height: me.height*0.4 }); }, WorkRecord: function(){ var me = this.workbench||this; return Ext.create('Ext.panel.Panel', { title:'任务报告(最近'+me.workbentch.days+'天)'+ '
更多任务日报
', bodyStyle: 'background: #f1f1f1', //style:'margin: 1px;', id: 'WR', contentEl: 'mytask', iconCls: 'main-todo', autoScroll: true, columnWidth: 1/3, height: me.height*0.4 }); }, newSynergy:function(){ var me = this.workbench || this; return Ext.create('Ext.panel.Panel', { title: ' 内部协同', bodyStyle: 'background: #f1f1f1', id: 'newSynergy', iconCls: 'main-news', contentEl:'mySynergy', columnWidth: 1/3, height: me.height*0.4 }); }, ProjectFeePlease:function(days){ var me = this.workbench || this; return Ext.create('Ext.panel.Panel', { title: '发出的费用申请单(最近'+me.workbentch.days+'天)', bodyStyle: 'background: #f1f1f1', id: 'bench_email9', iconCls: 'main-news', columnWidth: 1/3, height: me.height*0.4 }); }, ProjectFeeClaim:function(days){ var me = this.workbench || this; return Ext.create('Ext.panel.Panel', { title: '发出的费用报销单(最近'+me.workbentch.days+'天)', bodyStyle: 'background: #f1f1f1', id: 'bench_email99', iconCls: 'main-news', columnWidth: 1/3, height: me.height*0.4 }); }, Meeting:function(){ var me = this.workbench || this; return Ext.create('Ext.panel.Panel', { title: '参加的会议', bodyStyle: 'background: #f1f1f1', id: 'bench_email91', iconCls: 'main-news', columnWidth: 1/3, height: me.height*0.4 }); }, ToDoTask:function(){ var me = this.workbench || this; Ext.Ajax.request({ url : basePath + 'common/datalist.action', params: { caller: 'ResourceAssignment', condition: 'ra_emid=' + emid, page: 1, pageSize: parseInt(height*0.2/12) }, method : 'post', callback : function(options,success,response){ var res = new Ext.decode(response.responseText); if(res.exception || res.exceptionInfo){ showError(res.exceptionInfo); return; } var task = res.data != null ? Ext.decode(res.data.replace(/,}/g, '}').replace(/,]/g, ']')) : new Array(); if(task == [] || task.length == 0){ Ext.get("myToDo").insertHtml('afterBegin', '(暂无任务)'); } else { Ext.create('Ext.grid.Panel', { autoScroll: true, store: Ext.create('Ext.data.Store', { fields:['ra_id', 'ra_taskname', 'ra_startdate', 'ra_enddate', 'surplus', 'ra_taskpercentdone'], data: task }), height: me.height*0.5, bodyStyle: 'background: #f1f1f1;border: none;', columns: [ { header: 'ID', dataIndex: 'ra_id', hidden: true}, { header: '任务名称', dataIndex: 'ra_taskname', flex: 2 , renderer: taskItem}, { header: '开始时间', dataIndex: 'ra_startdate', flex: 1 }, { header: '结束时间', dataIndex: 'ra_enddate', flex: 1 }, { header: '剩余时间', dataIndex: 'surplus', flex: 1.5, renderer: getSurPlus }, { header: '完成率(%)', dataIndex: 'ra_taskpercentdone', flex: 1, renderer: percentdone} ], renderTo: Ext.get("myToDo") }); } } }); }, _WorkRecord: function(){ var me = this.workbench || this; Ext.Ajax.request({ url : basePath + 'common/datalist.action', params: { caller: 'WorkRecord', condition: 'wr_recorderemid=' + emid, page: 1, pageSize: parseInt(100*0.3/12) }, method : 'post', callback : function(options,success,response){ var res = new Ext.decode(response.responseText); if(res.exception || res.exceptionInfo){ showError(res.exceptionInfo); return; } var task = res.data != null ? Ext.decode(res.data.replace(/,}/g, '}').replace(/,]/g, ']')) : new Array(); if(task == [] || task.length == 0){ Ext.get("mytask").insertHtml('afterBegin', '(暂无任务报告)'); } else { Ext.create('Ext.grid.Panel', { autoScroll: true, store: Ext.create('Ext.data.Store', { fields:['wr_id', 'wr_taskname', 'wr_recorddate', 'wr_percentdone', 'wr_taskpercentdone'], data: task }), height: me.height*1/3, bodyStyle: 'background: #f1f1f1;border: none;', columns: [ { header: 'ID', dataIndex: ' wr_id', hidden: true}, { header: '任务名称', dataIndex: 'wr_taskname', flex: 2 ,renderer:workrecord}, { header: '提交日期', dataIndex: 'wr_recorddate', flex: 1 }, { header: '提交完成率', dataIndex: 'wr_percentdone', flex: 1 }, /** { header: '任务已完成率', dataIndex: 'wr_taskpercentdone', flex: 1.5 },**/ ], renderTo: Ext.get("mytask") }); } } }); }, _WorkDaily:function(){ Ext.Ajax.request({ url : basePath + 'common/datalist.action', params: { caller: 'Diary', condition: 'di_emid=' + emid, page: 1, pageSize: parseInt(height*0.27/23) }, method : 'post', callback : function(options,success,response){ var res = new Ext.decode(response.responseText); if(res.exception || res.exceptionInfo){ showError(res.exceptionInfo); return; } var notes = res.data != null ? Ext.decode(res.data.replace(/,}/g, '}').replace(/,]/g, ']')) : []; var html = '