瀏覽代碼

1、会员管理条件查询页面调整
2、会员项目管理条件查询页面调整
3、会员管理操作展示问题处理
4、会员项目管理操作展示问题处理

yfh 1 天之前
父節點
當前提交
d627530dc4
共有 3 個文件被更改,包括 148 次插入29 次删除
  1. 7 0
      src/api/store/user.js
  2. 59 13
      src/views/store/user/index.vue
  3. 82 16
      src/views/store/user/indexproject.vue

+ 7 - 0
src/api/store/user.js

@@ -57,6 +57,13 @@ export function delUser(userId) {
     method: 'delete'
   })
 }
+// 删除用户
+export function delUserCompanyUser(id) {
+  return request({
+    url: '/store/user/delete/' + id,
+    method: 'delete'
+  })
+}
 
 // 导出用户
 export function exportUser(query) {

+ 59 - 13
src/views/store/user/index.vue

@@ -43,24 +43,42 @@
           @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="status">
         <el-select  v-model="queryParams.status" placeholder="请选择状态" clearable size="small" >
           <el-option
@@ -150,7 +168,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"
@@ -207,7 +225,6 @@
                 :show-file-list="false"
                 :on-success="handleAvatarSuccess"
                 :before-upload="beforeAvatarUpload"
-                :http-request="handleAvatarUpload"
               >
                 <el-button size="small" type="primary" icon="el-icon-upload">上传头像</el-button>
               </el-upload>
@@ -303,6 +320,8 @@ export default {
   name: "User",
   data() {
     return {
+      companyQueryOptions:[],
+      companyQueryUserOptions:[],
       uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS", // 上传的图片服务器地址
       userIsPromoterOptions:[],
       userLevelOptions:[],
@@ -363,7 +382,7 @@ export default {
         isDel: null,
         startCreateTime: null,
         endCreateTime: null,
-        companyName: null,
+        companyId: null,
         companyUserNickName: null
       },
       // 表单参数
@@ -400,8 +419,34 @@ 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 = [];
+      }
+    },
+
     // 头像上传前的校验
     beforeAvatarUpload(file) {
       const isJPG = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg';
@@ -480,8 +525,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();
     },
     /** 处理日期范围变化 */

+ 82 - 16
src/views/store/user/indexproject.vue

@@ -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>