huminmin
18 小时以前 4752c457102833c0f379f20def46d4da5ff1adeb
src/views/basicData/customerFileOpenSea/index.vue
@@ -280,7 +280,8 @@
                 :limit="1"
                 accept=".xlsx, .xls"
                 :headers="upload.headers"
                 :action="upload.url + '?updateSupport=' + upload.updateSupport"
                 :action="upload.url"
                 :data="upload.data"
                 :disabled="upload.isUploading"
                 :before-upload="upload.beforeUpload"
                 :on-progress="upload.onProgress"
@@ -681,20 +682,23 @@
  import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
  import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
  import {
    addCustomer,
    addCustomerPrivatePool,
    delCustomerPrivatePool,
    delCustomer,
    getCustomer,
    shareCustomer,
    listCustomer,
    updateCustomer,
    addCustomerFollow,
    updateCustomerFollow,
    delCustomerFollow,
    addReturnVisit,
    getReturnVisit,
  } from "@/api/basicData/customerFile.js";
  import {
    listCustomer,
    addCustomer,
    delCustomer,
    updateCustomer,
    getCustomer,
    assignCustomer,
    recycleCustomer,
    shareCustomer,
  } from "@/api/basicData/customer.js";
  import { ElMessageBox } from "element-plus";
  import { userListNoPage } from "@/api/system/user.js";
  import useUserStore from "@/store/modules/user";
@@ -915,7 +919,7 @@
          type: "text",
          showHide: row => row.usageStatus == 1,
          clickFun: row => {
            recycleCustomer(row);
            recycle(row);
          },
        },
            {
@@ -970,6 +974,7 @@
    searchForm: {
      customerName: "",
      customerType: "",
      type: 1
    },
    form: {
      customerName: "",
@@ -984,6 +989,7 @@
      bankAccount: "",
      bankCode: "",
      customerType: "",
      type: 1
    },
    rules: {
      customerName: [{ required: true, message: "请输入", trigger: "blur" }],
@@ -1015,6 +1021,9 @@
    headers: { Authorization: "Bearer " + getToken() },
    // 上传的地址
    url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
    data: {
      type: 1
    },
    // 文件上传前的回调
    beforeUpload: file => {
      console.log("文件即将上传", file);
@@ -1122,6 +1131,7 @@
      },
    ];
    form.value.maintenanceTime = getCurrentDate();
    form.value.type = 1;
    userListNoPage().then(res => {
      userList.value = res.data;
    });
@@ -1214,7 +1224,7 @@
  const openShareDialog = row => {
    shareForm.id = row.id;
    shareForm.customerName = row.customerName;
    shareForm.boundIds = [];
    shareForm.boundIds = row.userIds || [];
    ensureUserList().then(() => {
      shareDialogVisible.value = true;
    });
@@ -1231,9 +1241,9 @@
      if (!valid) {
        return;
      }
      addCustomerPrivatePool({
        customerId: assignForm.id,
        boundId: assignForm.boundId,
      assignCustomer({
        id: assignForm.id,
        usageUser: assignForm.boundId,
      }).then(() => {
        proxy.$modal.msgSuccess("分配成功");
        closeAssignDialog();
@@ -1247,8 +1257,8 @@
        return;
      }
      shareCustomer({
        customerId: shareForm.id,
        boundIds: shareForm.boundIds,
        id: shareForm.id,
        userIds: shareForm.boundIds,
      }).then(() => {
        proxy.$modal.msgSuccess("共享成功");
        closeShareDialog();
@@ -1256,18 +1266,17 @@
      });
    });
  };
  const recycleCustomer = row => {
  const recycle = row => {
    ElMessageBox.confirm("确认回收客户“" + row.customerName + "”吗?", "回收提示", {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
    })
      .then(() => {
        return delCustomerPrivatePool(row.id);
      })
      .then(() => {
        proxy.$modal.msgSuccess("回收成功");
        getList();
        return recycleCustomer({id: row.id}).then(() => {
          proxy.$modal.msgSuccess("回收成功");
          getList();
        })
      })
      .catch(error => {
        if (error === "cancel" || error === "close") {
@@ -1283,7 +1292,7 @@
      type: "warning",
    })
      .then(() => {
        proxy.download("/basic/customer/export", {}, "客户档案.xlsx");
        proxy.download("/basic/customer/export", {type: 1}, "客户档案.xlsx");
      })
      .catch(() => {
        proxy.$modal.msg("已取消");