From bc2154934a924f10abdab01f46174db881080bd9 Mon Sep 17 00:00:00 2001 From: 刘淇 <290219706@qq.com> Date: Thu, 15 Oct 2026 12:09:21 +0800 Subject: [PATCH] 考勤记录 --- api/index/index.js | 2 +- api/user.js | 19 +++++++++++++++++++ pages-sub/daily/attendanceRecord.vue | 513 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages-sub/daily/patrol-manage/add-patrol-record.vue | 761 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages-sub/problem/work-order-manage/add-order.vue | 2 +- pages-sub/problem/work-order-manage/order-detail.vue | 4 ++++ pages/index/index.vue | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------- uni_modules/uview-plus/components/u-cascader/u-cascader.vue | 1163 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 8 files changed, 1069 insertions(+), 1565 deletions(-) diff --git a/api/index/index.js b/api/index/index.js index 42903f0..2801d84 100644 --- a/api/index/index.js +++ b/api/index/index.js @@ -63,7 +63,7 @@ export const getCurrentOrg = (params) => { * @returns {Promise} */ export const orgTaskIndicator = (params) => { - return get('/app-api/homePage/summary/orgTaskIndicator', params); + return post('/app-api/homePage/summary/orgTaskIndicator', params); }; diff --git a/api/user.js b/api/user.js index 4a5bbb9..0f00222 100644 --- a/api/user.js +++ b/api/user.js @@ -85,6 +85,25 @@ export const getSmsCode = (data) => { } +/** + * 查询月度考勤日历 + * @returns {Promise} + */ +export const attendanceDaily = (data) => { + return get('/app-api/garden/attendance-daily/calendar',data) +} + +/** + * 查询月度考勤日历 + * @returns {Promise} + */ +export const dayDetail = (data) => { + return get('/app-api/garden/attendance-daily/day-detail',data) +} + + + + diff --git a/pages-sub/daily/attendanceRecord.vue b/pages-sub/daily/attendanceRecord.vue index 6d83501..868b73c 100644 --- a/pages-sub/daily/attendanceRecord.vue +++ b/pages-sub/daily/attendanceRecord.vue @@ -1,85 +1,81 @@ - - diff --git a/pages-sub/daily/patrol-manage/add-patrol-record.vue b/pages-sub/daily/patrol-manage/add-patrol-record.vue index 8e0640e..62bac2e 100644 --- a/pages-sub/daily/patrol-manage/add-patrol-record.vue +++ b/pages-sub/daily/patrol-manage/add-patrol-record.vue @@ -1,249 +1,281 @@ - +const userStore = useUserStore(); +const BUSI_LINE_DICT_TYPE = 'business_line'; +const CJK_RE = /[一-龥]/; + +// 级联选择器变量 +const showCascader = ref(false); +const cascaderValue = ref([]); +const cascaderOptions = ref([]); + +// 打开级联弹窗 +const openCascader = () => { +const busiLineEn = getBusiLineEnByCn(proxy.$data.inspectForm.busiLineCn) +if (!busiLineEn) { +uni.showToast({ title: '请先选择业务线', icon: 'none' }) +return + } +if (!cascaderOptions.value || cascaderOptions.value.length === 0) { +uni.showToast({ title: '正在加载问题类型,请稍等', icon: 'none' }); +loadProblemCascader(busiLineEn); +return; + } +cascaderValue.value = []; +showCascader.value = true; +}; + +// 级联确认回调 +const cascaderConfirm = (selectedArr) => { +const getLabelByValueList = (list, valList) => { +const labelArr = []; +let currentList = list; +for (const val of valList) { +const target = currentList.find(item => item.value === val); +if (!target) break; +labelArr.push(target.label); +currentList = target.children || []; + } +return labelArr.join('/'); + }; +const fullLabel = getLabelByValueList(cascaderOptions.value, selectedArr); +proxy.$data.inspectForm.orderName = fullLabel; +proxy.$data.inspectForm.orderCode = selectedArr.at(-1); +cascaderValue.value = selectedArr; +inspectFormRef.value?.validateField('orderName'); +}; + +// 加载级联树形数据 +const loadProblemCascader = async (parentCode) => { +if (!parentCode) { +cascaderOptions.value = [] +return + } +try { +uni.showLoading({ title: '加载类型中...' }) +const res = await getProblemListByType({ parentCode }) +uni.hideLoading() +cascaderOptions.value = res || [] + } catch (err) { +uni.hideLoading() +console.error('获取问题类型失败', err) +uni.showToast({ title: '获取问题类型失败', icon: 'none' }) +cascaderOptions.value = [] + } +} +const getBusiLineCnByEn = (busiLineEn) => { +if (!busiLineEn) return ''; +return getDictLabel(BUSI_LINE_DICT_TYPE, busiLineEn) || busiLineEn; +}; +const getBusiLineEnByCn = (cnName) => { +if (!cnName) return ''; +const code = getDictValue(BUSI_LINE_DICT_TYPE, cnName); +if (code) return code; +return CJK_RE.test(cnName) ? '' : cnName; +}; + +// 暴露给选项式访问 +proxy.$setupCtx = { + loadProblemCascader, + getBusiLineEnByCn, + cascaderOptions, + cascaderValue +} + - \ No newline at end of file + diff --git a/pages-sub/problem/work-order-manage/add-order.vue b/pages-sub/problem/work-order-manage/add-order.vue index a0f4d71..146e061 100644 --- a/pages-sub/problem/work-order-manage/add-order.vue +++ b/pages-sub/problem/work-order-manage/add-order.vue @@ -212,7 +212,7 @@ const loadProblemCascader = async (parentCode) => { // 表单Ref const workOrderFormRef = ref(null) const problemImgs = useUploadImgs({ - maxCount: 3, + maxCount: 9, uploadText: '选择问题照片', sizeType: ['compressed'], formRef: workOrderFormRef, diff --git a/pages-sub/problem/work-order-manage/order-detail.vue b/pages-sub/problem/work-order-manage/order-detail.vue index 20b8825..b504ad3 100644 --- a/pages-sub/problem/work-order-manage/order-detail.vue +++ b/pages-sub/problem/work-order-manage/order-detail.vue @@ -116,6 +116,10 @@ + + + + - - 数字指标 - - - {{ sortLabel }} - - - - - - - - + + 数字指标 + + + {{ sortLabel }} + + + + + + + + @@ -52,23 +48,16 @@ :option="klineOption" :width="chartWidth" :height="chartHeight" /> --> - - - - {{baseListItem.num}} - {{baseListItem.title}} + + + + + {{ baseListItem.num }} + {{ baseListItem.title }} + - + + @@ -98,13 +87,8 @@ - + @@ -113,7 +97,7 @@ - 事项{{ index + 1 }} + 事项{{ index + 1 }} {{ item.taskName || '无' }} @@ -121,7 +105,8 @@ - + @@ -143,7 +128,7 @@ import { ref, computed, nextTick, watch } from 'vue'; import { onShow, onUnload } from '@dcloudio/uni-app'; import { useUserStore } from '@/pinia/user'; -// import { timeFormat } from '@/uni_modules/uview-plus/libs/function/date'; +import { timeFormat } from '@/uni_modules/uview-plus'; import uniCharts from '@/components/uni-charts/uni-charts.vue'; import { getUnreadCount } from "@/api/user"; import { @@ -211,8 +196,8 @@ const currentTabValue = ref(0); const dateRange = ref([]); const yesterday = new Date(); yesterday.setDate(yesterday.getDate() - 1); -const maxDate = ref(timeFormat(yesterday, 'YYYY-MM-DD')); -const minDate = '2026-01-06'; +const maxDate = ref(timeFormat(yesterday, 'yyyy-mm-dd')); +// const minDate = '2026-01-06'; const isDatePickerOpen = ref(false); const handlePopupShow = () => { isDatePickerOpen.value = true; @@ -365,23 +350,12 @@ const fetchOrgIndicator = async (orgId: number, beginDate: string, endDate: stri }); console.log('orgTaskIndicator 返回:', res); baseList.value = [ - { - num: String(res.totalCnt ?? 0), - title: '应办任务数' - }, - { - num: String(res.doneCnt ?? 0), - title: '已办任务数' - }, - { - num: String(res.pendingCnt ?? 0), - title: '待办任务数' - }, - { - num: String(res.overdueCnt ?? 0), - title: '超时未完成' - } + { num: String(res.totalCnt ?? 0), title: '应办任务数', name: 'file-text' }, + { num: String(res.doneCnt ?? 0), title: '已办任务数', name: 'checkmark-circle' }, + { num: String(res.pendingCnt ?? 0), title: '待办任务数', name: 'clock' }, + { num: String(res.overdueCnt ?? 0), title: '超时未完成', name: 'close-circle' } ]; + } catch (err) { console.error('orgTaskIndicator 请求失败:', err); } @@ -393,11 +367,13 @@ const initRecent7Days = () => { const end = new Date(now); end.setDate(end.getDate() - 1); const start = new Date(end); + console.log(start) start.setDate(start.getDate() - 6); dateRange.value = [ - timeFormat(start, 'YYYY-MM-DD'), - timeFormat(end, 'YYYY-MM-DD') + timeFormat(start, 'yyyy-mm-dd'), + timeFormat(end, 'yyyy-mm-dd') ]; + console.log(dateRange.value) initChartData(dateRange.value[0], dateRange.value[1]); }; @@ -640,17 +616,21 @@ $border-color: #e5e5e5; font-size: 16px; margin-bottom: 4px; } + .login-desc { font-size: 16px; } + .msg-icon { position: relative; padding: 5px; top: 10px; border-radius: 50%; + &--hover { background-color: rgba(255, 255, 255, 0.2); } + .msg-badge { position: absolute; top: -2px; @@ -675,6 +655,7 @@ $border-color: #e5e5e5; opacity: 1; overflow: hidden; } + .chart-wrap[hidden] { opacity: 0; height: 0; @@ -695,6 +676,7 @@ $border-color: #e5e5e5; margin: 0 $spacing-lg $spacing-md; padding: $spacing-md; flex-shrink: 0; + .card-header { display: flex; justify-content: space-between; @@ -702,16 +684,19 @@ $border-color: #e5e5e5; font-size: 12px; color: $text-color-placeholder; margin-bottom: $spacing-md; + .date-picker-wrap { border-radius: 3px; transition: background-color 0.2s; position: relative; z-index: 999; + &:active { background-color: $bg-color; } } } + .chart-container { width: 100%; height: 150px; @@ -720,6 +705,7 @@ $border-color: #e5e5e5; justify-content: center; } } + .con-wrap { border-radius: 8px; background-color: #fff; @@ -758,6 +744,7 @@ $border-color: #e5e5e5; transition: all 0.2s ease; font-weight: 500; } + .tab-capsule.active { color: #d4af37; background: #fff8dc; @@ -775,7 +762,7 @@ $border-color: #e5e5e5; } .tip-top { - padding: 8px 0 0 70px; + padding: 8px 0 0 70px; flex-shrink: 0; } @@ -789,6 +776,7 @@ $border-color: #e5e5e5; .empty-box { padding: 60rpx 0; } + .sort-trigger { display: flex; align-items: center; @@ -801,36 +789,44 @@ $border-color: #e5e5e5; padding: $spacing-md; transition: background-color 0.2s; border-bottom: 1px solid $border-color; + &:last-child { border-bottom: none; } + &--hover { background-color: $bg-color; } + &__content { width: 100%; } + .name-fixed-wrap { display: flex; } + .task-item__name { width: 60px; } - .task-name-text { - flex: 1; - font-size: 14px; - color: $text-color; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; -} + + .task-name-text { + flex: 1; + font-size: 14px; + color: $text-color; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + } + &__name { font-size: 15px; color: $text-color; display: inline-block; } + &__footer { display: flex; align-items: flex-start; @@ -841,6 +837,7 @@ $border-color: #e5e5e5; align-items: center; } } + .loc-icon { width: 20px; height: 20px; @@ -849,4 +846,23 @@ $border-color: #e5e5e5; .urgency-tag { color: #7D7D7D; } + +.grid-item-icon-box { + display:flex; + flex-direction:column; + align-items:center; + padding:16rpx; +} +.grid-num-icon { + font-size:40rpx; + font-weight:600; + color:#333; + margin-top:8rpx; +} +.grid-label-icon { + font-size:22rpx; + color:#666; + margin-top:4rpx; +} + \ No newline at end of file diff --git a/uni_modules/uview-plus/components/u-cascader/u-cascader.vue b/uni_modules/uview-plus/components/u-cascader/u-cascader.vue index 02061a1..154f359 100644 --- a/uni_modules/uview-plus/components/u-cascader/u-cascader.vue +++ b/uni_modules/uview-plus/components/u-cascader/u-cascader.vue @@ -1,933 +1,360 @@ - + \ No newline at end of file -- libgit2 0.21.4