From c435f1c060982615c4ad0c3049b14ca84babe0df Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 04 三月 2026 18:00:00 +0800
Subject: [PATCH] 客户档案新增回访提醒、跟进、详情功能
---
src/layout/components/NotificationCenter/index.vue | 591 +++++++-------
src/views/basicData/customerFile/index.vue | 1673 +++++++++++++++++++++++++++++-------------
src/api/basicData/customerFile.js | 25
3 files changed, 1,477 insertions(+), 812 deletions(-)
diff --git a/src/api/basicData/customerFile.js b/src/api/basicData/customerFile.js
index c52b76e..8685664 100644
--- a/src/api/basicData/customerFile.js
+++ b/src/api/basicData/customerFile.js
@@ -50,3 +50,28 @@
})
}
+
+// 鏂板瀹㈡埛璺熻繘
+export function addCustomerFollow(data) {
+ return request({
+ url: '/basic/customer-follow/add',
+ method: 'post',
+ data: data
+ })
+}
+
+// 淇敼瀹㈡埛璺熻繘
+export function updateCustomerFollow(data) {
+ return request({
+ url: '/basic/customer-follow/edit',
+ method: 'put',
+ data: data,
+ })
+}
+// 鍒犻櫎瀹㈡埛璺熻繘
+export function delCustomerFollow(id) {
+ return request({
+ url: '/basic/customer-follow/'+id,
+ method: 'delete',
+ })
+}
\ No newline at end of file
diff --git a/src/layout/components/NotificationCenter/index.vue b/src/layout/components/NotificationCenter/index.vue
index 6098153..2517c22 100644
--- a/src/layout/components/NotificationCenter/index.vue
+++ b/src/layout/components/NotificationCenter/index.vue
@@ -2,25 +2,30 @@
<div class="notification-popover-content">
<div class="popover-header">
<span class="popover-title">娑堟伅閫氱煡</span>
- <el-button type="primary" size="small" @click="handleMarkAllAsRead" :disabled="unreadCount === 0">
+ <el-button type="primary"
+ size="small"
+ @click="handleMarkAllAsRead"
+ :disabled="unreadCount === 0">
涓�閿凡璇�
</el-button>
</div>
-
<div class="notification-content">
- <el-tabs v-model="activeTab" @tab-change="handleTabChange">
- <el-tab-pane :label="`鏈(${unreadCount})`" name="unread">
- <div v-if="unreadList.length === 0" class="empty-state">
+ <el-tabs v-model="activeTab"
+ @tab-change="handleTabChange">
+ <el-tab-pane :label="`鏈(${unreadCount})`"
+ name="unread">
+ <div v-if="unreadList.length === 0"
+ class="empty-state">
<el-empty description="鏆傛棤鏈娑堟伅" />
</div>
- <div v-else class="notification-list">
- <div
- v-for="item in unreadList"
- :key="item.id"
- class="notification-item"
- >
+ <div v-else
+ class="notification-list">
+ <div v-for="item in unreadList"
+ :key="item.id"
+ class="notification-item">
<div class="notification-icon">
- <el-icon :size="24" color="#67C23A">
+ <el-icon :size="24"
+ color="#67C23A">
<Bell />
</el-icon>
</div>
@@ -30,25 +35,29 @@
<div class="notification-time">{{ item.createTime }}</div>
</div>
<div class="notification-action">
- <el-button type="primary" size="small" @click="handleConfirm(item)">
+ <el-button type="primary"
+ size="small"
+ @click="handleConfirm(item)">
纭
</el-button>
</div>
</div>
</div>
</el-tab-pane>
- <el-tab-pane label="宸茶" name="read">
- <div v-if="readList.length === 0" class="empty-state">
+ <el-tab-pane label="宸茶"
+ name="read">
+ <div v-if="readList.length === 0"
+ class="empty-state">
<el-empty description="鏆傛棤宸茶娑堟伅" />
</div>
- <div v-else class="notification-list">
- <div
- v-for="item in readList"
- :key="item.id"
- class="notification-item read"
- >
+ <div v-else
+ class="notification-list">
+ <div v-for="item in readList"
+ :key="item.id"
+ class="notification-item read">
<div class="notification-icon">
- <el-icon :size="24" color="#909399">
+ <el-icon :size="24"
+ color="#909399">
<Bell />
</el-icon>
</div>
@@ -61,312 +70,316 @@
</div>
</el-tab-pane>
</el-tabs>
-
<!-- 鍒嗛〉 -->
- <div class="pagination-wrapper" v-if="total > 0">
- <el-pagination
- v-model:current-page="pageNum"
- v-model:page-size="pageSize"
- :page-sizes="[10, 20, 50, 100]"
- :total="total"
- layout="prev, pager, next, sizes"
- @size-change="handleSizeChange"
- @current-change="handlePageChange"
- />
+ <div class="pagination-wrapper"
+ v-if="total > 0">
+ <el-pagination v-model:current-page="pageNum"
+ v-model:page-size="pageSize"
+ :page-sizes="[10, 20, 50, 100]"
+ :total="total"
+ layout="prev, pager, next, sizes"
+ @size-change="handleSizeChange"
+ @current-change="handlePageChange" />
</div>
</div>
</div>
</template>
<script setup>
-import { Bell } from '@element-plus/icons-vue'
-import { listMessage, markAsRead, markAllAsRead, confirmMessage, getUnreadCount } from '@/api/system/message'
-import { ElMessage } from 'element-plus'
-import useUserStore from '@/store/modules/user'
-import { useRouter } from 'vue-router'
+ import { Bell } from "@element-plus/icons-vue";
+ import {
+ listMessage,
+ markAsRead,
+ markAllAsRead,
+ confirmMessage,
+ getUnreadCount,
+ } from "@/api/system/message";
+ import { ElMessage } from "element-plus";
+ import useUserStore from "@/store/modules/user";
+ import { useRouter } from "vue-router";
-const userStore = useUserStore()
-const router = useRouter()
-const emit = defineEmits(['unreadCountChange'])
+ const userStore = useUserStore();
+ const router = useRouter();
+ const emit = defineEmits(["unreadCountChange"]);
-const activeTab = ref('unread')
-const unreadList = ref([])
-const readList = ref([])
-const unreadCount = ref(0)
-const total = ref(0)
-const pageNum = ref(1)
-const pageSize = ref(10)
+ const activeTab = ref("unread");
+ const unreadList = ref([]);
+ const readList = ref([]);
+ const unreadCount = ref(0);
+ const total = ref(0);
+ const pageNum = ref(1);
+ const pageSize = ref(10);
-// 鍔犺浇娑堟伅鍒楄〃
-const loadMessages = async () => {
- try {
- const consigneeId = userStore.id
- if (!consigneeId) {
- console.warn('鏈幏鍙栧埌褰撳墠鐧诲綍鐢ㄦ埛ID')
- return
- }
- const params = {
- consigneeId: consigneeId,
- current: pageNum.value,
- size: pageSize.value,
- status: activeTab.value === 'read' ? 1 : 0
- }
- const res = await listMessage(params)
- if (res.code === 200) {
- if (activeTab.value === 'unread') {
- unreadList.value = res.data.records || []
- } else {
- readList.value = res.data.records || []
+ // 鍔犺浇娑堟伅鍒楄〃
+ const loadMessages = async () => {
+ try {
+ const consigneeId = userStore.id;
+ if (!consigneeId) {
+ console.warn("鏈幏鍙栧埌褰撳墠鐧诲綍鐢ㄦ埛ID");
+ return;
}
- total.value = res.data.total || 0
+ const params = {
+ consigneeId: consigneeId,
+ current: pageNum.value,
+ size: pageSize.value,
+ status: activeTab.value === "read" ? 1 : 0,
+ };
+ const res = await listMessage(params);
+ if (res.code === 200) {
+ if (activeTab.value === "unread") {
+ unreadList.value = res.data.records || [];
+ } else {
+ readList.value = res.data.records || [];
+ }
+ total.value = res.data.total || 0;
+ }
+ } catch (error) {
+ console.error("鍔犺浇娑堟伅鍒楄〃澶辫触:", error);
}
- } catch (error) {
- console.error('鍔犺浇娑堟伅鍒楄〃澶辫触:', error)
- }
-}
+ };
-// 鍔犺浇鏈鏁伴噺
-const loadUnreadCount = async () => {
- try {
- const consigneeId = userStore.id
- if (!consigneeId) {
- console.warn('鏈幏鍙栧埌褰撳墠鐧诲綍鐢ㄦ埛ID')
- return
+ // 鍔犺浇鏈鏁伴噺
+ const loadUnreadCount = async () => {
+ try {
+ const consigneeId = userStore.id;
+ if (!consigneeId) {
+ console.warn("鏈幏鍙栧埌褰撳墠鐧诲綍鐢ㄦ埛ID");
+ return;
+ }
+ const res = await getUnreadCount(consigneeId);
+ if (res.code === 200) {
+ unreadCount.value = res.data || 0;
+ emit("unreadCountChange", unreadCount.value);
+ }
+ } catch (error) {
+ console.error("鍔犺浇鏈鏁伴噺澶辫触:", error);
}
- const res = await getUnreadCount(consigneeId)
- if (res.code === 200) {
- unreadCount.value = res.data || 0
- emit('unreadCountChange', unreadCount.value)
- }
- } catch (error) {
- console.error('鍔犺浇鏈鏁伴噺澶辫触:', error)
- }
-}
+ };
-// 鏍囩椤靛垏鎹�
-const handleTabChange = (tab) => {
- pageNum.value = 1
- loadMessages()
-}
+ // 鏍囩椤靛垏鎹�
+ const handleTabChange = tab => {
+ pageNum.value = 1;
+ loadMessages();
+ };
-// 纭娑堟伅
-const handleConfirm = async (item) => {
- try {
- console.log('item', item)
- const res = await confirmMessage(item.noticeId, 1)
- if (res.code === 200) {
- ElMessage.success('纭鎴愬姛')
- // 閲嶆柊鍔犺浇鏁版嵁
- loadMessages()
- loadUnreadCount()
-
- // 鏍规嵁 jumpPath 杩涜椤甸潰璺宠浆
- if (item.jumpPath) {
- try {
- // 瑙f瀽 jumpPath锛屽垎绂昏矾寰勫拰鏌ヨ鍙傛暟
- const [path, queryString] = item.jumpPath.split('?')
- let query = {}
-
- if (queryString) {
- // 瑙f瀽鏌ヨ鍙傛暟
- queryString.split('&').forEach(param => {
- const [key, value] = param.split('=')
- if (key && value) {
- query[key] = decodeURIComponent(value)
- }
- })
+ // 纭娑堟伅
+ const handleConfirm = async item => {
+ try {
+ console.log("item", item);
+ const res = await confirmMessage(item.noticeId, 1);
+ if (res.code === 200) {
+ ElMessage.success("纭鎴愬姛");
+ // 閲嶆柊鍔犺浇鏁版嵁
+ loadMessages();
+ loadUnreadCount();
+
+ // 鏍规嵁 jumpPath 杩涜椤甸潰璺宠浆
+ if (item.jumpPath) {
+ try {
+ // 瑙f瀽 jumpPath锛屽垎绂昏矾寰勫拰鏌ヨ鍙傛暟
+ const [path, queryString] = item.jumpPath.split("?");
+ let query = {};
+
+ if (queryString) {
+ // 瑙f瀽鏌ヨ鍙傛暟
+ queryString.split("&").forEach(param => {
+ const [key, value] = param.split("=");
+ if (key && value) {
+ query[key] = decodeURIComponent(value);
+ }
+ });
+ }
+
+ // 璺宠浆鍒版寚瀹氶〉闈�
+ router.push({
+ path: path,
+ query: query,
+ });
+ } catch (error) {
+ console.error("椤甸潰璺宠浆澶辫触:", error);
}
-
- // 璺宠浆鍒版寚瀹氶〉闈�
- router.push({
- path: path,
- query: query
- })
- } catch (error) {
- console.error('椤甸潰璺宠浆澶辫触:', error)
}
}
+ } catch (error) {
+ console.error("纭娑堟伅澶辫触:", error);
+ ElMessage.error("纭澶辫触");
}
- } catch (error) {
- console.error('纭娑堟伅澶辫触:', error)
- ElMessage.error('纭澶辫触')
- }
-}
+ };
-// 涓�閿凡璇�
-const handleMarkAllAsRead = async () => {
- try {
- const res = await markAllAsRead()
- if (res.code === 200) {
- ElMessage.success('宸插叏閮ㄦ爣璁颁负宸茶')
- loadMessages()
- loadUnreadCount()
+ // 涓�閿凡璇�
+ const handleMarkAllAsRead = async () => {
+ try {
+ const res = await markAllAsRead();
+ if (res.code === 200) {
+ ElMessage.success("宸插叏閮ㄦ爣璁颁负宸茶");
+ loadMessages();
+ loadUnreadCount();
+ }
+ } catch (error) {
+ console.error("涓�閿凡璇诲け璐�:", error);
+ ElMessage.error("鎿嶄綔澶辫触");
}
- } catch (error) {
- console.error('涓�閿凡璇诲け璐�:', error)
- ElMessage.error('鎿嶄綔澶辫触')
- }
-}
+ };
-// 鍒嗛〉澶у皬鏀瑰彉
-const handleSizeChange = (size) => {
- pageSize.value = size
- pageNum.value = 1
- loadMessages()
-}
+ // 鍒嗛〉澶у皬鏀瑰彉
+ const handleSizeChange = size => {
+ pageSize.value = size;
+ pageNum.value = 1;
+ loadMessages();
+ };
-// 椤电爜鏀瑰彉
-const handlePageChange = (page) => {
- pageNum.value = page
- loadMessages()
-}
+ // 椤电爜鏀瑰彉
+ const handlePageChange = page => {
+ pageNum.value = page;
+ loadMessages();
+ };
-// 缁勪欢鎸傝浇鏃跺姞杞芥湭璇绘暟閲�
-onMounted(() => {
- loadUnreadCount()
-})
+ // 缁勪欢鎸傝浇鏃跺姞杞芥湭璇绘暟閲�
+ onMounted(() => {
+ loadUnreadCount();
+ });
-// 鐩戝惉鐖剁粍浠朵紶閫掔殑 visible 鐘舵�侊紙閫氳繃 watch 鍦� Navbar 涓鐞嗭級
-// 杩欓噷鍙礋璐f暟鎹姞杞斤紝涓嶆帶鍒舵樉绀�
+ // 鐩戝惉鐖剁粍浠朵紶閫掔殑 visible 鐘舵�侊紙閫氳繃 watch 鍦� Navbar 涓鐞嗭級
+ // 杩欓噷鍙礋璐f暟鎹姞杞斤紝涓嶆帶鍒舵樉绀�
-// 鏆撮湶鏂规硶渚涘閮ㄨ皟鐢�
-defineExpose({
- loadUnreadCount,
- loadMessages
-})
+ // 鏆撮湶鏂规硶渚涘閮ㄨ皟鐢�
+ defineExpose({
+ loadUnreadCount,
+ loadMessages,
+ });
</script>
<style lang="scss" scoped>
-.notification-popover-content {
- display: flex;
- flex-direction: column;
- width: 500px;
- padding: 16px;
-}
-
-.popover-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- margin-bottom: 16px;
- padding-bottom: 12px;
- border-bottom: 1px solid #f0f0f0;
-
- .popover-title {
- font-size: 18px;
- font-weight: 500;
- color: #303133;
- }
-}
-
-.notification-content {
- max-height: 60vh;
- display: flex;
- flex-direction: column;
-
- :deep(.el-tabs) {
- flex: 1;
+ .notification-popover-content {
display: flex;
flex-direction: column;
- min-height: 0;
-
- .el-tabs__header {
- margin-bottom: 0;
- flex-shrink: 0;
- padding: 0;
- }
-
- .el-tabs__content {
- flex: 1;
- overflow-y: auto;
- min-height: 0;
- padding-top: 16px;
- }
-
- .el-tab-pane {
- height: 100%;
- }
+ width: 500px;
+ padding: 16px;
}
-}
-.empty-state {
- display: flex;
- justify-content: center;
- align-items: center;
- min-height: 300px;
- padding: 40px 0;
-}
-
-.notification-list {
- .notification-item {
+ .popover-header {
display: flex;
- padding: 12px 0;
+ justify-content: space-between;
+ align-items: center;
+ width: 100%;
+ margin-bottom: 16px;
+ padding-bottom: 12px;
border-bottom: 1px solid #f0f0f0;
- transition: background-color 0.3s;
- &:hover {
- background-color: #f5f7fa;
- }
-
- &.read {
- opacity: 0.7;
- }
-
- .notification-icon {
- flex-shrink: 0;
- width: 40px;
- height: 40px;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #f0f9ff;
- border-radius: 50%;
- margin-right: 12px;
- }
-
- .notification-content-wrapper {
- flex: 1;
- min-width: 0;
-
- .notification-title {
- font-size: 14px;
- font-weight: 500;
- color: #303133;
- margin-bottom: 8px;
- }
-
- .notification-detail {
- font-size: 13px;
- color: #606266;
- line-height: 1.5;
- margin-bottom: 8px;
- word-break: break-all;
- }
-
- .notification-time {
- font-size: 12px;
- color: #909399;
- }
- }
-
- .notification-action {
- flex-shrink: 0;
- margin-left: 12px;
- display: flex;
- align-items: center;
+ .popover-title {
+ font-size: 18px;
+ font-weight: 500;
+ color: #303133;
}
}
-}
-.pagination-wrapper {
- margin-top: 16px;
- padding-top: 16px;
- border-top: 1px solid #f0f0f0;
- display: flex;
- justify-content: center;
- padding-left: 0;
- padding-right: 0;
-}
+ .notification-content {
+ max-height: 60vh;
+ display: flex;
+ flex-direction: column;
+
+ :deep(.el-tabs) {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+
+ .el-tabs__header {
+ margin-bottom: 0;
+ flex-shrink: 0;
+ padding: 0;
+ }
+
+ .el-tabs__content {
+ flex: 1;
+ overflow-y: auto;
+ min-height: 0;
+ padding-top: 16px;
+ }
+
+ .el-tab-pane {
+ height: 100%;
+ }
+ }
+ }
+
+ .empty-state {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ min-height: 300px;
+ padding: 40px 0;
+ }
+
+ .notification-list {
+ .notification-item {
+ display: flex;
+ padding: 12px 0;
+ border-bottom: 1px solid #f0f0f0;
+ transition: background-color 0.3s;
+
+ &:hover {
+ background-color: #f5f7fa;
+ }
+
+ &.read {
+ opacity: 0.7;
+ }
+
+ .notification-icon {
+ flex-shrink: 0;
+ width: 40px;
+ height: 40px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: #f0f9ff;
+ border-radius: 50%;
+ margin-right: 12px;
+ }
+
+ .notification-content-wrapper {
+ flex: 1;
+ min-width: 0;
+
+ .notification-title {
+ font-size: 14px;
+ font-weight: 500;
+ color: #303133;
+ margin-bottom: 8px;
+ }
+
+ .notification-detail {
+ font-size: 13px;
+ color: #606266;
+ line-height: 1.5;
+ margin-bottom: 8px;
+ word-break: break-all;
+ }
+
+ .notification-time {
+ font-size: 12px;
+ color: #909399;
+ }
+ }
+
+ .notification-action {
+ flex-shrink: 0;
+ margin-left: 12px;
+ display: flex;
+ align-items: center;
+ }
+ }
+ }
+
+ .pagination-wrapper {
+ margin-top: 16px;
+ padding-top: 16px;
+ border-top: 1px solid #f0f0f0;
+ display: flex;
+ justify-content: center;
+ padding-left: 0;
+ padding-right: 0;
+ }
</style>
diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 0f39e25..1437beb 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -3,244 +3,519 @@
<div class="search_form">
<div>
<span class="search_title">瀹㈡埛鍚嶇О锛�</span>
- <el-input
- v-model="searchForm.customerName"
- style="width: 240px;margin-right: 10px"
- placeholder="璇疯緭鍏�"
- @change="handleQuery"
- clearable
- :prefix-icon="Search"
- />
- <span class="search_title">瀹㈡埛鍒嗙被锛�</span>
- <el-select
- v-model="searchForm.customerType"
- placeholder="璇烽�夋嫨"
- style="width: 240px"
- clearable
- @change="handleQuery"
- >
- <el-option label="闆跺敭瀹㈡埛" value="闆跺敭瀹㈡埛" />
- <el-option label="杩涢攢鍟嗗鎴�" value="杩涢攢鍟嗗鎴�" />
+ <el-input v-model="searchForm.customerName"
+ style="width: 240px;margin-right: 10px"
+ placeholder="璇疯緭鍏�"
+ @change="handleQuery"
+ clearable
+ :prefix-icon="Search" />
+ <span class="search_title">瀹㈡埛鍒嗙被锛�</span>
+ <el-select v-model="searchForm.customerType"
+ placeholder="璇烽�夋嫨"
+ style="width: 240px"
+ clearable
+ @change="handleQuery">
+ <el-option label="闆跺敭瀹㈡埛"
+ value="闆跺敭瀹㈡埛" />
+ <el-option label="杩涢攢鍟嗗鎴�"
+ value="杩涢攢鍟嗗鎴�" />
</el-select>
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
- >鎼滅储</el-button
- >
+ <el-button type="primary"
+ @click="handleQuery"
+ style="margin-left: 10px">鎼滅储</el-button>
</div>
<div>
- <el-button type="primary" @click="openForm('add')">鏂板瀹㈡埛</el-button>
+ <el-button type="primary"
+ @click="openForm('add')">鏂板瀹㈡埛</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
- <el-button type="info" plain icon="Upload" @click="handleImport"
- >瀵煎叆</el-button
- >
- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+ <el-button type="info"
+ plain
+ icon="Upload"
+ @click="handleImport">瀵煎叆</el-button>
+ <el-button type="danger"
+ plain
+ @click="handleDelete">鍒犻櫎</el-button>
</div>
</div>
<div class="table_list">
- <PIMTable
- rowKey="id"
- :column="tableColumn"
- :tableData="tableData"
- :page="page"
- :isSelection="true"
- @selection-change="handleSelectionChange"
- :tableLoading="tableLoading"
- @pagination="pagination"
- ></PIMTable>
+ <PIMTable rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"></PIMTable>
</div>
- <el-dialog
- v-model="dialogFormVisible"
- :title="operationType === 'add' ? '鏂板瀹㈡埛淇℃伅' : '缂栬緫瀹㈡埛淇℃伅'"
- width="70%"
- @close="closeDia"
- >
- <el-form
- :model="form"
- label-width="140px"
- label-position="top"
- :rules="rules"
- ref="formRef"
- >
+ <el-dialog v-model="dialogFormVisible"
+ :title="operationType === 'add' ? '鏂板瀹㈡埛淇℃伅' : '缂栬緫瀹㈡埛淇℃伅'"
+ width="70%"
+ @close="closeDia">
+ <el-form :model="form"
+ label-width="140px"
+ label-position="top"
+ :rules="rules"
+ ref="formRef">
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="瀹㈡埛鍚嶇О锛�" prop="customerName">
- <el-input
- v-model="form.customerName"
- placeholder="璇疯緭鍏�"
- clearable
- />
+ <el-form-item label="瀹㈡埛鍚嶇О锛�"
+ prop="customerName">
+ <el-input v-model="form.customerName"
+ placeholder="璇疯緭鍏�"
+ clearable />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item
- label="绾崇◣浜鸿瘑鍒彿锛�"
- prop="taxpayerIdentificationNumber"
- >
- <el-input
- v-model="form.taxpayerIdentificationNumber"
- placeholder="璇疯緭鍏�"
- clearable
- />
+ <el-form-item label="绾崇◣浜鸿瘑鍒彿锛�"
+ prop="taxpayerIdentificationNumber">
+ <el-input v-model="form.taxpayerIdentificationNumber"
+ placeholder="璇疯緭鍏�"
+ clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="鍏徃鍦板潃锛�" prop="companyAddress">
- <el-input
- v-model="form.companyAddress"
- placeholder="璇疯緭鍏�"
- clearable
- />
+ <el-form-item label="鍏徃鍦板潃锛�"
+ prop="companyAddress">
+ <el-input v-model="form.companyAddress"
+ placeholder="璇疯緭鍏�"
+ clearable />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鍏徃鐢佃瘽锛�" prop="companyPhone">
- <el-input
- v-model="form.companyPhone"
- placeholder="璇疯緭鍏�"
- clearable
- />
+ <el-form-item label="鍏徃鐢佃瘽锛�"
+ prop="companyPhone">
+ <el-input v-model="form.companyPhone"
+ placeholder="璇疯緭鍏�"
+ clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="閾惰鍩烘湰鎴凤細" prop="basicBankAccount">
- <el-input
- v-model="form.basicBankAccount"
- placeholder="璇疯緭鍏�"
- clearable
- />
+ <el-form-item label="閾惰鍩烘湰鎴凤細"
+ prop="basicBankAccount">
+ <el-input v-model="form.basicBankAccount"
+ placeholder="璇疯緭鍏�"
+ clearable />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="閾惰璐﹀彿锛�" prop="bankAccount">
- <el-input
- v-model="form.bankAccount"
- placeholder="璇疯緭鍏�"
- clearable
- />
+ <el-form-item label="閾惰璐﹀彿锛�"
+ prop="bankAccount">
+ <el-input v-model="form.bankAccount"
+ placeholder="璇疯緭鍏�"
+ clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="寮�鎴疯鍙凤細" prop="bankCode">
- <el-input
- v-model="form.bankCode"
- placeholder="璇疯緭鍏�"
- clearable
- />
+ <el-form-item label="寮�鎴疯鍙凤細"
+ prop="bankCode">
+ <el-input v-model="form.bankCode"
+ placeholder="璇疯緭鍏�"
+ clearable />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="瀹㈡埛鍒嗙被锛�" prop="customerType">
- <el-select v-model="form.customerType" placeholder="璇烽�夋嫨" clearable>
- <el-option label="闆跺敭瀹㈡埛" value="闆跺敭瀹㈡埛" />
- <el-option label="杩涢攢鍟嗗鎴�" value="杩涢攢鍟嗗鎴�" />
+ <el-form-item label="瀹㈡埛鍒嗙被锛�"
+ prop="customerType">
+ <el-select v-model="form.customerType"
+ placeholder="璇烽�夋嫨"
+ clearable>
+ <el-option label="闆跺敭瀹㈡埛"
+ value="闆跺敭瀹㈡埛" />
+ <el-option label="杩涢攢鍟嗗鎴�"
+ value="杩涢攢鍟嗗鎴�" />
</el-select>
</el-form-item>
</el-col>
</el-row>
- <el-row :gutter="30" v-for="(contact, index) in formYYs.contactList" :key="index">
- <el-col :span="12">
- <el-form-item label="鑱旂郴浜猴細" prop="contactPerson">
- <el-input v-model="contact.contactPerson" placeholder="璇疯緭鍏�" clearable />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鑱旂郴鐢佃瘽锛�" prop="contactPhone">
- <div style="display: flex; align-items: center;width: 100%;">
- <el-input v-model="contact.contactPhone" placeholder="璇疯緭鍏�" clearable />
- <el-button @click="removeContact(index)" type="danger" circle style="margin-left: 5px;">
- <el-icon><Close /></el-icon>
- </el-button>
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-button @click="addNewContact" style="margin-bottom: 10px;">+ 鏂板鑱旂郴浜�</el-button>
+ <el-row :gutter="30"
+ v-for="(contact, index) in formYYs.contactList"
+ :key="index">
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴浜猴細"
+ prop="contactPerson">
+ <el-input v-model="contact.contactPerson"
+ placeholder="璇疯緭鍏�"
+ clearable />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴鐢佃瘽锛�"
+ prop="contactPhone">
+ <div style="display: flex; align-items: center;width: 100%;">
+ <el-input v-model="contact.contactPhone"
+ placeholder="璇疯緭鍏�"
+ clearable />
+ <el-button @click="removeContact(index)"
+ type="danger"
+ circle
+ style="margin-left: 5px;">
+ <el-icon>
+ <Close />
+ </el-icon>
+ </el-button>
+ </div>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-button @click="addNewContact"
+ style="margin-bottom: 10px;">+ 鏂板鑱旂郴浜�</el-button>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="缁存姢浜猴細" prop="maintainer">
- <el-select
- v-model="form.maintainer"
- placeholder="璇烽�夋嫨"
- clearable
- disabled
- >
- <el-option
- v-for="item in userList"
- :key="item.nickName"
- :label="item.nickName"
- :value="item.nickName"
- />
+ <el-form-item label="缁存姢浜猴細"
+ prop="maintainer">
+ <el-select v-model="form.maintainer"
+ placeholder="璇烽�夋嫨"
+ clearable
+ disabled>
+ <el-option v-for="item in userList"
+ :key="item.nickName"
+ :label="item.nickName"
+ :value="item.nickName" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="缁存姢鏃堕棿锛�" prop="maintenanceTime">
- <el-date-picker
- style="width: 100%"
- v-model="form.maintenanceTime"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- type="date"
- placeholder="璇烽�夋嫨"
- clearable
- />
+ <el-form-item label="缁存姢鏃堕棿锛�"
+ prop="maintenanceTime">
+ <el-date-picker style="width: 100%"
+ v-model="form.maintenanceTime"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ clearable />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
+ <el-button type="primary"
+ @click="submitForm">纭</el-button>
<el-button @click="closeDia">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
<!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� -->
- <el-dialog
- :title="upload.title"
- v-model="upload.open"
- width="400px"
- append-to-body
- >
- <el-upload
- ref="uploadRef"
- :limit="1"
- accept=".xlsx, .xls"
- :headers="upload.headers"
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
- :disabled="upload.isUploading"
- :before-upload="upload.beforeUpload"
- :on-progress="upload.onProgress"
- :on-success="upload.onSuccess"
- :on-error="upload.onError"
- :on-change="upload.onChange"
- :auto-upload="false"
- drag
- >
+ <el-dialog :title="upload.title"
+ v-model="upload.open"
+ width="400px"
+ append-to-body>
+ <el-upload ref="uploadRef"
+ :limit="1"
+ accept=".xlsx, .xls"
+ :headers="upload.headers"
+ :action="upload.url + '?updateSupport=' + upload.updateSupport"
+ :disabled="upload.isUploading"
+ :before-upload="upload.beforeUpload"
+ :on-progress="upload.onProgress"
+ :on-success="upload.onSuccess"
+ :on-error="upload.onError"
+ :on-change="upload.onChange"
+ :auto-upload="false"
+ drag>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
<template #tip>
<div class="el-upload__tip text-center">
<span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span>
- <el-link
- type="primary"
- :underline="false"
- style="font-size: 12px; vertical-align: baseline"
- @click="importTemplate"
- >涓嬭浇妯℃澘</el-link
- >
+ <el-link type="primary"
+ :underline="false"
+ style="font-size: 12px; vertical-align: baseline"
+ @click="importTemplate">涓嬭浇妯℃澘</el-link>
</div>
</template>
</el-upload>
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button>
+ <el-button type="primary"
+ @click="submitFileForm">纭� 瀹�</el-button>
<el-button @click="upload.open = false">鍙� 娑�</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ <!-- 鍥炶鎻愰啋瀵硅瘽妗� -->
+ <el-dialog title="鍥炶鎻愰啋"
+ v-model="reminderDialogVisible"
+ width="500px"
+ @close="closeReminderDialog">
+ <el-form :model="reminderForm"
+ label-width="100px"
+ :rules="reminderRules"
+ ref="reminderFormRef">
+ <el-form-item label="瀹㈡埛鍚嶇О锛�">
+ <el-input v-model="reminderForm.customerName"
+ disabled />
+ </el-form-item>
+ <el-form-item label="鎻愰啋寮�鍏筹細">
+ <el-switch v-model="reminderForm.reminderSwitch" />
+ </el-form-item>
+ <el-form-item label="鎻愰啋鍐呭锛�"
+ prop="reminderContent">
+ <el-input v-model="reminderForm.reminderContent"
+ type="textarea"
+ :maxlength="100"
+ show-word-limit
+ placeholder="璇疯緭鍏ユ彁閱掑唴瀹�" />
+ </el-form-item>
+ <el-form-item label="鎻愰啋鏃堕棿锛�"
+ prop="reminderTime">
+ <el-date-picker v-model="reminderForm.reminderTime"
+ type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ placeholder="璇烽�夋嫨鎻愰啋鏃堕棿"
+ style="width: 100%" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button @click="closeReminderDialog">鍙栨秷</el-button>
+ <el-button type="primary"
+ @click="submitReminderForm">鎻愪氦</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ <!-- 娣诲姞/淇敼娲借皥杩涘害瀵硅瘽妗� -->
+ <el-dialog :title="negotiationForm.editIndex !== undefined ? '淇敼杩涘害' : '娣诲姞杩涘害'"
+ v-model="negotiationDialogVisible"
+ width="600px"
+ @close="closeNegotiationDialog">
+ <el-form :model="negotiationForm"
+ label-width="100px"
+ :rules="negotiationRules"
+ ref="negotiationFormRef">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="璺熻繘鏂瑰紡锛�"
+ prop="followUpMethod">
+ <el-select v-model="negotiationForm.followUpMethod"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%">
+ <el-option label="鐢佃瘽"
+ value="鐢佃瘽" />
+ <el-option label="閭欢"
+ value="閭欢" />
+ <el-option label="涓婇棬"
+ value="涓婇棬" />
+ <el-option label="寰俊"
+ value="寰俊" />
+ <el-option label="鍏朵粬"
+ value="鍏朵粬" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璺熻繘绋嬪害锛�"
+ prop="followUpLevel">
+ <el-select v-model="negotiationForm.followUpLevel"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%">
+ <el-option label="娼滃湪瀹㈡埛"
+ value="娼滃湪瀹㈡埛" />
+ <el-option label="鍒濇鎷滆"
+ value="鍒濇鎷滆" />
+ <el-option label="澶氭鎷滆"
+ value="澶氭鎷滆" />
+ <el-option label="鎰忓悜瀹㈡埛"
+ value="鎰忓悜瀹㈡埛" />
+ <el-option label="宸茬绾﹀鎴�"
+ value="宸茬绾﹀鎴�" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="璺熻繘鏃堕棿锛�"
+ prop="followUpTime">
+ <el-date-picker v-model="negotiationForm.followUpTime"
+ type="datetime"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ format="YYYY-MM-DD HH:mm:ss"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璺熻繘浜猴細">
+ <el-input v-model="negotiationForm.followerUserName"
+ disabled />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-form-item label="鍐呭锛�"
+ prop="content">
+ <el-input v-model="negotiationForm.content"
+ type="textarea"
+ :rows="4"
+ placeholder="璇疯緭鍏�" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button @click="closeNegotiationDialog">鍙栨秷</el-button>
+ <el-button type="primary"
+ @click="submitNegotiationForm">鎻愪氦</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ <!-- 瀹㈡埛璇︽儏瀵硅瘽妗� -->
+ <el-dialog title="瀹㈡埛璇︽儏"
+ v-model="detailDialogVisible"
+ width="800px"
+ @close="closeDetailDialog">
+ <!-- 瀹㈡埛鍩烘湰淇℃伅 -->
+ <div class="detail-section">
+ <h3 class="section-title">瀹㈡埛鍩烘湰淇℃伅</h3>
+ <div class="info-display">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <div class="info-item">
+ <span class="info-label">瀹㈡埛鍚嶇О锛�</span>
+ <span class="info-value">{{ detailForm.customerName }}</span>
+ </div>
+ </el-col>
+ <el-col :span="12">
+ <div class="info-item">
+ <span class="info-label">瀹㈡埛鍒嗙被锛�</span>
+ <span class="info-value">{{ detailForm.customerType }}</span>
+ </div>
+ </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.taxpayerIdentificationNumber }}</span>
+ </div>
+ </el-col>
+ <el-col :span="12">
+ <div class="info-item">
+ <span class="info-label">鍏徃鐢佃瘽锛�</span>
+ <span class="info-value">{{ detailForm.companyPhone }}</span>
+ </div>
+ </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.companyAddress }}</span>
+ </div>
+ </el-col>
+ <el-col :span="12">
+ <div class="info-item">
+ <span class="info-label">閾惰鍩烘湰鎴凤細</span>
+ <span class="info-value">{{ detailForm.basicBankAccount }}</span>
+ </div>
+ </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>
+ <span class="info-value">{{ detailForm.bankCode }}</span>
+ </div>
+ </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.contactPerson }}</span>
+ </div>
+ </el-col>
+ <el-col :span="12">
+ <div class="info-item">
+ <span class="info-label">鑱旂郴鐢佃瘽锛�</span>
+ <span class="info-value">{{ detailForm.contactPhone }}</span>
+ </div>
+ </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.maintainer }}</span>
+ </div>
+ </el-col>
+ <el-col :span="12">
+ <div class="info-item">
+ <span class="info-label">缁存姢鏃堕棿锛�</span>
+ <span class="info-value">{{ detailForm.maintenanceTime }}</span>
+ </div>
+ </el-col>
+ </el-row>
+ </div>
+ </div>
+ <!-- 娲借皥杩涘害璁板綍 -->
+ <div class="detail-section">
+ <div class="section-header">
+ <h3 class="section-title">娲借皥杩涘害璁板綍</h3>
+ <el-button type="primary"
+ size="small"
+ @click="openNegotiationDialog(detailForm)">
+ 娣诲姞杩涘害
+ </el-button>
+ </div>
+ <el-table :data="negotiationRecords"
+ border
+ style="width: 100%">
+ <el-table-column prop="followUpTime"
+ label="璺熻繘鏃堕棿"
+ width="160" />
+ <el-table-column prop="followUpMethod"
+ label="璺熻繘鏂瑰紡"
+ width="100" />
+ <el-table-column prop="followUpLevel"
+ label="璺熻繘绋嬪害"
+ width="120" />
+ <el-table-column prop="followerUserName"
+ label="璺熻繘浜�"
+ width="100" />
+ <el-table-column prop="content"
+ label="鍐呭"
+ show-overflow-tooltip />
+ <el-table-column label="鎿嶄綔"
+ width="150"
+ align="center">
+ <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>
+ </template>
+ </el-table-column>
+ </el-table>
+ <div v-if="negotiationRecords.length === 0"
+ class="no-records">
+ 鏆傛棤娲借皥杩涘害璁板綍
+ </div>
+ </div>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button @click="closeDetailDialog">鍏抽棴</el-button>
</div>
</template>
</el-dialog>
@@ -248,384 +523,736 @@
</template>
<script setup>
-import {onMounted, ref} from "vue";
-import { Search } from "@element-plus/icons-vue";
-import {
- addCustomer,
- delCustomer,
- getCustomer,
- listCustomer,
- updateCustomer,
-} from "@/api/basicData/customerFile.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();
+ import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
+ import { Search } from "@element-plus/icons-vue";
+ import {
+ addCustomer,
+ delCustomer,
+ getCustomer,
+ listCustomer,
+ updateCustomer,
+ addCustomerFollow,
+ updateCustomerFollow,
+ delCustomerFollow,
+ } from "@/api/basicData/customerFile.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 tableColumn = ref([
- {
- label: "瀹㈡埛鍒嗙被",
- prop: "customerType",
- width: 120,
- },
- {
- label: "瀹㈡埛鍚嶇О",
- prop: "customerName",
- width: 220,
- },
- {
- label: "绾崇◣浜鸿瘑鍒爜",
- prop: "taxpayerIdentificationNumber",
- width: 220,
- },
- {
- label: "鍦板潃鍙婅仈绯绘柟寮�",
- prop: "addressPhone",
- width: 250,
- },
- {
- label: "鑱旂郴浜�",
- prop: "contactPerson",
- },
- {
- label: "鑱旂郴鐢佃瘽",
- prop: "contactPhone",
- width:150
- },
- {
- label: "閾惰鍩烘湰鎴�",
- prop: "basicBankAccount",
- width: 220,
- },
- {
- label: "閾惰璐﹀彿",
- prop: "bankAccount",
- width: 220,
- },
- {
- label: "寮�鎴疯鍙�",
- prop: "bankCode",
- width:220
- },
- {
- label: "缁存姢浜�",
- prop: "maintainer",
- },
- {
- label: "缁存姢鏃堕棿",
- prop: "maintenanceTime",
- width: 100,
- },
- {
- dataType: "action",
- label: "鎿嶄綔",
- align: "center",
- fixed: 'right',
- operation: [
- {
- name: "缂栬緫",
- type: "text",
- clickFun: (row) => {
- openForm("edit", row);
- },
- },
+ // 鍥炶鎻愰啋鐩稿叧
+ const reminderDialogVisible = ref(false);
+ const reminderFormRef = ref();
+ const reminderForm = reactive({
+ customerName: "",
+ reminderSwitch: false,
+ reminderContent: "",
+ reminderTime: "",
+ });
+ const reminderRules = {
+ reminderContent: [
+ { required: true, message: "璇疯緭鍏ユ彁閱掑唴瀹�", trigger: "blur" },
],
- },
-]);
-const tableData = ref([]);
-const selectedRows = ref([]);
-const userList = ref([]);
-const tableLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 100,
- total: 0,
-});
-const total = ref(0);
+ reminderTime: [
+ { required: true, message: "璇烽�夋嫨鎻愰啋鏃堕棿", trigger: "change" },
+ ],
+ };
-// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
-const operationType = ref("");
-const dialogFormVisible = ref(false);
-const formYYs = ref({ // 鍏朵粬瀛楁...
- contactList: [
- {
- contactPerson: "",
- contactPhone: ""
- }
- ]
-});
-const data = reactive({
- searchForm: {
+ // 娲借皥杩涘害鐩稿叧
+ const negotiationDialogVisible = ref(false);
+ const negotiationFormRef = ref();
+ const negotiationForm = reactive({
+ customerName: "",
+ customerId: "",
+ followUpMethod: "",
+ followUpLevel: "",
+ followUpTime: "",
+ followerUserName: "",
+ content: "",
+ });
+ const negotiationRules = {
+ followUpMethod: [
+ { required: true, message: "璇烽�夋嫨璺熻繘鏂瑰紡", trigger: "change" },
+ ],
+ followUpLevel: [
+ { required: true, message: "璇烽�夋嫨璺熻繘绋嬪害", trigger: "change" },
+ ],
+ followUpTime: [
+ { required: true, message: "璇烽�夋嫨璺熻繘鏃堕棿", trigger: "change" },
+ ],
+ content: [{ required: true, message: "璇疯緭鍏ュ唴瀹�", trigger: "blur" }],
+ };
+
+ // 璇︽儏鐩稿叧
+ const detailDialogVisible = ref(false);
+ const detailForm = reactive({
customerName: "",
customerType: "",
- },
- form: {
- customerName: "",
taxpayerIdentificationNumber: "",
- companyAddress: "",
companyPhone: "",
+ companyAddress: "",
+ basicBankAccount: "",
+ bankAccount: "",
+ bankCode: "",
contactPerson: "",
contactPhone: "",
maintainer: "",
maintenanceTime: "",
- basicBankAccount: "",
- bankAccount: "",
- bankCode: "",
- customerType: "",
- },
- rules: {
- customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- taxpayerIdentificationNumber: [
- { required: true, message: "璇疯緭鍏�", trigger: "blur" },
- ],
- companyAddress: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- companyPhone: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- // contactPerson: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- // contactPhone: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- maintainer: [{ required: false, message: "璇烽�夋嫨", trigger: "change" }],
- maintenanceTime: [
- { required: false, message: "璇烽�夋嫨", trigger: "change" },
- ],
- basicBankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- bankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- bankCode: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- customerType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- },
-});
-const upload = reactive({
- // 鏄惁鏄剧ず寮瑰嚭灞傦紙瀹㈡埛瀵煎叆锛�
- open: false,
- // 寮瑰嚭灞傛爣棰橈紙瀹㈡埛瀵煎叆锛�
- title: "",
- // 鏄惁绂佺敤涓婁紶
- isUploading: false,
- // 璁剧疆涓婁紶鐨勮姹傚ご閮�
- headers: { Authorization: "Bearer " + getToken() },
- // 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
- // 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
- beforeUpload: (file) => {
- console.log('鏂囦欢鍗冲皢涓婁紶', file);
- // 鍙互鍦ㄦ澶勫仛鏂囦欢绫诲瀷鎴栧ぇ灏忔牎楠�
- const isValid = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.name.endsWith('.xlsx') || file.name.endsWith('.xls');
- if (!isValid) {
- proxy.$modal.msgError("鍙兘涓婁紶 Excel 鏂囦欢");
- }
- return isValid;
- },
- // 鏂囦欢鐘舵�佹敼鍙樻椂鐨勫洖璋�
- onChange: (file, fileList) => {
- console.log('鏂囦欢鐘舵�佹敼鍙�', file, fileList);
- },
- // 鏂囦欢涓婁紶鎴愬姛鏃剁殑鍥炶皟
- onSuccess: (response, file, fileList) => {
- console.log('涓婁紶鎴愬姛', response, file, fileList);
- upload.isUploading = false;
- if(response.code === 200){
- proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
- upload.open = false;
- proxy.$refs["uploadRef"].clearFiles();
- getList();
- }else if(response.code === 500){
- proxy.$modal.msgError(response.msg);
- }else{
- proxy.$modal.msgWarning(response.msg);
- }
- },
- // 鏂囦欢涓婁紶澶辫触鏃剁殑鍥炶皟
- onError: (error, file, fileList) => {
- console.error('涓婁紶澶辫触', error, file, fileList);
- upload.isUploading = false;
- proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
- },
- // 鏂囦欢涓婁紶杩涘害鍥炶皟
- onProgress: (event, file, fileList) => {
- console.log('涓婁紶涓�...', event.percent);
- }
-});
-const { searchForm, form, rules } = toRefs(data);
-const addNewContact = () => {
- formYYs.value.contactList.push({
- contactPerson: "",
- contactPhone: ""
});
-};
+ const negotiationRecords = ref([]);
-const removeContact = (index) => {
- if (formYYs.value.contactList.length > 1) {
- formYYs.value.contactList.splice(index, 1);
- }
-};
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- listCustomer({ ...searchForm.value, ...page }).then((res) => {
- tableLoading.value = false;
- tableData.value = res.records;
- page.total = res.total;
- });
-};
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
-};
-/** 鎻愪氦涓婁紶鏂囦欢 */
-function submitFileForm() {
- upload.isUploading = true;
- proxy.$refs["uploadRef"].submit();
-}
-/** 瀵煎叆鎸夐挳鎿嶄綔 */
-function handleImport() {
- upload.title = "瀹㈡埛瀵煎叆";
- upload.open = true;
-}
-/** 涓嬭浇妯℃澘 */
-function importTemplate() {
- proxy.download("/basic/customer/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
-}
-// 鎵撳紑寮规
-const openForm = (type, row) => {
- operationType.value = type;
- form.value = {};
- form.value.maintainer = userStore.nickName;
- formYYs.value.contactList = [
+ const tableColumn = ref([
{
- contactPerson: "",
- contactPhone: ""
- }
- ];
- form.value.maintenanceTime = getCurrentDate();
- userListNoPage().then((res) => {
- userList.value = res.data;
+ label: "瀹㈡埛鍒嗙被",
+ prop: "customerType",
+ width: 120,
+ },
+ {
+ label: "瀹㈡埛鍚嶇О",
+ prop: "customerName",
+ width: 220,
+ },
+ {
+ label: "绾崇◣浜鸿瘑鍒爜",
+ prop: "taxpayerIdentificationNumber",
+ width: 220,
+ },
+ {
+ label: "鍦板潃鍙婅仈绯绘柟寮�",
+ prop: "addressPhone",
+ width: 250,
+ },
+ {
+ label: "鑱旂郴浜�",
+ prop: "contactPerson",
+ },
+ {
+ label: "鑱旂郴鐢佃瘽",
+ prop: "contactPhone",
+ width: 150,
+ },
+ {
+ label: "璺熻繘杩涘害",
+ prop: "followUpLevel",
+ width: 120,
+ },
+ {
+ label: "璺熻繘鏃堕棿",
+ prop: "followUpTime",
+ width: 120,
+ },
+ {
+ label: "閾惰鍩烘湰鎴�",
+ prop: "basicBankAccount",
+ width: 220,
+ },
+ {
+ label: "閾惰璐﹀彿",
+ prop: "bankAccount",
+ width: 220,
+ },
+ {
+ label: "寮�鎴疯鍙�",
+ prop: "bankCode",
+ width: 220,
+ },
+ {
+ label: "缁存姢浜�",
+ prop: "maintainer",
+ },
+ {
+ label: "缁存姢鏃堕棿",
+ prop: "maintenanceTime",
+ width: 100,
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ width: 250,
+ operation: [
+ {
+ 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 => {
+ openNegotiationDialog(row);
+ },
+ },
+ ],
+ },
+ ]);
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const userList = ref([]);
+ const tableLoading = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
});
- if (type === "edit") {
- getCustomer(row.id).then((res) => {
- form.value = { ...res.data };
- formYYs.value.contactList = res.data.contactPerson.split(",").map((item, index) => {
- return {
- contactPerson: item,
- contactPhone: res.data.contactPhone.split(",")[index]
- }
- });
+ const total = ref(0);
- });
- }
- dialogFormVisible.value = true;
-};
-// 鎻愪氦琛ㄥ崟
-const submitForm = () => {
- proxy.$refs["formRef"].validate((valid) => {
- if (valid) {
- if (operationType.value === "edit") {
- submitEdit();
- } else {
- submitAdd();
+ // 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
+ const operationType = ref("");
+ const dialogFormVisible = ref(false);
+ const formYYs = ref({
+ // 鍏朵粬瀛楁...
+ contactList: [
+ {
+ contactPerson: "",
+ contactPhone: "",
+ },
+ ],
+ });
+ const data = reactive({
+ searchForm: {
+ customerName: "",
+ customerType: "",
+ },
+ form: {
+ customerName: "",
+ taxpayerIdentificationNumber: "",
+ companyAddress: "",
+ companyPhone: "",
+ contactPerson: "",
+ contactPhone: "",
+ maintainer: "",
+ maintenanceTime: "",
+ basicBankAccount: "",
+ bankAccount: "",
+ bankCode: "",
+ customerType: "",
+ },
+ rules: {
+ customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ taxpayerIdentificationNumber: [
+ { required: true, message: "璇疯緭鍏�", trigger: "blur" },
+ ],
+ companyAddress: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ companyPhone: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ // contactPerson: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ // contactPhone: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ maintainer: [{ required: false, message: "璇烽�夋嫨", trigger: "change" }],
+ maintenanceTime: [
+ { required: false, message: "璇烽�夋嫨", trigger: "change" },
+ ],
+ basicBankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ bankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ bankCode: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ customerType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ },
+ });
+ const upload = reactive({
+ // 鏄惁鏄剧ず寮瑰嚭灞傦紙瀹㈡埛瀵煎叆锛�
+ open: false,
+ // 寮瑰嚭灞傛爣棰橈紙瀹㈡埛瀵煎叆锛�
+ title: "",
+ // 鏄惁绂佺敤涓婁紶
+ isUploading: false,
+ // 璁剧疆涓婁紶鐨勮姹傚ご閮�
+ headers: { Authorization: "Bearer " + getToken() },
+ // 涓婁紶鐨勫湴鍧�
+ url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
+ // 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
+ beforeUpload: file => {
+ console.log("鏂囦欢鍗冲皢涓婁紶", file);
+ // 鍙互鍦ㄦ澶勫仛鏂囦欢绫诲瀷鎴栧ぇ灏忔牎楠�
+ const isValid =
+ file.type ===
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ||
+ file.name.endsWith(".xlsx") ||
+ file.name.endsWith(".xls");
+ if (!isValid) {
+ proxy.$modal.msgError("鍙兘涓婁紶 Excel 鏂囦欢");
}
- }
+ return isValid;
+ },
+ // 鏂囦欢鐘舵�佹敼鍙樻椂鐨勫洖璋�
+ onChange: (file, fileList) => {
+ console.log("鏂囦欢鐘舵�佹敼鍙�", file, fileList);
+ },
+ // 鏂囦欢涓婁紶鎴愬姛鏃剁殑鍥炶皟
+ onSuccess: (response, file, fileList) => {
+ console.log("涓婁紶鎴愬姛", response, file, fileList);
+ upload.isUploading = false;
+ if (response.code === 200) {
+ proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
+ upload.open = false;
+ proxy.$refs["uploadRef"].clearFiles();
+ getList();
+ } else if (response.code === 500) {
+ proxy.$modal.msgError(response.msg);
+ } else {
+ proxy.$modal.msgWarning(response.msg);
+ }
+ },
+ // 鏂囦欢涓婁紶澶辫触鏃剁殑鍥炶皟
+ onError: (error, file, fileList) => {
+ console.error("涓婁紶澶辫触", error, file, fileList);
+ upload.isUploading = false;
+ proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+ },
+ // 鏂囦欢涓婁紶杩涘害鍥炶皟
+ onProgress: (event, file, fileList) => {
+ console.log("涓婁紶涓�...", event.percent);
+ },
});
-};
-// 鎻愪氦鏂板
-const submitAdd = () => {
- if(formYYs.value.contactList.length < 1){
- return proxy.$modal.msgWarning("璇疯嚦灏戞坊鍔犱竴涓仈绯讳汉");
- }
- form.value.contactPerson = formYYs.value.contactList.map(item => item.contactPerson).join(",");
- form.value.contactPhone = formYYs.value.contactList.map(item => item.contactPhone).join(",");
- addCustomer(form.value).then((res) => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- getList();
- });
-};
-// 鎻愪氦淇敼
-const submitEdit = () => {
- form.value.contactPerson = formYYs.value.contactList.map(item => item.contactPerson).join(",");
- form.value.contactPhone = formYYs.value.contactList.map(item => item.contactPhone).join(",");
- updateCustomer(form.value).then((res) => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- getList();
- });
-};
-// 鍏抽棴寮规
-const closeDia = () => {
- proxy.resetForm("formRef");
- dialogFormVisible.value = false;
-};
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/basic/customer/export", {}, "瀹㈡埛妗f.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
+ const { searchForm, form, rules } = toRefs(data);
+ const addNewContact = () => {
+ formYYs.value.contactList.push({
+ contactPerson: "",
+ contactPhone: "",
});
-};
-// 鍒犻櫎
-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("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
+ };
+
+ const removeContact = index => {
+ if (formYYs.value.contactList.length > 1) {
+ formYYs.value.contactList.splice(index, 1);
+ }
+ };
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ listCustomer({ ...searchForm.value, ...page }).then(res => {
+ tableLoading.value = false;
+ tableData.value = res.records;
+ page.total = res.total;
+ });
+ };
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
+ /** 鎻愪氦涓婁紶鏂囦欢 */
+ function submitFileForm() {
+ upload.isUploading = true;
+ proxy.$refs["uploadRef"].submit();
+ }
+ /** 瀵煎叆鎸夐挳鎿嶄綔 */
+ function handleImport() {
+ upload.title = "瀹㈡埛瀵煎叆";
+ upload.open = true;
+ }
+ /** 涓嬭浇妯℃澘 */
+ function importTemplate() {
+ proxy.download("/basic/customer/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
+ }
+ // 鎵撳紑寮规
+ const openForm = (type, row) => {
+ operationType.value = type;
+ form.value = {};
+ form.value.maintainer = userStore.nickName;
+ formYYs.value.contactList = [
+ {
+ contactPerson: "",
+ contactPhone: "",
+ },
+ ];
+ form.value.maintenanceTime = getCurrentDate();
+ userListNoPage().then(res => {
+ userList.value = res.data;
+ });
+ if (type === "edit") {
+ getCustomer(row.id).then(res => {
+ form.value = { ...res.data };
+ formYYs.value.contactList = res.data.contactPerson
+ .split(",")
+ .map((item, index) => {
+ return {
+ contactPerson: item,
+ contactPhone: res.data.contactPhone.split(",")[index],
+ };
+ });
+ });
+ }
+ dialogFormVisible.value = true;
+ };
+ // 鎻愪氦琛ㄥ崟
+ const submitForm = () => {
+ proxy.$refs["formRef"].validate(valid => {
+ if (valid) {
+ if (operationType.value === "edit") {
+ submitEdit();
+ } else {
+ submitAdd();
+ }
+ }
+ });
+ };
+ // 鎻愪氦鏂板
+ const submitAdd = () => {
+ if (formYYs.value.contactList.length < 1) {
+ return proxy.$modal.msgWarning("璇疯嚦灏戞坊鍔犱竴涓仈绯讳汉");
+ }
+ form.value.contactPerson = formYYs.value.contactList
+ .map(item => item.contactPerson)
+ .join(",");
+ form.value.contactPhone = formYYs.value.contactList
+ .map(item => item.contactPhone)
+ .join(",");
+ addCustomer(form.value).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ getList();
+ });
+ };
+ // 鎻愪氦淇敼
+ const submitEdit = () => {
+ form.value.contactPerson = formYYs.value.contactList
+ .map(item => item.contactPerson)
+ .join(",");
+ form.value.contactPhone = formYYs.value.contactList
+ .map(item => item.contactPhone)
+ .join(",");
+ updateCustomer(form.value).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ getList();
+ });
+ };
+ // 鍏抽棴寮规
+ const closeDia = () => {
+ proxy.resetForm("formRef");
+ dialogFormVisible.value = false;
+ };
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/basic/customer/export", {}, "瀹㈡埛妗f.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+ // 鍒犻櫎
+ 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("璇烽�夋嫨鏁版嵁");
return;
}
- ids = selectedRows.value.map((item) => item.id);
- } else {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
- }
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- tableLoading.value = true;
- delCustomer(ids)
- .then((res) => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- getList();
- })
- .finally(() => {
- tableLoading.value = false;
- });
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
})
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
+ .then(() => {
+ tableLoading.value = true;
+ delCustomer(ids)
+ .then(res => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ })
+ .finally(() => {
+ tableLoading.value = false;
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+
+ // 鎵撳紑鍥炶鎻愰啋寮圭獥
+ const openReminderDialog = row => {
+ reminderForm.customerName = row.customerName;
+ reminderForm.reminderSwitch = false;
+ reminderForm.reminderContent = "";
+ reminderForm.reminderTime = "";
+
+ reminderDialogVisible.value = true;
+ };
+
+ // 鍏抽棴鍥炶鎻愰啋寮圭獥
+ const closeReminderDialog = () => {
+ proxy.resetForm("reminderFormRef");
+ reminderDialogVisible.value = false;
+ };
+
+ // 鎻愪氦鍥炶鎻愰啋
+ const submitReminderForm = () => {
+ proxy.$refs.reminderFormRef.validate(valid => {
+ if (valid) {
+ // 杩欓噷鍋囪涓�涓帴鍙f潵鎻愪氦鍥炶鎻愰啋鏁版嵁
+ // 瀹為檯椤圭洰涓渶瑕佹牴鎹悗绔帴鍙h繘琛岃皟鏁�
+ console.log("鎻愪氦鍥炶鎻愰啋鏁版嵁:", reminderForm);
+
+ // 妯℃嫙鎺ュ彛璋冪敤
+ setTimeout(() => {
+ proxy.$modal.msgSuccess("鍥炶鎻愰啋璁剧疆鎴愬姛");
+ closeReminderDialog();
+ }, 1000);
+ }
});
-};
+ };
-// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
-function getCurrentDate() {
- const today = new Date();
- const year = today.getFullYear();
- const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
- const day = String(today.getDate()).padStart(2, "0");
- return `${year}-${month}-${day}`;
-}
+ // 鎵撳紑娲借皥杩涘害寮圭獥
+ const openNegotiationDialog = row => {
+ negotiationForm.customerName = row.customerName;
+ negotiationForm.customerId = 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;
+ };
-onMounted(() => {
- getList();
-});
+ // 鍏抽棴娲借皥杩涘害寮圭獥
+ const closeNegotiationDialog = () => {
+ proxy.resetForm("negotiationFormRef");
+ // 娓呴櫎缂栬緫鐘舵��
+ delete negotiationForm.editIndex;
+ delete negotiationForm.id;
+ negotiationDialogVisible.value = false;
+ };
+
+ // 鎻愪氦娲借皥杩涘害
+ const submitNegotiationForm = () => {
+ proxy.$refs.negotiationFormRef.validate(valid => {
+ if (valid) {
+ // 鍒ゆ柇鏄柊澧炶繕鏄慨鏀�
+ const isEdit = negotiationForm.editIndex !== undefined;
+
+ 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 => {
+ // 鏇存柊鏈湴鏁版嵁
+ negotiationRecords.value = res.data.followUpList || [];
+ });
+ });
+ proxy.$modal.msgSuccess("淇敼鎴愬姛");
+ closeNegotiationDialog();
+ } else {
+ // 鏂板鎿嶄綔
+ console.log("鎻愪氦娲借皥杩涘害鏁版嵁:", negotiationForm);
+ addCustomerFollow(negotiationForm).then(res => {
+ // 娣诲姞鎴愬姛鍚庢洿鏂拌鎯呴〉闈㈢殑杩涘害璁板綍
+ const newRecord = {
+ followUpTime: negotiationForm.followUpTime,
+ followUpMethod: negotiationForm.followUpMethod,
+ followUpLevel: negotiationForm.followUpLevel,
+ followerUserName: negotiationForm.followerUserName,
+ content: negotiationForm.content,
+ };
+ negotiationRecords.value.unshift(newRecord);
+
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeNegotiationDialog();
+ getList();
+ });
+ }
+ }
+ });
+ };
+
+ // 鎵撳紑璇︽儏寮圭獥
+ const openDetailDialog = row => {
+ // 璋冪敤getCustomer鎺ュ彛鑾峰彇瀹㈡埛璇︽儏
+ getCustomer(row.id).then(res => {
+ // 濉厖瀹㈡埛鍩烘湰淇℃伅
+ Object.assign(detailForm, res.data);
+
+ // 鑾峰彇娲借皥杩涘害璁板綍
+ negotiationRecords.value = res.data.followUpList || [];
+
+ detailDialogVisible.value = true;
+ });
+ };
+
+ // 鍏抽棴璇︽儏寮圭獥
+ const closeDetailDialog = () => {
+ detailDialogVisible.value = false;
+ };
+
+ // 淇敼娲借皥璁板綍
+ const editNegotiationRecord = (row, index) => {
+ // 灏嗗綋鍓嶈褰曟暟鎹~鍏呭埌琛ㄥ崟
+ Object.assign(negotiationForm, {
+ customerName: row.customerName,
+ customerId: row.customerId,
+ followUpMethod: row.followUpMethod,
+ followUpLevel: row.followUpLevel,
+ followUpTime: row.followUpTime,
+ followerUserName: row.followerUserName,
+ content: row.content,
+ id: row.id, // 璁板綍ID鐢ㄤ簬鏇存柊
+ editIndex: index, // 璁板綍绱㈠紩鐢ㄤ簬鏈湴鏇存柊
+ });
+ negotiationDialogVisible.value = true;
+ };
+
+ // 鍒犻櫎娲借皥璁板綍
+ const deleteNegotiationRecord = (row, index) => {
+ ElMessageBox.confirm("纭畾瑕佸垹闄よ繖鏉℃唇璋堣褰曞悧锛�", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ // 杩欓噷鍙互璋冪敤鍒犻櫎鎺ュ彛
+ // 瀹為檯椤圭洰涓渶瑕佹牴鎹悗绔帴鍙h繘琛岃皟鏁�
+ // 绀轰緥锛歞eleteCustomerFollow(row.id).then(() => {
+ // negotiationRecords.value.splice(index, 1);
+ // proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ // });
+ delCustomerFollow(row.id).then(() => {
+ // 鍒犻櫎鎴愬姛鍚庢洿鏂版湰鍦版暟鎹�
+ getCustomer(row.customerId).then(res => {
+ // 鏇存柊鏈湴鏁版嵁
+ negotiationRecords.value = res.data.followUpList || [];
+ });
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ });
+ // 鏈湴鍒犻櫎锛堟ā鎷燂級
+ negotiationRecords.value.splice(index, 1);
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑堝垹闄�");
+ });
+ };
+
+ // 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
+ function getCurrentDate() {
+ const today = new Date();
+ const year = today.getFullYear();
+ const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
+ const day = String(today.getDate()).padStart(2, "0");
+ return `${year}-${month}-${day}`;
+ }
+
+ onMounted(() => {
+ getList();
+ });
</script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+ .detail-section {
+ margin-bottom: 20px;
+ padding: 15px;
+ background-color: #f9f9f9;
+ border-radius: 4px;
+ }
+
+ .section-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 15px;
+ }
+
+ .section-title {
+ font-size: 16px;
+ font-weight: bold;
+ margin: 0 0 15px 0;
+ color: #333;
+ }
+
+ .info-display {
+ background-color: #fff;
+ padding: 15px;
+ border-radius: 4px;
+ }
+
+ .info-item {
+ margin-bottom: 12px;
+ display: flex;
+ align-items: flex-start;
+ }
+
+ .info-label {
+ width: 120px;
+ font-weight: 500;
+ color: #606266;
+ margin-right: 10px;
+ }
+
+ .info-value {
+ flex: 1;
+ color: #303133;
+ word-break: break-word;
+ }
+
+ .no-records {
+ text-align: center;
+ padding: 30px;
+ color: #999;
+ font-size: 14px;
+ }
+</style>
--
Gitblit v1.9.3