From af8cab142a6b15c06e131a8474574dd5b00df982 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期四, 04 十二月 2025 22:09:58 +0800
Subject: [PATCH] feat: 改造微信accesstoken存放在系统配置表中
---
app/pagesTask/edit-emergency.vue | 66 +++++++++++++++++++++++++++------
1 files changed, 54 insertions(+), 12 deletions(-)
diff --git a/app/pagesTask/edit-emergency.vue b/app/pagesTask/edit-emergency.vue
index 67c10f4..eefd5df 100644
--- a/app/pagesTask/edit-emergency.vue
+++ b/app/pagesTask/edit-emergency.vue
@@ -19,7 +19,8 @@
/>
<view class="form-item">
- <OrganizationSelector
+ <OrganizationSelector
+ ref="organizationSelector"
v-model="selectedOrganizationId"
:required="true"
:auto-select-user-dept="false"
@@ -53,6 +54,7 @@
:required="false"
:auto-add-current-user="false"
:current-user-removable="true"
+ :branch-dept-ids="allOrganizationIds"
@change="onStaffChange"
/>
@@ -224,6 +226,7 @@
taskDetail: null,
selectedVehicleId: null,
selectedOrganizationId: null,
+ allOrganizationIds: [], // 鎵�鏈夊彲閫夋満鏋処D鏁扮粍
selectedRegion: '',
mapSelectorType: '',
// 鎵╁睍 addressCoordinates 鏀寔澶氱閿悕
@@ -292,6 +295,11 @@
}, 1500)
}
},
+
+ mounted() {
+ // 椤甸潰鎸傝浇鍚庡姞杞芥墍鏈夋満鏋処D
+ this.loadAllOrganizationIds()
+ },
methods: {
// 鍔犺浇浠诲姟璇︽儏
loadTaskDetail() {
@@ -320,8 +328,9 @@
const info = this.taskDetail.emergencyInfo
console.log('杞繍浠诲姟淇℃伅:', info)
- // 杞繍鏃堕棿
- this.taskForm.transferTime = this.taskDetail.plannedStartTime || ''
+ // 杞繍鏃堕棿锛堜慨澶嶏細1900骞寸殑鏃ユ湡鏄剧ず涓虹┖锛�
+ const transferTime = this.taskDetail.plannedStartTime || ''
+ this.taskForm.transferTime = transferTime && transferTime.startsWith('1900') ? '' : transferTime
// 鎮h�呬俊鎭�
this.taskForm.patient.contact = info.patientContact || ''
@@ -338,8 +347,10 @@
this.taskForm.hospitalOut.id = info.hospitalOutId || null
this.taskForm.hospitalOut.name = info.hospitalOutName || ''
this.taskForm.hospitalOut.department = info.hospitalOutDepartment || ''
+ this.taskForm.hospitalOut.departmentId = info.hospitalOutDepartmentId || null
this.taskForm.hospitalOut.bedNumber = info.hospitalOutBedNumber || ''
this.taskForm.hospitalOut.address = info.hospitalOutAddress || ''
+ console.log('杞嚭鍖婚櫌绉戝ID:', info.hospitalOutDepartmentId)
// 鍔犺浇杞嚭鍖婚櫌GPS鍧愭爣锛堜笉鏄剧ず锛屼絾淇濆瓨鍦ㄦ暟鎹腑锛�
if (info.hospitalOutLongitude && info.hospitalOutLatitude) {
@@ -354,8 +365,10 @@
this.taskForm.hospitalIn.id = info.hospitalInId || null
this.taskForm.hospitalIn.name = info.hospitalInName || ''
this.taskForm.hospitalIn.department = info.hospitalInDepartment || ''
+ this.taskForm.hospitalIn.departmentId = info.hospitalInDepartmentId || null
this.taskForm.hospitalIn.bedNumber = info.hospitalInBedNumber || ''
this.taskForm.hospitalIn.address = info.hospitalInAddress || ''
+ console.log('杞叆鍖婚櫌绉戝ID:', info.hospitalInDepartmentId)
// 鍔犺浇杞叆鍖婚櫌GPS鍧愭爣锛堜笉鏄剧ず锛屼絾淇濆瓨鍦ㄦ暟鎹腑锛�
if (info.hospitalInLongitude && info.hospitalInLatitude) {
@@ -372,7 +385,8 @@
} else {
console.warn('浠诲姟璇︽儏涓病鏈塭mergencyInfo瀛楁锛屽皾璇曚粠涓诲璞¤幏鍙栨暟鎹�')
// 鍏煎澶勭悊锛氬鏋渆mergencyInfo涓嶅瓨鍦紝灏濊瘯浠庝富瀵硅薄鑾峰彇
- this.taskForm.transferTime = this.taskDetail.plannedStartTime || ''
+ const transferTime = this.taskDetail.plannedStartTime || ''
+ this.taskForm.transferTime = transferTime && transferTime.startsWith('1900') ? '' : transferTime
this.taskForm.transferDistance = this.taskDetail.estimatedDistance ? String(this.taskDetail.estimatedDistance) : ''
}
@@ -417,16 +431,24 @@
console.log('璁剧疆鐩爣鍦板潗鏍�:', this.taskDetail.destinationLongitude, this.taskDetail.destinationLatitude)
}
- // 璁剧疆鎵ц浜哄憳锛堜慨澶嶏細纭繚 assignees 涓嶄负 null锛�
+ // 璁剧疆鎵ц浜哄憳锛堜慨澶嶏細纭繚 assignees 涓嶄负 null锛屽苟姝g‘鏄犲皠瀛楁锛�
if (this.taskDetail.assignees && Array.isArray(this.taskDetail.assignees) && this.taskDetail.assignees.length > 0) {
console.log('鍘熷鎵ц浜哄憳鏁版嵁:', this.taskDetail.assignees)
- this.selectedStaff = this.taskDetail.assignees.map(assignee => ({
- userId: assignee.userId,
- nickName: assignee.userName,
- type: assignee.userType || 'driver',
- phonenumber: '',
- deptName: ''
- }))
+ this.selectedStaff = this.taskDetail.assignees.map(assignee => {
+ console.log('澶勭悊鎵ц浜哄憳:', assignee)
+ console.log(' - userName:', assignee.userName)
+ console.log(' - nickName:', assignee.nickName)
+ console.log(' - phonenumber:', assignee.phonenumber)
+ console.log(' - phone:', assignee.phone)
+
+ return {
+ userId: assignee.userId,
+ nickName: assignee.userName || assignee.nickName || '',
+ type: assignee.userType || 'driver',
+ phonenumber: assignee.phonenumber || assignee.phone || '',
+ deptName: assignee.deptName || ''
+ }
+ })
console.log('澶勭悊鍚庣殑鎵ц浜哄憳鍒楄〃:', this.selectedStaff)
} else {
console.warn('浠诲姟娌℃湁鍒嗛厤鎵ц浜哄憳鎴朼ssignees涓虹┖')
@@ -449,6 +471,23 @@
// 杞﹁締閫夋嫨鍙樺寲
onVehicleChange(vehicle) {
console.log('閫変腑杞﹁締:', vehicle)
+ },
+
+ // 鍔犺浇鎵�鏈夋満鏋処D
+ loadAllOrganizationIds() {
+ // 閫氳繃 OrganizationSelector 缁勪欢鑾峰彇鎵�鏈夋満鏋�
+ const orgSelector = this.$refs.organizationSelector
+ if (orgSelector) {
+ orgSelector.reload().then(organizations => {
+ this.allOrganizationIds = organizations.map(org => org.deptId)
+ console.log('鎵�鏈夋満鏋処D:', this.allOrganizationIds)
+ })
+ } else {
+ // 濡傛灉缁勪欢杩樻湭鎸傝浇,绋嶅悗閲嶈瘯
+ setTimeout(() => {
+ this.loadAllOrganizationIds()
+ }, 100)
+ }
},
// 褰掑睘鏈烘瀯閫夋嫨鍙樺寲
@@ -854,6 +893,9 @@
this.loading = true
const submitData = this.buildSubmitData()
+ console.log('鎻愪氦鏁版嵁 - 杞嚭鍖婚櫌绉戝ID:', submitData.hospitalOut.departmentId)
+ console.log('鎻愪氦鏁版嵁 - 杞叆鍖婚櫌绉戝ID:', submitData.hospitalIn.departmentId)
+
updateTask(submitData).then(response => {
this.loading = false
console.log('浠诲姟鏇存柊鍝嶅簲:', response)
--
Gitblit v1.9.1