Files
ys-app/src/pages/business/CRM/mainOwner/view/viewMainOwner.vue

214 lines
5.3 KiB
Vue
Raw Normal View History

2025-09-17 21:47:23 +08:00
<!--
* @description 查看主归属人变更
* @update date 2025/9/17 21:45
-->
2025-08-25 16:41:33 +08:00
<template>
<view class="con-body">
<view class="con-bg">
<!-- 头部 -->
2025-09-17 21:47:23 +08:00
<customHeader ref="customHeaderRef" :title="'查看主归属人变更'" :leftFlag="true"
:rightFlag="false"></customHeader>
2025-08-25 16:41:33 +08:00
<!-- 高度来避免头部遮挡 -->
<view class="top-height" :style="{ paddingTop: navBarPaddingTop + 'px' }"></view>
<view class="all-body">
<!-- 分页部分 -->
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
:up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff"
class="scroll-h" :class="{ 'loading-scroll': cssFlag }">
<view class="white-bg margin-bottom20" v-for="(item, index) in list" :key="index"
@click="showDetail(item)">
<view>
<view class="report-list">
2025-09-17 21:47:23 +08:00
<view class="r-list title">{{ item.cusName }}
2025-08-25 16:41:33 +08:00
<view class="r-name">{{ item.visistCode }}</view>
2025-09-17 21:47:23 +08:00
<view class="r-right btn-blue no-wrap"> 查看 </view>
2025-08-25 16:41:33 +08:00
</view>
2025-09-17 21:47:23 +08:00
2025-08-25 16:41:33 +08:00
<view class="border-bottom"></view>
<view class="r-list">
<view class="r-left">客户人员名称</view>
2025-09-17 21:47:23 +08:00
<view class="r-right">{{ item.userName }}</view>
2025-08-25 16:41:33 +08:00
</view>
2025-09-17 21:47:23 +08:00
<view class="r-list">
2025-08-25 16:41:33 +08:00
<view class="r-left">目前业务员</view>
<view class="r-right">{{ item.belonger }}</view>
</view>
<view class="border-bottom"></view>
<view class="r-list">
<view class="r-left">创建时间</view>
<view class="r-right">{{ item.createTime }}</view>
</view>
<view class="border-bottom"></view>
<view class="r-list">
<view class="r-left">职能</view>
<view class="r-right">{{ item.function }}</view>
</view>
</view>
</view>
</view>
</mescroll-uni>
</view>
</view>
</view>
</template>
<script setup>
import customHeader from "../../../../../components/customHeader.vue";
2025-09-17 21:47:23 +08:00
import {onMounted, ref} from 'vue';
2025-08-25 16:41:33 +08:00
import {getNavBarPaddingTop} from "../../../../../utils/system";
import MescrollUni from "mescroll-uni/mescroll-uni.vue";
import {getQueryVisistList} from "../../../../../api/crm/activity/activity";
import {queryViewMainOwnerList} from "../../../../../api/crm/mainOwner/mainOwner";
import {onShow} from "@dcloudio/uni-app";
// 获取导航栏高度用于内容区域padding
const navBarPaddingTop = ref(0);
let queryParams = ref({
pageNum: 1,
pageSize: 10,
})
onMounted(() => {
navBarPaddingTop.value = getNavBarPaddingTop() * 2;
})
2025-09-17 21:47:23 +08:00
onShow(() => {
2025-08-25 16:41:33 +08:00
getList(queryParams)
})
let list = ref([])
2025-09-17 21:47:23 +08:00
2025-08-25 16:41:33 +08:00
//获取列表信息
2025-09-17 21:47:23 +08:00
function getList(queryParams) {
2025-08-25 16:41:33 +08:00
queryViewMainOwnerList(queryParams.value).then(res => {
2025-09-17 21:47:23 +08:00
list.value = res.rows
2025-08-25 16:41:33 +08:00
})
}
let cssFlag = ref(false);//控制样式
let mescrollRef = ref(null);
const mescrollInit = (mescroll) => {
cssFlag.value = true;
mescrollRef.value = mescroll;
};
// 下拉刷新
const downCallback = async (mescroll) => {
try {
setTimeout(async () => {
queryParams.pageNum = 1;
queryParams.pageSize = upOption.value.page.size;
//获取当前页的信息
const res = await queryViewMainOwnerList(queryParams)
cssFlag.value = false;
list.value = res.rows;
mescroll.resetUpScroll();
}, 500);
} catch (error) {
mescroll.endErr();
} finally {
setTimeout(async () => {
mescroll.endSuccess();
}, 500);
}
}
// 上拉加载更多
const upCallback = async (mescroll) => {
try {
setTimeout(async () => {
queryParams.pageNum = 1;
queryParams.pageSize = upOption.value.page.size;
const res = await queryViewMainOwnerList(queryParams);
if (mescroll.num === 1) {
list.value = res.rows;
} else {
list.value.push(...res.rows);
}
mescroll.endBySize(res.rows.length, res.total);
}, 500);
} catch (error) {
mescroll.endErr();
}
}
const upOption = ref({
2025-09-17 21:47:23 +08:00
page: {num: 0, size: 10},
2025-08-25 16:41:33 +08:00
noMoreSize: 5,
empty: {
tip: '~ 空空如也 ~',
icon: "../../../../../static/images/mescroll-empty.png"
2025-08-25 16:47:32 +08:00
},
2025-08-25 16:41:33 +08:00
textLoading: '加载中...',
textNoMore: '已经到底了'
});
const downOption = ref({
auto: true,
textInOffset: '下拉刷新',
textOutOffset: '释放更新',
textLoading: '刷新中...'
});
// 查看信息详情
function showDetail(item) {
uni.navigateTo({
url: './viewMainOwnerDetail?userId=' + item.userId
})
}
</script>
2025-09-17 21:47:23 +08:00
<style scoped>
2025-08-25 16:41:33 +08:00
.all-body {
/* #ifdef APP-PLUS */
top: 160rpx;
height: calc(100vh - 160rpx);
2025-08-25 16:41:33 +08:00
/* #endif */
/* #ifndef APP-PLUS */
top: 116rpx;
height: calc(100vh - 116rpx);
2025-08-25 16:41:33 +08:00
/* #endif */
}
2025-09-17 21:47:23 +08:00
.scroll-h{
2025-08-25 16:41:33 +08:00
/* #ifdef APP-PLUS */
2025-09-17 21:47:23 +08:00
top: 160rpx;
height: calc(100vh - 160rpx);
2025-08-25 16:41:33 +08:00
/* #endif */
/* #ifndef APP-PLUS */
2025-09-17 21:47:23 +08:00
top: 116rpx;
height: calc(100vh - 116rpx);
2025-08-25 16:41:33 +08:00
/* #endif */
}
.white-bg {
padding-bottom: 10rpx;
}
2025-09-17 21:47:23 +08:00
.title {
align-items: baseline
}
.no-wrap {
white-space: nowrap;
}
.btn-blue {
border-radius: 10rpx;
}
2025-08-25 16:41:33 +08:00
</style>