申请审核

This commit is contained in:
cwchen 2025-09-28 09:37:57 +08:00
parent c5d78f46db
commit a790de5264
4 changed files with 53 additions and 29 deletions

View File

@ -7,4 +7,13 @@ export function getTransferAuditListApi(params) {
method: 'GET', method: 'GET',
params: params, params: params,
}) })
}
// 审核
export function auditTransferApplyApi(data) {
return request({
url: '/smartArchives/transferApply/auditTransferApply',
method: 'POST',
data: data,
})
} }

View File

@ -152,11 +152,11 @@ export default {
getStatusType(status) { getStatusType(status) {
switch (status) { switch (status) {
case '0': case '0':
return 'danger'
case '1':
return 'warning' return 'warning'
case '2': case '1':
return 'success' return 'success'
case '2':
return 'danger'
default: default:
return 'info' return 'info'
} }

View File

@ -93,11 +93,11 @@ export default {
getStatusType(status) { getStatusType(status) {
switch (status) { switch (status) {
case '0': case '0':
return 'danger'
case '1':
return 'warning' return 'warning'
case '2': case '1':
return 'success' return 'success'
case '2':
return 'danger'
default: default:
return 'info' return 'info'
} }

View File

@ -35,7 +35,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="proName" label="项目名称" min-width="150"> <el-table-column prop="proName" label="项目名称" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.proName || '--'}} {{ scope.row.proName || '--' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="singleProName" label="单项工程名称" min-width="150"> <el-table-column prop="singleProName" label="单项工程名称" min-width="150">
@ -75,7 +75,8 @@
</el-input> </el-input>
</div> </div>
<div class="approval-actions"> <div class="approval-actions">
<el-button type="primary" @click="handleApprove" v-hasPermi="['transfer:apply:audit']">同意</el-button> <el-button type="primary" @click="handleApprove"
v-hasPermi="['transfer:apply:audit']">同意</el-button>
<el-button type="danger" @click="handleReject" v-hasPermi="['transfer:apply:audit']">驳回</el-button> <el-button type="danger" @click="handleReject" v-hasPermi="['transfer:apply:audit']">驳回</el-button>
</div> </div>
</div> </div>
@ -109,8 +110,9 @@
import { decryptWithSM4 } from '@/utils/sm' import { decryptWithSM4 } from '@/utils/sm'
import { import {
getTransferApplyFilesByApplyIdApi, getTransferApplyFilesByApplyIdApi,
getTransferApplyApi getTransferApplyApi,
} from '@/api/filesTransfer/apply' } from '@/api/filesTransfer/apply'
import {auditTransferApplyApi} from '@/api/filesTransfer/audit'
export default { export default {
name: 'DetailData', name: 'DetailData',
data() { data() {
@ -160,15 +162,15 @@ export default {
// //
document.body.style.overflow = 'auto'; document.body.style.overflow = 'auto';
}, },
created(){ created() {
this.initData(); this.initData();
}, },
methods: { methods: {
handleClose() { handleClose() {
if(this.viewStatus === 'audit'){ if (this.viewStatus === 'audit') {
const obj = { path: "/archivesManagement/filesTransfer/audit" } const obj = { path: "/archivesManagement/filesTransfer/audit" }
this.$tab.closeOpenPage(obj) this.$tab.closeOpenPage(obj)
}else{ } else {
const obj = { path: "/archivesManagement/filesTransfer/apply" } const obj = { path: "/archivesManagement/filesTransfer/apply" }
this.$tab.closeOpenPage(obj) this.$tab.closeOpenPage(obj)
} }
@ -177,14 +179,14 @@ export default {
this.fileList = []; this.fileList = [];
const res = await getTransferApplyFilesByApplyIdApi({ id: this.id }); const res = await getTransferApplyFilesByApplyIdApi({ id: this.id });
console.log(res); console.log(res);
const res2 = await getTransferApplyApi({ id: this.id }); const res2 = await getTransferApplyApi({ id: this.id });
this.projectName = res2?.data?.proName || '/'; this.projectName = res2?.data?.proName || '/';
this.receivingOrg = res2?.data?.deptName || '/'; this.receivingOrg = res2?.data?.deptName || '/';
// //
this.auditUserName = res2?.data?.auditUserName || '--'; this.auditUserName = res2?.data?.auditUserName || '--';
this.auditDate = res2?.data?.transfertTime || '--'; this.auditDate = res2?.data?.transfertTime || '--';
this.auditOpinion = res2?.data?.auditOpinion || '--'; this.auditOpinion = res2?.data?.auditOpinion || '--';
if (Array.isArray(res.data) && res.data.length > 0) { if (Array.isArray(res.data) && res.data.length > 0) {
res.data.map(item => { res.data.map(item => {
const newFile = { const newFile = {
@ -197,7 +199,7 @@ export default {
this.fileList.push(newFile); this.fileList.push(newFile);
}) })
} }
}, },
handleApprove() { handleApprove() {
if (!this.approvalComment.trim()) { if (!this.approvalComment.trim()) {
@ -211,9 +213,7 @@ export default {
type: 'success' type: 'success'
}).then(() => { }).then(() => {
this.status = 'approved' this.status = 'approved'
this.$message.success('审批通过') this.auditTransferApply(1)
// API
console.log('审批意见:', this.approvalComment)
}).catch(() => { }).catch(() => {
// //
}) })
@ -230,12 +230,22 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.status = 'rejected' this.status = 'rejected'
this.$message.success('已驳回申请') this.auditTransferApply(2)
// API
console.log('驳回原因:', this.approvalComment)
}).catch(() => { }).catch(() => {
// //
}) })
},
//
auditTransferApply(auditStatus) {
auditTransferApplyApi({
id: this.id,
auditOpinion: this.approvalComment.trim(),
auditStatus: auditStatus
}).then(res => {
this.$message.success(res.msg || '审核成功');
this.handleClose();
})
} }
} }
} }
@ -245,27 +255,28 @@ export default {
.detail-container { .detail-container {
padding: 20px; padding: 20px;
background: #fff; background: #fff;
height: calc(100vh - 120px); /* 减去头部导航栏的高度 */ height: calc(100vh - 120px);
/* 减去头部导航栏的高度 */
overflow-y: auto; overflow-y: auto;
box-sizing: border-box; box-sizing: border-box;
/* 自定义滚动条样式 */ /* 自定义滚动条样式 */
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 6px; width: 6px;
background: #f5f5f5; background: #f5f5f5;
} }
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
background: #f5f5f5; background: #f5f5f5;
border-radius: 3px; border-radius: 3px;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
background: #c0c4cc; background: #c0c4cc;
border-radius: 3px; border-radius: 3px;
transition: background 0.3s; transition: background 0.3s;
} }
&::-webkit-scrollbar-thumb:hover { &::-webkit-scrollbar-thumb:hover {
background: #909399; background: #909399;
} }
@ -368,19 +379,23 @@ export default {
.audit-info { .audit-info {
padding: 4px 0 0 6px; padding: 4px 0 0 6px;
} }
.audit-row { .audit-row {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
} }
.audit-label { .audit-label {
display: inline-block; display: inline-block;
min-width: 80px; min-width: 80px;
color: #666; color: #666;
} }
.audit-value { .audit-value {
color: #333; color: #333;
} }
.form-item { .form-item {
margin-bottom: 20px; margin-bottom: 20px;