| | |
| | | </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: { |
| | | // 获取用户绑定的车辆信息 |
| | |
| | | replaceRegion(region){ |
| | | 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() { |
| | |
| | | color: #999; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 人员选择弹窗样式 |
| | | .staff-selector-popup { |
| | | background-color: white; |
| | | border-radius: 20rpx 20rpx 0 0; |
| | | max-height: 80vh; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .popup-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 30rpx; |
| | | border-bottom: 1rpx solid #f0f0f0; |
| | | flex-shrink: 0; |
| | | |
| | | .popup-title { |
| | | font-size: 32rpx; |
| | | font-weight: bold; |
| | | color: #333; |
| | | } |
| | | |
| | | .popup-close { |
| | | padding: 10rpx; |
| | | } |
| | | } |
| | | |
| | | .search-box { |
| | | display: flex; |
| | | align-items: center; |
| | | margin: 20rpx 30rpx; |
| | | padding: 15rpx 20rpx; |
| | | background-color: #f5f5f5; |
| | | border-radius: 10rpx; |
| | | flex-shrink: 0; |
| | | |
| | | .search-input { |
| | | flex: 1; |
| | | margin-left: 10rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | } |
| | | |
| | | .staff-filter { |
| | | display: flex; |
| | | padding: 0 30rpx 20rpx; |
| | | gap: 20rpx; |
| | | flex-shrink: 0; |
| | | |
| | | .filter-item { |
| | | flex: 1; |
| | | text-align: center; |
| | | padding: 15rpx 0; |
| | | background-color: #f5f5f5; |
| | | border-radius: 10rpx; |
| | | font-size: 28rpx; |
| | | color: #666; |
| | | |
| | | &.active { |
| | | background-color: #007AFF; |
| | | color: white; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .staff-list-popup { |
| | | flex: 1; |
| | | overflow-y: auto; |
| | | padding: 0 30rpx; |
| | | |
| | | .staff-item-popup { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 25rpx 20rpx; |
| | | border-bottom: 1rpx solid #f0f0f0; |
| | | |
| | | &:active { |
| | | background-color: #f5f5f5; |
| | | } |
| | | |
| | | .staff-info { |
| | | flex: 1; |
| | | |
| | | .staff-name-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 10rpx; |
| | | |
| | | .staff-name { |
| | | font-size: 30rpx; |
| | | font-weight: bold; |
| | | color: #333; |
| | | margin-right: 20rpx; |
| | | } |
| | | |
| | | .staff-phone { |
| | | font-size: 24rpx; |
| | | color: #999; |
| | | } |
| | | } |
| | | |
| | | .staff-detail-row { |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .staff-dept { |
| | | font-size: 24rpx; |
| | | color: #666; |
| | | margin-right: 20rpx; |
| | | } |
| | | |
| | | .staff-post { |
| | | font-size: 24rpx; |
| | | color: #007AFF; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .checkbox-empty { |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | border: 2rpx solid #ddd; |
| | | border-radius: 50%; |
| | | } |
| | | } |
| | | |
| | | .no-data { |
| | | text-align: center; |
| | | padding: 100rpx 0; |
| | | color: #999; |
| | | |
| | | text { |
| | | display: block; |
| | | margin-top: 20rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .popup-footer { |
| | | display: flex; |
| | | padding: 20rpx 30rpx; |
| | | border-top: 1rpx solid #f0f0f0; |
| | | gap: 20rpx; |
| | | flex-shrink: 0; |
| | | |
| | | button { |
| | | flex: 1; |
| | | height: 80rpx; |
| | | border-radius: 10rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | |
| | | .cancel-btn { |
| | | background-color: #f5f5f5; |
| | | color: #666; |
| | | } |
| | | |
| | | .confirm-btn { |
| | | background-color: #007AFF; |
| | | color: white; |
| | | } |
| | | } |
| | | } |