瀏覽代碼

feature(跟进): 跟进升级优化

ZZH-wl 2 年之前
父節點
當前提交
791ebf799f

+ 1 - 1
src/views/base/distributor/detail.vue

@@ -55,7 +55,7 @@
   import { mapGetters } from 'vuex'
   import api from '@/api/base/distr'
   export default {
-    name: 'Detail',
+    name: 'DistributorDetail',
     components: {},
     data() {
       return {

+ 7 - 1
src/views/customer/components/FollowDetail.vue

@@ -12,11 +12,14 @@
       <el-descriptions-item label="跟进类型">
         {{ formatType(form.followType) }}
       </el-descriptions-item>
+      <el-descriptions-item label="跟进对象">
+        {{ form.targetName }}
+      </el-descriptions-item>
       <el-descriptions-item label="跟进时间">
         {{ form.followDate }}
       </el-descriptions-item>
       <el-descriptions-item label="跟进描述">
-        {{ form.followDate }}
+        {{ form.followContent }}
       </el-descriptions-item>
       <el-descriptions-item label="客户名称">
         {{ form.custName }}
@@ -30,6 +33,9 @@
       <el-descriptions-item label="评论数量">
         {{ form.commentNumber }}
       </el-descriptions-item>
+      <el-descriptions-item label="跟进人">
+        {{ form.createdName }}
+      </el-descriptions-item>
       <el-descriptions-item label="创建时间">
         {{ form.createdTime }}
       </el-descriptions-item>

+ 3 - 3
src/views/customer/detail.vue

@@ -130,7 +130,7 @@
                       <vab-icon class="user-avatar" icon="account-circle-fill" />
                       <div class="text">
                         <p class="action">
-                          <span>{{ item.contactsName }} 跟进({{ formatType(item.followType) }})</span>
+                          <span>{{ item.createdName }} 跟进({{ formatType(item.followType) }})</span>
                           <span>
                             <vab-icon icon="time-line" />
                             {{ item.followDate }}
@@ -545,8 +545,8 @@
           this.contactList = res.data.list || []
         } else if (tab.name == 'follow') {
           let params = {
-            custId: this.id,
-            DaysBeforeToday: 9999,
+            custId: String(this.id),
+            DaysBeforeToday: 99999,
           }
           ;[err, res] = await to(follow.getListByDay(params))
           if (err) return

+ 63 - 10
src/views/customer/follow.vue

@@ -10,7 +10,7 @@
   <div class="follow-container">
     <el-row :gutter="10" style="margin-bottom: 10px">
       <el-col :span="4">
-        <el-input v-model="queryForm.custId" placeholder="客户" />
+        <el-input v-model="queryForm.custName" placeholder="客户" />
       </el-col>
       <!-- <el-col :span="4">
         <el-date-picker
@@ -27,13 +27,15 @@
         </el-input>
       </el-col>
       <el-col :span="4">
-        <el-input v-model="queryForm.targetType" placeholder="跟进类型" />
+        <el-select v-model="queryForm.targetType" clearable placeholder="跟进类型" style="width: 100%">
+          <el-option v-for="item in targetTypeOptions" :key="item.key" :label="item.value" :value="item.key" />
+        </el-select>
       </el-col>
       <el-col :span="4">
-        <el-input v-model="queryForm.indusTry" placeholder="跟进人员" />
+        <el-input v-model.number="queryForm.targetName" placeholder="跟进对象" />
       </el-col>
       <el-col :span="4">
-        <el-input v-model="queryForm.managerId" placeholder="创建者" />
+        <el-input v-model="queryForm.managerId" placeholder="跟进人" />
       </el-col>
       <el-col :span="4">
         <el-button icon="el-icon-plus" type="primary" @click="search">查询</el-button>
@@ -59,17 +61,19 @@
               <vab-icon class="user-avatar" icon="account-circle-fill" />
               <div class="text">
                 <p class="action">
-                  <span>{{ item.contactsName }} 跟进({{ formatType(item.followType) }})</span>
+                  <span>{{ item.createdName }} 跟进({{ formatType(item.followType) }})</span>
                   <span>
                     <vab-icon icon="time-line" />
                     {{ item.followDate }}
                   </span>
                 </p>
-                <p>{{ item.followContent }}</p>
+                <p class="content">
+                  <span>{{ item.followContent }}</span>
+                </p>
                 <div class="footer">
                   <p>
-                    来自客户
-                    <span>{{ item.custName }}</span>
+                    来自{{ selectDictLabel(targetTypeOptions, item.targetType) }}
+                    <span @click="jumpTo(item)">{{ item.targetName }}</span>
                   </p>
                   <div>
                     <el-button size="mini" @click="showDetail(item)">
@@ -124,7 +128,9 @@
         listLoading: false,
         queryForm: {
           custId: '',
+          custName: '',
           targetType: '',
+          targetName: '',
           targetId: '',
           managerId: '',
           daysBeforeToday: 20,
@@ -159,6 +165,7 @@
           updatedTime: '',
           deletedTime: '',
         },
+        targetTypeOptions: [],
       }
     },
     mounted() {
@@ -166,7 +173,13 @@
       this.getOptions()
     },
     methods: {
-      getOptions() {},
+      getOptions() {
+        Promise.all([this.getDicts('follow_target_type')])
+          .then(([targetType]) => {
+            this.targetTypeOptions = targetType.data.values || []
+          })
+          .catch((err) => console.log(err))
+      },
       search() {
         // this.queryForm.daysBeforeToday = 20
         this.fetchData()
@@ -192,14 +205,44 @@
       reset() {
         this.queryForm = {
           custId: '',
+          custName: '',
           targetType: '',
+          targetName: '',
           targetId: '',
           managerId: '',
-          daysBeforeToday: '',
+          daysBeforeToday: 20,
           date: [],
         }
         this.fetchData()
       },
+      jumpTo(row) {
+        let pageName = ''
+        switch (row.targetType) {
+          case '10':
+            pageName = 'CustomerDetail'
+            break
+          case '20':
+            pageName = 'BusinessDetail'
+            break
+          case '30':
+            pageName = 'ContractDetail'
+            break
+          case '40':
+            pageName = ''
+            break
+          case '50':
+            pageName = 'DistributorDetail'
+            break
+        }
+        if (pageName) {
+          this.$router.push({
+            name: pageName,
+            query: {
+              id: row.targetId,
+            },
+          })
+        }
+      },
       // 详情
       showDetail(row) {
         this.$refs.followDetail.init({ ...row })
@@ -396,6 +439,16 @@
             }
           }
 
+          .content {
+            display: flex;
+            justify-content: space-between;
+
+            span {
+              font-weight: bold;
+              color: #333;
+            }
+          }
+
           .footer {
             display: flex;
             justify-content: space-between;

+ 1 - 1
src/views/proj/business/components/DetailsFollow.vue

@@ -15,7 +15,7 @@
               <vab-icon class="user-avatar" icon="account-circle-fill" />
               <div class="text">
                 <p class="action">
-                  <span>{{ item.contactsName }} 跟进({{ formatType(item.followType) }})</span>
+                  <span>{{ item.createdName }} 跟进({{ formatType(item.followType) }})</span>
                   <span>
                     <vab-icon icon="time-line" />
                     {{ item.followDate }}