fujunling
2023-06-06 f8fe13b6f7d8ad1ae53e7bf6a6cf83f584d52a4d
动态表单组件重构
已修改6个文件
687 ■■■■ 文件已修改
Source/UBCS-WEB/src/components/FormTemplate/CodeApply.vue 425 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/ResembleQuery.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/index.vue 207 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/vue.config.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/CodeApply.vue
@@ -3,24 +3,14 @@
    ref="FormTempalte"
    :selfColumnType="selfColumnType"
    :selfColumnConfig="selfColumnConfig"
    :columnList="columnList"
  ></FormTempalte>
</template>
<script>
import { getCodeRule } from "@/api/formTemplate.js";
export default {
  name: "CodeApply",
  components: { FormTempalte: () => import('./FormTempalte.vue') },
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    codeClassifyOid: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
@@ -57,406 +47,6 @@
          },
        },
      },
      columnList: [
        {
          btmname: "codebasicsec",
          checkInBy: "",
          checkInTime: null,
          checkOutBy: "",
          checkOutTime: null,
          codeDateFormatStr: "",
          codeFillFlag: "",
          codeFillLength: "",
          codeFillLimit: 0,
          codeFillSeparator: "",
          codeFillType: "",
          codeFillTypeText: "",
          codeGetValueType: "",
          codeGetValueTypeText: "",
          codeLevelType: "",
          codeLevelTypeText: "",
          codeLevelValue: 0,
          codeSecLength: "10",
          codeSecLengthType: "code_sec_length_variable",
          codeSecLengthTypeText: "",
          componentCodeFlag: "false",
          copyFromVersion: "",
          createTime: "2023-06-02 10:23:33.000",
          creator: "1",
          customCodeSerialClass: "",
          data: null,
          description: "",
          displayFlag: "false",
          filterSql: "",
          firstR: "1",
          firstV: "1",
          fixedValueVOList: [
            {
              btmname: "codefixedvalue",
              checkInBy: "",
              checkInTime: null,
              checkOutBy: "",
              checkOutTime: null,
              codefixedsecoid: "5591ED23-D218-8B84-9789-1E5EB21A49B9",
              codefixedsecoidName: null,
              copyFromVersion: "",
              createTime: "2023-06-02 10:47:45.000",
              creator: "1",
              data: null,
              description: "",
              firstR: "1",
              firstV: "1",
              id: "002",
              lastModifier: "1",
              lastModifyTime: "2023-06-02 10:47:45.000",
              lastR: "1",
              lastV: "1",
              lcStatus: "Exist",
              lcStatusText: "存在",
              lctid: "defaultLC",
              name: "",
              nameOid: "B8BB82F0-9B9E-3E7C-4324-62F13A64B369",
              oid: "375AE030-DCB2-B116-1C71-DA1AB971E249",
              ordernum: 0,
              owner: "1",
              revisionOid: "9BF1CABA-EB6D-0B80-0938-D4DC779D5AF0",
              revisionRule: "",
              revisionSeq: 1,
              revisionValue: "",
              secretGrade: null,
              secretGradeText: "",
              ts: "2023-06-02 10:47:45.635",
              versionRule: "0",
              versionSeq: 1,
              versionValue: "1",
            },
            {
              btmname: "codefixedvalue",
              checkInBy: "",
              checkInTime: null,
              checkOutBy: "",
              checkOutTime: null,
              codefixedsecoid: "5591ED23-D218-8B84-9789-1E5EB21A49B9",
              codefixedsecoidName: null,
              copyFromVersion: "",
              createTime: "2023-06-02 10:47:42.000",
              creator: "1",
              data: null,
              description: "",
              firstR: "1",
              firstV: "1",
              id: "001",
              lastModifier: "1",
              lastModifyTime: "2023-06-02 10:47:42.000",
              lastR: "1",
              lastV: "1",
              lcStatus: "Exist",
              lcStatusText: "存在",
              lctid: "defaultLC",
              name: "",
              nameOid: "804FA254-1158-C355-9CE2-7CA444955AFC",
              oid: "821F6250-C763-FB0E-92F5-A9C07F1B951C",
              ordernum: 0,
              owner: "1",
              revisionOid: "6CF50C9D-2606-948A-03B1-26158627CE33",
              revisionRule: "",
              revisionSeq: 1,
              revisionValue: "",
              secretGrade: null,
              secretGradeText: "",
              ts: "2023-06-02 10:47:42.527",
              versionRule: "0",
              versionSeq: 1,
              versionValue: "1",
            },
          ],
          getValueClass: "",
          id: "0001",
          lastModifier: "1",
          lastModifyTime: "2023-06-02 10:23:33.000",
          lastR: "1",
          lastV: "1",
          lcStatus: "Exist",
          lcStatusText: "存在",
          lctid: "defaultLC",
          matchClassifyValueFlag: "",
          name: "固定码段",
          nameOid: "C01CA64B-8358-D3A7-D38D-9DE7A5D748C8",
          nullableFlag: "false",
          oid: "5591ED23-D218-8B84-9789-1E5EB21A49B9",
          orderNum: 1,
          owner: "1",
          parentClassifySecOid: "",
          parentClassifySecText: "",
          pkCodeRule: "B95872A6-9CEA-D490-8F1B-9D26548CAF96",
          referAttributeId: "",
          referAttributeName: "",
          referBtmId: "",
          referBtmName: "",
          referCodeClassifyOid: "",
          referCodeClassifyOidName: "",
          referConfig: "",
          referValueInfo: "",
          revisionOid: "EE7A9BC0-FEF3-061B-A750-132121D86D83",
          revisionRule: "",
          revisionSeq: 1,
          revisionValue: "",
          secretGrade: null,
          secretGradeText: "",
          sectype: "codefixedsec",
          sectypeText: "固定码段",
          serialDependFlag: "false",
          serialDependOrder: 0,
          serialStart: "",
          serialStep: 0,
          ts: "2023-06-02 10:23:33.733",
          valueCutLength: 0,
          valueCutType: "code_cut_none",
          valueCutTypeText: "不截取",
          versionRule: "0",
          versionSeq: 1,
          versionValue: "1",
        },
        {
          btmname: "codebasicsec",
          checkInBy: "",
          checkInTime: null,
          checkOutBy: "",
          checkOutTime: null,
          codeDateFormatStr: "",
          codeFillFlag: "",
          codeFillLength: "",
          codeFillLimit: 0,
          codeFillSeparator: "0",
          codeFillType: "code_fill_right",
          codeFillTypeText: "",
          codeGetValueType: "",
          codeGetValueTypeText: "",
          codeLevelType: "",
          codeLevelTypeText: "",
          codeLevelValue: 0,
          codeSecLength: "10",
          codeSecLengthType: "",
          codeSecLengthTypeText: "",
          componentCodeFlag: "false",
          copyFromVersion: "",
          createTime: "2023-06-02 10:24:07.000",
          creator: "1",
          customCodeSerialClass: "",
          data: null,
          description: "可变码段",
          displayFlag: "false",
          filterSql: "",
          firstR: "1",
          firstV: "1",
          fixedValueVOList: null,
          getValueClass: "",
          id: "0002",
          lastModifier: "1",
          lastModifyTime: "2023-06-02 10:24:07.000",
          lastR: "1",
          lastV: "1",
          lcStatus: "Exist",
          lcStatusText: "存在",
          lctid: "defaultLC",
          matchClassifyValueFlag: "",
          name: "可变码段",
          nameOid: "02AED8DD-C40D-7E00-C88A-3DB65A3027A4",
          nullableFlag: "false",
          oid: "A4508759-4213-2F07-04ED-A8C224303F44",
          orderNum: 2,
          owner: "1",
          parentClassifySecOid: "",
          parentClassifySecText: "",
          pkCodeRule: "B95872A6-9CEA-D490-8F1B-9D26548CAF96",
          referAttributeId: "",
          referAttributeName: "",
          referBtmId: "",
          referBtmName: "",
          referCodeClassifyOid: "",
          referCodeClassifyOidName: "",
          referConfig: "",
          referValueInfo: "",
          revisionOid: "E4C77B6E-13AE-55EB-4147-64B4526BFEE4",
          revisionRule: "",
          revisionSeq: 1,
          revisionValue: "",
          secretGrade: null,
          secretGradeText: "",
          sectype: "codevariablesec",
          sectypeText: "可变码段",
          serialDependFlag: "false",
          serialDependOrder: 0,
          serialStart: "",
          serialStep: 0,
          ts: "2023-06-02 10:24:07.804",
          valueCutLength: 0,
          valueCutType: "",
          valueCutTypeText: "",
          versionRule: "0",
          versionSeq: 1,
          versionValue: "1",
        },
        {
          btmname: "codebasicsec",
          checkInBy: "",
          checkInTime: null,
          checkOutBy: "",
          checkOutTime: null,
          codeDateFormatStr: "",
          codeFillFlag: "",
          codeFillLength: "",
          codeFillLimit: 0,
          codeFillSeparator: "",
          codeFillType: "",
          codeFillTypeText: "",
          codeGetValueType: "",
          codeGetValueTypeText: "",
          codeLevelType: "",
          codeLevelTypeText: "",
          codeLevelValue: 0,
          codeSecLength: "10",
          codeSecLengthType: "code_sec_length_static",
          codeSecLengthTypeText: "",
          componentCodeFlag: "false",
          copyFromVersion: "",
          createTime: "2023-06-02 10:25:07.000",
          creator: "1",
          customCodeSerialClass: "",
          data: null,
          description: "分类码段子",
          displayFlag: "false",
          filterSql: "",
          firstR: "1",
          firstV: "1",
          fixedValueVOList: [
            {
              btmname: "codefixedvalue",
              checkInBy: "",
              checkInTime: null,
              checkOutBy: "",
              checkOutTime: null,
              codefixedsecoid: "8FD660BF-BA04-AB4F-8076-B5C43845621B",
              codefixedsecoidName: null,
              copyFromVersion: "",
              createTime: "2023-06-02 10:43:44.000",
              creator: "1",
              data: null,
              description: "",
              firstR: "1",
              firstV: "1",
              id: "000101",
              lastModifier: "1",
              lastModifyTime: "2023-06-02 10:43:44.000",
              lastR: "1",
              lastV: "1",
              lcStatus: "Exist",
              lcStatusText: "存在",
              lctid: "defaultLC",
              name: "",
              nameOid: "D135277F-E638-EB02-CEF1-AD99B889CA94",
              oid: "F7FEFFB7-0832-8CAF-2965-50757D01B878",
              ordernum: 0,
              owner: "1",
              revisionOid: "AF362124-06FD-F209-442F-8A13842CEB40",
              revisionRule: "",
              revisionSeq: 1,
              revisionValue: "",
              secretGrade: null,
              secretGradeText: "",
              ts: "2023-06-02 10:43:44.838",
              versionRule: "0",
              versionSeq: 1,
              versionValue: "1",
            },
            {
              btmname: "codefixedvalue",
              checkInBy: "",
              checkInTime: null,
              checkOutBy: "",
              checkOutTime: null,
              codefixedsecoid: "8FD660BF-BA04-AB4F-8076-B5C43845621B",
              codefixedsecoidName: null,
              copyFromVersion: "",
              createTime: "2023-06-02 10:43:49.000",
              creator: "1",
              data: null,
              description: "",
              firstR: "1",
              firstV: "1",
              id: "000102",
              lastModifier: "1",
              lastModifyTime: "2023-06-02 10:43:49.000",
              lastR: "1",
              lastV: "1",
              lcStatus: "Exist",
              lcStatusText: "存在",
              lctid: "defaultLC",
              name: "",
              nameOid: "4F0F0F48-6146-5E62-7E4C-C1ED5E7D788C",
              oid: "F11E47E7-1360-5914-BA03-B6844E37AFB4",
              ordernum: 0,
              owner: "1",
              revisionOid: "B4797510-7232-B6FF-077D-918F9B36D3C3",
              revisionRule: "",
              revisionSeq: 1,
              revisionValue: "",
              secretGrade: null,
              secretGradeText: "",
              ts: "2023-06-02 10:43:49.254",
              versionRule: "0",
              versionSeq: 1,
              versionValue: "1",
            },
          ],
          getValueClass: "",
          id: "00031",
          lastModifier: "1",
          lastModifyTime: "2023-06-02 10:25:07.000",
          lastR: "1",
          lastV: "1",
          lcStatus: "Exist",
          lcStatusText: "存在",
          lctid: "defaultLC",
          matchClassifyValueFlag: "",
          name: "分类码段子",
          nameOid: "69BEE3EC-F560-1C41-F56B-107F5B43C051",
          nullableFlag: "false",
          oid: "8FD660BF-BA04-AB4F-8076-B5C43845621B",
          orderNum: 4,
          owner: "1",
          parentClassifySecOid: "",
          parentClassifySecText: "",
          pkCodeRule: "B95872A6-9CEA-D490-8F1B-9D26548CAF96",
          referAttributeId: "",
          referAttributeName: "",
          referBtmId: "",
          referBtmName: "",
          referCodeClassifyOid: "",
          referCodeClassifyOidName: "",
          referConfig: "",
          referValueInfo: "",
          revisionOid: "EA98821E-60A0-1D18-4F70-96B0E0740B44",
          revisionRule: "",
          revisionSeq: 1,
          revisionValue: "",
          secretGrade: null,
          secretGradeText: "",
          sectype: "codefixedsec",
          sectypeText: "固定码段",
          serialDependFlag: "false",
          serialDependOrder: 0,
          serialStart: "",
          serialStep: 0,
          ts: "2023-06-02 10:25:07.764",
          valueCutLength: 0,
          valueCutType: "code_cut_none",
          valueCutTypeText: "不截取",
          versionRule: "0",
          versionSeq: 1,
          versionValue: "1",
        },
      ],
    };
  },
  created() {
@@ -467,19 +57,8 @@
    getType(item) {
      return this.selfColumnType[item.sectype];
    },
    getCodeRule() {
      getCodeRule({ codeClassifyOid: this.codeClassifyOid }).then((res) => {
        if (res.data && res.data.code === 200) {
          // this.defaultValue = res.data.data;
          // this.columnList = res.data.data.secVOList || [];
          // this.codeRuleOid = res.data.data.oid;
          this.$nextTick(() => {
            // 测试数据展示
            // this.$refs.FormTempalte.init(res.data.data.secVOList);
            this.$refs.FormTempalte.init(this.columnList);
          });
        }
      });
    init(columnList) {
      this.$refs.FormTempalte.templateRender(columnList);
    },
    handleResize() {
      let windowWidth = document.body.clientWidth;
Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue
@@ -24,11 +24,11 @@
        </span>
      </template>
      <template :slot="item.prop + ''" v-for="item in slotColumnList">
        <vciWebRefer
        <!-- <vciWebRefer
          v-if="item.type == 'refer'"
          :value="item.value"
          :options="item.referConfig || {}"
        ></vciWebRefer>
        ></vciWebRefer> -->
      </template>
    </avue-form>
  </div>
@@ -513,10 +513,8 @@
      })
        .then((res) => {
          if (res.status === 200) {
            this.templateRender(this.testItems);
            // 测试数据展示
            // this.templateRender(res.data.formDefineVO.items);
            this.$emit("getFormTemplateEnd", res.data);
            this.$emit('getFormTemplateEnd', res.data)
            this.templateRender(res.data.formDefineVO.items);
          }
        })
        .catch((err) => {
@@ -583,9 +581,6 @@
          maxlength: formItem.maxlength,
          filterable: true,
          referConfig: formItem.referConfig,
          change: () => {
            this.changeFun(formItem.displayExtension, formItem.prop);
          },
          span: formItem.type === "textarea" ? 24 : this.trendsSpan,
          rules: [
            {
@@ -618,8 +613,7 @@
      this.formIndex++;
      this.loading = false;
      this.geDictData(dictKeys);
      // 测试数据展示
      // this.getFormDetail();
      this.getFormDetail();
    },
    // 使用传入的表单数据配置
    resetFormConfig(formItem) {
@@ -665,11 +659,6 @@
      if ((type === "text" && !isIcon) || (type === "icon" && isIcon)) {
        return val;
      }
    },
    changeFun(displayExtension, prop) {
      // executeCode({displayExtension, data: this.form}).then(res => {
      //   this.form[prop] = res.data.data
      // })
    },
    // 获取swich和已拿到的下拉数据
    getDataList(type, dicData) {
@@ -725,9 +714,11 @@
    },
    // 获取表单详情数据
    getFormDetail() {
      if (this.type === 'add') return
      if (this.type === "add") return;
      getFormDetail({ templateOid: this.templateOid, oid: this.rowOid }).then(
        (res) => {
          this.form = Object.assign(this.form, res.obj)
          console.log(res, "res");
        }
      );
Source/UBCS-WEB/src/components/FormTemplate/ResembleQuery.vue
@@ -38,6 +38,7 @@
      :visible.sync="formTemplateVisible"
      :templateOid="this.resembleTemplateOid"
      :rowOid="rowOid"
      title="查看详细信息"
      :codeClassifyOid="this.resembleCodeClassifyOid"
    ></FormTemplateDialog>
  </div>
@@ -79,9 +80,7 @@
    return {
      formTemplateVisible: false,
      activeName: "findlike",
      tableData: [
        {id: '*****', materialclassifyText: '001', tuhao: 'tuhao', iod: '123123131312'}
      ],
      tableData: [],
      loading: false,
      resembleTemplateOid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
      resembleCodeClassifyOid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
@@ -125,7 +124,7 @@
  },
  methods: {
    // 相似项查询
    resembleQuery(form) {
    async resembleQuery(form) {
      this.loading = true;
      this.activeName = "findlike";
      const { defaultValue, formValue } =
@@ -137,17 +136,14 @@
        data: formValue,
      };
      params = Object.assign(params, defaultValue);
      findLike(params).then((res) => {
        this.loading = false;
        // this.tableData = res.data.data || [];
      });
      this.tableData = (await findLike(params)).data.data || []
      this.loading = false
      return this.tableData
    },
    openFormTemlpate(row) {
      this.$forceUpdate()
      console.log(row, 'row.oid');
      this.codetemplateoid = row.codetemplateoid;
      this.rowOid = row.oid
      this.rowOid = row.iod
      this.formTemplateVisible = true;
    },
    getDefaultValueAndFormValues(form) {
Source/UBCS-WEB/src/components/FormTemplate/index.vue
@@ -14,9 +14,7 @@
      :visible="visible"
      :type="type"
      :rowOid="rowOid"
      v-if="dialogVisible"
      ref="FormTempalte"
      @getFormTemplateEnd="getFormTemplate"
      @getFormData="getFormData"
    ></FormTempalte>
@@ -30,11 +28,14 @@
    >
      <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
        <el-tab-pane label="码值申请" name="codeApply" v-if="showCodeApply">
          <CodeApply
            ref="CodeApply"
          <FormTempalte
            v-bind="$attrs"
            @getCodeRuleOid="getCodeRuleOid"
          ></CodeApply>
            :type="type"
            :selfColumnType="selfColumnType"
            :selfColumnConfig="selfColumnConfig"
            ref="CodeApply"
            @getFormData="getFormData"
          ></FormTempalte>
        </el-tab-pane>
        <el-tab-pane
          label="相似项查询"
@@ -46,7 +47,9 @@
            ref="resembleQueryRef"
            :hasResemble="this.hasResemble"
            :column="this.resembleTableColumn"
            :codeClassifyOid="codeClassifyOid"
            :form="this.form"
            :templateOid="templateOid"
          ></ResembleQuery>
        </el-tab-pane>
      </el-tabs>
@@ -67,12 +70,12 @@
</template>
<script>
import { getCodeRule, getFormTemplate } from "@/api/formTemplate.js";
import FormTempalte from "./FormTempalte";
import ResembleQuery from "./ResembleQuery";
import CodeApply from "./CodeApply";
export default {
  name: "FormTemplateDialog",
  components: { ResembleQuery, FormTempalte, CodeApply },
  components: { ResembleQuery, FormTempalte },
  props: {
    visible: {
      type: Boolean,
@@ -90,7 +93,15 @@
      type: String,
      default: "80%",
    },
    rowOid: ''
    rowOid: "",
    codeClassifyOid: {
      type: String,
      default: "",
    },
    templateOid: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
@@ -100,7 +111,39 @@
      resembleTableColumn: [],
      secVOList: [],
      form: {},
      activeName: "",
      activeName: "codeApply",
      showCodeApply: true,
      showResembleQuery: true,
      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() {},
@@ -113,65 +156,137 @@
        this.$emit("update:visible", val);
      },
    },
    showCodeApply() {
      // 测试数据展示
      // if (this.type === "add") {
      //   if (this.hasResemble && this.secVOList.length === 0) {
      //     return false;
      //   }
      // } else {
      //   return false;
      // }
      return true;
    },
    showResembleQuery() {
      return this.hasResemble;
    },
  },
  methods: {
    openDialog() {
      this.$nextTick(() => {
        this.$refs.FormTempalte.init();
        this.$refs.CodeApply.getCodeRule();
      });
      this.getFormTemplate();
      this.getCodeRule();
    },
    close() {
      this.dialogVisible = false;
    },
    getCodeRuleOid(data) {
      this.secVOList = data.secVOList;
    // 接口获取表单数据
    getFormTemplate() {
      getFormTemplate({
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
      })
        .then((res) => {
          if (res.status === 200) {
            this.hasResemble =
              res.data.resembleTableVO &&
              res.data.resembleTableVO.cols &&
              res.data.resembleTableVO.cols.length > 0;
            this.resembleTableColumn = res.data.resembleTableVO.cols || [];
            if (this.hasResemble) {
              this.activeName = 'resembleQuery'
              this.showResembleQuery = true
            }
            this.$refs.FormTempalte.templateRender(res.data.formDefineVO.items);
          }
        })
        .catch((err) => {
          this.loading = false;
          console.log(err);
        });
    },
    getFormTemplate(data) {
      this.hasResemble =
        data.resembleTableVO &&
        data.resembleTableVO.cols &&
        data.resembleTableVO.cols.length > 0;
      this.resembleTableColumn = data.resembleTableVO.cols || [];
      this.activeName =
        (this.showCodeApply && "codeApply") ||
        (this.showResembleQuery && "resembleQuery");
    // 获取码值申请数据
    getCodeRule() {
      getCodeRule({ codeClassifyOid: this.codeClassifyOid }).then((res) => {
        if (res.data && res.data.code === 200) {
          const typeList = [
            "codefixedsec",
            "codeclassifysec",
            "codevariablesec",
            "coderefersec",
          ];
          this.secVOList = (res.data.data.secVOList || []).filter((item) =>
            typeList.includes(item)
          );
          this.$nextTick(() => {
            if (this.secVOList.length > 0 && this.type === 'add') {
              this.showCodeApply = true
              this.activeName = 'codeApply'
              this.$refs.CodeApply.templateRender(this.secVOList);
            } else {
              this.showCodeApply = false
            }
          });
        }
      });
    },
    getFormData(form) {
      this.form = form;
    },
    resembleQuerySubmit() {
      this.activeName = "resembleQuery";
      this.$refs.resembleQueryRef.resembleQuery(this.form);
    },
    handleClick() {
      if (this.activeName === 'resembleQuery') {
        this.resembleQuerySubmit()
      if (this.activeName === "resembleQuery") {
        this.resembleQuerySubmit();
      }
    },
    async submit() {
      // 进行表单校验
      const formValidate = await this.$refs.FormTempalte.validate();
      if (!formValidate) return;
      let codeValidate = true;
      // 进行码值申请校验
      if (this.showCodeApply) {
        codeValidate = await this.$refs.CodeApply.validate();
        codeValidate = await this.$refs.codeApply.validate();
        if (!codeValidate) return;
      }
      this.$emit("submit", {
        form: this.form,
        flag: formValidate && codeValidate,
      });
      // 进行相似项查询
      const resembleQueryList = await this.$refs.resembleQueryRef.resembleQuery(
        this.form
      );
      if (resembleQueryList.length === 0) {
        this.$emit("submit", this.form);
      } else {
        this.$confirm(
          `该物料已有${resembleQueryList.length}条相似数据,是否继续保存?`,
          "需要您确认",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }
        )
          .then(() => {
            this.$emit("submit", this.form);
          })
          .catch(() => {});
      }
    },
    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 [];
      }
    },
  },
};
Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue
@@ -32,7 +32,7 @@
      visible: false,
      visible1: false,
      // 默认禁用的表元素
      disabledProp: ["id"],
      disabledProp: ["id", 'lcstatus'],
      // 表单类型
      type: "add",
      templateOid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
Source/UBCS-WEB/vue.config.js
@@ -26,19 +26,11 @@
    proxy: {
      '/api': {
        //本地服务接口地址
<<<<<<< HEAD
        //  target: 'http://localhost:37000',
        // target: 'http://192.168.1.63:37000',
        //target: 'http://192.168.3.7:37000',
        target: 'http://dev.vci-tech.com:37000',
        // target: 'http://192.168.1.51:37000/',
=======
          target: 'http://localhost:37000',
        // target: 'http://192.168.1.63:37000',
        //target: 'http://192.168.3.7:37000',
        //target: 'http://dev.vci-tech.com:37000',
        //target: 'http://192.168.1.51:37000/',
>>>>>>> 9474fadca23df051af1789b2078aca9c3163a017
        // target: 'http://dev.vci-tech.com:37000',
        target: 'http://192.168.1.51:37000/',
        //远程演示服务地址,可用于直接启动项目
        // target: 'https://saber.bladex.vip/api',
        ws: true,