浏览代码

客户分ABC类、置顶

Long 3 天之前
父节点
当前提交
3fc0b86a97

+ 8 - 1
src/api/crm/customer.js

@@ -200,4 +200,11 @@ export function updateCustomerSource(data) {
     method: 'post',
     method: 'post',
     data: data
     data: data
   })
   })
-}
+}
+
+export function switchToTop(customerId) {
+  return request({
+    url: '/crm/customer/switchToTop/' + customerId,
+    method: 'post'
+  })
+}

+ 9 - 0
src/api/crm/customerLevel.js

@@ -0,0 +1,9 @@
+import request from "@/utils/request";
+
+export const customerLevelOptions = (query) => {
+  return request({
+    url: "/crm/customerLevel/getCustomerLevelOption",
+    method: "get",
+    params: query,
+  });
+};

+ 22 - 20
src/views/crm/components/addCustomerType.vue

@@ -1,10 +1,10 @@
 <template>
 <template>
     <div>
     <div>
             <el-form ref="form" :model="form" :rules="rules" label-width="100px">
             <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-                <el-form-item label="客户类型" prop="customerType">
-                    <el-select v-model="form.customerType" placeholder="请选择客户类型" clearable size="small">
+                <el-form-item label="客户类型" prop="customerLevel">
+                    <el-select v-model="form.customerLevel" placeholder="请选择客户类型" clearable size="small">
                         <el-option
                         <el-option
-                                v-for="item in typeOptions"
+                                v-for="item in customerLevelOptions"
                                 :key="item.dictValue"
                                 :key="item.dictValue"
                                 :label="item.dictLabel"
                                 :label="item.dictLabel"
                                 :value="item.dictValue"
                                 :value="item.dictValue"
@@ -15,42 +15,45 @@
             <div class="footer">
             <div class="footer">
                 <el-button type="primary" @click="submitForm">确 定</el-button>
                 <el-button type="primary" @click="submitForm">确 定</el-button>
             </div>
             </div>
-       
+
     </div>
     </div>
 </template>
 </template>
-  
+
 <script>
 <script>
      import { getCustomerDetails,updateCustomer  } from "@/api/crm/customer";
      import { getCustomerDetails,updateCustomer  } from "@/api/crm/customer";
