| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <style>
- .ui_buttons{
- text-align: center !important;
- }
- </style>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <div class="easyui-layout" fit="true">
- <div region="center" style="padding:0px;border:0px">
- <t:datagrid name="projecttaskList" fitColumns="true" sortName="taskstatus,createDate" pageSize="30" sortOrder="asc,desc" checkbox="false" title="我的任务"
- actionUrl="projecttaskController.do?myTaskListDatagrid" idField="id" queryMode="group" >
- <t:dgCol title="主键" field="id" hidden="true" width="120"></t:dgCol>
- <t:dgCol title="标题" field="name" query="true" width="320"></t:dgCol>
- <t:dgCol title="流程名称" hidden="true" field="sourceid" dictionary="p_activiti_task,id,process_name" width="120"></t:dgCol>
- <t:dgCol title="任务发起人" field="createName" query="true" width="120"></t:dgCol>
- <t:dgCol title="开始时间" field="planstarttime" formatter="yyyy-MM-dd" align="center" width="80"></t:dgCol>
- <t:dgCol title="截止时间" field="planendtime" formatter="yyyy-MM-dd" align="center" width="80"></t:dgCol>
- <t:dgCol title="执行状态" hidden="true" field="taskstatus" width="120" dictionary="taskstatus"></t:dgCol>
- <t:dgCol title="执行状态" field="stateWrittenWords" width="120" ></t:dgCol>
- <t:dgCol title="类型" field="tasktype" hidden="true" width="120"></t:dgCol>
- <t:dgCol title="" field="executeType" hidden="true" width="120"></t:dgCol>
- <t:dgCol title="" field="form" hidden="true" width="120"></t:dgCol>
- <t:dgCol title="工作类型" field="sourcetype" hidden="true" query="true" width="120" dictionary="tasksourcetype"></t:dgCol>
- <t:dgCol title="" field="sourceid" hidden="true" width="120"></t:dgCol>
- <t:dgCol title="" field="tasktype" hidden="true" width="120"></t:dgCol>
- <t:dgCol title="common.operation" field="opt"></t:dgCol>
- <t:dgFunOpt exp="taskstatus#eq#0,1" urlclass="ace_button" urlfont="fa-cog" funname="toDoTask()" title=" 办理" ></t:dgFunOpt>
- <t:dgFunOpt exp="sourcetype#eq#taskplan" urlclass="ace_button" urlfont="fa-file-text-o"
- funname="detail()" title=" 任务内容" ></t:dgFunOpt>
- <t:dgOpenOpt exp="taskstatus#eq#20" width="800" height="600" url="projecttaskController.do?goExeTaskView&load=detail&id={id}"
- urlclass="ace_button" urlfont="fa-check" title="查看结果"></t:dgOpenOpt>
- <t:dgFunOpt exp="tasktype#eq#pmdept" urlclass="ace_button" urlfont="fa-file-text-o"
- funname="downloadAttr(id)" title=" 下载附件" ></t:dgFunOpt>
- <t:dgFunOpt exp="sourcetype#eq#activititask" urlclass="ace_button" urlfont="fa-file-text-o"
- funname="viewActivitiTask(sourceid,sourcetype,tasktype)" title=" 签报内容" ></t:dgFunOpt>
- <t:dgFunOpt exp="sourcetype#eq#activititask" urlclass="ace_button" urlfont="fa-commenting-o"
- funname="startus(sourceid,sourcetype,tasktype)" title=" 查看流程" ></t:dgFunOpt>
- <%-- <t:dgToolBar title="任务清单" icon="icon-search" url="#" funname="none" ></t:dgToolBar> --%>
- </t:datagrid>
- </div>
- </div>
- <span style="display:-moz-inline-box;display:inline-block;" id="entryNameSearch">
- <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap; " title="执行状态">执行状态:</span>
- <select id="taskstatus" name="taskstatus">
- <option value="">---请选择---</option>
- <option value="1">未完成</option>
- <option value="20">已完成</option>
- <option value="30">逾期未完成</option>
- <option value="40">逾期已完成</option>
- </select>
- </span>
- <script type="text/javascript">
- var _gridId='projecttaskList';
- $(document).ready(function(){
- $('#projecttaskListForm').append($('#entryNameSearch'));
- //给时间控件加上样式
- $(":input[name='createName']").css("width","150px");
- $(":input[name='createName']").css("margin","5px");
- $("select[name='taskstatus']").css("width","150px");
- $("select[name='taskstatus']").css("margin","5px");
- $("select[name='sourcetype']").css("width","150px");
- $("select[name='sourcetype']").css("margin","5px");
- });
- function closeTask(id){
- }
- function detail( index){
- var row = $('#projecttaskList').datagrid('getRows')[index];
- var id = row.id;
- var url ='projecttaskController.do?goUpdate';
- var title = '任务内容';
- // var rowsData = $('#'+id).datagrid('getSelections');
- // if (rowData.id == '') {
- // tip('请选择查看项目');
- // return;
- // }
- /* if (!rowsData || rowsData.length == 0) {
- tip('请选择查看项目');
- return;
- }
- if (rowsData.length > 1) {
- tip('请选择一条记录再查看');
- return;
- } */
- url += '&load=detail&id='+id;
- createdetailwindow(title,url,'800px','700px');
- }
- //导入
- function ImportXls() {
- openuploadwin('Excel导入', 'projecttaskController.do?upload', "projecttaskList");
- }
- //导出
- function ExportXls() {
- JeecgExcelExport("projecttaskController.do?exportXls","projecttaskList");
- }
- //模板下载
- function ExportXlsByT() {
- JeecgExcelExport("projecttaskController.do?exportXlsByT","projecttaskList");
- }
- function toDoTask(index){
- // id,name,executeType,form
- var row = $('#projecttaskList').datagrid('getRows')[index];
- var id = row.id;
- var name = row.name;
- var executeType = row.executeType;
- var form = row.form;
- // var width = window.top.document.body.offsetWidth - 300;
- /* var windowHeight = window.top.document.body.offsetHeight-100; */
- var url = "projecttaskController.do?doExeTask&id="+id;
- var width = "820";
- var height = "550";
- $.ajax({
- async : false,
- cache : false,
- type : 'POST',
- url : url,// 请求的action路径
- error : function() {// 请求失败处理函数
- },
- success : function(data) {
- var d = data; // ------ $.parseJSON(data);
- if (d.success) {
- //form == ’‘,则说明此任务不是执行流中的任务
- if(form == '' || executeType=='offline'){
- var tasktype = d.obj.tasktype;
- if(tasktype == 'maintainbill')
- height = 660;
- var viewurl = "projecttaskController.do?goExeTaskView&id="+id;
- mycreatewindow('完成工作: ' + name,viewurl, width,height);
- }else{
- $.dialog({
- content: 'url:'+form,
- title : '完成工作: ' + name,
- lock : true,
- zIndex: getzIndex(),
- opacity : 0.3,
- width: width,
- height: height,
- ok:function(){
- var done =true;
- $.ajax(
- {
- url:'projecttaskController.do?checkResult'
- ,async:false
- ,type:'POST'
- ,dataType:'json'
- ,data:{
- id:id
- }
- ,success:function(d){
- done = d.done;
- if(done){
- $.post('projecttaskController.do?finishTask',{id:id},function(){
- reloadTable('projecttaskList');
- })
- }else {
- top.layer.alert(d.reason);
- }
- }
- ,error:function(d){
- }
- }
- )
- return done;
- }
- // ,okVal:'完成任务'
- ,cancel: function(){
- }
- });
- }
- } else {
- layer.alert(d.msg)
- }
- }
- });
- }
- //查看签报
- function viewActivitiTask(sourceid,sourcetype,tasktype) {
- /* var title='查看签报';
- var url = '${webBasePath}/tBusActivitiGreenController.do?goView&id='+sourceid;
- createdetailwindow(title, url,800,400);
- */
- $.ajax(
- {
- url : 'projecttaskController.do?findProcInstId'// 请求的action路径
- ,async:false
- ,type:'POST'
- ,dataType:'json'
- ,data:{
- sourceid:sourceid,
- tasktype:tasktype
- }
- ,success:function(d){
- if(d.success){
- goProcessHisTab(d.obj);
- }else {
- top.layer.alert(d.msg);
- }
- }
- ,error:function(d){
- }
- }
- );
- }
- //查看流程
- function startus(sourceid,sourcetype,tasktype ){
- $.ajax(
- {
- url : 'projecttaskController.do?findProcInstId'// 请求的action路径
- ,async:false
- ,type:'POST'
- ,dataType:'json'
- ,data:{
- sourceid:sourceid,
- tasktype:tasktype
- }
- ,success:function(d){
- if(d.success){
- processtracking(sourceid,d.obj);
- }else {
- top.layer.alert(d.msg);
- }
- }
- ,error:function(d){
- }
- }
- );
- }
- function none(){}
- function a (iframe){
- var memo = iframe.$('#memo').val();
- var completePer = iframe.$('#completePer').val();
- if(memo == ""){
- iframe.tip("请输入工作执行说明");
- return false;
- }
- if(completePer == ""){
- iframe.tip("请输入工作进度");
- return false;
- }else{
- var result = completePer.match(/^[0-9]*$/);
- if(result == null){
- iframe.tip("请输入正确的工作进度");
- return false;
- }
- if(parseInt(completePer) > 100){
- iframe.tip("请输入正确的工作进度范围0--100");
- return false;
- }
- }
- return true;
- }
- function mycreatewindow(title, addurl,width,height) {
- width = width?width:800;
- height = height?height:500;
- if(width=="100%" ){
- width = window.top.document.body.offsetWidth;
- }
- if( height=="100%"){
- height =window.top.document.body.offsetHeight-100;
- }
- //--author:JueYue---------date:20140427---------for:弹出bug修改,设置了zindex()函数
- if(typeof(windowapi) == 'undefined'){
- $.dialog({
- content: 'url:'+addurl,
- lock : true,
- zIndex: getzIndex(),
- width:width,
- height:height,
- title:title,
- opacity : 0.3,
- cache:false,
- okVal:'提交',
- ok: function(){
- iframe = this.iframe.contentWindow;
- var result = a(iframe);
- if(result){
- saveObj();
- tip('提交成功');
- reloadTable('projecttaskList');
- }else{
- return false;
- }
- },
- cancelVal: '关闭',
- cancel: function(){
- }, /*为true等价于function(){}*/
- button: [
- {
- name: '暂存',
- callback: function(){
- iframe = this.iframe.contentWindow;
- var result = a(iframe);
- if(result){
- $('#formobj', iframe.document).form('submit', {
- url : 'taskResultController.do?doUpdate&temp=1',
- onSubmit : function() {
- //iframe.editor.sync();
- },
- success : function(r) {
- //iframe.api.opener.refresh();
- iframe.closeCurrentDialog();
- tip('暂存成功');
- reloadTable('projecttaskList');
- return false;
- }
- });
- }
- return false;
- },
- class:"ui_state_highlight",
- focus: true
- }
- ]
- });
- }
- }
- function downloadAttr(id){
- var url = "projecttaskController.do?downloadAttrByTask&taskid="+id;
- layer.msg('数据导出中,请稍候···', {
- time : 6000,
- shade: 0.1});
- window.location.href = url;
- }
- </script>
|