marketingPlan.vue 3.06 KB
<template>
  <div class="scrm-sub-client-container">
    <div class="pageContent">
      <GLCombiForm :formObj="searchForm" :formData="searchFormList" @handleOk="searchTable" @handleRest="resetTable"></GLCombiForm>
      <GLTable v-loading="loading" :hasNum="true" @setTableHeightEvent="setTableHeightEvent" @setTableFinishFun="setTableFinishFun" ref="marketingPlan" :getListApi="getListApi" :searchForm="searchForm" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams"></GLTable>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      searchForm: {},
      searchFormList: [{
          type: 'input',
          inputType: 'text',
          // name: 'keyword',
          label: '分群名称',
          placeholder: '请输入分群关键字'
        },
        {
          type: 'select',
          // name: 'type',
          label: '营销状态',
          optionLabel: 'label',
          optionId: 'value',
          optionList: [
            {
              label: '全部',
              value: ''
            },
            {
              label: '救援服务',
              value: 3
            },
            {
              label: '新车询价',
              value: 4
            },
            {
              label: '试驾预约',
              value: 5
            },
            {
              label: '维保预约',
              value: 6
            }
          ],
          placeholder: '请选择'
        }
      ],
      // getListApi: getTableList,
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
      tableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '人群名称',
            prop: 'orderNo'
          },
          {
            label: 'SOP名称',
            prop: 'name'
          },
          {
            label: '营销时间',
            prop: 'phone'
          },
          {
            label: '完成度',
            prop: 'dsdasd'
          },
          {
            label: '营销状态',
            prop: 'dsdasds'
          }
        ]
      }
    }
  },
    mounted() {
    //没数据的时候要算高度
    setTimeout(() => {
      if (!this.$refs.marketingPlan.data.length) {
        this.loading = true
        this.$refs.marketingPlan.setTableHeightFun()
        this.loading = false
      }
    }, 200)
  },
  methods: {
        setTableFinishFun() {
      this.$refs.marketingPlan.data.length ? (this.$refs.marketingPlan.tableHeightValues = '') : this.$refs.marketingPlan.setTableHeightFun()
    },
    setTableHeightEvent() {
      this.$refs.marketingPlan.setTableHeightFun()
    },
    // 搜索表格
    searchTable() {
      console.log(this.searchForm)
      this.$refs.marketingPlan.refreshTable()
    },
    //重置表格
    resetTable() {
      this.searchForm = {
        status: '',
        type: ''
      }
      this.$refs.marketingPlan.refreshTable()
    }
  }
}
</script>

<style lang="scss" scoped>
.pageContent {
  padding: 20px 20px 30px;
  box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
  background-color: #fff;
}
</style>