index.vue 3.01 KB
<template>
  <div class="container">
    <div>
      <el-button @click="addSendGroup" :size="size" type="primary" mode="el-button">新建群发</el-button>
    </div>
    <GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
    <GLTable ref="groupTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable>
  </div>
</template>

<script>
import url from '@/assets/empty.png'
export default {
  name: 'collocation',
  data() {
    return {
      url,
      searchForm: {
        sendName: '',
        sendTime: '',
        store: ''
      },
      searchFormData: [
        {
          label: '群发名称',
          name: 'sendName',
          type: 'input',
          isClear: true
        },
        {
          label: '群发时间',
          name: 'sendTime',
          type: 'datePicker',
          isClear: true
        },
        {
          label: '群发门店',
          name: 'store',
          type: 'input',
          isClear: true
        }
      ],
      tableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '群发名称',
            prop: 'sendName'
          },
          {
            label: '群发门店',
            prop: 'senaStore'
          },
          {
            label: '客户数',
            prop: 'customerNum'
          },
          {
            label: '标签/人群',
            prop: 'tag'
          },
          {
            label: '创建时间',
            prop: 'creatTime'
          },
          {
            label: '发送状态',
            prop: 'sendStatus'
          },
          {
            label: '完成情况(失败/成功)',
            prop: 'finish',
            width: '200'
          }
        ]
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
      //   getListApi: this.$apis.accountConfig.listCustomizedAgentWithPage,
    }
  },
  methods: {
    handleSearch() {
      this.$refs.activeTable.refreshTable()
    },
    // 重置搜索框搜索
    handleReset() {
      this.searchForm = {
        isBuyPermit: '',
        merchantId: '',
        merchantName: ''
      }
      this.handleSearch()
    },
    setTableFinishFun() {
      //接收到的数据为空
      this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun()
    },
    // 跳转新建群发
    addSendGroup() {
      this.$router.push('/wechatGroup/addWechatGroup')
    }
  }
}
</script>

<style lang="scss" scoped>
.container {
  padding: 20px;
  background-color: #fff;
  .table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    .header-text {
      font-size: 16px;
      color: #333333;
      font-weight: 600;
    }
  }
  .table-btn {
    color: #5850ff;
    border: 1px solid #5850ff;
  }
}
</style>