| | |
| | | </view> |
| | | <view class="form-item"> |
| | | <text class="item-label">上报医院</text> |
| | | <u-input |
| | | v-model="form.toHospital" |
| | | placeholder="请输入上报医院" |
| | | maxlength="100" |
| | | /> |
| | | <view class="picker" @click="openHospitalPopup"> |
| | | <text>{{ form.toHospital || "请选择上报医院" }}</text> |
| | | <text class="icon-arrow">›</text> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <text class="item-label">科室名称</text> |
| | |
| | | {{ loading ? "提交中..." : isEditMode ? "保存修改" : "提交上报" }} |
| | | </u-button> |
| | | </view> |
| | | |
| | | <!-- 上报医院机构选择弹窗 --> |
| | | <u-popup |
| | | :show="hospitalPopupShow" |
| | | mode="bottom" |
| | | round="20" |
| | | :close-on-click-overlay="true" |
| | | @close="hospitalPopupShow = false" |
| | | > |
| | | <view class="hospital-popup"> |
| | | <view class="popup-header"> |
| | | <text class="popup-title">选择上报医院</text> |
| | | <text class="popup-close" @click="hospitalPopupShow = false">×</text> |
| | | </view> |
| | | <view class="popup-search"> |
| | | <u-search |
| | | v-model="hospitalKeyword" |
| | | placeholder="请输入机构名称模糊查询" |
| | | :showAction="false" |
| | | :clearabled="true" |
| | | @change="onHospitalKeywordChange" |
| | | @search="searchHospital(hospitalKeyword)" |
| | | @clear="onHospitalClear" |
| | | /> |
| | | </view> |
| | | <scroll-view scroll-y class="hospital-list"> |
| | | <view |
| | | v-for="org in hospitalOptions" |
| | | :key="org.id" |
| | | class="hospital-item" |
| | | :class="{ active: org.organizationname === form.toHospital }" |
| | | @click="selectHospital(org)" |
| | | > |
| | | <text class="hospital-name">{{ org.organizationname }}</text> |
| | | <text class="hospital-id" v-if="org.organizationid"> |
| | | {{ org.organizationid }} |
| | | </text> |
| | | </view> |
| | | <view v-if="hospitalLoading" class="list-tip">加载中...</view> |
| | | <view v-else-if="!hospitalOptions.length" class="list-tip"> |
| | | {{ hospitalKeyword ? "未查询到相关机构" : "暂无机构数据" }} |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </u-popup> |
| | | </view> |
| | | </view> |
| | | </template> |
| | |
| | | "sys_AgeUnit", // 年龄单位(已存在) |
| | | "sys_education", |
| | | "sys_occupation", |
| | | "sys_RegionalLevel", // 机构所属地区 |
| | | ]; |
| | | |
| | | const { dictData, loading: dictLoading } = useDictMapper(requiredDictTypes); |
| | |
| | | // 报告时间选择器 |
| | | const showReportTimePicker = ref(false); |
| | | const reportTimeValue = ref(Date.now()); |
| | | |
| | | // 上报医院机构模糊查询 |
| | | const hospitalPopupShow = ref(false); |
| | | const hospitalKeyword = ref(""); |
| | | const hospitalOptions = ref([]); |
| | | const hospitalLoading = ref(false); |
| | | let hospitalSearchTimer = null; |
| | | |
| | | // 地址数据 |
| | | const residenceAddress = ref({ sheng: "", shi: "", qu: "" }); |
| | |
| | | registerprovincename: "", |
| | | registercityname: "", |
| | | registertownname: "", |
| | | registerCountyName: "", |
| | | registercommunityname: "", |
| | | residenceaddress: "", |
| | | residenceprovince: "", |
| | |
| | | if (!isEditMode.value) { |
| | | generateCaseNo(); |
| | | } |
| | | }; |
| | | |
| | | // ===== 上报医院机构模糊查询 ===== |
| | | const openHospitalPopup = () => { |
| | | hospitalPopupShow.value = true; |
| | | hospitalKeyword.value = ""; |
| | | hospitalOptions.value = []; |
| | | searchHospital(""); |
| | | }; |
| | | |
| | | const onHospitalKeywordChange = (val) => { |
| | | clearTimeout(hospitalSearchTimer); |
| | | const keyword = (val || "").trim(); |
| | | if (!keyword) { |
| | | searchHospital(""); |
| | | return; |
| | | } |
| | | hospitalSearchTimer = setTimeout(() => searchHospital(keyword), 300); |
| | | }; |
| | | |
| | | const onHospitalClear = () => { |
| | | hospitalKeyword.value = ""; |
| | | searchHospital(""); |
| | | }; |
| | | |
| | | const searchHospital = async (keyword) => { |
| | | hospitalLoading.value = true; |
| | | try { |
| | | const params = { pageNum: 1, pageSize: 50 }; |
| | | if (keyword) params.organizationname = keyword; |
| | | const res = await uni.$uapi.get("/project/organization/list", params); |
| | | hospitalOptions.value = res.rows || []; |
| | | } catch (e) { |
| | | hospitalOptions.value = []; |
| | | } finally { |
| | | hospitalLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | const selectHospital = (org) => { |
| | | form.value.toHospital = org.organizationname; |
| | | // 选中机构的所属地区(regionallevel)对照 sys_RegionalLevel 字典取出地区名称,存入户籍县名 |
| | | const regionalItem = getDictList("sys_RegionalLevel").find( |
| | | (item) => item.value == org.regionallevel, |
| | | ); |
| | | form.value.registerCountyName = regionalItem ? regionalItem.label : ""; |
| | | hospitalPopupShow.value = false; |
| | | }; |
| | | |
| | | // 附件处理(示例,需根据实际附件组件调整) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // ===== 上报医院机构选择弹窗 ===== |
| | | .hospital-popup { |
| | | padding: 30rpx; |
| | | background: #fff; |
| | | |
| | | .popup-header { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20rpx; |
| | | |
| | | .popup-title { |
| | | font-size: 32rpx; |
| | | font-weight: 650; |
| | | color: #1d1d1f; |
| | | } |
| | | |
| | | .popup-close { |
| | | font-size: 44rpx; |
| | | color: #86868b; |
| | | line-height: 1; |
| | | padding: 0 10rpx; |
| | | } |
| | | } |
| | | |
| | | .popup-search { |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .hospital-list { |
| | | max-height: 600rpx; |
| | | |
| | | .hospital-item { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | padding: 28rpx 20rpx; |
| | | border-bottom: 2rpx solid #f0f0f0; |
| | | |
| | | &:active { |
| | | background: #f5f5f7; |
| | | } |
| | | |
| | | &.active { |
| | | background: rgba(15, 149, 176, 0.08); |
| | | |
| | | .hospital-name { |
| | | color: #0f95b0; |
| | | font-weight: 600; |
| | | } |
| | | } |
| | | |
| | | .hospital-name { |
| | | font-size: 29rpx; |
| | | color: #1d1d1f; |
| | | flex: 1; |
| | | } |
| | | |
| | | .hospital-id { |
| | | font-size: 24rpx; |
| | | color: #86868b; |
| | | margin-left: 20rpx; |
| | | } |
| | | } |
| | | |
| | | .list-tip { |
| | | padding: 60rpx 0; |
| | | text-align: center; |
| | | font-size: 26rpx; |
| | | color: #86868b; |
| | | } |
| | | } |
| | | } |
| | | </style> |