jinlin
2024-04-07 d9461a1740bbc5d8d03258e4db0722aa9655d712
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue
@@ -42,7 +42,7 @@
          name: '',
          productType: '',
          operatImg: '',
          operatImgName:'',
          operatImgName: '',
          sort: '',
          status: ''
        }
@@ -52,7 +52,7 @@
      PictureSelect
    },
    methods: {
      init(id,params) {
      init(id, params) {
        if (params.type === 'tree') {
          this.isTree = true
          this.isShow = false
@@ -61,7 +61,11 @@
          this.dataForm.pid = params.pid
          this.dataForm.productType = params.type
        }
        if (this.dataForm.productType==='10'){
        }
      },
      // 获取系统列表
      async getProductList() {
        let res = await this.$http.get('/basicInfo/XhProductModel/getProductList')
@@ -73,7 +77,7 @@
        let params = {
          productType: selected
        }
        let res = await this.$http.get(`/sysPictureBase/getDefaultImg`, {params:params})
        let res = await this.$http.get(`/sysPictureBase/getDefaultImg`, {params: params})
        this.dataForm.operatImgName = res.data.name
        this.dataForm.operatImg = res.data.id
      },
@@ -95,6 +99,22 @@
      },
      // 表单提交
      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') {
            this.$alert("不支持新增此节点")
            flag =false
          }
        }
        if (!flag){
          return
        }
        let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/basicInfo/XhProductModel/', this.dataForm)
        if (res.success) {
          await this.$tip.success()