statDialog.vue 2.46 KB
<template>
  <GLDialog title="SOP执行统计" :visible.sync="statVisible" width="70%" :before-close="handleClose" :hasFooter="false">
    <div class="dialog-body">
      <GLTable v-loading="loading" :searchForm="tableSearchForm" :hasNum="true" :beforeSearchFn="beforeSearchFn"  @setTableFinishFun="setTableFinishFun" ref="leadManage" :getListApi="getListApi" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams"></GLTable>
    </div>
  </GLDialog>
</template>
<script>
const STAGE = Object.freeze({
  1: '门店助手短信',
  2: 'AI外呼',
  3: '门店助手朋友圈',
  4: '门店助手1v1',
  5: '跟进提醒',
  6: '客户信息查询',
  7: '企微提醒',
  8: '企微群发',
  9: '企微朋友圈',
  10: '发送短信'
})
export default {
  props: {
    statVisible: Boolean,
    stageid:Number
  },
  data() {
    return {
      stage: STAGE,
      loading:false,
      tableSearchForm:{},
      getListApi: this.$apis.journeyConfig.getTaskList,
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNumber', totalCount: 'total' },
      tableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '营销计划',
            prop: 'plan'
          },
          {
            label: '触达方式',
            prop: 'taskType',
            formatter: cellValue => {
              return this.stage[cellValue.taskType] ? this.stage[cellValue.taskType] : '--'
            }
          },
          {
            label: '今日营销客户数',
            prop: 'todayCusCount'
          },
          {
            label: '今日下发任务数',
            prop: 'todayTaskCount',
            formatter:cellValue => {
              return cellValue.taskType!=10 ? cellValue.todayTaskCount : '--'
            }
          },
          {
            label: '累计营销客户数',
            prop: 'totalCusCount'
          },
          {
            label: '累计下发任务数',
            prop: 'totalTaskCount'
          }
        ]
      }
    }
  },
  created() {
    const query = this.$route.query
    this.query = query
  },
  methods: {
    beforeSearchFn() {
      return new Promise(resolve => {
        this.loading = true
        this.tableSearchForm = {
          instId:this.query.instId,
          stageid:this.stageid
        }
        resolve()
      })
    },
    setTableFinishFun() {
      this.loading = false
    },
    handleClose() {
      this.$parent.statVisible = false
    }
  }
}
</script>
<style scoped lang="scss"></style>