소스 검색

fix(inspection): 列表 label 改字 + 防折行 / 详情 taskId 改 string 防大数精度丢失

1. inspection/list/index.vue & qualityInspection/list/index.vue
   - '任务完成时间' -> '计划完成'
   - '实际打卡时间' -> '实际打卡'
   - info-label 宽度 168rpx -> 200rpx + white-space:nowrap
2. inspection/check/index.vue
   - taskId 类型 number -> string(雪花 ID 超过 2^53,Number() 会丢最后几位,导致详情查不到数据)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
yangjingjing 1 일 전
부모
커밋
2f9a7b7b36
3개의 변경된 파일13개의 추가작업 그리고 9개의 파일을 삭제
  1. 4 2
      src/pages/inspection/check/index.vue
  2. 4 3
      src/pages/inspection/list/index.vue
  3. 5 4
      src/pages/qualityInspection/list/index.vue

+ 4 - 2
src/pages/inspection/check/index.vue

@@ -116,7 +116,7 @@ import { request } from '@/utils/request'
 import { getToken } from '@/utils/auth'
 import { getCurrentLocation, ensureLocationAuth } from '@/utils/location'
 
-const taskId = ref<number>(0)
+const taskId = ref<string>('')
 const readonly = ref<boolean>(false)
 const task = ref<Partial<InspectionTask>>({})
 const items = ref<InspectionItem[]>([])
@@ -127,7 +127,8 @@ const pickedLocation = ref<string>('')
 const pickedCoord = ref<{ lng: number; lat: number } | null>(null)
 
 onLoad((q) => {
-  taskId.value = Number(q?.taskId || 0)
+  // 注意:taskId 是大数(雪花 ID),Number() 会丢精度,必须全程用 string
+  taskId.value = String(q?.taskId || '')
   readonly.value = q?.readonly === '1'
   // 扫码页会带 lng/lat 过来,作为初值(用户仍可在地图上重新选点)
   if (q?.lng && q?.lat) {
@@ -151,6 +152,7 @@ async function loadDetail() {
       task.value = data
       items.value = (data.items || []).map((it) => ({
         ...it,
+        needPhoto: it.needPhoto === '1' || it.needPhoto === true,
         result: undefined,
         reason: '',
         photos: []

+ 4 - 3
src/pages/inspection/list/index.vue

@@ -60,11 +60,11 @@
             <text class="info-value">{{ item.punchLocation }}</text>
           </view>
           <view class="info-row">
-            <text class="info-label">任务完成时间:</text>
+            <text class="info-label">计划完成:</text>
             <text class="info-value">{{ item.completeTime }}</text>
           </view>
           <view v-if="item.punchStatus === 'DONE' && item.actualPunchTime" class="info-row">
-            <text class="info-label">实际打卡时间:</text>
+            <text class="info-label">实际打卡:</text>
             <text class="info-value">{{ item.actualPunchTime }}</text>
           </view>
           <view v-if="item.punchStatus === 'DONE'" class="info-row">
@@ -324,7 +324,8 @@ function resultTagClass(r?: string | null) {
 .info-label {
   color: $text-secondary;
   flex-shrink: 0;
-  width: 168rpx;
+  width: 200rpx;
+  white-space: nowrap;
 }
 .info-value {
   color: $text-primary;

+ 5 - 4
src/pages/qualityInspection/list/index.vue

@@ -60,12 +60,12 @@
             <text class="info-value">{{ item.location || '-' }}</text>
           </view>
           <view class="info-row">
-            <text class="info-label">任务完成时间:</text>
+            <text class="info-label">计划完成:</text>
             <text class="info-value">{{ item.planEndTime || '-' }}</text>
           </view>
-          <!-- 实际打卡时间:仅已打卡状态显示 -->
+          <!-- 实际打卡:仅已打卡状态显示 -->
           <view v-if="item.punchStatus === 'DONE' && item.punchTime" class="info-row">
-            <text class="info-label">实际打卡时间:</text>
+            <text class="info-label">实际打卡:</text>
             <text class="info-value">{{ item.punchTime }}</text>
           </view>
           <!-- 打卡结果:仅已打卡状态显示 -->
@@ -333,7 +333,8 @@ function resultTagClass(r?: string | null) {
 .info-label {
   color: $text-secondary;
   flex-shrink: 0;
-  width: 168rpx;
+  width: 200rpx;
+  white-space: nowrap;
 }
 .info-value {
   color: $text-primary;