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
+1 -1
View File
@@ -167,7 +167,7 @@
const moduleMeta = getModuleMeta(item.module) const moduleMeta = getModuleMeta(item.module)
const title = String(item.title || '').trim() || ((moduleMeta && moduleMeta.title) || '申报表') const title = String(item.title || '').trim() || ((moduleMeta && moduleMeta.title) || '申报表')
uni.navigateTo({ uni.navigateTo({
url: `/pages/gxmu/form?code=${encodeURIComponent(item.module)}&year=${encodeURIComponent(item.year || '')}&declareTitle=${encodeURIComponent(title)}` url: `/pages/gxmu/form?code=${encodeURIComponent(item.module)}&year=${encodeURIComponent(item.year || '')}&declareId=${encodeURIComponent(item.id)}&declareTitle=${encodeURIComponent(title)}`
}) })
} }
} }
+27 -2
View File
@@ -30,6 +30,8 @@
<view class="card-year">{{ item.year || fixedYear || '-' }}</view> <view class="card-year">{{ item.year || fixedYear || '-' }}</view>
</view> </view>
<view class="meta-line">{{ getRecordMeta(item) }}</view> <view class="meta-line">{{ getRecordMeta(item) }}</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>
</view> </view>
</scroll-view> </scroll-view>
@@ -214,7 +216,8 @@
userPageWshqtwForm, userPageWshqtwForm,
userPageWshqtzbForm, userPageWshqtzbForm,
userPageYxgqtdgbForm, userPageYxgqtdgbForm,
userPageYxgqtyForm userPageYxgqtyForm,
withdrawDeclareRecord
} from './module-form-service' } from './module-form-service'
const STORAGE_PREFIX = 'gxmu_form_draft_' const STORAGE_PREFIX = 'gxmu_form_draft_'
@@ -275,6 +278,7 @@
nationOptions: [], nationOptions: [],
politicsOptions: [], politicsOptions: [],
recordId: '', recordId: '',
declareId: '',
loading: false, loading: false,
showEdit: false, showEdit: false,
list: [], list: [],
@@ -322,6 +326,7 @@
this.fixedYear = fixedYear this.fixedYear = fixedYear
this.declareTitle = declareTitle this.declareTitle = declareTitle
this.recordId = recordId this.recordId = recordId
this.declareId = String(options.declareId || '').trim()
if (config) { if (config) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
@@ -448,6 +453,19 @@
.slice(0, 1) .slice(0, 1)
return parts.length ? parts.join(' · ') : (this.moduleMeta && this.moduleMeta.group) || '申报记录' return parts.length ? parts.join(' · ') : (this.moduleMeta && this.moduleMeta.group) || '申报记录'
}, },
getRecordStatusText(status) {
const map = { 0: '草稿', 1: '审核中', 2: '已通过', 3: '已驳回', 4: '已作废' }
return map[status] === undefined ? '待提交' : map[status]
},
async withdrawRecord(item) {
try {
await withdrawDeclareRecord(this.moduleCode, item.id)
uni.showToast({ title: '已撤回,可继续修改后重新提交', icon: 'none' })
this.loadData()
} catch (error) {
uni.showToast({ title: (error && error.message) || '撤回失败', icon: 'none' })
}
},
getRecordMeta(item) { getRecordMeta(item) {
const pairs = [ const pairs = [
['政治面貌', item && item.politics], ['政治面貌', item && item.politics],
@@ -782,7 +800,8 @@
try { try {
const payload = { const payload = {
...this.formData, ...this.formData,
year: this.fixedYear || this.formData.year year: this.fixedYear || this.formData.year,
declareId: this.declareId ? Number(this.declareId) : undefined
} }
const request = payload.id ? api.update : api.add const request = payload.id ? api.update : api.add
await request({ await request({
@@ -890,4 +909,10 @@
.empty-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48rpx; text-align: center; } .empty-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48rpx; text-align: center; }
.empty-title { font-size: 30rpx; font-weight: 700; color: #1f2329; } .empty-title { font-size: 30rpx; font-weight: 700; color: #1f2329; }
.empty-desc { margin-top: 12rpx; font-size: 24rpx; line-height: 1.7; color: #7b8694; } .empty-desc { margin-top: 12rpx; font-size: 24rpx; line-height: 1.7; color: #7b8694; }
.card-withdraw {
margin-top: 12rpx;
font-size: 22rpx;
color: #cf1322;
}
</style> </style>
+70 -5
View File
@@ -51,7 +51,7 @@
v-for="item in filteredDeclareList" v-for="item in filteredDeclareList"
:key="item.id || `${item.module}-${item.year}`" :key="item.id || `${item.module}-${item.year}`"
class="declare-card" class="declare-card"
:class="{ 'declare-card--disabled': !isModuleSupported(item.module) }" :class="{ 'declare-card--disabled': !isModuleSupported(item.module) || item.myStatus === 1 || item.myStatus === 2 }"
@tap="goApply(item)" @tap="goApply(item)"
> >
<view class="card-top"> <view class="card-top">
@@ -61,9 +61,9 @@
</view> </view>
<view <view
class="card-status" class="card-status"
:class="isModuleSupported(item.module) ? 'card-status--active' : 'card-status--disabled'" :class="getDeclareStatus(item).className"
> >
{{ isModuleSupported(item.module) ? '可申报' : '待支持' }} {{ getDeclareStatus(item).text }}
</view> </view>
</view> </view>
@@ -87,7 +87,7 @@
<view class="card-footer"> <view class="card-footer">
<view class="card-tag">{{ getDeclareGroup(item.module) }}</view> <view class="card-tag">{{ getDeclareGroup(item.module) }}</view>
<view class="card-action"> <view class="card-action">
{{ isModuleSupported(item.module) ? '进入申报' : '暂未开放' }} {{ getDeclareActionText(item) }}
</view> </view>
</view> </view>
</view> </view>
@@ -231,6 +231,37 @@
getDeclareGroup(module) { getDeclareGroup(module) {
return this.getModuleMetaSafe(module).group return this.getModuleMetaSafe(module).group
}, },
getDeclareStatus(item) {
const status = item && item.myStatus
if (status === 0) {
return { text: '草稿', className: 'card-status--draft' }
}
if (status === 1) {
return { text: '审核中', className: 'card-status--pending' }
}
if (status === 2) {
return { text: '已通过', className: 'card-status--passed' }
}
if (status === 3) {
return { text: '已驳回', className: 'card-status--rejected' }
}
if (status === 4) {
return { text: '已作废', className: 'card-status--void' }
}
if (!this.isModuleSupported(item.module)) {
return { text: '待支持', className: 'card-status--disabled' }
}
return { text: '可申报', className: 'card-status--active' }
},
getDeclareActionText(item) {
if (item.myStatus === 1) {
return '审核中'
}
if (item.myStatus === 2) {
return '已通过'
}
return this.isModuleSupported(item.module) ? '进入申报' : '暂未开放'
},
isModuleSupported(module) { isModuleSupported(module) {
return !!getFormConfig(module) return !!getFormConfig(module)
}, },
@@ -305,6 +336,14 @@
} }
}, },
goApply(item) { goApply(item) {
if (item.myStatus === 1) {
this.showToast('该项目你的申报正在审核中,请等待审核结果')
return
}
if (item.myStatus === 2) {
this.showToast('该项目你已通过,不能重复申报')
return
}
if (!item.module) { if (!item.module) {
this.showToast('当前申报项目缺少模块标识') this.showToast('当前申报项目缺少模块标识')
return return
@@ -334,7 +373,8 @@
const query = [ const query = [
`code=${encodeURIComponent(item.module)}`, `code=${encodeURIComponent(item.module)}`,
`year=${encodeURIComponent(item.year || '')}`, `year=${encodeURIComponent(item.year || '')}`,
`declareTitle=${encodeURIComponent(this.getDeclareTitle(item))}` `declareTitle=${encodeURIComponent(this.getDeclareTitle(item))}`,
`declareId=${encodeURIComponent(item.id)}`
] ]
uni.navigateTo({ uni.navigateTo({
url: `/pages/gxmu/form?${query.join('&')}` url: `/pages/gxmu/form?${query.join('&')}`
@@ -628,6 +668,31 @@
color: #8f837d; color: #8f837d;
} }
.card-status--draft {
background: #f0f5ff;
color: #2f54eb;
}
.card-status--pending {
background: #fff7e6;
color: #d46b08;
}
.card-status--passed {
background: #f0f9eb;
color: #389e0d;
}
.card-status--rejected {
background: #fff1f0;
color: #cf1322;
}
.card-status--void {
background: #f5f5f5;
color: #8c8c8c;
}
.card-year { .card-year {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
+8
View File
@@ -49,6 +49,14 @@ export function removeSjqnForm(id) {
return request(`/gxmu/sjqn-form/${id}`, 'DELETE') return request(`/gxmu/sjqn-form/${id}`, 'DELETE')
} }
export function withdrawDeclareRecord(module, id) {
return request('/gxmu/declare-record/withdraw', 'POST', { module, id })
}
export function getDeclareRecord(module, declareId) {
return request('/gxmu/declare-record/mine', 'GET', { module, declareId })
}
export function getDeclare(id) { export function getDeclare(id) {
return request(`/gxmu/declare/${id}`, 'GET') return request(`/gxmu/declare/${id}`, 'GET')
} }
+26 -3
View File
@@ -22,6 +22,8 @@
</view> </view>
<view class="meta-line">手机号:{{ item.phone || '-' }}</view> <view class="meta-line">手机号:{{ item.phone || '-' }}</view>
<view class="meta-line">团学职务:{{ item.leaguePosition || '-' }}</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>
</view> </view>
</scroll-view> </scroll-view>
@@ -128,7 +130,7 @@
<script> <script>
import CommonHero from '../../components/common-hero/common-hero.vue' 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 POLITICS_DICT_ID = 172
const NATION_DICT_ID = 173 const NATION_DICT_ID = 173
@@ -184,6 +186,7 @@
showEdit: false, showEdit: false,
pageTitle: '青马工程申报', pageTitle: '青马工程申报',
fixedYear: '', fixedYear: '',
declareId: '',
list: [], list: [],
current: createDefaultForm(), current: createDefaultForm(),
nationOptions: [], nationOptions: [],
@@ -240,6 +243,7 @@
} }
}, },
onLoad(options) { onLoad(options) {
this.declareId = String(options.declareId || options.id || '').trim()
this.fixedYear = String(options.year || '').trim() this.fixedYear = String(options.year || '').trim()
this.pageTitle = decodeURIComponent(options.declareTitle || '青马工程申报').trim() || '青马工程申报' this.pageTitle = decodeURIComponent(options.declareTitle || '青马工程申报').trim() || '青马工程申报'
this.loadDictOptions() this.loadDictOptions()
@@ -258,7 +262,20 @@
uni.showToast({ title: (error && error.message) || '字典加载失败', icon: 'none' }) 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 this.loading = true
try { try {
const result = await userPageQmgcForm({ const result = await userPageQmgcForm({
@@ -376,7 +393,7 @@
}, },
async save() { async save() {
try { 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) { if (payload.id) {
await updateQmgcForm(payload) await updateQmgcForm(payload)
} else { } 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,.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; } .ghost-btn { background: #f6f7fa; color: #50617a; }
.primary-btn { background: linear-gradient(135deg, #0f7dd1 0%, #1496f2 100%); color: #fff; } .primary-btn { background: linear-gradient(135deg, #0f7dd1 0%, #1496f2 100%); color: #fff; }
.card-withdraw {
margin-top: 12rpx;
font-size: 22rpx;
color: #cf1322;
}
</style> </style>
+25 -3
View File
@@ -30,6 +30,8 @@
</view> </view>
<view class="meta-line">学校:{{ item.schoolName || '-' }}</view> <view class="meta-line">学校:{{ item.schoolName || '-' }}</view>
<view class="meta-line">负责人:{{ getLeaderInfo(item).leader || '-' }} / {{ getLeaderInfo(item).phone || '-' }}</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>
</view> </view>
</scroll-view> </scroll-view>
@@ -255,7 +257,7 @@
<script> <script>
import CommonHero from '../../components/common-hero/common-hero.vue' 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 = [ const FALLBACK_PROJECT_TYPE_OPTIONS = [
{ label: 'I. 普通高校', value: '普通高校' }, { label: 'I. 普通高校', value: '普通高校' },
@@ -431,7 +433,7 @@ export default {
}, },
onLoad(options) { onLoad(options) {
this.fixedYear = String(options.year || '').trim() 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.pageTitle = decodeURIComponent(options.declareTitle || '挑战杯申报').trim() || '挑战杯申报'
this.loadData() this.loadData()
this.loadDeclareConfig() this.loadDeclareConfig()
@@ -486,7 +488,7 @@ export default {
} }
}, },
async loadInitialDetail(options) { async loadInitialDetail(options) {
const id = String((options && options.id) || '').trim() const id = String((options && options.recordId) || '').trim()
if (!id) { if (!id) {
return return
} }
@@ -507,6 +509,19 @@ export default {
this.initializingDetail = false 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() { async loadData() {
this.loading = true this.loading = true
try { try {
@@ -686,6 +701,7 @@ export default {
return { return {
...this.current, ...this.current,
year: this.fixedYear || this.current.year, year: this.fixedYear || this.current.year,
declareId: this.declareId ? Number(this.declareId) : undefined,
leader: leaderInfo.leader, leader: leaderInfo.leader,
phone: leaderInfo.phone 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,.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; } .ghost-btn { background: #f6f7fa; color: #50617a; }
.primary-btn { background: linear-gradient(135deg, #0f7dd1 0%, #1496f2 100%); color: #fff; } .primary-btn { background: linear-gradient(135deg, #0f7dd1 0%, #1496f2 100%); color: #fff; }
.card-withdraw {
margin-top: 12rpx;
font-size: 22rpx;
color: #cf1322;
}
</style> </style>
+26 -3
View File
@@ -22,6 +22,8 @@
</view> </view>
<view class="meta-line">负责人:{{ item.leader || '-' }}</view> <view class="meta-line">负责人:{{ item.leader || '-' }}</view>
<view class="meta-line">联系电话:{{ item.phone || '-' }}</view> <view class="meta-line">联系电话:{{ 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>
</view> </view>
</scroll-view> </scroll-view>
@@ -57,7 +59,7 @@
<script> <script>
import CommonHero from '../../components/common-hero/common-hero.vue' import CommonHero from '../../components/common-hero/common-hero.vue'
import { addWxxzxForm, getWxxzxForm, updateWxxzxForm, userPageWxxzxForm } from './module-form-service' import { addWxxzxForm, getWxxzxForm, updateWxxzxForm, userPageWxxzxForm, withdrawDeclareRecord } from './module-form-service'
const createDefaultForm = () => ({ const createDefaultForm = () => ({
id: undefined, id: undefined,
@@ -93,17 +95,32 @@
showEdit: false, showEdit: false,
pageTitle: '未来学术之星申报', pageTitle: '未来学术之星申报',
fixedYear: '', fixedYear: '',
declareId: '',
list: [], list: [],
current: createDefaultForm() current: createDefaultForm()
} }
}, },
onLoad(options) { onLoad(options) {
this.declareId = String(options.declareId || options.id || '').trim()
this.fixedYear = String(options.year || '').trim() this.fixedYear = String(options.year || '').trim()
this.pageTitle = decodeURIComponent(options.declareTitle || '未来学术之星申报').trim() || '未来学术之星申报' this.pageTitle = decodeURIComponent(options.declareTitle || '未来学术之星申报').trim() || '未来学术之星申报'
this.loadData() this.loadData()
}, },
methods: { methods: {
async loadData() { getRecordStatusText(status) {
const map = { 0: '草稿', 1: '审核中', 2: '已通过', 3: '已驳回', 4: '已作废' }
return map[status] === undefined ? '待提交' : map[status]
},
async withdrawRecord(item) {
try {
await withdrawDeclareRecord('gxmu_wxxzx_project', item.id)
uni.showToast({ title: '已撤回,可继续修改后重新提交', icon: 'none' })
this.loadData()
} catch (error) {
uni.showToast({ title: (error && error.message) || '撤回失败', icon: 'none' })
}
},
async loadData() {
this.loading = true this.loading = true
try { try {
const result = await userPageWxxzxForm({ const result = await userPageWxxzxForm({
@@ -138,7 +155,7 @@
}, },
async save() { async save() {
try { 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) { if (payload.id) {
await updateWxxzxForm(payload) await updateWxxzxForm(payload)
} else { } else {
@@ -191,4 +208,10 @@
.ghost-btn,.primary-btn { height: 84rpx; line-height: 84rpx; border-radius: 22rpx; text-align: center; font-size: 26rpx; font-weight: 700; } .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; } .ghost-btn { background: #f6f7fa; color: #50617a; }
.primary-btn { background: linear-gradient(135deg, #0f7dd1 0%, #1496f2 100%); color: #fff; } .primary-btn { background: linear-gradient(135deg, #0f7dd1 0%, #1496f2 100%); color: #fff; }
.card-withdraw {
margin-top: 12rpx;
font-size: 22rpx;
color: #cf1322;
}
</style> </style>
+1 -1
View File
@@ -162,7 +162,7 @@
const moduleMeta = getModuleMeta(item.module) const moduleMeta = getModuleMeta(item.module)
const title = String(item.title || '').trim() || ((moduleMeta && moduleMeta.title) || '申报表') const title = String(item.title || '').trim() || ((moduleMeta && moduleMeta.title) || '申报表')
uni.navigateTo({ uni.navigateTo({
url: `/pages/gxmu/form?code=${encodeURIComponent(item.module)}&year=${encodeURIComponent(item.year || '')}&declareTitle=${encodeURIComponent(title)}` url: `/pages/gxmu/form?code=${encodeURIComponent(item.module)}&year=${encodeURIComponent(item.year || '')}&declareId=${encodeURIComponent(item.id)}&declareTitle=${encodeURIComponent(title)}`
}) })
} }
} }