From 7f863f2bebf55d5735d8fc7556f74e463d81b983 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 29 十一月 2023 12:42:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue |   80 +++++++++++++++++-----------------------
 1 files changed, 34 insertions(+), 46 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
index b633a29..b8bfceb 100644
--- a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
+++ b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
@@ -75,7 +75,7 @@
     // 琛ㄥ崟绫诲瀷锛坅dd, edit, detail锛�
     type: {
       type: String,
-      default: "",
+      default: "add",
     },
     // 鑷畾涔夎〃鍗曠被鍨�
     selfColumnType: {
@@ -106,6 +106,8 @@
   },
   data() {
     return {
+      //骞翠唬鍙�
+      dataYearValue:null,
       filteredObject: {},
       filteredArray: [],
       isSeriesType: {},
@@ -139,7 +141,7 @@
       // 琛ㄥ崟灞炴��
       attributes: [],
       slotColumnList: [],
-      isShow:null,
+      isShow: "",
     };
   },
   mounted() {
@@ -170,12 +172,6 @@
       immediate: true,
       handler(newV) {
         this.$emit("getFormData", newV);
-        // console.log("filteredObject",this.filteredObject)
-        if (this.filteredObject.label === "绯诲垪鍙�") {
-          if (newV.isSeries === "false") {
-            this.filteredObject.disabled = true;
-          }
-        }
       },
     },
     attrList: {
@@ -184,15 +180,6 @@
       handler(newVal, oldVal) {
         if (newVal) {
           this.$emit("attrList", newVal)
-        }
-      }
-    },
-    isSeriesType: {
-      deep: true,
-      immediate: true,
-      handler(newVal, oldVal) {
-        if (newVal) {
-          this.$emit("isSeriesType", newVal)
         }
       }
     },
@@ -205,11 +192,22 @@
       deep: true,
       immediate: true
     },
+    isShow: {
+      handler(newV) {
+        this.$emit("isShow", newV)
+      }
+    },
+    dataYearValue:{
+      handler(newV){
+        if(newV){
+          this.$emit("dataYearValue",newV)
+        }
+      }
+    }
   },
   methods: {
     // 娓叉煋琛ㄥ崟妯℃澘
     templateRender(formItemList, TreeValue) {
-      // debugger
       if (this.eventList) {
         this.eventFlag = this.eventList.some(item => {
           if (item.classifyInvokeEditFlag === 'true') {
@@ -224,18 +222,12 @@
       let dictKeys = [];
       let slotColumnList = [];
       formItemList.forEach((formItem) => {
-        console.log('formItem',formItem);
         formItem = this.resetFormConfig(formItem);
         //灞炴�х爜娈佃鍒�
         if (formItem.secType === "codeattrsec") {
           this.attrList.push(formItem);
         }
         //绯诲垪鍙疯鍒�
-        if (formItem.label === "绯诲垪鍙�") {
-          this.isSeriesType = formItem;
-          // console.log("绯诲垪鍙�",formItem)
-        }
-        //鏇存敼鏂瑰紡瑙勫垯
         if (formItem.field === "codeStandardEditType") {
           if (this.status === "amend") {
             formItem.readOnly = true;
@@ -281,23 +273,27 @@
           formItem.fieldMap[formItem.field + 'id'] = 'id'
         }
 
-
         let columnItem = {
           change: (val) => {
-            // console.log(val)
             if (val.column.field === "drawingno") {
               this.codeattrsecValue = val.value;
               return;
             }
-            ;
+            //鏄惁绯诲垪-绯诲垪鍙�
             if (val.column.field === "isSeries") {
               if (val.value === "false") {
                 this.isShow = true;
-              }else {
+              } else {
                 this.isShow = false;
               }
             }
-
+            if(val.column.field === "releaseDate"){
+              if(val.value){
+                this.dataYearValue = val.column.valueFormat;
+              }else {
+                this.dataYearValue = null;
+              }
+            }
           },
           dataKey: formItem.dataKey || formItem.field,
           label: formItem.text,
@@ -308,8 +304,7 @@
           field: formItem.field,
           type: this.columnType[formItem.type],
           dicData: this.getDataList(formItem.type, formItem.data),
-          disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false) ||
-            (this.isShow && formItem.label === "绯诲垪鍙�" ? true : false),
+          disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false),
           prepend: this.preOrSufFixShow("text", formItem.prefix),
           append: this.preOrSufFixShow("text", formItem.suffix),
           prefixIcon: this.preOrSufFixShow("icon", formItem.prefix),
@@ -319,13 +314,10 @@
           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.field === "isSeries" ? "true" : null),
+            (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null),
           placeholder: formItem.inputTip,
           comboxKey: formItem.comboxKey,
           tip: formItem.tooltips,
-          // hidden:formItem.secType && formItem.codeValueApplyStatus == 3 ? true : false,
-          // readonly:formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ?true : false ,
           display: !formItem.hidden,
           maxlength: formItem.maxlength,
           filterable: true,
@@ -364,7 +356,6 @@
           },
         };
         this.filteredObject = columnItem
-        // console.log("columnItem", columnItem)
         slotColumnList.push(columnItem);
         if (group.length === 0) {
           column.push(columnItem);
@@ -373,9 +364,7 @@
         }
       });
 
-      // this.filteredArray = column.filter(obj => obj.label === "绯诲垪鍙�");
       this.slotColumnList = slotColumnList;
-      // console.log(slotColumnList)
       this.$set(this.option, "column", column);
       this.$set(this.option, "group", group);
       this.updateIndex++;
@@ -387,9 +376,12 @@
       this.getFormDetail();
     },
     //淇敼绾ц仈椤�
-    changeChildItem(items, TreeValue) {
-      let column = this.option.column;
-      let group = this.option.group;
+    changeChildItem(items, TreeValue, type) {
+      type = type || "add"
+      // let column = this.option.column;
+      // let group = this.option.group;
+      let column = [];
+      let group = [];
       let that = this;
       items.forEach((item) => {
         let formItem = this.resetFormConfig(item);
@@ -412,9 +404,6 @@
           formItem.fieldMap[formItem.field + 'id'] = 'id'
         }
         let columnItem = {
-          change: (val) => {
-            // console.log('1', val)
-          },
           label: formItem.text,
           labelslot: true,
           prop: this.$utilFunc.isValuableObj(formItem.referConfig)
@@ -423,7 +412,7 @@
           field: formItem.field,
           type: this.columnType[formItem.type],
           dicData: this.getDataList(formItem.type, formItem.data),
-          disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false),
+          disabled: type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false),
           prepend: this.preOrSufFixShow("text", formItem.prefix),
           append: this.preOrSufFixShow("text", formItem.suffix),
           prefixIcon: this.preOrSufFixShow("icon", formItem.prefix),
@@ -475,7 +464,6 @@
             value: "key",
           },
         };
-
         if (group.length === 0) {
           that.slotColumnList.forEach((colItem, index) => {
             if (colItem.field == columnItem.field) {

--
Gitblit v1.9.3