jinlin
2024-07-15 8bf8713da9f9ebf844af7ceefd462c2966070128
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue
@@ -1,7 +1,7 @@
<template>
  <zt-dialog ref="dialog" @confirm="formSubmit">
    <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px">
      <zt-form-item label="上级系统" prop="pid" v-if="isTree">
      <zt-form-item label="上级系统" prop="pid" v-if="isShow">
        <zt-combo-tree v-model="dataForm.pid" :datas="productList"/>
      </zt-form-item>
      <zt-form-item label="名称" prop="name" rules="required">
@@ -33,7 +33,6 @@
      return {
        disabled: false,
        url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=`,
        isTree: false,
        isShow: true,
        fileId: '',
        productList: [],
@@ -54,9 +53,13 @@
    },
    methods: {
      init(id, params) {
        if (params.type === 'tree') {
          this.isTree = true
        if (params.type === 'xh') {
          this.isShow = false
          this.dataForm.pid = null
          this.dataForm.productType = 5
        } else if (params.type === 'zt') {
          this.dataForm.pid = params.pid
          this.dataForm.productType = 4
          this.getProductList()
        } else {
          this.dataForm.pid = params.pid
@@ -65,7 +68,6 @@
        if (this.dataForm.productType === 10 && id == null) {
          this.getDefaultImg(this.dataForm.productType)
        }
        this.disabled = !!id;
      },
      // 获取系统列表
      async getProductList() {
@@ -101,18 +103,12 @@
      // 表单提交
      async formSubmit() {
        let flag = true
        if (this.isTree) {
          if (this.dataForm.productType !== '5' || this.dataForm.productType !== '4') {
            this.$alert("不支持新增此节点")
            flag = false
          }
        } else {
          if (this.dataForm.productType === '5' || this.dataForm.productType === '4') {
        if (this.isShow) {
          if (this.dataForm.productType === '5') {
            this.$alert("不支持新增此节点")
            flag = false
          }
        }
        if (!flag) {
          return
        }