diff --git a/o2web/source/o2_core/o2/widget/Dialog.js b/o2web/source/o2_core/o2/widget/Dialog.js index 6eb749802e0ab89373dba9eac34ebe34ee13be61..fcc56e594fe8057f8675b93175c740a03ed26145 100644 --- a/o2web/source/o2_core/o2/widget/Dialog.js +++ b/o2web/source/o2_core/o2/widget/Dialog.js @@ -36,6 +36,7 @@ o2.widget.Dialog = o2.DL = new Class({ "container": null }, initialize: function(options){ + debugger; this.setOptions(options); this.path = o2.session.path+"/widget/$Dialog/"; diff --git a/o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.json b/o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.json index 84c27d279bbfc0e6b8b6368183977646ea0f09a7..c197f36213564cd929d6035b4feb9c97d4fbfc0f 100644 --- a/o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.json +++ b/o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.json @@ -113,8 +113,8 @@ "listDraftPrev": {"uri": "/jaxrs/draft/list/{id}/prev/{count}"}, "listDraftPage": {"uri": "/jaxrs/draft/list/my/paging/{page}/size/{size}", "method": "POST"}, "listDraftApplication": {"uri": "/jaxrs/draft/list/count/application"}, - - + "startDraft": {"uri": "/jaxrs/draft/{id}/start"}, + "deleteDraftWork": {"uri": "/jaxrs/draft/{id}", "method": "DELETE"}, "getTask": {"uri": "/jaxrs/task/{id}"}, "saveTask": {"uri": "/jaxrs/task/{id}", "method": "POST"}, diff --git a/o2web/source/o2_core/o2/xDesktop/Dialog.js b/o2web/source/o2_core/o2/xDesktop/Dialog.js index e9003ad5ced80780a8a556447a66d283391225fd..df9cf7e8d8daf9399ce5ef38dbf13ee77bcd03eb 100644 --- a/o2web/source/o2_core/o2/xDesktop/Dialog.js +++ b/o2web/source/o2_core/o2/xDesktop/Dialog.js @@ -820,6 +820,7 @@ o2.xDesktop.Dialog = o2.DDL = new Class({ } }); o2.DL.open = function(options){ + debugger; if (!options) options = {}; if (!options.style) options.style = "user"; //if (!options.transition) options.transition = Fx.Transitions.Back.easeOut; @@ -827,14 +828,14 @@ o2.DL.open = function(options){ if (options.isClose!==false) options.isClose = true; var size; - if (!options.width && !options.contentWidth){ + if ((!options.width || options.width=="auto") && !options.contentWidth){ if (options.content){ options.content.show(); size = options.content.getComputedSize(); options.contentWidth = size.totalWidth.toFloat(); } } - if (!options.height && !options.contentHeight){ + if ((!options.height || options.height=="auto") && !options.contentHeight){ if (options.content){ if (!size){ options.content.show(); diff --git a/o2web/source/x_component_process_TaskCenter/DraftList.js b/o2web/source/x_component_process_TaskCenter/DraftList.js index 11a7ba6d56ef51c0b86bd49c2e723c621896d303..e8cc51a752c7ebd8484f1215ec61538f748156df 100644 --- a/o2web/source/x_component_process_TaskCenter/DraftList.js +++ b/o2web/source/x_component_process_TaskCenter/DraftList.js @@ -23,7 +23,7 @@ MWF.xApplication.process.TaskCenter.DraftList = new Class({ this.initData(); this.filterData = null; if (this.applicationFilterAreaNode) this.applicationFilterAreaNode.empty(); - //this.createAppFilterNodes(); + this.createAppFilterNodes(); this.listAreaNode.empty(); this.resetListAreaHeight(); this.app.getWorkCounts(); diff --git a/o2web/source/x_component_process_TaskCenter/Main.js b/o2web/source/x_component_process_TaskCenter/Main.js index 11d4f8780c9f7d7c63ed56426252f0d5d7ddd184..0f55285142d3d8120c707c50256d94e6eab10be3 100644 --- a/o2web/source/x_component_process_TaskCenter/Main.js +++ b/o2web/source/x_component_process_TaskCenter/Main.js @@ -1065,12 +1065,12 @@ MWF.xApplication.process.TaskCenter.Process = new Class({ var options = {"draft": work, "appId": "process.Work"+(new o2.widget.UUID).toString(), "desktopReload": false}; this.app.desktop.openApplication(null, "process.Work", options); - var msg = { - "subject": this.app.lp.processStarted, - "content": "
"+this.app.lp.processStartedMessage+"“["+processName+"]"+title+"”
" - }; - var tooltip = layout.desktop.message.addTooltip(msg); - var item = layout.desktop.message.addMessage(msg); + // var msg = { + // "subject": this.app.lp.processStarted, + // "content": "
"+this.app.lp.processStartedMessage+"“["+processName+"]"+title+"”
" + // }; + // var tooltip = layout.desktop.message.addTooltip(msg); + // var item = layout.desktop.message.addMessage(msg); }, startProcessInstance: function(data, title, processName){ var workInfors = []; diff --git a/o2web/source/x_component_process_Work/$Main/default/css.wcss b/o2web/source/x_component_process_Work/$Main/default/css.wcss index c2d883097b0a3dc6189b695e83cacf7d853305d0..efd287d57b9ed4b1a41a3c637ea34b840d71be86 100644 --- a/o2web/source/x_component_process_Work/$Main/default/css.wcss +++ b/o2web/source/x_component_process_Work/$Main/default/css.wcss @@ -32,6 +32,8 @@ }, "processNode_Area": { "height": "300px", + "width": "700px", + "padding": "10px", "background-color": "#FFF", "overflow": "hidden" }, diff --git a/o2web/source/x_component_process_Work/$Processor/process/css.wcss b/o2web/source/x_component_process_Work/$Processor/process/css.wcss index 15424eb1e0751fb2d8493aa6376290cfe076adb1..4c2ce519244c66939686f5b87ff30637c5222e7f 100644 --- a/o2web/source/x_component_process_Work/$Processor/process/css.wcss +++ b/o2web/source/x_component_process_Work/$Processor/process/css.wcss @@ -89,7 +89,7 @@ "float": "left", "margin-left": "20px", "padding-left" : "26px", - "border-radius": "5px", + "border-radius": "20px", "min-height": "24px", "line-height": "24px", "margin-top": "8px", diff --git a/o2web/source/x_component_process_Work/Main.js b/o2web/source/x_component_process_Work/Main.js index 4731ca5c2b763d44f95a5e51ec241a448c9036f9..d009d7c0bf409cf96eb6fa6dab4a42132d8212bc 100644 --- a/o2web/source/x_component_process_Work/Main.js +++ b/o2web/source/x_component_process_Work/Main.js @@ -240,7 +240,7 @@ MWF.xApplication.process.Work.Main = new Class({ "allowVisit": true, "allowProcessing": true, "allowSave": true, - "allowDelete": false + "allowDelete": true }; this.parseData(workData, control, json_form.data, [], [], []); @@ -349,9 +349,11 @@ MWF.xApplication.process.Work.Main = new Class({ //this.inheritedAttachmentList = data.inheritedAttachmentList; this.control = controlData; - this.form = (formData.data) ? JSON.decode(MWF.decodeJsonString(formData.data)): null; - delete formData.data; - this.formInfor = formData; + if (formData){ + this.form = (formData.data) ? JSON.decode(MWF.decodeJsonString(formData.data)): null; + delete formData.data; + this.formInfor = formData; + } }, // loadWork2: function(){ diff --git a/o2web/source/x_component_process_Work/Processor.js b/o2web/source/x_component_process_Work/Processor.js index 5794c8a00f1c198903f73bcc0c12d52b00712d96..578b10424dff2756fe3852e54d916924b71d6263 100644 --- a/o2web/source/x_component_process_Work/Processor.js +++ b/o2web/source/x_component_process_Work/Processor.js @@ -62,7 +62,7 @@ MWF.xApplication.process.Work.Processor = new Class({ if( layout.mobile ){ this.orgsArea = new Element("div", {"styles": this.css.orgsArea}).inject(this.node); this.orgsTile = new Element("div", {"styles": this.css.orgsTitle, "text": MWF.xApplication.process.Work.LP.selectPerson}).inject(this.orgsArea); - this.orgsArea.hide() + this.orgsArea.hide(); }else{ this.orgsArea = new Element("div", {"styles": this.css.orgsArea}).inject(this.node); this.orgsTile = new Element("div", {"styles": this.css.orgsTitle, "text": MWF.xApplication.process.Work.LP.selectPerson}).inject(this.orgsArea); @@ -248,9 +248,11 @@ MWF.xApplication.process.Work.Processor = new Class({ if (this.selectedRouteGroup){ if (this.selectedRouteGroup.get("text") != node.get("text")){ this.selectedRouteGroup.setStyles(this.css.routeGroupNode); + //this.selectedRouteGroup.removeClass("mainColor_bg"); this.selectedRouteGroup = node; this.selectedRouteGroup.setStyles(this.css.routeGroupNode_selected); + //this.selectedRouteGroup.addClass("mainColor_bg"); var routeList = this.selectedRouteGroup.retrieve("routeList"); this.setRouteList( routeList ); @@ -265,6 +267,7 @@ MWF.xApplication.process.Work.Processor = new Class({ }else{ this.selectedRouteGroup = node; node.setStyles(this.css.routeGroupNode_selected); + //this.selectedRouteGroup.addClass("mainColor_bg"); var routeList = this.selectedRouteGroup.retrieve("routeList"); this.setRouteList( routeList ); @@ -341,19 +344,23 @@ MWF.xApplication.process.Work.Processor = new Class({ if (this.selectedRoute){ if (this.selectedRoute.get("text") != node.get("text")){ node.setStyles(this.css.routeNode_over); + node.addClass("lightColor_bg"); //node.setStyle("background-color", "#f7e1d0"); } }else{ node.setStyles(this.css.routeNode_over); + node.addClass("lightColor_bg"); } }, outRoute: function(node){ if (this.selectedRoute){ if (this.selectedRoute.get("text") != node.get("text")){ node.setStyles(this.css.routeNode); + node.removeClass("lightColor_bg"); } }else{ node.setStyles(this.css.routeNode); + node.removeClass("lightColor_bg"); } }, selectRoute_noform: function(node){ @@ -378,17 +385,22 @@ MWF.xApplication.process.Work.Processor = new Class({ if (this.selectedRoute){ if (this.selectedRoute.get("text") != node.get("text")){ this.selectedRoute.setStyles(this.css.routeNode); + this.selectedRoute.removeClass("mainColor_bg"); //this.selectedRoute.getFirst().setStyles(this.css.routeIconNode); //this.selectedRoute.getLast().setStyles(this.css.routeTextNode); this.selectedRoute = node; node.setStyles(this.css.routeNode_selected); + node.addClass("mainColor_bg"); + node.removeClass("lightColor_bg"); //node.setStyle("background-color", "#da7429"); //node.getFirst().setStyle("background-image", "url("+"/x_component_process_Work/$Processor/default/checked.png)"); //node.getLast().setStyle("color", "#FFF"); }else{ this.selectedRoute.setStyles(this.css.routeNode); + this.selectedRoute.addClass("mainColor_bg"); + this.selectedRoute.removeClass("lightColor_bg"); //this.selectedRoute.getFirst().setStyles(this.css.routeIconNode); //this.selectedRoute.getLast().setStyles(this.css.routeTextNode); @@ -397,6 +409,8 @@ MWF.xApplication.process.Work.Processor = new Class({ }else{ this.selectedRoute = node; node.setStyles(this.css.routeNode_selected); + node.addClass("mainColor_bg"); + node.removeClass("lightColor_bg"); //node.setStyle("background-color", "#da7429"); //node.getFirst().setStyle("background-image", "url("+"/x_component_process_Work/$Processor/default/checked.png)"); //node.getLast().setStyle("color", "#FFF"); diff --git a/o2web/source/x_component_process_Xform/Actionbar.js b/o2web/source/x_component_process_Xform/Actionbar.js index b513cdae0caf25cb1b3dc65b5a84adadcb65dc09..9bbdfc48d655582bcbb5cc080abb30870a8dfa36 100644 --- a/o2web/source/x_component_process_Xform/Actionbar.js +++ b/o2web/source/x_component_process_Xform/Actionbar.js @@ -128,6 +128,18 @@ MWF.xApplication.process.Xform.Actionbar = MWF.APPActionbar = new Class({ // flag = false; // } // } + if (tool.id == "action_downloadAll" || tool.id == "action_print"){ + if (!this.form.businessData.activity || !this.form.businessData.activity.id){ + flag = false; + } + } + if (tool.id == "action_delete"){ + if (!this.form.businessData.work || !this.form.businessData.work.id){ + flag = false; + } + } + + if (tool.id == "action_rollback") tool.read = true; if (readonly) if (!tool.read) flag = false; if (flag){ diff --git a/o2web/source/x_component_process_Xform/Attachment.js b/o2web/source/x_component_process_Xform/Attachment.js index b7b2ad45ad50de8906e76f589cd4a57a81a9d4cb..b321418c1b6a9f2938ec966d75e3f301733247fc 100644 --- a/o2web/source/x_component_process_Xform/Attachment.js +++ b/o2web/source/x_component_process_Xform/Attachment.js @@ -1031,8 +1031,10 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({ _loadUserInterface: function () { this.node.empty(); - this.loadAttachmentController(); - this.fireEvent("load"); + if (this.form.businessData.activity && this.form.businessData.activity.id){ + this.loadAttachmentController(); + this.fireEvent("load"); + } }, loadAttachmentController: function () { //MWF.require("MWF.widget.AttachmentController", function() { @@ -1103,7 +1105,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({ }, getData: function () { - return this.attachmentController.getAttachmentNames(); + return (this.attachmentController) ? this.attachmentController.getAttachmentNames() : null; }, createUploadFileNode: function () { var accept = "*"; diff --git a/o2web/source/x_component_process_Xform/Form.js b/o2web/source/x_component_process_Xform/Form.js index 230973b1c70b1e4edf0bfd15b14f998fbcade2d1..981b3318f62c967e5546df87a52f6f537a1142c9 100644 --- a/o2web/source/x_component_process_Xform/Form.js +++ b/o2web/source/x_component_process_Xform/Form.js @@ -1608,82 +1608,160 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({ var dlg = o2.DL.open(options); }, + startDraftProcess: function(){ + if (!this.formCustomValidation("", "")) { + this.app.content.unmask(); + // if (callback) callback(); + return false; + } + if (!this.formValidation("", "")) { + this.app.content.unmask(); + // if (callback) callback(); + return false; + } + this.saveFormData(function(){ + this.workAction.startDraft(this.businessData.work.id, function(json){ + this.app.options.workId = json.data[0].work; + var msg = { + "subject": MWF.xApplication.process.Xform.LP.processStarted, + "content": "
"+MWF.xApplication.process.Xform.LP.processStartedMessage+"“["+json.data[0].processName+"]"+(this.businessData.data.title || this.businessData.data.subject)+"”
" + }; + var tooltip = layout.desktop.message.addTooltip(msg); + var item = layout.desktop.message.addMessage(msg); + + this.app.reload(); + + //this.app.notice(MWF.xApplication.process.Xform.LP.dataSaved, "success"); + //草稿模式暂时不能上传附件,不能直接流转文件 + // o2.Actions.invokeAsync([ + // {"action": this.workAction, "name": "loadWork"}, + // {"action": this.workAction, "name": "getWorkControl"}, + // {"action": this.workAction, "name": "getWorkLog"}, + // {"action": this.workAction, "name": "getRecordLog"}, + // {"action": this.workAction, "name": "listAttachments"} + // ], {"success": function(json_work, json_control, json_log, json_record, json_att){ + // if (json_work && json_control && json_log && json_att){ + // this.app.parseData(json_work.data, json_control.data, null, json_log.data, json_record.data, json_att.data); + // var workData = json_work.data; + // this.businessData.activity = workData.activity; + // this.businessData.originalData = Object.clone( this.businessData.data ); + // this.businessData.taskList = workData.taskList; + // this.businessData.task = this.getCurrentTaskData(workData); + // this.businessData.taskList = workData.taskList; + // this.businessData.readList = workData.readList; + // this.businessData.work = workData.work; + // this.businessData.workCompleted = (workData.work.completedTime) ? workData.work : null; + // + // this.businessData.workLogList = json_log.data; + // this.businessData.recordList = json_record.data; + // this.businessData.attachmentList = json_att.data; + // this.businessData.control = json_control.data; + // + // if (this.businessData.task){ + // this.processWork(); + // }else{ + // this.app.options.workId = json.data[0].work; + // this.app.reload(); + // } + // } + // }.bind(this), "failure": function(){}}, json.data[0].work); + + }.bind(this)); + }.bind(this), null, false, null, false) + }, + getCurrentTaskData: function(data){ + if ((data.currentTaskIndex || data.currentTaskIndex===0) && data.currentTaskIndex != -1){ + this.app.options.taskId = this.businessData.taskList[data.currentTaskIndex].id; + return this.businessData.taskList[data.currentTaskIndex]; + } + return null; + }, + processWork: function () { - if (this.json.mode == "Mobile") { - this.processWork_mobile(); - } else { - this.fireEvent("beforeProcessWork"); - if (this.app && this.app.fireEvent) this.app.fireEvent("beforeProcessWork"); + if (!this.businessData.activity || !this.businessData.activity.id){ + this.startDraftProcess(); + }else { + if (this.json.mode == "Mobile") { + this.processWork_mobile(); + } else { + this.fireEvent("beforeProcessWork"); + if (this.app && this.app.fireEvent) this.app.fireEvent("beforeProcessWork"); - if (!this.formCustomValidation("", "")) { - this.app.content.unmask(); - // if (callback) callback(); - return false; - } - // MWF.require("MWF.widget.Mask", function() { - // this.mask = new MWF.widget.Mask({"style": "desktop", "zIndex": 50000}); - // this.mask.loadNode(this.app.content); - - if (!this.formValidation("", "")) { - this.app.content.unmask(); - // if (callback) callback(); - return false; - } + if (!this.formCustomValidation("", "")) { + this.app.content.unmask(); + // if (callback) callback(); + return false; + } + // MWF.require("MWF.widget.Mask", function() { + // this.mask = new MWF.widget.Mask({"style": "desktop", "zIndex": 50000}); + // this.mask.loadNode(this.app.content); + + if (!this.formValidation("", "")) { + this.app.content.unmask(); + // if (callback) callback(); + return false; + } - var setSize = function (notRecenter) { - var dlg = this; - if (!dlg || !dlg.node) return; - dlg.node.setStyle("display", "block"); - var size = processNode.getSize(); - dlg.content.setStyles({ - "height": size.y, - "width": size.x - }); - var s = dlg.setContentSize(); - if (dlg.content.getStyle("overflow-y") === "auto" && dlg.content.getStyle("overflow-x") !== "auto") { - dlg.node.setStyle("width", dlg.node.getStyle("width").toInt() + 20 + "px"); - dlg.content.setStyle("width", dlg.content.getStyle("width").toInt() + 20 + "px"); + var setSize = function (notRecenter) { + debugger; + var dlg = this; + if (!dlg || !dlg.node) return; + dlg.node.setStyle("display", "block"); + var size = processNode.getSize(); + dlg.content.setStyles({ + "height": size.y, + "width": size.x + }); + var s = dlg.setContentSize(); + if (dlg.content.getStyle("overflow-y") === "auto" && dlg.content.getStyle("overflow-x") !== "auto") { + dlg.node.setStyle("width", dlg.node.getStyle("width").toInt() + 20 + "px"); + dlg.content.setStyle("width", dlg.content.getStyle("width").toInt() + 20 + "px"); + } + if (!notRecenter) dlg.reCenter(); } - if (!notRecenter) dlg.reCenter(); - } - //var node = new Element("div", {"styles": this.css.rollbackAreaNode}); - var processNode = new Element("div", { "styles": this.app.css.processNode_Area }).inject(this.app.content); - this.setProcessNode(processNode, "process", function () { - this.processDlg = o2.DL.open({ - "title": this.app.lp.process, - "style": this.json.dialogStyle || "user", - "isResize": false, - "content": processNode, - "positionHeight": 800, - "maxHeight": 800, - "maxHeightPercent": "98%", - "minTop": 5, - "width": "auto", //processNode.retrieve("width") || 1000, //600, - "height": "auto", //processNode.retrieve("height") || 401, - "buttonList": [ - { - "type": "ok", - "text": MWF.LP.process.button.ok, - "action": function (d, e) { - if (this.processor) this.processor.okButton.click(); - }.bind(this) - }, - { - "type": "cancel", - "text": MWF.LP.process.button.cancel, - "action": function () { this.processDlg.close(); }.bind(this) + //var node = new Element("div", {"styles": this.css.rollbackAreaNode}); + var processNode = new Element("div", {"styles": this.app.css.processNode_Area}).inject(this.node); + this.setProcessNode(processNode, "process", function () { + this.processDlg = o2.DL.open({ + "title": this.app.lp.process, + "style": this.json.dialogStyle || "user", + "isResize": false, + "content": processNode, + "maskNode": this.app.content, + "positionHeight": 800, + "maxHeight": 800, + "maxHeightPercent": "98%", + "minTop": 5, + "width": "auto", //processNode.retrieve("width") || 1000, //600, + "height": "auto", //processNode.retrieve("height") || 401, + "buttonList": [ + { + "type": "ok", + "text": MWF.LP.process.button.ok, + "action": function (d, e) { + if (this.processor) this.processor.okButton.click(); + }.bind(this) + }, + { + "type": "cancel", + "text": MWF.LP.process.button.cancel, + "action": function () { + this.processDlg.close(); + if (this.processor) this.processor.destroy(); + }.bind(this) + } + ], + "onPostLoad": function () { + setSize.call(this) } - ], - "onPostLoad": function () { - setSize.call(this) - } - }); + }); - }.bind(this), function () { - setSize.call(this.processDlg, true) - }.bind(this)); + }.bind(this), function () { + if (this.processDlg) setSize.call(this.processDlg, true) + }.bind(this)); + } } }, processWork_mobile: function () { @@ -3176,28 +3254,29 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({ } }, - deleteWork: function () { + deleteDraftWork: function(){ var _self = this; if (this.json.mode === "Mobile") { if (window.confirm(MWF.xApplication.process.Xform.LP.deleteWorkText.text)) { MWF.require("MWF.widget.Mask", function () { - _self.mask = new MWF.widget.Mask({ "style": "desktop", "zIndex": 50000 }); + _self.mask = new MWF.widget.Mask({"style": "desktop", "zIndex": 50000}); _self.mask.loadNode(_self.app.content); - _self.fireEvent("beforeDelete"); - if (_self.app && _self.app.fireEvent) _self.app.fireEvent("beforeDelete"); - _self.doDeleteWork(function () { - _self.fireEvent("afterDelete"); - if (_self.app && _self.app.fireEvent) _self.app.fireEvent("afterDelete"); _self.app.notice(MWF.xApplication.process.Xform.LP.workDelete + ": “" + _self.businessData.work.title + "”", "success"); - if (_self.mask) { _self.mask.hide(); _self.mask = null; } + if (_self.mask) { + _self.mask.hide(); + _self.mask = null; + } _self.finishOnMobile() }.bind(this), function (xhr, text, error) { var errorText = error + ":" + text; if (xhr) errorText = xhr.responseText; _self.app.notice("request json error: " + errorText, "error", dlg.node); - if (_self.mask) { _self.mask.hide(); _self.mask = null; } + if (_self.mask) { + _self.mask.hide(); + _self.mask = null; + } }.bind(this)); }.bind(this)); } @@ -3212,58 +3291,147 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({ } }; this.app.confirm("infor", event, MWF.xApplication.process.Xform.LP.deleteWorkTitle, MWF.xApplication.process.Xform.LP.deleteWorkText, 380, 120, function () { - // _self.app.content.mask({ - // "style": { - // "background-color": "#999", - // "opacity": 0.6 - // } - // }); - - MWF.require("MWF.widget.Mask", function () { - _self.mask = new MWF.widget.Mask({ "style": "desktop", "zIndex": 50000 }); + _self.mask = new MWF.widget.Mask({"style": "desktop", "zIndex": 50000}); _self.mask.loadNode(_self.app.content); - _self.fireEvent("beforeDelete"); - if (_self.app && _self.app.fireEvent) _self.app.fireEvent("beforeDelete"); - _self.doDeleteWork(function () { - _self.fireEvent("afterDelete"); - if (_self.app && _self.app.fireEvent) _self.app.fireEvent("afterDelete"); _self.app.notice(MWF.xApplication.process.Xform.LP.workDelete + ": “" + _self.businessData.work.title + "”", "success"); _self.app.close(); this.close(); - if (_self.mask) { _self.mask.hide(); _self.mask = null; } + if (_self.mask) { + _self.mask.hide(); + _self.mask = null; + } }.bind(this), function (xhr, text, error) { var errorText = error + ":" + text; if (xhr) errorText = xhr.responseText; _self.app.notice("request json error: " + errorText, "error", dlg.node); - if (_self.mask) { _self.mask.hide(); _self.mask = null; } + if (_self.mask) { + _self.mask.hide(); + _self.mask = null; + } }.bind(this)); }.bind(this)); - - - - //_self.workAction.deleteWork(function(json){ - // _self.app.notice(MWF.xApplication.process.Xform.LP.workDelete+": “"+_self.businessData.work.title+"”", "success"); - // _self.app.close(); - // this.close(); - //}.bind(this), null, _self.businessData.work.id); - //this.close(); }, function () { this.close(); }, null, this.app.content, this.json.confirmStyle); } }, + deleteWork: function () { + if (!this.businessData.activity || !this.businessData.activity.id) { + this.deleteDraftWork(); + }else { + var _self = this; + if (this.json.mode === "Mobile") { + if (window.confirm(MWF.xApplication.process.Xform.LP.deleteWorkText.text)) { + MWF.require("MWF.widget.Mask", function () { + _self.mask = new MWF.widget.Mask({"style": "desktop", "zIndex": 50000}); + _self.mask.loadNode(_self.app.content); + + _self.fireEvent("beforeDelete"); + if (_self.app && _self.app.fireEvent) _self.app.fireEvent("beforeDelete"); + + _self.doDeleteWork(function () { + _self.fireEvent("afterDelete"); + if (_self.app && _self.app.fireEvent) _self.app.fireEvent("afterDelete"); + _self.app.notice(MWF.xApplication.process.Xform.LP.workDelete + ": “" + _self.businessData.work.title + "”", "success"); + if (_self.mask) { + _self.mask.hide(); + _self.mask = null; + } + _self.finishOnMobile() + }.bind(this), function (xhr, text, error) { + var errorText = error + ":" + text; + if (xhr) errorText = xhr.responseText; + _self.app.notice("request json error: " + errorText, "error", dlg.node); + if (_self.mask) { + _self.mask.hide(); + _self.mask = null; + } + }.bind(this)); + }.bind(this)); + } + } else { + var p = MWF.getCenterPosition(this.app.content, 380, 150); + var event = { + "event": { + "x": p.x, + "y": p.y - 200, + "clientX": p.x, + "clientY": p.y - 200 + } + }; + this.app.confirm("infor", event, MWF.xApplication.process.Xform.LP.deleteWorkTitle, MWF.xApplication.process.Xform.LP.deleteWorkText, 380, 120, function () { + // _self.app.content.mask({ + // "style": { + // "background-color": "#999", + // "opacity": 0.6 + // } + // }); + + + MWF.require("MWF.widget.Mask", function () { + _self.mask = new MWF.widget.Mask({"style": "desktop", "zIndex": 50000}); + _self.mask.loadNode(_self.app.content); + + _self.fireEvent("beforeDelete"); + if (_self.app && _self.app.fireEvent) _self.app.fireEvent("beforeDelete"); + + _self.doDeleteWork(function () { + _self.fireEvent("afterDelete"); + if (_self.app && _self.app.fireEvent) _self.app.fireEvent("afterDelete"); + _self.app.notice(MWF.xApplication.process.Xform.LP.workDelete + ": “" + _self.businessData.work.title + "”", "success"); + _self.app.close(); + this.close(); + if (_self.mask) { + _self.mask.hide(); + _self.mask = null; + } + }.bind(this), function (xhr, text, error) { + var errorText = error + ":" + text; + if (xhr) errorText = xhr.responseText; + _self.app.notice("request json error: " + errorText, "error", dlg.node); + if (_self.mask) { + _self.mask.hide(); + _self.mask = null; + } + }.bind(this)); + }.bind(this)); + + + //_self.workAction.deleteWork(function(json){ + // _self.app.notice(MWF.xApplication.process.Xform.LP.workDelete+": “"+_self.businessData.work.title+"”", "success"); + // _self.app.close(); + // this.close(); + //}.bind(this), null, _self.businessData.work.id); + //this.close(); + }, function () { + this.close(); + }, null, this.app.content, this.json.confirmStyle); + } + } + }, + doDeleteDraftWork: function(success, failure){ + this.workAction.deleteDraftWork(function (json) { + if (success) success(json); + }.bind(this), function (xhr, text, error) { + if (failure) failure(xhr, text, error); + }, this.businessData.work.id); + }, doDeleteWork: function (success, failure) { - if (this.businessData.control["allowDelete"]) { - this.workAction.deleteWork(function (json) { - if (success) success(json); - }.bind(this), function (xhr, text, error) { - if (failure) failure(xhr, text, error); - }, this.businessData.work.id); - } else { - if (failure) failure(null, "Permission Denied", ""); + if (!this.businessData.activity || !this.businessData.activity.id) { + this.doDeleteDraftWork(success, failure); + }else { + if (this.businessData.control["allowDelete"]) { + this.workAction.deleteWork(function (json) { + if (success) success(json); + }.bind(this), function (xhr, text, error) { + if (failure) failure(xhr, text, error); + }, this.businessData.work.id); + } else { + if (failure) failure(null, "Permission Denied", ""); + } } }, diff --git a/o2web/source/x_component_process_Xform/lp/zh-cn.js b/o2web/source/x_component_process_Xform/lp/zh-cn.js index 97c3c82eb47f0f498a4cae6402b5314967a69662..48c41bd5cae85554b01c70c7089a70af450de9eb 100644 --- a/o2web/source/x_component_process_Xform/lp/zh-cn.js +++ b/o2web/source/x_component_process_Xform/lp/zh-cn.js @@ -18,6 +18,11 @@ MWF.xApplication.process.Xform.LP = { "arrivedUsers": "到达处理人", "replace": "代", + "processStarted": "文件已启动", + "processStartedMessage": "您启动了一个新的工作:", + + "draftStart": "流程已启动", + "taskCompleted": "待办已处理", "workCompleted": "工作流转已完成", "arrivedActivity": "工作已到达活动:",