wlzboy
2026-03-31 61c4c3f45e4257e2e7662f033e2719e62366c632
app/pagesTask/create-normal.vue
@@ -91,7 +91,7 @@
          class="form-input" 
          type="digit" 
          placeholder="请输入行驶公里数" 
          v-model="taskForm.distance"
          v-model="taskForm.transferDistance"
        />
      </view>
      
@@ -186,7 +186,7 @@
        plannedEndTime: '',
        startLocation: '',
        endLocation: '',
        distance: '',
        transferDistance: '',
        remark: ''
      },
      vehicles: [],
@@ -497,7 +497,7 @@
          // 百度地图返回的距离单位是米,需要转换为公里
          const distanceInMeters = response.data.distance
          const distanceInKm = distanceInMeters / 1000
          this.taskForm.distance = distanceInKm.toFixed(2)
          this.taskForm.transferDistance = distanceInKm.toFixed(2)
          
          console.log('距离计算成功:', distanceInMeters, '米 =', distanceInKm, '公里')
          
@@ -576,7 +576,7 @@
        plannedEndTime: this.taskForm.plannedEndTime,
        departureAddress: this.taskForm.startLocation,
        destinationAddress: this.taskForm.endLocation,
        estimatedDistance: this.taskForm.distance ? parseFloat(this.taskForm.distance) : null,
        transferDistance: this.taskForm.transferDistance ? parseFloat(this.taskForm.transferDistance) : null,
        remark: this.taskForm.remark
      }