<template>

  <div>
    <el-card class="box-card noborder">
      <div class="cardtitles">相关企业</div>
      <div class="searchbtns">
        <el-select class="select" placeholder="企业角色">
          <option label="111" value="222"></option>
        </el-select>
        <div class="searchInput">
          <el-input type="text" placeholder="输入关键词查询"></el-input>
          <div class="btn">搜索</div>
        </div>
        <div class="btn btn_primary h32 b3" @click="opennew"><div class="img img1"></div>添加相关企业</div>
      </div>
      <div class="document">
        <el-table
          :data="tableData"
          style="width: 100%"
        >
          <template slot="empty">
            <div class="empty">
              <img src="@/assets/images/project/empty.png">
              <div class="p1">暂无数据展示</div>
              <div class="p2">抱歉,你还未添加相关数据，快去添加吧</div>
              <div class="btn btn_primary h36 w102" @click="opennew">新增联系人</div>
            </div>
          </template>
          <el-table-column
            prop="date"
            label="企业名称"
            >
            <template slot-scope="scope">
              <div class="wordprimary">集团投标常用资料</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="name"
            label="对接深度"
            >
          </el-table-column>
          <el-table-column
            prop="name"
            label="企业角色"
            sortable
            width="">
          </el-table-column>
          <el-table-column
            prop="name"
            label="负责人"
            width="">
          </el-table-column>
          <el-table-column
            prop="name"
            label=""
            align="right"
            width="">
            <template slot-scope="scope">
              <div class="hoverbtn">
                <div class="sc">删除</div>
              </div>
            </template>
          </el-table-column>
        </el-table>

        <div class="tables">
          <div class="bottems">
            <el-pagination
              background
              :page-size="20"
              :current-page="1"
              @current-change="handleCurrentChange"
              layout="prev, pager, next"
              :total="1000">
            </el-pagination>
          </div>
        </div>
      </div>
      <el-dialog
        class="popups"
        :visible.sync="dialogVisible"
        width="464px">
        <div class="poptitle">
          <img src="@/assets/images/economies/icon.png">
          <span>新建相关企业</span>
        </div>
        <div class="types">
          <div :class="{'on':types==1}" @click="types=1"><i></i>业主单位</div>
          <div :class="{'on':types==2}" @click="types=2"><i></i>合作伙伴</div>
          <div :class="{'on':types==3}" @click="types=3"><i></i>竞争对手</div>
        </div>
        <div class="popform">
          <div class="popbot" style="padding-right: 0">
            <div class="btn btn_cancel h32" @click="cancel">返回</div>
            <div class="btn btn_primary h32" @click="hzhbVisible=true">下一步</div>
          </div>
        </div>
      </el-dialog>
      <el-dialog
        class="popups"
        :visible.sync="hzhbVisible"
        width="464px">
        <div class="poptitle">
          <img src="@/assets/images/economies/icon.png">
          <span>新建相关企业-{{types==1?"业主单位":""}}{{types==2?"合作伙伴":""}}{{types==3?"竞争对手":""}}</span>
        </div>
        <div class="popform i">
          <div class="row">
            <span class="left"><i>*</i>企业名称：</span>
            <el-input type="text" placeholder="请输入"></el-input>
          </div>
          <div class="row" v-if="types == 1">
            <span class="left">对接深度：</span>
            <el-select  placeholder="请选择">
              <el-option label="cccc" value="11"></el-option>
              <el-option label="cccc" value="121"></el-option>
            </el-select>
          </div>
          <div class="row" v-if="types == 2">
            <span class="left">合作阶段：</span>
            <el-select  placeholder="请选择">
              <el-option label="cccc" value="11"></el-option>
              <el-option label="cccc" value="121"></el-option>
            </el-select>
          </div>
          <div class="row" v-if="types == 3">
            <span class="left">竞争力度：</span>
            <el-select  placeholder="请选择">
              <el-option label="cccc" value="11"></el-option>
              <el-option label="cccc" value="121"></el-option>
            </el-select>
          </div>
          <div class="row">
            <span class="left">企业角色：</span>
            <el-select  placeholder="请选择">
              <el-option label="cccc" value="11"></el-option>
              <el-option label="cccc" value="121"></el-option>
            </el-select>
          </div>
          <div class="row">
            <span class="left">负责人：</span>
            <el-input type="text" placeholder="请输入"></el-input>
          </div>
          <div class="popbot">
            <div class="btn btn_cancel h32" @click="cancel">返回</div>
            <div class="btn btn_primary h32">添加</div>
          </div>
        </div>
      </el-dialog>
    </el-card>
  </div>
</template>

<script>
  import "@/assets/styles/project.scss"
  export default {
    name: 'zlwd',
    data(){
      return{
        types:1,
        dialogVisible:false,
        hzhbVisible:false,
        textarea:"",
        nowedit:-1,//当前正在编辑的文本
        tipslit:[],//项目标签
        tipsvalue:"",//标签填写内容
        tableData: [
          {
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
          }, {
            date: '2016-05-04',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1517 弄'
          }, {
            date: '2016-05-01',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1519 弄'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
          }
        ]
      }
    },
    methods:{
      //翻页
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      },
      cancel(){
        this.dialogVisible = false
      },
      //打开新建窗口
      opennew(){
        this.dialogVisible = true
      },
    }
  }
</script>

<style lang="scss" scoped>
  .w102{
    width: 102px;
  }

  .img.img1{
    margin-right: 4px;
    background: url('../../../../../src/assets/images/project/add_2.png')no-repeat center center;
  }
  .img.img2{
    margin-right: 4px;
    background: url('../../../../../src/assets/images/upload.png')no-repeat center center;
  }
  .box-card{
    position: relative;
  }
</style>
