Forráskód Böngészése

会员关联项目

Long 3 napja
szülő
commit
f56db45955

+ 42 - 29
src/views/company/companyApply/index.vue

@@ -55,7 +55,7 @@
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -65,9 +65,9 @@
     />
 
     <!-- 详情对话框 -->
-    <el-dialog 
-      title="申请详情" 
-      :visible.sync="detailsVisible" 
+    <el-dialog
+      title="申请详情"
+      :visible.sync="detailsVisible"
       width="50%"
       :close-on-click-modal="false"
       custom-class="apply-details-dialog"
@@ -93,21 +93,26 @@
           </el-tag>
         </div>
       </div>
-      
+
       <!-- 用户列表 -->
       <div class="details-content">
         <div class="content-title">变更用户列表</div>
-        <el-table 
-          :data="selectedUsers" 
-          border 
+        <el-table
+          :data="selectedUsers"
+          border
           style="width: 100%"
           :header-cell-style="{background:'#f5f7fa',color:'#606266'}"
         >
+          <el-table-column prop="projectId" label="项目" align="center">
+            <template slot-scope="scope">
+              <el-tag v-if="scope.row.projectId">{{ getProjectLabel(scope.row.projectId) }}</el-tag>
+            </template>
+          </el-table-column>
           <el-table-column prop="userId" label="用户ID" align="center"></el-table-column>
           <el-table-column prop="userName" label="姓名" align="center"></el-table-column>
         </el-table>
       </div>
-      
+
       <!-- 底部操作区 -->
       <div class="details-footer">
         <el-button @click="detailsVisible = false">关闭</el-button>
@@ -115,9 +120,9 @@
     </el-dialog>
 
     <!-- 审核对话框 -->
-    <el-dialog 
-      title="审核申请" 
-      :visible.sync="auditVisible" 
+    <el-dialog
+      title="审核申请"
+      :visible.sync="auditVisible"
       width="40%"
       :close-on-click-modal="false"
       custom-class="audit-dialog"
@@ -136,8 +141,8 @@
             <el-radio :label="2">拒绝</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item 
-          label="拒绝原因" 
+        <el-form-item
+          label="拒绝原因"
           prop="reason"
           v-if="auditForm.status === 2"
         >
@@ -149,7 +154,7 @@
           ></el-input>
         </el-form-item>
       </el-form>
-      
+
       <!-- 底部操作区 -->
       <div class="audit-footer">
         <el-button @click="auditVisible = false">取 消</el-button>
@@ -214,10 +219,14 @@ export default {
         reason: [
           { required: true, message: "请输入拒绝原因", trigger: "blur" }
         ]
-      }
+      },
+      projectOptions: [],
     };
   },
   created() {
+    this.getDicts("sys_course_project").then(response => {
+      this.projectOptions = response.data;
+    });
     this.getList();
   },
   methods: {
@@ -267,7 +276,7 @@ export default {
           if (this.auditForm.status === 1) {
             this.auditForm.reason = '';
           }
-          
+
           this.submitLoading = true;
           auditApply(this.auditForm).then(response => {
             this.msgSuccess("审核成功");
@@ -280,7 +289,11 @@ export default {
           });
         }
       });
-    }
+    },
+    /** 获取项目对应名称 */
+    getProjectLabel(projectId) {
+      return this.projectOptions.find(item => parseInt(item.dictValue) === projectId)?.dictLabel;
+    },
   }
 };
 </script>
