diff --git a/src/api/gxmu/declare-record/index.ts b/src/api/gxmu/declare-record/index.ts new file mode 100644 index 0000000..ecbda09 --- /dev/null +++ b/src/api/gxmu/declare-record/index.ts @@ -0,0 +1,34 @@ +import request from '@/utils/request'; +import type { ApiResult } from '@/api'; + +/** + * 撤回申报:待审核 -> 草稿 + */ +export async function withdrawDeclareRecord(module: string, id: number) { + const res = await request.post>( + '/gxmu/declare-record/withdraw', + { module, id } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 作废申报(等同强制放行,作废后申报人可重新申报) + */ +export async function voidDeclareRecord( + module: string, + id: number, + reason?: string +) { + const res = await request.post>( + '/gxmu/declare-record/void', + { module, id, reason } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/gxmu/declare/model/index.ts b/src/api/gxmu/declare/model/index.ts index b7b6c54..7cc76b6 100644 --- a/src/api/gxmu/declare/model/index.ts +++ b/src/api/gxmu/declare/model/index.ts @@ -36,6 +36,18 @@ export interface Declare { createTime?: string; // 更新时间 updateTime?: string; + // 是否允许重复提交:0否 1是 + allowRepeat?: number; + // 最多同时进行中的申报条数 + maxPending?: number; + // 当前用户在该项目下的最新申报状态:0草稿 1待审核 2通过 3驳回 4作废 + myStatus?: number; + // 当前用户在该项目下的最新申报记录id + myRecordId?: number; + // 当前用户在该项目下的最新申报记录提交时间 + mySubmitTime?: string; + // 当前用户在该项目下的最新申报记录状态备注 + myStatusRemark?: string; // 删除标记:0未删 1已删 deleted?: number; // 是否可申报 @@ -55,4 +67,4 @@ export interface DeclareParam extends PageParam { formProjectGroup?: string; publicProjectType?: string; publicProjectGroup?: string; -} +} \ No newline at end of file diff --git a/src/views/gxmu/QMGCForm/index.vue b/src/views/gxmu/QMGCForm/index.vue index 51a37b4..afc91b3 100644 --- a/src/views/gxmu/QMGCForm/index.vue +++ b/src/views/gxmu/QMGCForm/index.vue @@ -99,6 +99,7 @@ :module="REVIEW_MODULE" module-name="青马工程" :pk="detailCurrent?.id" + @done="reload" /> @import '../toolbar.less'; - + \ No newline at end of file diff --git a/src/views/gxmu/SJQNForm/index.vue b/src/views/gxmu/SJQNForm/index.vue index b61528f..3a4ecbd 100644 --- a/src/views/gxmu/SJQNForm/index.vue +++ b/src/views/gxmu/SJQNForm/index.vue @@ -89,6 +89,7 @@ :module="REVIEW_MODULE" module-name="十佳青年岗位能手" :pk="detailCurrent?.id" + @done="reload" /> @import '../toolbar.less'; - + \ No newline at end of file diff --git a/src/views/gxmu/SJTBZBSJForm/index.vue b/src/views/gxmu/SJTBZBSJForm/index.vue index f8ef83e..523415f 100644 --- a/src/views/gxmu/SJTBZBSJForm/index.vue +++ b/src/views/gxmu/SJTBZBSJForm/index.vue @@ -89,6 +89,7 @@ :module="REVIEW_MODULE" module-name="十佳团支部书记" :pk="detailCurrent?.id" + @done="reload" /> @import '../toolbar.less'; - + \ No newline at end of file diff --git a/src/views/gxmu/TYGLForm/index.vue b/src/views/gxmu/TYGLForm/index.vue index 352f80d..9204e31 100644 --- a/src/views/gxmu/TYGLForm/index.vue +++ b/src/views/gxmu/TYGLForm/index.vue @@ -114,6 +114,7 @@ module="gxmu_tygl_form" module-name="团员管理" :pk="detailCurrent?.id" + @done="reload" /> + \ No newline at end of file diff --git a/src/views/gxmu/TZBCYForm/index.vue b/src/views/gxmu/TZBCYForm/index.vue index fd95a8d..d090a07 100644 --- a/src/views/gxmu/TZBCYForm/index.vue +++ b/src/views/gxmu/TZBCYForm/index.vue @@ -84,6 +84,7 @@ :module="REVIEW_MODULE" module-name="挑战杯" :pk="detailCurrent?.id" + @done="reload" /> @import '../toolbar.less'; - + \ No newline at end of file diff --git a/src/views/gxmu/WSHQTWForm/index.vue b/src/views/gxmu/WSHQTWForm/index.vue index 3a04e1c..08b3728 100644 --- a/src/views/gxmu/WSHQTWForm/index.vue +++ b/src/views/gxmu/WSHQTWForm/index.vue @@ -89,6 +89,7 @@ :module="REVIEW_MODULE" module-name="五四红旗团委" :pk="detailCurrent?.id" + @done="reload" /> @import '../toolbar.less'; - + \ No newline at end of file diff --git a/src/views/gxmu/WSHQTZBForm/index.vue b/src/views/gxmu/WSHQTZBForm/index.vue index 1197f3b..3d3634d 100644 --- a/src/views/gxmu/WSHQTZBForm/index.vue +++ b/src/views/gxmu/WSHQTZBForm/index.vue @@ -89,6 +89,7 @@ :module="REVIEW_MODULE" module-name="五四红旗团支部" :pk="detailCurrent?.id" + @done="reload" /> @import '../toolbar.less'; - + \ No newline at end of file diff --git a/src/views/gxmu/WXXZXForm/index.vue b/src/views/gxmu/WXXZXForm/index.vue index e478630..8c51d74 100644 --- a/src/views/gxmu/WXXZXForm/index.vue +++ b/src/views/gxmu/WXXZXForm/index.vue @@ -105,6 +105,7 @@ :module="REVIEW_MODULE" module-name="未来学术之星" :pk="detailCurrent?.id" + @done="reload" /> + \ No newline at end of file diff --git a/src/views/gxmu/YXGQTDGBForm/index.vue b/src/views/gxmu/YXGQTDGBForm/index.vue index 9f97443..760d44f 100644 --- a/src/views/gxmu/YXGQTDGBForm/index.vue +++ b/src/views/gxmu/YXGQTDGBForm/index.vue @@ -89,6 +89,7 @@ :module="REVIEW_MODULE" module-name="优秀共青团干部" :pk="detailCurrent?.id" + @done="reload" /> @import '../toolbar.less'; - + \ No newline at end of file diff --git a/src/views/gxmu/YXGQTYForm/index.vue b/src/views/gxmu/YXGQTYForm/index.vue index df720a8..a6272f1 100644 --- a/src/views/gxmu/YXGQTYForm/index.vue +++ b/src/views/gxmu/YXGQTYForm/index.vue @@ -333,6 +333,7 @@ :module="REVIEW_MODULE" module-name="优秀共青团员" :pk="detailCurrent?.id" + @done="reload" /> + \ No newline at end of file diff --git a/src/views/gxmu/components/common-import.vue b/src/views/gxmu/components/common-import.vue index f731e43..d3389f5 100644 --- a/src/views/gxmu/components/common-import.vue +++ b/src/views/gxmu/components/common-import.vue @@ -26,6 +26,21 @@

将 Excel 文件拖到此处,或点击上传

+ + + @@ -63,6 +78,8 @@ }>(); const loading = ref(false); + const failures = ref<{ row: number; reason: string }[]>([]); + const successCount = ref(0); const description = computed( () => @@ -141,13 +158,17 @@ if (!rows.length) { throw new Error('导入文件内容为空'); } - const data = rows - .map((row, index) => props.createPayload(row, index + 2)) - .filter((item) => + const entries = rows + .map((row, index) => ({ + rowNo: index + 2, + item: props.createPayload(row, index + 2) + })) + .filter(({ item }) => props.templateFields.some((field) => !!String(item[field.key] ?? '').trim() ) ); + const data = entries.map((entry) => entry.item); if (!data.length) { throw new Error('未识别到有效数据'); } @@ -155,10 +176,28 @@ if (errors.length) { throw new Error(errors.slice(0, 5).join(';')); } - for (const item of data) { - await props.saveItem(item); + failures.value = []; + successCount.value = 0; + for (const entry of entries) { + try { + await props.saveItem(entry.item); + successCount.value += 1; + } catch (e: any) { + failures.value.push({ + row: entry.rowNo, + reason: e?.message || '保存失败' + }); + } } - message.success(`成功导入 ${data.length} 条${props.moduleName}数据`); + if (failures.value.length) { + // 被跳过的是「同一申报项目已有进行中/已通过/被驳回」的记录,保留在清单里供人工处理 + message.warning( + `成功 ${successCount.value} 条,跳过 ${failures.value.length} 条` + ); + emit('done'); + return false; + } + message.success(`成功导入 ${successCount.value} 条${props.moduleName}数据`); updateVisible(false); emit('done'); } catch (e: any) { @@ -169,7 +208,32 @@ return false; }; + const exportFailures = () => { + if (!failures.value.length) { + return; + } + const sheet = utils.aoa_to_sheet([ + ['行号', '跳过原因'], + ...failures.value.map((item) => [item.row, item.reason]) + ]); + sheet['!cols'] = [{ wch: 10 }, { wch: 64 }]; + writeFile( + { + SheetNames: ['失败清单'], + Sheets: { 失败清单: sheet } + }, + `${props.moduleName}导入失败清单.xlsx` + ); + }; + const updateVisible = (value: boolean) => { emit('update:visible', value); }; + diff --git a/src/views/gxmu/declare/components/declareEdit.vue b/src/views/gxmu/declare/components/declareEdit.vue index c5f29d6..bae5869 100644 --- a/src/views/gxmu/declare/components/declareEdit.vue +++ b/src/views/gxmu/declare/components/declareEdit.vue @@ -149,6 +149,19 @@ + + + + + + + \ No newline at end of file diff --git a/src/views/gxmu/declareHistory/index.vue b/src/views/gxmu/declareHistory/index.vue index 9a51be1..3782687 100644 --- a/src/views/gxmu/declareHistory/index.vue +++ b/src/views/gxmu/declareHistory/index.vue @@ -92,6 +92,7 @@ :module="detailCurrent?.module" :module-name="getDeclareModuleLabel(detailCurrent?.module)" :pk="detailCurrent?.id" + @done="loadHistoryData" /> + \ No newline at end of file diff --git a/src/views/gxmu/reviewList/components/moduleDataModal.vue b/src/views/gxmu/reviewList/components/moduleDataModal.vue index 7dad046..f923969 100644 --- a/src/views/gxmu/reviewList/components/moduleDataModal.vue +++ b/src/views/gxmu/reviewList/components/moduleDataModal.vue @@ -11,6 +11,24 @@ @ok="updateVisible(false)" > +
+ + + 撤回申报 + + + 作废申报 + + + + 作废后该申报人可重新申报这个项目;撤回后记录回到草稿,本人可继续修改。 + +
@@ -193,7 +211,12 @@ - + \ No newline at end of file