|
|
|
@ -43,6 +43,7 @@ |
|
|
|
<div class="mb-25 flex between"> |
|
|
|
<div class="mb-25 flex between"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" @click="handleAdd">添加</el-button> |
|
|
|
<el-button type="primary" @click="handleAdd">添加</el-button> |
|
|
|
|
|
|
|
<el-button type="danger" @click="handleBatchDel" :disabled="selectedRows.length === 0">批量删除</el-button> |
|
|
|
<el-button type="primary" @click="handleImport">数据导入</el-button> |
|
|
|
<el-button type="primary" @click="handleImport">数据导入</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
@ -57,7 +58,8 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</header> |
|
|
|
</header> |
|
|
|
<div class="table-container" v-loading="loading"> |
|
|
|
<div class="table-container" v-loading="loading"> |
|
|
|
<el-table :data="list"> |
|
|
|
<el-table :data="list" @selection-change="handleSelectionChange" ref="tableRef"> |
|
|
|
|
|
|
|
<el-table-column type="selection" width="55"/> |
|
|
|
<el-table-column label="审计类型" width="140" prop="auditType"> |
|
|
|
<el-table-column label="审计类型" width="140" prop="auditType"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<template #default="{ row }"> |
|
|
|
{{ getAuditTypeLabel(row.auditType) }} |
|
|
|
{{ getAuditTypeLabel(row.auditType) }} |
|
|
|
@ -211,6 +213,9 @@ const query = ref({ |
|
|
|
auditTimeList: [] |
|
|
|
auditTimeList: [] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const selectedRows = ref([]); |
|
|
|
|
|
|
|
const tableRef = ref(); |
|
|
|
|
|
|
|
|
|
|
|
const list = ref([]); |
|
|
|
const list = ref([]); |
|
|
|
const total = ref(0); |
|
|
|
const total = ref(0); |
|
|
|
const loading = ref(false); |
|
|
|
const loading = ref(false); |
|
|
|
@ -253,6 +258,7 @@ const submitLoading = ref(false); |
|
|
|
const createEmptyForm = () => ({ |
|
|
|
const createEmptyForm = () => ({ |
|
|
|
id: null, |
|
|
|
id: null, |
|
|
|
auditType: '', |
|
|
|
auditType: '', |
|
|
|
|
|
|
|
auditTypeName: '', |
|
|
|
projectName: '', |
|
|
|
projectName: '', |
|
|
|
secondLevelDeptId: null, |
|
|
|
secondLevelDeptId: null, |
|
|
|
secondLevelDeptName: '', |
|
|
|
secondLevelDeptName: '', |
|
|
|
@ -282,6 +288,7 @@ const handleEdit = (row) => { |
|
|
|
form.value = { |
|
|
|
form.value = { |
|
|
|
id: row.id, |
|
|
|
id: row.id, |
|
|
|
auditType: String(row.auditType), |
|
|
|
auditType: String(row.auditType), |
|
|
|
|
|
|
|
auditTypeName: row.auditTypeName || '', |
|
|
|
projectName: row.projectName, |
|
|
|
projectName: row.projectName, |
|
|
|
secondLevelDeptId: row.secondLevelDeptId ? String(row.secondLevelDeptId) : null, |
|
|
|
secondLevelDeptId: row.secondLevelDeptId ? String(row.secondLevelDeptId) : null, |
|
|
|
secondLevelDeptName: row.secondLevelDeptName || '', |
|
|
|
secondLevelDeptName: row.secondLevelDeptName || '', |
|
|
|
@ -302,8 +309,29 @@ const handleDel = async (row) => { |
|
|
|
getList(); |
|
|
|
getList(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleSelectionChange = (val) => { |
|
|
|
|
|
|
|
selectedRows.value = val; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleBatchDel = async () => { |
|
|
|
|
|
|
|
if (selectedRows.value.length === 0) { |
|
|
|
|
|
|
|
feedback.msgWarning("请选择要删除的数据"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
await feedback.confirm(`确定删除选中的 ${selectedRows.value.length} 条数据?`); |
|
|
|
|
|
|
|
const ids = selectedRows.value.map(row => row.id); |
|
|
|
|
|
|
|
await del({ids}); |
|
|
|
|
|
|
|
feedback.msgSuccess("批量删除成功"); |
|
|
|
|
|
|
|
getList(); |
|
|
|
|
|
|
|
selectedRows.value = []; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const submitForm = async () => { |
|
|
|
const submitForm = async () => { |
|
|
|
await formRef.value.validate(); |
|
|
|
await formRef.value.validate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 根据auditType设置auditTypeName |
|
|
|
|
|
|
|
form.value.auditTypeName = auditTypeMap[form.value.auditType] || ''; |
|
|
|
|
|
|
|
|
|
|
|
submitLoading.value = true; |
|
|
|
submitLoading.value = true; |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (form.value.id) { |
|
|
|
if (form.value.id) { |
|
|
|
|