wlzboy
2025-12-26 c10b1e130ccbc94e6481a43e8e2d35cfc8fcf83b
app/pagesTask/create-emergency.vue
@@ -567,11 +567,7 @@
      console.log('转出医院变化:', hospitalData)
      // 组件已经通过 v-model 更新了 taskForm.hospitalOut
      
      // 如果选择的是"家中",自动设置科室为"其它"
      if (hospitalData.name === '家中') {
        this.taskForm.hospitalOut.department = '其它'
        this.taskForm.hospitalOut.departmentId = null
      }
      // 科室的设置由 DepartmentSelector 组件自动处理(通过 isHome 属性)
      
      // 如果转入地址已填写,自动计算距离
      if (this.taskForm.hospitalIn.address) {
@@ -597,11 +593,7 @@
      console.log('转入医院变化:', hospitalData)
      // 组件已经通过 v-model 更新了 taskForm.hospitalIn
      
      // 如果选择的是"家中",自动设置科室为"其它"
      if (hospitalData.name === '家中') {
        this.taskForm.hospitalIn.department = '其它'
        this.taskForm.hospitalIn.departmentId = null
      }
      // 科室的设置由 DepartmentSelector 组件自动处理(通过 isHome 属性)
      
      // 如果转出地址已填写,自动计算距离
      if (this.taskForm.hospitalOut.address) {
@@ -813,6 +805,18 @@
        return false
      }
      
      // 如果转入医院是“家中”,必须填写地址
      if (this.taskForm.hospitalIn.name === '家中' && !this.taskForm.hospitalIn.address) {
        this.$modal.showToast('请输入转入地址(家中)')
        return false
      }
      // 如果转出医院是“家中”,必须填写地址
      if (this.taskForm.hospitalOut.name === '家中' && !this.taskForm.hospitalOut.address) {
        this.$modal.showToast('请输入转出地址(家中)')
        return false
      }
      if (!this.taskForm.transferDistance) {
        this.$modal.showToast('请输入转运公里数')
        return false
@@ -847,6 +851,10 @@
        }
      }
      
      // 调试日志:检查转入医院地址
      console.log('构建提交数据 - 转入医院:', this.taskForm.hospitalIn.name)
      console.log('构建提交数据 - 转入医院地址:', this.taskForm.hospitalIn.address)
      const submitData = {
        taskType: 'EMERGENCY_TRANSFER',
        deptId: this.selectedOrganizationId, // 归属机构ID(部门ID)