沐梦. пре 3 дана
родитељ
комит
58c89f22dd

+ 88 - 6
src/api/customer/customerPool.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 查询客户公海信息列表
 export function listPool(query) {
   return request({
-    url: '/customer/customerInfo/customerList',
+    url: '/customer/customerPool/customerList',
     method: 'get',
     params: {
       ...query,
@@ -12,27 +12,75 @@ export function listPool(query) {
   })
 }
 
+// 查询有效客户信息列表
+export function listValidCustomer(query) {
+  return request({
+    url: '/customer/customerPool/list',
+    method: 'get',
+    params: {
+      ...query,
+      isHighSeas: 'false'
+    }
+  })
+}
+
 // 公海客户认领
 export function claimPool(data) {
   return request({
-    url: '/customer/customerInfo/claimPool',
+    url: '/customer/customerPool/claimPool',
+    method: 'put',
+    data: data
+  })
+}
+
+// 退回到公海池(支持批量)
+export function releaseToPool(customerIds, reason = '') {
+  const ids = Array.isArray(customerIds) ? customerIds : [customerIds];
+  return request({
+    url: '/customer/customerPool/releaseToPool',
+    method: 'post',
+    data: { customerIds: ids, reason }
+  })
+}
+
+// 转移业务人员
+export function transferSalesPerson(data) {
+  return request({
+    url: '/customer/customerPool/transferSalesPerson',
+    method: 'put',
+    data: data
+  })
+}
+
+// 转移客服人员
+export function transferServiceStaff(data) {
+  return request({
+    url: '/customer/customerPool/transferServiceStaff',
     method: 'put',
     data: data
   })
 }
 
-// 详情接口
+// 获取详情接口 (公海使用)
 export function getPool(id) {
   return request({
-      url: `/customer/customerInfo/${id}`,
+      url: `/customer/customerPool/${id}`,
       method: 'get'
   })
 }
 
+// 获取有效客户信息详细 (有效客户使用)
+export function getCustomerInfo(id) {
+  return request({
+    url: '/customer/customerPool/' + id,
+    method: 'get'
+  });
+}
+
 // 新增客户公海
 export function addPool(data) {
   return request({
-    url: '/customer/customerInfo',
+    url: '/customer/customerPool',
     method: 'post',
     data: data
   })
@@ -41,8 +89,42 @@ export function addPool(data) {
 // 修改客户公海
 export function updatePool(data) {
   return request({
-    url: '/customer/customerInfo',
+    url: '/customer/customerPool',
     method: 'put',
     data: data
   })
 }
+
+// 新增客户信息
+export function addCustomerInfo(data) {
+  return request({
+    url: '/customer/customerPool',
+    method: 'post',
+    data: data
+  });
+}
+
+// 修改客户信息
+export function updateCustomerInfo(data) {
+  return request({
+    url: '/customer/customerPool',
+    method: 'put',
+    data: data
+  });
+}
+
+// 获取公司下拉列表
+export function listCompanyOption() {
+  return request({
+    url: '/customer/customerPool/companyOptionList',
+    method: 'get'
+  })
+}
+
+// 获取等级下拉列表
+export function listLevelOption() {
+  return request({
+    url: '/customer/customerPool/levelOptionList',
+    method: 'get'
+  })
+}

+ 22 - 1
src/views/common/businessActivity.vue

@@ -294,7 +294,7 @@
 
         <el-form-item label="团队角色:" prop="roleCode">
           <el-select v-model="memberForm.roleCode" placeholder="请选择" class="w100">
-            <el-option v-for="dict in teamRoleDict" :key="dict.value" :label="dict.label" :value="dict.value" />
+            <el-option v-for="dict in filteredTeamRoleDict" :key="dict.value" :label="dict.label" :value="dict.value" />
           </el-select>
         </el-form-item>
 
@@ -409,6 +409,27 @@ const filteredTeam = computed(() => {
   return teamList.value.filter(m => (m.realName || '').includes(memberSearch.value));
 });
 
+const filteredTeamRoleDict = computed(() => {
+  if (!teamRoleDict.value) return [];
+  // 获取已被其他团队成员占用的角色编码
+  const existingRoleCodes = teamList.value
+    .filter(m => {
+      if (isEditMember.value) {
+        // 编辑团队成员时,排除当前正在编辑的成员自身占用的角色
+        return String(m.id) !== String(memberForm.id);
+      }
+      return true;
+    })
+    .map(m => {
+      const code = String(m.roleCode);
+      // 兼容可能存在的旧数据 B0001(对应字典值 1)
+      if (code === 'B0001') return '1';
+      return code;
+    });
+  
+  return teamRoleDict.value.filter(dict => !existingRoleCodes.includes(String(dict.value)));
+});
+
 const filteredRecords = computed(() => {
   return recordList.value.filter(record => {
     const no = String(record.recordsNo || record.scheduleNo || '');

+ 1 - 1
src/views/customer/highseas/edit.vue

@@ -259,7 +259,7 @@
 
 <script setup>
 import { ref, reactive, onMounted, getCurrentInstance, isRef } from 'vue';
-import { getCustomerInfo, updateCustomerInfo, listCompanyOption, listLevelOption } from "@/api/customer/customerInfo";
+import { getPool as getCustomerInfo, updatePool as updateCustomerInfo, listCompanyOption, listLevelOption } from "@/api/customer/customerPool";
 import { listComStaff } from "@/api/system/comStaff/index";
 import { listProvinceWithCities } from "@/api/customer/addressArea";
 import ImageUpload from "@/components/ImageUpload";

+ 1 - 1
src/views/customer/valid/detail.vue

@@ -713,7 +713,7 @@
 import { ref, reactive, computed, onMounted, getCurrentInstance, toRefs } from 'vue';
 import { useRoute, useRouter } from 'vue-router';
 import { Close, Edit, Plus, Search, UserFilled, Upload } from '@element-plus/icons-vue';
-import { getCustomerInfo } from "@/api/customer/customerInfo/index";
+import { getCustomerInfo } from "@/api/customer/customerPool";
 import { listTeamMember } from "@/api/customer/teamMember";
 import { listOpportunity } from "@/api/saleManage/opportunity";
 import { listProjectSelection } from "@/api/saleManage/projectSelection";

+ 1 - 1
src/views/customer/valid/edit.vue

@@ -270,7 +270,7 @@
 <script setup name="CustomerValidEdit">
 import { ref, reactive, onMounted, getCurrentInstance, toRefs } from 'vue';
 import { useRoute, useRouter } from 'vue-router';
-import { listCompanyOption, getCustomerInfo, updateCustomerInfo } from "@/api/customer/customerInfo/index";
+import { listCompanyOption, getCustomerInfo, updateCustomerInfo } from "@/api/customer/customerPool";
 import { listIndustryCategory } from "@/api/customer/industryCategory";
 import { listLevel } from "@/api/customer/customerLevel";
 import { listComStaff } from "@/api/system/comStaff/index";

+ 6 - 12
src/views/customer/valid/index.vue

@@ -185,7 +185,7 @@
 <script setup name="CustomerValid">
 import { ref, reactive, onMounted, getCurrentInstance, toRefs } from 'vue';
 import { useRouter } from 'vue-router';
-import { listValidCustomer, releaseToPool, listCompanyOption, transferSalesPerson, transferServiceStaff } from "@/api/customer/customerInfo/index";
+import { listValidCustomer, releaseToPool, listCompanyOption, transferSalesPerson, transferServiceStaff } from "@/api/customer/customerPool";
 import { listIndustryCategory } from "@/api/customer/industryCategory";
 import { listLevel } from "@/api/customer/customerLevel";
 import { listComStaff } from "@/api/system/comStaff/index";
@@ -221,17 +221,10 @@ const tabs = [
 
 const handleTabClick = (key) => {
   activeTab.value = key;
+  queryParams.activeTab = key;
   // 重置负责人相关的过滤参数
   queryParams.salesPersonId = undefined;
   queryParams.serviceStaffId = undefined;
-
-  if (key === 'mine') {
-    const currentStaff = staffOptions.value.find(s => String(s.userId) === String(userStore.userId));
-    if (currentStaff) {
-      queryParams.salesPersonId = currentStaff.staffId;
-      queryParams.serviceStaffId = currentStaff.staffId;
-    }
-  }
   handleQuery();
 };
 
@@ -247,7 +240,8 @@ const queryParams = reactive({
   serviceStaffId: undefined,
   belongingDepartmentId: undefined,
   status: undefined,
-  enterpriseTypeId: undefined
+  enterpriseTypeId: undefined,
+  activeTab: 'all'
 });
 
 const getList = () => {
@@ -472,9 +466,9 @@ onMounted(() => {
     background-color: #fff;
 
     &.active {
-      color: #333;
+      color: #409eff;
       font-weight: normal;
-      border-color: #333;
+      border-color: #409eff;
     }
     &:hover:not(.active) {
       border-color: #cbd5e1;