修改跟进详细功能位置
This commit is contained in:
parent
d187069086
commit
28ec62e90d
|
|
@ -21,15 +21,6 @@
|
||||||
/>
|
/>
|
||||||
<view class="followup-user-info">
|
<view class="followup-user-info">
|
||||||
<text class="followup-user-name">{{ item.userName }}</text>
|
<text class="followup-user-name">{{ item.userName }}</text>
|
||||||
<text class="followup-user-role">销售经理</text>
|
|
||||||
</view>
|
|
||||||
<view class="followup-actions">
|
|
||||||
<view class="edit-btn" @click.stop="handleEdit(item)">
|
|
||||||
<text class="edit-icon">✏️</text>
|
|
||||||
</view>
|
|
||||||
<view class="delete-btn" @click.stop="handleDelete(item)">
|
|
||||||
<text class="delete-icon">🗑️</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -50,7 +41,6 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { deleteFollowup } from '@/common/api/customer';
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
followupList: {
|
followupList: {
|
||||||
|
|
@ -59,7 +49,7 @@ const props = defineProps({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['followup-click', 'refresh']);
|
const emit = defineEmits(['followup-click']);
|
||||||
|
|
||||||
// 按日期分组的跟进记录
|
// 按日期分组的跟进记录
|
||||||
const groupedFollowupList = computed(() => {
|
const groupedFollowupList = computed(() => {
|
||||||
|
|
@ -140,42 +130,7 @@ const handleFollowupClick = (item) => {
|
||||||
emit('followup-click', item);
|
emit('followup-click', item);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 编辑跟进记录
|
// 详情页承载编辑与删除操作
|
||||||
const handleEdit = (item) => {
|
|
||||||
if (item && item.followId) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/customer/follow/edit/index?followId=${item.followId}`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 删除跟进记录
|
|
||||||
const handleDelete = (item) => {
|
|
||||||
if (!item || !item.followId) {
|
|
||||||
uni.$uv.toast('跟进记录ID不存在');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
uni.showModal({
|
|
||||||
title: '确认删除',
|
|
||||||
content: '确定要删除这条跟进记录吗?删除后无法恢复。',
|
|
||||||
confirmText: '删除',
|
|
||||||
confirmColor: '#f56c6c',
|
|
||||||
success: async (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
try {
|
|
||||||
await deleteFollowup(item.followId);
|
|
||||||
uni.$uv.toast('删除成功');
|
|
||||||
// 通知父组件刷新列表
|
|
||||||
emit('refresh');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('删除跟进记录失败:', error);
|
|
||||||
uni.$uv.toast(error?.message || '删除失败,请重试');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
@ -260,8 +215,8 @@ const handleDelete = (item) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
.followup-avatar {
|
.followup-avatar {
|
||||||
width: 40px;
|
width: 20px;
|
||||||
height: 40px;
|
height: 20px;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
margin-right: 12px;
|
margin-right: 12px;
|
||||||
background-color: #e0e0e0;
|
background-color: #e0e0e0;
|
||||||
|
|
@ -289,39 +244,7 @@ const handleDelete = (item) => {
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.followup-actions {
|
/* 编辑与删除按钮移动到详情页 */
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.edit-btn,
|
|
||||||
.delete-btn {
|
|
||||||
width: 32px;
|
|
||||||
height: 32px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background-color: #e0e0e0;
|
|
||||||
transform: scale(0.95);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.edit-icon,
|
|
||||||
.delete-icon {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.delete-btn {
|
|
||||||
&:active {
|
|
||||||
background-color: #fee;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.followup-arrow {
|
.followup-arrow {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
|
|
|
||||||
|
|
@ -175,13 +175,22 @@
|
||||||
<text>重试</text>
|
<text>重试</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 底部操作栏 -->
|
||||||
|
<view class="bottom-actions">
|
||||||
|
<view class="action-btn edit-btn" @click="handleEdit">
|
||||||
|
<text>编辑</text>
|
||||||
|
</view>
|
||||||
|
<view class="action-btn delete-btn" @click="handleDelete">
|
||||||
|
<text>删除</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { getFollowupDetail, getCustomerFollowTypeDict } from '@/common/api/customer';
|
import { getFollowupDetail, getCustomerFollowTypeDict, deleteFollowup } from '@/common/api/customer';
|
||||||
import {
|
import {
|
||||||
getCustomerStatusText,
|
getCustomerStatusText,
|
||||||
getCustomerStatusClass,
|
getCustomerStatusClass,
|
||||||
|
|
@ -507,6 +516,44 @@ const handleBack = () => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 编辑
|
||||||
|
const handleEdit = () => {
|
||||||
|
if (!followId.value) {
|
||||||
|
uni.$uv?.toast?.('缺少跟进ID');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/customer/follow/edit/index?followId=${followId.value}`
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
const handleDelete = () => {
|
||||||
|
if (!followId.value) {
|
||||||
|
uni.$uv?.toast?.('缺少跟进ID');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.showModal({
|
||||||
|
title: '确认删除',
|
||||||
|
content: '确定要删除这条跟进记录吗?删除后无法恢复。',
|
||||||
|
confirmText: '删除',
|
||||||
|
confirmColor: '#f56c6c',
|
||||||
|
success: async (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
try {
|
||||||
|
await deleteFollowup(followId.value);
|
||||||
|
uni.$uv?.toast?.('删除成功');
|
||||||
|
// 返回上一页(通常为列表或详情来源页)
|
||||||
|
uni.navigateBack();
|
||||||
|
} catch (err) {
|
||||||
|
console.error('删除跟进记录失败:', err);
|
||||||
|
uni.$uv?.toast?.(err?.message || '删除失败,请重试');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 组件挂载
|
// 组件挂载
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 数据已在 onLoad 中加载
|
// 数据已在 onLoad 中加载
|
||||||
|
|
@ -556,6 +603,7 @@ onMounted(() => {
|
||||||
.content-scroll {
|
.content-scroll {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
padding-bottom: 72px; /* 预留底部操作栏空间 */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -789,5 +837,35 @@ onMounted(() => {
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 底部操作栏与按钮(左右各占一半) */
|
||||||
|
.bottom-actions {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
z-index: 200;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn {
|
||||||
|
flex: 1;
|
||||||
|
height: 56px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-btn {
|
||||||
|
color: #1976d2;
|
||||||
|
border-right: 1px solid #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.delete-btn {
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user