Explorar o código

销售线索和个人页面完成

朱鑫波 %!s(int64=3) %!d(string=hai) anos
pai
achega
17084bb454

+ 80 - 1
src/api/sales/sale.js

@@ -33,6 +33,85 @@ export function saleClueDistribution(query) {
   return request({
   return request({
     url: '/sale/saleClueInfoController/saleClueDistribution',
     url: '/sale/saleClueInfoController/saleClueDistribution',
     method: 'post',
     method: 'post',
-    data: query
+    params: query
+  })
+}
+
+// 行业列表
+export function getIndustryInfoList(query) {
+  return request({
+    url: '/system/industry/getIndustryInfoList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 销售列表
+export function getUserByRoleName(query) {
+  return request({
+    url: '/system/user/getUserByRoleName',
+    method: 'get',
+    params: query
+  })
+}
+
+
+
+// 销售线索-查询用户代办以及本周完成数量汇总
+export function getTaskNumber(query) {
+  return request({
+    url: '/sale/saleClueInfoController/getTaskNumber',
+    method: 'get',
+    params: query
+  })
+}
+
+// 销售线索任务列表查询
+export function getSaleClueTaskList(query) {
+  return request({
+    url: '/sale/saleClueInfoController/selectSaleClueTaskList',
+    method: 'get',
+    params: query
   })
   })
 }
 }
+
+
+// 销售线索任务-回显线索详情
+export function getSaleTaskInfoBySellerId(query) {
+  return request({
+    url: '/sale/saleClueInfoController/getSaleTaskInfoBySellerId',
+    method: 'get',
+    params: query
+  })
+}
+
+
+
+// 销售线索任务-新增跟进
+export function addInsertSaleTaskRecord(query) {
+  return request({
+    url: '/sale/saleClueInfoController/insertSaleTaskRecord',
+    method: 'post',
+    params: query
+  })
+}
+
+
+// 转电销面销
+export function saleClueToOffline(query) {
+  return request({
+    url: '/sale/saleClueInfoController/saleClueToOffline',
+    method: 'post',
+    params: query
+  })
+}
+
+
+// 获取用户信息
+export function getUserRoleByUserId(query) {
+  return request({
+    url: '/system/user/getUserRoleByUserId',
+    method: 'get',
+    params: query
+  })
+}

+ 2 - 2
src/layout/components/Navbar.vue

@@ -9,13 +9,13 @@
       <template v-if="device!=='mobile'">
       <template v-if="device!=='mobile'">
         <search id="header-search" class="right-menu-item" />
         <search id="header-search" class="right-menu-item" />
         
         
-        <el-tooltip content="源码地址" effect="dark" placement="bottom">
+        <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
           <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
           <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
         </el-tooltip>
         </el-tooltip>
 
 
         <el-tooltip content="文档地址" effect="dark" placement="bottom">
         <el-tooltip content="文档地址" effect="dark" placement="bottom">
           <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
           <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
-        </el-tooltip>
+        </el-tooltip> -->
 
 
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
 
 

+ 1 - 0
src/store/getters.js

@@ -14,5 +14,6 @@ const getters = {
   topbarRouters:state => state.permission.topbarRouters,
   topbarRouters:state => state.permission.topbarRouters,
   defaultRoutes:state => state.permission.defaultRoutes,
   defaultRoutes:state => state.permission.defaultRoutes,
   sidebarRouters:state => state.permission.sidebarRouters,
   sidebarRouters:state => state.permission.sidebarRouters,
+  userId:state => state.user.userId
 }
 }
 export default getters
 export default getters

+ 8 - 1
src/store/modules/user.js

@@ -7,7 +7,8 @@ const user = {
     name: '',
     name: '',
     avatar: '',
     avatar: '',
     roles: [],
     roles: [],
-    permissions: []
+    permissions: [],
+    userId:''
   },
   },
 
 
   mutations: {
   mutations: {
@@ -17,6 +18,9 @@ const user = {
     SET_NAME: (state, name) => {
     SET_NAME: (state, name) => {
       state.name = name
       state.name = name
     },
     },
+    SET_USERID: (state, userId) => {
+      state.userId = userId
+    },
     SET_AVATAR: (state, avatar) => {
     SET_AVATAR: (state, avatar) => {
       state.avatar = avatar
       state.avatar = avatar
     },
     },
@@ -52,6 +56,7 @@ const user = {
         getInfo().then(res => {
         getInfo().then(res => {
           const user = res.user
           const user = res.user
           const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
           const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
+          localStorage.setItem('userInfo', res.user.userId)
           if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
           if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
             commit('SET_ROLES', res.roles)
             commit('SET_ROLES', res.roles)
             commit('SET_PERMISSIONS', res.permissions)
             commit('SET_PERMISSIONS', res.permissions)
@@ -60,6 +65,8 @@ const user = {
           }
           }
           commit('SET_NAME', user.userName)
           commit('SET_NAME', user.userName)
           commit('SET_AVATAR', avatar)
           commit('SET_AVATAR', avatar)
+          commit('SET_USERID', user.userId)
+          
           resolve(res)
           resolve(res)
         }).catch(error => {
         }).catch(error => {
           reject(error)
           reject(error)

+ 1 - 1
src/utils/request.js

@@ -17,7 +17,7 @@ const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: 'http://192.168.0.195:9003',
   baseURL: 'http://192.168.0.195:9003',
   // 超时
   // 超时
-  timeout: 10000
+  timeout: 300000
 })
 })
 
 
 // request拦截器
 // request拦截器

+ 2 - 2
src/views/login.vue

@@ -72,8 +72,8 @@ export default {
     return {
     return {
       codeUrl: "",
       codeUrl: "",
       loginForm: {
       loginForm: {
-        username: "admin",
-        password: "admin123",
+        username: "",
+        password: "",
         rememberMe: false,
         rememberMe: false,
         code: "",
         code: "",
         uuid: ""
         uuid: ""

+ 113 - 27
src/views/sales/index.vue

@@ -29,6 +29,7 @@
       </el-form-item>
       </el-form-item>
       <el-form-item label="行业" prop="industryId">
       <el-form-item label="行业" prop="industryId">
         <el-select
         <el-select
+          filterable
           v-model="queryParams.industryId"
           v-model="queryParams.industryId"
           placeholder="选择行业"
           placeholder="选择行业"
           clearable
           clearable
@@ -110,7 +111,6 @@
           icon="el-icon-document-add"
           icon="el-icon-document-add"
           size="mini"
           size="mini"
           @click="handleAdd"
           @click="handleAdd"
-          v-hasPermi="['system:dict:add']"
           >上传报表</el-button
           >上传报表</el-button
         >
         >
       </el-col>
       </el-col>
@@ -121,7 +121,6 @@
           icon="el-icon-s-custom"
           icon="el-icon-s-custom"
           size="mini"
           size="mini"
           @click="handleAllocation"
           @click="handleAllocation"
-          v-hasPermi="['system:dict:add']"
           :disabled="ids.length == 0"
           :disabled="ids.length == 0"
           >分配人员</el-button
           >分配人员</el-button
         >
         >
@@ -144,7 +143,6 @@
           icon="el-icon-refresh"
           icon="el-icon-refresh"
           size="mini"
           size="mini"
           @click="handleRefreshCache"
           @click="handleRefreshCache"
-          v-hasPermi="['system:dict:remove']"
           >刷新缓存</el-button
           >刷新缓存</el-button
         >
         >
       </el-col>
       </el-col>
@@ -159,7 +157,12 @@
       @selection-change="handleSelectionChange"
       @selection-change="handleSelectionChange"
       ref="multipleTable"
       ref="multipleTable"
     >
     >
-      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column
+        type="selection"
+        width="55"
+        align="center"
+        :selectable="selectable"
+      />
       <el-table-column label="卖家ID" align="center" prop="sellerId" />
       <el-table-column label="卖家ID" align="center" prop="sellerId" />
       <el-table-column label="卖家昵称" align="center" prop="sellerName" />
       <el-table-column label="卖家昵称" align="center" prop="sellerName" />
       <el-table-column label="行业" align="center" prop="industryName">
       <el-table-column label="行业" align="center" prop="industryName">
@@ -175,13 +178,7 @@
       </el-table-column>
       </el-table-column>
       <el-table-column label="是否跃迁" align="center" prop="transitionFlag">
       <el-table-column label="是否跃迁" align="center" prop="transitionFlag">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{
-            scope.row.transitionFlag > -1
-              ? scope.row.transitionFlag == 0
-                ? "否"
-                : "是"
-              : "-"
-          }}
+          {{ scope.row.transitionFlag ? scope.row.transitionFlag : "-" }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column
       <el-table-column
@@ -196,13 +193,7 @@
         :show-overflow-tooltip="true"
         :show-overflow-tooltip="true"
       >
       >
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{
-            scope.row.providerFlag > -1
-              ? scope.row.providerFlag == 0
-                ? "否"
-                : "是"
-              : "-"
-          }}
+          {{ scope.row.providerFlag ? scope.row.providerFlag : "-" }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="销售" align="center" prop="saleName">
       <el-table-column label="销售" align="center" prop="saleName">
@@ -210,6 +201,25 @@
           {{ scope.row.saleName ? scope.row.saleName : "-" }}
           {{ scope.row.saleName ? scope.row.saleName : "-" }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
+
+      <el-table-column label="GMV" align="center" prop="gmv">
+        <template slot-scope="scope">
+          <span v-if="scope.row.gmv">{{ scope.row.gmv }}</span>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="MTD" align="center" prop="mtd">
+        <template slot-scope="scope">
+          <span v-if="scope.row.mtd">{{ scope.row.mtd }}</span>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="近30天" align="center" prop="nearlyThirtyDays">
+        <template slot-scope="scope">
+          <span v-if="scope.row.nearlyThirtyDays">{{ scope.row.nearlyThirtyDays }}</span>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
       <el-table-column
       <el-table-column
         label="操作"
         label="操作"
         align="center"
         align="center"
@@ -221,8 +231,7 @@
             type="text"
             type="text"
             icon="el-icon-edit"
             icon="el-icon-edit"
             @click="handleAllocationOne(scope.row)"
             @click="handleAllocationOne(scope.row)"
-            :disabled="scope.row.saleName"
-            v-hasPermi="['system:dict:edit']"
+            :disabled="!!scope.row.saleName"
             >分配</el-button
             >分配</el-button
           >
           >
           <!-- <el-button
           <!-- <el-button
@@ -335,6 +344,7 @@
       <el-form label-width="80px">
       <el-form label-width="80px">
         <el-form-item label="选择销售" prop="sale">
         <el-form-item label="选择销售" prop="sale">
           <el-select
           <el-select
+            filterable
             v-model="saleId"
             v-model="saleId"
             placeholder="选择销售"
             placeholder="选择销售"
             clearable
             clearable
@@ -384,6 +394,9 @@ import {
   importSaleExcelOrCsv,
   importSaleExcelOrCsv,
   getSaleAllocationList,
   getSaleAllocationList,
   saleClueDistribution,
   saleClueDistribution,
+  getIndustryInfoList,
+  getUserByRoleName,
+  getUserRoleByUserId,
 } from "@/api/sales/sale";
 } from "@/api/sales/sale";
 export default {
 export default {
   name: "sale",
   name: "sale",
@@ -412,6 +425,8 @@ export default {
       openAllocation: false,
       openAllocation: false,
       // 选择的销售id
       // 选择的销售id
       saleId: undefined,
       saleId: undefined,
+      // 获取用户id
+      userId: undefined,
       // 销售列表
       // 销售列表
       saleList: [],
       saleList: [],
       // 分配销售确定loading
       // 分配销售确定loading
@@ -423,7 +438,7 @@ export default {
         pageNum: 1,
         pageNum: 1,
         pageSize: 10,
         pageSize: 10,
         sellerName: undefined,
         sellerName: undefined,
-        uploadDate: undefined,
+        uploadDate: new Date(),
         distributionSaleFlag: undefined,
         distributionSaleFlag: undefined,
         industryId: undefined,
         industryId: undefined,
         fansType: undefined,
         fansType: undefined,
@@ -482,9 +497,57 @@ export default {
     };
     };
   },
   },
   created() {
   created() {
-    this.getList();
+    this.userId = this.$store.getters.userId;
+    let date = new Date();
+    let y = date.getFullYear();
+    let MM = date.getMonth() + 1;
+    MM = MM < 10 ? "0" + MM : MM;
+    this.queryParams.uploadDate = `${y}-${MM}`;
+    this.getUserRoleByUserId();
+  },
+  mounted() {
+    this.$nextTick(() => {
+      // this.getList();
+      this.getIndustryInfoList();
+    });
   },
   },
   methods: {
   methods: {
+    /** 获取用户信息 */
+    getUserRoleByUserId() {
+      getUserRoleByUserId({ userId: this.userId })
+        .then((res) => {
+          if (res.data[0].role_key == "electricPin") {
+            this.queryParams.salesLeadsType = 2;
+          } else if (res.data[0].role_key == "facePin") {
+            this.queryParams.salesLeadsType = 3;
+          } else {
+            this.queryParams.salesLeadsType = 2;
+          }
+          this.getList();
+        })
+        .catch((error) => {});
+    },
+    /** 复选框禁用 */
+    selectable(row, index) {
+      if (!!row.saleName) {
+        return false;
+      } else {
+        return true;
+      }
+    },
+    /** 获取行业列表 */
+    getIndustryInfoList() {
+      getIndustryInfoList()
+        .then((res) => {
+          this.queryParamsList.industryList = res.data.map((item) => {
+            return {
+              label: item.name,
+              value: item.id,
+            };
+          });
+        })
+        .catch((err) => {});
+    },
     handleExceed(files, fileList) {
     handleExceed(files, fileList) {
       this.$message.warning(
       this.$message.warning(
         `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
         `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
@@ -552,9 +615,15 @@ export default {
     /** 重置按钮操作 */
     /** 重置按钮操作 */
     resetQuery() {
     resetQuery() {
       this.dateRange = [];
       this.dateRange = [];
-      this.queryParams.uploadDate = undefined;
+      let date = new Date();
+      let y = date.getFullYear();
+      let MM = date.getMonth() + 1;
+      MM = MM < 10 ? "0" + MM : MM;
+      this.queryParams.uploadDate = `${y}-${MM}`;
       this.resetForm("queryForm");
       this.resetForm("queryForm");
-      this.handleQuery();
+      this.queryParams.pageNum = 1;
+      // this.handleQuery();
+      this.getUserRoleByUserId();
     },
     },
     /** 新增按钮操作 */
     /** 新增按钮操作 */
     handleAdd() {
     handleAdd() {
@@ -568,6 +637,7 @@ export default {
     },
     },
     /** 单条销售线索分配列表 */
     /** 单条销售线索分配列表 */
     handleAllocationOne(item) {
     handleAllocationOne(item) {
+      console.log(item);
       this.getAllocationList(item.sellerId);
       this.getAllocationList(item.sellerId);
     },
     },
     /** 多销售线索分配列表 */
     /** 多销售线索分配列表 */
@@ -579,6 +649,7 @@ export default {
       var params = {};
       var params = {};
       if (sellerIds) {
       if (sellerIds) {
         params.sellerIds = sellerIds;
         params.sellerIds = sellerIds;
+        this.ids = [sellerIds];
       } else {
       } else {
         params.sellerIds = this.ids.join();
         params.sellerIds = this.ids.join();
       }
       }
@@ -588,6 +659,16 @@ export default {
             this.openAllocation = true;
             this.openAllocation = true;
             this.title = "分配销售";
             this.title = "分配销售";
             this.saleAllocationList = res.data;
             this.saleAllocationList = res.data;
+            getUserByRoleName({ roleName: "electricPin,facePin" })
+              .then((res) => {
+                this.saleList = res.data.map((item) => {
+                  return {
+                    value: item.user_id,
+                    label: item.nick_name,
+                  };
+                });
+              })
+              .catch((error) => {});
           }
           }
         })
         })
         .catch((err) => {
         .catch((err) => {
@@ -605,12 +686,17 @@ export default {
       } else {
       } else {
         this.confirmLoadingSale = true;
         this.confirmLoadingSale = true;
         saleClueDistribution({
         saleClueDistribution({
-          sellerIds: this.ids.join(),
+          sellerIds: this.saleAllocationList
+            .map((item) => {
+              return item.sellerId;
+            })
+            .join(),
           saleId: this.saleId,
           saleId: this.saleId,
-          createUserId: 1,
+          createUserId: this.userId,
         })
         })
           .then((res) => {
           .then((res) => {
             this.openAllocation = false;
             this.openAllocation = false;
+            this.confirmLoadingSale = false;
             this.saleId = undefined;
             this.saleId = undefined;
             this.$refs.multipleTable.clearSelection();
             this.$refs.multipleTable.clearSelection();
             this.handleQuery();
             this.handleQuery();
@@ -640,7 +726,7 @@ export default {
             formData.append("file", this.dateFile);
             formData.append("file", this.dateFile);
             formData.append("salesLeadsType", this.form.salesLeadsType);
             formData.append("salesLeadsType", this.form.salesLeadsType);
             formData.append("uploadDate", this.form.uploadDate);
             formData.append("uploadDate", this.form.uploadDate);
-            formData.append("createUserId", 1);
+            formData.append("createUserId", this.userId);
             importSaleExcelOrCsv(formData)
             importSaleExcelOrCsv(formData)
               .then((res) => {
               .then((res) => {
                 this.confirmLoading = false;
                 this.confirmLoading = false;

+ 805 - 0
src/views/sales/saleHtml.vue

@@ -0,0 +1,805 @@
+<template>
+  <div class="app-container">
+    <el-row class="top-sum">
+      <el-col :span="8">
+        <el-card shadow="never" class="card-show">
+          <p class="p-title">我的待办</p>
+          <p class="p-main">{{ taskNumber.noStarted }}个任务</p>
+        </el-card>
+      </el-col>
+      <el-col :span="8">
+        <el-card shadow="never" class="card-show">
+          <p class="p-title">本周电联主播数量</p>
+          <p class="p-main">-</p>
+        </el-card>
+      </el-col>
+      <el-col :span="8">
+        <el-card shadow="never" class="card-show">
+          <p class="p-title">本周完成任务数</p>
+          <p class="p-main">{{ taskNumber.complete }}个任务</p>
+        </el-card>
+      </el-col>
+    </el-row>
+
+    <el-card shadow="never" class="card-show">
+      <div slot="header" class="clearfix">
+        <span style="display: inline-block; line-height: 2">任务列表</span>
+        <div style="float: right; padding: 3px 0; display: flex">
+          <el-radio-group
+            v-model="queryParams.state"
+            size="mini"
+            @change="getList"
+          >
+            <el-radio-button
+              plain
+              :label="item.value"
+              v-for="item in queryParamsList.stateList"
+              :key="item.value"
+              >{{ item.label }}</el-radio-button
+            >
+          </el-radio-group>
+          <el-input
+            size="mini"
+            placeholder="请输入卖家昵称"
+            v-model="queryParams.sellerName"
+            style="width: 300px; margin-left: 15px"
+          >
+            <el-button
+              slot="append"
+              icon="el-icon-search"
+              @click="handleQuery"
+            ></el-button>
+          </el-input>
+        </div>
+      </div>
+
+      <el-table
+        v-loading="loading"
+        :data="typeList"
+        @selection-change="handleSelectionChange"
+        ref="multipleTable"
+      >
+        <el-table-column label="卖家昵称" align="center" prop="sellerName" />
+        <el-table-column label="行业" align="center" prop="industryName">
+          <template slot-scope="scope">
+            {{ scope.row.industryName ? scope.row.industryName : "-" }}
+          </template>
+        </el-table-column>
+        <el-table-column label="常驻城市" align="center" prop="cityName" />
+        <el-table-column label="卖家粉丝数" align="center" prop="fans">
+          <template slot-scope="scope">
+            {{ scope.row.fans ? scope.row.fans : "-" }}
+          </template>
+        </el-table-column>
+        <el-table-column label="销售" align="center" prop="saleName">
+          <template slot-scope="scope">
+            {{ scope.row.saleName ? scope.row.saleName : "-" }}
+          </template>
+        </el-table-column>
+        <el-table-column label="跟进进度" align="center" prop="continueFlag">
+          <template slot-scope="scope">
+            <span v-if="scope.row.recordTask">
+              {{ scope.row.recordTask.continueFlag | continueFlagText }}
+            </span>
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="跟进详情"
+          align="center"
+          prop="recordInfo"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            {{ scope.row.recordTask ? scope.row.recordTask.recordInfo : "-" }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="跟进结果"
+          align="center"
+          prop="intendedCooperation"
+        >
+          <template slot-scope="scope">
+            <span v-if="scope.row.recordTask">
+              {{
+                scope.row.recordTask.intendedCooperation
+                  | intendedCooperationText
+              }}
+            </span>
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="备注"
+          show-overflow-tooltip
+          align="center"
+          prop="intendedCooperation"
+        >
+          <template slot-scope="scope">
+            <span v-if="scope.row.recordTask && scope.row.recordTask.remarks">
+              {{ scope.row.recordTask.remarks }}
+            </span>
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          label="操作"
+          align="center"
+          class-name="small-padding fixed-width"
+        >
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-edit"
+              @click="handleUpdate(scope.row)"
+              :disabled="scope.row.state == 3"
+              >编辑</el-button
+            >
+            <el-dropdown
+              @command="handleEdit($event, scope.row)"
+              :disabled="scope.row.state == 3"
+            >
+              <span class="el-dropdown-link">
+                <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-arrow-down el-icon--right"
+                  :disabled="scope.row.state == 3"
+                  >更多</el-button
+                >
+              </span>
+
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item command="editSale">转销售</el-dropdown-item>
+                <el-dropdown-item command="editType">转面销</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </el-card>
+    <!-- 添加或修改参数配置对话框 -->
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="1000px"
+      append-to-body
+    >
+      <el-descriptions title="" v-if="formDataShow" style="margin-bottom: 15px">
+        <el-descriptions-item label="卖家昵称"
+          >{{ formDataShow.saleRecordVo.sellerName }}({{
+            formDataShow.saleRecordVo.sellerId
+          }})</el-descriptions-item
+        >
+        <el-descriptions-item label="粉丝数">{{
+          formDataShow.saleRecordVo.fans
+        }}</el-descriptions-item>
+        <el-descriptions-item label="联系方式">{{
+          formDataShow.saleRecordVo.telephone
+        }}</el-descriptions-item>
+        <el-descriptions-item label="行业">{{
+          formDataShow.saleRecordVo.industryName
+            ? formDataShow.saleRecordVo.industryName
+            : "-"
+        }}</el-descriptions-item>
+        <el-descriptions-item label="所属地区">{{
+          formDataShow.saleRecordVo.cityName
+        }}</el-descriptions-item>
+        <el-descriptions-item label="是否绑定服务商">{{
+          formDataShow.saleRecordVo.providerFlag == 0 ? "否" : "是"
+        }}</el-descriptions-item>
+
+        <el-descriptions-item label="MTD">{{
+          formDataShow.saleRecordVo.mtd ? formDataShow.saleRecordVo.mtd : "-"
+        }}</el-descriptions-item>
+        <el-descriptions-item label="GMV">{{
+          formDataShow.saleRecordVo.gmv ? formDataShow.saleRecordVo.gmv : "-"
+        }}</el-descriptions-item>
+        <el-descriptions-item label="近30天">{{
+          formDataShow.saleRecordVo.nearlyThirtyDays
+            ? formDataShow.saleRecordVo.nearlyThirtyDays
+            : "-"
+        }}</el-descriptions-item>
+      </el-descriptions>
+      <div v-if="formDataShow">
+        <el-descriptions
+          title=""
+          style="margin-bottom: 15px"
+          v-for="item in formDataShow.recordList"
+        >
+          <el-descriptions-item
+            :label="`第${item.recordTimes}次跟进时间`"
+            :span="1"
+            >{{ item.createTime }}</el-descriptions-item
+          >
+          <el-descriptions-item
+            :label="`第${item.recordTimes}次跟进话术`"
+            :span="2"
+            >{{
+              item.recordScript
+                ? item.recordScript == "1"
+                  ? "扶持"
+                  : "活动"
+                : "-"
+            }}</el-descriptions-item
+          >
+          <el-descriptions-item
+            :label="`第${item.recordTimes}次跟进记录`"
+            :span="3"
+            >{{ item.recordInfo }}</el-descriptions-item
+          >
+        </el-descriptions>
+      </div>
+
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="跟进次数" prop="salesLeadsType">
+          第{{ formDataShow ? formDataShow.nextNum : 1 }}次跟进
+        </el-form-item>
+        <el-form-item label="跟进详情" prop="recordInfo">
+          <el-input
+            type="textarea"
+            :rows="2"
+            placeholder="请输入内容"
+            v-model="form.recordInfo"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item label="跟进话术" prop="recordScript">
+          <el-select
+            v-model="form.recordScript"
+            placeholder="选择类别"
+            clearable
+            style="width: 240px"
+          >
+            <el-option
+              v-for="item in formList.recordScriptList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="继续跟进" prop="continueFlag">
+          <el-select
+            v-model="form.continueFlag"
+            placeholder="选择类别"
+            clearable
+            style="width: 240px"
+          >
+            <el-option
+              v-for="item in formList.continueFlagList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          label="合作状态"
+          prop="intendedCooperation"
+          v-if="form.continueFlag == 2"
+          class="content-one"
+        >
+          <el-select
+            v-model="form.intendedCooperation"
+            placeholder="选择类别"
+            clearable
+            style="width: 240px"
+          >
+            <el-option
+              v-for="item in formList.intendedCooperationList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input placeholder="请输入内容" v-model="form.remarks"> </el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm" :loading="confirmLoading"
+          >确 定</el-button
+        >
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 分配销售-->
+    <el-dialog
+      :title="title"
+      :visible.sync="openAllocation"
+      width="500px"
+      append-to-body
+    >
+      <el-form label-width="80px" size="mini">
+        <el-form-item label="选择销售" prop="sale">
+          <el-select
+            filterable
+            v-model="saleId"
+            placeholder="选择销售"
+            clearable
+            style="width: 240px"
+          >
+            <el-option
+              v-for="item in saleList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button
+          type="primary"
+          @click="submitSale"
+          :loading="confirmLoadingSale"
+          >确 定</el-button
+        >
+        <el-button
+          @click="
+            openAllocation = false;
+            confirmLoadingSale = false;
+            saleId = undefined;
+            saleAllocationList = [];
+          "
+          >取 消</el-button
+        >
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listType,
+  getType,
+  delType,
+  addType,
+  updateType,
+  refreshCache,
+} from "@/api/system/dict/type";
+import {
+  getSaleAllocationList,
+  saleClueDistribution,
+  getIndustryInfoList,
+  getUserByRoleName,
+  getTaskNumber,
+  getSaleClueTaskList,
+  getSaleTaskInfoBySellerId,
+  addInsertSaleTaskRecord,
+  saleClueToOffline,
+} from "@/api/sales/sale";
+export default {
+  name: "sale-html",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 字典表格数据
+      typeList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 分配销售
+      openAllocation: false,
+      // 选择的销售id
+      saleId: undefined,
+      // 销售列表
+      saleList: [],
+      // 分配销售确定loading
+      confirmLoadingSale: false,
+      // 汇总数据获取
+      taskNumber: {
+        complete: 0,
+        noStarted: 0,
+      },
+      userId: undefined,
+      // 日期范围
+      dateRange: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        sellerName: undefined,
+        state: null,
+      },
+      //查询参数所用下拉数据
+      queryParamsList: {
+        stateList: [
+          { value: null, label: "全部" },
+          { value: 1, label: "未开始" },
+          { value: 2, label: "进行中" },
+          { value: 3, label: "已结束" },
+        ], //粉丝量级
+      },
+      // 销售线索回显
+      formDataShow: null,
+      // 表单参数
+      form: {},
+      //上传报表下拉数据
+      formList: {
+        recordScriptList: [
+          { value: 1, label: "扶持" },
+          { value: 2, label: "活动" },
+        ], //跟进话术
+        continueFlagList: [
+          { value: 1, label: "继续跟进" },
+          { value: 2, label: "意向合作" },
+          { value: 3, label: "跟进完成无合作" },
+        ], //是否继续跟进
+        intendedCooperationList: [
+          { value: 1, label: "不合作可跟进" },
+          { value: 2, label: "添加微信" },
+          { value: 3, label: "操盘合作" },
+          { value: 4, label: "服务商合作" },
+          { value: 5, label: "金牛合作" },
+          { value: 6, label: "无法添加微信" },
+        ], // 意向合作
+      },
+      fileList: [],
+      //获取销售线索文件流
+      dateFile: null,
+      //销售线索上传loading
+      confirmLoading: false,
+      // 表单校验
+      rules: {
+        recordInfo: [
+          { required: true, message: "跟进详情不能为空", trigger: "blur" },
+          {
+            min: 2,
+            max: 500,
+            message: "跟进详情最多500个字,最少2个字",
+            trigger: "blur",
+          },
+        ],
+        recordScript: [
+          { required: false, message: "跟进详情不能为空", trigger: "blur" },
+        ],
+        continueFlag: [
+          { required: true, message: "是否继续跟进必选", trigger: "change" },
+        ],
+        remarks: [
+          {
+            min: 2,
+            max: 500,
+            message: "备注最多500个字,最少2个字",
+            trigger: "change",
+          },
+        ],
+      },
+      // 分配销售展示列表
+      saleAllocationList: [],
+    };
+  },
+  filters: {
+    continueFlagText(status) {
+      const statusMap = {
+        1: "继续跟进",
+        2: "意向合作",
+        3: "跟进完成无合作",
+      };
+      return statusMap[status];
+    },
+    intendedCooperationText(status) {
+      const statusMap = {
+        1: "不合作可跟进",
+        2: "添加微信",
+        3: "操盘合作",
+        4: "服务商合作",
+        5: "金牛合作",
+        6: "无法添加微信",
+      };
+      return statusMap[status];
+    },
+  },
+  created() {
+    this.userId = this.$store.getters.userId;
+    this.getList();
+    this.getIndustryInfoList();
+    this.getTaskNumber();
+  },
+  methods: {
+    /** 更多操作 */
+    handleEdit(item, id) {
+      this.ids = id.sellerId;
+      if (item == "editSale") {
+        this.getAllocationList();
+      } else {
+        this.$confirm("是否确认该线索转给面销?", "提示", {
+          confirmButtonText: "是",
+          cancelButtonText: "否",
+          type: "warning",
+        })
+          .then(() => {
+            this.getAllocationList();
+          })
+          .catch(() => {
+            this.$message({
+              type: "info",
+              message: "已取消",
+            });
+          });
+      }
+    },
+    /** 获取行业列表 */
+    getIndustryInfoList() {
+      getIndustryInfoList()
+        .then((res) => {
+          this.queryParamsList.industryList = res.data.map((item) => {
+            return {
+              label: item.name,
+              value: item.id,
+            };
+          });
+        })
+        .catch((err) => {});
+    },
+    /** 获取top汇总数据 */
+    getTaskNumber() {
+      getTaskNumber({ userId: this.userId })
+        .then((res) => {
+          this.taskNumber.complete = res.data.complete;
+          this.taskNumber.noStarted = res.data.noStarted;
+        })
+        .catch((error) => {
+          this.taskNumber = { complete: 0, noStarted: 0 };
+        });
+    },
+
+    handleExceed(files, fileList) {
+      this.$message.warning(
+        `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
+          files.length + fileList.length
+        } 个文件`
+      );
+    },
+    beforeRemove(file, fileList) {
+      return false;
+    },
+    /** 删除文件 */
+    handleRemove(file, fileList) {
+      console.log(file, fileList);
+    },
+    /** 上传文件 */
+    handlePreview(file) {
+      console.log(file);
+    },
+    /** 上传文件前验证 */
+    handleBeforeUpload(file) {
+      console.log(file);
+      const fileSuffix = ["xlsx", "xls", "csv"];
+      const fileName = file.name;
+      const fileStrArr = fileName.split(".");
+      const suffix = fileStrArr[fileStrArr.length - 1];
+
+      let result = fileSuffix.some((item) => {
+        return item === suffix;
+      });
+
+      if (!result) {
+        this.$message.error("不支持该文件类型");
+        this.loadDisabled = false;
+        return false;
+      }
+      this.dateFile = file;
+      return false;
+    },
+    /** 查询字典类型列表 */
+    getList() {
+      this.loading = true;
+      getSaleClueTaskList({ ...this.queryParams, userId: this.userId }).then(
+        (response) => {
+          console.log(response.data.rows);
+          this.typeList = response.data.rows;
+          this.total = response.data.total;
+          this.loading = false;
+        }
+      );
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.confirmLoading = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {};
+      this.dateFile = null;
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams.uploadDate = undefined;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "上传报表";
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.sellerId);
+    },
+    /** 单条销售线索分配列表 */
+    handleAllocationOne(item) {
+      this.getAllocationList(item.sellerId);
+    },
+    /** 多销售线索分配列表 */
+    handleAllocation() {
+      this.getAllocationList(null);
+    },
+    /** 获取分配销售列表 */
+    getAllocationList(sellerIds) {
+      this.openAllocation = true;
+      this.title = "转销售";
+      getUserByRoleName({ roleName: "electricPin,facePin" })
+        .then((res) => {
+          this.saleList = res.data.map((item) => {
+            return {
+              value: item.user_id,
+              label: item.nick_name,
+            };
+          });
+        })
+        .catch((error) => {});
+    },
+    // 销售列表删除
+    removeListOne(index) {
+      this.saleAllocationList.splice(index, 1);
+    },
+    // 分配销售确定
+    submitSale() {
+      if (!this.saleId) {
+        this.$message.error("请选择销售");
+      } else {
+        this.confirmLoadingSale = true;
+        saleClueDistribution({
+          sellerIds: this.ids,
+          saleId: this.saleId,
+          createUserId: this.userId,
+        })
+          .then((res) => {
+            this.openAllocation = false;
+            this.confirmLoadingSale = false;
+            this.saleId = undefined;
+            this.handleQuery();
+          })
+          .catch((err) => {
+            this.confirmLoadingSale = false;
+          });
+      }
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.open = true;
+      this.title = "跟进填写";
+      getSaleTaskInfoBySellerId({ sellerId: row.sellerId })
+        .then((res) => {
+          this.formDataShow = res.data;
+        })
+        .catch((error) => {});
+    },
+    /** 提交按钮 */
+    submitForm: function () {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          this.confirmLoading = true;
+          let formData = {};
+          formData.continueFlag = this.form.continueFlag;
+          formData.createUserId = this.userId;
+          formData.intendedCooperation =
+            this.form.continueFlag == 2
+              ? !this.form.intendedCooperation
+                ? null
+                : this.form.intendedCooperation
+              : null;
+          formData.recordInfo = this.form.recordInfo;
+          formData.recordScript = !this.form.recordScript
+            ? null
+            : this.form.recordScript;
+          formData.remarks = this.form.remarks;
+          formData.sellerId = this.formDataShow.saleRecordVo.sellerId;
+          formData.recordTimes = this.formDataShow.nextNum;
+          addInsertSaleTaskRecord(formData)
+            .then((res) => {
+              this.confirmLoading = false;
+              this.$message.success("添加跟进成功");
+              this.cancel();
+              this.handleQuery();
+            })
+            .catch((err) => {
+              this.confirmLoading = false;
+            });
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const dictIds = row.dictId || this.ids;
+      this.$modal
+        .confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?')
+        .then(function () {
+          return delType(dictIds);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        "system/dict/type/export",
+        {
+          ...this.queryParams,
+        },
+        `type_${new Date().getTime()}.xlsx`
+      );
+    },
+    /** 刷新缓存按钮操作 */
+    handleRefreshCache() {
+      refreshCache().then(() => {
+        this.$modal.msgSuccess("刷新成功");
+      });
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.top-sum {
+  margin-bottom: 15px;
+  ::v-deep .card-show {
+    text-align: center;
+    .p-title {
+      width: 100%;
+      font-size: 10px;
+      color: darkgray;
+      font-weight: bold;
+    }
+    .p-main {
+      width: 100%;
+      font-size: 20px;
+      font-weight: bold;
+    }
+  }
+}
+::v-deep .el-form-item__label {
+  white-space: nowrap;
+}
+</style>

+ 706 - 0
src/views/trader/index.vue

@@ -0,0 +1,706 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="100px"
+    >
+      <el-form-item label="卖家昵称" prop="sellerName">
+        <el-input
+          v-model="queryParams.sellerName"
+          placeholder="请输入卖家昵称"
+          clearable
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="选择日期">
+        <el-date-picker
+          v-model="queryParams.uploadDate"
+          type="month"
+          placeholder="选择月"
+          style="width: 240px"
+          value-format="yyyy-MM"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="行业" prop="industryId">
+        <el-select
+          v-model="queryParams.industryId"
+          placeholder="选择行业"
+          clearable
+          style="width: 240px"
+        >
+          <el-option
+            v-for="item in queryParamsList.industryList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="是否分配销售" prop="distributionSaleFlag">
+        <el-select
+          v-model="queryParams.distributionSaleFlag"
+          placeholder="是否分配销售"
+          clearable
+          style="width: 240px"
+        >
+          <el-option
+            v-for="item in queryParamsList.distributionSaleFlagList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="粉丝量级" prop="fansType">
+        <el-select
+          v-model="queryParams.fansType"
+          placeholder="粉丝量级"
+          clearable
+          style="width: 240px"
+        >
+          <el-option
+            v-for="item in queryParamsList.fansList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="类别" prop="salesLeadsType">
+        <el-select
+          v-model="queryParams.salesLeadsType"
+          placeholder="请选择类别"
+          clearable
+          style="width: 240px"
+        >
+          <el-option
+            v-for="item in queryParamsList.salesLeadsTypeList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </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">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-document-add"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:dict:add']"
+          >上传报表</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-s-custom"
+          size="mini"
+          @click="handleAllocation"
+          v-hasPermi="['system:dict:add']"
+          :disabled="ids.length == 0"
+          >分配人员</el-button
+        >
+      </el-col>
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-printer"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:dict:add']"
+          >报表导出</el-button
+        >
+      </el-col> -->
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-refresh"
+          size="mini"
+          @click="handleRefreshCache"
+          v-hasPermi="['system:dict:remove']"
+          >刷新缓存</el-button
+        >
+      </el-col>
+      <!-- <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar> -->
+    </el-row>
+    <el-table
+      v-loading="loading"
+      :data="typeList"
+      @selection-change="handleSelectionChange"
+      ref="multipleTable"
+    >
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="卖家ID" align="center" prop="sellerId" />
+      <el-table-column label="卖家昵称" align="center" prop="sellerName" />
+      <el-table-column label="行业" align="center" prop="industryName">
+        <template slot-scope="scope">
+          {{ scope.row.industryName ? scope.row.industryName : "-" }}
+        </template>
+      </el-table-column>
+      <el-table-column label="常驻城市" align="center" prop="cityName" />
+      <el-table-column label="卖家粉丝数" align="center" prop="fans">
+        <template slot-scope="scope">
+          {{ scope.row.fans ? scope.row.fans : "-" }}
+        </template>
+      </el-table-column>
+      <el-table-column label="是否跃迁" align="center" prop="transitionFlag">
+        <template slot-scope="scope">
+          {{
+            scope.row.transitionFlag > -1
+              ? scope.row.transitionFlag == 0
+                ? "否"
+                : "是"
+              : "-"
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="联系方式"
+        align="center"
+        prop="telephone"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column
+        label="是否绑定服务商"
+        align="center"
+        :show-overflow-tooltip="true"
+      >
+        <template slot-scope="scope">
+          {{
+            scope.row.providerFlag > -1
+              ? scope.row.providerFlag == 0
+                ? "否"
+                : "是"
+              : "-"
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column label="销售" align="center" prop="saleName">
+        <template slot-scope="scope">
+          {{ scope.row.saleName ? scope.row.saleName : "-" }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleAllocationOne(scope.row)"
+            :disabled="scope.row.saleName"
+            v-hasPermi="['system:dict:edit']"
+            >分配</el-button
+          >
+          <!-- <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:dict:remove']"
+            >删除</el-button
+          > -->
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改参数配置对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="选择类别" prop="salesLeadsType">
+          <el-select
+            v-model="form.salesLeadsType"
+            placeholder="选择类别"
+            clearable
+            style="width: 240px"
+          >
+            <el-option
+              v-for="item in formList.salesLeadsTypeList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="选择月份" prop="uploadDate">
+          <el-date-picker
+            v-model="form.uploadDate"
+            type="month"
+            placeholder="选择月"
+            style="width: 240px"
+            value-format="yyyy-MM"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="销售线索">
+          <el-upload
+            class="upload-demo"
+            action="http://192.168.0.195:9003/sale/saleClueInfoController/importSaleExcelOrCsv"
+            :before-upload="handleBeforeUpload"
+            :on-preview="handlePreview"
+            :on-remove="handleRemove"
+            :before-remove="beforeRemove"
+            accept=""
+            :on-exceed="handleExceed"
+            :file-list="fileList"
+            :show-file-list="false"
+          >
+            <el-button size="small" icon="el-icon-upload">点击上传</el-button>
+            <div slot="tip" class="el-upload__tip">
+              只能上传.csv .xlsx .xls文件
+              <br />
+              <span v-if="!!dateFile">{{ dateFile.name }}</span>
+            </div>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm" :loading="confirmLoading"
+          >确 定</el-button
+        >
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 分配销售-->
+    <el-dialog
+      :title="title"
+      :visible.sync="openAllocation"
+      width="1000px"
+      append-to-body
+    >
+      <div
+        v-for="(item, index) in saleAllocationList"
+        :key="item.id"
+        style="margin-bottom: 10px; display: flex"
+      >
+        <el-descriptions title="">
+          <el-descriptions-item label="卖家昵称"
+            >{{ item.sellerName }}({{ item.sellerId }})</el-descriptions-item
+          >
+          <el-descriptions-item label="粉丝数">{{
+            item.fans
+          }}</el-descriptions-item>
+          <el-descriptions-item label="联系方式">{{
+            item.telephone
+          }}</el-descriptions-item>
+        </el-descriptions>
+        <i
+          class="el-icon-delete"
+          style="cursor: pointer"
+          v-if="saleAllocationList.length > 1"
+          @click="removeListOne(index)"
+        ></i>
+      </div>
+      <el-form label-width="80px">
+        <el-form-item label="选择销售" prop="sale">
+          <el-select
+            v-model="saleId"
+            placeholder="选择销售"
+            clearable
+            style="width: 240px"
+          >
+            <el-option
+              v-for="item in saleList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button
+          type="primary"
+          @click="submitSale"
+          :loading="confirmLoadingSale"
+          >确 定</el-button
+        >
+        <el-button
+          @click="
+            openAllocation = false;
+            confirmLoadingSale = false;
+            saleId = undefined;
+            saleAllocationList = [];
+          "
+          >取 消</el-button
+        >
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listType,
+  getType,
+  delType,
+  addType,
+  updateType,
+  refreshCache,
+} from "@/api/system/dict/type";
+import {
+  getSaleList,
+  importSaleExcelOrCsv,
+  getSaleAllocationList,
+  saleClueDistribution,
+} from "@/api/sales/sale";
+export default {
+  name: "sale",
+  dicts: ["sys_normal_disable"],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 字典表格数据
+      typeList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 分配销售
+      openAllocation: false,
+      // 选择的销售id
+      saleId: undefined,
+      // 销售列表
+      saleList: [],
+      // 分配销售确定loading
+      confirmLoadingSale: false,
+      // 日期范围
+      dateRange: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        sellerName: undefined,
+        uploadDate: undefined,
+        distributionSaleFlag: undefined,
+        industryId: undefined,
+        fansType: undefined,
+        salesLeadsType: undefined,
+        userId: undefined,
+      },
+      //查询参数所用下拉数据
+      queryParamsList: {
+        industryList: [], //行业下拉
+        fansList: [
+          { value: 1, label: "0~50W" },
+          { value: 2, label: "50W~200W" },
+          { value: 3, label: "200W~500W" },
+          { value: 4, label: "500W以上" },
+        ], //粉丝量级
+        distributionSaleFlagList: [
+          { value: 0, label: "否" },
+          { value: 1, label: "是" },
+        ], //是否分配销售
+        salesLeadsTypeList: [
+          { value: 1, label: "50W低潜" },
+          { value: 2, label: "50W中高潜" },
+          { value: 3, label: "200W高潜" },
+          { value: 4, label: "200W~500W" },
+          { value: 5, label: "500W以上" },
+        ], //销售线索类型
+      },
+      // 表单参数
+      form: {},
+      //上传报表下拉数据
+      formList: {
+        salesLeadsTypeList: [
+          { value: 1, label: "50W低潜" },
+          { value: 2, label: "50W中高潜" },
+          { value: 3, label: "200W高潜" },
+          { value: 4, label: "200W~500W" },
+          { value: 5, label: "500W以上" },
+        ], //销售线索类型
+      },
+      fileList: [],
+      //获取销售线索文件流
+      dateFile: null,
+      //销售线索上传loading
+      confirmLoading: false,
+      // 表单校验
+      rules: {
+        salesLeadsType: [
+          { required: true, message: "选择类别不能为空", trigger: "blur" },
+        ],
+        uploadDate: [
+          { required: true, message: "月份不能为空", trigger: "blur" },
+        ],
+      },
+      // 分配销售展示列表
+      saleAllocationList: [],
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    handleExceed(files, fileList) {
+      this.$message.warning(
+        `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
+          files.length + fileList.length
+        } 个文件`
+      );
+    },
+    beforeRemove(file, fileList) {
+      return false;
+    },
+    /** 删除文件 */
+    handleRemove(file, fileList) {
+      console.log(file, fileList);
+    },
+    /** 上传文件 */
+    handlePreview(file) {
+      console.log(file);
+    },
+    /** 上传文件前验证 */
+    handleBeforeUpload(file) {
+      console.log(file);
+      const fileSuffix = ["xlsx", "xls", "csv"];
+      const fileName = file.name;
+      const fileStrArr = fileName.split(".");
+      const suffix = fileStrArr[fileStrArr.length - 1];
+
+      let result = fileSuffix.some((item) => {
+        return item === suffix;
+      });
+
+      if (!result) {
+        this.$message.error("不支持该文件类型");
+        this.loadDisabled = false;
+        return false;
+      }
+      this.dateFile = file;
+      return false;
+    },
+    /** 查询字典类型列表 */
+    getList() {
+      this.loading = true;
+      getSaleList(this.queryParams).then((response) => {
+        this.typeList = response.data.rows;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.confirmLoading = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {};
+      this.dateFile = null;
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams.uploadDate = undefined;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "上传报表";
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.sellerId);
+    },
+    /** 单条销售线索分配列表 */
+    handleAllocationOne(item) {
+      this.getAllocationList(item.sellerId);
+    },
+    /** 多销售线索分配列表 */
+    handleAllocation() {
+      this.getAllocationList(null);
+    },
+    /** 获取分配销售列表 */
+    getAllocationList(sellerIds) {
+      var params = {};
+      if (sellerIds) {
+        params.sellerIds = sellerIds;
+      } else {
+        params.sellerIds = this.ids.join();
+      }
+      getSaleAllocationList(params)
+        .then((res) => {
+          if (res.code === 200) {
+            this.openAllocation = true;
+            this.title = "分配销售";
+            this.saleAllocationList = res.data;
+          }
+        })
+        .catch((err) => {
+          this.$message.error("分配销售列表数据请求出错");
+        });
+    },
+    // 销售列表删除
+    removeListOne(index) {
+      this.saleAllocationList.splice(index, 1);
+    },
+    // 分配销售确定
+    submitSale() {
+      if (!this.saleId) {
+        this.$message.error("请选择销售");
+      } else {
+        this.confirmLoadingSale = true;
+        saleClueDistribution({
+          sellerIds: this.ids.join(),
+          saleId: this.saleId,
+          createUserId: 1,
+        })
+          .then((res) => {
+            this.openAllocation = false;
+            this.saleId = undefined;
+            this.$refs.multipleTable.clearSelection();
+            this.handleQuery();
+          })
+          .catch((err) => {
+            this.confirmLoadingSale = false;
+          });
+      }
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const dictId = row.dictId || this.ids;
+      getType(dictId).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改字典类型";
+      });
+    },
+    /** 提交按钮 */
+    submitForm: function () {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.dateFile) {
+            this.confirmLoading = true;
+            let formData = new FormData();
+            formData.append("file", this.dateFile);
+            formData.append("salesLeadsType", this.form.salesLeadsType);
+            formData.append("uploadDate", this.form.uploadDate);
+            formData.append("createUserId", 1);
+            importSaleExcelOrCsv(formData)
+              .then((res) => {
+                this.confirmLoading = false;
+                this.$message.success("上传成功");
+                this.cancel();
+                this.handleQuery();
+              })
+              .catch((err) => {
+                this.confirmLoading = false;
+              });
+          } else {
+            this.$message.error("请上传文件");
+          }
+
+          // if (this.form.dictId != undefined) {
+          //   updateType(this.form).then((response) => {
+          //     this.$modal.msgSuccess("修改成功");
+          //     this.open = false;
+          //     this.getList();
+          //   });
+          // } else {
+          //   addType(this.form).then((response) => {
+          //     this.$modal.msgSuccess("新增成功");
+          //     this.open = false;
+          //     this.getList();
+          //   });
+          // }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const dictIds = row.dictId || this.ids;
+      this.$modal
+        .confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?')
+        .then(function () {
+          return delType(dictIds);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        "system/dict/type/export",
+        {
+          ...this.queryParams,
+        },
+        `type_${new Date().getTime()}.xlsx`
+      );
+    },
+    /** 刷新缓存按钮操作 */
+    handleRefreshCache() {
+      refreshCache().then(() => {
+        this.$modal.msgSuccess("刷新成功");
+      });
+    },
+  },
+};
+</script>