67e1a42f by lttnew

考点考官

1 parent 8f77dd9a
......@@ -1690,6 +1690,14 @@ export function examinerDel(id) {
})
}
// 清空当前考点申请已选考官
export function clearMyExaminer() {
return request({
url: `/member/examiner/clearMyExaminer`,
method: 'post'
})
}
// 添加考官
export function otherAdd(memId, ids) {
return request({
......
......@@ -229,6 +229,7 @@ const submitAddress = async () => {
form.value.province = region.value[0];
form.value.city = region.value[1];
form.value.area = region.value[2];
form.value.address = `${form.value.province || ''}${form.value.city || ''}${form.value.area || ''}${form.value.a || ''}`;
uni.showLoading({ title: '保存中' });
try {
......
......@@ -21,10 +21,10 @@
<view class="info-card">
<view class="card-header">
<text class="card-title">邮寄信息</text>
<text class="manage-btn" @click="goAddressManage">管理地址</text>
<text v-if="allowEditAddress" class="manage-btn" @click="goAddressManage">管理地址</text>
</view>
<view v-if="selectedAddress.id" class="address-content" @click="goAddressManage">
<view v-if="selectedAddress.id" :class="{ disabled: !allowEditAddress }" class="address-content" @click="goAddressManage">
<view class="address-region">
{{ selectedAddress.province }} {{ selectedAddress.city }} {{ selectedAddress.area }}
</view>
......@@ -38,8 +38,8 @@
</view>
<view v-else class="empty-address" @click="goAddressManage">
<text class="empty-tip">请添加收货地址</text>
<text class="arrow"></text>
<text class="empty-tip">{{ allowEditAddress ? '请添加收货地址' : '暂无订单地址' }}</text>
<text v-if="allowEditAddress" class="arrow"></text>
</view>
</view>
......@@ -120,7 +120,9 @@
</view>
</view>
<view v-if="!selectedAddress.id" class="tip-text">请先选择邮寄地址</view>
<view v-if="!selectedAddress.id" class="tip-text">
{{ allowEditAddress ? '请先选择邮寄地址' : '订单地址异常,请联系管理员' }}
</view>
</view>
</template>
......@@ -136,6 +138,7 @@ const orderId = ref('');
const loading = ref(true);
const examData = ref({});
const selectedAddress = ref({});
const examInfo = ref({});
const memberInfo = ref({});
const deptInfo = ref({});
const payType = ref('2');
......@@ -146,6 +149,7 @@ const formData = ref({
// 判断是再次支付还是新订单
const isRePay = computed(() => !!orderId.value);
const allowEditAddress = computed(() => !isRePay.value);
// 级别标签
const levelTags = computed(() => {
......@@ -188,6 +192,10 @@ onMounted(() => {
});
onShow(() => {
if (!allowEditAddress.value) {
getExamAddress();
return
}
// 检查是否有选中的地址带回
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
......@@ -230,7 +238,40 @@ const getDefaultAddress = async () => {
}
};
const getExamAddress = async () => {
if (!examId.value) return
try {
const res = await api.getLevelApplyInfo(examId.value)
const data = res.data || {}
examInfo.value = data
const address = data.postAddress || {}
if (address.id) {
selectedAddress.value = normalizePostAddress(address)
return
}
} catch (e) {
console.error('获取考试地址失败', e)
}
};
function normalizePostAddress(address = {}) {
return {
id: address.id,
province: address.province || '',
city: address.city || '',
area: address.area || '',
a: address.a || '',
name: address.name || '',
phone: address.phone || '',
defaultFlag: address.defaultFlag
}
}
const goAddressManage = () => {
if (!allowEditAddress.value) {
uni.showToast({title: '重新支付订单不可修改地址', icon: 'none'})
return
}
uni.navigateTo({
url: '/level/addressManage'
});
......@@ -245,7 +286,7 @@ const onPayTypeChange = (e) => {
const handleSubmit = async () => {
if (!selectedAddress.value.id) {
return uni.showToast({title: '请先选择地址', icon: 'none'});
return uni.showToast({title: allowEditAddress.value ? '请先选择地址' : '订单地址异常,请联系管理员', icon: 'none'});
}
console.log('支付参数:', {
......
......@@ -184,6 +184,7 @@ const form = ref({
})
const currentDelItem = ref({})
const delPopup = ref(null)
const AUDIT_CACHE_KEY = 'ztx_examination_audit_item'
onShow(() => {
if (memId.value) {
......@@ -208,18 +209,26 @@ onLoad((options) => {
}
userType.value = app.globalData.userType
if (options.item) {
try {
const itemData = JSON.parse(decodeURIComponent(options.item))
const itemData = getAuditItem(options)
if (itemData?.id) {
detailForm.value = itemData
photoList.value = normalizePhotos(itemData.photos)
} catch (e) {
console.error('解析审核详情失败', e)
}
}
console.log(userType.value)
})
function getAuditItem(options) {
const cacheItem = uni.getStorageSync(AUDIT_CACHE_KEY)
if (cacheItem && typeof cacheItem === 'object') return cacheItem
if (!options.item) return {}
try {
return JSON.parse(decodeURIComponent(options.item))
} catch (e) {
console.error('解析审核详情失败', e)
return {}
}
}
function goBack() {
uni.navigateBack()
}
......
......@@ -123,25 +123,43 @@ const examinerList = ref([])
const photoList = ref([])
const userType = ref('')
const auditStatusMap = {1: '审核中', 2: '审核通过', 3: '审核拒绝'}
const DETAIL_CACHE_KEY = 'ztx_examination_detail_item'
onLoad((options) => {
userType.value = app.globalData.userType
if (options.item) {
try {
const itemData = JSON.parse(decodeURIComponent(options.item))
const itemData = getDetailItem(options)
if (itemData?.id) {
form.value = itemData
if (itemData.auditLogs) {
auditList.value = JSON.parse(itemData.auditLogs)
auditList.value = parseAuditLogs(itemData.auditLogs)
}
photoList.value = normalizePhotos(itemData.photos)
if (itemData.memId) {
getExaminerList(itemData.memId)
}
}
})
function getDetailItem(options) {
const cacheItem = uni.getStorageSync(DETAIL_CACHE_KEY)
if (cacheItem && typeof cacheItem === 'object') return cacheItem
if (!options.item) return {}
try {
return JSON.parse(decodeURIComponent(options.item))
} catch (e) {
console.error('解析数据失败', e)
return {}
}
}
function parseAuditLogs(auditLogs) {
if (Array.isArray(auditLogs)) return auditLogs
try {
return JSON.parse(auditLogs)
} catch (e) {
return []
}
})
}
function getExaminerList(memId) {
api.listInfo({memId: memId}).then(res => {
......
......@@ -185,6 +185,8 @@ const tabList = ref([
])
const currentTab = ref(0)
const userType = ref('')
const DETAIL_CACHE_KEY = 'ztx_examination_detail_item'
const AUDIT_CACHE_KEY = 'ztx_examination_audit_item'
onLoad(() => {
......@@ -332,6 +334,7 @@ function toggleSelect(item) {
}
function goView(item) {
uni.setStorageSync(DETAIL_CACHE_KEY, item)
const itemStr = encodeURIComponent(JSON.stringify(item))
uni.navigateTo({
url: `/level/ztx/examinationDetail?item=${itemStr}`
......@@ -339,6 +342,7 @@ function goView(item) {
}
function goAudit(item) {
uni.setStorageSync(AUDIT_CACHE_KEY, item)
const itemStr = encodeURIComponent(JSON.stringify(item))
uni.navigateTo({
url: `/level/ztx/examinationAudit?ids=${item.id}&type=single&selfSelect=${item.selfSelect}&memId=${item.memId}&item=${itemStr}`
......
......@@ -197,11 +197,26 @@ function handleDel(row) {
customModalRef.value.open()
}
// 切换考官类型:打开自定义提示弹窗
function onSelfSelectChange(e) {
form.value.selfSelect = e.detail.value
showExamine.value = e.detail.value == '1'
// 切换考官类型:如果已有考官数据,先同步清空后端数据。
async function onSelfSelectChange(e) {
const nextValue = e.detail.value
const prevValue = form.value.selfSelect
if (nextValue === prevValue) return
if (list.value.length > 0) {
uni.showLoading({title: '清空考官中'})
try {
await api.clearMyExaminer()
list.value = []
} catch (err) {
uni.showToast({title: err?.data?.msg || err?.msg || '清空考官失败,请稍后重试', icon: 'none'})
form.value.selfSelect = prevValue
return
} finally {
uni.hideLoading()
}
}
form.value.selfSelect = nextValue
showExamine.value = nextValue == '1'
searchResult.value = null
searchNoData.value = false
// if (e.detail.value == '0') {
......
......@@ -22,7 +22,7 @@
<uni-easyinput v-model="form.creditCode" :disabled="isFieldDisabled('creditCode')" />
</uni-forms-item>
<uni-forms-item label="机构名称" required>
<uni-easyinput v-model="form.name" :disabled="isFieldDisabled('name')" placeholder="机构名称" />
<uni-easyinput v-model="form.name" :disabled="false" placeholder="机构名称" />
</uni-forms-item>
<uni-forms-item label="认证地址" required>
<uni-data-picker v-model="coordinates1" @change="changeCoordinates1" placeholder="请选择认证地址"
......
......@@ -100,7 +100,7 @@
<view v-else class="license-preview">
<image :src="getImageUrl(getBusinessLicenseUrl())" class="license-img"
@click="previewImage(getImageUrl(getBusinessLicenseUrl()))"></image>
<view v-if="editIng" class="delete-btn" @click="removeBusinessLicense">×</view>
<view v-if="canEditCertField('businessLicense')" class="delete-btn" @click="removeBusinessLicense">×</view>
</view>
</view>
</uni-forms-item>
......@@ -131,6 +131,7 @@
class="custom-picker"
popup-title="请选择所在地区"
@change="changeAddress"
:readonly="true"
></uni-data-picker>
</view>
</uni-forms-item>
......@@ -142,7 +143,9 @@
<view class="picker-wrapper">
<uni-data-picker
v-model="form.parentId"
:disabled="isFieldDisabled('parentId')"
:disabled="true"
:readonly="true"
:clear-icon="false"
:level="3"
:localdata="assoList"
class="custom-picker"
......@@ -160,7 +163,7 @@
<view v-else class="idcard-preview">
<image :src="getImageUrl(form.legalIdcPhoto1)" class="idcard-img"
@click="previewImage(getImageUrl(form.legalIdcPhoto1))"></image>
<view v-if="editIng" class="delete-btn" @click="removeIdCardFront">×</view>
<view v-if="canEditCertField('legalIdcPhoto1')" class="delete-btn" @click="removeIdCardFront">×</view>
</view>
</view>
</view>
......@@ -172,7 +175,7 @@
<view v-else class="idcard-preview">
<image :src="getImageUrl(form.legalIdcPhoto2)" class="idcard-img"
@click="previewImage(getImageUrl(form.legalIdcPhoto2))"></image>
<view v-if="editIng" class="delete-btn" @click="removeIdCardBack">×</view>
<view v-if="canEditCertField('legalIdcPhoto2')" class="delete-btn" @click="removeIdCardBack">×</view>
</view>
</view>
</view>
......@@ -186,11 +189,11 @@
placeholder="请输入法人证件号"/>
</uni-forms-item>
<uni-forms-item label="联系人" required>
<uni-easyinput v-model="form.siteContact" :disabled="!editIng" class="input-with-border"
<uni-easyinput v-model="form.siteContact" :disabled="!canEditCertField('siteContact')" class="input-with-border"
placeholder="请输入联系人"/>
</uni-forms-item>
<uni-forms-item label="联系方式" required>
<uni-easyinput v-model="form.siteTel" :disabled="!editIng" class="input-with-border"
<uni-easyinput v-model="form.siteTel" :disabled="!canEditCertField('siteTel')" class="input-with-border"
placeholder="请输入联系方式"/>
</uni-forms-item>
<uni-forms-item label="上传机构照片" required>
......@@ -201,7 +204,7 @@
<view v-else class="pictures-preview">
<image :src="getImageUrl(form.pictures.split(',')[0])" class="picture-img"
@click="previewImage(form.pictures.split(',').map(url => getImageUrl(url)))"></image>
<view v-if="editIng" class="delete-btn" @click="removePictures">×</view>
<view v-if="canEditCertField('pictures')" class="delete-btn" @click="removePictures">×</view>
</view>
</view>
</uni-forms-item>
......@@ -209,7 +212,7 @@
<view class="notice-box">
<checkbox-group @change="onNoticeChange">
<label class="notice-label">
<checkbox :checked="form.notice" :disabled="!editIng" color="#AD181F" value="1"/>
<checkbox :checked="form.notice" :disabled="!canEditCertField('notice')" color="#AD181F" value="1"/>
<text class="notice-text">我已阅读并同意</text>
<text class="notice-link" @click.stop="showNotice(1)">《注册须知》</text>
<text class="notice-link" @click.stop="showNotice(2)">《入会须知》</text>
......@@ -426,7 +429,19 @@ const creditCodeValid = ref(true)
const ocrLockedFields = ref({})
function isFieldDisabled(field) {
return !editIng.value || !!ocrLockedFields.value[field]
if (!canEditCertField(field)) return true
if (isRejectLimitedMode() && canEditCertField(field)) return false
return !!ocrLockedFields.value[field]
}
function isRejectLimitedMode() {
return String(authenticationStatus.value) === '3'
}
function canEditCertField(field) {
if (!editIng.value) return false
if (!isRejectLimitedMode()) return true
return ['siteContact', 'siteTel', 'pictures', 'notice'].includes(field)
}
function lockOcrField(field, value) {
......@@ -441,7 +456,7 @@ function unlockOcrFields() {
// 须知勾选
function onNoticeChange(e) {
if (!editIng.value) return
if (!canEditCertField('notice')) return
const values = e.detail.value
form.value.notice = values.includes('1')
}
......@@ -886,12 +901,8 @@ function findAssoNodeWithPath(list, targetId, currentPath) {
// 协会选择(修复:100%对齐PC端el-cascader emitPath: false逻辑,只取最后一级ID)
function changCase(e) {
if (isFieldDisabled('parentId')) return
const valueArr = e.detail?.value || e;
// 取最后一级的value(纯ID)
const lastNode = valueArr[valueArr.length - 1];
form.value.parentId = lastNode?.value || '';
assoFullName.value = getAssoFullName(valueArr)
// 所属协会只展示,不允许在注册引导页手动修改。
return
}
// 地址选择(核心修复:从对象中提取纯value,对齐PC端格式)
......@@ -1144,7 +1155,7 @@ function submitCertification() {
// 营业执照上传
function onBusinessLicenseSelect() {
if (!editIng.value) return
if (!canEditCertField('businessLicense')) return
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
......@@ -1173,7 +1184,6 @@ function onBusinessLicenseSelect() {
const ocrData = data.data
form.value.creditCode = ocrData.creditCode || form.value.creditCode
form.value.companyName = ocrData.companyName || form.value.companyName
form.value.legal = ocrData.legalPerson || form.value.legal
lockOcrField('creditCode', form.value.creditCode)
lockOcrField('companyName', form.value.companyName)
lockOcrField('legal', form.value.legal)
......@@ -1204,7 +1214,7 @@ function onBusinessLicenseSelect() {
}
function removeBusinessLicense() {
if (!editIng.value) return
if (!canEditCertField('businessLicense')) return
form.value.businessLicense = ''
form.value.businessLicenseName = ''
unlockOcrFields()
......@@ -1326,19 +1336,19 @@ function applyBusinessAddress(address) {
// 删除身份证正面
function removeIdCardFront() {
if (!editIng.value) return
if (!canEditCertField('legalIdcPhoto1')) return
form.value.legalIdcPhoto1 = ''
}
// 删除身份证反面
function removeIdCardBack() {
if (!editIng.value) return
if (!canEditCertField('legalIdcPhoto2')) return
form.value.legalIdcPhoto2 = ''
}
// 身份证上传
function onIdCardFrontSelect() {
if (!editIng.value) return
if (!canEditCertField('legalIdcPhoto1')) return
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
......@@ -1359,7 +1369,7 @@ function onIdCardFrontSelect() {
}
function onIdCardBackSelect() {
if (!editIng.value) return
if (!canEditCertField('legalIdcPhoto2')) return
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
......@@ -1405,7 +1415,7 @@ function extractIdCardInfo(tempPath) {
// 机构照片上传
function onPicturesSelect() {
if (!editIng.value) return
if (!canEditCertField('pictures')) return
uni.chooseImage({
count: 3,
sizeType: ['compressed'],
......@@ -1444,7 +1454,7 @@ function previewImage(url) {
// 删除机构照片
function removePictures() {
if (!editIng.value) return
if (!canEditCertField('pictures')) return
form.value.pictures = ''
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!