export default {
  data() {
    return {
      gradeObj: {},
    }
  },
  created () {
    this.searchData.unshift(
      {label: '组织机构', key: 'hasGrade', type: 'selectRemote', changeHandle: this.gradeChange,
        remoteParams: {skey: 'name', api: 'base.searchAccountAllMch?search_EQ_status=1', opKey: 'name', opVal: 'id'}
      }
    )
  },
  computed: {},
  methods: {
    gradeChange (val, op, item) {
      this.gradeObj = item
    },
    splitGradeParams (newForm) {
      delete newForm.hasGrade
      this.gradeObj.mchpath_3
        ? newForm.mchpath_3 = this.gradeObj.id
        : this.gradeObj.mchpath_2
          ? newForm.mchpath_2 = this.gradeObj.id
          : this.gradeObj.mchpath_1
            ? newForm.mchpath_1 = this.gradeObj.id
            : ''
    }
  }
}
