jiangping
2025-04-08 b1740c80205d9584738b1150f4122784c70bbe57
admin/src/components/business/OperaInternalCompanyWindow.vue
@@ -15,8 +15,8 @@
            <el-form-item label="组织名称" prop="name">
                <el-input v-model="form.name" placeholder="请输入组织名称" v-trim/>
            </el-form-item>
          <el-form-item label="组织类型" prop="type">
            <el-radio-group v-model="form.type" :disabled="form.parentType == 0">
          <el-form-item label="组织类型" prop="type" v-if="(editType === 'edit' && parentId) || (editType === 'add')">
            <el-radio-group v-model="form.type" :disabled="(editType === 'edit') || (!!(editType === 'add' && parentId))">
              <el-radio :label="0">相关方组织</el-radio>
              <el-radio :label="1">内部组织</el-radio>
            </el-radio-group>
@@ -39,12 +39,14 @@
      // 表单数据
      form: {
        id: null,
        type: '0',
        type: 0,
        name: '',
        parentId: null,
        disable: false,
        parentName: ''
      },
      editType: '',
      parentId: null,
      // 验证规则
      rules: {
        name: [
@@ -68,10 +70,15 @@
    })
  },
  methods: {
    open(title,target,row){
    open(title, target, row, editType){
      this.title =title
      this.editType = editType
      if (editType === 'edit') {
        this.parentId = row.parentId
      } else if (editType === 'add') {
        this.parentId = target.parentId
      }
      this.visible =true
      console.log(target)
      this.form= {
        id: null,
        type: 0,
@@ -85,13 +92,13 @@
        this.form.parentId = target.id
        this.form.parentType = target.type
        this.form.parentName = target.companyNamePath
      }
      // 新建组织
      if (row == null) {
        this.$nextTick(() => {
          this.$refs.form.resetFields()
          this.form[this.configData['field.id']] = null
          this.form.type = target.type
        })
        return
      }