customList.vue 7.39 KB
<template>
  <div>
    <div class="form-panel scrm-box-f">
      <el-form :inline="true" :model="tableSearchForm" class="follow-form-item">
        <el-row>
          <el-form-item size="small" label="手机号">
            <el-input size="small" v-model="tableSearchForm.phone" placeholder="请输入手机号"></el-input>
          </el-form-item>
          <el-form-item size="small" label="发送状态" style="margin-left: 20px">
            <el-select v-model="tableSearchForm.status" 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="客户姓名" style="margin-left: 20px">
            <el-input size="small" v-model="tableSearchForm.customerName" placeholder="请输入客户姓名"></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-row>
      </el-form>
      <GLTable v-loading="loading" ref="table" @refreshTable="handleSearch" :searchForm="tableSearchForm" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams">
         <div slot="status" slot-scope="scope">
            <span :class="['task_icon',scope.scope.status==1?'green-icon':'yellow-icon']">{{ scope.scope.statusName }}</span>
        </div>
        <div class="table-btns" slot="optionBtns" slot-scope="scope">
          <el-button type="text" @click="handleDetail(scope.scope)">短信内容</el-button>
        </div>
      </GLTable>
      <GLDialog title="短信内容" :hasFooter="true" :content="messageContent" :visible.sync="dialogVisible" mode="small">
        <span slot="footer" class="dialog-footer">
          <el-button size="small" type="primary" @click="dialogVisible = false">确定</el-button>
        </span>
      </GLDialog>
    </div>
  </div>
</template>

<script>
import util from '@/utils/util'
export default {
  name: 'customList',
  data() {
    return {
      loading: false,
      messageContent: '',
      tableSearchForm: {},
      dialogVisible: false,
      tableData: [],
      optionstatus: [
        {
          value: '',
          label: '全部'
        },
        {
          value: '0',
          label: '未发送'
        },
        {
          value: '1',
          label: '已发送'
        }
      ],
      tableParams: {
        listName: 'data',
        tableOption: false,
        tableColumns: [
          {
            label: '手机号',
            prop: 'phone'
          },
          {
            label: '客户姓名',
            prop: 'customerName'
          },
          {
            label: '发送状态',
            prop: 'statusName',
            addHtml: 'status'
          },
          {
            label: '发送时间',
            prop: 'sendTime'
          },
          {
            label: '操作',
            prop: 'optionBtns',
            width: '140px',
            addHtml: 'optionBtns',
            fixed: 'right'
          }
        ]
      },
      layout: 'sizes, prev, pager, next, jumper, ->, total',
      tableTotal: 0,
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
    }
  },
  methods: {
    handleDetail(scope) {
      this.dialogVisible = true
      this.messageContent = scope.content
    },
    handleSearch() {
      this.listChannelCodeByPage()
    },
    handleReset() {
      this.tableSearchForm = {}
      this.listChannelCodeByPage()
    },
    listChannelCodeByPage() {
      const { id } = this.$route.params
      const params = {
        ...JSON.parse(JSON.stringify(this.tableSearchForm)),
        pageSize: this.$refs.table.page.pageSize,
        pageNum: this.$refs.table.page.pageNum,
        id
      }
      this.loading = true
      this.$apis.marketing.customerPage(params).then(res => {
        this.loading = false
        if (res) {
          this.tableData = res.data
          this.tableData.forEach(item => {
            this.$set(item, 'taggingList', [])
            const tagging = eval(item.tagging)
            if (tagging && tagging.length > 0) {
              tagging.forEach(itm => {
                let name = itm.name.split(',')
                name.forEach((tag, index) => {
                  item.taggingList.push({ name: tag })
                })
              })
            }
          })
          this.tableTotal = res.count
        }
      })
    }
  },
  mounted() {
    this.listChannelCodeByPage()
  }
}
</script>
<style>
.el-popover {
  max-width: 800px;
}
</style>
<style lang="scss" scoped>
.popover-panel {
  width: 1000px;
}
.form-header {
  margin-bottom: 20px;
}
.form-panel {
  padding: 20px;
  margin-bottom: 60px;
  /deep/ .el-popover {
    max-width: 1000px;
  }
}
.download-link {
  cursor: pointer;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 400;
  color: #666666;
  line-height: 20px;
}
.codeRemark {
  font-size: 14px;
  font-weight: 400;
  color: #999999;
  line-height: 20px;
}
.tag-panel {
  .tag-item {
    border-radius: 4px;
    border: 1px solid #e8e8ea;
    display: inline-block;
    padding: 4px 6px;
    margin-right: 3px;
    margin-bottom: 3px;
  }
}
.allTagsWrap {
  position: relative;
  display: -webkit-box;
  // max-height: 56px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  padding-bottom: -2px;
  box-sizing: border-box;
  // &:hover {
  //   -webkit-line-clamp: 9999;
  //   // .tag-box-wrap {
  //   //   margin-bottom: 10px;
  //   // }
  // }
  .tag-box-wrap {
    display: inline-block;

    margin-right: 10px;
    // margin-bottom: 2px;
    padding: 0 10px;
    box-sizing: border-box;
    min-width: 76px;
    max-width: 200px;
    height: 26px;
    line-height: 26px;
    border-radius: 4px;
    border: 1px solid #e8e8ea;
    background: #fafbfe;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: #666666;
    max-width: 245px;
    cursor: pointer;
    margin-bottom: 3px;
    // &:first-child{
    //   margin-bottom: 4px;
    // }
  }
  // .tag-box-wrap + .tag-box-wrap {
  //   margin-bottom: 4px;
  // }
  .expande-button-wrap {
    position: absolute;
    right: 0;
    bottom: 0;
    .expande-button {
      color: #fafbfe;
      cursor: pointer;
      i {
        height: 8px;
      }
      span {
        height: 20px;
        font-size: 14px;
        font-weight: 400;
        color: #fafbfe;
        line-height: 20px;
      }
    }
  }
}
.link-dialog {
  text-decoration: underline;
  cursor: pointer;
}
.accountType-row {
  text-align: left;
  position: relative;
  font-size: 14px;
  line-height: 14px;
  padding-left: 15px;
  border-radius: 4px;
  border: 1px solid #e8e8ea;
  padding: 6px;
  display: inline-block;
  margin-bottom: 5px;
  margin-right: 5px;
  &-tag {
    display: inline-block;
    border: 1px solid #e8e8ea;
    background: #fafbfe;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: #666;
    max-width: 150px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
  i {
    color: #75acff;
    margin-right: 3px;
  }
  // &::before {
  //   content: '';
  //   position: absolute;
  //   width: 6px;
  //   height: 6px;
  //   background: #5850ff;
  //   border-radius: 8px;
  //   left: 0px;
  //   top: 7px;
  // }
}
</style>