processedProcess.js 4.3 KB
Newer Older
doc_wei's avatar
doc_wei 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106

var processInstanceId = "";//流程id

var hisTaskId = "";//历史审批任务id

layui.config({
	base: basePath, 
	version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
	winui.renderColor();
	var $ = layui.$,
		table = layui.table,
		form = layui.form;
	
	// 我的历史任务
	table.render({
	    id: 'messageMyHistoryTaskTable',
	    elem: '#messageMyHistoryTaskTable',
	    method: 'post',
	    url: reqBasePath + 'activitimode014',
	    where:{},
	    even:true,
	    page: true,
		limits: getLimits(),
		limit: getLimit(),
	    cols: [[
	        { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'},
	        { field: 'processInstanceId', title: '流程ID', width: 100 },
	        { field: 'taskType', title: '类型', width: 100 },
	        { field: 'createName', title: '申请人', width: 100},
	        { field: 'startTime', title: '申请时间', align: 'center', width: 140, templet: function(d){
	        	if(!isNull(d.createTime)){
		        	var str = d.createTime.toString();
		        	str = str.substring(0, str.length - 3);
		        	return date('Y-m-d H:i', str);
	        	}else{
	        		return "";
	        	}
	        }},
	        { field: 'name', title: '我处理的节点', width: 130, templet: function(d){
	        	return '[' + d.name + ']';
	        }},
	        { field: 'agencyName', title: '受理人', width: 80},
	        { field: 'endTime', title: '受理时间', align: 'center', width: 140, templet: function(d){
	        	if(!isNull(d.endTime)){
		        	var str = d.endTime.toString();
		        	str = str.substring(0, str.length - 3);
		        	return date('Y-m-d H:i', str);
	        	}else{
	        		return "";
	        	}
	        }},
	        { field: 'weatherEnd', title: '审批进度', align: 'left', width: 80, templet: function(d){
	        	if(d.weatherEnd == 0){
	        		return "<span class='state-down'>进行中</span>";
	        	}else{
	        		return "<span class='state-up'>已完成</span>";
	        	}
	        }},
	        { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 240, toolbar: '#myHistoryTaskTableBar'}
	    ]],
	    done: function(){
	    	matchingLanguage();
	    }
	});
	
	table.on('tool(messageMyHistoryTaskTable)', function (obj) {
        var data = obj.data;
        var layEvent = obj.event;
        if (layEvent === 'details') { //详情
			activitiUtil.activitiDetails(data);
        } else if (layEvent === 'withdraw') { //撤回
        	withdraw(data);
        } else if (layEvent === 'refreshPic') { //刷新流程图
        	refreshPic(data);
        }
    });

	//撤回
	function withdraw(data){
		//流程id
		processInstanceId = data.processInstanceId;
		//历史审批任务id
		hisTaskId = data.hisTaskId;
		_openNewWindows({
			url: "../../tpl/activiticommon/activitiwithdraw.html", 
			title: "撤回",
			pageId: "activitiwithdraw",
			area: ['70vw', '40vh'],
			callBack: function(refreshCode){
				if (refreshCode == '0') {
                	winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1,time: 2000});
                	reloadMyHistoryTaskTable();
                } else if (refreshCode == '-9999') {
                	winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000});
                }
			}
		});
	}
	
	//刷新流程图
	function refreshPic(data){
		layer.confirm('确认重新生成流程图吗?', { icon: 3, title: '刷新流程图操作' }, function (i) {
			layer.close(i);
doc_wei's avatar
doc_wei 已提交
107
            AjaxPostUtil.request({url:reqBasePath + "activitimode027", params: {processInstanceId: data.processInstanceId}, type: 'json', callback: function(json){
doc_wei's avatar
doc_wei 已提交
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
 	   			if(json.returnCode == 0){
                	winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1,time: 2000});
 	   			}else{
 	   				winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
 	   			}
 	   		}});
		});
	}
	
    //刷新我的历史任务
	$("body").on("click", "#reloadMyHistoryTaskTable", function(){
		reloadMyHistoryTaskTable();
	});
	
    function reloadMyHistoryTaskTable(){
    	table.reload("messageMyHistoryTaskTable", {where:{}});
    }
    
    exports('processedProcess', {});
});