实现项目归档功能
This commit is contained in:
@@ -27,24 +27,15 @@
|
||||
</li>
|
||||
<li>
|
||||
<i class="el-icon-check"></i>
|
||||
<span>自动生成项目报告PDF</span>
|
||||
</li>
|
||||
<li>
|
||||
<i class="el-icon-check"></i>
|
||||
<span>移入归档库,可随时查看</span>
|
||||
<span>项目详情中的上传数据与参数配置页签将不可点击</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 删除选项 -->
|
||||
<div class="delete-option">
|
||||
<el-checkbox v-model="deleteData">同时删除项目相关数据(不可恢复)</el-checkbox>
|
||||
</div>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<div class="archive-hint">
|
||||
<i class="el-icon-info"></i>
|
||||
<span>归档后可从"归档库"中查看和恢复</span>
|
||||
<span>归档后项目进入只读查看状态,请确认后继续</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -77,8 +68,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
submitting: false,
|
||||
deleteData: false
|
||||
submitting: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -93,44 +83,21 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
if (!val) {
|
||||
this.deleteData = false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleConfirm() {
|
||||
if (this.deleteData) {
|
||||
this.$confirm('删除后数据将无法恢复,是否确认删除?', '警告', {
|
||||
confirmButtonText: '确认删除',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.doArchive()
|
||||
}).catch(() => {
|
||||
// 取消删除,但仍归档
|
||||
this.deleteData = false
|
||||
this.doArchive()
|
||||
})
|
||||
} else {
|
||||
this.doArchive()
|
||||
}
|
||||
this.doArchive()
|
||||
},
|
||||
doArchive() {
|
||||
this.submitting = true
|
||||
setTimeout(() => {
|
||||
this.submitting = false
|
||||
this.$emit('confirm', {
|
||||
projectId: this.projectData.projectId,
|
||||
deleteData: this.deleteData
|
||||
projectId: this.projectData.projectId
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
handleClose() {
|
||||
this.$emit('close')
|
||||
this.deleteData = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -203,22 +170,6 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.delete-option {
|
||||
margin-bottom: 16px;
|
||||
padding: 12px;
|
||||
background-color: #fef0f0;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #fde2e2;
|
||||
|
||||
:deep(.el-checkbox__label) {
|
||||
color: #F56C6C;
|
||||
}
|
||||
|
||||
:deep(.el-checkbox__input.is-checked + .el-checkbox__label) {
|
||||
color: #F56C6C;
|
||||
}
|
||||
}
|
||||
|
||||
.archive-hint {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="param-config-container" v-loading="loading" element-loading-text="加载中...">
|
||||
<div v-if="isProjectTagging" class="readonly-tip">
|
||||
项目正在进行银行流水打标,参数暂不可修改。
|
||||
<div v-if="isProjectTagging || isProjectArchived" class="readonly-tip">
|
||||
{{ isProjectArchived ? "已归档项目暂不可修改参数。" : "项目正在进行银行流水打标,参数暂不可修改。" }}
|
||||
</div>
|
||||
|
||||
<!-- 模型参数卡片组(垂直堆叠) -->
|
||||
@@ -24,7 +24,7 @@
|
||||
<template #default="{ row }">
|
||||
<el-input
|
||||
v-model="row.paramValue"
|
||||
:disabled="isProjectTagging"
|
||||
:disabled="isProjectTagging || isProjectArchived"
|
||||
placeholder="请输入阈值"
|
||||
@input="markAsModified(model.modelCode, row)"
|
||||
/>
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
<!-- 统一保存按钮 -->
|
||||
<div class="button-section" v-if="!loading && modelGroups.length > 0">
|
||||
<el-button type="primary" :disabled="isProjectTagging || saving" @click="handleSaveAll" :loading="saving">
|
||||
<el-button type="primary" :disabled="isProjectTagging || isProjectArchived || saving" @click="handleSaveAll" :loading="saving">
|
||||
保存所有修改
|
||||
</el-button>
|
||||
<span v-if="modifiedCount > 0" class="modified-tip">
|
||||
@@ -82,6 +82,9 @@ export default {
|
||||
},
|
||||
isProjectTagging() {
|
||||
return String(this.projectInfo.projectStatus) === "3";
|
||||
},
|
||||
isProjectArchived() {
|
||||
return String(this.projectInfo.projectStatus) === "2";
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -159,6 +162,10 @@ export default {
|
||||
},
|
||||
|
||||
async handleSaveAll() {
|
||||
if (this.isProjectArchived) {
|
||||
this.$message.warning("已归档项目暂不可修改参数");
|
||||
return;
|
||||
}
|
||||
if (this.isProjectTagging) {
|
||||
this.$message.warning("项目正在进行银行流水打标,参数暂不可修改");
|
||||
return;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<el-button
|
||||
size="small"
|
||||
icon="el-icon-download"
|
||||
:disabled="isProjectTagging"
|
||||
:disabled="isProjectTagging || isProjectArchived"
|
||||
@click="handleFetchBankInfo"
|
||||
>
|
||||
拉取本行信息
|
||||
@@ -26,7 +26,7 @@
|
||||
<el-button
|
||||
size="small"
|
||||
icon="el-icon-upload2"
|
||||
:disabled="isProjectTagging"
|
||||
:disabled="isProjectTagging || isProjectArchived"
|
||||
@click="handleGoCreditInfoPage"
|
||||
>
|
||||
征信导入
|
||||
@@ -34,8 +34,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="isProjectTagging" class="tagging-lock-tip">
|
||||
项目正在进行银行流水打标,暂不可上传或拉取数据。
|
||||
<div v-if="isProjectTagging || isProjectArchived" class="tagging-lock-tip">
|
||||
{{ isProjectArchived ? "项目已归档,暂不可上传或拉取数据。" : "项目正在进行银行流水打标,暂不可上传或拉取数据。" }}
|
||||
</div>
|
||||
|
||||
<!-- 上传模块 -->
|
||||
@@ -183,7 +183,7 @@
|
||||
v-model="pullBankInfoForm.idCardText"
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
:disabled="isProjectTagging"
|
||||
:disabled="isProjectTagging || isProjectArchived"
|
||||
placeholder="支持逗号、中文逗号、换行分隔"
|
||||
/>
|
||||
<div class="pull-bank-field-tip">
|
||||
@@ -201,7 +201,7 @@
|
||||
:show-file-list="false"
|
||||
:file-list="idCardFileList"
|
||||
accept=".xls,.xlsx"
|
||||
:disabled="isProjectTagging"
|
||||
:disabled="isProjectTagging || isProjectArchived"
|
||||
:on-change="handleIdCardFileChange"
|
||||
:on-remove="handleIdCardFileRemove"
|
||||
>
|
||||
@@ -233,7 +233,7 @@
|
||||
<el-date-picker
|
||||
class="pull-bank-range-picker"
|
||||
v-model="pullBankInfoForm.dateRange"
|
||||
:disabled="isProjectTagging"
|
||||
:disabled="isProjectTagging || isProjectArchived"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
:picker-options="pullBankInfoDatePickerOptions"
|
||||
@@ -247,7 +247,7 @@
|
||||
<el-button @click="pullBankInfoDialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="isProjectTagging"
|
||||
:disabled="isProjectTagging || isProjectArchived"
|
||||
:loading="pullBankInfoLoading"
|
||||
@click="handleConfirmPullBankInfo"
|
||||
>
|
||||
@@ -268,7 +268,7 @@
|
||||
drag
|
||||
action="#"
|
||||
multiple
|
||||
:disabled="isProjectTagging"
|
||||
:disabled="isProjectTagging || isProjectArchived"
|
||||
:auto-upload="false"
|
||||
:on-change="handleBatchFileChange"
|
||||
:show-file-list="false"
|
||||
@@ -307,7 +307,7 @@
|
||||
<el-button @click="batchUploadDialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="isProjectTagging || selectedFiles.length === 0"
|
||||
:disabled="isProjectTagging || isProjectArchived || selectedFiles.length === 0"
|
||||
:loading="uploadLoading"
|
||||
@click="handleBatchUpload"
|
||||
>开始上传</el-button
|
||||
@@ -450,6 +450,9 @@ export default {
|
||||
isProjectTagging() {
|
||||
return String(this.projectInfo.projectStatus) === "3";
|
||||
},
|
||||
isProjectArchived() {
|
||||
return String(this.projectInfo.projectStatus) === "2";
|
||||
},
|
||||
isReportDisabled() {
|
||||
return ["0", "3"].includes(String(this.projectInfo.projectStatus));
|
||||
},
|
||||
@@ -531,7 +534,7 @@ export default {
|
||||
if (card.key === "transaction") {
|
||||
return {
|
||||
...card,
|
||||
disabled: this.isProjectTagging,
|
||||
disabled: this.isProjectTagging || this.isProjectArchived,
|
||||
};
|
||||
}
|
||||
return card;
|
||||
@@ -580,7 +583,7 @@ export default {
|
||||
this.$emit("menu-change", { key: "overview", route: "overview" });
|
||||
},
|
||||
handleGoCreditInfoPage() {
|
||||
if (this.isProjectTagging) {
|
||||
if (this.isProjectTagging || this.isProjectArchived) {
|
||||
return;
|
||||
}
|
||||
this.$router.push("/maintain/creditInfo");
|
||||
@@ -636,6 +639,9 @@ export default {
|
||||
return Array.from(new Set(merged)).join(", ");
|
||||
},
|
||||
async handleIdCardFileChange(file, fileList) {
|
||||
if (this.isProjectTagging || this.isProjectArchived) {
|
||||
return;
|
||||
}
|
||||
const latestFile = (fileList || []).slice(-1);
|
||||
const currentFile = latestFile[0] || file;
|
||||
const fileName = (currentFile && currentFile.name) || "";
|
||||
@@ -716,8 +722,12 @@ export default {
|
||||
return this.parseIdCardText(this.pullBankInfoForm.idCardText);
|
||||
},
|
||||
async handleConfirmPullBankInfo() {
|
||||
if (this.isProjectTagging) {
|
||||
this.$message.warning("项目正在进行银行流水打标,暂不可上传或拉取数据");
|
||||
if (this.isProjectTagging || this.isProjectArchived) {
|
||||
this.$message.warning(
|
||||
this.isProjectArchived
|
||||
? "项目已归档,暂不可上传或拉取数据"
|
||||
: "项目正在进行银行流水打标,暂不可上传或拉取数据"
|
||||
);
|
||||
return;
|
||||
}
|
||||
const idCards = this.buildFinalIdCardList();
|
||||
@@ -776,8 +786,12 @@ export default {
|
||||
},
|
||||
/** 拉取本行信息 */
|
||||
handleFetchBankInfo() {
|
||||
if (this.isProjectTagging) {
|
||||
this.$message.warning("项目正在进行银行流水打标,暂不可上传或拉取数据");
|
||||
if (this.isProjectTagging || this.isProjectArchived) {
|
||||
this.$message.warning(
|
||||
this.isProjectArchived
|
||||
? "项目已归档,暂不可上传或拉取数据"
|
||||
: "项目正在进行银行流水打标,暂不可上传或拉取数据"
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.resetPullBankInfoForm();
|
||||
@@ -868,8 +882,12 @@ export default {
|
||||
|
||||
/** 开始批量上传 */
|
||||
async handleBatchUpload() {
|
||||
if (this.isProjectTagging) {
|
||||
this.$message.warning("项目正在进行银行流水打标,暂不可上传或拉取数据");
|
||||
if (this.isProjectTagging || this.isProjectArchived) {
|
||||
this.$message.warning(
|
||||
this.isProjectArchived
|
||||
? "项目已归档,暂不可上传或拉取数据"
|
||||
: "项目正在进行银行流水打标,暂不可上传或拉取数据"
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (this.selectedFiles.length === 0) {
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
@select="handleMenuSelect"
|
||||
class="nav-menu"
|
||||
>
|
||||
<el-menu-item index="upload">上传数据</el-menu-item>
|
||||
<el-menu-item index="config">参数配置</el-menu-item>
|
||||
<el-menu-item index="upload" :disabled="isArchiveLockedTab('upload')">上传数据</el-menu-item>
|
||||
<el-menu-item index="config" :disabled="isArchiveLockedTab('config')">参数配置</el-menu-item>
|
||||
<el-menu-item index="overview">结果总览</el-menu-item>
|
||||
<el-menu-item index="special">专项排查</el-menu-item>
|
||||
<el-menu-item index="detail">流水明细查询</el-menu-item>
|
||||
@@ -107,6 +107,11 @@ export default {
|
||||
projectStatusPollingLoading: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isProjectArchived() {
|
||||
return String(this.projectInfo.projectStatus) === "2";
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
"$route.params.projectId"(newId) {
|
||||
this.stopProjectStatusPolling();
|
||||
@@ -123,6 +128,10 @@ export default {
|
||||
},
|
||||
"projectInfo.projectStatus"() {
|
||||
this.syncProjectStatusPolling();
|
||||
const accessibleTab = this.resolveAccessibleTab(this.activeTab);
|
||||
if (accessibleTab !== this.activeTab) {
|
||||
this.setActiveTab(accessibleTab);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -138,7 +147,16 @@ export default {
|
||||
const tab = (this.$route.query && this.$route.query.tab) || "";
|
||||
const validTabs = ["upload", "config", "overview", "special", "detail"];
|
||||
const targetTab = validTabs.includes(tab) ? tab : "upload";
|
||||
this.setActiveTab(targetTab);
|
||||
this.setActiveTab(this.resolveAccessibleTab(targetTab));
|
||||
},
|
||||
isArchiveLockedTab(tab) {
|
||||
return this.isProjectArchived && ["upload", "config"].includes(tab);
|
||||
},
|
||||
resolveAccessibleTab(tab) {
|
||||
if (this.isArchiveLockedTab(tab)) {
|
||||
return "overview";
|
||||
}
|
||||
return tab;
|
||||
},
|
||||
setActiveTab(index) {
|
||||
this.activeTab = index;
|
||||
@@ -319,6 +337,9 @@ export default {
|
||||
},
|
||||
/** 菜单选择事件 */
|
||||
handleMenuSelect(index) {
|
||||
if (this.isArchiveLockedTab(index)) {
|
||||
return;
|
||||
}
|
||||
console.log("菜单选择:", index);
|
||||
this.setActiveTab(index);
|
||||
},
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getStatusCounts, listProject, rebuildProjectTags} from '@/api/ccdiProject'
|
||||
import {archiveProject, getStatusCounts, listProject, rebuildProjectTags} from '@/api/ccdiProject'
|
||||
import SearchBar from './components/SearchBar'
|
||||
import ProjectTable from './components/ProjectTable'
|
||||
import QuickEntry from './components/QuickEntry'
|
||||
@@ -268,11 +268,17 @@ export default {
|
||||
this.archiveDialogVisible = true;
|
||||
},
|
||||
/** 确认归档 */
|
||||
handleConfirmArchive(data) {
|
||||
console.log("确认归档:", data);
|
||||
this.$modal.msgSuccess("项目已归档");
|
||||
this.archiveDialogVisible = false;
|
||||
this.getList();
|
||||
async handleConfirmArchive(data) {
|
||||
try {
|
||||
await archiveProject(data.projectId)
|
||||
this.$modal.msgSuccess("项目归档成功")
|
||||
this.archiveDialogVisible = false
|
||||
this.currentArchiveProject = null
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
const message = error && error.message ? error.message : "项目归档失败,请稍后重试"
|
||||
this.$modal.msgError(message)
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user