From ae478a3d5dab28dd598d39f27429e4a544b15ad2 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期四, 25 十二月 2025 22:48:06 +0800
Subject: [PATCH] feat:已完成时,检查附件是否上传
---
app/pagesTask/edit.vue | 61 ++++++++++++++++++++----------
1 files changed, 40 insertions(+), 21 deletions(-)
diff --git a/app/pagesTask/edit.vue b/app/pagesTask/edit.vue
index 0404fc5..0be25aa 100644
--- a/app/pagesTask/edit.vue
+++ b/app/pagesTask/edit.vue
@@ -53,7 +53,7 @@
class="form-input"
type="digit"
placeholder="璇疯緭鍏ヨ椹跺叕閲屾暟"
- v-model="taskForm.distance"
+ v-model="taskForm.transferDistance"
/>
</view>
@@ -150,6 +150,13 @@
taskId: null,
taskDetail: null,
mapSelectorType: '',
+ // 鎵╁睍 addressCoordinates 鏀寔澶氱閿悕
+ addressCoordinates: {
+ start: null,
+ end: null,
+ startLocation: null,
+ endLocation: null
+ },
taskForm: {
taskDescription: '',
taskType: '',
@@ -158,7 +165,7 @@
plannedEndTime: '',
startLocation: '',
endLocation: '',
- distance: '',
+ transferDistance: '',
remark: ''
},
loading: false
@@ -202,7 +209,7 @@
this.taskForm.plannedEndTime = this.taskDetail.plannedEndTime || ''
this.taskForm.startLocation = this.taskDetail.departureAddress || ''
this.taskForm.endLocation = this.taskDetail.destinationAddress || ''
- this.taskForm.distance = this.taskDetail.estimatedDistance || ''
+ this.taskForm.transferDistance = this.taskDetail.transferDistance || ''
this.taskForm.remark = this.taskDetail.remark || ''
// 璁剧疆杞﹁締淇℃伅
@@ -213,16 +220,22 @@
// 璁剧疆鍦板潃鍧愭爣锛堜娇鐢╩ixin涓殑鏂规硶锛�
if (this.taskDetail.departureLongitude && this.taskDetail.departureLatitude) {
- this.setStartLocation({
+ const startLocation = {
lng: this.taskDetail.departureLongitude,
lat: this.taskDetail.departureLatitude
- })
+ }
+ this.setStartLocation(startLocation)
+ // 鍚屾椂淇濆瓨鍒� startLocation 閿�
+ this.addressCoordinates.startLocation = startLocation
}
if (this.taskDetail.destinationLongitude && this.taskDetail.destinationLatitude) {
- this.setEndLocation({
+ const endLocation = {
lng: this.taskDetail.destinationLongitude,
lat: this.taskDetail.destinationLatitude
- })
+ }
+ this.setEndLocation(endLocation)
+ // 鍚屾椂淇濆瓨鍒� endLocation 閿�
+ this.addressCoordinates.endLocation = endLocation
}
}).catch(error => {
console.error('鍔犺浇浠诲姟璇︽儏澶辫触:', error)
@@ -264,15 +277,19 @@
if (this.mapSelectorType === 'startLocation') {
this.taskForm.startLocation = formattedAddress
- this.setLocationByAddress('start', address)
+ const location = this.setLocationByAddress('start', address)
+ // 鍚屾椂淇濆瓨鍒� startLocation 閿�
+ this.addressCoordinates.startLocation = location
} else if (this.mapSelectorType === 'endLocation') {
this.taskForm.endLocation = formattedAddress
- this.setLocationByAddress('end', address)
+ const location = this.setLocationByAddress('end', address)
+ // 鍚屾椂淇濆瓨鍒� endLocation 閿�
+ this.addressCoordinates.endLocation = location
}
// 鐩戝惉mixin涓殑璺濈璁$畻瀹屾垚浜嬩欢
this.$once('distance-calculated', (distance) => {
- this.taskForm.distance = this.formatDistance(distance)
+ this.taskForm.transferDistance = this.formatDistance(distance)
})
this.closeMapSelector()
@@ -323,6 +340,7 @@
},
buildSubmitData() {
+ // 鏋勫缓鎻愪氦鏁版嵁 - 浣跨敤涓� TaskCreateVO 涓�鑷寸殑缁撴瀯
const submitData = {
taskId: this.taskId,
taskDescription: this.taskForm.taskDescription,
@@ -330,20 +348,21 @@
vehicleIds: this.taskForm.vehicleId ? [this.taskForm.vehicleId] : [],
plannedStartTime: this.taskForm.plannedStartTime,
plannedEndTime: this.taskForm.plannedEndTime,
+
+ // 鍑哄彂鍦板湴鍧�鍜屽潗鏍�
departureAddress: this.taskForm.startLocation,
+ departureLongitude: this.addressCoordinates.startLocation ? this.addressCoordinates.startLocation.lng : null,
+ departureLatitude: this.addressCoordinates.startLocation ? this.addressCoordinates.startLocation.lat : null,
+
+ // 鐩爣鍦板湴鍧�鍜屽潗鏍�
destinationAddress: this.taskForm.endLocation,
- estimatedDistance: this.taskForm.distance ? parseFloat(this.taskForm.distance) : null,
+ destinationLongitude: this.addressCoordinates.endLocation ? this.addressCoordinates.endLocation.lng : null,
+ destinationLatitude: this.addressCoordinates.endLocation ? this.addressCoordinates.endLocation.lat : null,
+
+ // 璺濈锛堜富浠诲姟瀛楁锛�
+ transferDistance: this.taskForm.transferDistance ? parseFloat(this.taskForm.transferDistance) : null,
+
remark: this.taskForm.remark
- }
-
- if (this.addressCoordinates.startLocation) {
- submitData.departureLongitude = this.addressCoordinates.startLocation.lng
- submitData.departureLatitude = this.addressCoordinates.startLocation.lat
- }
-
- if (this.addressCoordinates.endLocation) {
- submitData.destinationLongitude = this.addressCoordinates.endLocation.lng
- submitData.destinationLatitude = this.addressCoordinates.endLocation.lat
}
return submitData
--
Gitblit v1.9.1