考点考官
Showing
9 changed files
with
153 additions
and
47 deletions
| ... | @@ -1690,6 +1690,14 @@ export function examinerDel(id) { | ... | @@ -1690,6 +1690,14 @@ export function examinerDel(id) { |
| 1690 | }) | 1690 | }) |
| 1691 | } | 1691 | } |
| 1692 | 1692 | ||
| 1693 | // 清空当前考点申请已选考官 | ||
| 1694 | export function clearMyExaminer() { | ||
| 1695 | return request({ | ||
| 1696 | url: `/member/examiner/clearMyExaminer`, | ||
| 1697 | method: 'post' | ||
| 1698 | }) | ||
| 1699 | } | ||
| 1700 | |||
| 1693 | // 添加考官 | 1701 | // 添加考官 |
| 1694 | export function otherAdd(memId, ids) { | 1702 | export function otherAdd(memId, ids) { |
| 1695 | return request({ | 1703 | return request({ | ... | ... |
| ... | @@ -229,6 +229,7 @@ const submitAddress = async () => { | ... | @@ -229,6 +229,7 @@ const submitAddress = async () => { |
| 229 | form.value.province = region.value[0]; | 229 | form.value.province = region.value[0]; |
| 230 | form.value.city = region.value[1]; | 230 | form.value.city = region.value[1]; |
| 231 | form.value.area = region.value[2]; | 231 | form.value.area = region.value[2]; |
| 232 | form.value.address = `${form.value.province || ''}${form.value.city || ''}${form.value.area || ''}${form.value.a || ''}`; | ||
| 232 | 233 | ||
| 233 | uni.showLoading({ title: '保存中' }); | 234 | uni.showLoading({ title: '保存中' }); |
| 234 | try { | 235 | try { | ... | ... |
| ... | @@ -21,10 +21,10 @@ | ... | @@ -21,10 +21,10 @@ |
| 21 | <view class="info-card"> | 21 | <view class="info-card"> |
| 22 | <view class="card-header"> | 22 | <view class="card-header"> |
| 23 | <text class="card-title">邮寄信息</text> | 23 | <text class="card-title">邮寄信息</text> |
| 24 | <text class="manage-btn" @click="goAddressManage">管理地址</text> | 24 | <text v-if="allowEditAddress" class="manage-btn" @click="goAddressManage">管理地址</text> |
| 25 | </view> | 25 | </view> |
| 26 | 26 | ||
| 27 | <view v-if="selectedAddress.id" class="address-content" @click="goAddressManage"> | 27 | <view v-if="selectedAddress.id" :class="{ disabled: !allowEditAddress }" class="address-content" @click="goAddressManage"> |
| 28 | <view class="address-region"> | 28 | <view class="address-region"> |
| 29 | {{ selectedAddress.province }} {{ selectedAddress.city }} {{ selectedAddress.area }} | 29 | {{ selectedAddress.province }} {{ selectedAddress.city }} {{ selectedAddress.area }} |
| 30 | </view> | 30 | </view> |
| ... | @@ -38,8 +38,8 @@ | ... | @@ -38,8 +38,8 @@ |
| 38 | </view> | 38 | </view> |
| 39 | 39 | ||
| 40 | <view v-else class="empty-address" @click="goAddressManage"> | 40 | <view v-else class="empty-address" @click="goAddressManage"> |
| 41 | <text class="empty-tip">请添加收货地址</text> | 41 | <text class="empty-tip">{{ allowEditAddress ? '请添加收货地址' : '暂无订单地址' }}</text> |
| 42 | <text class="arrow">›</text> | 42 | <text v-if="allowEditAddress" class="arrow">›</text> |
| 43 | </view> | 43 | </view> |
| 44 | </view> | 44 | </view> |
| 45 | 45 | ||
| ... | @@ -120,7 +120,9 @@ | ... | @@ -120,7 +120,9 @@ |
| 120 | </view> | 120 | </view> |
| 121 | </view> | 121 | </view> |
| 122 | 122 | ||
| 123 | <view v-if="!selectedAddress.id" class="tip-text">请先选择邮寄地址</view> | 123 | <view v-if="!selectedAddress.id" class="tip-text"> |
| 124 | {{ allowEditAddress ? '请先选择邮寄地址' : '订单地址异常,请联系管理员' }} | ||
| 125 | </view> | ||
| 124 | </view> | 126 | </view> |
| 125 | </template> | 127 | </template> |
| 126 | 128 | ||
| ... | @@ -136,6 +138,7 @@ const orderId = ref(''); | ... | @@ -136,6 +138,7 @@ const orderId = ref(''); |
| 136 | const loading = ref(true); | 138 | const loading = ref(true); |
| 137 | const examData = ref({}); | 139 | const examData = ref({}); |
| 138 | const selectedAddress = ref({}); | 140 | const selectedAddress = ref({}); |
| 141 | const examInfo = ref({}); | ||
| 139 | const memberInfo = ref({}); | 142 | const memberInfo = ref({}); |
| 140 | const deptInfo = ref({}); | 143 | const deptInfo = ref({}); |
| 141 | const payType = ref('2'); | 144 | const payType = ref('2'); |
| ... | @@ -146,6 +149,7 @@ const formData = ref({ | ... | @@ -146,6 +149,7 @@ const formData = ref({ |
| 146 | 149 | ||
| 147 | // 判断是再次支付还是新订单 | 150 | // 判断是再次支付还是新订单 |
| 148 | const isRePay = computed(() => !!orderId.value); | 151 | const isRePay = computed(() => !!orderId.value); |
| 152 | const allowEditAddress = computed(() => !isRePay.value); | ||
| 149 | 153 | ||
| 150 | // 级别标签 | 154 | // 级别标签 |
| 151 | const levelTags = computed(() => { | 155 | const levelTags = computed(() => { |
| ... | @@ -188,6 +192,10 @@ onMounted(() => { | ... | @@ -188,6 +192,10 @@ onMounted(() => { |
| 188 | }); | 192 | }); |
| 189 | 193 | ||
| 190 | onShow(() => { | 194 | onShow(() => { |
| 195 | if (!allowEditAddress.value) { | ||
| 196 | getExamAddress(); | ||
| 197 | return | ||
| 198 | } | ||
| 191 | // 检查是否有选中的地址带回 | 199 | // 检查是否有选中的地址带回 |
| 192 | const pages = getCurrentPages(); | 200 | const pages = getCurrentPages(); |
| 193 | const currentPage = pages[pages.length - 1]; | 201 | const currentPage = pages[pages.length - 1]; |
| ... | @@ -230,7 +238,40 @@ const getDefaultAddress = async () => { | ... | @@ -230,7 +238,40 @@ const getDefaultAddress = async () => { |
| 230 | } | 238 | } |
| 231 | }; | 239 | }; |
| 232 | 240 | ||
| 241 | const getExamAddress = async () => { | ||
| 242 | if (!examId.value) return | ||
| 243 | try { | ||
| 244 | const res = await api.getLevelApplyInfo(examId.value) | ||
| 245 | const data = res.data || {} | ||
| 246 | examInfo.value = data | ||
| 247 | const address = data.postAddress || {} | ||
| 248 | if (address.id) { | ||
| 249 | selectedAddress.value = normalizePostAddress(address) | ||
| 250 | return | ||
| 251 | } | ||
| 252 | } catch (e) { | ||
| 253 | console.error('获取考试地址失败', e) | ||
| 254 | } | ||
| 255 | }; | ||
| 256 | |||
| 257 | function normalizePostAddress(address = {}) { | ||
| 258 | return { | ||
| 259 | id: address.id, | ||
| 260 | province: address.province || '', | ||
| 261 | city: address.city || '', | ||
| 262 | area: address.area || '', | ||
| 263 | a: address.a || '', | ||
| 264 | name: address.name || '', | ||
| 265 | phone: address.phone || '', | ||
| 266 | defaultFlag: address.defaultFlag | ||
| 267 | } | ||
| 268 | } | ||
| 269 | |||
| 233 | const goAddressManage = () => { | 270 | const goAddressManage = () => { |
| 271 | if (!allowEditAddress.value) { | ||
| 272 | uni.showToast({title: '重新支付订单不可修改地址', icon: 'none'}) | ||
| 273 | return | ||
| 274 | } | ||
| 234 | uni.navigateTo({ | 275 | uni.navigateTo({ |
| 235 | url: '/level/addressManage' | 276 | url: '/level/addressManage' |
| 236 | }); | 277 | }); |
| ... | @@ -245,7 +286,7 @@ const onPayTypeChange = (e) => { | ... | @@ -245,7 +286,7 @@ const onPayTypeChange = (e) => { |
| 245 | 286 | ||
| 246 | const handleSubmit = async () => { | 287 | const handleSubmit = async () => { |
| 247 | if (!selectedAddress.value.id) { | 288 | if (!selectedAddress.value.id) { |
| 248 | return uni.showToast({title: '请先选择地址', icon: 'none'}); | 289 | return uni.showToast({title: allowEditAddress.value ? '请先选择地址' : '订单地址异常,请联系管理员', icon: 'none'}); |
| 249 | } | 290 | } |
| 250 | 291 | ||
| 251 | console.log('支付参数:', { | 292 | console.log('支付参数:', { | ... | ... |
| ... | @@ -184,6 +184,7 @@ const form = ref({ | ... | @@ -184,6 +184,7 @@ const form = ref({ |
| 184 | }) | 184 | }) |
| 185 | const currentDelItem = ref({}) | 185 | const currentDelItem = ref({}) |
| 186 | const delPopup = ref(null) | 186 | const delPopup = ref(null) |
| 187 | const AUDIT_CACHE_KEY = 'ztx_examination_audit_item' | ||
| 187 | 188 | ||
| 188 | onShow(() => { | 189 | onShow(() => { |
| 189 | if (memId.value) { | 190 | if (memId.value) { |
| ... | @@ -208,18 +209,26 @@ onLoad((options) => { | ... | @@ -208,18 +209,26 @@ onLoad((options) => { |
| 208 | 209 | ||
| 209 | } | 210 | } |
| 210 | userType.value = app.globalData.userType | 211 | userType.value = app.globalData.userType |
| 211 | if (options.item) { | 212 | const itemData = getAuditItem(options) |
| 212 | try { | 213 | if (itemData?.id) { |
| 213 | const itemData = JSON.parse(decodeURIComponent(options.item)) | ||
| 214 | detailForm.value = itemData | 214 | detailForm.value = itemData |
| 215 | photoList.value = normalizePhotos(itemData.photos) | 215 | photoList.value = normalizePhotos(itemData.photos) |
| 216 | } catch (e) { | ||
| 217 | console.error('解析审核详情失败', e) | ||
| 218 | } | ||
| 219 | } | 216 | } |
| 220 | console.log(userType.value) | 217 | console.log(userType.value) |
| 221 | }) | 218 | }) |
| 222 | 219 | ||
| 220 | function getAuditItem(options) { | ||
| 221 | const cacheItem = uni.getStorageSync(AUDIT_CACHE_KEY) | ||
| 222 | if (cacheItem && typeof cacheItem === 'object') return cacheItem | ||
| 223 | if (!options.item) return {} | ||
| 224 | try { | ||
| 225 | return JSON.parse(decodeURIComponent(options.item)) | ||
| 226 | } catch (e) { | ||
| 227 | console.error('解析审核详情失败', e) | ||
| 228 | return {} | ||
| 229 | } | ||
| 230 | } | ||
| 231 | |||
| 223 | function goBack() { | 232 | function goBack() { |
| 224 | uni.navigateBack() | 233 | uni.navigateBack() |
| 225 | } | 234 | } | ... | ... |
| ... | @@ -123,25 +123,43 @@ const examinerList = ref([]) | ... | @@ -123,25 +123,43 @@ const examinerList = ref([]) |
| 123 | const photoList = ref([]) | 123 | const photoList = ref([]) |
| 124 | const userType = ref('') | 124 | const userType = ref('') |
| 125 | const auditStatusMap = {1: '审核中', 2: '审核通过', 3: '审核拒绝'} | 125 | const auditStatusMap = {1: '审核中', 2: '审核通过', 3: '审核拒绝'} |
| 126 | const DETAIL_CACHE_KEY = 'ztx_examination_detail_item' | ||
| 126 | 127 | ||
| 127 | onLoad((options) => { | 128 | onLoad((options) => { |
| 128 | userType.value = app.globalData.userType | 129 | userType.value = app.globalData.userType |
| 129 | if (options.item) { | 130 | const itemData = getDetailItem(options) |
| 130 | try { | 131 | if (itemData?.id) { |
| 131 | const itemData = JSON.parse(decodeURIComponent(options.item)) | ||
| 132 | form.value = itemData | 132 | form.value = itemData |
| 133 | if (itemData.auditLogs) { | 133 | if (itemData.auditLogs) { |
| 134 | auditList.value = JSON.parse(itemData.auditLogs) | 134 | auditList.value = parseAuditLogs(itemData.auditLogs) |
| 135 | } | 135 | } |
| 136 | photoList.value = normalizePhotos(itemData.photos) | 136 | photoList.value = normalizePhotos(itemData.photos) |
| 137 | if (itemData.memId) { | 137 | if (itemData.memId) { |
| 138 | getExaminerList(itemData.memId) | 138 | getExaminerList(itemData.memId) |
| 139 | } | 139 | } |
| 140 | } | ||
| 141 | }) | ||
| 142 | |||
| 143 | function getDetailItem(options) { | ||
| 144 | const cacheItem = uni.getStorageSync(DETAIL_CACHE_KEY) | ||
| 145 | if (cacheItem && typeof cacheItem === 'object') return cacheItem | ||
| 146 | if (!options.item) return {} | ||
| 147 | try { | ||
| 148 | return JSON.parse(decodeURIComponent(options.item)) | ||
| 140 | } catch (e) { | 149 | } catch (e) { |
| 141 | console.error('解析数据失败', e) | 150 | console.error('解析数据失败', e) |
| 151 | return {} | ||
| 142 | } | 152 | } |
| 153 | } | ||
| 154 | |||
| 155 | function parseAuditLogs(auditLogs) { | ||
| 156 | if (Array.isArray(auditLogs)) return auditLogs | ||
| 157 | try { | ||
| 158 | return JSON.parse(auditLogs) | ||
| 159 | } catch (e) { | ||
| 160 | return [] | ||
| 143 | } | 161 | } |
| 144 | }) | 162 | } |
| 145 | 163 | ||
| 146 | function getExaminerList(memId) { | 164 | function getExaminerList(memId) { |
| 147 | api.listInfo({memId: memId}).then(res => { | 165 | api.listInfo({memId: memId}).then(res => { | ... | ... |
| ... | @@ -185,6 +185,8 @@ const tabList = ref([ | ... | @@ -185,6 +185,8 @@ const tabList = ref([ |
| 185 | ]) | 185 | ]) |
| 186 | const currentTab = ref(0) | 186 | const currentTab = ref(0) |
| 187 | const userType = ref('') | 187 | const userType = ref('') |
| 188 | const DETAIL_CACHE_KEY = 'ztx_examination_detail_item' | ||
| 189 | const AUDIT_CACHE_KEY = 'ztx_examination_audit_item' | ||
| 188 | 190 | ||
| 189 | 191 | ||
| 190 | onLoad(() => { | 192 | onLoad(() => { |
| ... | @@ -332,6 +334,7 @@ function toggleSelect(item) { | ... | @@ -332,6 +334,7 @@ function toggleSelect(item) { |
| 332 | } | 334 | } |
| 333 | 335 | ||
| 334 | function goView(item) { | 336 | function goView(item) { |
| 337 | uni.setStorageSync(DETAIL_CACHE_KEY, item) | ||
| 335 | const itemStr = encodeURIComponent(JSON.stringify(item)) | 338 | const itemStr = encodeURIComponent(JSON.stringify(item)) |
| 336 | uni.navigateTo({ | 339 | uni.navigateTo({ |
| 337 | url: `/level/ztx/examinationDetail?item=${itemStr}` | 340 | url: `/level/ztx/examinationDetail?item=${itemStr}` |
| ... | @@ -339,6 +342,7 @@ function goView(item) { | ... | @@ -339,6 +342,7 @@ function goView(item) { |
| 339 | } | 342 | } |
| 340 | 343 | ||
| 341 | function goAudit(item) { | 344 | function goAudit(item) { |
| 345 | uni.setStorageSync(AUDIT_CACHE_KEY, item) | ||
| 342 | const itemStr = encodeURIComponent(JSON.stringify(item)) | 346 | const itemStr = encodeURIComponent(JSON.stringify(item)) |
| 343 | uni.navigateTo({ | 347 | uni.navigateTo({ |
| 344 | url: `/level/ztx/examinationAudit?ids=${item.id}&type=single&selfSelect=${item.selfSelect}&memId=${item.memId}&item=${itemStr}` | 348 | url: `/level/ztx/examinationAudit?ids=${item.id}&type=single&selfSelect=${item.selfSelect}&memId=${item.memId}&item=${itemStr}` | ... | ... |
| ... | @@ -197,11 +197,26 @@ function handleDel(row) { | ... | @@ -197,11 +197,26 @@ function handleDel(row) { |
| 197 | customModalRef.value.open() | 197 | customModalRef.value.open() |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | // 切换考官类型:打开自定义提示弹窗 | 200 | // 切换考官类型:如果已有考官数据,先同步清空后端数据。 |
| 201 | function onSelfSelectChange(e) { | 201 | async function onSelfSelectChange(e) { |
| 202 | form.value.selfSelect = e.detail.value | 202 | const nextValue = e.detail.value |
| 203 | showExamine.value = e.detail.value == '1' | 203 | const prevValue = form.value.selfSelect |
| 204 | if (nextValue === prevValue) return | ||
| 205 | if (list.value.length > 0) { | ||
| 206 | uni.showLoading({title: '清空考官中'}) | ||
| 207 | try { | ||
| 208 | await api.clearMyExaminer() | ||
| 204 | list.value = [] | 209 | list.value = [] |
| 210 | } catch (err) { | ||
| 211 | uni.showToast({title: err?.data?.msg || err?.msg || '清空考官失败,请稍后重试', icon: 'none'}) | ||
| 212 | form.value.selfSelect = prevValue | ||
| 213 | return | ||
| 214 | } finally { | ||
| 215 | uni.hideLoading() | ||
| 216 | } | ||
| 217 | } | ||
| 218 | form.value.selfSelect = nextValue | ||
| 219 | showExamine.value = nextValue == '1' | ||
| 205 | searchResult.value = null | 220 | searchResult.value = null |
| 206 | searchNoData.value = false | 221 | searchNoData.value = false |
| 207 | // if (e.detail.value == '0') { | 222 | // if (e.detail.value == '0') { | ... | ... |
| ... | @@ -22,7 +22,7 @@ | ... | @@ -22,7 +22,7 @@ |
| 22 | <uni-easyinput v-model="form.creditCode" :disabled="isFieldDisabled('creditCode')" /> | 22 | <uni-easyinput v-model="form.creditCode" :disabled="isFieldDisabled('creditCode')" /> |
| 23 | </uni-forms-item> | 23 | </uni-forms-item> |
| 24 | <uni-forms-item label="机构名称" required> | 24 | <uni-forms-item label="机构名称" required> |
| 25 | <uni-easyinput v-model="form.name" :disabled="isFieldDisabled('name')" placeholder="机构名称" /> | 25 | <uni-easyinput v-model="form.name" :disabled="false" placeholder="机构名称" /> |
| 26 | </uni-forms-item> | 26 | </uni-forms-item> |
| 27 | <uni-forms-item label="认证地址" required> | 27 | <uni-forms-item label="认证地址" required> |
| 28 | <uni-data-picker v-model="coordinates1" @change="changeCoordinates1" placeholder="请选择认证地址" | 28 | <uni-data-picker v-model="coordinates1" @change="changeCoordinates1" placeholder="请选择认证地址" | ... | ... |
| ... | @@ -100,7 +100,7 @@ | ... | @@ -100,7 +100,7 @@ |
| 100 | <view v-else class="license-preview"> | 100 | <view v-else class="license-preview"> |
| 101 | <image :src="getImageUrl(getBusinessLicenseUrl())" class="license-img" | 101 | <image :src="getImageUrl(getBusinessLicenseUrl())" class="license-img" |
| 102 | @click="previewImage(getImageUrl(getBusinessLicenseUrl()))"></image> | 102 | @click="previewImage(getImageUrl(getBusinessLicenseUrl()))"></image> |
| 103 | <view v-if="editIng" class="delete-btn" @click="removeBusinessLicense">×</view> | 103 | <view v-if="canEditCertField('businessLicense')" class="delete-btn" @click="removeBusinessLicense">×</view> |
| 104 | </view> | 104 | </view> |
| 105 | </view> | 105 | </view> |
| 106 | </uni-forms-item> | 106 | </uni-forms-item> |
| ... | @@ -131,6 +131,7 @@ | ... | @@ -131,6 +131,7 @@ |
| 131 | class="custom-picker" | 131 | class="custom-picker" |
| 132 | popup-title="请选择所在地区" | 132 | popup-title="请选择所在地区" |
| 133 | @change="changeAddress" | 133 | @change="changeAddress" |
| 134 | :readonly="true" | ||
| 134 | ></uni-data-picker> | 135 | ></uni-data-picker> |
| 135 | </view> | 136 | </view> |
| 136 | </uni-forms-item> | 137 | </uni-forms-item> |
| ... | @@ -142,7 +143,9 @@ | ... | @@ -142,7 +143,9 @@ |
| 142 | <view class="picker-wrapper"> | 143 | <view class="picker-wrapper"> |
| 143 | <uni-data-picker | 144 | <uni-data-picker |
| 144 | v-model="form.parentId" | 145 | v-model="form.parentId" |
| 145 | :disabled="isFieldDisabled('parentId')" | 146 | :disabled="true" |
| 147 | :readonly="true" | ||
| 148 | :clear-icon="false" | ||
| 146 | :level="3" | 149 | :level="3" |
| 147 | :localdata="assoList" | 150 | :localdata="assoList" |
| 148 | class="custom-picker" | 151 | class="custom-picker" |
| ... | @@ -160,7 +163,7 @@ | ... | @@ -160,7 +163,7 @@ |
| 160 | <view v-else class="idcard-preview"> | 163 | <view v-else class="idcard-preview"> |
| 161 | <image :src="getImageUrl(form.legalIdcPhoto1)" class="idcard-img" | 164 | <image :src="getImageUrl(form.legalIdcPhoto1)" class="idcard-img" |
| 162 | @click="previewImage(getImageUrl(form.legalIdcPhoto1))"></image> | 165 | @click="previewImage(getImageUrl(form.legalIdcPhoto1))"></image> |
| 163 | <view v-if="editIng" class="delete-btn" @click="removeIdCardFront">×</view> | 166 | <view v-if="canEditCertField('legalIdcPhoto1')" class="delete-btn" @click="removeIdCardFront">×</view> |
| 164 | </view> | 167 | </view> |
| 165 | </view> | 168 | </view> |
| 166 | </view> | 169 | </view> |
| ... | @@ -172,7 +175,7 @@ | ... | @@ -172,7 +175,7 @@ |
| 172 | <view v-else class="idcard-preview"> | 175 | <view v-else class="idcard-preview"> |
| 173 | <image :src="getImageUrl(form.legalIdcPhoto2)" class="idcard-img" | 176 | <image :src="getImageUrl(form.legalIdcPhoto2)" class="idcard-img" |
| 174 | @click="previewImage(getImageUrl(form.legalIdcPhoto2))"></image> | 177 | @click="previewImage(getImageUrl(form.legalIdcPhoto2))"></image> |
| 175 | <view v-if="editIng" class="delete-btn" @click="removeIdCardBack">×</view> | 178 | <view v-if="canEditCertField('legalIdcPhoto2')" class="delete-btn" @click="removeIdCardBack">×</view> |
| 176 | </view> | 179 | </view> |
| 177 | </view> | 180 | </view> |
| 178 | </view> | 181 | </view> |
| ... | @@ -186,11 +189,11 @@ | ... | @@ -186,11 +189,11 @@ |
| 186 | placeholder="请输入法人证件号"/> | 189 | placeholder="请输入法人证件号"/> |
| 187 | </uni-forms-item> | 190 | </uni-forms-item> |
| 188 | <uni-forms-item label="联系人" required> | 191 | <uni-forms-item label="联系人" required> |
| 189 | <uni-easyinput v-model="form.siteContact" :disabled="!editIng" class="input-with-border" | 192 | <uni-easyinput v-model="form.siteContact" :disabled="!canEditCertField('siteContact')" class="input-with-border" |
| 190 | placeholder="请输入联系人"/> | 193 | placeholder="请输入联系人"/> |
| 191 | </uni-forms-item> | 194 | </uni-forms-item> |
| 192 | <uni-forms-item label="联系方式" required> | 195 | <uni-forms-item label="联系方式" required> |
| 193 | <uni-easyinput v-model="form.siteTel" :disabled="!editIng" class="input-with-border" | 196 | <uni-easyinput v-model="form.siteTel" :disabled="!canEditCertField('siteTel')" class="input-with-border" |
| 194 | placeholder="请输入联系方式"/> | 197 | placeholder="请输入联系方式"/> |
| 195 | </uni-forms-item> | 198 | </uni-forms-item> |
| 196 | <uni-forms-item label="上传机构照片" required> | 199 | <uni-forms-item label="上传机构照片" required> |
| ... | @@ -201,7 +204,7 @@ | ... | @@ -201,7 +204,7 @@ |
| 201 | <view v-else class="pictures-preview"> | 204 | <view v-else class="pictures-preview"> |
| 202 | <image :src="getImageUrl(form.pictures.split(',')[0])" class="picture-img" | 205 | <image :src="getImageUrl(form.pictures.split(',')[0])" class="picture-img" |
| 203 | @click="previewImage(form.pictures.split(',').map(url => getImageUrl(url)))"></image> | 206 | @click="previewImage(form.pictures.split(',').map(url => getImageUrl(url)))"></image> |
| 204 | <view v-if="editIng" class="delete-btn" @click="removePictures">×</view> | 207 | <view v-if="canEditCertField('pictures')" class="delete-btn" @click="removePictures">×</view> |
| 205 | </view> | 208 | </view> |
| 206 | </view> | 209 | </view> |
| 207 | </uni-forms-item> | 210 | </uni-forms-item> |
| ... | @@ -209,7 +212,7 @@ | ... | @@ -209,7 +212,7 @@ |
| 209 | <view class="notice-box"> | 212 | <view class="notice-box"> |
| 210 | <checkbox-group @change="onNoticeChange"> | 213 | <checkbox-group @change="onNoticeChange"> |
| 211 | <label class="notice-label"> | 214 | <label class="notice-label"> |
| 212 | <checkbox :checked="form.notice" :disabled="!editIng" color="#AD181F" value="1"/> | 215 | <checkbox :checked="form.notice" :disabled="!canEditCertField('notice')" color="#AD181F" value="1"/> |
| 213 | <text class="notice-text">我已阅读并同意</text> | 216 | <text class="notice-text">我已阅读并同意</text> |
| 214 | <text class="notice-link" @click.stop="showNotice(1)">《注册须知》</text> | 217 | <text class="notice-link" @click.stop="showNotice(1)">《注册须知》</text> |
| 215 | <text class="notice-link" @click.stop="showNotice(2)">《入会须知》</text> | 218 | <text class="notice-link" @click.stop="showNotice(2)">《入会须知》</text> |
| ... | @@ -426,7 +429,19 @@ const creditCodeValid = ref(true) | ... | @@ -426,7 +429,19 @@ const creditCodeValid = ref(true) |
| 426 | const ocrLockedFields = ref({}) | 429 | const ocrLockedFields = ref({}) |
| 427 | 430 | ||
| 428 | function isFieldDisabled(field) { | 431 | function isFieldDisabled(field) { |
| 429 | return !editIng.value || !!ocrLockedFields.value[field] | 432 | if (!canEditCertField(field)) return true |
| 433 | if (isRejectLimitedMode() && canEditCertField(field)) return false | ||
| 434 | return !!ocrLockedFields.value[field] | ||
| 435 | } | ||
| 436 | |||
| 437 | function isRejectLimitedMode() { | ||
| 438 | return String(authenticationStatus.value) === '3' | ||
| 439 | } | ||
| 440 | |||
| 441 | function canEditCertField(field) { | ||
| 442 | if (!editIng.value) return false | ||
| 443 | if (!isRejectLimitedMode()) return true | ||
| 444 | return ['siteContact', 'siteTel', 'pictures', 'notice'].includes(field) | ||
| 430 | } | 445 | } |
| 431 | 446 | ||
| 432 | function lockOcrField(field, value) { | 447 | function lockOcrField(field, value) { |
| ... | @@ -441,7 +456,7 @@ function unlockOcrFields() { | ... | @@ -441,7 +456,7 @@ function unlockOcrFields() { |
| 441 | 456 | ||
| 442 | // 须知勾选 | 457 | // 须知勾选 |
| 443 | function onNoticeChange(e) { | 458 | function onNoticeChange(e) { |
| 444 | if (!editIng.value) return | 459 | if (!canEditCertField('notice')) return |
| 445 | const values = e.detail.value | 460 | const values = e.detail.value |
| 446 | form.value.notice = values.includes('1') | 461 | form.value.notice = values.includes('1') |
| 447 | } | 462 | } |
| ... | @@ -886,12 +901,8 @@ function findAssoNodeWithPath(list, targetId, currentPath) { | ... | @@ -886,12 +901,8 @@ function findAssoNodeWithPath(list, targetId, currentPath) { |
| 886 | 901 | ||
| 887 | // 协会选择(修复:100%对齐PC端el-cascader emitPath: false逻辑,只取最后一级ID) | 902 | // 协会选择(修复:100%对齐PC端el-cascader emitPath: false逻辑,只取最后一级ID) |
| 888 | function changCase(e) { | 903 | function changCase(e) { |
| 889 | if (isFieldDisabled('parentId')) return | 904 | // 所属协会只展示,不允许在注册引导页手动修改。 |
| 890 | const valueArr = e.detail?.value || e; | 905 | return |
| 891 | // 取最后一级的value(纯ID) | ||
| 892 | const lastNode = valueArr[valueArr.length - 1]; | ||
| 893 | form.value.parentId = lastNode?.value || ''; | ||
| 894 | assoFullName.value = getAssoFullName(valueArr) | ||
| 895 | } | 906 | } |
| 896 | 907 | ||
| 897 | // 地址选择(核心修复:从对象中提取纯value,对齐PC端格式) | 908 | // 地址选择(核心修复:从对象中提取纯value,对齐PC端格式) |
| ... | @@ -1144,7 +1155,7 @@ function submitCertification() { | ... | @@ -1144,7 +1155,7 @@ function submitCertification() { |
| 1144 | 1155 | ||
| 1145 | // 营业执照上传 | 1156 | // 营业执照上传 |
| 1146 | function onBusinessLicenseSelect() { | 1157 | function onBusinessLicenseSelect() { |
| 1147 | if (!editIng.value) return | 1158 | if (!canEditCertField('businessLicense')) return |
| 1148 | uni.chooseImage({ | 1159 | uni.chooseImage({ |
| 1149 | count: 1, | 1160 | count: 1, |
| 1150 | sizeType: ['compressed'], | 1161 | sizeType: ['compressed'], |
| ... | @@ -1173,7 +1184,6 @@ function onBusinessLicenseSelect() { | ... | @@ -1173,7 +1184,6 @@ function onBusinessLicenseSelect() { |
| 1173 | const ocrData = data.data | 1184 | const ocrData = data.data |
| 1174 | form.value.creditCode = ocrData.creditCode || form.value.creditCode | 1185 | form.value.creditCode = ocrData.creditCode || form.value.creditCode |
| 1175 | form.value.companyName = ocrData.companyName || form.value.companyName | 1186 | form.value.companyName = ocrData.companyName || form.value.companyName |
| 1176 | form.value.legal = ocrData.legalPerson || form.value.legal | ||
| 1177 | lockOcrField('creditCode', form.value.creditCode) | 1187 | lockOcrField('creditCode', form.value.creditCode) |
| 1178 | lockOcrField('companyName', form.value.companyName) | 1188 | lockOcrField('companyName', form.value.companyName) |
| 1179 | lockOcrField('legal', form.value.legal) | 1189 | lockOcrField('legal', form.value.legal) |
| ... | @@ -1204,7 +1214,7 @@ function onBusinessLicenseSelect() { | ... | @@ -1204,7 +1214,7 @@ function onBusinessLicenseSelect() { |
| 1204 | } | 1214 | } |
| 1205 | 1215 | ||
| 1206 | function removeBusinessLicense() { | 1216 | function removeBusinessLicense() { |
| 1207 | if (!editIng.value) return | 1217 | if (!canEditCertField('businessLicense')) return |
| 1208 | form.value.businessLicense = '' | 1218 | form.value.businessLicense = '' |
| 1209 | form.value.businessLicenseName = '' | 1219 | form.value.businessLicenseName = '' |
| 1210 | unlockOcrFields() | 1220 | unlockOcrFields() |
| ... | @@ -1326,19 +1336,19 @@ function applyBusinessAddress(address) { | ... | @@ -1326,19 +1336,19 @@ function applyBusinessAddress(address) { |
| 1326 | 1336 | ||
| 1327 | // 删除身份证正面 | 1337 | // 删除身份证正面 |
| 1328 | function removeIdCardFront() { | 1338 | function removeIdCardFront() { |
| 1329 | if (!editIng.value) return | 1339 | if (!canEditCertField('legalIdcPhoto1')) return |
| 1330 | form.value.legalIdcPhoto1 = '' | 1340 | form.value.legalIdcPhoto1 = '' |
| 1331 | } | 1341 | } |
| 1332 | 1342 | ||
| 1333 | // 删除身份证反面 | 1343 | // 删除身份证反面 |
| 1334 | function removeIdCardBack() { | 1344 | function removeIdCardBack() { |
| 1335 | if (!editIng.value) return | 1345 | if (!canEditCertField('legalIdcPhoto2')) return |
| 1336 | form.value.legalIdcPhoto2 = '' | 1346 | form.value.legalIdcPhoto2 = '' |
| 1337 | } | 1347 | } |
| 1338 | 1348 | ||
| 1339 | // 身份证上传 | 1349 | // 身份证上传 |
| 1340 | function onIdCardFrontSelect() { | 1350 | function onIdCardFrontSelect() { |
| 1341 | if (!editIng.value) return | 1351 | if (!canEditCertField('legalIdcPhoto1')) return |
| 1342 | uni.chooseImage({ | 1352 | uni.chooseImage({ |
| 1343 | count: 1, | 1353 | count: 1, |
| 1344 | sizeType: ['compressed'], | 1354 | sizeType: ['compressed'], |
| ... | @@ -1359,7 +1369,7 @@ function onIdCardFrontSelect() { | ... | @@ -1359,7 +1369,7 @@ function onIdCardFrontSelect() { |
| 1359 | } | 1369 | } |
| 1360 | 1370 | ||
| 1361 | function onIdCardBackSelect() { | 1371 | function onIdCardBackSelect() { |
| 1362 | if (!editIng.value) return | 1372 | if (!canEditCertField('legalIdcPhoto2')) return |
| 1363 | uni.chooseImage({ | 1373 | uni.chooseImage({ |
| 1364 | count: 1, | 1374 | count: 1, |
| 1365 | sizeType: ['compressed'], | 1375 | sizeType: ['compressed'], |
| ... | @@ -1405,7 +1415,7 @@ function extractIdCardInfo(tempPath) { | ... | @@ -1405,7 +1415,7 @@ function extractIdCardInfo(tempPath) { |
| 1405 | 1415 | ||
| 1406 | // 机构照片上传 | 1416 | // 机构照片上传 |
| 1407 | function onPicturesSelect() { | 1417 | function onPicturesSelect() { |
| 1408 | if (!editIng.value) return | 1418 | if (!canEditCertField('pictures')) return |
| 1409 | uni.chooseImage({ | 1419 | uni.chooseImage({ |
| 1410 | count: 3, | 1420 | count: 3, |
| 1411 | sizeType: ['compressed'], | 1421 | sizeType: ['compressed'], |
| ... | @@ -1444,7 +1454,7 @@ function previewImage(url) { | ... | @@ -1444,7 +1454,7 @@ function previewImage(url) { |
| 1444 | 1454 | ||
| 1445 | // 删除机构照片 | 1455 | // 删除机构照片 |
| 1446 | function removePictures() { | 1456 | function removePictures() { |
| 1447 | if (!editIng.value) return | 1457 | if (!canEditCertField('pictures')) return |
| 1448 | form.value.pictures = '' | 1458 | form.value.pictures = '' |
| 1449 | } | 1459 | } |
| 1450 | 1460 | ... | ... |
-
Please register or sign in to post a comment