| 
					
				 | 
			
			
				@@ -1,7 +1,16 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   <div class="app-container"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <el-form-item label="会员ID" prop="userId"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-input 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          v-model="queryParams.userId" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          placeholder="请输入会员ID" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          clearable 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          @keyup.enter.native="handleQuery" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <el-form-item label="会员昵称" prop="nickname"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <el-input 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -32,24 +41,47 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           @change="handleDateRangeChange"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </el-date-picker> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <el-form-item label="所属公司" prop="companyName"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <el-input 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          v-model="queryParams.companyName" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          placeholder="请输入所属公司" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-select 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          v-model="queryParams.companyId" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          placeholder="请选择所属公司" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           clearable 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          filterable 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          @keyup.enter.native="handleQuery" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          @change="handleQueryCompanyChange" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-option 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            v-for="item in companyQueryOptions" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :key="item.companyId" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :label="item.companyName" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :value="item.companyId"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </el-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <el-form-item label="所属销售" prop="companyUserNickName"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <el-input 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-select 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           v-model="queryParams.companyUserNickName" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          placeholder="请输入所属销售" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          placeholder="请选择所属销售" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           clearable 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          filterable 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          @keyup.enter.native="handleQuery" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-option 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            v-for="item in companyQueryUserOptions" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :key="item.userId" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :label="item.nickName" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :value="item.nickName"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </el-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <!--      <el-form-item label="推线编码" prop="registerCode">--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <!--        <el-input--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -192,7 +224,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <span>{{ parseTime(scope.row.lastWatchDate) }}</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <el-table-column label="操作" align="center" fixed="right" width="150px" class-name="small-padding fixed-width"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <el-table-column label="操作" align="center"  width="150px"   class-name="small-padding fixed-width"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <template slot-scope="scope"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <el-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             size="mini" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -348,7 +380,8 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { listUserByProject, getUser, delUser, addUser, updateUser, exportUser } from "@/api/store/user"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import {listUserByProject, getUser, addUser, updateUser, exportUser, delUserCompanyUser} from "@/api/store/user"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { deleteCompanyUserById } from "@/api/company/companyUser"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { getCompanyUserList, changeCompanyUser, getCompanyList } from '@/api/company/companyUser'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import storeUserDetails from './components/storeUserDetails.vue'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -356,6 +389,8 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   name: "User", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   data() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      companyQueryOptions:[], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      companyQueryUserOptions:[], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       userIsPromoterOptions:[], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       userLevelOptions:[], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       statusOptions:[], 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -415,7 +450,7 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         isDel: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         startCreateTime: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         endCreateTime: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        companyName: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        companyId: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         companyUserNickName: null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 表单参数 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -473,8 +508,36 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.getList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    getCompanyList().then(response => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (response.code === 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.companyQueryOptions = response.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   methods: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    handleQueryCompanyChange(companyId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 清空已选择的销售 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.queryCompanyUserId = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 根据公司ID获取对应的销售列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (companyId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        getCompanyUserList({ companyId: companyId }).then(response => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if (response.code === 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.companyQueryUserOptions = response.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.$message.error(response.msg || '获取销售列表失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.companyQueryUserOptions = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }).catch(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$message.error('获取销售列表失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.companyQueryUserOptions = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.companyQueryUserOptions = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 查询用户列表 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     getList() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.loading = true; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -533,8 +596,9 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     resetQuery() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.dateRange = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.resetForm("queryForm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.queryParams.companyName = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.queryParams.companyId = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.queryParams.companyUserNickName = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.companyQueryUserOptions = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.handleQuery(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 处理日期范围变化 */ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -600,13 +664,13 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 删除按钮操作 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     handleDelete(row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      const userIds = row.userId || this.ids; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.$confirm('是否确认删除用户编号为"' + userIds + '"的数据项?', "警告", { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const companyUserId = row.companyUserId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$confirm('是否确认删除用户编号为"' + companyUserId + '"的数据项?', "警告", { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           confirmButtonText: "确定", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           cancelButtonText: "取消", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           type: "warning" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }).then(function() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          return delUser(userIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          return delUserCompanyUser(companyUserId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }).then(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.getList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.msgSuccess("删除成功"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -726,4 +790,6 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </script> 
			 |