【招生小程序】 修复# 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 { try {
await apiEditClue(form.value) await apiEditClue(form.value)
toast('修改成功') toast('修改成功')
uni.$emit('editFollow')
uni.navigateBack() uni.navigateBack()
uni.$emit('refreshPageList')
} catch (error) {} } catch (error) {}
loading.value = false loading.value = false
} }

View File

@ -12,7 +12,6 @@
<view class="info"> <view class="info">
<text>{{ userInfo.nickname }}</text> <text>{{ userInfo.nickname }}</text>
<text class="strong">{{ userInfo.mobile }}</text> <text class="strong">{{ userInfo.mobile }}</text>
<text class="strong">{{ roles }}</text>
</view> </view>
<view class="icon" @click="handleViewInfo"> <view class="icon" @click="handleViewInfo">
<TIcon name="icon-right" :size="24" /> <TIcon name="icon-right" :size="24" />
@ -25,17 +24,30 @@
v-for="(group, index) in parseGroupList" v-for="(group, index) in parseGroupList"
:key="index" :key="index"
:title="group.title" :title="group.title"
:label="group.label"
:url="group.url" :url="group.url"
:isLink="group.isLink" :isLink="group.isLink"
:border="group.border" :border="group.border"
size="large" size="large"
@click="handleClick(group)" @click="handleClick(group)"
> >
<template #value v-if="group.value == 'roles'"> <!-- <template #value v-if="group.value == 'roles'">
<view class="flex items-center"> <view class="flex items-center">
<text class="text-sm mr-1">{{ roles }}</text> <text class="text-sm mr-1">{{ roles }}</text>
<u-icon name="arrow-right" color="#aaacb1" size="18"></u-icon> <u-icon name="arrow-right" color="#aaacb1" size="18"></u-icon>
</view> </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> </template>
</u-cell> </u-cell>
</u-cell-group> </u-cell-group>
@ -66,6 +78,7 @@ interface IGroup {
isLink: boolean isLink: boolean
border?: boolean border?: boolean
url?: string url?: string
label?: string
} }
const props = defineProps({ const props = defineProps({
@ -92,6 +105,7 @@ const activeRoleId = computed(() => {
const newGroupList = ref(props.groupList) const newGroupList = ref(props.groupList)
const originGroupList = [ const originGroupList = [
{ title: '所属组织', label: userInfo.organizationName, value: '' }
// { title: '', value: 'customer', isLink: false }, // { title: '', value: 'customer', isLink: false },
// { // {
// title: '', // title: '',
@ -107,7 +121,7 @@ const originGroupList = [
// url: `/bundle/pages/agreement/index?type=${AgreementEnum.SERVICE}` // url: `/bundle/pages/agreement/index?type=${AgreementEnum.SERVICE}`
// } // }
] ]
const parseGroupList = computed(() => [...newGroupList.value, ...originGroupList]) const parseGroupList = computed(() => [...originGroupList, ...newGroupList.value])
const handleViewInfo = () => { const handleViewInfo = () => {
uni.navigateTo({ uni.navigateTo({
@ -155,7 +169,7 @@ const imageError = () => {
const judgeShow = () => { const judgeShow = () => {
if (userInfo?.roles.length > 1) { 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> </template>
<script setup lang="ts"> <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 { debounce } from 'lodash-es'
import clueCard from './clue-card.vue' import clueCard from './clue-card.vue'
import { useZPaging } from '@/hooks/useZPaging' import { useZPaging } from '@/hooks/useZPaging'
@ -44,10 +45,11 @@ const searchChange = debounce(() => {
refresh(queryParams.value) refresh(queryParams.value)
}, 300) }, 300)
onMounted(() => { const refreshPage = () => {
uni.$on('refreshPageList', () => {
refresh(queryParams.value) refresh(queryParams.value)
}) }
defineExpose({
refreshPage
}) })
</script> </script>
<style scoped></style> <style scoped></style>

View File

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