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
+27 -4
View File
@@ -22,6 +22,8 @@
</view>
<view class="meta-line">手机号:{{ item.phone || '-' }}</view>
<view class="meta-line">团学职务:{{ item.leaguePosition || '-' }}</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>
@@ -128,7 +130,7 @@
<script>
import CommonHero from '../../components/common-hero/common-hero.vue'
import { addQmgcForm, getQmgcForm, listDictData, updateQmgcForm, userPageQmgcForm } from './module-form-service'
import { addQmgcForm, getQmgcForm, listDictData, updateQmgcForm, userPageQmgcForm, withdrawDeclareRecord } from './module-form-service'
const POLITICS_DICT_ID = 172
const NATION_DICT_ID = 173
@@ -184,6 +186,7 @@
showEdit: false,
pageTitle: '青马工程申报',
fixedYear: '',
declareId: '',
list: [],
current: createDefaultForm(),
nationOptions: [],
@@ -240,6 +243,7 @@
}
},
onLoad(options) {
this.declareId = String(options.declareId || options.id || '').trim()
this.fixedYear = String(options.year || '').trim()
this.pageTitle = decodeURIComponent(options.declareTitle || '青马工程申报').trim() || '青马工程申报'
this.loadDictOptions()
@@ -258,7 +262,20 @@
uni.showToast({ title: (error && error.message) || '字典加载失败', icon: 'none' })
}
},
async loadData() {
getRecordStatusText(status) {
const map = { 0: '草稿', 1: '审核中', 2: '已通过', 3: '已驳回', 4: '已作废' }
return map[status] === undefined ? '待提交' : map[status]
},
async withdrawRecord(item) {
try {
await withdrawDeclareRecord('gxmu_qmgc_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 {
const result = await userPageQmgcForm({
@@ -376,7 +393,7 @@
},
async save() {
try {
const payload = { ...this.current, year: this.fixedYear || this.current.year }
const payload = { ...this.current, year: this.fixedYear || this.current.year, declareId: this.declareId ? Number(this.declareId) : undefined }
if (payload.id) {
await updateQmgcForm(payload)
} else {
@@ -432,4 +449,10 @@
.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>