|
|
|
@@ -51,7 +51,12 @@ |
|
|
|
</view> |
|
|
|
<view class="form-group"> |
|
|
|
<text class="form-label">医院名称</text> |
|
|
|
<u-input v-model="form.hospital" placeholder="请输入就诊医院名称" border="surround" /> |
|
|
|
<!-- 有医院数据:点击弹窗选择;无数据:降级为输入框 --> |
|
|
|
<view v-if="hospitalOptions.length" class="region-row" @tap="openHospitalPopup"> |
|
|
|
<text :class="['region-text', form.hospital ? '' : 'placeholder']">{{ form.hospital || '请选择医院' }}</text> |
|
|
|
<text class="arrow">›</text> |
|
|
|
</view> |
|
|
|
<u-input v-else v-model="form.hospital" placeholder="请输入就诊医院名称" border="surround" /> |
|
|
|
</view> |
|
|
|
<view class="form-group"> |
|
|
|
<text class="form-label">癌种</text> |
|
|
|
@@ -149,6 +154,43 @@ |
|
|
|
<u-picker v-if="regionColumns[0].length" :show="showRegionPicker" :columns="regionColumns" @confirm="onRegionConfirm" |
|
|
|
@cancel="showRegionPicker = false" @change="onRegionChange" :defaultIndex="regionDefaultIndex" /> |
|
|
|
|
|
|
|
<!-- 医院搜索弹窗 --> |
|
|
|
<u-popup :show="showHospitalPopup" mode="bottom" round="24" :closeable="true" :safeAreaInsetBottom="true" @close="showHospitalPopup = false"> |
|
|
|
<view class="hospital-popup"> |
|
|
|
<text class="popup-title">选择医院</text> |
|
|
|
<view class="search-bar"> |
|
|
|
<u--input v-model="hospitalKeywords" placeholder="搜索医院名称" prefixIcon="search" prefixIconStyle="color: #999" border="surround" shape="circle" @change="searchHospital" /> |
|
|
|
</view> |
|
|
|
<scroll-view scroll-y class="hospital-list"> |
|
|
|
<view v-for="item in filteredHospitals" :key="item.id" class="hospital-item" @click="onSelectHospital(item)"> |
|
|
|
<text>{{ item.name }}</text> |
|
|
|
<u-icon v-if="form.hospital === item.name" name="checkmark" size="16" color="#0E63E3" /> |
|
|
|
</view> |
|
|
|
<view v-if="!filteredHospitals.length" class="empty-tip"> |
|
|
|
<text>没有找到相关医院</text> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
<view class="add-hospital-link" v-if="hospitalKeywords.trim() && filteredHospitals.length <= 5" @click="manualInputHospital"> |
|
|
|
<text>找不到医院?手动填写</text> |
|
|
|
<u-icon name="arrow-right" size="14" color="#0E63E3" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-popup> |
|
|
|
|
|
|
|
<!-- 手动输入医院弹窗 --> |
|
|
|
<u-popup :show="showManualHospital" mode="center" round="12" :safeAreaInsetBottom="false" @close="showManualHospital = false"> |
|
|
|
<view class="manual-hospital-popup"> |
|
|
|
<text class="popup-title">手动填写医院</text> |
|
|
|
<view class="manual-input"> |
|
|
|
<u--input v-model="manualHospitalName" placeholder="请输入医院名称" border="surround" /> |
|
|
|
</view> |
|
|
|
<view class="manual-btns"> |
|
|
|
<u-button text="取消" size="normal" :plain="true" shape="circle" @click="showManualHospital = false" /> |
|
|
|
<u-button text="确定" size="normal" color="#0E63E3" shape="circle" @click="confirmManualHospital" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-popup> |
|
|
|
|
|
|
|
<!-- 已通过重新提交确认弹窗 --> |
|
|
|
<u-popup :show="showConfirmPopup" mode="center" round="12" :safeAreaInsetBottom="false" @close="showConfirmPopup = false"> |
|
|
|
<view class="confirm-popup"> |
|
|
|
@@ -197,6 +239,50 @@ const tagOptions = ref([]) |
|
|
|
const showReturnRegionPicker = ref(false) |
|
|
|
const returnRegionDefaultIndex = ref([0, 0, 0]) |
|
|
|
|
|
|
|
// 医院选项 |
|
|
|
const hospitalOptions = ref([]) |
|
|
|
const showHospitalPopup = ref(false) |
|
|
|
const hospitalKeywords = ref('') |
|
|
|
const showManualHospital = ref(false) |
|
|
|
const manualHospitalName = ref('') |
|
|
|
|
|
|
|
const filteredHospitals = computed(() => { |
|
|
|
const kw = hospitalKeywords.value.trim() |
|
|
|
if (!kw) return hospitalOptions.value |
|
|
|
return hospitalOptions.value.filter(h => h.name.includes(kw)) |
|
|
|
}) |
|
|
|
|
|
|
|
const openHospitalPopup = () => { |
|
|
|
hospitalKeywords.value = '' |
|
|
|
showHospitalPopup.value = true |
|
|
|
} |
|
|
|
|
|
|
|
const searchHospital = () => { |
|
|
|
// 本地过滤,filteredHospitals 自动响应 |
|
|
|
} |
|
|
|
|
|
|
|
const onSelectHospital = (item) => { |
|
|
|
form.hospital = item.name |
|
|
|
showHospitalPopup.value = false |
|
|
|
} |
|
|
|
|
|
|
|
const manualInputHospital = () => { |
|
|
|
// 关闭搜索弹窗,打开手动输入弹窗,带入搜索框内容 |
|
|
|
manualHospitalName.value = hospitalKeywords.value.trim() |
|
|
|
showHospitalPopup.value = false |
|
|
|
showManualHospital.value = true |
|
|
|
} |
|
|
|
|
|
|
|
const confirmManualHospital = () => { |
|
|
|
const name = manualHospitalName.value.trim() |
|
|
|
if (!name) { |
|
|
|
uni.showToast({ title: '请输入医院名称', icon: 'none' }) |
|
|
|
return |
|
|
|
} |
|
|
|
form.hospital = name |
|
|
|
showManualHospital.value = false |
|
|
|
} |
|
|
|
|
|
|
|
// 签署时的额外信息(用于重签回显) |
|
|
|
const signExtra = reactive({ |
|
|
|
income_amount: '', |
|
|
|
@@ -321,6 +407,7 @@ onLoad(async () => { |
|
|
|
await loadInfo() |
|
|
|
loadSubscribeConfig() |
|
|
|
loadTagOptions() |
|
|
|
loadHospitals() |
|
|
|
}) |
|
|
|
|
|
|
|
onBeforeUnmount(() => { |
|
|
|
@@ -445,6 +532,13 @@ const loadTagOptions = async () => { |
|
|
|
} catch (e) {} |
|
|
|
} |
|
|
|
|
|
|
|
const loadHospitals = async () => { |
|
|
|
try { |
|
|
|
const res = await get('/common/hospitals') |
|
|
|
hospitalOptions.value = res.data || [] |
|
|
|
} catch (e) {} |
|
|
|
} |
|
|
|
|
|
|
|
const chooseDocument = () => { |
|
|
|
uni.chooseImage({ |
|
|
|
count: 9 - form.documents.length, |
|
|
|
@@ -889,4 +983,74 @@ const doSubmit = async () => { |
|
|
|
display: flex; |
|
|
|
gap: 24rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.hospital-popup { |
|
|
|
padding: 32rpx; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
height: 70vh; |
|
|
|
} |
|
|
|
|
|
|
|
.popup-title { |
|
|
|
font-size: 32rpx; |
|
|
|
font-weight: 600; |
|
|
|
color: #333; |
|
|
|
text-align: center; |
|
|
|
margin-bottom: 24rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.search-bar { |
|
|
|
margin-bottom: 16rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.hospital-list { |
|
|
|
flex: 1; |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
|
|
|
|
.hospital-item { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
padding: 28rpx 16rpx; |
|
|
|
border-bottom: 1rpx solid #f0f0f0; |
|
|
|
font-size: 28rpx; |
|
|
|
color: #333; |
|
|
|
|
|
|
|
&:active { |
|
|
|
background: #f5f7fa; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.empty-tip { |
|
|
|
text-align: center; |
|
|
|
padding: 60rpx 0; |
|
|
|
font-size: 26rpx; |
|
|
|
color: #999; |
|
|
|
} |
|
|
|
|
|
|
|
.add-hospital-link { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
gap: 8rpx; |
|
|
|
padding: 28rpx 0; |
|
|
|
font-size: 28rpx; |
|
|
|
color: #0e63e3; |
|
|
|
border-top: 1rpx solid #f0f0f0; |
|
|
|
} |
|
|
|
|
|
|
|
.manual-hospital-popup { |
|
|
|
padding: 48rpx 40rpx 40rpx; |
|
|
|
width: 560rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.manual-input { |
|
|
|
margin-bottom: 40rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.manual-btns { |
|
|
|
display: flex; |
|
|
|
gap: 24rpx; |
|
|
|
} |
|
|
|
</style> |