| 
					
				 | 
			
			
				@@ -51,6 +51,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </el-tag> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!--      <el-table-column label="是否重粉" align="center" prop="isRepeat">--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!--        <template slot-scope="scope">--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!--          <el-tag :type="scope.row.isRepeat === 1 ? 'success' : 'danger'">--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!--            {{ scope.row.status === 1 ? '是' : '否' }}--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!--          </el-tag>--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!--        </template>--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!--      </el-table-column>--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <el-table-column label="看课数量" align="center" prop="watchCourseCount" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <el-table-column label="参与营期数量" align="center" prop="partCourseCount" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <el-table-column label="所属销售" align="center" prop="companyUserNickName" /> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -71,9 +78,9 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <!--            size="mini"--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <!--            type="text"--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <!--            icon="el-icon-delete"--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-<!--            @click="handleDelete(scope.row)"--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!--            @click="handleQwAccount(scope.row)"--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <!--            v-hasPermi="['fs:user:remove']"--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-<!--          >删除</el-button>--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!--          >查看重粉列表</el-button>--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <!--        </template>--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <!--      </el-table-column>--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </el-table> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -114,6 +121,16 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <!-- 更换会员归属对话框 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <el-dialog title="更换会员归属" :visible.sync="changeCompanyUserOpen" width="500px" append-to-body> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <el-form ref="changeCompanyUserForm" :model="changeCompanyUserForm" :rules="changeCompanyUserRules" label-width="100px"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-form-item label="选择公司" prop="companyId"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-select v-model="changeCompanyUserForm.companyId" placeholder="请选择公司" style="width: 100%" @change="handleCompanyChange"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-option 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              v-for="item in companyOptions" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              :key="item.companyId" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              :label="item.companyName" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              :value="item.companyId" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <el-form-item label="选择销售" prop="companyUserId"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <el-select v-model="changeCompanyUserForm.companyUserId" placeholder="请选择销售" style="width: 100%" @change="handleCompanyUserChange"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <el-option 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -135,7 +152,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { listUser, delUser, addUser, updateUser, exportUser } from "@/api/fs/user"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { getCompanyUserList, changeCompanyUser } from '@/api/company/companyUser'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { getCompanyUserList, changeCompanyUser, getCompanyList } from '@/api/company/companyUser'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   name: "User", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   data() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -187,23 +204,32 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       changeCompanyUserOpen: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 更换会员归属表单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       changeCompanyUserForm: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        companyId: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         companyUserId: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        companyId: null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        userIds: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 更换会员归属表单校验 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       changeCompanyUserRules: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        companyId: [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { required: true, message: '请选择公司', trigger: 'change' } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         companyUserId: [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          { required: true, message: "请选择销售", trigger: "change" } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { required: true, message: '请选择销售', trigger: 'change' } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 销售选项 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      companyUserOptions: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      companyUserOptions: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      companyOptions: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   created() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.getList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   methods: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 查看企微账号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    handleQwAccount(row){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 查询用户列表 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     getList() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.loading = true; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -302,62 +328,74 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 更换会员归属按钮操作 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     handleChangeCompanyUser() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      // 获取销售列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      getCompanyUserList().then(response => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 获取公司下拉列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      getCompanyList().then(response => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (response.code === 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.companyUserOptions = response.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          console.log("列表", this.companyUserOptions); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.companyOptions = response.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          // 重置表单和销售列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.resetCompanyUserForm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.companyUserOptions = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.changeCompanyUserOpen = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.$message.error(response.msg || '获取销售列表失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$message.error(response.msg || '获取公司列表失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }).catch(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.$message.error('获取销售列表失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$message.error('获取公司列表失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 取消更换会员归属 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    cancelChangeCompanyUser() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.changeCompanyUserOpen = false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.resetCompanyUserForm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 销售选择变化 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    handleCompanyUserChange(value) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      const selectedUser = this.companyUserOptions.find(item => item.userId === value); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if (selectedUser) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.changeCompanyUserForm.companyId = selectedUser.companyId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        console.log("选择的销售信息:", selectedUser); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        console.log("设置的companyId:", this.changeCompanyUserForm.companyId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    handleCompanyUserChange(userId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (!this.changeCompanyUserForm.companyId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$message.warning('请先选择公司'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.changeCompanyUserForm.companyUserId = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 重置更换会员归属表单 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     resetCompanyUserForm() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.changeCompanyUserForm = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        companyId: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         companyUserId: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        companyId: null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        userIds: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.resetForm("changeCompanyUserForm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    handleCompanyChange(companyId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 清空已选择的销售 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.changeCompanyUserForm.companyUserId = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 根据公司ID获取对应的销售列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (companyId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        getCompanyUserList({ companyId: companyId }).then(response => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if (response.code === 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.companyUserOptions = response.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.$message.error(response.msg || '获取销售列表失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.companyUserOptions = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }).catch(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$message.error('获取销售列表失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.companyUserOptions = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.companyUserOptions = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 取消更换会员归属 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    cancelChangeCompanyUser() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.changeCompanyUserOpen = false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.resetCompanyUserForm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 提交更换会员归属 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     submitChangeCompanyUserForm() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.$refs["changeCompanyUserForm"].validate(valid => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (valid) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           // 调用更换会员归属接口 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          console.log("销售", this.changeCompanyUserForm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          console.log("用户", this.ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           // 检查companyId是否已设置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           if (!this.changeCompanyUserForm.companyId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            this.$message.error('请选择销售'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.$message.error('请选择公司'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          // 确保userIds是List<Long>类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          // const userIds = this.ids.map(id => Number(id)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          console.log({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            userIds:  this.ids, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            companyUserId: this.changeCompanyUserForm.companyUserId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            companyId: this.changeCompanyUserForm.companyId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           changeCompanyUser(this.ids, { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               companyUserId: this.changeCompanyUserForm.companyUserId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               companyId: this.changeCompanyUserForm.companyId 
			 |