@@ -291,7 +304,7 @@ export default {
   ::v-deep .el-dialog__body {
     padding: 20px;
   }
-  
+
   /* 头部信息样式 */
   .details-header {
     display: flex;
@@ -300,20 +313,20 @@ export default {
     background-color: #f8f9fa;
     border-radius: 4px;
     margin-bottom: 20px;
-    
+
     .info-item {
       width: 50%;
       margin-bottom: 10px;
       display: flex;
       align-items: center;
-      
+
       .label {
         color: #606266;
         font-size: 14px;
         width: 100px;
         text-align: right;
       }
-      
+
       .value {
         color: #303133;
         font-size: 14px;
@@ -321,7 +334,7 @@ export default {
       }
     }
   }
-  
+
   /* 内容区域样式 */
   .details-content {
     .content-title {
@@ -333,7 +346,7 @@ export default {
       border-left: 3px solid #409EFF;
     }
   }
-  
+
   /* 底部样式 */
   .details-footer {
     margin-top: 20px;
@@ -352,7 +365,7 @@ export default {
       font-weight: bold;
     }
   }
-  
+
   .el-table__body-wrapper {
     tr:hover > td {
       background-color: #f5f7fa;
@@ -365,21 +378,21 @@ export default {
   ::v-deep .el-dialog__body {
     padding: 20px;
   }
-  
+
   /* 表单样式 */
   .el-form {
     padding: 20px 0;
-    
+
     .el-form-item {
       margin-bottom: 20px;
-      
+
       span {
         color: #606266;
         font-size: 14px;
       }
     }
   }
-  
+
   /* 底部样式 */
   .audit-footer {
     margin-top: 20px;

+ 27 - 3
src/views/member/list.vue

@@ -2,6 +2,16 @@
   <div class="app-container">
     <!-- Search Form -->
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
+      <el-form-item label="项目" prop="projectId">
+        <el-select  v-model="queryParams.projectId" placeholder="请选择项目" clearable size="small" >
+          <el-option
+            v-for="item in projectOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="昵称" prop="nickname">
         <el-input
           style="width: 200px"
@@ -134,6 +144,11 @@
     <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" border>
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="ID" align="center" prop="userId" />
+      <el-table-column label="项目" align="center" prop="projectId">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.projectId">{{ getProjectLabel(scope.row.projectId) }}</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="昵称" align="center" prop="nickname" />
       <el-table-column label="头像" align="center" width="80">
         <template slot-scope="scope">
@@ -305,7 +320,8 @@ export default {
         missCourseStatus: "0",
         continueMissCourseSort: "0",
         registerStartTime: null,
-        registerEndTime: null
+        registerEndTime: null,
+        projectId: null,
       },
       // 表单参数
       form: {},
@@ -321,7 +337,8 @@ export default {
         status: [
           { required: true, message: "状态不能为空", trigger: "change" }
         ]
-      }
+      },
+      projectOptions: []
     };
   },
   created() {
@@ -329,6 +346,9 @@ export default {
     this.getDicts("user_status").then(response => {
       this.statusOptions = response.data;
     });
+    this.getDicts("sys_course_project").then(response => {
+      this.projectOptions = response.data;
+    });
     this.getTagOptions();
     this.getSalesOptions();
   },
@@ -532,7 +552,11 @@ export default {
           }
         });
       }).catch(() => {});
-    }
+    },
+    /** 获取项目对应名称 */
+    getProjectLabel(projectId) {
+      return this.projectOptions.find(item => parseInt(item.dictValue) === projectId)?.dictLabel;
+    },
   }
 };
 </script>

+ 27 - 3
src/views/member/myList.vue

@@ -2,6 +2,16 @@
   <div class="app-container">
     <!-- Search Form -->
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
+      <el-form-item label="项目" prop="projectId">
+        <el-select  v-model="queryParams.projectId" placeholder="请选择项目" clearable size="small" >
+          <el-option
+            v-for="item in projectOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="昵称" prop="nickname">
         <el-input
           style="width: 200px"
@@ -134,6 +144,11 @@
     <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" border>
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="ID" align="center" prop="userId" />
+      <el-table-column label="项目" align="center" prop="projectId">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.projectId">{{ getProjectLabel(scope.row.projectId) }}</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="昵称" align="center" prop="nickname" />
       <el-table-column label="头像" align="center" width="80">
         <template slot-scope="scope">
@@ -305,7 +320,8 @@ export default {
         missCourseStatus: "0",
         continueMissCourseSort: "0",
         registerStartTime: null,
-        registerEndTime: null
+        registerEndTime: null,
+        projectId: null,
       },
       // 表单参数
       form: {},
