|
|
@@ -46,19 +46,19 @@
|
|
|
<text class="required">*</text>
|
|
|
<text>账号身份</text>
|
|
|
</view>
|
|
|
- <radio-group @change="onAccountIdentityChange" class="radio-group">
|
|
|
- <label
|
|
|
- class="radio-item"
|
|
|
- v-for="(option, index) in accountIdentityOptions"
|
|
|
- :key="index">
|
|
|
- <radio
|
|
|
- :value="option.value"
|
|
|
- :checked="formData.accountType == option.value"
|
|
|
- color="#388BFF"
|
|
|
- />
|
|
|
- <text class="radio-text">{{ option.label }}</text>
|
|
|
- </label>
|
|
|
- </radio-group>
|
|
|
+ <picker
|
|
|
+ style="flex:1"
|
|
|
+ mode="selector"
|
|
|
+ :range="accountIdentityOptions"
|
|
|
+ range-key="label"
|
|
|
+ :value="getAccountIdentityIndex()"
|
|
|
+ @change="onAccountIdentityChange"
|
|
|
+ >
|
|
|
+ <view class="form-input picker-input" :class="{ placeholder: !formData.accountType }">
|
|
|
+ {{ getAccountIdentityLabel() || '请选择账号身份' }}
|
|
|
+ <image class="w32 h32" src="/static/image/icon_my_more.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
</view>
|
|
|
|
|
|
<view class="form-item">
|
|
|
@@ -66,12 +66,12 @@
|
|
|
<text class="required">*</text>
|
|
|
<text>机构</text>
|
|
|
</view>
|
|
|
- <input
|
|
|
- class="form-input"
|
|
|
- v-model="formData.institution"
|
|
|
- placeholder="请输入机构名称"
|
|
|
- placeholder-class="placeholder"
|
|
|
- />
|
|
|
+ <view style="flex:1" @click="openInstitutionPicker">
|
|
|
+ <view class="form-input picker-input" :class="{ placeholder: !formData.institution }">
|
|
|
+ {{ getInstitutionLabel() || '请选择机构' }}
|
|
|
+ <image class="w32 h32" src="/static/image/icon_my_more.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
<view class="form-item">
|
|
|
@@ -79,12 +79,19 @@
|
|
|
<text class="required">*</text>
|
|
|
<text>科室</text>
|
|
|
</view>
|
|
|
- <input
|
|
|
- class="form-input"
|
|
|
- v-model="formData.department"
|
|
|
- placeholder="请输入科室"
|
|
|
- placeholder-class="placeholder"
|
|
|
- />
|
|
|
+ <picker
|
|
|
+ style="flex:1"
|
|
|
+ mode="selector"
|
|
|
+ :range="departmentList"
|
|
|
+ range-key="label"
|
|
|
+ :value="getDepartmentIndex()"
|
|
|
+ @change="onDepartmentChange"
|
|
|
+ >
|
|
|
+ <view class="form-input picker-input" :class="{ placeholder: !formData.department }">
|
|
|
+ {{ getDepartmentLabel() || '请选择科室' }}
|
|
|
+ <image class="w32 h32" src="/static/image/icon_my_more.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
</view>
|
|
|
|
|
|
<view class="form-item">
|
|
|
@@ -92,12 +99,19 @@
|
|
|
<text class="required">*</text>
|
|
|
<text>职称</text>
|
|
|
</view>
|
|
|
- <input
|
|
|
- class="form-input"
|
|
|
- v-model="formData.jobTitle"
|
|
|
- placeholder="请输入职称"
|
|
|
- placeholder-class="placeholder"
|
|
|
- />
|
|
|
+ <picker
|
|
|
+ style="flex:1"
|
|
|
+ mode="selector"
|
|
|
+ :range="titleList"
|
|
|
+ range-key="label"
|
|
|
+ :value="getTitleIndex()"
|
|
|
+ @change="onTitleChange"
|
|
|
+ >
|
|
|
+ <view class="form-input picker-input" :class="{ placeholder: !formData.jobTitle }">
|
|
|
+ {{ getTitleLabel() || '请选择职称' }}
|
|
|
+ <image class="w32 h32" src="/static/image/icon_my_more.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -177,12 +191,19 @@
|
|
|
<text class="required">*</text>
|
|
|
<text>开户行</text>
|
|
|
</view>
|
|
|
- <input
|
|
|
- class="form-input"
|
|
|
- v-model="formData.bankName"
|
|
|
- placeholder="请输入开户行"
|
|
|
- placeholder-class="text-placeholder"
|
|
|
- />
|
|
|
+ <picker
|
|
|
+ style="flex:1"
|
|
|
+ mode="selector"
|
|
|
+ :range="bankList"
|
|
|
+ range-key="label"
|
|
|
+ :value="getBankIndex()"
|
|
|
+ @change="onBankChange"
|
|
|
+ >
|
|
|
+ <view class="form-input picker-input" :class="{ placeholder: !formData.bankName }">
|
|
|
+ {{ getBankLabel() || '请选择开户行' }}
|
|
|
+ <image class="w32 h32" src="/static/image/icon_my_more.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
</view>
|
|
|
|
|
|
<view class="form-item">
|
|
|
@@ -212,6 +233,39 @@
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
|
|
|
+ <!-- 机构搜索弹窗 -->
|
|
|
+ <view class="search-picker-popup" v-if="showInstitutionPicker" @click="closeInstitutionPicker">
|
|
|
+ <view class="popup-content" @click.stop>
|
|
|
+ <view class="popup-header">
|
|
|
+ <text class="popup-title">选择机构</text>
|
|
|
+ <view class="popup-close" @click="closeInstitutionPicker">×</view>
|
|
|
+ </view>
|
|
|
+ <view class="search-box">
|
|
|
+ <input
|
|
|
+ class="search-input"
|
|
|
+ v-model="institutionSearchKeyword"
|
|
|
+ placeholder="请输入机构名称搜索"
|
|
|
+ @input="onInstitutionSearch"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ <scroll-view class="search-list" scroll-y>
|
|
|
+ <view
|
|
|
+ class="search-item"
|
|
|
+ v-for="(item, index) in filteredInstitutionList"
|
|
|
+ :key="index"
|
|
|
+ :class="{ active: formData.institution === item.label }"
|
|
|
+ @click="selectInstitution(item)"
|
|
|
+ >
|
|
|
+ <text>{{ item.label }}</text>
|
|
|
+ <text v-if="formData.institution === item.label" class="check-icon">✓</text>
|
|
|
+ </view>
|
|
|
+ <view class="search-empty" v-if="filteredInstitutionList.length === 0">
|
|
|
+ <text>暂无匹配结果</text>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- 底部操作栏 -->
|
|
|
<view class="bottom-bar">
|
|
|
|
|
|
@@ -239,8 +293,11 @@
|
|
|
import {
|
|
|
submitCertification,
|
|
|
getCertificationInfo,
|
|
|
- getBankList,
|
|
|
- getCertificationStatus
|
|
|
+ getCertificationStatus,
|
|
|
+ identityType,
|
|
|
+ getHospitalList,
|
|
|
+ getDeptData,
|
|
|
+ getBankTypeList
|
|
|
} from '@/api/certification'
|
|
|
import { uploadOSS } from '@/api/common'
|
|
|
export default {
|
|
|
@@ -250,102 +307,137 @@ export default {
|
|
|
agreed: false,
|
|
|
certificationStatus: null, // 认证状态
|
|
|
formData: {
|
|
|
- doctorName: '', // 讲者姓名
|
|
|
- idCard: '', // 身份证号
|
|
|
- accountIdentity: '', // 账号身份(用于转换为 accountType)
|
|
|
- accountType: 1, // 账户身份: 1-医生, 2-药剂师
|
|
|
- institution: '', // 机构名称
|
|
|
- institutionId: '', // 机构ID(用于获取 companyId)
|
|
|
- companyId: '', // 公司ID
|
|
|
- companyName: '', // 公司名称
|
|
|
- department: '', // 科室
|
|
|
- jobTitle: '', // 职称
|
|
|
- licenseImage: '', // 执业证图片URL(多个图片用逗号分隔)
|
|
|
- titleCertImage: '', // 职称证/工牌图片URL(多个图片用逗号分隔)
|
|
|
- bankName: '', // 开户银行
|
|
|
- bankBranch: '', // 支行信息
|
|
|
- bankCardNo: '', // 银行卡号
|
|
|
- // 本地图片路径(用于上传)
|
|
|
- practiceCertificate: [], // 医师职业证图片数组(本地路径)
|
|
|
- titleCertificate: [] // 医师职称证/工牌图片数组(本地路径)
|
|
|
+ doctorName: '',
|
|
|
+ idCard: '',
|
|
|
+ accountType: '',
|
|
|
+ institution: '',
|
|
|
+ companyId: '',
|
|
|
+ department: '',
|
|
|
+ jobTitle: '',
|
|
|
+ bankName: '',
|
|
|
+ bankBranch: '',
|
|
|
+ bankCardNo: '',
|
|
|
+ practiceCertificate: [],
|
|
|
+ titleCertificate: []
|
|
|
},
|
|
|
institutionList: [],
|
|
|
departmentList: [],
|
|
|
+ bankList: [],
|
|
|
titleList: [],
|
|
|
- selectedInstitution: null, // 选中的机构对象
|
|
|
- selectedBank: null, // 选中的银行对象
|
|
|
- accountIdentityOptions: [
|
|
|
- { label: '医生', value: 1 },
|
|
|
- { label: '药剂师', value: 2 }
|
|
|
- ]
|
|
|
+ accountIdentityOptions: [],
|
|
|
+ showInstitutionPicker: false,
|
|
|
+ institutionSearchKeyword: '',
|
|
|
+ filteredInstitutionList: [],
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- var user = JSON.parse(uni.getStorageSync('userInfo'))
|
|
|
- this.formData.companyId=user.companyId
|
|
|
+ const user = JSON.parse(uni.getStorageSync('userInfo'))
|
|
|
+ this.formData.companyId = user.companyId
|
|
|
if (options.rejectionInfo) {
|
|
|
this.rejectionInfo = decodeURIComponent(options.rejectionInfo)
|
|
|
}
|
|
|
- //this.loadData()
|
|
|
+ this.loadData()
|
|
|
},
|
|
|
methods: {
|
|
|
+ extractArray(data) {
|
|
|
+ if (Array.isArray(data)) return data
|
|
|
+ const candidates = [
|
|
|
+ data?.data,
|
|
|
+ data?.list,
|
|
|
+ data?.rows,
|
|
|
+ data?.titleList,
|
|
|
+ data?.hospitalList,
|
|
|
+ data?.departmentList,
|
|
|
+ data?.bankList
|
|
|
+ ]
|
|
|
+ return candidates.find(Array.isArray) || []
|
|
|
+ },
|
|
|
+ getAccountIdentityLabel() {
|
|
|
+ return this.formData.accountType || ''
|
|
|
+ },
|
|
|
+ getAccountIdentityIndex() {
|
|
|
+ if (!this.formData.accountType) return 0
|
|
|
+ const idx = this.accountIdentityOptions.findIndex(opt => opt.label === this.formData.accountType)
|
|
|
+ return idx >= 0 ? idx : 0
|
|
|
+ },
|
|
|
+ getInstitutionLabel() {
|
|
|
+ return this.formData.institution || ''
|
|
|
+ },
|
|
|
+ getDepartmentLabel() {
|
|
|
+ return this.formData.department || ''
|
|
|
+ },
|
|
|
+ getDepartmentIndex() {
|
|
|
+ if (!this.formData.department) return 0
|
|
|
+ const idx = this.departmentList.findIndex(opt => opt.label === this.formData.department)
|
|
|
+ return idx >= 0 ? idx : 0
|
|
|
+ },
|
|
|
+ getBankLabel() {
|
|
|
+ return this.formData.bankName || ''
|
|
|
+ },
|
|
|
+ getBankIndex() {
|
|
|
+ if (!this.formData.bankName) return 0
|
|
|
+ const idx = this.bankList.findIndex(opt => opt.label === this.formData.bankName)
|
|
|
+ return idx >= 0 ? idx : 0
|
|
|
+ },
|
|
|
+ getTitleLabel() {
|
|
|
+ return this.formData.jobTitle || ''
|
|
|
+ },
|
|
|
+ getTitleIndex() {
|
|
|
+ if (!this.formData.jobTitle) return 0
|
|
|
+ const idx = this.titleList.findIndex(opt => opt.label === this.formData.jobTitle)
|
|
|
+ return idx >= 0 ? idx : 0
|
|
|
+ },
|
|
|
async loadData() {
|
|
|
try {
|
|
|
uni.showLoading({ title: '加载中...' })
|
|
|
- // 并行加载所有数据
|
|
|
- const [infoRes, statusRes, bankRes] = await Promise.all([
|
|
|
- getCertificationInfo().catch(() => ({ code: 0 })),
|
|
|
- getCertificationStatus().catch(() => ({ code: 0 })),
|
|
|
- // getBankList().catch(() => ({ code: 0, data: [] }))
|
|
|
+ const [identityRes, bankRes, instRes, departRes, titleRes] = await Promise.all([
|
|
|
+ identityType({ dictType: 'doctor_account_identity_type' }).catch(() => ({ code: 0 })),
|
|
|
+ getBankTypeList().catch(() => ({ code: 0 })),
|
|
|
+ getHospitalList().catch(() => ({ code: 0 })),
|
|
|
+ getDeptData().catch(() => ({ code: 0 })),
|
|
|
+ identityType({ dictType: 'hospital_title' }).catch(() => ({ code: 0 })),
|
|
|
])
|
|
|
-
|
|
|
- // 加载认证信息(如果已提交过)
|
|
|
- if (infoRes.code === 200 && infoRes.data) {
|
|
|
- const data = infoRes.data
|
|
|
- // 映射接口返回的字段到表单字段
|
|
|
- this.formData = {
|
|
|
- ...this.formData,
|
|
|
- doctorName: data.doctorName || data.name || '',
|
|
|
- idCard: data.idCard || data.idNumber || '',
|
|
|
- accountType: data.accountType || '',
|
|
|
- accountIdentity: data.accountType === 1 ? '医生' : (data.accountType === 2 ? '药剂师' : ''),
|
|
|
- institution: data.institution || '',
|
|
|
- companyId: data.companyId || '',
|
|
|
- companyName: data.companyName || '',
|
|
|
- department: data.department || '',
|
|
|
- jobTitle: data.jobTitle || data.title || '',
|
|
|
- bankName: data.bankName || data.bank || '',
|
|
|
- bankBranch: data.bankBranch || data.branchName || '',
|
|
|
- bankCardNo: data.bankCardNo || data.bankCardNumber || '',
|
|
|
- // 处理图片URL,转换为数组
|
|
|
- licenseImage: data.licenseImage || '',
|
|
|
- titleCertImage: data.titleCertImage || '',
|
|
|
- practiceCertificate: data.licenseImage ? data.licenseImage.split(',').filter(Boolean) : [],
|
|
|
- titleCertificate: data.titleCertImage ? data.titleCertImage.split(',').filter(Boolean) : []
|
|
|
+
|
|
|
+ if (identityRes.code === 200) {
|
|
|
+ const arr = this.extractArray(identityRes.data)
|
|
|
+ this.accountIdentityOptions = arr.map(item => ({
|
|
|
+ label: item.dictLabel || '',
|
|
|
+ value: item.dictValue
|
|
|
+ })).filter(opt => opt.label)
|
|
|
}
|
|
|
- // 设置账号身份
|
|
|
- if (data.accountType) {
|
|
|
- const selected = this.accountIdentityOptions.find(opt => opt.value === data.accountType)
|
|
|
- if (selected) {
|
|
|
- this.formData.accountIdentity = selected.label
|
|
|
- this.formData.accountType = selected.value
|
|
|
- }
|
|
|
+
|
|
|
+ if (bankRes.code === 200) {
|
|
|
+ const arr = this.extractArray(bankRes.data)
|
|
|
+ this.bankList = arr.map(item => ({
|
|
|
+ label: item.bankName || '',
|
|
|
+ value: item.id
|
|
|
+ })).filter(opt => opt.label)
|
|
|
}
|
|
|
- // 如果有id(编辑时),保存id
|
|
|
- if (data.id) {
|
|
|
- this.formData.id = data.id
|
|
|
+
|
|
|
+ if (instRes.code === 200) {
|
|
|
+ const arr = this.extractArray(instRes.data)
|
|
|
+ this.institutionList = arr.map(item => ({
|
|
|
+ label: item.hospitalName || '',
|
|
|
+ value: item.id
|
|
|
+ })).filter(opt => opt.label)
|
|
|
}
|
|
|
- if (data.rejectionInfo) {
|
|
|
- this.rejectionInfo = data.rejectionInfo
|
|
|
+
|
|
|
+ if (departRes.code === 200) {
|
|
|
+ const arr = this.extractArray(departRes.data)
|
|
|
+ this.departmentList = arr.map(item => ({
|
|
|
+ label: item.departmentName || '',
|
|
|
+ value: item.id
|
|
|
+ })).filter(opt => opt.label)
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- // 加载认证状态
|
|
|
- if (statusRes.code === 200 && statusRes.data) {
|
|
|
- this.certificationStatus = statusRes.data
|
|
|
+
|
|
|
+ if (titleRes.code === 200) {
|
|
|
+ const arr = this.extractArray(titleRes.data)
|
|
|
+ this.titleList = arr.map(item => ({
|
|
|
+ label: item.dictLabel || '',
|
|
|
+ value: item.dictValue
|
|
|
+ })).filter(opt => opt.label)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
uni.hideLoading()
|
|
|
} catch (e) {
|
|
|
uni.hideLoading()
|
|
|
@@ -353,11 +445,49 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onAccountIdentityChange(e) {
|
|
|
- const value = parseInt(e.detail.value)
|
|
|
- const selected = this.accountIdentityOptions.find(opt => opt.value === value)
|
|
|
+ const selected = this.accountIdentityOptions[e.detail.value]
|
|
|
+ if (selected) {
|
|
|
+ this.formData.accountType = selected.label
|
|
|
+ }
|
|
|
+ },
|
|
|
+ openInstitutionPicker() {
|
|
|
+ this.showInstitutionPicker = true
|
|
|
+ this.institutionSearchKeyword = ''
|
|
|
+ this.filteredInstitutionList = this.institutionList
|
|
|
+ },
|
|
|
+ closeInstitutionPicker() {
|
|
|
+ this.showInstitutionPicker = false
|
|
|
+ },
|
|
|
+ onInstitutionSearch() {
|
|
|
+ const keyword = this.institutionSearchKeyword.trim().toLowerCase()
|
|
|
+ if (!keyword) {
|
|
|
+ this.filteredInstitutionList = this.institutionList
|
|
|
+ } else {
|
|
|
+ this.filteredInstitutionList = this.institutionList.filter(item =>
|
|
|
+ item.label.toLowerCase().includes(keyword)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectInstitution(item) {
|
|
|
+ this.formData.institution = item.label
|
|
|
+ this.closeInstitutionPicker()
|
|
|
+ },
|
|
|
+ onDepartmentChange(e) {
|
|
|
+ const selected = this.departmentList[e.detail.value]
|
|
|
+ if (selected) {
|
|
|
+ this.formData.department = selected.label
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onBankChange(e) {
|
|
|
+ const selected = this.bankList[e.detail.value]
|
|
|
+ if (selected) {
|
|
|
+ this.formData.bankName = selected.label
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onTitleChange(e) {
|
|
|
+ const selected = this.titleList[e.detail.value]
|
|
|
if (selected) {
|
|
|
- this.formData.accountIdentity = selected.label
|
|
|
- this.formData.accountType = selected.value
|
|
|
+ this.formData.jobTitle = selected.label
|
|
|
}
|
|
|
},
|
|
|
onAgreementChange(e) {
|
|
|
@@ -489,119 +619,65 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
async handleSubmit() {
|
|
|
- // 表单验证
|
|
|
- if (!this.formData.doctorName && !this.formData.name) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请输入姓名'
|
|
|
- })
|
|
|
- return
|
|
|
+ if (!this.formData.doctorName) {
|
|
|
+ return uni.showToast({ icon: 'none', title: '请输入姓名' })
|
|
|
}
|
|
|
- if (!this.formData.idCard && !this.formData.idNumber) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请输入身份证号'
|
|
|
- })
|
|
|
- return
|
|
|
+ if (!this.formData.idCard) {
|
|
|
+ return uni.showToast({ icon: 'none', title: '请输入身份证号' })
|
|
|
}
|
|
|
if (!this.formData.accountType) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请选择账号身份'
|
|
|
- })
|
|
|
- return
|
|
|
+ return uni.showToast({ icon: 'none', title: '请选择账号身份' })
|
|
|
}
|
|
|
if (!this.formData.institution) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请输入机构名称'
|
|
|
- })
|
|
|
- return
|
|
|
+ return uni.showToast({ icon: 'none', title: '请选择机构' })
|
|
|
}
|
|
|
if (!this.formData.department) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请输入科室'
|
|
|
- })
|
|
|
- return
|
|
|
+ return uni.showToast({ icon: 'none', title: '请选择科室' })
|
|
|
}
|
|
|
- if (!this.formData.jobTitle && !this.formData.title) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请输入职称'
|
|
|
- })
|
|
|
- return
|
|
|
+ if (!this.formData.jobTitle) {
|
|
|
+ return uni.showToast({ icon: 'none', title: '请选择职称' })
|
|
|
}
|
|
|
- // 至少上传一种证件
|
|
|
if (this.formData.practiceCertificate.length === 0 && this.formData.titleCertificate.length === 0) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请至少上传一种身份证明'
|
|
|
- })
|
|
|
- return
|
|
|
+ return uni.showToast({ icon: 'none', title: '请至少上传一种身份证明' })
|
|
|
}
|
|
|
- // 医师职业证至少上传2张
|
|
|
if (this.formData.practiceCertificate.length > 0 && this.formData.practiceCertificate.length < 2) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '医师职业证至少需上传编码页和执业点页'
|
|
|
- })
|
|
|
- return
|
|
|
+ return uni.showToast({ icon: 'none', title: '医师职业证至少需上传编码页和执业点页' })
|
|
|
}
|
|
|
- if (!this.formData.bankName && !this.formData.bank) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请输入开户行'
|
|
|
- })
|
|
|
- return
|
|
|
+ if (!this.formData.bankName) {
|
|
|
+ return uni.showToast({ icon: 'none', title: '请选择开户行' })
|
|
|
}
|
|
|
- if (!this.formData.bankBranch && !this.formData.branchName) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请输入支行名称'
|
|
|
- })
|
|
|
- return
|
|
|
+ if (!this.formData.bankBranch) {
|
|
|
+ return uni.showToast({ icon: 'none', title: '请输入支行名称' })
|
|
|
}
|
|
|
- if (!this.formData.bankCardNo && !this.formData.bankCardNumber) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请输入银行卡号'
|
|
|
- })
|
|
|
- return
|
|
|
+ if (!this.formData.bankCardNo) {
|
|
|
+ return uni.showToast({ icon: 'none', title: '请输入银行卡号' })
|
|
|
}
|
|
|
if (!this.agreed) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '请阅读并同意用户协议和知情同意书'
|
|
|
- })
|
|
|
- return
|
|
|
+ return uni.showToast({ icon: 'none', title: '请阅读并同意用户协议和知情同意书' })
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
uni.showLoading({ title: '提交中...' })
|
|
|
|
|
|
- // 获取图片URL(选择时已上传,直接使用)
|
|
|
const licenseImageUrls = this.formData.practiceCertificate.filter(url => url && (url.startsWith('http://') || url.startsWith('https://')))
|
|
|
const titleCertImageUrls = this.formData.titleCertificate.filter(url => url && (url.startsWith('http://') || url.startsWith('https://')))
|
|
|
|
|
|
- // 构建提交数据,按照接口字段要求
|
|
|
const submitData = {
|
|
|
- accountType: this.formData.accountType, // 账户身份: 1-医生, 2-药剂师
|
|
|
- bankBranch: this.formData.bankBranch || this.formData.branchName, // 支行信息
|
|
|
- bankCardNo: this.formData.bankCardNo || this.formData.bankCardNumber, // 银行卡号
|
|
|
- bankName: this.formData.bankName || this.formData.bank, // 开户银行
|
|
|
- companyId: this.formData.companyId || '', // 公司ID
|
|
|
- companyName: this.formData.companyName || this.formData.institution, // 公司名称
|
|
|
- department: this.formData.department, // 科室
|
|
|
- doctorName: this.formData.doctorName || this.formData.name, // 讲者姓名
|
|
|
- idCard: this.formData.idCard || this.formData.idNumber, // 身份证号
|
|
|
- institution: this.formData.institution, // 机构名称
|
|
|
- jobTitle: this.formData.jobTitle || this.formData.title, // 职称
|
|
|
- licenseImage: licenseImageUrls.join(','), // 执业证图片URL(多个用逗号分隔)
|
|
|
- titleCertImage: titleCertImageUrls.join(',') // 职称证/工牌图片URL(多个用逗号分隔)
|
|
|
+ accountType: this.formData.accountType,
|
|
|
+ bankBranch: this.formData.bankBranch,
|
|
|
+ bankCardNo: this.formData.bankCardNo,
|
|
|
+ bankName: this.formData.bankName,
|
|
|
+ companyId: this.formData.companyId,
|
|
|
+ companyName: this.formData.institution,
|
|
|
+ department: this.formData.department,
|
|
|
+ doctorName: this.formData.doctorName,
|
|
|
+ idCard: this.formData.idCard,
|
|
|
+ institution: this.formData.institution,
|
|
|
+ jobTitle: this.formData.jobTitle,
|
|
|
+ licenseImage: licenseImageUrls.join(','),
|
|
|
+ titleCertImage: titleCertImageUrls.join(',')
|
|
|
}
|
|
|
|
|
|
- // 如果有id(编辑时),添加id字段
|
|
|
if (this.formData.id) {
|
|
|
submitData.id = this.formData.id
|
|
|
}
|
|
|
@@ -610,28 +686,17 @@ export default {
|
|
|
uni.hideLoading()
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'success',
|
|
|
- title: '提交成功'
|
|
|
- })
|
|
|
+ uni.showToast({ icon: 'success', title: '提交成功' })
|
|
|
setTimeout(() => {
|
|
|
- uni.switchTab({
|
|
|
- url: '/pages/user/index'
|
|
|
- })
|
|
|
+ uni.switchTab({ url: '/pages/user/index' })
|
|
|
}, 1500)
|
|
|
} else {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: res.msg || '提交失败'
|
|
|
- })
|
|
|
+ uni.showToast({ icon: 'none', title: res.msg || '提交失败' })
|
|
|
}
|
|
|
} catch (e) {
|
|
|
uni.hideLoading()
|
|
|
console.error('提交认证失败', e)
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: e.message || '提交失败'
|
|
|
- })
|
|
|
+ uni.showToast({ icon: 'none', title: e.message || '提交失败' })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -746,6 +811,17 @@ export default {
|
|
|
flex:1;
|
|
|
height: 80rpx;
|
|
|
font-size: 28rpx;
|
|
|
+
|
|
|
+ &.picker-input {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ gap: 16rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.placeholder {
|
|
|
+ color: #C8C9CC !important;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.radio-group {
|
|
|
@@ -957,5 +1033,108 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.search-picker-popup {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
+ z-index: 1000;
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-end;
|
|
|
+
|
|
|
+ .popup-content {
|
|
|
+ width: 100%;
|
|
|
+ max-height: 80vh;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 24rpx 24rpx 0 0;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 32rpx;
|
|
|
+ border-bottom: 1rpx solid #f0f0f0;
|
|
|
+
|
|
|
+ .popup-title {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-close {
|
|
|
+ font-size: 48rpx;
|
|
|
+ color: #999;
|
|
|
+ line-height: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-box {
|
|
|
+ padding: 24rpx 32rpx;
|
|
|
+
|
|
|
+ .search-input {
|
|
|
+ width: 100%;
|
|
|
+ height: 72rpx;
|
|
|
+ background: #f5f5f5;
|
|
|
+ border-radius: 36rpx;
|
|
|
+ padding: 0 32rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-list {
|
|
|
+ flex: 1;
|
|
|
+ max-height: 60vh;
|
|
|
+ padding: 0 32rpx;
|
|
|
+
|
|
|
+ .search-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 28rpx 0;
|
|
|
+ border-bottom: 1rpx solid #f5f5f5;
|
|
|
+
|
|
|
+ &:last-child {
|
|
|
+ border-bottom: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ color: #388BFF;
|
|
|
+
|
|
|
+ text {
|
|
|
+ color: #388BFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .check-icon {
|
|
|
+ color: #388BFF;
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-empty {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ padding: 60rpx 0;
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
|