<!-- 区域账号查看 -->
<template>
  <div>
    <dialog-edit :visible.sync="dialogVisible" :api="{}" :editModel="editModel" :form="form" :width="'30%'" :formRules="formRules"
                 :title="$t('cyjg.businessRegionInfo.contactEdit')" :autoSave="autoSave" @onSaved="onSaved"
                 labelWidth="100px">
      <dym-form :componentList="componentList" :formValue="form" @selectChanged="selectChanged">
      </dym-form>
    </dialog-edit>
  </div>
</template>
<script>
import { DialogEdit, dymForm } from 'newepoch-components'
import BaseEdit from '@/pages/baseEditPage'
import businessRegionInfoApi from '@/api/cyjg/businessRegionInfoApi.js'
export default {
  extends: new BaseEdit(),
  name: 'commissionerEdit',
  components: {
    DialogEdit,
    dymForm
  },
  props: {},
  data () {
    return {
      autoSave: false,
      componentList: [
        // 区域账号
        {
          value: 'account',
          disabled: true,
          componentName: 'el-input',
          label: this.$i18n.messages[this.$i18n.locale].cyjg.businessRegionInfo.contactName,
          labelWidth: '110px',
          placeholder: '',
          cols: [24, 24, 24, 24],
          multiple: true,
          prop: 'account'
        },
        // 区域账号所属人 调接口
        {
          value: 'owner',
          disabled: true,
          componentName: 'el-input',
          label: this.$i18n.messages[this.$i18n.locale].cyjg.businessRegionInfo.contactOwner,
          labelWidth: '110px',
          placeholder: '',
          cols: [24, 24, 24, 24],
          multiple: true,
          prop: 'owner'
        }
      ]
    }
  },
  methods: {
    onSaved (data) {},
    selectChanged (obj) {}
  },
  watch: {
    dialogVisible (val) {
      if (val) {
        // this.form.owner = '123'
        let obj = {
          account: this.form.account,
          companyId: this.form.companyId
        }
        businessRegionInfoApi.account.find(obj).then(res => {
          if (res && res.data) {
            this.$set(this.form, 'owner', res.data.owner)
          }
        })
      }
    }
  },
  computed: {
  }
}
</script>

<style scoped>

</style>
