|
|
@@ -125,11 +125,14 @@ const showSuccess = ref(false)
|
|
|
const pickedLocation = ref<string>('')
|
|
|
// 用户选位置时取到的坐标(覆盖 GPS 自动获取)
|
|
|
const pickedCoord = ref<{ lng: number; lat: number } | null>(null)
|
|
|
+// 每日多时段任务的当前时间段(从列表或扫码页 URL 传入)
|
|
|
+const slot = ref<string>('')
|
|
|
|
|
|
onLoad((q) => {
|
|
|
// 注意:taskId 是大数(雪花 ID),Number() 会丢精度,必须全程用 string
|
|
|
taskId.value = String(q?.taskId || '')
|
|
|
readonly.value = q?.readonly === '1'
|
|
|
+ slot.value = String(q?.slot || '')
|
|
|
// 扫码页会带 lng/lat 过来,作为初值(用户仍可在地图上重新选点)
|
|
|
if (q?.lng && q?.lat) {
|
|
|
pickedCoord.value = {
|
|
|
@@ -147,7 +150,8 @@ onShow(() => {
|
|
|
async function loadDetail() {
|
|
|
try {
|
|
|
// 走统一 request 后:已自动剥外层 R<T>,data 即 InspectionTask
|
|
|
- const data = (await getInspectionTaskDetail(taskId.value)) as InspectionTask
|
|
|
+ // 每日多时段任务: 传 slot 让后端按 (taskId, slot) 查 record 状态
|
|
|
+ const data = (await getInspectionTaskDetail(taskId.value, slot.value || undefined)) as InspectionTask
|
|
|
if (data) {
|
|
|
// 详情接口字段是 location(后端 VO),模板用的是 punchLocation(列表接口 mapRow 映射后的字段名)
|
|
|
// 这里补一次映射,让已打卡任务的预设位置能在 readonly 模式下显示
|
|
|
@@ -371,6 +375,8 @@ async function onSubmit() {
|
|
|
lng,
|
|
|
lat,
|
|
|
punchType: (task.value.punchType as any) || 'NORMAL',
|
|
|
+ // 每日多时段任务:把当前 slot 传给后端,record 按 (taskId, slot) 独立存储
|
|
|
+ slot: slot.value || undefined,
|
|
|
photos: allPhotoUrls || undefined,
|
|
|
items: items.value.map((it) => ({
|
|
|
itemId: it.id,
|