feat(declare): 申报项目列表展示审核状态并透传申报项目id
- 列表按本人状态显示草稿/审核中/已通过/已驳回/已作废,审核中与已通过时禁止进入 - 各申报页提交时透传 declareId,6 个通用模块此前不传导致无法判重 - 各模块列表显示审核状态并支持撤回 - 挑战杯页不再把申报项目 id 当作申报记录 id 加载详情
This commit is contained in:
@@ -167,7 +167,7 @@
|
||||
const moduleMeta = getModuleMeta(item.module)
|
||||
const title = String(item.title || '').trim() || ((moduleMeta && moduleMeta.title) || '申报表')
|
||||
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)}`
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -370,4 +370,4 @@
|
||||
color: #1496f2;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
+28
-3
@@ -30,6 +30,8 @@
|
||||
<view class="card-year">{{ item.year || fixedYear || '-' }}</view>
|
||||
</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>
|
||||
</scroll-view>
|
||||
@@ -214,7 +216,8 @@
|
||||
userPageWshqtwForm,
|
||||
userPageWshqtzbForm,
|
||||
userPageYxgqtdgbForm,
|
||||
userPageYxgqtyForm
|
||||
userPageYxgqtyForm,
|
||||
withdrawDeclareRecord
|
||||
} from './module-form-service'
|
||||
|
||||
const STORAGE_PREFIX = 'gxmu_form_draft_'
|
||||
@@ -275,6 +278,7 @@
|
||||
nationOptions: [],
|
||||
politicsOptions: [],
|
||||
recordId: '',
|
||||
declareId: '',
|
||||
loading: false,
|
||||
showEdit: false,
|
||||
list: [],
|
||||
@@ -322,6 +326,7 @@
|
||||
this.fixedYear = fixedYear
|
||||
this.declareTitle = declareTitle
|
||||
this.recordId = recordId
|
||||
this.declareId = String(options.declareId || '').trim()
|
||||
|
||||
if (config) {
|
||||
uni.setNavigationBarTitle({
|
||||
@@ -448,6 +453,19 @@
|
||||
.slice(0, 1)
|
||||
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) {
|
||||
const pairs = [
|
||||
['政治面貌', item && item.politics],
|
||||
@@ -782,7 +800,8 @@
|
||||
try {
|
||||
const payload = {
|
||||
...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
|
||||
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-title { font-size: 30rpx; font-weight: 700; color: #1f2329; }
|
||||
.empty-desc { margin-top: 12rpx; font-size: 24rpx; line-height: 1.7; color: #7b8694; }
|
||||
</style>
|
||||
.card-withdraw {
|
||||
margin-top: 12rpx;
|
||||
font-size: 22rpx;
|
||||
color: #cf1322;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -51,7 +51,7 @@
|
||||
v-for="item in filteredDeclareList"
|
||||
:key="item.id || `${item.module}-${item.year}`"
|
||||
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)"
|
||||
>
|
||||
<view class="card-top">
|
||||
@@ -61,9 +61,9 @@
|
||||
</view>
|
||||
<view
|
||||
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>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
<view class="card-footer">
|
||||
<view class="card-tag">{{ getDeclareGroup(item.module) }}</view>
|
||||
<view class="card-action">
|
||||
{{ isModuleSupported(item.module) ? '进入申报' : '暂未开放' }}
|
||||
{{ getDeclareActionText(item) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -231,6 +231,37 @@
|
||||
getDeclareGroup(module) {
|
||||
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) {
|
||||
return !!getFormConfig(module)
|
||||
},
|
||||
@@ -305,6 +336,14 @@
|
||||
}
|
||||
},
|
||||
goApply(item) {
|
||||
if (item.myStatus === 1) {
|
||||
this.showToast('该项目你的申报正在审核中,请等待审核结果')
|
||||
return
|
||||
}
|
||||
if (item.myStatus === 2) {
|
||||
this.showToast('该项目你已通过,不能重复申报')
|
||||
return
|
||||
}
|
||||
if (!item.module) {
|
||||
this.showToast('当前申报项目缺少模块标识')
|
||||
return
|
||||
@@ -334,7 +373,8 @@
|
||||
const query = [
|
||||
`code=${encodeURIComponent(item.module)}`,
|
||||
`year=${encodeURIComponent(item.year || '')}`,
|
||||
`declareTitle=${encodeURIComponent(this.getDeclareTitle(item))}`
|
||||
`declareTitle=${encodeURIComponent(this.getDeclareTitle(item))}`,
|
||||
`declareId=${encodeURIComponent(item.id)}`
|
||||
]
|
||||
uni.navigateTo({
|
||||
url: `/pages/gxmu/form?${query.join('&')}`
|
||||
@@ -628,6 +668,31 @@
|
||||
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 {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -694,4 +759,4 @@
|
||||
font-weight: 600;
|
||||
color: #1496f2;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -49,6 +49,14 @@ export function removeSjqnForm(id) {
|
||||
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) {
|
||||
return request(`/gxmu/declare/${id}`, 'GET')
|
||||
}
|
||||
@@ -209,4 +217,4 @@ export function uploadTempFile(file) {
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
+27
-4
@@ -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>
|
||||
@@ -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>
|
||||
@@ -22,6 +22,8 @@
|
||||
</view>
|
||||
<view class="meta-line">负责人:{{ item.leader || '-' }}</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>
|
||||
</scroll-view>
|
||||
@@ -57,7 +59,7 @@
|
||||
|
||||
<script>
|
||||
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 = () => ({
|
||||
id: undefined,
|
||||
@@ -93,17 +95,32 @@
|
||||
showEdit: false,
|
||||
pageTitle: '未来学术之星申报',
|
||||
fixedYear: '',
|
||||
declareId: '',
|
||||
list: [],
|
||||
current: createDefaultForm()
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.declareId = String(options.declareId || options.id || '').trim()
|
||||
this.fixedYear = String(options.year || '').trim()
|
||||
this.pageTitle = decodeURIComponent(options.declareTitle || '未来学术之星申报').trim() || '未来学术之星申报'
|
||||
this.loadData()
|
||||
},
|
||||
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
|
||||
try {
|
||||
const result = await userPageWxxzxForm({
|
||||
@@ -138,7 +155,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 updateWxxzxForm(payload)
|
||||
} 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 { 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>
|
||||
@@ -162,7 +162,7 @@
|
||||
const moduleMeta = getModuleMeta(item.module)
|
||||
const title = String(item.title || '').trim() || ((moduleMeta && moduleMeta.title) || '申报表')
|
||||
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)}`
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -352,4 +352,4 @@
|
||||
color: #1496f2;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user