|
@@ -42,23 +42,79 @@ var windowid;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //初始化流程弹框
|
|
|
- function initProcessDialog(){
|
|
|
|
|
|
+ function createProcessByModalId(templateId, modalName) {
|
|
|
+ z.ui.loading(true, true);
|
|
|
z.ui.ajax({
|
|
|
- url: window.data.workflowUrl + "/HandlerCaseCenter/getCalBackActivity",
|
|
|
+ url: "/TProcessEngine/add",
|
|
|
data: {
|
|
|
- "activityInstanceId": data.activityInsId,
|
|
|
- "flowInsId": data.flowInsId
|
|
|
+ "templateId": templateId
|
|
|
+ },
|
|
|
+ complete: function () {
|
|
|
+ z.ui.loading(false);
|
|
|
},
|
|
|
success: function (res) {
|
|
|
+ //给办件中心发消息
|
|
|
+ z.webcontainer.sendMessageCrossWindow(window.top, "handlerCaseCenter", {
|
|
|
+ "type": "reload",
|
|
|
+ "status": "1" // 代办tab
|
|
|
+ });
|
|
|
+ //给首页办件中心发消息
|
|
|
+ z.webcontainer.sendMessageCrossWindow(window.top, "indexModuleList", {
|
|
|
+ "type": "reload",
|
|
|
+ "status": "1" // 代办tab
|
|
|
+ });
|
|
|
+ openWebContainerTab("新建办件", modalName, res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function openWebContainerTab(title, tip, url) {
|
|
|
+ z.webcontainer.openTab({
|
|
|
+ id: 'workflowMain_' + tip,
|
|
|
+ title: title,
|
|
|
+ tip: tip,
|
|
|
+ url: url,
|
|
|
+ iconclass: 'fa fa-file'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //初始化流程弹框
|
|
|
+ function initProcessDialog(){
|
|
|
|
|
|
+ z.ui.ajax({
|
|
|
+ url: window.data.workflowUrl + "/TFlowTemplateApi/selectFlowTemplateTree",
|
|
|
+ success: function (res) {
|
|
|
+ if(res.data && res.data.length > 0){
|
|
|
+ processItemHtml(res.data[0]['children'])
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
function processItemHtml(arr){
|
|
|
-
|
|
|
+ if(arr && arr.length === 0) throw new Error("流程表单Tree不存在!");
|
|
|
+ var htmlStr = "<ul>";
|
|
|
+ for(var i = 0; i < arr.length; i++){
|
|
|
+ var item = arr[i]
|
|
|
+ htmlStr += `<li><p class="title">${item["name"]}</p>`;
|
|
|
+ if(item['children'] && item['children'].length > 0){
|
|
|
+ htmlStr += `<div class="process_list">`;
|
|
|
+ for(var j = 0; j < item['children'].length; j++){
|
|
|
+ var cItem = item['children'][j]
|
|
|
+ htmlStr += `<div class="process_item" data-id="${cItem['id']}" data-name="${cItem['name']}">${cItem['name']}</div>`
|
|
|
+ }
|
|
|
+ htmlStr += '</div>';
|
|
|
+ }
|
|
|
+ htmlStr += '</li>'
|
|
|
+ }
|
|
|
+ htmlStr += "</ul>"
|
|
|
+ $("#process-dialog").html(htmlStr);
|
|
|
+ $(".process_item").click(function(){
|
|
|
+ var id = $(this).attr("data-id");
|
|
|
+ var name = $(this).attr("data-name");
|
|
|
+ createProcessByModalId(id, name)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
+ initProcessDialog()
|
|
|
//绑定事件
|
|
|
function bindEvents() {
|
|
|
$("[name=flowCatalogBtn]").on({
|