| | |
| | | label="执行任务人员" |
| | | :required="false" |
| | | :auto-add-current-user="true" |
| | | :current-user-removable="false" |
| | | :current-user-removable="true" |
| | | :branch-dept-ids="allOrganizationIds" |
| | | @change="onStaffChange" |
| | | /> |
| | |
| | | import { mapState } from 'vuex' |
| | | import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue' |
| | | import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue' |
| | | import { addTask } from "@/api/task" |
| | | import { addTask, checkTaskDuplicate } from "@/api/task" |
| | | import { listAvailableVehicles, getUserBoundVehicle } from "@/api/vehicle" |
| | | import { searchHospitals, searchHospitalsByDeptRegion } from "@/api/hospital" |
| | | import DepartureSelector from './components/DepartureSelector.vue' |
| | |
| | | return |
| | | } |
| | | |
| | | // 获取当前日期(格式YYYY-MM-DD) |
| | | const today = new Date() |
| | | const createDate = today.getFullYear() + '-' + |
| | | String(today.getMonth() + 1).padStart(2, '0') + '-' + |
| | | String(today.getDate()).padStart(2, '0') |
| | | const phone = this.taskForm.patient.phone |
| | | |
| | | // 先检查是否重复 |
| | | uni.showLoading({ |
| | | title: '检查中...' |
| | | }) |
| | | |
| | | checkTaskDuplicate(phone, createDate).then(response => { |
| | | uni.hideLoading() |
| | | |
| | | // 如果接口返回错误,说明存在重复 |
| | | if (response.code !== 200) { |
| | | this.$modal.showToast(response.msg || '该联系电话在当天已有任务,不能重复提交') |
| | | return |
| | | } |
| | | |
| | | // 检查通过,继续提交 |
| | | this.doSubmitTask() |
| | | }).catch(error => { |
| | | uni.hideLoading() |
| | | console.error('重复性检查失败:', error) |
| | | this.$modal.showToast('检查失败,请重试') |
| | | }) |
| | | }, |
| | | |
| | | // 执行实际的提交操作 |
| | | doSubmitTask() { |
| | | this.$modal.confirm('确定要保存任务吗?').then(() => { |
| | | this.loading = true |
| | | const submitData = this.buildSubmitData() |