feat: 周计划查看支持下拉刷新
This commit is contained in:
@@ -331,7 +331,8 @@
|
|||||||
"path": "pages/business/CRM/plan/planView",
|
"path": "pages/business/CRM/plan/planView",
|
||||||
//周计划查看
|
//周计划查看
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": ""
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
<view style="text-align: center; margin-bottom: 30rpx; font-size: 30rpx;">
|
<view style="text-align: center; margin-bottom: 30rpx; font-size: 30rpx;">
|
||||||
{{ parseInt(searchValue.selectDate.substring(5, 7)) }}月
|
{{ parseInt(searchValue.selectDate.substring(5, 7)) }}月
|
||||||
<span class="line"></span>
|
<span class="line"></span>
|
||||||
{{searchValue.selectDate.substring(0, 4) }}年
|
{{ searchValue.selectDate.substring(0, 4) }}年
|
||||||
</view>
|
</view>
|
||||||
<uni-row class="demo-uni-row">
|
<uni-row class="demo-uni-row">
|
||||||
<uni-col :span="1">
|
<uni-col :span="1">
|
||||||
@@ -58,6 +58,7 @@
|
|||||||
<view class="demo-uni-col mar-left">
|
<view class="demo-uni-col mar-left">
|
||||||
<text>{{ WeekShortCN[i] }}</text>
|
<text>{{ WeekShortCN[i] }}</text>
|
||||||
<text v-if="list[0][field]">{{ list[0][field].substring(8) }}</text>
|
<text v-if="list[0][field]">{{ list[0][field].substring(8) }}</text>
|
||||||
|
<text v-else>{{ getWeek(i) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</block>
|
</block>
|
||||||
@@ -103,9 +104,10 @@ import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
|||||||
import {getNavBarPaddingTop} from '@/utils/system.js'
|
import {getNavBarPaddingTop} from '@/utils/system.js'
|
||||||
import {getAllWeekPlanList} from "@/api/crm/plan/getPlan";
|
import {getAllWeekPlanList} from "@/api/crm/plan/getPlan";
|
||||||
import {AreaList, COLOR_MAP, OrdinalDate, WeekShortCN, WorkEvent, WorkType} from "./dataMap";
|
import {AreaList, COLOR_MAP, OrdinalDate, WeekShortCN, WorkEvent, WorkType} from "./dataMap";
|
||||||
import {getCurrentWeekNum} from "./dateTimeUtils";
|
import {getCurrentWeekNum, getWeek2} from "./dateTimeUtils";
|
||||||
import {getDate} from "@/utils/datetime";
|
import {getDate} from "@/utils/datetime";
|
||||||
import {getWeekPlanListByDate} from "@/api/crm/plan/getPlan";
|
import {getWeekPlanListByDate} from "@/api/crm/plan/getPlan";
|
||||||
|
import {onPullDownRefresh} from "@dcloudio/uni-app";
|
||||||
|
|
||||||
// const currentYear = new Date().getFullYear();
|
// const currentYear = new Date().getFullYear();
|
||||||
const currentMonth = new Date().getMonth() + 1;
|
const currentMonth = new Date().getMonth() + 1;
|
||||||
@@ -116,10 +118,13 @@ const navBarPaddingTop = ref(0);
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
navBarPaddingTop.value = getNavBarPaddingTop() * 2;
|
navBarPaddingTop.value = getNavBarPaddingTop() * 2;
|
||||||
uni.showLoading({})
|
uni.showLoading({})
|
||||||
getPlanList().then(res=>{
|
getPlanList().then(res => {
|
||||||
let {total, rows} = res;
|
let {total, rows} = res;
|
||||||
console.log(rows, "周计划数据获取成功")
|
console.log(total, rows, "周计划数据获取成功")
|
||||||
list.value = rows;
|
list.value = rows;
|
||||||
|
}).catch((err) => {
|
||||||
|
console.warn(err, "周计划数据获取失败")
|
||||||
|
}).finally(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -140,22 +145,21 @@ let searchValue = ref({
|
|||||||
// 查询列表
|
// 查询列表
|
||||||
let list = ref([]);
|
let list = ref([]);
|
||||||
const mescrollRef = ref(null);
|
const mescrollRef = ref(null);
|
||||||
const upOption = ref({
|
onPullDownRefresh(() => {
|
||||||
page: {num: 0, size: 10},
|
getPlanList().then(res => {
|
||||||
noMoreSize: 5,
|
const {rows} = res;
|
||||||
empty: {tip: '~ 空空如也 ~'},
|
list.value = rows;
|
||||||
textLoading: '加载中...',
|
console.log(rows,'刷新周计划成功');
|
||||||
textNoMore: '已经到底了'
|
}).finally(()=>{
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
const downOption = ref({
|
// 查询当前周一周日期
|
||||||
auto: true,
|
const aweek = getWeek2('本周');
|
||||||
textInOffset: '下拉刷新',
|
const getWeek = (i) => {
|
||||||
textOutOffset: '释放更新',
|
return aweek[OrdinalDate[i]].substring(7)
|
||||||
textLoading: '刷新中...'
|
}
|
||||||
});
|
|
||||||
|
|
||||||
let cssFlag = ref(false);//控制样式
|
|
||||||
|
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
const getPlanList = (month, date, pageIndex, pageSize) => {
|
const getPlanList = (month, date, pageIndex, pageSize) => {
|
||||||
@@ -187,20 +191,17 @@ let bindDateChange = (e) => {
|
|||||||
let handleSearch = () => {
|
let handleSearch = () => {
|
||||||
console.log(searchValue.value, '查询参数')
|
console.log(searchValue.value, '查询参数')
|
||||||
uni.showLoading();
|
uni.showLoading();
|
||||||
getWeekPlanListByDate(searchValue.value).then(res=>{
|
getWeekPlanListByDate(searchValue.value).then(res => {
|
||||||
const {total, rows } = res;
|
const {total, rows} = res;
|
||||||
list.value = rows;
|
list.value = rows;
|
||||||
console.log(rows, '查询成功');
|
console.log(rows, '查询成功');
|
||||||
}).catch(err=>{
|
}).catch(err => {
|
||||||
console.warn(err,'数据获取失败');
|
console.warn(err, '数据获取失败');
|
||||||
}).finally(()=>{
|
}).finally(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const mescrollInit = (mescroll) => {
|
|
||||||
cssFlag.value = true;
|
|
||||||
mescrollRef.value = mescroll;
|
|
||||||
};
|
|
||||||
// 搜索区域变更
|
// 搜索区域变更
|
||||||
const bindPickerChange = (e) => {
|
const bindPickerChange = (e) => {
|
||||||
// console.log('picker发送选择改变,携带值为', peopleIndex.value)
|
// console.log('picker发送选择改变,携带值为', peopleIndex.value)
|
||||||
@@ -216,7 +217,7 @@ let handleDetail = (rowIndex, colIndex) => {
|
|||||||
let workDate = detail[OrdinalDate[colIndex]];
|
let workDate = detail[OrdinalDate[colIndex]];
|
||||||
let workType = detail[WorkType[colIndex]];
|
let workType = detail[WorkType[colIndex]];
|
||||||
let workEvent = detail[WorkEvent[colIndex]];
|
let workEvent = detail[WorkEvent[colIndex]];
|
||||||
if(workType && workEvent){
|
if (workType && workEvent) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: `${workDate}\n${workType}`,
|
title: `${workDate}\n${workType}`,
|
||||||
content: `${workEvent}`,
|
content: `${workEvent}`,
|
||||||
@@ -231,8 +232,7 @@ let handleDetail = (rowIndex, colIndex) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "暂无内容",
|
title: "暂无内容",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
@@ -366,10 +366,12 @@ let handleDetail = (rowIndex, colIndex) => {
|
|||||||
margin: 20rpx 0 0 0;
|
margin: 20rpx 0 0 0;
|
||||||
border-radius: 8px 8px 0 0;
|
border-radius: 8px 8px 0 0;
|
||||||
/* #ifdef APP-PLUS */
|
/* #ifdef APP-PLUS */
|
||||||
min-height: calc(100vh - 160rpx/*.topbar height*/ - 68rpx/*.search height*/ - 40rpx/*.white-bg padding-top*/ - 40rpx/*.white-bg padding-bottom*/);
|
min-height: calc(100vh - 160rpx/*.topbar height*/ - 68rpx/*.search height*/ - 40rpx/*.white-bg padding-top*/ - 40rpx /*.white-bg padding-bottom*/
|
||||||
|
);
|
||||||
/* #endif */
|
/* #endif */
|
||||||
/* #ifndef APP-PLUS */
|
/* #ifndef APP-PLUS */
|
||||||
min-height: calc(100vh - 116rpx/*.topbar height*/ - 68rpx/*.search height*/ - 40rpx/*.white-bg padding-top*/ - 40rpx/*.white-bg padding-bottom*/);
|
min-height: calc(100vh - 116rpx/*.topbar height*/ - 68rpx/*.search height*/ - 40rpx/*.white-bg padding-top*/ - 40rpx /*.white-bg padding-bottom*/
|
||||||
|
);
|
||||||
/* #endif */
|
/* #endif */
|
||||||
//overflow-y: auto;
|
//overflow-y: auto;
|
||||||
}
|
}
|
||||||
@@ -394,6 +396,7 @@ let handleDetail = (rowIndex, colIndex) => {
|
|||||||
:deep(.form-con .uni-forms-item) {
|
:deep(.form-con .uni-forms-item) {
|
||||||
margin-bottom: 22px !important;
|
margin-bottom: 22px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*.con-bg {
|
/*.con-bg {
|
||||||
height: 420rpx;
|
height: 420rpx;
|
||||||
}*/
|
}*/
|
||||||
|
|||||||
Reference in New Issue
Block a user