| | |
| | | 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) { |
| | |
| | | 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) { |
| | |
| | | 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 |
| | |
| | | conditionText = this.taskForm.patient.condition |
| | | } |
| | | } |
| | | |
| | | // 调试日志:检查转入医院地址 |
| | | console.log('构建提交数据 - 转入医院:', this.taskForm.hospitalIn.name) |
| | | console.log('构建提交数据 - 转入医院地址:', this.taskForm.hospitalIn.address) |
| | | |
| | | const submitData = { |
| | | taskType: 'EMERGENCY_TRANSFER', |
| | |
| | | if (!this.validateForm()) { |
| | | return |
| | | } |
| | | |
| | | // 获取当前日期(格式YYYY-MM-DD) |
| | | this.doSubmitTask(); |
| | | |
| | | }, |
| | | checkTaskDp(){ |
| | | // 获取当前日期(格式YYYY-MM-DD) |
| | | const today = new Date() |
| | | const createDate = today.getFullYear() + '-' + |
| | | String(today.getMonth() + 1).padStart(2, '0') + '-' + |
| | |
| | | this.$modal.showToast('检查失败,请重试') |
| | | }) |
| | | }, |
| | | |
| | | // 执行实际的提交操作 |
| | | doSubmitTask() { |
| | | this.$modal.confirm('确定要保存任务吗?').then(() => { |