<template>
  <div >
    <el-table border v-loading="loading" :data="list">
      <el-table-column label="支付订单号" align="center" prop="payCode" width="120px" />
      <el-table-column label="会员手机号" align="center" prop="userPhone" />
      <el-table-column label="支付类型" align="center" prop="payTypeCode" />
      <el-table-column label="支付金额" align="center" prop="payMoney" />
      <el-table-column label="退款金额" align="center" prop="refundMoney" />
      <el-table-column label="交易单号" align="center" prop="bankTransactionId" />
      <el-table-column label="银行单号" align="center" prop="bankSerialNo" />
      <el-table-column label="所属公司" align="center" prop="companyName" />
      <el-table-column label="所属部门" align="center" prop="deptName" />
      <el-table-column label="员工" align="center" prop="companyUserNickName" />
      <el-table-column label="状态" align="center" prop="status" >
          <template slot-scope="scope">
              <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
          </template>
      </el-table-column>
      <el-table-column label="提交时间" align="center" prop="createTime" width="180">
      </el-table-column>
      <el-table-column label="支付时间" align="center" prop="payTime" width="180">
      </el-table-column>
      <el-table-column label="操作" fixed="right" align="center" width="100px" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            @click="handleSelect(scope.row)"
          >选择</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      style="padding-bottom:10px;"
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { getMyPaymentList, getStorePayment, delStorePayment, addStorePayment, updateStorePayment, exportStorePayment } from "@/api/hisStore/storePayment";

export default {
  name: "paymentSelect",
  data() {
    return {
      statusOptions:[],
      loading: true,
      list:[],
      total: 0,
      queryParams: {
        pageNum: 1,
        pageSize: 10
      }
    };
  },
  created() {
    this.getDicts("store_payment_status").then((response) => {
      this.statusOptions = response.data;
    });
  },
  methods: {
    getPaymentList(){
      this.getList();
    },
    handleSelect(row){
      this.$emit('selectPayment',row);

    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    getList(){
      this.loading = true;
      getMyPaymentList(this.queryParams).then(response => {
        this.list = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    }
  }
};
</script>
<style scoped>

</style>
