fjl
fujunling
2023-06-21 2d0fdaca6f7637c68782ae53ed2c3feee4f48db7
Source/UBCS-WEB/src/components/FormTemplate/index.vue
@@ -29,7 +29,7 @@
      "
    >
      <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
        <el-tab-pane label="码值申请" name="codeApply">
        <el-tab-pane label="码值申请" name="codeApply" v-if="showCodeApply">
          <FormTempalte
            v-bind="$attrs"
            :type="type"
@@ -57,18 +57,25 @@
        </el-tab-pane>
      </el-tabs>
    </div>
    <div class="avue-dialog__footer" v-if="type !== 'detail'">
      <el-button @click="close()">取 消</el-button>
      <el-button @click="submit()" type="primary" :loading="submitBtnLoading">{{
        submitText
      }}</el-button>
      <el-button
        @click="resembleQuerySubmit"
        type="primary"
        v-if="showResembleQuery"
        >相似像查询</el-button
      >
    </div>
    <template #footer>
      <div class="" v-if="type !== 'detail'">
        <el-button @click="close()" size="small">取 消</el-button>
        <el-button
          @click="submit()"
          type="primary"
          :loading="submitBtnLoading"
          size="small"
          >{{ submitText }}</el-button
        >
        <el-button
          @click="resembleQuerySubmit"
          type="primary"
          size="small"
          v-if="showResembleQuery"
          >相似像查询</el-button
        >
      </div>
    </template>
  </el-dialog>
</template>
@@ -236,6 +243,7 @@
    // 获取码值申请数据
    getCodeRule() {
      getCodeRule({ codeClassifyOid: this.codeClassifyOid }).then((res) => {
        console.log(res, "resresresresres");
        if (res.data && res.data.code === 200) {
          const typeList = [
            "codefixedsec",
@@ -244,8 +252,9 @@
            "coderefersec",
          ];
          this.secVOList = (res.data.data.secVOList || []).filter((item) =>
            typeList.includes(item)
            typeList.includes(item.secType)
          );
          console.log(this.secVOList, "this.secVOListthis.secVOList");
          this.$nextTick(() => {
            if (this.secVOList.length > 0 && this.type === "add") {
              this.showCodeApply = true;
@@ -301,19 +310,21 @@
        this.form
      );
      if (resembleQueryList.length === 0) {
        let resForm = {}
        const { defaultValue, formValue } = this.getDefaultValueAndFormValues(this.form)
        resForm.data = formValue
        resForm = Object.assign({}, resForm, defaultValue)
        resForm.secDTOList = []
        let resForm = {};
        const { defaultValue, formValue } = this.getDefaultValueAndFormValues(
          this.form
        );
        resForm.data = formValue;
        resForm = Object.assign({}, resForm, defaultValue);
        resForm.secDTOList = [];
        for (const key in this.codeApplyForm) {
        if (Object.hasOwnProperty.call(this.codeApplyForm, key)) {
          const value = this.codeApplyForm[key];
          if (value) {
            resForm.secDTOList.push({[key]: value})
          if (Object.hasOwnProperty.call(this.codeApplyForm, key)) {
            const value = this.codeApplyForm[key];
            if (value) {
              resForm.secDTOList.push({ [key]: value });
            }
          }
        }
      }
        this.$emit("submit", resForm);
      } else {
        this.$confirm(