From 38f0f601c507fa9a7a27754e9f1a1bd10f913899 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期日, 03 十二月 2023 23:07:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
index 5849e98..e75483c 100644
--- a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
+++ b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
@@ -278,7 +278,6 @@
 
         let columnItem = {
           change: (val) => {
-            console.log(val)
             if (val.column.field === "drawingno") {
               this.codeattrsecValue = val.value;
               return;
@@ -318,9 +317,10 @@
           valueFormat: formItem.dateFormate || "yyyy-MM-dd HH:mm:ss",
           format: formItem.dateFormate,
           keyAttr: formItem.keyAttr,
-          value: (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) ||
+          value:formItem.defaultValue || (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) ||
             (formItem.secType == "codedatesec" ? formItem.codeDateValue : null) || (TreeValue && formItem.secType == "codelevelsec" ? TreeValue : null) ||
-            (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null),
+            (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null) ||
+            (this.status === "amend" && formItem.field === "codeStandardEditType" ? "2" : null),
           placeholder: formItem.inputTip,
           comboxKey: formItem.comboxKey,
           tip: formItem.tooltips,
@@ -428,7 +428,8 @@
           keyAttr: formItem.keyAttr,
           value: (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) ||
             (formItem.secType == "codedatesec" ? formItem.codeDateValue : null) || (TreeValue && formItem.secType == "codelevelsec" ? TreeValue : null) ||
-            (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null),
+            (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null)  ||
+            (this.status === "amend" && formItem.field === "codeStandardEditType" ? "2" : null),
           placeholder: formItem.inputTip,
           comboxKey: formItem.comboxKey,
           tip: formItem.tooltips,
@@ -600,12 +601,16 @@
     // 鑾峰彇琛ㄥ崟璇︽儏鏁版嵁
     getFormDetail() {
       if (this.type === "add") return;
-      getFormDetail({templateOid: this.templateOid, oid: this.rowOid}).then(
-        (res) => {
-          this.form = Object.assign(this.form, res.data.data[0]);
-          this.loading = false;
-        }
-      );
+      if(this.templateOid){
+        getFormDetail({templateOid: this.templateOid, oid: this.rowOid}).then(
+          (res) => {
+            this.form = Object.assign(this.form, res.data.data[0]);
+            this.loading = false;
+          }
+        );
+        return;
+      }
+
     },
     setReferValue(data) {
       if (data.field) {

--
Gitblit v1.9.3