<template>
  <div>
    <div class="miantitle">
      <span>客户管理</span>
      <span> / 客户列表</span>
    </div>
    <div class="app-container">
      <el-card class="box-card noborder">
        <div class="tables">
          <div class="empty" v-if="tableData == null || tableData.length == 0">
            <img src="@/assets/images/project/empty.png">
            <div class="p1">添加你的第一位客户吧</div>
            <div class="p2">抱歉,你还未添加客户，快去添加吧</div>
            <div class="btn btn_primary h36 w88" @click="opennew">添加客户</div>
            <div class="btn btn_primary btn_shallow h36 w88">批量导入</div>
          </div>
          <div class="table_search">
            <div class="searchInput">
              <el-input type="text" placeholder="输入企业名称查询"></el-input>
              <div class="btn">搜索</div>
            </div>
            <div class="dc">
              <div class="total">共126条</div>
              <div class="btn-export"><img src="@/assets/images/project/import.png">批量导入</div>
              <div class="btn btn_primary h32 p10" @click="opennew"><div class="img img1"></div>添加客户</div>
            </div>
          </div>
          <el-table
            :data="tableData"
            stripe border
            style="width: 100%"
            :default-sort = "{prop: 'date', order: 'descending'}"
          >
            <el-table-column
              prop="index"
              label="序号"
              width="47">
            </el-table-column>  <el-table-column
              prop="date"
              label="企业名称"
              width="441">
            <template slot-scope="scope">
              <div class="ps1">
                <div class="wordprimary ps2">中国建筑第八工程局有限公司重庆至万州高铁</div>
                <div class="ps3">
                  <div>写跟进<img src="@/assets/images/project/edit_1.png"></div>
                  <div>编辑信息<img src="@/assets/images/project/edit_2.png"></div>
                </div>
              </div>
            </template>

            </el-table-column>
            <el-table-column
              prop="name"
              label="合作项目"
              width="76">
            </el-table-column>
            <el-table-column
              prop="name"
              label="跟进项目"
              width="76">
            </el-table-column>
            <el-table-column
              prop="name"
              label="储备项目"
              width="76">
            </el-table-column>
            <el-table-column
              prop="name"
              label="法定代表人"
              width="110">
            </el-table-column>
            <el-table-column
              prop="name"
              label="注册地区"
              width="160">
            </el-table-column>
            <el-table-column
              prop="name"
              label="注册资本金（万元）"
              width="140">
            </el-table-column>
            <el-table-column
              prop="address"
              label="企业主体评级" width="100">
            </el-table-column>
            <el-table-column
              prop="address"
              label="上市公司" width="76">
            </el-table-column>
            <el-table-column
              prop="address"
              label="局级大客户" width="88">
            </el-table-column>
            <el-table-column
              prop="address"
              label="客户等级" width="76">
            </el-table-column>
            <el-table-column
              prop="address"
              label="客户性质" width="76">
            </el-table-column>
            <el-table-column
              prop="address"
              label="客户级别" width="76">
            </el-table-column>
            <el-table-column
              prop="address"
              label="企业母公司" width="268">
              <template slot-scope="scope">
                <div class="wordprimary">中国建筑第八工程局有限公司重庆至万州高铁</div>
              </template>
            </el-table-column>
            <el-table-column
              prop="address"
              label="主营业务" width="120">
            </el-table-column>
            <el-table-column
              prop="address"
              label="发包属性" width="120">
            </el-table-column>
            <el-table-column
              prop="address"
              label="跟进人" width="110">
            </el-table-column>
          </el-table>
          <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>
        <el-dialog
          class="popups"
          :visible.sync="dialogVisible"
          width="534px">
          <div class="poptitle">
            <img src="@/assets/images/economies/icon.png">
            <span>添加客户</span>
          </div>
          <div class="popform j">
            <div class="row">
              <span class="left"><i>*</i>企业名称：</span>
              <el-input type="text" placeholder="请输入"></el-input>
            </div>
            <div class="row">
              <span class="left">法定代表人：</span>
              <el-input type="text" placeholder="请输入"></el-input>
            </div>
            <div class="row">
              <span class="left">注册资本（万）：</span>
              <el-input type="text" placeholder="请输入"></el-input>
            </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="popbot">
              <div class="wordprimary">前往城投平台寻找客户线索></div>
              <div class="btn btn_cancel h32" @click="cancel">返回</div>
              <div class="btn btn_primary h32">添加</div>
            </div>
          </div>
        </el-dialog>
      </el-card>
    </div>
  </div>
</template>

<script>
  import "@/assets/styles/project.scss"
export default {
  name: 'CustomList',
  data() {

    return{
      dialogVisible: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 弄'
        }
      ]
    }
  },
  created() {
  },
  methods:{
    //翻页
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    cancel(){
      this.dialogVisible = false
    },
    //打开新建窗口
    opennew(){
      this.dialogVisible = true
    },
  }
}
</script>

<style lang="scss" scoped>
  .app-container{
    height: calc(100vh - 134px)
  }
.box-card{
  padding-top: 16px;
  width: 100%;
  height: 100%;
}

  .dc{
    font-size: 12px;
    color: #3D3D3D;
    font-weight: 400;
    position: relative;
    &::after{
      content: ' ';
      width: 2px;
      height: 2px;
      background: rgba(35,35,35,0.4);
      border-radius: 50%;
      position: absolute;
      top: 16px;
      left: 14px;
    }
    >div{
      display: inline-block;
      margin-left: 20px;
    }
  }
  .img.img1{
    margin-right: 2px;
    background: url('../../../../src/assets/images/project/add_2.png')no-repeat center center;
  }
  .w88{
    width: 88px;
  }
  .tables{
    position: relative;
    height: calc(100vh - 134px);
    .empty{
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%,-50%);
      .btn{
        margin-right: 8px;
        margin-top: 12px;
      }
    }
  }
  .ps1{
    display: flex;
    justify-content: space-between;
    .ps2{
      width: 270px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .ps3{
      width: 150px;
      display: flex;
      justify-content: right;
      >div{
        margin-left: 12px;
        &:hover{
          color: #0CBC6D;
          cursor: pointer;
        }
        >img{
          float: right;
          margin: 3px 0 0 4px
        }
      }
    }
  }
  .popbot{
    .wordprimary{
      display: inline;
      padding-right: 26px;
    }
  }
</style>
