| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form" style="margin-bottom: 20px;"> |
| | | <div class="search_form" |
| | | style="margin-bottom: 20px;"> |
| | | <div> |
| | | <span class="search_title">客户名称:</span> |
| | | <el-input v-model="searchForm.customerName" |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="assignDialogVisible" |
| | | title="分配客户" |
| | | width="500px" |
| | | @close="closeAssignDialog"> |
| | | <el-form :model="assignForm" |
| | | :rules="assignRules" |
| | | ref="assignFormRef" |
| | | label-width="100px"> |
| | | <el-form-item label="客户名称"> |
| | | <el-input v-model="assignForm.customerName" |
| | | disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="分配人员" |
| | | prop="boundId"> |
| | | <el-select v-model="assignForm.boundId" |
| | | placeholder="请选择分配人员" |
| | | style="width: 100%" |
| | | filterable> |
| | | <el-option v-for="item in userList" |
| | | :key="item.userId || item.nickName" |
| | | :label="item.nickName" |
| | | :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" |
| | | @click="submitAssignForm">确认</el-button> |
| | | <el-button @click="closeAssignDialog">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="shareDialogVisible" |
| | | title="共享客户" |
| | | width="500px" |
| | | @close="closeShareDialog"> |
| | | <el-form :model="shareForm" |
| | | :rules="shareRules" |
| | | ref="shareFormRef" |
| | | label-width="100px"> |
| | | <el-form-item label="客户名称"> |
| | | <el-input v-model="shareForm.customerName" |
| | | disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="共享人员" |
| | | prop="boundIds"> |
| | | <el-select v-model="shareForm.boundIds" |
| | | placeholder="请选择共享人员" |
| | | style="width: 100%" |
| | | filterable |
| | | multiple |
| | | collapse-tags |
| | | collapse-tags-tooltip> |
| | | <el-option v-for="item in userList" |
| | | :key="item.userId || item.nickName" |
| | | :label="item.nickName" |
| | | :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" |
| | | @click="submitShareForm">确认</el-button> |
| | | <el-button @click="closeShareDialog">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 用户导入对话框 --> |
| | | <el-dialog :title="upload.title" |
| | | v-model="upload.open" |
| | |
| | | :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" |
| | |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitReminderForm">确认</el-button> |
| | | <el-button type="primary" |
| | | @click="submitReminderForm">确认</el-button> |
| | | <el-button @click="closeReminderDialog">取消</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitNegotiationForm">确认</el-button> |
| | | <el-button type="primary" |
| | | @click="submitNegotiationForm">确认</el-button> |
| | | <el-button @click="closeNegotiationDialog">取消</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | 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, |
| | | getCustomer, |
| | | addCustomer, |
| | | updateCustomer, |
| | | delCustomer, |
| | | } from "@/api/basicData/customer.js"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { getToken } from "@/utils/auth.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore(); |
| | | const assignDialogVisible = ref(false); |
| | | const assignFormRef = ref(); |
| | | const assignForm = reactive({ |
| | | id: undefined, |
| | | customerName: "", |
| | | boundId: undefined, |
| | | }); |
| | | const assignRules = { |
| | | boundId: [{ required: true, message: "请选择分配人员", trigger: "change" }], |
| | | }; |
| | | const shareDialogVisible = ref(false); |
| | | const shareFormRef = ref(); |
| | | const shareForm = reactive({ |
| | | id: undefined, |
| | | customerName: "", |
| | | boundIds: [], |
| | | }); |
| | | const shareRules = { |
| | | boundIds: [{ required: true, message: "请选择共享人员", trigger: "change" }], |
| | | }; |
| | | |
| | | // 回访提醒相关 |
| | | const reminderDialogVisible = ref(false); |
| | |
| | | }, |
| | | { |
| | | label: "地址及联系方式", |
| | | prop: "addressPhone", |
| | | prop: "companyAddress", |
| | | width: 250, |
| | | }, |
| | | { |
| | |
| | | prop: "contactPhone", |
| | | width: 150, |
| | | }, |
| | | // { |
| | | // label: "跟进进度", |
| | | // prop: "followUpLevel", |
| | | // width: 120, |
| | | // }, |
| | | // { |
| | | // label: "跟进时间", |
| | | // prop: "followUpTime", |
| | | // width: 120, |
| | | // }, |
| | | { |
| | | label: "跟进进度", |
| | | prop: "followUpLevel", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "跟进时间", |
| | | prop: "followUpTime", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "银行基本户", |
| | | prop: "basicBankAccount", |
| | |
| | | label: "维护人", |
| | | prop: "maintainer", |
| | | }, |
| | | { |
| | | label: "维护时间", |
| | | prop: "maintenanceTime", |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: "领用人", |
| | | prop: "usageUserName", |
| | | width: 120, |
| | | fixed: "right", |
| | | }, |
| | | { |
| | | label: "领用状态", |
| | | prop: "usageStatus", |
| | | dataType: "tag", |
| | | label: "维护时间", |
| | | prop: "maintenanceTime", |
| | | width: 100, |
| | | fixed: "right", |
| | | formatData: value => { |
| | | if (value === 1 || value === "1") { |
| | | return "已领用"; |
| | | } |
| | | return "未领用"; |
| | | }, |
| | | formatType: value => { |
| | | if (value === 1 || value === "1") { |
| | | return "success"; |
| | | } |
| | | return "info"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "共享人", |
| | | prop: "togetherUserNames", |
| | | width: 120, |
| | | fixed: "right", |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "操作", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 200, |
| | | width: 290, |
| | | operation: [ |
| | | { |
| | | name: "分配", |
| | | name: "编辑", |
| | | type: "text", |
| | | showHide: row => row.usageStatus != 1, |
| | | clickFun: row => { |
| | | openAssignDialog(row); |
| | | openForm("edit", row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "回收", |
| | | name: "添加洽谈进度", |
| | | type: "text", |
| | | showHide: row => row.usageStatus == 1, |
| | | clickFun: row => { |
| | | recycleCustomer(row); |
| | | openNegotiationDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "共享", |
| | | type: "text", |
| | | showHide: row => row.usageStatus == 1, |
| | | clickFun: row => { |
| | | openShareDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "编辑", |
| | | type: "text", |
| | | clickFun: row => { |
| | | openForm("edit", row); |
| | | }, |
| | | }, |
| | | // { |
| | | // name: "详情", |
| | | // type: "text", |
| | | // clickFun: row => { |
| | | // openDetailDialog(row); |
| | | // }, |
| | | // }, |
| | | { |
| | | name: "回访提醒", |
| | | type: "text", |
| | | clickFun: row => { |
| | | openReminderDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "详情", |
| | | type: "text", |
| | | clickFun: row => { |
| | | openDetailDialog(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // 上传的地址 |
| | | url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData", |
| | | data: {}, |
| | | // 文件上传前的回调 |
| | | beforeUpload: file => { |
| | | console.log("文件即将上传", file); |
| | |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const { total, ...queryPage } = page; |
| | | listCustomer({ ...searchForm.value, ...queryPage }).then(res => { |
| | | listCustomer({ ...searchForm.value, ...page }).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | page.total = res.data.total; |
| | |
| | | proxy.resetForm("formRef"); |
| | | dialogFormVisible.value = false; |
| | | }; |
| | | const ensureUserList = () => { |
| | | if (userList.value.length) { |
| | | return Promise.resolve(); |
| | | } |
| | | return userListNoPage().then(res => { |
| | | userList.value = res.data || []; |
| | | }); |
| | | }; |
| | | const openAssignDialog = row => { |
| | | assignForm.id = row.id; |
| | | assignForm.customerName = row.customerName; |
| | | assignForm.boundId = undefined; |
| | | ensureUserList().then(() => { |
| | | assignDialogVisible.value = true; |
| | | }); |
| | | }; |
| | | const closeAssignDialog = () => { |
| | | proxy.resetForm("assignFormRef"); |
| | | assignForm.id = undefined; |
| | | assignForm.customerName = ""; |
| | | assignForm.boundId = undefined; |
| | | assignDialogVisible.value = false; |
| | | }; |
| | | const openShareDialog = row => { |
| | | shareForm.id = row.id; |
| | | shareForm.customerName = row.customerName; |
| | | shareForm.boundIds = []; |
| | | ensureUserList().then(() => { |
| | | shareDialogVisible.value = true; |
| | | }); |
| | | }; |
| | | const closeShareDialog = () => { |
| | | proxy.resetForm("shareFormRef"); |
| | | shareForm.id = undefined; |
| | | shareForm.customerName = ""; |
| | | shareForm.boundIds = []; |
| | | shareDialogVisible.value = false; |
| | | }; |
| | | const submitAssignForm = () => { |
| | | proxy.$refs.assignFormRef.validate(valid => { |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | addCustomerPrivatePool({ |
| | | customerId: assignForm.id, |
| | | boundId: assignForm.boundId, |
| | | }).then(() => { |
| | | proxy.$modal.msgSuccess("分配成功"); |
| | | closeAssignDialog(); |
| | | getList(); |
| | | }); |
| | | }); |
| | | }; |
| | | const submitShareForm = () => { |
| | | proxy.$refs.shareFormRef.validate(valid => { |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | shareCustomer({ |
| | | customerId: shareForm.id, |
| | | boundIds: shareForm.boundIds, |
| | | }).then(() => { |
| | | proxy.$modal.msgSuccess("共享成功"); |
| | | closeShareDialog(); |
| | | getList(); |
| | | }); |
| | | }); |
| | | }; |
| | | const recycleCustomer = row => { |
| | | ElMessageBox.confirm("确认回收客户“" + row.customerName + "”吗?", "回收提示", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return delCustomerPrivatePool(row.id); |
| | | }) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("回收成功"); |
| | | getList(); |
| | | }) |
| | | .catch(error => { |
| | | if (error === "cancel" || error === "close") { |
| | | proxy.$modal.msg("已取消"); |
| | | } |
| | | }); |
| | | }; |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | // 检查是否有他人维护的数据 |
| | | const unauthorizedData = selectedRows.value.filter( |
| | | item => item.maintainer !== userStore.nickName |
| | | ); |
| | | if (unauthorizedData.length > 0) { |
| | | proxy.$modal.msgWarning("不可删除他人维护的数据"); |
| | | return; |
| | | } |
| | | ids = selectedRows.value.map(item => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("请选择数据"); |
| | |
| | | .then(() => { |
| | | tableLoading.value = true; |
| | | delCustomer(ids) |
| | | .then(res => { |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |
| | | }) |
| | |
| | | }; |
| | | } |
| | | |
| | | console.log("提交回访提醒数据:", submitvalue.value); |
| | | |
| | | // 调用接口 |
| | | addReturnVisit(submitvalue.value) |
| | | .then(res => { |
| | |
| | | negotiationForm.followUpTime = ""; |
| | | negotiationForm.followerUserName = userStore.nickName; // 默认当前登录人 |
| | | negotiationForm.content = ""; |
| | | // { |
| | | // "customerId": 152, |
| | | // "followUpMethod": "电话沟通", |
| | | // "followUpLevel": "没有意向", |
| | | // "followUpTime": "2026-03-04T15:30:00", |
| | | // "followerUserName": "管理员账号", |
| | | // "content": "111" |
| | | // } |
| | | negotiationDialogVisible.value = true; |
| | | }; |
| | | |
| | |
| | | |
| | | if (isEdit) { |
| | | // 修改操作 |
| | | console.log("修改洽谈进度数据:", negotiationForm); |
| | | // 这里可以调用更新接口 |
| | | // 实际项目中需要根据后端接口进行调整 |
| | | // 示例:updateCustomerFollow(negotiationForm).then(res => { |
| | | // // 更新本地数据 |
| | | // const index = negotiationForm.editIndex; |
| | | // negotiationRecords.value[index] = { |
| | | // followUpTime: negotiationForm.followUpTime, |
| | | // followUpMethod: negotiationForm.followUpMethod, |
| | | // followUpLevel: negotiationForm.followUpLevel, |
| | | // followerUserName: negotiationForm.followerUserName, |
| | | // content: negotiationForm.content, |
| | | // id: negotiationForm.id, |
| | | // }; |
| | | // proxy.$modal.msgSuccess("修改成功"); |
| | | // closeNegotiationDialog(); |
| | | // }); |
| | | updateCustomerFollow(negotiationForm).then(res => { |
| | | // 更新本地数据 |
| | | getCustomer(negotiationForm.customerId).then(res => { |
| | |
| | | |
| | | // 打开详情弹窗 |
| | | const openDetailDialog = row => { |
| | | // 调用getCustomer接口获取客户详情 |
| | | getCustomer(row.id).then(res => { |
| | | // 填充客户基本信息 |
| | | Object.assign(detailForm, res.data); |
| | |
| | | const downloadAttachment = row => { |
| | | if (row.url) { |
| | | // proxy.download(row.url, {}, row.name); |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } else { |
| | | proxy.$modal.msgError("下载链接不存在"); |
| | | } |