username@email.com
2021-06-03 904fb460b9359fe92e00ce25804d96c8a52bb513
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
$(function () {
    $(window).bind('resize', function () {
        $('#flowMain').width($(window).width());
        $('#flowMain').height($(window).height() - (isShow ? 0 : (window.isSign ? 182 : 130)));
    });
    $(window).resize();
});
 
function execute(script) {
    if (!script || $.trim(script).length === 0) {
        return false;
    }
    eval(script);
    return false;
}
 
function showComment() {
    var url = '/WorkFlowRun/ShowComment?' + query;
    layer.open({
        type: 2,
        title: "查看流程处理意见",
        shadeClose: true,
        shade: 0.4,
        area: ['800px', '420px'],
        content: url
    });
}
 
function flowSave() {
    if (!validateForm()) {
        return false;
    }
    formSubmit("save");
    return false;
}
 
function flowCompleted() {
    formSubmit("completed");
}
 
function flowRedirect() {
    var url = '/WorkFlowRun/FlowRedirect?' + query;
    layer.open({
        type: 2,
        title: "选择接收人员",
        shadeClose: true,
        shade: 0.4,
        area: ['480px', '200px'],
        content: url
    });
}
 
function formSubmit(opation) {
    if (!opation) {
        layer.alert("无效的行为参数!");
        return false;
    }
    var form = new FormData(document.forms[0]);
    window.setTimeout('', 100);
    var url = "/WorkFlowRun/Execute?" + query + "&opation=" + opation;
    window.$.ajax({
        url: url,
        type: "post",
        data: form,
        dataType: "json",
        processData: false,
        contentType: false,
        success: function (response) {
            var index = $(".layui-layer-loading").attr("times");
            layer.close(index);
            if (response.status === 1) {
                if (response.data != undefined) {
                    $("#sysid").val(response.data);
                }
                layer.confirm('提交成功', {
                    btn: ['确认'] //按钮
                }, function () {
                    var thUrl = window.location.pathname + window.location.search;
                    tab.refresh('/WorkFlowTask/Index');
                    tab.close(thUrl);
                });
            }
            if (response.status === 0) {
                var errorMsg = response.error;
                layer.confirm(errorMsg, {
                    btn: ['确认'] //按钮
                }, function () {
                    var thUrl = window.location.pathname + window.location.search;
                    tab.refresh('/WorkFlowTask/Index');
                    tab.close(thUrl);
                });
            }
        }
    });
 
    return false;
}
 
 
function flowFail() {
    var form = new FormData(document.forms[0]);
    window.setTimeout('', 100);
    var url = "/WorkFlowRun/Fail?" + query;
    window.$.ajax({
        url: url,
        type: "post",
        data: form,
        dataType: "json",
        processData: false,
        contentType: false,
        success: function (response) {
            var index = $(".layui-layer-loading").attr("times");
            layer.close(index);
 
            if (response.status === 1) {
                if (response.data != undefined) {
                    $("#sysid").val(response.data);
                }
                layer.confirm('操作成功', {
                    btn: ['确认'] //按钮
                }, function () {
                    var thUrl = window.location.pathname + window.location.search;
                    tab.refresh('/WorkFlowTask/Index');
                    tab.close(thUrl);
                });
            }
            if (response.status === 0) {
                var errorMsg = response.error;
                layer.confirm(errorMsg, {
                    btn: ['确认'] //按钮
                }, function () {
                    var thUrl = window.location.pathname + window.location.search;
                    tab.refresh('/WorkFlowTask/Index');
                    tab.close(thUrl);
                });
            }
        }
    });
 
    return false;
}
 
 
function flowSend() {
    if (!validateForm()) {
        return false;
    }
    formSubmit("submit");
    return false;
}
 
function validateForm() {
    //验证提示类型 0-弹出 1-图标加提示信息 2-图标
    var validatealertType = $("#Form_Validatelayer.alertType").size() > 0 && !isNaN($("#Form_Validatelayer.alertType").val()) ? parseInt($("#Form_Validatelayer.alertType").val()) : 1;
    return new RoadUI.Validate().validateForm(document.forms[0], validatealertType);
}
 
function showProcessing(type) {
    var title = "正在处理";
    switch (type) {
        case "save": title = "正在保存..."; break;
        case "savedata": title = "正在保存数据..."; break;
        case "submit": title = "正在发送..."; break;
        case "back": title = "正在退回..."; break;
        case "redirect": title = "正在转交..."; break;
        case "fail": title = "正在处理..."; break;
    }
    var url = '/WorkFlowRun/Process?op=' + type;
    layer.open({
        type: 2,
        title: title,
        shadeClose: true,
        shade: 0.4,
        area: ['260px', '120px'],
        content: url
    });
}
 
function showProcess() {
    var url = '/WorkFlowRun/Detail?' + query;
    layer.open({
        type: 2,
        title: "查看处理过程",
        shadeClose: true,
        shade: 0.4,
        area: ['90%', '90%'],
        content: url
    });
}
 
function showFlowDesign() {
    var url = '/WorkFlowRun/ShowDesign?' + query;
    layer.open({
        type: 2,
        title: "查看流程图",
        shadeClose: true,
        shade: 0.4,
        area: ['98%', '98%'],
        content: url
    });
}
 
function showSubFlow() {
    var url = '/WorkFlowRun/DetailSubFlow?' + query;
    layer.open({
        type: 2,
        title: "查看子流程处理过程",
        shadeClose: true,
        shade: 0.4,
        area: ['90%', '90%'],
        content: url
    });
}