田源
2023-12-08 87ba3b8de4f19bada035d81daff9c723d2131083
Source/UBCS-WEB/src/components/FormTemplate/index.vue
@@ -17,6 +17,7 @@
      :TreeValue="TreeValue"
      :eventList="eventList"
      :rowOid="rowOid"
      :selectRow="selectRow"
      :status="status"
      :templateOid="templateOid"
      :type="type"
@@ -38,8 +39,10 @@
        <el-tab-pane v-if="showCodeApply" label="码值申请" name="codeApply">
          <FormTemplate
            key="codeApplyForm" ref="CodeApply"
            :selectRow="selectRow"
            :selfColumnConfig="selfColumnConfig"
            :selfColumnType="selfColumnType"
            :status="status"
            :type="type"
            data-key="codeApplyForm"
            secDTOListv-bind="$attrs"
@@ -139,6 +142,10 @@
      type: Object,
      default: () => ({}),
    },
    selectRow: {
      type: Array,
      default: []
    }
  },
  data() {
    return {
@@ -241,18 +248,12 @@
      },
    },
  },
  watch: {
    codeApplyForm: {
      handler(newval, oldval) {
        // console.log('newval',newval)
      }
    }
  },
  watch: {},
  methods: {
    openDialog() {
      //新增和修改共同调用(有改动 不需要在使用edit,方法没什么影响)
      this.getFormTemplate();
      if (this.type === "add" || (this.type !== "add" && this.status === "amend")) {
      if (this.type === "add") {
        this.getCodeRule();
        return;
      }
@@ -323,7 +324,7 @@
          that.secVOList = (res.data.data.secVOList || []).filter((item) =>
            typeList.includes(item.secType)
          );
          if (that.secVOList.length > 0 && that.type === "add" ||(that.type !== "add" &&  that.status === "amend")) {
          if (that.secVOList.length > 0 && that.type === "add" || (that.type !== "add" && that.status === "amend")) {
            that.showCodeApply = true;
            that.activeName = "codeApply";
@@ -358,7 +359,7 @@
        }
      })
      if (this.$refs.CodeApply) { // 添加一个判断语句,检查对象是否为undefined
        this.$refs.CodeApply.changeChildItem(this.secVOList, this.TreeValue, this.type);
        this.$refs.CodeApply.changeStatusItem(this.secVOList, this.TreeValue, this.type);
      }
    },
    //年代号
@@ -374,7 +375,7 @@
      });
      if (this.$refs.CodeApply) {
        this.$refs.CodeApply.changeChildItem(this.secVOList, this.TreeValue, this.type);
        this.$refs.CodeApply.changeStatusItem(this.secVOList, this.TreeValue, this.type);
      }
    },
    //属性码段赋值
@@ -413,7 +414,7 @@
      }
    },
    async submit() {
      if(this.status){
      if (this.status) {
        // 进行表单校验
        const formValidate = await this.$refs.FormTemplate.validate();
        if (!formValidate) return;
@@ -492,7 +493,7 @@
        resForm.codeRuleOid = this.codeRuleOid;
        resForm.templateOid = this.templateOid;
        this.$emit("submit", resForm);
      }else {
      } else {
        // 进行表单校验
        const formValidate = await this.$refs.FormTemplate.validate();
        if (!formValidate) return;