index.vue 5.83 KB
Newer Older
chenwei's avatar
chenwei committed
1 2 3
<template>
  <div class="app-container">
    <!-- 搜索工作栏 -->
chenwei's avatar
chenwei committed
4
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
chenwei's avatar
chenwei committed
5
      <el-form-item :label="$t('操作人')" prop="memberName">
chenwei's avatar
chenwei committed
6
        <el-input v-model="queryParams.memberName" :placeholder="$t('请输入操作人')" clearable @keyup.enter.native="handleQuery" />
chenwei's avatar
chenwei committed
7 8
      </el-form-item>
      <el-form-item :label="$t('分类')" prop="type">
chenwei's avatar
chenwei committed
9 10
        <el-select v-model="queryParams.type" :placeholder="$t('请选择分类')" clearable>
          <el-option v-for="item in getDictDatas(DICT_TYPE.SCORE_RULE_TYPE)" :label="isChinese ? item.label : item.labelEn" :value="item.value" v-if="item.value == 3 || item.value == 4" />
chenwei's avatar
chenwei committed
11 12 13
        </el-select>
      </el-form-item>
      <el-form-item :label="$t('标题')" prop="title">
chenwei's avatar
chenwei committed
14
        <el-input v-model="queryParams.title" :placeholder="$t('请输入关键词查找')" clearable @keyup.enter.native="handleQuery" />
chenwei's avatar
chenwei committed
15 16
      </el-form-item>
      <el-form-item :label="$t('分享ID')" prop="code">
chenwei's avatar
chenwei committed
17
        <el-input v-model="queryParams.code" :placeholder="$t('请输入分享ID')" clearable @keyup.enter.native="handleQuery" />
chenwei's avatar
chenwei committed
18 19 20 21
      </el-form-item>
      <el-form-item :label="$t('总积分')" prop="type">
        <el-row :gutter="10" style="width: 300px">
          <el-col :span="10">
chenwei's avatar
chenwei committed
22
            <dict-selector v-model="queryParams.relationSymbol" clearable :type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL" @change="handleQuery" />
chenwei's avatar
chenwei committed
23 24
          </el-col>
          <el-col :span="14">
chenwei's avatar
chenwei committed
25
            <el-input v-model.trim="queryParams.totalScore" :placeholder="$t('请输入数字')" clearable onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" @keyup.enter.native="handleQuery" />
chenwei's avatar
chenwei committed
26 27 28 29
          </el-col>
        </el-row>
      </el-form-item>
      <el-form-item :label="$t('操作时间')">
chenwei's avatar
chenwei committed
30
        <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
chenwei's avatar
chenwei committed
31 32
      </el-form-item>
      <el-form-item>
chenwei's avatar
chenwei committed
33 34
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
chenwei's avatar
chenwei committed
35 36 37 38 39
      </el-form-item>
    </el-form>

    <!-- 操作工具栏 -->
    <el-row :gutter="10" class="mb8">
chenwei's avatar
chenwei committed
40
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
chenwei's avatar
chenwei committed
41 42 43 44
    </el-row>

    <!-- 列表 -->
    <el-table v-loading="loading" :data="list">
chenwei's avatar
chenwei committed
45 46 47 48 49 50
      <el-table-column width="100" :label="$t('序号')" align="center" prop="id" />
      <el-table-column width="140" :label="$t('操作人')" align="center" prop="memberName" />
      <el-table-column width="120" :label="$t('分类')" align="center" :prop="isChinese ? 'typeZh' : 'typeEn'" />
      <el-table-column width="120" :label="$t('分享ID')" align="center" prop="code" />
      <el-table-column :label="$t('标题')" align="center" :prop="isChinese ? 'titleZh' : 'titleEn'" />
      <el-table-column :label="$t('操作时间')" align="center" prop="createTime"">
chenwei's avatar
chenwei committed
51 52 53 54 55
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>

chenwei's avatar
chenwei committed
56
      <el-table-column :label="$t('点击时间')" align="center" prop="createTime" width="180">
chenwei's avatar
chenwei committed
57 58 59 60
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.triggerTime) || "--" }}</span>
        </template>
      </el-table-column>
chenwei's avatar
chenwei committed
61
      <el-table-column   width="180" :label="$t('ip')" align="center" prop="ipAddress" />
chenwei's avatar
chenwei committed
62 63 64
      <el-table-column :label="$t('积分')" align="center" prop="score" />
    </el-table>
    <!-- 分页组件 -->
chenwei's avatar
chenwei committed
65
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
chenwei's avatar
chenwei committed
66 67 68 69
  </div>
</template>

<script>
chenwei's avatar
chenwei committed
70
import { getShareRecordDetails } from "@/api/ecw/memberManagement"
chenwei's avatar
chenwei committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
export default {
  name: "EcwMembermanagementSharingdetailsIndex",
  components: {},
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 字典类型列表
      list: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      dateRangeCreateTime: [],
      // 查询参数
      queryParams: {
        page: 1,
        rows: 10,
        memberName: "", //操作人
        type: "", //分类
        title: "",
        relationSymbol: "", //查询条件
        totalScore: "",
        name: null,
        status: null,
        type: null,
        category: null,
chenwei's avatar
chenwei committed
104 105 106
        remark: null
      }
    }
chenwei's avatar
chenwei committed
107 108
  },
  created() {
chenwei's avatar
chenwei committed
109
    this.getList()
chenwei's avatar
chenwei committed
110 111 112
  },
  computed: {
    isChinese() {
chenwei's avatar
chenwei committed
113 114
      return this.$i18n.locale === "zh_CN"
    }
chenwei's avatar
chenwei committed
115 116 117 118 119
  },
  methods: {
    goShareDetails(row) {
      if (row.triggerCount != "0") {
        this.$router.push({
chenwei's avatar
chenwei committed
120
          path: "/member/memberManagement/sharingStatisticalDetails",
chenwei's avatar
chenwei committed
121
          query: {
chenwei's avatar
chenwei committed
122 123 124
            id: row.id
          }
        })
chenwei's avatar
chenwei committed
125 126 127 128
      }
    },
    /** 查询列表 */
    getList() {
chenwei's avatar
chenwei committed
129
      this.loading = true
chenwei's avatar
chenwei committed
130
      // 处理查询参数
chenwei's avatar
chenwei committed
131 132
      let params = { ...this.queryParams }
      this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime")
chenwei's avatar
chenwei committed
133 134
      // 执行查询
      getShareRecordDetails(params).then((response) => {
chenwei's avatar
chenwei committed
135 136 137 138
        this.list = response.data.list
        this.total = response.data.total
        this.loading = false
      })
chenwei's avatar
chenwei committed
139 140 141 142
    },

    /** 搜索按钮操作 */
    handleQuery() {
chenwei's avatar
chenwei committed
143 144
      this.queryParams.page = 1
      this.getList()
chenwei's avatar
chenwei committed
145 146 147
    },
    /** 重置按钮操作 */
    resetQuery() {
chenwei's avatar
chenwei committed
148 149 150 151 152 153 154 155
      this.dateRangeCreateTime = []
      this.queryParams.relationSymbol = ""
      this.queryParams.totalScore = ""
      this.resetForm("queryForm")
      this.handleQuery()
    }
  }
}
chenwei's avatar
chenwei committed
156
</script>