messageList.vue 5.03 KB
<template>
  <div class="form-panel scrm-box-f">
    <div class="statistics-panel">
      <div class="statistics-panel-item">
        <div class="statistics-title-h">短信营销统计</div>
        <div class="statistics-title">
          <span>任务完成率</span>
          <el-popover placement="top" width="300" trigger="hover" content="已发送短信数量 / 累计的营销短信总数。">
            <img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
          </el-popover>
        </div>
        <div class="circle-box">
          <echart-circle bgColor1="#F0F0F0" bgColor2="#6F76EE" coustomId="coustomId_5" :coustomCount="percentage"></echart-circle>
          <div class="circle-box-item">
            <div class="circle-item-scale">{{ percentage }}%</div>
            <div class="circle-item-num">{{ totalCount }}</div>
          </div>
        </div>
      </div>
    </div>
    <GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
    <GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
      <div class="table-btns" slot="optionBtns" slot-scope="scope">
        <el-button type="text" @click="handleDetail(scope.scope)">短信内容</el-button>
      </div>
    </GLTable>
  </div>
</template>

<script>
import echartCircle from './echartCircle'
export default {
  name: 'channelList',
  components: {
    echartCircle
  },
  data() {
    return {
      totalCount: 0,
      percentage: 0,
      optionstatus: [
        {
          value: '',
          label: '全部'
        },
        {
          value: '0',
          label: '未发送'
        },
        {
          value: '1',
          label: '已发送'
        }
      ],
      tableSearchForm: {
        phone: '',
        status: null
      },
      searchFormData: [
        {
          label: '电话号码',
          name: 'phone',
          type: 'input',
          placeholder: '请输入电话号码'
        },
        {
          label: '状态',
          name: 'status',
          type: 'select',
          placeholder: '请选择',
          optionId: 'value',
          optionLabel: 'label',
          optionList: [
            {
              value: '',
              label: '全部'
            },
            {
              value: '0',
              label: '未发送'
            },
            {
              value: '1',
              label: '已发送'
            }
          ]
        }
      ],
      getListApi: this.$apis.overview.findAllMessageByPage,
      tableParams: {
        listName: 'data',
        tableOption: false,
        otherOptions: {
          label: '启用开关'
        },
        tableColumns: [
          {
            label: '用户联系方式',
            prop: 'phone'
          },
          {
            label: '发送状态',
            prop: 'statusName'
          },
          {
            label: '发送时间',
            prop: 'sendTime'
          },
          {
            label: '操作',
            prop: 'optionBtns',
            width: '140px',
            addHtml: 'optionBtns',
            fixed: 'right'
          }
        ]
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
      baseData: {
        allMerchantList: [],
        roleList: [],
        staffStatusList: []
      }
    }
  },
  methods: {
    findMessageStatic() {
      this.$apis.overview.findMessageStatic({}).then(res => {
        this.totalCount = res.totalCount
        this.percentage = res.percentage
      })
    },
    handleReset() {
      this.tableSearchForm = {}
      this.handleSearch()
    },
    handleSearch() {
      this.$refs.employeeRef.refreshTable()
    },
    handleDetail(scope) {
      this.$alert(scope.content, { center: true })
    }
  },
  mounted() {
    this.findMessageStatic()
  }
}
</script>

<style lang="scss" scoped>
.form-header {
  margin-bottom: 20px;
}
.form-panel {
  padding: 20px;
  .statistics-panel {
    display: flex;
    &-item {
      width: 33.33%;
      .statistics-title-h {
        font-size: 20px;
        font-weight: 600;
        color: #333333;
        line-height: 20px;
        letter-spacing: 1px;
        margin-bottom: 20px;
      }
      .statistics-title {
        font-size: 16px;
        font-weight: 500;
        color: #424242;
        line-height: 22px;
        img {
          width: 14px;
          height: 14px;
          margin-left: 10px;
          margin-top: 4px;
        }
      }
      .circle-box {
        margin: 20px 0px;
        display: flex;
        align-items: center;
        .circle-box-item {
          margin-left: 10px;
          font-size: 14px;
          font-weight: 400;
          color: rgba(0, 0, 0, 0.65);
          line-height: 22px;
          .circle-item-num {
            font-size: 22px;
            font-weight: 600;
            color: #333333;
            line-height: 30px;
          }
        }
      }
    }
  }
}
</style>