| | |
| | | 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"; |
| | |
| | | type: "text", |
| | | showHide: row => row.usageStatus == 1, |
| | | clickFun: row => { |
| | | recycleCustomer(row); |
| | | recycle(row); |
| | | }, |
| | | }, |
| | | { |
| | |
| | | searchForm: { |
| | | customerName: "", |
| | | customerType: "", |
| | | type: 1 |
| | | }, |
| | | form: { |
| | | customerName: "", |
| | |
| | | bankAccount: "", |
| | | bankCode: "", |
| | | customerType: "", |
| | | type: 1 |
| | | }, |
| | | rules: { |
| | | customerName: [{ required: true, message: "请输入", trigger: "blur" }], |
| | |
| | | }, |
| | | ]; |
| | | form.value.maintenanceTime = getCurrentDate(); |
| | | form.value.type = 1; |
| | | userListNoPage().then(res => { |
| | | userList.value = res.data; |
| | | }); |
| | |
| | | const openShareDialog = row => { |
| | | shareForm.id = row.id; |
| | | shareForm.customerName = row.customerName; |
| | | shareForm.boundIds = []; |
| | | shareForm.boundIds = row.userIds || []; |
| | | ensureUserList().then(() => { |
| | | shareDialogVisible.value = true; |
| | | }); |
| | |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | addCustomerPrivatePool({ |
| | | customerId: assignForm.id, |
| | | boundId: assignForm.boundId, |
| | | assignCustomer({ |
| | | id: assignForm.id, |
| | | usageUser: assignForm.boundId, |
| | | }).then(() => { |
| | | proxy.$modal.msgSuccess("分配成功"); |
| | | closeAssignDialog(); |
| | |
| | | return; |
| | | } |
| | | shareCustomer({ |
| | | customerId: shareForm.id, |
| | | boundIds: shareForm.boundIds, |
| | | id: shareForm.id, |
| | | userIds: shareForm.boundIds, |
| | | }).then(() => { |
| | | proxy.$modal.msgSuccess("共享成功"); |
| | | closeShareDialog(); |
| | |
| | | }); |
| | | }); |
| | | }; |
| | | 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") { |