<template>
  <div id="claimList">
    <el-row>
      <el-col :span="24">
        <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
          <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
          <!--<el-table-column property="company.company_name" label="企业名称" align="center"> </el-table-column>-->
          <el-table-column label="企业名称" align="center">
            <template slot-scope="scope">
              <span class="hand" @click="$router.push({ path: '/intelligentDocking/intelligentDockingDetail', query: { id: scope.row._id, cid: scope.row.cid } })">{{ scope.row.company.company_name}}</span>
            </template>
          </el-table-column>
          <el-table-column property="finance_claims.name" label="对接产品" align="center"> </el-table-column>
          <el-table-column property="institution.name" label="对接机构" align="center"> </el-table-column>
          <el-table-column property="money" label="融资金额(万元)" align="center"> </el-table-column>
          <el-table-column label="需求状态" align="center">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{
                scope.row.follow
                  ? '已处理'
                  : '待处理'
              }}</span>
            </template>
          </el-table-column>
          <el-table-column fixed="right" label="操作" align="center">
            <template slot-scope="scope">
              <!--<el-button-->
                <!--@click="$router.push({ path: '/intelligentDocking/intelligentDockingDetail', query: { id: scope.row._id, cid: scope.row.cid } })"-->
                <!--type="text"-->
                <!--icon="el-icon-search"-->
                <!--title="查看详情"-->
              <!--&gt;</el-button>-->
              <el-button @click="zhipai(scope.row._id)" type="text" icon="el-icon-s-promotion" title="分配"></el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-row class="page">
          <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage"
                  :page-size="10"
                  layout="total, prev, pager, next, jumper"
                  :total="total"
          >
          </el-pagination>
        </el-row>
      </el-col>
    </el-row>
    <el-row>
      <el-dialog title="分配" :visible.sync="dialogFormVisible" :show-close="false">
        <el-form :model="zhipaiform">
          <el-form-item label="客户经理">
            <el-select v-model="zhipaiform.uuid" placeholder="请选客户经理">
              <el-option v-for="(item, index) in jlList" :key="index" :label="item.name" :value="item.id"> </el-option>
            </el-select>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="quxiao">取 消</el-button>
          <el-button type="primary" @click="zhipaiformBtn">确 定</el-button>
        </div>
      </el-dialog>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'intelligentDockingList',
  props: {
    debtTable: null,
    total: null,
    jlList: null,
    zhipaiform: null,
    dialogFormVisible: null,
  },
  components: {},
  data: () => ({
    currentPage: 1,
  }),
  created() {},
  computed: {},
  methods: {
    // deleteRow(id) {
    //   this.$emit('deleteRow', id);
    // },
    // clickRest(id) {
    //   this.$emit('clickRest', id);
    // },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      this.$emit('pagechange', { skip: val });
    },
    zhipai(valid) {
      this.$emit('zhipai', valid);
    },
    zhipaiformBtn() {
      this.$emit('zhipaiformBtn', { data: this.zhipaiform });
    },
    quxiao() {
      this.$emit('quxiao');
    },
  },
};
</script>

<style lang="less" scoped>
.page {
  text-align: center;
  padding: 15px 0;
}
</style>
