<!--邀请奖励记录-->
<template>
  <div class="app-container" style="background-color: #ffffff">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="118px">
      <el-form-item label="用户账号" prop="userNum">
        <el-input
          v-model="queryParams.userNum"
          placeholder="请输入用户账号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户姓名" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="请输入用户姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>



    <el-table  :data="productList" @selection-change="handleSelectionChange" class="tabble">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="用户账号" align="center" prop="userNum" />
      <el-table-column label="用户姓名" align="center" prop="userName" />
      <el-table-column label="直推人数" align="center" prop="people" />
      <el-table-column label="余额" align="center" prop="balance" />
      <el-table-column label="每年分红" align="center" prop="yearRed" />
      <el-table-column label="百姓云股权" align="center" prop="stock" />
      <el-table-column label="百姓云股权价值" align="center" prop="price" />
      <el-table-column label="黄金" align="center" prop="gold" />
      <el-table-column  label="状态" align="center" prop="status"  />

    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改产品对话框 -->

  </div>
</template>

<script>
// import { listProduct, getProduct, delProduct, addProduct, updateProduct } from "@/api/ops/product";

export default {
  name: "Product",
  dicts: ['sys_normal_disable'],
  data() {
    return {

      // 状态
      status:'',
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 产品表格数据
      productList: [

      ],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
          userNum: null,
          userName: null,
        //   receMan:null,
        //   receBank:null,
        //   bankNum:null,
        //   oppenBank:null,
        //   phoneNum:null,
        //   topUp:null,
        //   productName: null,
        //   status: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        // prizeMany: [
        //   { required: true, message: "买一送N不能为空", trigger: "blur" }
        // ],
      }
    };
  },
  created() {
    this.getList();
  },

  methods: {


    /** 查询产品列表 */
    getList() {
      console.log(311)
      // this.loading = true;
      // listProduct(this.queryParams).then(response => {
      //   this.productList = response.rows;
      //   this.total = response.total;
      //   this.loading = false;
      // })
      // ;
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        pageNum: 1,
        pageSize: 10,
        userNum: null,
        userName: null,
        receMan:null,
        receBank:null,
        bankNum:null,
        oppenBank:null,
        phoneNum:null,
        topUp:null,
        productName: null,
        status: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      console.log(204)
      // this.queryParams.pageNum = 1;
      // this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      console.log(210)
      // this.resetForm("queryForm");
      // this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      console.log(216)
      // this.ids = selection.map(item => item.productId)
      // this.single = selection.length!==1
      // this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      console.log(223)
      // this.reset();
      // this.open = true;
      // this.title = "添加产品";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      console.log(375);
      // this.reset();
      // const productId = row.productId || this.ids
      // getProduct(productId).then(response => {
      //   this.form = response.data;
      //   this.open = true;
      //   this.title = "修改产品";
      // })
    },
    /** 提交按钮 */
    submitForm() {
      console.log(390)
      // this.$refs["form"].validate(valid => {
      //   if (valid) {
      //     if (this.form.productId != null) {
      //       updateProduct(this.form).then(response => {
      //         this.$modal.msgSuccess("修改成功");
      //         this.open = false;
      //         this.getList();
      //       });
      //     } else {
      //       addProduct(this.form).then(response => {
      //         this.$modal.msgSuccess("新增成功");
      //         this.open = false;
      //         this.getList();
      //       });
      //     }
      //   }
      // });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      console.log(411)
      // const productIds = row.productId || this.ids;
      // this.$modal.confirm('是否确认删除产品编号为"' + productIds + '"的数据项?').then(function() {
      //   return delProduct(productIds);
      // }).then(() => {
      //   this.getList();
      //   this.$modal.msgSuccess("删除成功");
      // }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      console.log(422)
      // this.download('ops/product/export', {
      //   ...this.queryParams
      // }, `product_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
<style lang="scss" scoped>
.tabble{
  margin-top: 50px;
}


</style>