<template>
  <div class="page-byh-service">
    <block-header title="搜索" />
    <div class="page-search">
      <el-form size="small" label-suffix=":" :inline="true" label-width="80px" ref="refForm" :model="form"
        class="demo-form-inline">
        <el-form-item prop="clientInfo" label="客户信息">
          <el-input style="width: 260px" clearable v-model.trim="form.clientInfo" @keyup.enter.native="onSubmit"
            placeholder="姓名/手机/证件号/项目名称/借款编号"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="onSubmit">查询</el-button>
          <el-button @click="onReset('refForm')">清空</el-button>
        </el-form-item>
      </el-form>
    </div>

    <block-header title="搜索结果"></block-header>
    <div class="block-box">
      <el-table border size="mini" :highlight-current-row="true" :header-row-class-name="headerStyle" :data="data"
        stripe style="width: 100%;">
        <el-table-column align="center" width="140" prop="loanName" label="项目名称"></el-table-column>
        <el-table-column align="center" prop="loanNo" label="借款编号"></el-table-column>
        <el-table-column align="center" prop="realName" label="客户姓名"></el-table-column>
        <el-table-column align="center" prop="mobile" label="手机号"></el-table-column>
        <el-table-column align="center" prop="idCard" label="证件号"></el-table-column>
        <el-table-column align="center" prop="followUpTeam" label="委案商/跟进团队"></el-table-column>
      </el-table>
    </div>

  </div>
</template>

<script>
export default {
  name: "Commission",
  data() {
    return {

      form: {
        clientInfo: ""
      },


      data: []
    }
  },
  created() {

  },

  methods: {
    /** 表格样式 */
    headerStyle() {
      return "tableHeaderStyle";
    },

    /** 初始化订单列表 **/
    async init() {
      try {
        const params = this.form
        const form = Object.assign({}, params)
        const res = await this.$$post('/outsourcing/collectionSearch', { ...form })
        if (res.status === 200 && res.data.success) {
          const records = res.data.result;
          console.log(records, '记录')
          this.data = records;
        } else {
          this.$message.error(res.data.message);
        }
      } catch (err) {
        this.$Message.error(err || '系统异常');
        console.log(err, '初始化协议列表错误')
      }
    },

    /** 搜索提交 */
    onSubmit() {
      this.init()
    },

    handleCurrentChange(e) {
      this.form.current = e;
      this.init();
    },
    handleSizeChange(e) {
      this.form.size = e;
      this.form.current = 1;
      this.init();
    }
  }
}


</script>

<style scoped>
.link-active,
.link-null {
  text-decoration: none;
}

.link-active {
  color: #155bd4;
}

ul,
li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-table {
  margin-bottom: 20px;
}

.pages {
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>
