<!--
 * @Author: wanglj 471442253@qq.com
 * @Date: 2022-12-26 14:34:34
 * @LastEditors: wanglj
 * @LastEditTime: 2022-12-26 17:24:04
 * @Description: file content
 * @FilePath: \opms_frontend\src\views\customer\components\allocate.vue
-->
<template>
  <el-dialog :visible.sync="visible"
             width="30%"
             @close="handleClose"
             title="分配客户">
    <Transfer ref="transfer"></Transfer>
    <el-form :model="form"
             label-width="80px">
      <el-form-item label="销售代表">
        <el-input v-model="form.allocate"
                  readonly>
          <el-button slot="append"
                     icon="el-icon-search"
                     @click="choose"></el-button>
        </el-input>
      </el-form-item>
    </el-form>
    <span slot="footer">
      <el-button type="primary"
                 size="mini">保存</el-button>
      <el-button size="mini"
                 @click="visible = false">取消</el-button>
    </span>
  </el-dialog>
</template>

<script>
import Transfer from './Transfer.vue'
export default {
  data () {
    const generateData = _ => {
      const data = [];
      const cities = ['上海', '北京', '广州', '深圳', '南京', '西安', '成都'];
      const pinyin = ['shanghai', 'beijing', 'guangzhou', 'shenzhen', 'nanjing', 'xian', 'chengdu'];
      cities.forEach((city, index) => {
        data.push({
          label: city,
          key: index,
          pinyin: pinyin[index]
        });
      });
      return data;
    };
    return {
      visible: false,
      innerVisible: false,
      form: {
        allocate: ''
      },
      allocate: [],
      data: generateData(),
      options: []
    }
  },
  components: {
    Transfer
  },
  methods: {
    handleClose () {

    },
    choose () {
      this.$refs.transfer.innerVisible = true
    }
  }
}
</script>

<style>
</style>