فهرست منبع

对公报销单

wanghaiwu 2 هفته پیش
والد
کامیت
471999f396

+ 12 - 10
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/form/ErDailyReimburseExtBotpUpPlugin.java

@@ -85,21 +85,11 @@ public class ErDailyReimburseExtBotpUpPlugin extends PublicReimburseBotpUpPlugin
             item = BusinessDataServiceHelper.loadSingle(item.getPkValue(), item.getDynamicObjectType().getName());
 
             String isrelapjtype = item.getString("nckd_isrelapjtype");
-            String pjtype = item.getString("nckd_pjtype");
             String isrelapj = (String) this.getModel().getValue("nckd_isrelapj");
 
             //必选
             if ("1".equals(isrelapjtype) || ("2".equals(isrelapjtype) && "1".equals(isrelapj))) {
                 needCheck = true;
-
-                //标准项目
-                if ("project".equals(pjtype)) {
-                    fieldKey = "nckd_project";
-                }
-                //核算项目
-                else if ("acctitem".equals(pjtype)) {
-                    fieldKey = "nckd_acctitem";
-                }
             }
         }
 
@@ -151,6 +141,18 @@ public class ErDailyReimburseExtBotpUpPlugin extends PublicReimburseBotpUpPlugin
             DynamicObject item = (DynamicObject) this.getModel().getValue("nckd_expenseitem");
             String fieldKey = "";
             boolean checkProject = checkProject(item, fieldKey);
+
+            String pjtype = item.getString("nckd_pjtype");
+
+            //标准项目
+            if ("project".equals(pjtype)) {
+                fieldKey = "nckd_project";
+            }
+            //核算项目
+            else if ("acctitem".equals(pjtype)) {
+                fieldKey = "nckd_acctitem";
+            }
+
             Long curProjectId = 0L;
             if(checkProject) {
                 curProjectId = ((DynamicObject) this.getModel().getValue(fieldKey)).getLong("id");