+     import {customerLevelOptions} from "@/api/crm/customerLevel";
     export default {
     export default {
         name: "visit",
         name: "visit",
         data() {
         data() {
             return {
             return {
-                 
-                typeOptions:[],
+
                 form: {
                 form: {
                     customerId:null,
                     customerId:null,
-                    customerType:null,
-                 
+                    customerLevel:null,
                 },
                 },
                 // 表单校验
                 // 表单校验
                 rules: {
                 rules: {
-                    customerType: [
+                    customerLevel: [
                         { required: true, message: "类型不能为空", trigger: "change" }
                         { required: true, message: "类型不能为空", trigger: "change" }
                     ],
                     ],
-         
-                }
-                 
+
+                },
+              customerLevelOptions: []
+
             };
             };
         },
         },
         created() {
         created() {
-            this.getDicts("crm_customer_type").then((response) => {
-                this.typeOptions = response.data;
-            });
+            this.getCustomerLevelOptions()
         },
         },
         methods: {
         methods: {
+          getCustomerLevelOptions(){
+            customerLevelOptions({status: 0}).then((response) => {
+              this.customerLevelOptions = response.data;
+            });
+          },
             reset(customer) {
             reset(customer) {
                 this.form.customerId=customer.customerId;
                 this.form.customerId=customer.customerId;
-                this.form.customerType=customer.customerType.toString();
+                this.form.customerLevel=customer.customerLevel;
             },
             },
             submitForm() {
             submitForm() {
                 this.$refs["form"].validate(valid => {
                 this.$refs["form"].validate(valid => {
@@ -58,7 +61,7 @@
                         updateCustomer(this.form).then(response => {
                         updateCustomer(this.form).then(response => {
                             if (response.code === 200) {
                             if (response.code === 200) {
                                 this.msgSuccess("操作成功");
                                 this.msgSuccess("操作成功");
-                                
+
                                 this.$emit('close');
                                 this.$emit('close');
                             }
                             }
                         });
                         });
@@ -73,7 +76,7 @@
     height: 100%;
     height: 100%;
     background-color: #fff;
     background-color: #fff;
     padding: 20px;
     padding: 20px;
-        
+
 }
 }
 .footer{
 .footer{
     display: flex;
     display: flex;
@@ -82,4 +85,3 @@
 }
 }
 </style>
 </style>
 
 
- 

+ 24 - 17
src/views/crm/components/addOrEditCustomer.vue

@@ -28,10 +28,10 @@
                 <el-form-item label="详细地址" prop="detailAddress">
                 <el-form-item label="详细地址" prop="detailAddress">
                     <el-input v-model="form.detailAddress" placeholder="请输入详细地址" />
                     <el-input v-model="form.detailAddress" placeholder="请输入详细地址" />
                 </el-form-item>
                 </el-form-item>
-                <el-form-item label="客户类型" prop="customerType">
-                    <el-select v-model="form.customerType" placeholder="请选择客户类型" clearable size="small">
+                <el-form-item label="客户类型" prop="customerLevel">
+                    <el-select v-model="form.customerLevel" placeholder="请选择客户类型" clearable size="small">
                         <el-option
                         <el-option
-                            v-for="item in typeOptions"
+                            v-for="item in customerLevelOptions"
                             :key="item.dictValue"
                             :key="item.dictValue"
                             :label="item.dictLabel"
                             :label="item.dictLabel"
                             :value="item.dictValue"
                             :value="item.dictValue"
@@ -129,11 +129,12 @@
             </div>
             </div>
     </div>
     </div>
 </template>
 </template>
-  
+
 <script>
 <script>
     import { listCustomerExt } from "@/api/crm/customerExt";
     import { listCustomerExt } from "@/api/crm/customerExt";
     import { updateCustomer,addCustomer,addMyCustomer,getCustomerDetails   } from "@/api/crm/customer";
     import { updateCustomer,addCustomer,addMyCustomer,getCustomerDetails   } from "@/api/crm/customer";
     import {getCitys} from "@/api/store/city";
     import {getCitys} from "@/api/store/city";
+    import {customerLevelOptions} from "@/api/crm/customerLevel";
     export default {
     export default {
         name: "remark",
         name: "remark",
         data() {
         data() {
@@ -156,7 +157,7 @@
                     province:null,
                     province:null,
                     city:null,
                     city:null,
                     district:null,
                     district:null,
-                    
+                    customerLevel: null
                 },
                 },
                 exts:[],
                 exts:[],
                 // 表单校验
                 // 表单校验
@@ -170,8 +171,9 @@
                     source: [
                     source: [
                     { required: true, message: "客户来源不能为空", trigger: "blur" }
                     { required: true, message: "客户来源不能为空", trigger: "blur" }
                     ],
                     ],
-                }
-                 
+                },
+              customerLevelOptions: []
+
             };
             };
         },
         },
         created() {
         created() {
@@ -190,10 +192,16 @@
             this.getDicts("crm_customer_type").then((response) => {
             this.getDicts("crm_customer_type").then((response) => {
                 this.typeOptions = response.data;
                 this.typeOptions = response.data;
             });
             });
-            
+
             this.getCitys()
             this.getCitys()
+          this.getCustomerLevelOptions()
         },
         },
         methods: {
         methods: {
+          getCustomerLevelOptions(){
+            customerLevelOptions({status: 0}).then((response) => {
+              this.customerLevelOptions = response.data;
+            });
+          },
             tagsChange(e){
             tagsChange(e){
                 var item=this.tagsOptions.find(val => val.dictValue === e);
                 var item=this.tagsOptions.find(val => val.dictValue === e);
                 console.log(item);
                 console.log(item);
@@ -210,7 +218,7 @@
                 setTimeout(() => {
                 setTimeout(() => {
                     that.$refs.tag.reset(this.item);
                     that.$refs.tag.reset(this.item);
                 }, 500);
                 }, 500);
-                
+
             },
             },
             handleCityChange(value) {
             handleCityChange(value) {
                 console.log(value);
                 console.log(value);
@@ -276,7 +284,7 @@
                     isLine: null,
                     isLine: null,
                     source: null,
                     source: null,
                     tags: null,
                     tags: null,
-                    
+                    customerLevel: null
                 };
                 };
                 this.exts=[];
                 this.exts=[];
                 this.tags=[];
                 this.tags=[];
@@ -294,9 +302,9 @@
                         var data={extId:element.extId,name:element.name,value:""};
                         var data={extId:element.extId,name:element.name,value:""};
                         this.exts.push(data)
                         this.exts.push(data)
                     });
                     });
-                
+
                 });
                 });
-                
+
                 console.log(this.exts)
                 console.log(this.exts)
             },
             },
             /** 修改按钮操作 */
             /** 修改按钮操作 */
@@ -343,10 +351,10 @@
                                         item.value=element.value
                                         item.value=element.value
                                     }
                                     }
                                 });
                                 });
-                            
+
                             });
                             });
                         }
                         }
-                    
+
                     });
                     });
                     this.open = true;
                     this.open = true;
                     this.title = "修改客户";
                     this.title = "修改客户";
@@ -382,7 +390,7 @@
                                     }
                                     }
                                 });
                                 });
                             }
                             }
-                            
+
                         }
                         }
                     }
                     }
                 });
                 });
@@ -395,7 +403,7 @@
     height: 100%;
     height: 100%;
     background-color: #fff;
     background-color: #fff;
     padding: 20px;
     padding: 20px;
-        
+
 }
 }
 .footer{
 .footer{
     display: flex;
     display: flex;
@@ -406,4 +414,3 @@
 
 
 
 
 
 
- 

+ 9 - 2
src/views/crm/components/customerDetails.vue

@@ -47,7 +47,7 @@
             </el-descriptions-item>
             </el-descriptions-item>
             <el-descriptions-item label="客户类型" >
             <el-descriptions-item label="客户类型" >
                 <span v-if="item!=null">
                 <span v-if="item!=null">
-                    <el-tag  v-for="(dict, index) in typeOptions"    v-if="item.customerType==dict.dictValue">{{dict.dictLabel}}</el-tag>
+                    <el-tag  v-for="(dict, index) in customerLevelOptions"    v-if="item.customerLevel===dict.dictValue">{{dict.dictLabel}}</el-tag>
                 </span>
                 </span>
             </el-descriptions-item>
             </el-descriptions-item>
             <el-descriptions-item label="客户状态" >
             <el-descriptions-item label="客户状态" >
@@ -221,6 +221,7 @@
     import addSms from './addSms.vue';
     import addSms from './addSms.vue';
     import addOrEditCustomer from '../components/addOrEditCustomer.vue';
     import addOrEditCustomer from '../components/addOrEditCustomer.vue';
     import addPackage from "@/views/store/components/addOrder";
     import addPackage from "@/views/store/components/addOrder";
+    import {customerLevelOptions} from "@/api/crm/customerLevel";
     export default {
     export default {
         name: "customer",
         name: "customer",
         components: {addPackage,customerHisOrderList,addOrEditCustomer,addSms,addTag,addRemark, customerContacts,customerVisitList,customerLogsList,customerVoiceLogsList,customerStoreOrderList,customerSmsLogsList,duplicateCustomer },
         components: {addPackage,customerHisOrderList,addOrEditCustomer,addSms,addTag,addRemark, customerContacts,customerVisitList,customerLogsList,customerVoiceLogsList,customerStoreOrderList,customerSmsLogsList,duplicateCustomer },
@@ -270,6 +271,7 @@
                 item:null,
                 item:null,
                 showDuplicate:false,
                 showDuplicate:false,
                 dCustomerId:null,
                 dCustomerId:null,
+              customerLevelOptions: []
 
 
             };
             };
         },
         },
