瀏覽代碼

推广员列表

lsx 2 年之前
父節點
當前提交
6e92dfafd3
共有 3 個文件被更改,包括 200 次插入0 次删除
  1. 12 0
      src/api/admin/promoters.js
  2. 185 0
      src/views/business/promoters/index.vue
  3. 3 0
      src/views/order/userTicket/detail.vue

+ 12 - 0
src/api/admin/promoters.js

@@ -0,0 +1,12 @@
+import request from '@/utils/request'
+
+
+// 查询列表
+export function promotersList(urlParams, data) {
+  return request({
+    url: '/api/v1/mp/admin/promoter/list',
+    method: 'post',
+    data: data,
+    urlParams: urlParams
+  })
+}

+ 185 - 0
src/views/business/promoters/index.vue

@@ -0,0 +1,185 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
+      label-width="75px"
+    >
+      <el-form-item label="门店名称" prop="siteName" label-width="90px">
+        <el-input
+          v-model="queryParams.siteName"
+          placeholder="请输入门店名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="推广员姓名" prop="name" label-width="90px">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入推广员姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="手机号码" prop="mobile">
+        <el-input
+          v-model="queryParams.mobile"
+          placeholder="请输入手机号码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="下单时间">
+        <el-date-picker @clear="handleQuery()" v-model="registeredTimeArr" type="datetimerange" size="small" value-format="timestamp" range-separator="至" start-placeholder="时间选择" end-placeholder="时间选择" @change="tardeTime">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="list" @sort-change="sortChannelId">
+      <!-- <el-table-column type="selection" width="55"  /> -->
+      <el-table-column label="推广员编号" sortable="custom" prop="channelId" min-width="110px"/>
+      <el-table-column label="推广员姓名" show-overflow-tooltip  prop="name" min-width="110px" >
+        <template slot-scope="scope">
+          <pre>{{scope.row.name}}</pre>
+        </template>
+      </el-table-column>
+      <el-table-column label="手机号码"  prop="mobile" min-width="120px"/>
+      <el-table-column label="佣金比例" sortable="custom" prop="commRate" min-width="100px">
+        <template slot-scope="{ row, column }">
+          <span>{{row.commRate}}%</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="门店名称" prop="siteName" min-width="100px" />
+      <el-table-column label="盲票销量" sortable="custom" prop="saleNum" min-width="100px"/>
+      <el-table-column label="销售额" sortable="custom" prop="saleAmt" min-width="100px"/>
+      <el-table-column label="佣金" sortable="custom" prop="commAmt" min-width="100px"/>
+      <el-table-column label="注册时间" prop="createdTime" min-width="160px">
+        <template slot-scope="{ row }">
+          {{ parseTime(row.createdTime) }}
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="pageParams.pageNum"
+      :limit.sync="pageParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { promotersList } from "@/api/admin/promoters";
+export default {
+  name: "Promoters",
+  components: {
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 门店表格数据
+      list: [],
+      // 状态数据字典
+      statusOptions: [],
+      // 查询参数
+      queryParams: {
+        endDate: "",
+        startDate: "",
+        name: "",
+        mobile: "",
+        siteName: ""
+      },
+      pageParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderByColumn: 't1.channelId',
+        isAsc: 'desc',
+      },
+      // 注册时间
+      registeredTimeArr: [],
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询门店列表 */
+    getList() {
+      this.loading = true;
+      promotersList('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&orderByColumn='+ this.pageParams.orderByColumn +'&isAsc='+ this.pageParams.isAsc +'&',this.queryParams).then(res => {
+        this.loading = false;
+        if(res.code === 0) {
+          this.list = res.rows;
+          this.total = res.total;
+        }
+      }).catch(res => {
+        this.loading = false;
+      });
+    },
+
+    // 切换排序
+    sortChannelId(row){
+      if (row){
+        let prop =  row.prop == 'channelId' || row.prop == 'commRate' ? ('t1.'+ row.prop) : row.prop;
+        this.pageParams.orderByColumn = prop
+        this.pageParams.isAsc = row.order=='ascending'?"asc":"desc";
+        this.getList()
+      }
+    },
+
+    // 岗位状态字典翻译
+    statusFormat(row, column) {
+      return this.selectDictLabel(this.statusOptions, row.status);
+    },
+    // 选择注册时间
+    tardeTime(e) {
+      if (e) {
+        this.queryParams.startTime = e[0];
+        this.queryParams.endTime = e[1];
+        this.handleQuery();
+      } else {
+        this.queryParams.startTime = "";
+        this.queryParams.endTime = "";
+        this.handleQuery();
+      }
+    },
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.pageParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.registeredTimeArr = [];
+      this.queryParams= {
+        endDate: "",
+        startDate: "",
+        name: "",
+        mobile: "",
+        siteName: ""
+      },
+        this.resetForm("queryForm");
+      this.handleQuery();
+    },
+  }
+};
+</script>

+ 3 - 0
src/views/order/userTicket/detail.vue

@@ -63,6 +63,9 @@
         <el-col :span="8" :xs="{span: 24, offset: 0}">
           <div class="title">门店:{{ info.channelName ? info.channelName : '--' }}</div>
         </el-col>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">推广员:{{ info.promoterName ? info.promoterName : '--' }}</div>
+        </el-col>
       </el-col>
     </el-row>
     <br>