|
@@ -3,26 +3,6 @@
|
|
|
<TopBar title="每日检查" show-back />
|
|
<TopBar title="每日检查" show-back />
|
|
|
|
|
|
|
|
<view class="px-4 pt-3">
|
|
<view class="px-4 pt-3">
|
|
|
- <!-- 今日任务概览 -->
|
|
|
|
|
- <view class="glass-card p-4">
|
|
|
|
|
- <view class="section-head-inner mb-3">
|
|
|
|
|
- <view class="section-bar mr-2"></view>
|
|
|
|
|
- <text class="section-title">今日概览</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="grid grid-cols-2 gap-3">
|
|
|
|
|
- <view class="stat-card">
|
|
|
|
|
- <view class="stat-bar"></view>
|
|
|
|
|
- <text class="stat-value">{{ todayTasks.length }}</text>
|
|
|
|
|
- <text class="stat-label">今日任务</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="stat-card">
|
|
|
|
|
- <view class="stat-bar"></view>
|
|
|
|
|
- <text class="stat-value">{{ completedTasks }}</text>
|
|
|
|
|
- <text class="stat-label">已完成</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
<!-- 今日排班 -->
|
|
<!-- 今日排班 -->
|
|
|
<view v-if="schedule" class="glass-card p-4">
|
|
<view v-if="schedule" class="glass-card p-4">
|
|
|
<view class="section-head-inner mb-3">
|
|
<view class="section-head-inner mb-3">
|
|
@@ -31,7 +11,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
|
<text class="info-label">班组</text>
|
|
<text class="info-label">班组</text>
|
|
|
- <text class="info-value">{{ schedule.teamName || '-' }}</text>
|
|
|
|
|
|
|
+ <text class="info-value">{{ displayTeamName }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
|
<text class="info-label">班次</text>
|
|
<text class="info-label">班次</text>
|
|
@@ -163,47 +143,12 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
- <!-- 今日任务列表 -->
|
|
|
|
|
- <view class="glass-card">
|
|
|
|
|
- <view class="section-head">
|
|
|
|
|
- <view class="section-bar mr-2"></view>
|
|
|
|
|
- <text class="section-title flex-1">今日任务列表</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view v-if="taskStore.loading" class="py-10 text-center">
|
|
|
|
|
- <text class="empty-text">加载中...</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view v-else-if="todayTasks.length === 0" class="pb-3">
|
|
|
|
|
- <EmptyState message="今日无任务" />
|
|
|
|
|
- </view>
|
|
|
|
|
- <view v-else>
|
|
|
|
|
- <view
|
|
|
|
|
- v-for="task in todayTasks"
|
|
|
|
|
- :key="task.taskId || task.id"
|
|
|
|
|
- class="list-row"
|
|
|
|
|
- hover-class="row-hover"
|
|
|
|
|
- :hover-start-time="0"
|
|
|
|
|
- :hover-stay-time="120"
|
|
|
|
|
- @click="goToDetail(task.taskId || task.id)"
|
|
|
|
|
- >
|
|
|
|
|
- <view class="icon-chip mr-3">
|
|
|
|
|
- <text class="uni-icons uniui-flag chip-glyph"></text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-1 min-w-0 mr-2">
|
|
|
|
|
- <text class="row-title truncate">{{ task.taskName || task.projectName }}</text>
|
|
|
|
|
- <text class="row-sub truncate">{{ task.address || '暂无地址' }}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <StatusTag :status="task.status" />
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { ref, computed, onMounted } from 'vue'
|
|
import { ref, computed, onMounted } from 'vue'
|
|
|
-import { useTaskStore } from '../../stores/task'
|
|
|
|
|
import { useAuthStore } from '../../stores/auth'
|
|
import { useAuthStore } from '../../stores/auth'
|
|
|
import { chooseMediaCompat } from '../../utils'
|
|
import { chooseMediaCompat } from '../../utils'
|
|
|
import {
|
|
import {
|
|
@@ -215,10 +160,7 @@ import {
|
|
|
} from '../../api/dailyCheck'
|
|
} from '../../api/dailyCheck'
|
|
|
import { uploadFile } from '../../api/file'
|
|
import { uploadFile } from '../../api/file'
|
|
|
import TopBar from '../../components/common/TopBar.vue'
|
|
import TopBar from '../../components/common/TopBar.vue'
|
|
|
-import StatusTag from '../../components/common/StatusTag.vue'
|
|
|
|
|
-import EmptyState from '../../components/common/EmptyState.vue'
|
|
|
|
|
|
|
|
|
|
-const taskStore = useTaskStore()
|
|
|
|
|
const authStore = useAuthStore()
|
|
const authStore = useAuthStore()
|
|
|
|
|
|
|
|
const today = new Date().toISOString().split('T')[0]
|
|
const today = new Date().toISOString().split('T')[0]
|
|
@@ -269,18 +211,12 @@ const vehiclePlateNos = computed(() => {
|
|
|
return vehicles.value.map((v) => v.plateNo).filter(Boolean).join('、')
|
|
return vehicles.value.map((v) => v.plateNo).filter(Boolean).join('、')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const canSubmit = computed(() => {
|
|
|
|
|
- return !!(selectedCheckDate.value && selectedVehicle.value)
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-const completedTasks = computed(() => {
|
|
|
|
|
- return todayTasks.value.filter((t) => t.status === 'completed').length
|
|
|
|
|
|
|
+const displayTeamName = computed(() => {
|
|
|
|
|
+ return schedule.value?.scheduleName || schedule.value?.teamName || '-'
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const todayTasks = computed<any[]>(() => {
|
|
|
|
|
- return taskStore.tasks.filter(
|
|
|
|
|
- (t: any) => t.planDate === today || t.scheduleDate === today || t.serviceDate === today
|
|
|
|
|
- )
|
|
|
|
|
|
|
+const canSubmit = computed(() => {
|
|
|
|
|
+ return !!(selectedCheckDate.value && selectedVehicle.value)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const mediaSummary = computed(() => {
|
|
const mediaSummary = computed(() => {
|
|
@@ -465,11 +401,6 @@ function handleReset() {
|
|
|
selectedVehicleIndex.value = 0
|
|
selectedVehicleIndex.value = 0
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function goToDetail(taskId: string | number) {
|
|
|
|
|
- if (!taskId) return
|
|
|
|
|
- uni.navigateTo({ url: `/subPackages/pages-construction/taskDetail?id=${taskId}` })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
const savedRemark = uni.getStorageSync(remarkKey)
|
|
const savedRemark = uni.getStorageSync(remarkKey)
|
|
|
if (savedRemark) {
|
|
if (savedRemark) {
|
|
@@ -478,7 +409,6 @@ onMounted(() => {
|
|
|
|
|
|
|
|
loadSchedule()
|
|
loadSchedule()
|
|
|
loadTodayRecord()
|
|
loadTodayRecord()
|
|
|
- taskStore.fetchMyTasks(today)
|
|
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
@@ -503,12 +433,6 @@ onMounted(() => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* 区块标题 */
|
|
/* 区块标题 */
|
|
|
-.section-head {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- padding: 16px 16px 12px;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
.section-head-inner {
|
|
.section-head-inner {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
@@ -527,45 +451,6 @@ onMounted(() => {
|
|
|
color: #1f2937;
|
|
color: #1f2937;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 统计卡 */
|
|
|
|
|
-.stat-card {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- min-height: 88px;
|
|
|
|
|
- padding: 14px 6px 12px;
|
|
|
|
|
- border-radius: 16px;
|
|
|
|
|
- background-color: rgba(164, 216, 152, 0.14);
|
|
|
|
|
- border: 1px solid rgba(164, 216, 152, 0.3);
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.stat-bar {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- top: 0;
|
|
|
|
|
- left: 50%;
|
|
|
|
|
- transform: translateX(-50%);
|
|
|
|
|
- width: 26px;
|
|
|
|
|
- height: 3px;
|
|
|
|
|
- border-radius: 0 0 3px 3px;
|
|
|
|
|
- background: linear-gradient(135deg, #368f6f 0%, #5ab8d0 100%);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.stat-value {
|
|
|
|
|
- font-size: 24px;
|
|
|
|
|
- font-weight: 800;
|
|
|
|
|
- line-height: 1.1;
|
|
|
|
|
- color: #368f6f;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.stat-label {
|
|
|
|
|
- margin-top: 6px;
|
|
|
|
|
- font-size: 12px;
|
|
|
|
|
- color: #6b7280;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
/* 排班信息 */
|
|
/* 排班信息 */
|
|
|
.info-row {
|
|
.info-row {
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -834,48 +719,6 @@ onMounted(() => {
|
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 列表行 */
|
|
|
|
|
-.list-row {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- padding: 13px 16px;
|
|
|
|
|
- border-top: 1px solid rgba(164, 216, 152, 0.18);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.row-title {
|
|
|
|
|
- display: block;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- color: #1f2937;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.row-sub {
|
|
|
|
|
- display: block;
|
|
|
|
|
- margin-top: 3px;
|
|
|
|
|
- font-size: 12px;
|
|
|
|
|
- color: #9ca3af;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.row-hover {
|
|
|
|
|
- background-color: rgba(164, 216, 152, 0.3);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.icon-chip {
|
|
|
|
|
- width: 42px;
|
|
|
|
|
- height: 42px;
|
|
|
|
|
- border-radius: 12px;
|
|
|
|
|
- flex-shrink: 0;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- background-color: rgba(164, 216, 152, 0.2);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.chip-glyph {
|
|
|
|
|
- font-size: 20px;
|
|
|
|
|
- color: #368f6f;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
.empty-text {
|
|
.empty-text {
|
|
|
font-size: 13px;
|
|
font-size: 13px;
|
|
|
color: #9ca3af;
|
|
color: #9ca3af;
|