From 8ebc23e4846723aa20a9bf0ffca981fe8d6b256b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 20 四月 2026 10:08:17 +0800
Subject: [PATCH] 阳光彩印 1.客户档案分为公海私海 2.销售台账、销售报价查询客户接口修改
---
src/views/basicData/customerFile/index.vue | 251 +++++++++++++++++++++++++++++++++-----------------
1 files changed, 166 insertions(+), 85 deletions(-)
diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index ad1c5bb..cc6590c 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -112,6 +112,14 @@
</el-row>
<el-row :gutter="30">
<el-col :span="12">
+ <el-form-item label="寮�鎴烽摱琛岋細"
+ prop="bankName">
+ <el-input v-model="form.bankName"
+ placeholder="璇疯緭鍏�"
+ clearable />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
<el-form-item label="寮�鎴疯鍙凤細"
prop="bankCode">
<el-input v-model="form.bankCode"
@@ -119,6 +127,8 @@
clearable />
</el-form-item>
</el-col>
+ </el-row>
+ <el-row :gutter="30">
<el-col :span="12">
<el-form-item label="瀹㈡埛鍒嗙被锛�"
prop="customerType">
@@ -130,6 +140,47 @@
<el-option label="杩涢攢鍟嗗鎴�"
value="杩涢攢鍟嗗鎴�" />
</el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="娉曚汉"
+ prop="corporation">
+ <el-input v-model="form.corporation"
+ placeholder="璇疯緭鍏�"
+ clearable />
+ </el-form-item>
+ </el-col>
+
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="浠g悊浜�"
+ prop="agent">
+ <el-select v-model="form.agent"
+ placeholder="璇烽�夋嫨浠g悊浜�"
+ clearable
+ filterable
+ :disabled="agentOptions.length === 0"
+ :no-data-text="agentNoDataText">
+ <el-option v-for="(contact, index) in agentOptions"
+ :key="getAgentOptionKey(contact, index)"
+ :label="getAgentLabel(contact)"
+ :value="contact.contactPhone"
+ :disabled="!contact.contactPhone">
+ <span>{{ contact.contactPerson || "-" }}</span>
+ <span style="float: right; color: var(--el-text-color-secondary); font-size: 12px;">
+ {{ contact.contactPhone || "" }}
+ </span>
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="浼犵湡"
+ prop="fax">
+ <el-input v-model="form.fax"
+ placeholder="璇疯緭鍏�"
+ clearable />
</el-form-item>
</el-col>
</el-row>
@@ -276,9 +327,8 @@
</el-form>
<template #footer>
<div class="dialog-footer">
+ <el-button type="primary" @click="submitReminderForm">纭</el-button>
<el-button @click="closeReminderDialog">鍙栨秷</el-button>
- <el-button type="primary"
- @click="submitReminderForm">鎻愪氦</el-button>
</div>
</template>
</el-dialog>
@@ -360,9 +410,8 @@
</el-form>
<template #footer>
<div class="dialog-footer">
+ <el-button type="primary" @click="submitNegotiationForm">纭</el-button>
<el-button @click="closeNegotiationDialog">鍙栨秷</el-button>
- <el-button type="primary"
- @click="submitNegotiationForm">鎻愪氦</el-button>
</div>
</template>
</el-dialog>
@@ -418,12 +467,7 @@
</el-col>
</el-row>
<el-row :gutter="20">
- <el-col :span="12">
- <div class="info-item">
- <span class="info-label">閾惰璐﹀彿锛�</span>
- <span class="info-value">{{ detailForm.bankAccount }}</span>
- </div>
- </el-col>
+
<el-col :span="12">
<div class="info-item">
<span class="info-label">寮�鎴疯鍙凤細</span>
@@ -494,7 +538,6 @@
<template #default="{ row }">
<el-button type="info"
link
- size="small"
@click="openAttachmentDialog(row)">
<el-icon>
<Paperclip />
@@ -510,13 +553,11 @@
<template #default="{ row, $index }">
<el-button type="primary"
link
- size="small"
@click="editNegotiationRecord(row, $index)">
淇敼
</el-button>
<el-button type="danger"
link
- size="small"
@click="deleteNegotiationRecord(row, $index)">
鍒犻櫎
</el-button>
@@ -587,13 +628,11 @@
<template #default="{ row, $index }">
<el-button type="primary"
link
- size="small"
@click="downloadAttachment(row)">
涓嬭浇
</el-button>
<el-button type="danger"
link
- size="small"
@click="deleteAttachment(row, $index)">
鍒犻櫎
</el-button>
@@ -619,11 +658,13 @@
import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
import {
- addCustomer,
- delCustomer,
+ addCustomerPrivate,
+ delCustomerPrivate,
getCustomer,
- listCustomer,
- updateCustomer,
+ getCustomerPrivatePoolById,
+ getCustomerPrivatePoolInfo,
+ listCustomerPrivatePool,
+ updateCustomerPrivatePool,
addCustomerFollow,
updateCustomerFollow,
delCustomerFollow,
@@ -661,7 +702,7 @@
const negotiationFormRef = ref();
const negotiationForm = reactive({
customerName: "",
- customerId: "",
+ customerPrivatePoolId: "",
followUpMethod: "",
followUpLevel: "",
followUpTime: "",
@@ -690,6 +731,8 @@
companyPhone: "",
companyAddress: "",
basicBankAccount: "",
+ corporation: "",
+ fax: "",
bankAccount: "",
bankCode: "",
contactPerson: "",
@@ -733,7 +776,7 @@
},
{
label: "鍦板潃鍙婅仈绯绘柟寮�",
- prop: "addressPhone",
+ prop: "companyAddress",
width: 250,
},
{
@@ -771,8 +814,36 @@
width: 220,
},
{
+ label: "娉曚汉浠h〃",
+ prop: "corporation",
+ width: 220,
+ },
+ {
+ label: "浼犵湡",
+ prop: "fax",
+ width: 220,
+ },
+ {
label: "缁存姢浜�",
prop: "maintainer",
+ },
+ {
+ label: "瀹㈡埛鏉ユ簮",
+ prop: "type",
+ dataType: "tag",
+ width: 100,
+ formatData: value => {
+ if (value === 1 || value === "1") {
+ return "鍏捣";
+ }
+ return "绉佹捣";
+ },
+ formatType: value => {
+ if (value === 1 || value === "1") {
+ return "warning";
+ }
+ return "success";
+ },
},
{
label: "缁存姢鏃堕棿",
@@ -784,7 +855,7 @@
label: "鎿嶄綔",
align: "center",
fixed: "right",
- width: 250,
+ width: 290,
operation: [
{
name: "缂栬緫",
@@ -793,13 +864,13 @@
openForm("edit", row);
},
},
- {
- name: "璇︽儏",
- type: "text",
- clickFun: row => {
- openDetailDialog(row);
- },
- },
+ {
+ name: "娣诲姞娲借皥杩涘害",
+ type: "text",
+ clickFun: row => {
+ openNegotiationDialog(row);
+ },
+ },
{
name: "鍥炶鎻愰啋",
type: "text",
@@ -807,13 +878,13 @@
openReminderDialog(row);
},
},
- {
- name: "娣诲姞娲借皥杩涘害",
- type: "text",
- clickFun: row => {
- openNegotiationDialog(row);
- },
- },
+ {
+ name: "璇︽儏",
+ type: "text",
+ clickFun: row => {
+ openDetailDialog(row);
+ },
+ },
],
},
]);
@@ -856,6 +927,8 @@
maintenanceTime: "",
basicBankAccount: "",
bankAccount: "",
+ fax: "",
+ corporation: "",
bankCode: "",
customerType: "",
},
@@ -874,6 +947,9 @@
],
basicBankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
bankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ corporation: [{ required: true, message: "璇疯緭鍏ユ硶浜轰唬琛�", trigger: "blur" }],
+ agent: [{ required: true, message: "璇烽�夋嫨浠g悊浜�", trigger: "change" }],
+ bankName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
bankCode: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
customerType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
},
@@ -888,7 +964,7 @@
// 璁剧疆涓婁紶鐨勮姹傚ご閮�
headers: { Authorization: "Bearer " + getToken() },
// 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
+ url: import.meta.env.VITE_APP_BASE_API + "/customerPrivate/importData",
// 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
beforeUpload: file => {
console.log("鏂囦欢鍗冲皢涓婁紶", file);
@@ -934,6 +1010,39 @@
},
});
const { searchForm, form, rules } = toRefs(data);
+
+ const agentOptions = computed(() => {
+ const list = formYYs.value?.contactList || [];
+ return list.filter(item => item && (item.contactPerson || item.contactPhone));
+ });
+
+ const agentNoDataText = computed(() => {
+ if (agentOptions.value.length === 0) return "璇峰厛鏂板鑱旂郴浜�";
+ return "鏃犲尮閰嶈仈绯讳汉";
+ });
+
+ const getAgentLabel = contact => {
+ const person = (contact?.contactPerson || "").trim();
+ const phone = (contact?.contactPhone || "").trim();
+ if (person && phone) return `${person}锛�${phone}锛塦;
+ return person || phone || "-";
+ };
+
+ const getAgentOptionKey = (contact, index) => {
+ return contact?.contactPhone || contact?.contactPerson || index;
+ };
+
+ watch(
+ () => agentOptions.value.map(item => item.contactPhone),
+ phones => {
+ const val = form.value?.agent;
+ if (!val) return;
+ if (!phones.includes(val)) {
+ form.value.agent = "";
+ }
+ }
+ );
+
const addNewContact = () => {
formYYs.value.contactList.push({
contactPerson: "",
@@ -959,10 +1068,10 @@
};
const getList = () => {
tableLoading.value = true;
- listCustomer({ ...searchForm.value, ...page }).then(res => {
+ listCustomerPrivatePool({ ...searchForm.value, ...page }).then(res => {
tableLoading.value = false;
- tableData.value = res.records;
- page.total = res.total;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
});
};
// 琛ㄦ牸閫夋嫨鏁版嵁
@@ -981,7 +1090,7 @@
}
/** 涓嬭浇妯℃澘 */
function importTemplate() {
- proxy.download("/basic/customer/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
+ proxy.download("/customerPrivate/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
}
// 鎵撳紑寮规
const openForm = (type, row) => {
@@ -999,7 +1108,7 @@
userList.value = res.data;
});
if (type === "edit") {
- getCustomer(row.id).then(res => {
+ getCustomerPrivatePoolById(row.id).then(res => {
form.value = { ...res.data };
formYYs.value.contactList = res.data.contactPerson
.split(",")
@@ -1036,7 +1145,7 @@
form.value.contactPhone = formYYs.value.contactList
.map(item => item.contactPhone)
.join(",");
- addCustomer(form.value).then(res => {
+ addCustomerPrivate(form.value).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
getList();
@@ -1050,7 +1159,7 @@
form.value.contactPhone = formYYs.value.contactList
.map(item => item.contactPhone)
.join(",");
- updateCustomer(form.value).then(res => {
+ updateCustomerPrivatePool(form.value).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
getList();
@@ -1069,7 +1178,7 @@
type: "warning",
})
.then(() => {
- proxy.download("/basic/customer/export", {}, "瀹㈡埛妗f.xlsx");
+ proxy.download("/customerPrivate/export", {}, "瀹㈡埛妗f.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
@@ -1079,12 +1188,11 @@
const handleDelete = () => {
let ids = [];
if (selectedRows.value.length > 0) {
- // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
const unauthorizedData = selectedRows.value.filter(
- item => item.maintainer !== userStore.nickName
+ item => item.type === 1 || item.type === "1"
);
if (unauthorizedData.length > 0) {
- proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
+ proxy.$modal.msgWarning("鍏捣鍒嗛厤鐨勫鎴蜂笉鑳藉垹闄�");
return;
}
ids = selectedRows.value.map(item => item.id);
@@ -1099,8 +1207,8 @@
})
.then(() => {
tableLoading.value = true;
- delCustomer(ids)
- .then(res => {
+ delCustomerPrivate(ids)
+ .then(() => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
getList();
})
@@ -1153,7 +1261,8 @@
if (reminderForm.id) {
submitvalue.value = {
id: reminderForm.id,
- customerId: currentCustomerId.value,
+ customerPrivatePoolId: reminderForm.id,
+ customerPrivatePoolId: currentCustomerId.value,
isEnabled: reminderForm.reminderSwitch ? 1 : 0,
content: reminderForm.reminderContent,
reminderTime: reminderForm.reminderTime,
@@ -1161,15 +1270,13 @@
};
} else {
submitvalue.value = {
- customerId: currentCustomerId.value,
+ customerPrivatePoolId: currentCustomerId.value,
isEnabled: reminderForm.reminderSwitch ? 1 : 0,
content: reminderForm.reminderContent,
reminderTime: reminderForm.reminderTime,
remindUserId: userStore.id,
};
}
-
- console.log("鎻愪氦鍥炶鎻愰啋鏁版嵁:", submitvalue.value);
// 璋冪敤鎺ュ彛
addReturnVisit(submitvalue.value)
@@ -1192,20 +1299,12 @@
// 鎵撳紑娲借皥杩涘害寮圭獥
const openNegotiationDialog = row => {
negotiationForm.customerName = row.customerName;
- negotiationForm.customerId = row.id;
+ negotiationForm.customerPrivatePoolId = row.id;
negotiationForm.followUpMethod = "";
negotiationForm.followUpLevel = "";
negotiationForm.followUpTime = "";
negotiationForm.followerUserName = userStore.nickName; // 榛樿褰撳墠鐧诲綍浜�
negotiationForm.content = "";
- // {
- // "customerId": 152,
- // "followUpMethod": "鐢佃瘽娌熼��",
- // "followUpLevel": "娌℃湁鎰忓悜",
- // "followUpTime": "2026-03-04T15:30:00",
- // "followerUserName": "绠$悊鍛樿处鍙�",
- // "content": "111"
- // }
negotiationDialogVisible.value = true;
};
@@ -1227,26 +1326,9 @@
if (isEdit) {
// 淇敼鎿嶄綔
- console.log("淇敼娲借皥杩涘害鏁版嵁:", negotiationForm);
- // 杩欓噷鍙互璋冪敤鏇存柊鎺ュ彛
- // 瀹為檯椤圭洰涓渶瑕佹牴鎹悗绔帴鍙h繘琛岃皟鏁�
- // 绀轰緥锛歶pdateCustomerFollow(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 => {
+ getCustomer(negotiationForm.customerPrivatePoolId).then(res => {
// 鏇存柊鏈湴鏁版嵁
negotiationRecords.value = res.data.followUpList || [];
});
@@ -1278,8 +1360,7 @@
// 鎵撳紑璇︽儏寮圭獥
const openDetailDialog = row => {
- // 璋冪敤getCustomer鎺ュ彛鑾峰彇瀹㈡埛璇︽儏
- getCustomer(row.id).then(res => {
+ getCustomerPrivatePoolInfo(row.id).then(res => {
// 濉厖瀹㈡埛鍩烘湰淇℃伅
Object.assign(detailForm, res.data);
@@ -1300,7 +1381,7 @@
// 灏嗗綋鍓嶈褰曟暟鎹~鍏呭埌琛ㄥ崟
Object.assign(negotiationForm, {
customerName: row.customerName,
- customerId: row.customerId,
+ customerPrivatePoolId: row.customerPrivatePoolId,
followUpMethod: row.followUpMethod,
followUpLevel: row.followUpLevel,
followUpTime: row.followUpTime,
@@ -1328,7 +1409,7 @@
// });
delCustomerFollow(row.id).then(() => {
// 鍒犻櫎鎴愬姛鍚庢洿鏂版湰鍦版暟鎹�
- getCustomer(row.customerId).then(res => {
+ getCustomer(row.customerPrivatePoolId).then(res => {
// 鏇存柊鏈湴鏁版嵁
negotiationRecords.value = res.data.followUpList || [];
});
--
Gitblit v1.9.3