| 
					
				 | 
			
			
				@@ -60,17 +60,17 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <el-form-item label="客户类型" prop="customerType"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <el-select multiple v-model="ctsTypeArr" placeholder="请选择客户类型" clearable size="small"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <el-form-item label="客户类型" prop="customerLevel"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-select v-model="queryParams.customerLevel" placeholder="请选择客户类型" clearable size="small"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            <el-option 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                v-for="item in typeOptions" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                v-for="item in customerLevelOptions" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 :key="'type'+item.dictValue" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 :label="item.dictLabel" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 :value="item.dictValue" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-       
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <el-form-item label="创建时间" prop="createTime"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <el-date-picker clearable size="small" style="width: 205.4px" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           v-model="dateRange" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -186,9 +186,9 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <el-table-column  label="客户类型" align="center" prop="customerType"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <el-table-column  label="客户类型" align="center"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <template slot-scope="scope"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <el-tag prop="customerType" v-for="(item, index) in typeOptions" :key="'customerType'+index"   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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -228,6 +228,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             @click="handleDelete(scope.row)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             v-hasPermi="['crm:customer:remove']" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           >删除</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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </el-table> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -280,10 +287,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <el-form-item label="客户类型" prop="customerType"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <el-select v-model="form.customerType" placeholder="请选择客户类型" clearable size="small"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-form-item label="客户类型"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-select v-model="form.customerLevel" placeholder="请选择客户类型" clearable size="small"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <el-option 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                  v-for="item in typeOptions" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  v-for="item in customerLevelOpenOptions" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                   :key="item.dictValue" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                   :label="item.dictLabel" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                   :value="item.dictValue" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -346,7 +353,15 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { listCustomer,getCustomer,addCustomer,updateCustomer,delCustomer,exportCustomer  } from "@/api/crm/customer"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  listCustomer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  getCustomer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  addCustomer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  updateCustomer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  delCustomer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  exportCustomer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  switchToTop 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} from "@/api/crm/customer"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { getCompanyList } from "@/api/company/company"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import customerDetails from '../components/customerDetails.vue'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import editCustomerSource from '../components/editCustomerSource.vue'; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -356,6 +371,7 @@ import { throwStatement } from "@babel/types"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { treeselect } from "@/api/company/companyDept"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import Treeselect from "@riophae/vue-treeselect"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import "@riophae/vue-treeselect/dist/vue-treeselect.css"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import {customerLevelOption} from "@/api/crm/customerLevel"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    watch: { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -441,7 +457,8 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         companyId: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         isLine: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         source: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        tags: null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tags: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        customerLevel: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 表单参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       form: {}, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -459,7 +476,9 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         source: [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           { required: true, message: "客户来源不能为空", trigger: "blur" } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      customerLevelOptions: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      customerLevelOpenOptions: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   created() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -483,8 +502,14 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.getCitys(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.getList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.getCustomerLevelOptions() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   methods: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     getCustomerLevelOptions() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       customerLevelOption().then(response => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         this.customerLevelOptions = response.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     handleEditSource(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.source.open=true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       var that=this; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -534,25 +559,6 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.citys=res.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    handleClose(tag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.tags.splice(this.tags.indexOf(tag), 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.form.tags=this.tags.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    showInput() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.inputVisible = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.$nextTick(_ => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.$refs.saveTagInput.$refs.input.focus(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    handleInputConfirm() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      let inputValue = this.inputValue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if (inputValue) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.tags.push(inputValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.inputVisible = false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.inputValue = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.form.tags=this.tags.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     handleShow(row){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       var that=this; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       that.show.open=true; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -631,7 +637,8 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         companyId: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         isLine: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         source: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        tags: null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tags: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        customerLevel: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.tags=[]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.cityIds=[]; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -689,6 +696,11 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               that.cityIds.push(id) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        customerLevelOption({status: 0}).then(response => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.customerLevelOpenOptions = response.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.open = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.title = "修改客户"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -731,6 +743,15 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.msgSuccess("删除成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }).catch(function() {}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    handleSwitchToTop(row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      switchToTop(row.customerId).then(response => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const {code} = response 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (code === 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.msgSuccess(row.isTop === 0 ? "已置顶" : "已取消置顶"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.getList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 导出按钮操作 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     handleExport() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       //const queryParams = this.queryParams; 
			 |