【招生小程序】 修复# 1、电销:修改跟进后页面不刷新的问题;2、我的页面:添加上所属组织字段

master
kaeery 2025-03-11 15:45:32 +08:00
parent 9bf6f3a837
commit 961236f444
4 changed files with 43 additions and 11 deletions

View File

@ -73,8 +73,8 @@ const handleConfirm = () => {
try {
await apiEditClue(form.value)
toast('修改成功')
uni.$emit('editFollow')
uni.navigateBack()
uni.$emit('refreshPageList')
} catch (error) {}
loading.value = false
}

View File

@ -12,7 +12,6 @@
<view class="info">
<text>{{ userInfo.nickname }}</text>
<text class="strong">{{ userInfo.mobile }}</text>
<text class="strong">{{ roles }}</text>
</view>
<view class="icon" @click="handleViewInfo">
<TIcon name="icon-right" :size="24" />
@ -25,17 +24,30 @@
v-for="(group, index) in parseGroupList"
:key="index"
:title="group.title"
:label="group.label"
:url="group.url"
:isLink="group.isLink"
:border="group.border"
size="large"
@click="handleClick(group)"
>
<template #value v-if="group.value == 'roles'">
<!-- <template #value v-if="group.value == 'roles'">
<view class="flex items-center">
<text class="text-sm mr-1">{{ roles }}</text>
<u-icon name="arrow-right" color="#aaacb1" size="18"></u-icon>
</view>
</template> -->
<template #label>
<view class="mt-[8rpx]">{{ group.label }}</view>
</template>
<template #value>
<view
class="flex items-center gap-[4rpx] text-primary"
v-if="group?.value == 'roles'"
>
<text>切换岗位</text>
<u-icon name="arrow-right" color="#0E66FB" size="16"></u-icon>
</view>
</template>
</u-cell>
</u-cell-group>
@ -66,6 +78,7 @@ interface IGroup {
isLink: boolean
border?: boolean
url?: string
label?: string
}
const props = defineProps({
@ -92,6 +105,7 @@ const activeRoleId = computed(() => {
const newGroupList = ref(props.groupList)
const originGroupList = [
{ title: '所属组织', label: userInfo.organizationName, value: '' }
// { title: '', value: 'customer', isLink: false },
// {
// title: '',
@ -107,7 +121,7 @@ const originGroupList = [
// url: `/bundle/pages/agreement/index?type=${AgreementEnum.SERVICE}`
// }
]
const parseGroupList = computed(() => [...newGroupList.value, ...originGroupList])
const parseGroupList = computed(() => [...originGroupList, ...newGroupList.value])
const handleViewInfo = () => {
uni.navigateTo({
@ -155,7 +169,7 @@ const imageError = () => {
const judgeShow = () => {
if (userInfo?.roles.length > 1) {
newGroupList.value.push({ title: '切换角色', value: 'roles', isLink: false })
newGroupList.value.push({ title: '当前岗位', label: roles, value: 'roles', border: false })
}
}

View File

@ -25,7 +25,8 @@
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import { ref } from 'vue'
import { debounce } from 'lodash-es'
import clueCard from './clue-card.vue'
import { useZPaging } from '@/hooks/useZPaging'
@ -44,10 +45,11 @@ const searchChange = debounce(() => {
refresh(queryParams.value)
}, 300)
onMounted(() => {
uni.$on('refreshPageList', () => {
refresh(queryParams.value)
})
const refreshPage = () => {
refresh(queryParams.value)
}
defineExpose({
refreshPage
})
</script>
<style scoped></style>

View File

@ -12,7 +12,10 @@
></u-tabs>
<view class="flex-1 bg-gray3">
<follow-form v-if="activeTab === teleSaleEnum.ADD_FOLLOW" />
<follow-record v-else-if="activeTab === teleSaleEnum.FOLLOW_RECORD" />
<follow-record
v-else-if="activeTab === teleSaleEnum.FOLLOW_RECORD"
ref="followRecordRef"
/>
</view>
</TContainer>
</template>
@ -23,7 +26,9 @@ import { ref } from 'vue'
import followForm from '@/components/widgets/telesale/follow-form.vue'
import followRecord from '@/components/widgets/telesale/follow-record.vue'
import { teleSaleEnum } from '@/enums'
import { onLoad, onUnload } from '@dcloudio/uni-app'
const followRecordRef = ref<InstanceType<typeof followRecord>>()
const activeTab = ref(teleSaleEnum.ADD_FOLLOW)
const tabs = shallowRef([
{ name: '新增跟进', value: teleSaleEnum.ADD_FOLLOW },
@ -32,5 +37,16 @@ const tabs = shallowRef([
const handleChangeTab = item => {
activeTab.value = item.value
}
const editFollow = () => {
console.log('editFollow')
followRecordRef.value?.refreshPage()
// refresh(queryParams.value)
}
onLoad(() => {
uni.$on('editFollow', editFollow)
})
onUnload(() => {
uni.$off('editFollow', editFollow)
})
</script>
<style scoped></style>