From 3a1339fc76be6890b0b096f8855b5ffe821892de Mon Sep 17 00:00:00 2001 From: wangzhuo Date: Wed, 17 Sep 2025 21:44:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=91=A8=E8=AE=A1=E5=88=92=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=94=AF=E6=8C=81=E4=B8=8B=E6=8B=89=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages.json | 3 +- src/pages/business/CRM/plan/planView.vue | 67 +++++++++++++----------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/src/pages.json b/src/pages.json index d86b7d5..b0f497d 100644 --- a/src/pages.json +++ b/src/pages.json @@ -331,7 +331,8 @@ "path": "pages/business/CRM/plan/planView", //周计划查看 "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "enablePullDownRefresh": true } }, { diff --git a/src/pages/business/CRM/plan/planView.vue b/src/pages/business/CRM/plan/planView.vue index 2f999c7..26c6adf 100644 --- a/src/pages/business/CRM/plan/planView.vue +++ b/src/pages/business/CRM/plan/planView.vue @@ -44,7 +44,7 @@ {{ parseInt(searchValue.selectDate.substring(5, 7)) }}月 - {{searchValue.selectDate.substring(0, 4) }}年 + {{ searchValue.selectDate.substring(0, 4) }}年 @@ -58,6 +58,7 @@ {{ WeekShortCN[i] }} {{ list[0][field].substring(8) }} + {{ getWeek(i) }} @@ -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; }*/