Kaynağa Gözat

自定义提交

unknown 5 yıl önce
ebeveyn
işleme
6f99d2d610

+ 6 - 0
o2web/source/x_component_process_FormDesigner/Module/Form/form.html

@@ -64,14 +64,17 @@
                     <input type="radio" onclick="if (this.checked) {
                         $('text{$.pid}selectSubmitForm').setStyle('display', 'none');
                         $('text{$.pid}scriptSubmitForm').setStyle('display', 'none');
+                        $('text{$.pid}submitScript').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');
+                        $('text{$.pid}submitScript').setStyle('display', 'block');
                     }" 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');}
+                        $('text{$.pid}submitScript').setStyle('display', 'block');
                     " name="submitFormType" value="script" text{($.submitFormType=='script')?'checked':''}/>计算表单<br/>
                 </td>
             </tr>
@@ -100,6 +103,9 @@
                 }; <br/> 本应用:<br/>return "表单名称"; </div>
             <div class="MWFScriptArea" name="submitFormScript" title="提交表单脚本 (S)"></div>
         </div>
+        <div id="text{$.pid}submitScript" style="display: text{($.submitFormType=='script' || $.submitFormType=='select')?'block':'none'}">
+            <div class="MWFScriptArea" name="submitScript" title="提交(继续流转)操作脚本"></div>
+        </div>
 
         <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
             <tr>

+ 3 - 0
o2web/source/x_component_process_Xform/Form.js

@@ -1728,6 +1728,9 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
             }
             var submitFormContainer = new Element("div").inject( layout.mobile ? $(document.body) : this.app.content );
             this.submitFormModule = new MWF["APPSubmitform"]( submitFormContainer , this.json, this);
+            this.submitFormModule.addEvent("load", function () {
+                this.submitFormModule.show();
+            }.bind(this))
             this.submitFormModule.load();
         }else{
             this.submitFormModule.show();

+ 4 - 1
o2web/source/x_component_process_Xform/Subform.js

@@ -197,6 +197,9 @@ MWF.xApplication.process.Xform.SubmitForm = MWF.APPSubmitform = new Class({
         }.bind(this));
     },
     show : function(){
+        if (this.json.submitScript.code) {
+            this.form.Macro.exec(this.json.submitScript.code, this);
+        }
         // this.fireSubFormEvent("load");
     },
     // fireSubFormEvent : function( name ){
@@ -209,7 +212,7 @@ MWF.xApplication.process.Xform.SubmitForm = MWF.APPSubmitform = new Class({
         if (this.subformData){
             if( !this.checkSubformUnique( this.subformData.json.id ) ){ //如果提交表单已经嵌入到表单中,那么把这个表单弹出来
                 // this.form.notice(MWF.xApplication.process.Xform.LP.subformUniqueError, "error");
-
+                this.isEmbedded = true;
             }else if( !this.checkSubformNested( this.subformData.json.id ) ){
                 this.form.notice(MWF.xApplication.process.Xform.LP.subformNestedError, "error");
             }else{