@@ -321,7 +337,8 @@ export default {
         status: [
           { required: true, message: "状态不能为空", trigger: "change" }
         ]
-      }
+      },
+      projectOptions: []
     };
   },
   created() {
@@ -329,6 +346,9 @@ export default {
     this.getDicts("user_status").then(response => {
       this.statusOptions = response.data;
     });
+    this.getDicts("sys_course_project").then(response => {
+      this.projectOptions = response.data;
+    });
     this.getTagOptions();
     this.getSalesOptions();
   },
@@ -532,7 +552,11 @@ export default {
           }
         });
       }).catch(() => {});
-    }
+    },
+    /** 获取项目对应名称 */
+    getProjectLabel(projectId) {
+      return this.projectOptions.find(item => parseInt(item.dictValue) === projectId)?.dictLabel;
+    },
   }
 };
 </script>

+ 17 - 2
src/views/users/user/transfer.vue

@@ -47,6 +47,11 @@
     <el-table height="500" border v-loading="loading" :data="customerList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="客户ID" align="center" prop="userId" />
+      <el-table-column label="项目" align="center" prop="projectId">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.projectId">{{ getProjectLabel(scope.row.projectId) }}</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="昵称" align="center" prop="nickname" />
       <el-table-column label="所属销售" align="center" prop="companyUserName" />
       <el-table-column label="手机号码" align="center" prop="phone" />
@@ -135,9 +140,14 @@ export default {
         salesName: null,
         phoneNumber: null,
       },
+      projectOptions: [],
+      selectedUser: [],
     };
   },
   created() {
+    this.getDicts("sys_course_project").then(response => {
+      this.projectOptions = response.data;
+    });
     getUserList().then(res=>{
       if(res.code === 200) {
         this.companyUserList = res.data
@@ -184,6 +194,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.userId)
+      this.selectedUser = selection.map(item => {return {userId: item.userId, projectId: item.projectId}})
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
@@ -206,7 +217,7 @@ export default {
       this.$refs["transferForm"].validate(valid => {
         if (valid) {
           transferUser({
-            userIds: this.ids,
+            userIds: this.selectedUser,
             targetCompanyUserId: this.transferForm.targetUserId,
             content: this.transferForm.content
           }).then(response => {
@@ -240,7 +251,11 @@ export default {
           // 处理下载
           this.download(response.msg); // RuoYi 提供的下载方法
         }).catch(function() {});
-    }
+    },
+    /** 获取项目对应名称 */
+    getProjectLabel(projectId) {
+      return this.projectOptions.find(item => parseInt(item.dictValue) === projectId)?.dictLabel;
+    },
 
   }
 };

+ 15 - 2
src/views/users/user/transferLog.vue

@@ -153,6 +153,11 @@
         <el-form-item label="转移矩阵" prop="customerIds">
           <el-table :data="form.customerList" border>
             <el-table-column label="客户" align="center" prop="userName" />
+            <el-table-column label="项目" align="center" prop="projectId">
+              <template slot-scope="scope">
+                <el-tag v-if="scope.row.projectId">{{ getProjectLabel(scope.row.projectId) }}</el-tag>
+              </template>
+            </el-table-column>
             <el-table-column label="转移前销售" align="center" prop="beforeCompanyUserName" />
             <el-table-column label="转移后销售" align="center" prop="afterCompanyUserName" />
           </el-table>
@@ -268,7 +273,8 @@ export default {
         updatedAt: [
           { required: true, message: "记录最后更新时间不能为空", trigger: "blur" }
         ]
-      }
+      },
+      projectOptions: [],
     };
   },
   created() {
@@ -278,6 +284,9 @@ export default {
     getDicts('transfer_approval_status').then(response => {
       this.approvalStatusList = response.data;
     })
+    this.getDicts("sys_course_project").then(response => {
+      this.projectOptions = response.data;
+    });
     getUserList().then(res=>{
       if(res.code === 200) {
         this.companyUserList = res.data
@@ -393,7 +402,11 @@ export default {
         }).then(response => {
           this.download(response.msg);
         }).catch(function() {});
-    }
+    },
+    /** 获取项目对应名称 */
+    getProjectLabel(projectId) {
+      return this.projectOptions.find(item => parseInt(item.dictValue) === projectId)?.dictLabel;
+    },
   }
 };
 </script>