From bc796666e8267f1e47ff9451d9c105b6e327ecff Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 08 九月 2023 08:56:57 +0800
Subject: [PATCH] 修改参照bug

---
 Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue   |    4 
 Source/UBCS-WEB/src/mixins/codeApply.js                     |  380 +++++++++++++++++++-------------------
 Source/UBCS-WEB/src/components/FormTemplate/CodeApply.vue   |  206 ++++++++++----------
 Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue |    4 
 4 files changed, 297 insertions(+), 297 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/FormTemplate/CodeApply.vue b/Source/UBCS-WEB/src/components/FormTemplate/CodeApply.vue
index 6f9190d..38d0fba 100644
--- a/Source/UBCS-WEB/src/components/FormTemplate/CodeApply.vue
+++ b/Source/UBCS-WEB/src/components/FormTemplate/CodeApply.vue
@@ -1,103 +1,103 @@
-<template>
-  <FormTemplate
-    ref="FormTemplate"
-    :selfColumnType="selfColumnType"
-    :selfColumnConfig="selfColumnConfig"
-  ></FormTemplate>
-</template>
-
-<script>
-export default {
-  name: "CodeApply",
-  components: { FormTemplate: () => import('./FormTemplate.vue') },
-  props: {
-  },
-  data() {
-    return {
-      secVOList: [],
-      formItems: [],
-      trendsSpan: 8,
-      selfColumnType: {
-        codefixedsec: "combox",
-        codeclassifysec: "refer",
-        codevariablesec: "text",
-        coderefersec: "refer",
-      },
-      selfColumnConfig: {
-        function: {
-          required: this.isRequired,
-          dicData: this.getOptionList,
-          type: this.getType,
-        },
-        exchange: {
-          text: "name",
-          field: "oid",
-          prop: "oid",
-          showField: "name",
-          parentClassifySecOid: "parentClassifySecOid",
-          label: "name",
-          maxlength: "codeSecLength",
-          data: "fixedValueVOList",
-        },
-        directVoluation: {
-          search: true,
-          props: {
-            label: "id",
-            value: "id",
-          },
-        },
-      },
-    };
-  },
-  created() {
-    this.handleResize();
-  },
-  mounted() {},
-  methods: {
-    getType(item) {
-      return this.selfColumnType[item.sectype];
-    },
-    isRequired(item) {
-      return item.nullableFlag != "true";
-    },
-    getOptionList(item) {
-      if (
-        Array.isArray(item.fixedValueVOList) &&
-        item.fixedValueVOList.length > 0
-      ) {
-        const configAttr = {
-          key: "id",
-          value: "id",
-        };
-        const optionList = item.fixedValueVOList.map((item) => {
-          for (const key in configAttr) {
-            if (Object.hasOwnProperty.call(configAttr, key)) {
-              const element = configAttr[key];
-              item[key] = item[element];
-            }
-          }
-          return item;
-        });
-        return optionList;
-      } else {
-        return [];
-      }
-    },
-    init(columnList) {
-      this.$refs.FormTemplate.templateRender(columnList);
-    },
-    handleResize() {
-      let windowWidth = document.body.clientWidth;
-      this.trendsSpan = 24 / Math.floor(windowWidth / 500);
-    },
-    
-    
-    async validate() {
-      return await this.$refs.FormTemplate.validate();
-    },
-  },
-  watch: {},
-};
-</script>
-
-<style lang="less" scoped></style>
+<template>
+  <FormTemplate
+    ref="FormTemplate"
+    :selfColumnType="selfColumnType"
+    :selfColumnConfig="selfColumnConfig"
+  ></FormTemplate>
+</template>
+
+<script>
+export default {
+  name: "CodeApply",
+  components: { FormTemplate: () => import('./FormTemplate.vue') },
+  props: {
+  },
+  data() {
+    return {
+      secVOList: [],
+      formItems: [],
+      trendsSpan: 8,
+      selfColumnType: {
+        codefixedsec: "combox",
+        codeclassifysec: "refer",
+        codevariablesec: "text",
+        coderefersec: "refer",
+      },
+      selfColumnConfig: {
+        function: {
+          required: this.isRequired,
+          dicData: this.getOptionList,
+          type: this.getType,
+        },
+        exchange: {
+          text: "name",
+          field: "oid",
+          prop: "oid",
+          showField: "name",
+          parentClassifySecOid: "parentClassifySecOid",
+          label: "name",
+          maxlength: "codeSecLength",
+          data: "fixedValueVOList",
+        },
+        directVoluation: {
+          search: true,
+          props: {
+            label: "id",
+            value: "id",
+          },
+        },
+      },
+    };
+  },
+  created() {
+    this.handleResize();
+  },
+  mounted() {},
+  methods: {
+    getType(item) {
+      return this.selfColumnType[item.sectype];
+    },
+    isRequired(item) {
+      return item.nullableFlag != "true";
+    },
+    getOptionList(item) {
+      if (
+        Array.isArray(item.fixedValueVOList) &&
+        item.fixedValueVOList.length > 0
+      ) {
+        const configAttr = {
+          key: "id",
+          value: "id",
+        };
+        const optionList = item.fixedValueVOList.map((item) => {
+          for (const key in configAttr) {
+            if (Object.hasOwnProperty.call(configAttr, key)) {
+              const element = configAttr[key];
+              item[key] = item[element];
+            }
+          }
+          return item;
+        });
+        return optionList;
+      } else {
+        return [];
+      }
+    },
+    init(columnList) {
+      this.$refs.FormTemplate.templateRender(columnList);
+    },
+    handleResize() {
+      let windowWidth = document.body.clientWidth;
+      this.trendsSpan = 24 / Math.floor(windowWidth / 500);
+    },
+
+
+    async validate() {
+      return await this.$refs.FormTemplate.validate();
+    },
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped></style>
diff --git a/Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue b/Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue
index 11fe9d4..d984c90 100644
--- a/Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue
+++ b/Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue
@@ -222,7 +222,7 @@
       this.selectionList.forEach((item,_index) =>{
         if(isMutiValue){
           var valueFieldArray = _that.props.value.split(",");
-          valueFieldArray.forEach((_indexField,_itemField)=>{
+          valueFieldArray.forEach((_itemField,_indexField)=>{
             value.push( item[_itemField] + (_that.referConfig.valueSep?_that.referConfig.valueSep:' '));
           })
         }else {
@@ -230,7 +230,7 @@
         }
         if(isMutiRaw) {
           var rawFieldArray = _that.props.label.split(",");
-          rawFieldArray.forEach((_indexField,_itemField)=>{
+          rawFieldArray.forEach((_itemField,_indexFiel)=>{
             text.push(item[_itemField] + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ;
           })
         }else{
diff --git a/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue b/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue
index cec6ded..575cfbd 100644
--- a/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue
+++ b/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue
@@ -282,7 +282,7 @@
       this.selectionList.forEach((item,_index) =>{
         if(isMutiValue){
           var valueFieldArray = _that.props.value.split(",");
-          valueFieldArray.forEach((_indexField,_itemField)=>{
+          valueFieldArray.forEach((_itemField,_indexFiel)=>{
             value.push( item[_itemField] + (_that.referConfig.valueSep?_that.referConfig.valueSep:' '));
           })
         }else {
@@ -290,7 +290,7 @@
         }
         if(isMutiRaw) {
           var rawFieldArray = _that.props.label.split(",");
-          rawFieldArray.forEach((_indexField,_itemField)=>{
+          rawFieldArray.forEach((_itemField,_indexField)=>{
             text.push(item[_itemField] + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ;
           })
         }else{
diff --git a/Source/UBCS-WEB/src/mixins/codeApply.js b/Source/UBCS-WEB/src/mixins/codeApply.js
index ffe002e..4416eab 100644
--- a/Source/UBCS-WEB/src/mixins/codeApply.js
+++ b/Source/UBCS-WEB/src/mixins/codeApply.js
@@ -1,190 +1,190 @@
-import { getCodeRule } from "@/api/formTemplate.js";
-export default {
-  data() {
-    return {
-      secVOList: [],
-      localSecVOList: [],
-      showCodeApply: false,
-      selfColumnType: {
-        codefixedsec: "combox",
-        codeclassifysec: "refer",
-        codevariablesec: "text",
-        coderefersec: "refer",
-      },
-      selfColumnConfig: {
-        function: {
-          required: this.isRequired,
-          dicData: this.getOptionList,
-          type: this.getType,
-          referConfig: this.getReferConfig,
-          readOnly: this.getDisabled,
-        },
-        exchange: {
-          text: "name",
-          field: "oid",
-          prop: "oid",
-          showField: "name",
-          parentClassifySecOid: "parentClassifySecOid",
-          label: "name",
-          maxlength: "codeSecLength",
-          data: "fixedValueVOList",
-        },
-        directVoluation: {
-          search: true,
-          span: 12,
-          props: {
-            label: "id",
-            value: "id",
-          },
-        },
-      },
-      codeApplyForm: {},
-    }
-  },
-  created() {
-    if (this.type === 'batchImportApply') {
-      this.getCodeRule()
-    }
-  },
-  methods: {
-    // 鑾峰彇鐮佸�肩敵璇锋暟鎹�
-    getCodeRule() {
-      getCodeRule({ codeClassifyOid: this.localCodeClassifyOid || this.codeClassifyOid }).then((res) => {
-        if (res.data && res.data.code === 200) {
-          const typeList = [
-            "codefixedsec",
-            "codeclassifysec",
-            "codevariablesec",
-            "coderefersec",
-          ];
-          this.secVOList = res.data.data.secVOList || []
-          this.localSecVOList = (res.data.data.secVOList || []).filter((item) =>
-            typeList.includes(item.secType)
-          );
-          if (this.localSecVOList.length > 0) {
-            this.showCodeApply = true
-            this.$nextTick(() => {
-              if (this.batchApplyCodeTableData) {
-                this.batchApplyCodeTableData[this.codeRuleOid]["localSecVOList"] = this.localSecVOList
-              }
-              this.$refs.CodeApply.templateRender(this.localSecVOList);
-            });
-          } else {
-            this.showCodeApply = false
-          }
-
-        }
-      });
-    },
-    getCodeApplyFormData(codeApplyForm) {
-      this.codeApplyForm = codeApplyForm;
-      if (this.batchApplyCodeTableData) {
-        this.batchApplyCodeTableData[this.codeRuleOid]["codeApply"] = codeApplyForm
-      }
-    },
-    getType(item) {
-      console.log(item.secType, 'item.secType');
-      return this.selfColumnType[item.secType];
-    },
-    getReferConfig(item) {
-      let params = {};
-      if (item.secType == "codeclassifysec") {
-        params = {
-          isMuti: false,
-          type: "grid",
-          tableConfig: {
-            limit: -1,
-            cols: [
-              {
-                field: "id",
-                title: "鑻辨枃鍚嶇О",
-                sort: true,
-                width: 150,
-              },
-              {
-                field: "name",
-                title: "涓枃鍚嶇О",
-                sort: true,
-                width: 150,
-              },
-              {
-                field: "description",
-                title: "鎻忚堪",
-                width: 250,
-              },
-            ],
-            queryColumns: [
-              {
-                field: "id",
-                title: "鑻辨枃鍚嶇О",
-              },
-              {
-                field: "name",
-                title: "涓枃鍚嶇О",
-              },
-            ],
-          },
-          url: "api/ubcs-code/ubcs-code/mdmEngineController/listCodeClassifyValueBySecOid",
-          extraParams: {
-            classifySecOid: item.oid,
-            parentClassifyValueOid: item.parentClassifySecOid
-              ? this.codeApplyForm[item.parentClassifySecOid]
-              : "",
-          },
-        };
-      } else if (item.secType == "coderefersec") {
-        params = JSON.parse(item.referValueInfo);
-      }
-      return params;
-    },
-    getDisabled(item) {
-      if (item.secType === "codeclassifysec") {
-        if (item.parentClassifySecOid) {
-          if (!this.codeApplyForm[item.parentClassifySecOid]) {
-            return true;
-          } else {
-            return false;
-          }
-        }
-      }
-    },
-    isRequired(item) {
-      return item.nullableFlag != "true";
-    },
-    getOptionList(item) {
-      if (
-        Array.isArray(item.fixedValueVOList) &&
-        item.fixedValueVOList.length > 0
-      ) {
-        const configAttr = {
-          key: "id",
-          value: "id",
-        };
-        const optionList = item.fixedValueVOList.map((item) => {
-          for (const key in configAttr) {
-            if (Object.hasOwnProperty.call(configAttr, key)) {
-              const element = configAttr[key];
-              item[key] = item[element];
-            }
-          }
-          return item;
-        });
-        return optionList;
-      } else {
-        return [];
-      }
-    },
-    // 鍙傜収缁勪欢鏁版嵁鍙樻洿
-    referConfigDataUpdate(data) {
-      const { field } = data;
-      this.localSecVOList = this.localSecVOList.map((item) => {
-        if (item.parentClassifySecOid === field) {
-          this.$refs.CodeApply.form[item.oid] = undefined;
-          this.$refs.CodeApply.form[item.name] = undefined;
-        }
-        return item;
-      });
-      this.$refs.CodeApply.templateRender(this.localSecVOList);
-    },
-  }
-}
\ No newline at end of file
+import { getCodeRule } from "@/api/formTemplate.js";
+export default {
+  data() {
+    return {
+      secVOList: [],
+      localSecVOList: [],
+      showCodeApply: false,
+      selfColumnType: {
+        codefixedsec: "combox",
+        codeclassifysec: "refer",
+        codevariablesec: "text",
+        coderefersec: "refer",
+      },
+      selfColumnConfig: {
+        function: {
+          required: this.isRequired,
+          dicData: this.getOptionList,
+          type: this.getType,
+          referConfig: this.getReferConfig,
+          readOnly: this.getDisabled,
+        },
+        exchange: {
+          text: "name",
+          field: "oid",
+          prop: "oid",
+          showField: "name",
+          parentClassifySecOid: "parentClassifySecOid",
+          label: "name",
+          maxlength: "codeSecLength",
+          data: "fixedValueVOList",
+        },
+        directVoluation: {
+          search: true,
+          span: 12,
+          props: {
+            label: "id",
+            value: "id",
+          },
+        },
+      },
+      codeApplyForm: {},
+    }
+  },
+  created() {
+    if (this.type === 'batchImportApply') {
+      this.getCodeRule()
+    }
+  },
+  methods: {
+    // 鑾峰彇鐮佸�肩敵璇锋暟鎹�
+    getCodeRule() {
+      getCodeRule({ codeClassifyOid: this.localCodeClassifyOid || this.codeClassifyOid }).then((res) => {
+        if (res.data && res.data.code === 200) {
+          const typeList = [
+            "codefixedsec",
+            "codeclassifysec",
+            "codevariablesec",
+            "coderefersec",
+          ];
+          this.secVOList = res.data.data.secVOList || []
+          this.localSecVOList = (res.data.data.secVOList || []).filter((item) =>
+            typeList.includes(item.secType)
+          );
+          if (this.localSecVOList.length > 0) {
+            this.showCodeApply = true
+            this.$nextTick(() => {
+              if (this.batchApplyCodeTableData) {
+                this.batchApplyCodeTableData[this.codeRuleOid]["localSecVOList"] = this.localSecVOList
+              }
+              this.$refs.CodeApply.templateRender(this.localSecVOList);
+            });
+          } else {
+            this.showCodeApply = false
+          }
+
+        }
+      });
+    },
+    getCodeApplyFormData(codeApplyForm) {
+      this.codeApplyForm = codeApplyForm;
+      if (this.batchApplyCodeTableData) {
+        this.batchApplyCodeTableData[this.codeRuleOid]["codeApply"] = codeApplyForm
+      }
+    },
+    getType(item) {
+      console.log(item.secType, 'item.secType');
+      return this.selfColumnType[item.secType];
+    },
+    getReferConfig(item) {
+      let params = {};
+      if (item.secType == "codeclassifysec") {
+        params = {
+          isMuti: false,
+          type: "grid",
+          tableConfig: {
+            limit: -1,
+            cols: [
+              {
+                field: "id",
+                title: "鑻辨枃鍚嶇О",
+                sort: true,
+                width: 150,
+              },
+              {
+                field: "name",
+                title: "涓枃鍚嶇О",
+                sort: true,
+                width: 150,
+              },
+              {
+                field: "description",
+                title: "鎻忚堪",
+                width: 250,
+              },
+            ],
+            queryColumns: [
+              {
+                field: "id",
+                title: "鑻辨枃鍚嶇О",
+              },
+              {
+                field: "name",
+                title: "涓枃鍚嶇О",
+              },
+            ],
+          },
+          url: "api/ubcs-code/ubcs-code/mdmEngineController/listCodeClassifyValueBySecOid",
+          extraParams: {
+            classifySecOid: item.oid,
+            parentClassifyValueOid: item.parentClassifySecOid
+              ? this.codeApplyForm[item.parentClassifySecOid]
+              : "",
+          },
+        };
+      } else if (item.secType == "coderefersec") {
+        params = JSON.parse(item.referValueInfo);
+      }
+      return params;
+    },
+    getDisabled(item) {
+      if (item.secType === "codeclassifysec") {
+        if (item.parentClassifySecOid) {
+          if (!this.codeApplyForm[item.parentClassifySecOid]) {
+            return true;
+          } else {
+            return false;
+          }
+        }
+      }
+    },
+    isRequired(item) {
+      return item.nullableFlag != "true";
+    },
+    getOptionList(item) {
+      if (
+        Array.isArray(item.fixedValueVOList) &&
+        item.fixedValueVOList.length > 0
+      ) {
+        const configAttr = {
+          key: "id",
+          value: "id",
+        };
+        const optionList = item.fixedValueVOList.map((item) => {
+          for (const key in configAttr) {
+            if (Object.hasOwnProperty.call(configAttr, key)) {
+              const element = configAttr[key];
+              item[key] = item[element];
+            }
+          }
+          return item;
+        });
+        return optionList;
+      } else {
+        return [];
+      }
+    },
+    // 鍙傜収缁勪欢鏁版嵁鍙樻洿
+    referConfigDataUpdate(data) {
+      const { field } = data;
+      this.localSecVOList = this.localSecVOList.map((item) => {
+        if (item.parentClassifySecOid === field) {
+          this.$refs.CodeApply.form[item.oid] = undefined;
+          this.$refs.CodeApply.form[item.name] = undefined;
+        }
+        return item;
+      });
+      this.$refs.CodeApply.templateRender(this.localSecVOList);
+    },
+  }
+}

--
Gitblit v1.9.3