@@ -292,12 +294,17 @@
             this.getDicts("crm_customer_is_receive").then((response) => {
             this.getDicts("crm_customer_is_receive").then((response) => {
                 this.receiveOptions = response.data;
                 this.receiveOptions = response.data;
             });
             });
-
+          this.getCustomerLevelOptions()
         },
         },
         mounted(){
         mounted(){
 
 
         },
         },
         methods: {
         methods: {
+          getCustomerLevelOptions(){
+            customerLevelOptions().then((response) => {
+              this.customerLevelOptions = response.data;
+            });
+          },
             addPackageOrder(){
             addPackageOrder(){
 
 
                this.addPackageOpen=true;
                this.addPackageOpen=true;

+ 22 - 13
src/views/crm/customer/assist.vue

@@ -41,10 +41,10 @@
               />
               />
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="客户类型" prop="customerType">
-        <el-select style="width:220px" multiple filterable  v-model="ctsTypeArr" placeholder="请选择客户类型" clearable size="small">
+      <el-form-item label="客户类型" prop="customerLevel">
+        <el-select style="width:220px" filterable  v-model="queryParams.customerLevel" placeholder="请选择客户类型" clearable size="small">
            <el-option
            <el-option
-                v-for="item in typeOptions"
+                v-for="item in customerLevelOptions"
                 :key="item.dictValue"
                 :key="item.dictValue"
                 :label="item.dictLabel"
                 :label="item.dictLabel"
                 :value="item.dictValue"
                 :value="item.dictValue"
@@ -106,7 +106,7 @@
     </el-form>
     </el-form>
 
 
     <el-row :gutter="10" class="mb8">
     <el-row :gutter="10" class="mb8">
-      
+
       <el-col :span="1.5">
       <el-col :span="1.5">
         <el-button
         <el-button
           type="success"
           type="success"
@@ -116,9 +116,9 @@
           @click="handleAssist"
           @click="handleAssist"
           v-hasPermi="['crm:customer:assistToUser']"
           v-hasPermi="['crm:customer:assistToUser']"
         >客户协作</el-button>
         >客户协作</el-button>
-      </el-col>  
-      
-      
+      </el-col>
+
+
       <el-col :span="1.5">
       <el-col :span="1.5">
         <el-button
         <el-button
           type="success"
           type="success"
@@ -157,7 +157,7 @@
 <!--          @click="addPackageOrder"-->
 <!--          @click="addPackageOrder"-->
 <!--        >创建订单</el-button>-->
 <!--        >创建订单</el-button>-->
       </el-col>
       </el-col>
-      
+
       <!-- <el-col :span="1.5">
       <!-- <el-col :span="1.5">
         <el-button
         <el-button
           type="warning"
           type="warning"
@@ -197,9 +197,9 @@
             <el-button  v-hasPermi="['crm:customer:addVisitStatus']"  type="text" size="mini" @click="handleVisitStatus(scope.row)">修改</el-button>
             <el-button  v-hasPermi="['crm:customer:addVisitStatus']"  type="text" size="mini" @click="handleVisitStatus(scope.row)">修改</el-button>
           </template>
           </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column  label="客户类型"  width="200" align="center" prop="customerType">
+      <el-table-column  label="客户类型"  width="200" align="center" prop="customerLevel">
         <template slot-scope="scope">
         <template slot-scope="scope">
-            <el-tag prop="status" v-for="(item, index) in typeOptions"    v-if="scope.row.customerType==item.dictValue">{{item.dictLabel}}</el-tag>
+            <el-tag prop="status" v-for="(item, index) in customerLevelOptions"    v-if="scope.row.customerLevel===item.dictValue">{{item.dictLabel}}</el-tag>
             <el-button   v-hasPermi="['crm:customer:addCustomerType']"  type="text" size="mini" @click="handleCustomerType(scope.row)">修改</el-button>
             <el-button   v-hasPermi="['crm:customer:addCustomerType']"  type="text" size="mini" @click="handleCustomerType(scope.row)">修改</el-button>
           </template>
           </template>
       </el-table-column>
       </el-table-column>
@@ -243,7 +243,7 @@
             @click="handleRecover(scope.row)"
             @click="handleRecover(scope.row)"
             v-hasPermi="['crm:customer:recover']"
             v-hasPermi="['crm:customer:recover']"
           >回收公海</el-button>
           >回收公海</el-button>
-          
+
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -278,7 +278,7 @@
     <el-dialog :title="assist.title" :visible.sync="assist.open" width="800px" append-to-body>
     <el-dialog :title="assist.title" :visible.sync="assist.open" width="800px" append-to-body>
         <assist-user  ref="assistUser" @close="closeAssist"   />
         <assist-user  ref="assistUser" @close="closeAssist"   />
     </el-dialog>
     </el-dialog>
-    
+
     <el-dialog :title="addTag.title" :visible.sync="addTag.open" width="600px" append-to-body>
     <el-dialog :title="addTag.title" :visible.sync="addTag.open" width="600px" append-to-body>
         <add-tag ref="tag" @close="closeTag()"></add-tag>
         <add-tag ref="tag" @close="closeTag()"></add-tag>
     </el-dialog>
     </el-dialog>
@@ -317,6 +317,7 @@ import addCustomerType from '../components/addCustomerType.vue';
 import addVisitStatus from '../components/addVisitStatus.vue';
 import addVisitStatus from '../components/addVisitStatus.vue';
 import addPackage from "@/views/store/components/addOrder";
 import addPackage from "@/views/store/components/addOrder";
 import addOrderOffline from "@/views/store/components/addOrderOffline";
 import addOrderOffline from "@/views/store/components/addOrderOffline";
+import {customerLevelOptions} from "@/api/crm/customerLevel";
 export default {
 export default {
   name: "Customer",
   name: "Customer",
   components: {addPackage,addOrderOffline,addVisitStatus,addCustomerType,addRemark,addTag,assignUser,assistUser,addOrEditCustomer,editSource, addBatchSms,customerDetails,addVisit },
   components: {addPackage,addOrderOffline,addVisitStatus,addCustomerType,addRemark,addTag,assignUser,assistUser,addOrEditCustomer,editSource, addBatchSms,customerDetails,addVisit },
@@ -444,7 +445,8 @@ export default {
         companyId: null,
         companyId: null,
         isLine: null,
         isLine: null,
         source: null,
         source: null,
-        tags: null
+        tags: null,
+        customerLevel: null,
       },
       },
       // 表单参数
       // 表单参数
       form: {
       form: {
@@ -468,6 +470,7 @@ export default {
         ],
         ],
       },
       },
       loading:null,
       loading:null,
+      customerLevelOptions: []
     };
     };
   },
   },
   created() {
   created() {
@@ -488,8 +491,14 @@ export default {
     });
     });
     this.getCitys();
     this.getCitys();
     this.getList();
     this.getList();
