Ver código fonte

打印表单和已完成数据的表单获取展现错误

huqi 5 anos atrás
pai
commit
16adcc846f

+ 16 - 10
o2web/source/x_component_process_Work/Main.js

@@ -144,7 +144,6 @@ MWF.xApplication.process.Work.Main = new Class({
     loadWorkByWork: function(id){
         //var getWorkLogMothed = "getWorkLog";    //以前使用worklog,现在改成record了
         //var getWorkLogMothed = (this.options.worklogType.toLowerCase()==="worklog") ? "getWorkLog" : "getRecordLog";
-
         var loadFormFlag = false;
         var loadWorkFlag = false;
 
@@ -172,12 +171,12 @@ MWF.xApplication.process.Work.Main = new Class({
             }
         }.bind(this);
 
-        if (this.options.form && this.options.form.id && this.options.form.app){
+        if (this.options.form && this.options.form.id){
             o2.Actions.invokeAsync([
                 {"action": this.action, "name": "loadWorkV2"},
                 {"action": this.action, "name": "getWorkLog"},
                 {"action": this.action, "name": "getWorkControl"},
-                {"action": this.action, "name": "getForm"}
+                {"action": this.action, "name": ((layout.mobile) ? "getFormV2Mobile": "getFormV2")}
             ], {"success": function(jsonWork, jsonLog, jsonControl, jsonForm){
                     json_work = jsonWork;
                     json_log = jsonLog;
@@ -188,18 +187,25 @@ MWF.xApplication.process.Work.Main = new Class({
                     check();
                 }.bind(this), "failure": function(){
                     //this.close();
-                }.bind(this)}, id, id, id, [this.options.form.id, this.options.form.app]);
+                }.bind(this)}, id, id, id, [this.options.form.id]);
         }else{
             this.action.lookupFormWithWork(id, function(json){
                 var formId = json.data.id;
-                this.action[((layout.mobile) ? "getFormV2Mobile": "getFormV2")](formId, function(formJson){
-                    json_form = formJson;
-                    loadFormFlag = true;
-                    check();
-                }, function(){
+                if (json.data.form){
+                    json_form = json;
                     loadFormFlag = true;
                     check();
-                });
+                }else{
+                    this.action[((layout.mobile) ? "getFormV2Mobile": "getFormV2")](formId, function(formJson){
+                        json_form = formJson;
+                        loadFormFlag = true;
+                        check();
+                    }, function(){
+                        loadFormFlag = true;
+                        check();
+                    });
+                }
+
             }.bind(this), function(){
                 loadFormFlag = true;
                 check();

+ 1 - 2
o2web/source/x_desktop/printWork.html

@@ -6,9 +6,8 @@
         <link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" />
         <link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
         <script src="../o2_core/o2.min.js"></script>
-        <script src="js/base.min.js"></script>
+        <script src="js/base_work.js"></script>
         <script src="js/printWork.js"></script>
-        <script src="../o2_lib/Decimal.js"></script>
 
         <title>WORK</title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />