<template>
  <div class="eibs">
    <c-col :span="24">
      <c-table :list="baseList" :columnsConfig="columns" @row-dblclick="useInfo">
        <c-table-column fixed="right" prop="op" label="操作" width="200px">
          <template slot-scope="{ scope }">
            <button
              class="el-button el-button--default el-button--small"
              style="margin-left: 0"
              size="small"
              :disabled="false"
              @click.prevent="useInfo(scope.row)"
            >
              <span>使用</span>
            </button>
          </template>
        </c-table-column>
      </c-table>
    </c-col>
  </div>
</template>

<script>
import { getWebDetail } from "~/service/manage/act.js";
export default {
  name: "BaseWebInfo",
  inject: ["root"],
  props: {
    baseList: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      operateIdx: 0,
      columns: [
        { label: "账号", prop: "extkey", width: "auto" },
        { label: "账号名", prop: "accnam", width: "auto" },
        { label: "账号类型", prop: "typ", width: "auto" },
        { label: "客户账号", prop: "khzh", width: "auto" },
        { label: "账户余额", prop: "yue", width: "auto" },
        { label: "可用金额", prop: "kyje", width: "auto" },
        { label: "记录状态", prop: "jlzt", width: "auto" },
        { label: "营业机构号", prop: "yyjgh", width: "auto" },
        { label: "账务机构号", prop: "zwjgh", width: "auto" },
      ],
    };
  },
  methods: {
    async useInfo(row) {
      this.$emit("uselist", row)
      let params = {
        extkey: row.extkey,
        startnum: "",
        selectnum: ""
      };
      const response = await getWebDetail(params);
      if (response.respCode == SUCCESS) {
        this.$emit("backfill", response.data)
      }
    },
    cancel() {
      this.handleClose();
    },
    handleClose(done) {
      this.actDialog = false;
      if (done && typeof done === "function") {
        done();
      }
    },
  }
};
</script>

<style scoped lang="less">
.eibs {
  height: 400px;
  overflow: auto;
}
</style>