Bläddra i källkod

修复提交界面某些情况下选择人员字样没有隐藏的问题

unknown 5 år sedan
förälder
incheckning
60d914fc46

+ 78 - 35
o2web/source/x_component_process_FormDesigner/Module/Form/form.html

@@ -40,6 +40,83 @@
                 </td>
             </tr>
         </table>
+
+		<!--<div class="MWFArraylist" name="cssLinks" title="CSS引用"></div>-->
+		<!--<div class="MWFArraylist" name="scriptSrc" title="JS引用"></div>-->
+
+		<div class="MWFMaplist" name="styles" title="样式"></div>
+		<div class="MWFMaplist" name="properties" title="属性"></div>
+
+        <div class="MWFCssArea" name="css" title="CSS"></div>
+		<!--<div class="MWFScriptArea" name="jsheader" title="JS Header"></div>-->
+
+        <div class="MWFScriptArea" name="validationOpinion" title="校验意见 (S)"></div>
+        <div class="MWFScriptArea" name="validationRoute" title="校验路由 (S)"></div>
+        <div class="MWFScriptArea" name="validationFormCustom" title="流转校验 (S)"></div>
+
+	</div>
+	<div title="提交" class="MWFTab">
+
+        <div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999; font-weight: bold">提交界面</div>
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td class="editTableValue" colspan="2">
+                    <input type="radio" onclick="if (this.checked) {
+                        $('text{$.pid}selectSubmitForm').setStyle('display', 'none');
+                        $('text{$.pid}scriptSubmitForm').setStyle('display', 'none');
+                    }" name="submitFormType" value="default" text{($.submitFormType!='script' && $.submitFormType!='select' )?'checked':''}/>系统默认
+                    <input type="radio" onclick="if (this.checked) {
+                        $('text{$.pid}selectSubmitForm').setStyle('display', 'block');
+                        $('text{$.pid}scriptSubmitForm').setStyle('display', 'none');
+                    }" name="submitFormType" value="select" text{($.submitFormType=='select')?'checked':''}/>选择表单
+                    <input type="radio" onclick="if (this.checked) {
+                        $('text{$.pid}selectSubmitForm').setStyle('display', 'none');
+                        $('text{$.pid}scriptSubmitForm').setStyle('display', 'block');}
+                    " name="submitFormType" value="script" text{($.submitFormType=='script')?'checked':''}/>计算表单<br/>
+                </td>
+            </tr>
+        </table>
+
+        <div id="text{$.pid}selectSubmitForm" class="MWFSubFormSelectContainer" style="display: text{($.submitFormType=='select')?'block':'none'}">
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">应用:</td>
+                    <td class="editTableValue">
+                        <div class="MWFSubformAppSelect" name="submitFormAppSelected"></div>
+                    </td>
+                </tr>
+                <tr>
+                    <td class="editTableTitle">表单:</td>
+                    <td class="editTableValue">
+                        <div class="MWFSubformSelect" name="submitFormSelected"></div>
+                    </td>
+                </tr>
+            </table>
+        </div>
+        <div id="text{$.pid}scriptSubmitForm" style="display: text{($.submitFormType=='script')?'block':'none'}">
+            <div style="padding: 5px;">跨应用:<br/>return { <br/>
+                &nbsp;&nbsp;"application" : "应用名称", //应用名称、别名、id <br/>
+                &nbsp;&nbsp;"form" : "表单名称" //表单、id<br/>
+                }; <br/> 本应用:<br/>return "表单名称"; </div>
+            <div class="MWFScriptArea" name="submitFormScript" title="提交表单脚本 (S)"></div>
+        </div>
+
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td colspan="2" class="editTableValue"><b>提交意见手写板宽度:</b>
+                    <input type="text" name="tabletWidth" value="text{$.tabletWidth}" class="editTableInputNoWidth" style="width: 50px;margin-right:3px;" />px
+                    <span>&nbsp;&nbsp;&nbsp;&nbsp;(pc端有效)</span>
+                </td>
+            </tr>
+            <tr>
+                <td colspan="2" class="editTableValue"><b>提交意见手写板高度:</b>
+                    <input type="text" name="tabletHeight" value="text{$.tabletHeight}" class="editTableInputNoWidth" style="width: 50px;;margin-right:3px;" />px
+                    <span>&nbsp;&nbsp;&nbsp;&nbsp;(pc端有效)</span>
+                </td>
+            </tr>
+        </table>
+
+        <div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999; font-weight: bold">流转后提示框</div>
         <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
             <tr>
                 <td colspan="2" class="editTableValue"><b>流转后提示框:</b>