+    this.getCustomerLevelOptions()
   },
   },
   methods: {
   methods: {
+    getCustomerLevelOptions(){
+      customerLevelOptions().then((response) => {
+        this.customerLevelOptions = response.data;
+      });
+    },
     handleCommand(command){
     handleCommand(command){
       if (command==="1"){
       if (command==="1"){
         this.addOfflineOrder.open = true
         this.addOfflineOrder.open = true

+ 16 - 7
src/views/crm/customer/full.vue

@@ -55,10 +55,10 @@
             </el-select>
             </el-select>
           </el-form-item>
           </el-form-item>
 
 
-          <el-form-item label="客户类型" prop="customerType">
-            <el-select multiple filterable v-model="ctsTypeArr" placeholder="请选择客户类型" clearable size="small">
+          <el-form-item label="客户类型" prop="customerLevel">
+            <el-select filterable v-model="queryParams.customerLevel" placeholder="请选择客户类型" clearable size="small">
               <el-option
               <el-option
-                    v-for="item in typeOptions"
+                    v-for="item in customerLevelOptions"
                     :key="item.dictValue"
                     :key="item.dictValue"
                     :label="item.dictLabel"
                     :label="item.dictLabel"
                     :value="item.dictValue"
                     :value="item.dictValue"
@@ -172,9 +172,9 @@
                 <el-tag prop="visitStatus" v-for="(item, index) in visitStatusOptions"    v-if="scope.row.visitStatus==item.dictValue">{{item.dictLabel}}</el-tag>
                 <el-tag prop="visitStatus" v-for="(item, index) in visitStatusOptions"    v-if="scope.row.visitStatus==item.dictValue">{{item.dictLabel}}</el-tag>
               </template>
               </template>
           </el-table-column>
           </el-table-column>
-          <el-table-column  label="客户类型"  align="center" prop="customerType">
+          <el-table-column  label="客户类型"  align="center" prop="customerLevel">
             <template slot-scope="scope">
             <template slot-scope="scope">
-                <el-tag prop="status" v-for="(item, index) in typeOptions"    v-if="scope.row.customerType==item.dictValue">{{item.dictLabel}}</el-tag>
+                <el-tag v-for="(item, index) in customerLevelOptions"    v-if="scope.row.customerLevel===item.dictValue">{{item.dictLabel}}</el-tag>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
           <el-table-column label="标签" align="center" prop="tags" />
           <el-table-column label="标签" align="center" prop="tags" />
@@ -253,6 +253,7 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import customerAssignList from '../components/customerAssignList.vue';
 import customerAssignList from '../components/customerAssignList.vue';
 import assignUser from '../components/assignUser.vue';
 import assignUser from '../components/assignUser.vue';
+import {customerLevelOptions} from "@/api/crm/customerLevel";
 export default {
 export default {
   name: "Customer",
   name: "Customer",
   components: {customerAssignList, customerDetails,Treeselect,assignUser },
   components: {customerAssignList, customerDetails,Treeselect,assignUser },
@@ -352,7 +353,8 @@ export default {
         companyId: null,
         companyId: null,
         isLine: null,
         isLine: null,
         source: null,
         source: null,
-        tags: null
+        tags: null,
+        customerLevel: null,
       },
       },
       // 表单参数
       // 表单参数
       form: {
       form: {
@@ -374,7 +376,8 @@ export default {
         source: [
         source: [
           { required: true, message: "客户来源不能为空", trigger: "blur" }
           { required: true, message: "客户来源不能为空", trigger: "blur" }
         ],
         ],
-      }
+      },
+      customerLevelOptions: []
     };
     };
   },
   },
   watch: {
   watch: {
@@ -414,8 +417,14 @@ export default {
     this.getTreeselect();
     this.getTreeselect();
     this.getCitys();
     this.getCitys();
     this.getList();
     this.getList();
+    this.getCustomerLevelOptions()
   },
   },
   methods: {
   methods: {
+    getCustomerLevelOptions(){
+      customerLevelOptions().then((response) => {
+        this.customerLevelOptions = response.data;
+      });
+    },
     handleAssign(){
     handleAssign(){
       var that=this;
       var that=this;
       var ids=this.ids;
       var ids=this.ids;

+ 57 - 21
src/views/crm/customer/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div class="app-container">
   <div class="app-container">
- 
+
         <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
         <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
           <el-form-item label="客户编码" prop="customerCode">
           <el-form-item label="客户编码" prop="customerCode">
             <el-input
             <el-input
@@ -55,10 +55,10 @@
                   />
                   />
             </el-select>
             </el-select>
           </el-form-item>
           </el-form-item>
-          <el-form-item label="客户类型" prop="customerType">
-            <el-select style="width:220px" multiple filterable v-model="ctsTypeArr" placeholder="请选择客户类型" clearable size="small">
+          <el-form-item label="客户类型" prop="customerLevel">
+            <el-select style="width:220px" filterable v-model="queryParams.customerLevel" placeholder="请选择客户类型" clearable size="small">
               <el-option
               <el-option
-                    v-for="item in typeOptions"
+                    v-for="item in customerLevelOptions"
                     :key="item.dictValue"
                     :key="item.dictValue"
                     :label="item.dictLabel"
                     :label="item.dictLabel"
                     :value="item.dictValue"
                     :value="item.dictValue"
@@ -75,7 +75,7 @@
                   />
                   />
             </el-select>
             </el-select>
           </el-form-item>
           </el-form-item>
-          
+
           <!-- <el-form-item label="是否认领" prop="isReceive">
           <!-- <el-form-item label="是否认领" prop="isReceive">
             <el-select v-model="queryParams.isReceive" placeholder="请选择是否认领" clearable size="small">
             <el-select v-model="queryParams.isReceive" placeholder="请选择是否认领" clearable size="small">
               <el-option
               <el-option
@@ -163,7 +163,7 @@
               v-hasPermi="['crm:customer:editScource']"
               v-hasPermi="['crm:customer:editScource']"
             >修改客户来源</el-button>
             >修改客户来源</el-button>
           </el-col>
           </el-col>
-         
+
           <el-col :span="1.5">
           <el-col :span="1.5">
             <el-button
             <el-button
               type="success"
               type="success"
@@ -229,9 +229,9 @@
                 <el-tag prop="visitStatus" v-for="(item, index) in visitStatusOptions"    v-if="scope.row.visitStatus==item.dictValue">{{item.dictLabel}}</el-tag>
                 <el-tag prop="visitStatus" v-for="(item, index) in visitStatusOptions"    v-if="scope.row.visitStatus==item.dictValue">{{item.dictLabel}}</el-tag>
               </template>
               </template>
           </el-table-column>
           </el-table-column>
-          <el-table-column  label="客户类型"  width="200" align="center" prop="customerType">
+          <el-table-column  label="客户类型"  width="200" align="center" prop="customerLevel">
             <template slot-scope="scope">
             <template slot-scope="scope">
-                <el-tag prop="status" v-for="(item, index) in typeOptions"    v-if="scope.row.customerType==item.dictValue">{{item.dictLabel}}</el-tag>
+                <el-tag v-for="(item, index) in customerLevelOptions"    v-if="scope.row.customerLevel===item.dictValue">{{item.dictLabel}}</el-tag>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
           <el-table-column label="标签" align="center" prop="tags" />
           <el-table-column label="标签" align="center" prop="tags" />
@@ -275,10 +275,17 @@
                 @click="handleAssign(scope.row)"
                 @click="handleAssign(scope.row)"
                 v-hasPermi="['crm:customer:assign']"
                 v-hasPermi="['crm:customer:assign']"
               >分配客户</el-button> -->
               >分配客户</el-button> -->
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-mouse"
+                @click="handleSwitchToTop(scope.row)"
+                v-hasPermi="['crm:customer:switchToTop']"
+              >{{ scope.row.isTop === 1 ? '取消置顶' : '置顶' }}</el-button>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
         </el-table>
         </el-table>
-        
+
         <pagination
         <pagination
           v-show="total>0"
           v-show="total>0"
           :total="total"
           :total="total"
@@ -293,15 +300,15 @@
         <customer-details  ref="customerDetails" />
         <customer-details  ref="customerDetails" />
     </el-drawer>
     </el-drawer>
 
 
-   
-     
+
+
     <el-dialog :title="addSms.title" :visible.sync="addSms.open" width="1000px" append-to-body>
     <el-dialog :title="addSms.title" :visible.sync="addSms.open" width="1000px" append-to-body>
        <add-batch-sms ref="sms" @close="closeSms()"></add-batch-sms>
        <add-batch-sms ref="sms" @close="closeSms()"></add-batch-sms>
     </el-dialog>
     </el-dialog>
     <el-dialog :title="source.title" :visible.sync="source.open" width="1000px" append-to-body>
     <el-dialog :title="source.title" :visible.sync="source.open" width="1000px" append-to-body>
        <edit-source ref="editSource" @close="closeSource()"></edit-source>
        <edit-source ref="editSource" @close="closeSource()"></edit-source>
     </el-dialog>
     </el-dialog>
-     
+
     <el-dialog :title="customerSource.title" :visible.sync="customerSource.open" width="1000px" append-to-body>
     <el-dialog :title="customerSource.title" :visible.sync="customerSource.open" width="1000px" append-to-body>
        <customer-source ref="customerSource" @close="closeSource()"></customer-source>
        <customer-source ref="customerSource" @close="closeSource()"></customer-source>
     </el-dialog>
     </el-dialog>
@@ -336,8 +343,19 @@
 </template>
 </template>
 
 
 <script>
 <script>
- 
-import { assignToUser,recover,receive,getCustomerList ,addCustomer,updateCustomer,getCustomerDetails,exportCustomer,importVisitTemplate } from "@/api/crm/customer";
+
+import {
+  assignToUser,
+  recover,
+  receive,
+  getCustomerList,
+  addCustomer,
+  updateCustomer,
+  getCustomerDetails,
+  exportCustomer,
+  importVisitTemplate,
+  switchToTop
+} from "@/api/crm/customer";
 import { getToken } from "@/utils/auth";
 import { getToken } from "@/utils/auth";
 import customerDetails from '../components/customerDetails.vue';
 import customerDetails from '../components/customerDetails.vue';
 import {getCitys} from "@/api/store/city";
 import {getCitys} from "@/api/store/city";
@@ -349,6 +367,7 @@ import editSource from '../components/editSource.vue';
 import customerSource from '../components/customerSource.vue';
 import customerSource from '../components/customerSource.vue';
 import customerAssignList from '../components/customerAssignList.vue';
 import customerAssignList from '../components/customerAssignList.vue';
 import assignUser from '../components/assignUser.vue';
 import assignUser from '../components/assignUser.vue';
+import {customerLevelOptions} from "@/api/crm/customerLevel";
 export default {
 export default {
   name: "Customer",
   name: "Customer",
   components: {assignUser,customerAssignList,addBatchSms,editSource, customerDetails,Treeselect,customerSource },
   components: {assignUser,customerAssignList,addBatchSms,editSource, customerDetails,Treeselect,customerSource },
@@ -466,6 +485,7 @@ export default {
         tags: null,
         tags: null,
         tagList:[],
         tagList:[],
         visitStatus:null,
         visitStatus:null,
+        customerLevel: null,
       },
       },
       // 表单参数
       // 表单参数
       form: {
       form: {
@@ -487,7 +507,8 @@ export default {
         source: [
         source: [
           { required: true, message: "客户来源不能为空", trigger: "blur" }
           { required: true, message: "客户来源不能为空", trigger: "blur" }
         ],
         ],
-      }
+      },
+      customerLevelOptions: []
     };
     };
   },
   },
   watch: {
   watch: {
@@ -525,12 +546,18 @@ export default {
     this.getDicts("crm_customer_tag").then((response) => {
     this.getDicts("crm_customer_tag").then((response) => {
         this.tagsOptions = response.data;
         this.tagsOptions = response.data;
     });
     });
-    
+
     this.getTreeselect();
     this.getTreeselect();
     this.getCitys();
     this.getCitys();
     this.getList();
     this.getList();
+    this.getCustomerLevelOptions()
   },
   },
   methods: {
   methods: {
+    getCustomerLevelOptions(){
+      customerLevelOptions().then((response) => {
+        this.customerLevelOptions = response.data;
+      });
+    },
     handleShow(row){
     handleShow(row){
       this.show.open=true;
       this.show.open=true;
       var that=this;
       var that=this;
@@ -555,7 +582,7 @@ export default {
       setTimeout(() => {
       setTimeout(() => {
         that.$refs.customerSource.getData();
         that.$refs.customerSource.getData();
       }, 200);
       }, 200);
-      
+
     },
     },
     closeCustomerSource(){
     closeCustomerSource(){
         this.customerSource.open=false;
         this.customerSource.open=false;
@@ -571,7 +598,7 @@ export default {
       setTimeout(() => {
       setTimeout(() => {
         that.$refs.editSource.handleEdit(that.ids);
         that.$refs.editSource.handleEdit(that.ids);
       }, 200);
       }, 200);
-      
+
     },
     },
     closeSource(){
     closeSource(){
         this.source.open=false;
         this.source.open=false;
@@ -637,6 +664,15 @@ export default {
           this.msgSuccess("操作成功");
           this.msgSuccess("操作成功");
         }).catch(function() {});
         }).catch(function() {});
     },
     },
+    handleSwitchToTop(row) {
+      switchToTop(row.customerId).then(response => {
+        const {code} = response
+        if (code === 200) {
+          this.msgSuccess(row.isTop === 0 ? "已置顶" : "已取消置顶");
+          this.getList();
+        }
+      })
+    },
     getTreeselect() {
     getTreeselect() {
       treeselect().then((response) => {
       treeselect().then((response) => {
         this.deptOptions = response.data;
         this.deptOptions = response.data;
@@ -689,7 +725,7 @@ export default {
       else{
       else{
         this.queryParams.source=null
         this.queryParams.source=null
       }
       }
- 
+
       if(this.tagIds.length>0){
       if(this.tagIds.length>0){
         this.queryParams.tags=this.tagIds.toString();
         this.queryParams.tags=this.tagIds.toString();
       }
       }
@@ -760,8 +796,8 @@ export default {
       this.single = selection.length!==1
       this.single = selection.length!==1
       this.multiple = !selection.length
       this.multiple = !selection.length
     },
     },
-    
-    
+
+
     /** 新增按钮操作 */
     /** 新增按钮操作 */
     handleAdd() {
     handleAdd() {
       this.reset();
       this.reset();

+ 17 - 7
src/views/crm/customer/line.vue

@@ -39,10 +39,10 @@
                 />
                 />
           </el-select>
           </el-select>
         </el-form-item>
         </el-form-item>
-        <el-form-item   label="客户类型" prop="customerType">
-          <el-select filterable v-model="queryParams.customerType" placeholder="请选择客户类型" clearable size="small">
+        <el-form-item   label="客户类型" prop="customerLevel">
+          <el-select filterable v-model="queryParams.customerLevel" placeholder="请选择客户类型" clearable size="small">
             <el-option
             <el-option
-                  v-for="item in typeOptions"
+                  v-for="item in customerLevelOptions"
                   :key="item.dictValue"
                   :key="item.dictValue"
                   :label="item.dictLabel"
                   :label="item.dictLabel"
                   :value="item.dictValue"
                   :value="item.dictValue"
@@ -186,7 +186,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column  label="客户类型"  align="center" prop="customerType" >
         <el-table-column  label="客户类型"  align="center" prop="customerType" >
           <template slot-scope="scope">
           <template slot-scope="scope">
-              <el-tag prop="status" v-for="(item, index) in typeOptions"    v-if="scope.row.customerType==item.dictValue">{{item.dictLabel}}</el-tag>
+              <el-tag v-for="item in customerLevelOptions"    v-if="scope.row.customerLevel === item.dictValue">{{item.dictLabel}}</el-tag>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column label="标签" align="center" prop="tags" />
         <el-table-column label="标签" align="center" prop="tags" />
@@ -279,6 +279,7 @@ import editSource from '../components/editSource.vue';
 import addOrEditCustomer from '../components/addOrEditCustomer.vue';
 import addOrEditCustomer from '../components/addOrEditCustomer.vue';
 import customerAssignList from '../components/customerAssignList.vue';
 import customerAssignList from '../components/customerAssignList.vue';
 import assignUser from '../components/assignUser.vue';
 import assignUser from '../components/assignUser.vue';
+import {customerLevelOptions} from "@/api/crm/customerLevel";
 export default {
 export default {
   name: "Customer",
   name: "Customer",
   components: { assignUser,customerAssignList,addOrEditCustomer,customerDetails,Treeselect,editSource },
   components: { assignUser,customerAssignList,addOrEditCustomer,customerDetails,Treeselect,editSource },
@@ -393,7 +394,8 @@ export default {
         isLine: 1,
         isLine: 1,
         source: null,
         source: null,
         tags: null,
         tags: null,
-        isDuplicate:null
+        isDuplicate:null,
+        customerLevel: null
       },
       },
       // 表单参数
       // 表单参数
       form: {
       form: {
@@ -415,7 +417,9 @@ export default {
         source: [
         source: [
           { required: true, message: "客户来源不能为空", trigger: "blur" }
           { required: true, message: "客户来源不能为空", trigger: "blur" }
         ],
         ],
-      }
+      },
+      customerLevelOptions: [],
+      customerLevelOpenOptions: []
     };
     };
   },
   },
 
 
@@ -426,7 +430,7 @@ export default {
     this.getDicts("common_sex").then((response) => {
     this.getDicts("common_sex").then((response) => {
       this.sexOptions = response.data;
       this.sexOptions = response.data;
     });
     });
-   
+
     this.getDicts("common_sex").then((response) => {
     this.getDicts("common_sex").then((response) => {
       this.sexOptions = response.data;
       this.sexOptions = response.data;
     });
     });
@@ -444,8 +448,14 @@ export default {
     });
     });
 
 
     this.getList();
     this.getList();
+    this.getCustomerLevelOptions()
   },
   },
   methods: {
   methods: {
+    getCustomerLevelOptions(){
+      customerLevelOptions().then((response) => {
+        this.customerLevelOptions = response.data;
+      });
+    },
     handleShow(row){
     handleShow(row){
       this.show.open=true;
       this.show.open=true;
       var that=this;
       var that=this;

+ 20 - 11
src/views/crm/customer/my.vue

@@ -41,10 +41,10 @@
               />
               />
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="客户类型" prop="customerType">
-        <el-select style="width:220px" multiple filterable  v-model="ctsTypeArr" placeholder="请选择客户类型" clearable size="small">
+      <el-form-item label="客户类型" prop="customerLevel">
+        <el-select style="width:220px" filterable  v-model="queryParams.customerLevel" placeholder="请选择客户类型" clearable size="small">
            <el-option
            <el-option
-                v-for="item in typeOptions"
+                v-for="item in customerLevelOptions"
                 :key="item.dictValue"
                 :key="item.dictValue"
                 :label="item.dictLabel"
                 :label="item.dictLabel"
                 :value="item.dictValue"
                 :value="item.dictValue"
@@ -122,9 +122,9 @@
           size="mini"
           size="mini"
           :disabled="multiple"
           :disabled="multiple"
           @click="handleAssist"
           @click="handleAssist"
-         
+
         >客户协作</el-button>
         >客户协作</el-button>
-      </el-col>  
+      </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
         <el-button
         <el-button
           type="success"
           type="success"
@@ -184,7 +184,7 @@
           :disabled="multiple"
           :disabled="multiple"
           @click="handleRemoveAllAssist"
           @click="handleRemoveAllAssist"
         >删除协作人</el-button>
         >删除协作人</el-button>
-      </el-col> 
+      </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
         <el-button
         <el-button
           type="warning"
           type="warning"
@@ -194,7 +194,7 @@
           v-hasPermi="['crm:customer:export']"
           v-hasPermi="['crm:customer:export']"
         >导出</el-button>
         >导出</el-button>
       </el-col>
       </el-col>
-     
+
        <!-- 新增选择外呼线路的下拉框 -->
        <!-- 新增选择外呼线路的下拉框 -->
       <el-col :span="2">
       <el-col :span="2">
         <el-select
         <el-select
@@ -242,9 +242,9 @@
             <el-button  v-hasPermi="['crm:customer:addVisitStatus']"  type="text" size="mini" @click="handleVisitStatus(scope.row)">修改</el-button>
             <el-button  v-hasPermi="['crm:customer:addVisitStatus']"  type="text" size="mini" @click="handleVisitStatus(scope.row)">修改</el-button>
           </template>
           </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column  label="客户类型"  width="200" align="center" prop="customerType">
+      <el-table-column  label="客户类型"  width="200" align="center" prop="customerLevel">
         <template slot-scope="scope">
         <template slot-scope="scope">
-            <el-tag prop="status" v-for="(item, index) in typeOptions"    v-if="scope.row.customerType==item.dictValue">{{item.dictLabel}}</el-tag>
+            <el-tag prop="status" v-for="(item, index) in customerLevelOptions"    v-if="scope.row.customerLevel===item.dictValue">{{item.dictLabel}}</el-tag>
             <el-button   v-hasPermi="['crm:customer:addCustomerType']"  type="text" size="mini" @click="handleCustomerType(scope.row)">修改</el-button>
             <el-button   v-hasPermi="['crm:customer:addCustomerType']"  type="text" size="mini" @click="handleCustomerType(scope.row)">修改</el-button>
           </template>
           </template>
       </el-table-column>
       </el-table-column>
@@ -330,7 +330,7 @@
     <el-dialog :title="assist.title" :visible.sync="assist.open" width="800px" append-to-body>
     <el-dialog :title="assist.title" :visible.sync="assist.open" width="800px" append-to-body>
         <assist-user  ref="assistUser" @close="closeAssist"   />
         <assist-user  ref="assistUser" @close="closeAssist"   />
     </el-dialog>
     </el-dialog>
-    
+
     <el-dialog :title="addTag.title" :visible.sync="addTag.open" width="600px" append-to-body>
     <el-dialog :title="addTag.title" :visible.sync="addTag.open" width="600px" append-to-body>
         <add-tag ref="tag" @close="closeTag()"></add-tag>
         <add-tag ref="tag" @close="closeTag()"></add-tag>
     </el-dialog>
     </el-dialog>
@@ -370,6 +370,7 @@ import addVisitStatus from '../components/addVisitStatus.vue';
 import addPackage from "@/views/store/components/addOrder";
 import addPackage from "@/views/store/components/addOrder";
 import addOrderOffline from "@/views/store/components/addOrderOffline";
 import addOrderOffline from "@/views/store/components/addOrderOffline";
 import {getMyCallerApiList} from "@/api/company/companyVoiceCaller"
 import {getMyCallerApiList} from "@/api/company/companyVoiceCaller"
+import {customerLevelOptions} from "@/api/crm/customerLevel";
 export default {
 export default {
   name: "Customer",
   name: "Customer",
   components: {addPackage,addOrderOffline,addVisitStatus,addCustomerType,addRemark,addTag,assignUser,assistUser,addOrEditCustomer,editSource, addBatchSms,customerDetails,addVisit },
   components: {addPackage,addOrderOffline,addVisitStatus,addCustomerType,addRemark,addTag,assignUser,assistUser,addOrEditCustomer,editSource, addBatchSms,customerDetails,addVisit },
@@ -503,7 +504,8 @@ export default {
         companyId: null,
         companyId: null,
         isLine: null,
         isLine: null,
         source: null,
         source: null,
-        tags: null
+        tags: null,
+        customerLevel: null,
       },
       },
       // 表单参数
       // 表单参数
       form: {
       form: {
@@ -527,6 +529,7 @@ export default {
         ],
         ],
       },
       },
       loading:null,
       loading:null,
+      customerLevelOptions: []
     };
     };
   },
   },
   created() {
   created() {
@@ -548,8 +551,14 @@ export default {
     this.getCitys();
     this.getCitys();
     this.getList();
     this.getList();
     this.getCallerApiList();
     this.getCallerApiList();
+    this.getCustomerLevelOptions()
   },
   },
   methods: {
   methods: {
+    getCustomerLevelOptions(){
+      customerLevelOptions().then((response) => {
+        this.customerLevelOptions = response.data;
+      });
+    },
     getCallerApiList() {
     getCallerApiList() {
       getMyCallerApiList().then(response => {
       getMyCallerApiList().then(response => {
         this.callerApis = response.rows;
         this.callerApis = response.rows;