<template>
  <div class="cmain">
    <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent v-show="showSearch">
      <el-form-item label="姓名" prop="name">
        <el-input v-model="queryParams.name" placeholder="请输入姓名" @keyup.enter.native="handleQuery" class="inp" clearable />
      </el-form-item>
      <el-form-item label="手机号" prop="phone">
        <el-input v-model="queryParams.phone" placeholder="请输入手机号" @keyup.enter.native="handleQuery" class="inp" clearable />
      </el-form-item>
      <el-form-item label="身份证号" prop="idCard">
        <el-input v-model="queryParams.idCard" placeholder="请输入身份证号" @keyup.enter.native="handleQuery" clearable />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <div class="jlu">
      <span class="sp">共计应付款：{{ param.form.realMoney }}元</span>
      <span class="sp">结算金额：{{ param.form.money }}元</span>
      <span class="sp">综合服务费：{{ param.form.serviceMoney }}元</span>
      <span class="sp">应结算人数：{{ param.form.peoples }}人</span>
    </div>
    <el-table :data="response.rows" border height="400">
      <el-table-column type="index" label="序号" align="center" width="80" />
      <el-table-column label="姓名" align="center" prop="name" width="100" />
      <el-table-column label="身份证号" align="center" prop="idCard" width="180" />
      <el-table-column label="手机号" align="center" prop="phone" width="130" />
      <el-table-column label="支付宝" align="center" prop="alipay" width="140" />
      <el-table-column label="开户行" align="center" prop="bankName" width="130" />
      <el-table-column label="银行卡号" align="center" prop="bankAccount" width="180" />
      <el-table-column label="流水号" align="center" prop="num" width="165" />
      <el-table-column label="发放业务费(元)" align="center" prop="realMoney" width="120" />
      <el-table-column label="结算金额(元)" align="center" prop="money" width="120" />
      <el-table-column label="综合服务费(元)" align="center" prop="serviceMoney" width="120" />
      <el-table-column label="结算单状态" align="center" width="120">
        <template slot-scope="scope">
          <span v-if="scope.row.state == 0">待发放</span>
          <span v-if="scope.row.state == 1">已发放</span>
        </template>
      </el-table-column>
      <template slot="empty">
        <el-empty></el-empty>
      </template>
    </el-table>
    <pagination v-if="response.total > 0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
  </div>
</template>
<script>
  export default {
    data() {
      return {
        ids: [],
        showSearch: true,
        response: {},
        dateRange: [],
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          name: null,
          phone: null,
          idCard: null,
          orderByColumn: 'id',
          isAsc: 'desc'
        }
      };
    },
    props: {
      param: {
        type: Object,
        default: () => {
          return {};
        }
      },
      layerid: {
        type: String
      }
    },
    created() {
      this.queryParams.statementId = this.param.form.id;
      this.getList();
    },
    methods: {
      getList() {
        this.ajax({ url: '/work/statement/detailList', data: this.queryParams }).then((response) => {
          this.response = response;
        });
      },
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      resetQuery() {
        this.resetForm('queryForm');
        this.dateRange = [];
        this.handleQuery();
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('/work/recharge/export', { ...this.queryParams }, '充值明细.xlsx');
      }
    }
  };
</script>
