index.vue 8.14 KB
<template>
  <div class="square-main">
    <div class="square-main-header">
      <GLButton type="primary" size="small" @click="addConfig" fn="新增营销">
        <i class="el-icon-plus"></i>
        新增营销
      </GLButton>
      <label>结合门店营销活动,指定客户创建智能营销,提高活动转化率</label>
      <el-popover placement="top" width="400" trigger="hover" content="通过导入的客户,门店可通过智能外呼及智能短信,结合营销活动的需要向离店用户进行智能营销,可实现标准、高效的营销同时实现用户线上化。">
        <img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
      </el-popover>
    </div>
    <div class="square-tabel scrm-box-f">
      <div class="square-tabel-form">
        <el-form :inline="true" :model="tableSearchForm" class="follow-form-item" label-width="68px">
          <el-form-item size="small" label="添加时间">
            <el-date-picker :picker-options="pickerOptions" v-model="createTime" type="daterange" value-format="yyyy/MM/dd" start-placeholder="开始时间" end-placeholder="结束时间"></el-date-picker>
          </el-form-item>
          <el-form-item size="small" label="状态">
            <el-select v-model="tableSearchForm.imStatus" placeholder="请选择">
              <el-option v-for="item in optionstatus" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item size="small" label="ID">
            <el-input v-model="tableSearchForm.imUid" placeholder="请输入ID"></el-input>
          </el-form-item>
          <el-form-item size="small" style="float: right">
            <el-button @click="handleReset">重置</el-button>
            <el-button type="primary" @click="handleSearch">查询</el-button>
          </el-form-item>
        </el-form>
        <GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
          <div class="table-btns" slot="optionBtns" slot-scope="scope">
            <GLButton type="text" @click="handleDetail(scope.scope)" fn="智能营销配置">营销配置</GLButton>
          </div>
        </GLTable>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'marketing',
  data() {
    return {
      optionstatus: [
        {
          value: '',
          label: '全部'
        },
        {
          value: '1',
          label: '待处理'
        },
        {
          value: '3',
          label: '已完成'
        }
      ],
      pickerOptions: {
        disabledDate: time => {
          return time.getTime() > Date.now()
        }
      },
      createTime: '',
      dialogVisible: true,
      tableSearchForm: {},
      getListApi: this.$apis.marketing.findAllByPage,
      tableParams: {
        listName: 'data',
        tableOption: false,
        tableColumns: [
          {
            label: 'ID',
            prop: 'uuid'
          },
          {
            label: '营销客户数',
            prop: 'customerCount',
            width: '120px'
          },
          {
            label: '状态',
            prop: 'imStatusName'
          },
          {
            label: '创建时间',
            prop: 'createdTime',
            width: '160px'
          },
          {
            label: '创建人',
            prop: 'staffPhone',
            width: '130px'
          },
          {
            label: '操作',
            prop: 'optionBtns',
            width: '100px',
            addHtml: 'optionBtns',
            fixed: 'right'
          }
        ]
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
      baseData: {
        allMerchantList: [],
        roleList: [],
        staffStatusList: []
      }
    }
  },
  watch: {
    createTime(value) {
      if (value) {
        this.tableSearchForm.beginTime = value[0]
        this.tableSearchForm.endTime = value[1]
      } else {
        delete this.tableSearchForm.beginTime
        delete this.tableSearchForm.endTime
      }
    }
  },
  methods: {
    handleSearch() {
      this.$refs.employeeRef.refreshTable()
    },
    handleReset() {
      this.tableSearchForm = {}
      this.$refs.employeeRef.refreshTable()
    },
    handleImport() {},
    addConfig() {
      this.$router.push('/marketing/config/-1')
    },
    handleDetail(scope) {
      this.$router.push('/marketing/config/' + scope.id)
    }
  }
}
</script> 

<style lang="scss" scoped>
.square-main-header {
  label {
    margin: 0px 20px 0px 10px;
    color: #666666;
  }
  img {
    width: 14px;
    height: 14px;
    margin-top: 8px;
  }
}
.dialog-wrap-box {
  z-index: 2001;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0px;
  left: 0px;
  background: rgba(0, 0, 0, 0.5);
  .dialog-wrap-panel {
    background: #ffffff;
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    height: 360px;
    width: 80%;
    .dialog-wrap-items {
      position: relative;
      display: flex;
      width: 100%;
      height: 360px;
      .footer-btn {
        cursor: pointer;
        position: absolute;
        bottom: -50px;
        left: 50%;
        text-align: center;
        width: 120px;
        margin-left: -60px;
        height: 34px;
        line-height: 34px;
        background: #5850ff;
        border-radius: 4px;
        font-size: 14px;
        color: #ffffff;
      }
    }
    .dialog-wrap-item {
      padding: 30px;
      width: 33.33%;
      text-align: center;
      border-right: 1px solid #eeeeee;
      .dialog-item-title {
        font-size: 16px;
        font-weight: 500;
        color: #333333;
        line-height: 22px;
      }
      img {
        width: 200px;
        height: auto;
        margin: 20px;
      }
      .dialog-item-content {
        font-size: 14px;
        width: 240px;
        margin: 0 auto;
        font-weight: 400;
        color: #333333;
        line-height: 20px;
      }
    }
  }
}
.square-title {
  font-size: 20px;
  font-weight: 600;
  color: #333333;
  line-height: 20px;
  letter-spacing: 1px;
  img {
    width: 14px;
    height: 14px;
    margin-top: 5px;
  }
}
.square-num-box {
  height: 102px;
  margin: 20px 0px;
  background: #ffffff;
  box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
  display: flex;
  .square-num-item {
    width: 33.33%;
    padding-left: 20px;
    .square-num-title {
      margin-top: 20px;
      font-size: 14px;
      font-weight: 400;
      color: rgba(0, 0, 0, 0.65);
      line-height: 22px;
    }
    .square-num-count {
      font-size: 30px;
      font-weight: 600;
      color: rgba(0, 0, 0, 0.85);
      line-height: 38px;
    }
  }
}
.coustom-box {
  margin-top: 20px;
  display: flex;
  &-item {
    box-sizing: border-box;
    width: 25%;
    margin-right: 20px;
    padding: 20px;
    height: 334px;
    background: #ffffff;
    box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
    text-align: center;
    &:last-child {
      margin-right: 0px;
    }
    .coustom-box-title {
      font-size: 20px;
      font-weight: 500;
      color: #424242;
      line-height: 28px;
      letter-spacing: 1px;
      margin: 10px;
    }
    .coustom-echart {
      display: flex;
      justify-content: center;
      align-items: center;
      margin-bottom: 20px;
      .coustom-echart-desc {
        margin-left: 10px;
        font-size: 14px;
        font-weight: 400;
        color: rgba(0, 0, 0, 0.65);
        line-height: 22px;
        .coustom-echart-num {
          font-size: 20px;
        }
      }
    }
    .coustom-box-content {
      font-size: 14px;
      font-weight: 500;
      color: #a3a3a3;
      line-height: 20px;
      text-align: left;
      height: 110px;
    }
    .coustom-box-config {
      margin: 10px auto;
      display: inline-block;
      border-radius: 4px;
      border: 1px solid #5850ff;
      padding: 7px 28px;
      font-size: 14px;
      font-weight: 400;
      color: #5850ff;
      line-height: 14px;
    }
  }
}
.square-tabel {
  padding: 10px;
  margin-top: 20px;
  /deep/ {
    .el-date-editor.el-input,
    .el-date-editor.el-input__inner {
      width: 220px;
    }
  }
}
</style>