feat(declare): 申报项目列表展示审核状态并透传申报项目id

- 列表按本人状态显示草稿/审核中/已通过/已驳回/已作废,审核中与已通过时禁止进入
- 各申报页提交时透传 declareId,6 个通用模块此前不传导致无法判重
- 各模块列表显示审核状态并支持撤回
- 挑战杯页不再把申报项目 id 当作申报记录 id 加载详情
This commit is contained in:
2026-11-02 19:28:57 +08:00
parent 6acb8ba4b9
commit 98521fdc71
8 changed files with 192 additions and 26 deletions
+26 -4
View File
@@ -30,6 +30,8 @@
</view>
<view class="meta-line">学校:{{ item.schoolName || '-' }}</view>
<view class="meta-line">负责人:{{ getLeaderInfo(item).leader || '-' }} / {{ getLeaderInfo(item).phone || '-' }}</view>
<view class="meta-line">审核状态:{{ getRecordStatusText(item.declareStatus) }}</view>
<view v-if="item.declareStatus === 1" class="card-withdraw" @tap.stop="withdrawRecord(item)">撤回申报</view>
</view>
</view>
</scroll-view>
@@ -255,7 +257,7 @@
<script>
import CommonHero from '../../components/common-hero/common-hero.vue'
import { addTzbcyForm, getDeclare, getTzbcyForm, uploadTempFile, userPageTzbcyForm } from './module-form-service'
import { addTzbcyForm, getDeclare, getTzbcyForm, uploadTempFile, userPageTzbcyForm, withdrawDeclareRecord } from './module-form-service'
const FALLBACK_PROJECT_TYPE_OPTIONS = [
{ label: 'I. 普通高校', value: '普通高校' },
@@ -431,7 +433,7 @@ export default {
},
onLoad(options) {
this.fixedYear = String(options.year || '').trim()
this.declareId = String(options.id || '').trim()
this.declareId = String(options.declareId || options.id || '').trim()
this.pageTitle = decodeURIComponent(options.declareTitle || '挑战杯申报').trim() || '挑战杯申报'
this.loadData()
this.loadDeclareConfig()
@@ -486,7 +488,7 @@ export default {
}
},
async loadInitialDetail(options) {
const id = String((options && options.id) || '').trim()
const id = String((options && options.recordId) || '').trim()
if (!id) {
return
}
@@ -507,6 +509,19 @@ export default {
this.initializingDetail = false
}
},
getRecordStatusText(status) {
const map = { 0: '草稿', 1: '审核中', 2: '已通过', 3: '已驳回', 4: '已作废' }
return map[status] === undefined ? '待提交' : map[status]
},
async withdrawRecord(item) {
try {
await withdrawDeclareRecord('gxmu_tzbcy_form', item.id)
uni.showToast({ title: '已撤回,可继续修改后重新提交', icon: 'none' })
this.loadData()
} catch (error) {
uni.showToast({ title: (error && error.message) || '撤回失败', icon: 'none' })
}
},
async loadData() {
this.loading = true
try {
@@ -686,6 +701,7 @@ export default {
return {
...this.current,
year: this.fixedYear || this.current.year,
declareId: this.declareId ? Number(this.declareId) : undefined,
leader: leaderInfo.leader,
phone: leaderInfo.phone
}
@@ -786,4 +802,10 @@ export default {
.ghost-btn,.primary-btn { height: 84rpx; line-height: 84rpx; border-radius: 22rpx; text-align: center; font-size: 26rpx; font-weight: 700; }
.ghost-btn { background: #f6f7fa; color: #50617a; }
.primary-btn { background: linear-gradient(135deg, #0f7dd1 0%, #1496f2 100%); color: #fff; }
</style>
.card-withdraw {
margin-top: 12rpx;
font-size: 22rpx;
color: #cf1322;
}
</style>