| | |
| | | </view> |
| | | <view class="form-item"> |
| | | <OrganizationSelector |
| | | ref="organizationSelector" |
| | | v-model="selectedOrganizationId" |
| | | :required="true" |
| | | :auto-select-user-dept="true" |
| | |
| | | :required="false" |
| | | :auto-add-current-user="true" |
| | | :current-user-removable="false" |
| | | :branch-dept-ids="allOrganizationIds" |
| | | @change="onStaffChange" |
| | | /> |
| | | |
| | |
| | | return { |
| | | selectedVehicle: '', |
| | | selectedVehicleId: null, |
| | | selectedOrganizationId: null, // 归属机构ID(部门ID) |
| | | selectedOrganizationId: null, // 当前选中的归属机构ID |
| | | allOrganizationIds: [], // 所有可选机构ID数组 |
| | | selectedOrganizationServiceOrderClass: '', // 归属机构的服务单编码 |
| | | selectedRegion: '', // 从归属机构中提取的地域信息(如:广州、深圳等) |
| | | departureAddress: '', // 出发地地址 |
| | |
| | | this.loadEmergencyTaskTypes() |
| | | // 加载单据类型数据 |
| | | this.loadDocumentTypes() |
| | | // 加载所有机构ID |
| | | this.loadAllOrganizationIds() |
| | | }, |
| | | methods: { |
| | | // 获取用户绑定的车辆信息 |
| | |
| | | return region.replace(/(分公司|总公司|总部)$/g, '').trim(); |
| | | }, |
| | | |
| | | // 加载所有机构ID |
| | | loadAllOrganizationIds() { |
| | | // 通过 OrganizationSelector 组件获取所有机构 |
| | | const orgSelector = this.$refs.organizationSelector |
| | | if (orgSelector) { |
| | | orgSelector.reload().then(organizations => { |
| | | this.allOrganizationIds = organizations.map(org => org.deptId) |
| | | console.log('所有机构ID:', this.allOrganizationIds) |
| | | }) |
| | | } else { |
| | | // 如果组件还未挂载,稍后重试 |
| | | setTimeout(() => { |
| | | this.loadAllOrganizationIds() |
| | | }, 100) |
| | | } |
| | | }, |
| | | |
| | | // 加载科室数据(从 SQL Server 动态加载) |
| | | loadDepartments() { |
| | | getHospitalDepartments().then(response => { |