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