@@ -76,41 +153,7 @@
                     秒后自动关闭</b></td>
             </tr>
         </table>
-
-        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
-<!--            <tr>-->
-<!--                <td colspan="2" class="editTableValue"><b>提交表单:</b>-->
-<!--                    <div class="MWFFormSelect" name="submitForm"></div>-->
-<!--                </td>-->
-<!--            </tr>-->
-            <tr>
-                <td colspan="2" class="editTableValue"><b>提交意见手写板宽度:</b>
-                    <input type="text" name="tabletWidth" value="text{$.tabletWidth}" class="editTableInputNoWidth" style="width: 50px;margin-right:3px;" />px
-                    <span>&nbsp;&nbsp;&nbsp;&nbsp;(pc端有效)</span>
-                </td>
-            </tr>
-            <tr>
-                <td colspan="2" class="editTableValue"><b>提交意见手写板高度:</b>
-                    <input type="text" name="tabletHeight" value="text{$.tabletHeight}" class="editTableInputNoWidth" style="width: 50px;;margin-right:3px;" />px
-                    <span>&nbsp;&nbsp;&nbsp;&nbsp;(pc端有效)</span>
-                </td>
-            </tr>
-        </table>
-		
-		<!--<div class="MWFArraylist" name="cssLinks" title="CSS引用"></div>-->
-		<!--<div class="MWFArraylist" name="scriptSrc" title="JS引用"></div>-->
-		
-		<div class="MWFMaplist" name="styles" title="样式"></div>
-		<div class="MWFMaplist" name="properties" title="属性"></div>
-
-        <div class="MWFCssArea" name="css" title="CSS"></div>
-		<!--<div class="MWFScriptArea" name="jsheader" title="JS Header"></div>-->
-
-        <div class="MWFScriptArea" name="validationOpinion" title="校验意见 (S)"></div>
-        <div class="MWFScriptArea" name="validationRoute" title="校验路由 (S)"></div>
-        <div class="MWFScriptArea" name="validationFormCustom" title="流转校验 (S)"></div>
-
-	</div>
+    </div>
     <div title="操作"  class="MWFTab" style="overflow: hidden; display: text{($.mode=='Mobile')?'block':'none'}">
         <div class="MWFDefaultActionArea" name="defaultTools" data-target="mobileForm"></div>
         <div class="MWFActionArea" name="tools"></div>

+ 96 - 73
o2web/source/x_component_process_Xform/Form.js

@@ -1680,92 +1680,115 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
     processWork: function () {
         if (!this.businessData.work.startTime) {
             this.startDraftProcess();
+        } else if( this.json.submitFormType === "select" ){
+
+        } else if( this.json.submitFormType === "script" ){
+
         } else {
             if (this.json.mode == "Mobile") {
                 setTimeout(function () {
                     this.processWork_mobile();
                 }.bind(this), 100);
-
             } else {
-                this.fireEvent("beforeProcessWork");
-                if (this.app && this.app.fireEvent) this.app.fireEvent("beforeProcessWork");
+                this.processWork_pc();
+            }
+        }
+    },
+    processWork_custom : function(){
+        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;
+        }
 
-                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 (!this.formValidation("", "")) {
+            this.app.content.unmask();
+            //    if (callback) callback();
+            return false;
+        }
 
-                //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)
-                        }
-                    });
 
-                }.bind(this), function () {
-                    if (this.processDlg) setSize.call(this.processDlg, true)
-                }.bind(this));
+    },
+    processWork_pc: function(){
+        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;
+        }
+
+        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();
         }
