<template>
    <div>
        <Modal :mask-closable="false" @on-visible-change="visibleChange" v-model="my_show" width="800" footer-hide>
            <div slot="header">
                <span style="margin-right:20px">{{title}}</span>
                <Button type="primary" @click="addSet">添加</Button>
            </div>
            <div style="height:500px">
                <Row style="margin-bottom:10px;font-size:14px;font-weight: bold;">
                    <Col span="8">
                    机构名称
                    </Col>
                    <Col span="8">占比</Col>
                    <Col span="8">操作</Col>
                </Row>
                <Row v-for="(item,index) in agentSetList" style="margin-bottom:10px">
                    <Col span="8">
                    <Select v-model="item.info.agentId" style="width:80%" placeholder="请选择机构" label-in-value @on-change="handleSelect($event,index)" :disabled="item.id!=undefined">
                        <Option v-for="agent in agentList" :value="agent.id" :key="agent.id">{{agent.name}}</Option>
                    </Select>
                    </Col>
                    <Col span="8">
                    <Input v-model="item.info.percent" type="number" placeholder="请输入占比" clearable style="width:80%"/>
                    </Col>
                    <Col span="8">
                    <Button type="error" @click="delSet(item,index)" style="margin-right:20px">删除</Button>
                    <Button v-if="item.info.agentId" type="primary" @click="cartypeSet(item,index)">配置车型</Button>
                    </Col>
                </Row>
            </div>
        </Modal>
        <cartype-set :show.sync="cartype.show" v-bind="cartype"></cartype-set>
    </div>
</template>
<script src="./js/agent_set.js"></script>
