<!--
 * @Descripttion: 当前组件信息
 * @version: 1.0.0
 * @Author: 无尘
 * @Date: 2020-04-13 15:27:46
 * @LastEditors: 无尘
 * @LastEditTime: 2020-04-14 15:55:49
 -->

<template>
  <section class="common-right-wrap"></section>
</template>
<script>
import errMsg from '@/common/js/error';
// import { _debounce } from '@/common/js/public';
import { postRequest } from '@/api/api';
export default {
  components: {},
  props: {
    brandId: {
      type: String,
      default: ''
    }
  },
  watch: {
    brandId(val) {
      if (!!val) {
        this.getTableList();
      }
    }
  },
  data() {
    return {};
  },
  methods: {
    /**
     * 获取数据
     */
    async getData() {
      const that = this;
      let para = {
        gicEnterpriseId: that.brandId,
        search: that.searchInput || '' // 搜索字段
      };
      postRequest('/haoban-app-customer-web/cardCoupon/find-card-page', para)
        .then(res => {
          let resData = res.data;
          if (resData.errorCode == 1) {
            that.tableData = resData.result.list || [];
            that.total = resData.result.pageInfo.total;
            return;
          }
          errMsg.errorMsg(resData);
        })
        .catch(function(error) {
          that.$message.error({
            duration: 1000,
            message: error.message
          });
        });
    }
  }
};
</script>
<style type="text/less" lang="less" scoped>
.w-123 {
  width: 123px;
}
.p-20 {
  padding: 20px;
  box-sizing: border-box;
}
</style>
