liyong
2 天以前 c4263eabb45d79932caee4827c01322406049be0
feat(customer): 添加客户流入公海功能

- 新增 backCustomer API 接口用于客户流入公海操作
- 在客户档案页面添加流入公海按钮和相应功能
- 实现批量选择客户流入公海的确认对话框
- 添加流入公海成功提示和列表刷新逻辑
- 集成 Element Plus 的 MessageBox 确认弹窗
- 实现表格加载状态管理和错误处理
已修改2个文件
43 ■■■■■ 文件已修改
src/api/basicData/customer.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/customerFile/index.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/basicData/customer.js
@@ -26,6 +26,14 @@
    })
}
// 流入公海
export function backCustomer(id) {
    return request({
        url: '/basic/customer/back/' + id,
        method: 'post'
    })
}
export function shareCustomer(data) {
    return request({
        url: '/basic/customer/together',
src/views/basicData/customerFile/index.vue
@@ -27,6 +27,9 @@
      <div>
        <el-button type="primary"
                   @click="openForm('add')">新增客户</el-button>
        <el-button type="primary"
                   plain
                   @click="back">流入公海</el-button>
        <el-button @click="handleOut">导出</el-button>
        <el-button type="info"
                   plain
@@ -619,7 +622,7 @@
    addReturnVisit,
    getReturnVisit,
  } from "@/api/basicData/customerFile.js";
  import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer} from "@/api/basicData/customer.js";
  import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer, backCustomer} from "@/api/basicData/customer.js";
  import { ElMessageBox } from "element-plus";
  import { userListNoPage } from "@/api/system/user.js";
  import useUserStore from "@/store/modules/user";
@@ -1126,6 +1129,36 @@
      });
  };
  const back = () => {
    if (selectedRows.value.length === 0) {
      proxy.$modal.msgWarning("请选择数据");
      return;
    }
    const ids = selectedRows.value.map(item => item.id);
    ElMessageBox.confirm("选中的客户将流入公海,是否确认?", "流入公海提示", {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
    })
      .then(() => {
        tableLoading.value = true;
        return Promise.all(ids.map(id => backCustomer(id)))
          .then(() => {
            proxy.$modal.msgSuccess("流入公海成功");
            selectedRows.value = [];
            getList();
          })
          .finally(() => {
            tableLoading.value = false;
          });
      })
      .catch(error => {
        if (error === "cancel" || error === "close") {
          proxy.$modal.msg("已取消");
        }
      });
  };
  // 打开回访提醒弹窗
  const openReminderDialog = row => {
    currentCustomerId.value = row.id;