From 8cb5d3440208a3be3e772e65f1bd0ec63031ba62 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期三, 17 十二月 2025 08:37:14 +0800
Subject: [PATCH] feat: 增加服务单派发通知
---
app/pagesTask/edit.vue | 53 ++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 36 insertions(+), 17 deletions(-)
diff --git a/app/pagesTask/edit.vue b/app/pagesTask/edit.vue
index 0404fc5..ee17c8b 100644
--- a/app/pagesTask/edit.vue
+++ b/app/pagesTask/edit.vue
@@ -150,6 +150,13 @@
taskId: null,
taskDetail: null,
mapSelectorType: '',
+ // 鎵╁睍 addressCoordinates 鏀寔澶氱閿悕
+ addressCoordinates: {
+ start: null,
+ end: null,
+ startLocation: null,
+ endLocation: null
+ },
taskForm: {
taskDescription: '',
taskType: '',
@@ -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,10 +277,14 @@
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涓殑璺濈璁$畻瀹屾垚浜嬩欢
@@ -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,
+
+ // 璺濈锛堜富浠诲姟瀛楁锛�
+ distance: this.taskForm.distance ? parseFloat(this.taskForm.distance) : 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