+
+        //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)
+                }
+            });
+
+        }.bind(this), function () {
+            if (this.processDlg) setSize.call(this.processDlg, true)
+        }.bind(this));
     },
     processWork_mobile: function () {
         if (this.app.inBrowser) {

+ 95 - 0
o2web/source/x_component_process_Xform/Subform.js

@@ -179,4 +179,99 @@ MWF.xApplication.process.Xform.Subform = MWF.APPSubform =  new Class({
             this.subformData.updateTime = data.updateTime;
         }
     }
+});
+
+
+MWF.xApplication.process.Xform.SubmitForm = MWF.APPSubmitform = new Class({
+    Extends: MWF.APPSubform,
+    loadSubform: function(){
+        if (this.subformData){
+            if( !this.checkSubformUnique( this.subformData.json.id ) ){ //如果提交表单已经嵌入到表单中,那么把这个表单弹出来
+                // this.form.notice(MWF.xApplication.process.Xform.LP.subformUniqueError, "error");
+
+            }else if( !this.checkSubformNested( this.subformData.json.id ) ){
+                this.form.notice(MWF.xApplication.process.Xform.LP.subformNestedError, "error");
+            }else{
+                //this.form.addEvent("postLoad", function(){
+
+                this.loadCss();
+
+                this.node.set("html", this.subformData.html);
+                Object.each(this.subformData.json.moduleList, function (module, key) {
+                    var formKey = key;
+                    if (this.form.json.moduleList[key]) {
+                        formKey = this.json.id + "_" + key;
+                        var moduleNode = this.node.getElement("#" + key);
+                        if (moduleNode) moduleNode.set("id", formKey);
+                        module.id = formKey;
+                    }
+                    this.form.json.moduleList[formKey] = module;
+                }.bind(this));
+
+                var moduleNodes = this.form._getModuleNodes(this.node);
+                moduleNodes.each(function (node) {
+                    if (node.get("MWFtype") !== "form") {
+                        var _self = this;
+                        var json = this.form._getDomjson(node);
+                        //if( json.type === "Subform" || json.moduleName === "subform" )this.form.subformCount++;
+                        var module = this.form._loadModule(json, node, function(){
+                            this.parentformIdList = _self.getParentformIdList();
+                        });
+                        this.form.modules.push(module);
+                    }
+                }.bind(this));
+
+                this.form.subformLoaded.push( this.subformData.json.id );
+            }
+        }
+        // if( this.form.subformLoadedCount ){
+        //     this.form.subformLoadedCount++;
+        // }else{
+        //     this.form.subformLoadedCount = 1
+        // }
+        // this.form.checkSubformLoaded();
+    },
+    getSubform: function(callback){
+        var method = (this.form.json.mode !== "Mobile" && !layout.mobile) ? "getForm": "getFormMobile";
+        if (this.json.submitFormType==="script"){
+            if (this.json.submitFormScript.code){
+                var data = this.form.Macro.exec(this.json.submitFormScript.code, this);
+                if (data){
+                    var formName, app;
+                    if( typeOf( data ) === "string" ){
+                        formName = data;
+                    }else{
+                        if( data.application )app = data.application;
+                        if( data.subform )formName = data.subform;
+                    }
+                    if( formName ){
+                        if( !app )app = (this.form.businessData.work || this.form.businessData.workCompleted).application;
+                        MWF.Actions.get("x_processplatform_assemble_surface")[method](formName, app, function(json){
+                            this.getSubformData(json.data);
+                            if (callback) callback();
+                        }.bind(this));
+                    }else{
+                        if (callback) callback();
+                    }
+                }else{
+                    if (callback) callback();
+                }
+            }
+        }else{
+            if (this.json.submitFormSelected && this.json.submitFormSelected!=="none"){
+                var app;
+                if( this.json.submitFormAppSelected ){
+                    app = this.json.submitFormAppSelected;
+                }else{
+                    app = (this.form.businessData.work || this.form.businessData.workCompleted).application;
+                }
+                MWF.Actions.get("x_processplatform_assemble_surface")[method](this.json.submitFormSelected, app, function(json){
+                    this.getSubformData(json.data);
+                    if (callback) callback();
+                }.bind(this));
+            }else{
+                if (callback) callback();
+            }
+        }
+    }
 });