This commit is contained in:
parent
3e40ba462b
commit
068a5b49bb
|
|
@ -22,3 +22,17 @@ export function rectifyApi(params) {
|
|||
data: params,
|
||||
})
|
||||
}
|
||||
export function rejectApi(params) {
|
||||
return request({
|
||||
url: '/blade-system/rectFeedback/rectifyRefuse',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
export function approveApi(params) {
|
||||
return request({
|
||||
url: '/blade-system/rectFeedback/rectifyPass',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,20 @@
|
|||
<!-- 状态标题区域 -->
|
||||
<div class="status-section">
|
||||
<div class="status-icon">
|
||||
<Timer class="status-icon-svg" />
|
||||
<component
|
||||
:is="rectifyStatus === '1' ? 'CircleCheck' : rectifyStatus === '3' ? 'Check' : 'Timer'"
|
||||
class="status-icon-svg"
|
||||
/>
|
||||
</div>
|
||||
<div class="status-text">
|
||||
{{
|
||||
rectifyStatus === '1'
|
||||
? '已通过'
|
||||
: rectifyStatus === '3'
|
||||
? '已整改'
|
||||
: '待整改'
|
||||
}}
|
||||
</div>
|
||||
<div class="status-text">待整改</div>
|
||||
</div>
|
||||
|
||||
<!-- 表格区域 -->
|
||||
|
|
@ -70,7 +81,7 @@
|
|||
</div>
|
||||
|
||||
<!-- 整改记录区域 -->
|
||||
<div v-if= "rectificationRecords.length > 0" class="rectification-records-section">
|
||||
<div v-if="rectificationRecords.length > 0" class="rectification-records-section">
|
||||
<p>责任单位整改反馈</p>
|
||||
<div class="record-item" v-for="(record, index) in rectificationRecords" :key="index">
|
||||
<div class="record-header">
|
||||
|
|
@ -80,10 +91,16 @@
|
|||
</div>
|
||||
|
||||
<!-- 整改按钮 -->
|
||||
<div v-if="rectifyStatus === '0'" class="rectify-button-section">
|
||||
<div v-if="rectifyStatus === '0' || rectifyStatus === '2'" class="rectify-button-section">
|
||||
<el-button type="primary" @click="showRectifyDialog">整改</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 驳回和同意按钮 -->
|
||||
<div v-if="rectifyStatus === '3'" class="rectify-button-section">
|
||||
<el-button type="warning" @click="showRejectDialog">驳回</el-button>
|
||||
<el-button type="success" @click="approveRectify">同意</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 预览文件组件(新增) -->
|
||||
<ViewFile
|
||||
v-if="isViewFlag"
|
||||
|
|
@ -119,6 +136,33 @@
|
|||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 驳回弹框 -->
|
||||
<el-dialog
|
||||
v-model="rejectDialogVisible"
|
||||
title="驳回"
|
||||
width="500px"
|
||||
@close="closeRejectDialog"
|
||||
>
|
||||
<el-form :model="rejectForm" label-width="80px">
|
||||
<el-form-item label="驳回原因">
|
||||
<el-input
|
||||
v-model="rejectForm.description"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入驳回原因"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="closeRejectDialog">取消</el-button>
|
||||
<el-button type="primary" @click="saveReject">保存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -126,13 +170,13 @@
|
|||
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Close, Timer } from '@element-plus/icons-vue'
|
||||
import { Close, Timer, Check } from '@element-plus/icons-vue'
|
||||
|
||||
// 新增:引入 ViewFile 组件
|
||||
import ViewFile from '@/views/viewFile/viewFile.vue'
|
||||
|
||||
// API(请根据你实际路径调整)
|
||||
import { getRectifyDetailApi, rectifyApi } from '@/api/filesTransfer/rectFeedback.js'
|
||||
import { getRectifyDetailApi, rectifyApi, rejectApi, approveApi } from '@/api/filesTransfer/rectFeedback.js'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
|
@ -158,6 +202,12 @@ const rectifyForm = ref({
|
|||
description: ''
|
||||
})
|
||||
|
||||
// 新增:驳回弹框相关变量
|
||||
const rejectDialogVisible = ref(false)
|
||||
const rejectForm = ref({
|
||||
description: ''
|
||||
})
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
document.body.style.overflow = 'hidden'
|
||||
|
|
@ -269,6 +319,93 @@ const saveRectify = async () => {
|
|||
ElMessage.error('整改提交失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 显示驳回弹框
|
||||
const showRejectDialog = () => {
|
||||
rejectDialogVisible.value = true
|
||||
// 清空之前的输入
|
||||
rejectForm.value.description = ''
|
||||
}
|
||||
|
||||
// 关闭驳回弹框
|
||||
const closeRejectDialog = () => {
|
||||
rejectDialogVisible.value = false
|
||||
rejectForm.value.description = ''
|
||||
}
|
||||
|
||||
// 保存驳回信息
|
||||
const saveReject = async () => {
|
||||
if (!rejectForm.value.description.trim()) {
|
||||
ElMessage.warning('请输入驳回原因')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
// 获取当前记录的ID
|
||||
const currentId = fileList.value[0]?.id
|
||||
if (!currentId) {
|
||||
ElMessage.error('获取记录ID失败')
|
||||
return
|
||||
}
|
||||
|
||||
// 调用驳回接口
|
||||
const res = await rejectApi({
|
||||
id: currentId,
|
||||
description: rejectForm.value.description
|
||||
})
|
||||
|
||||
if (res.data?.code === 200) {
|
||||
ElMessage.success('驳回成功')
|
||||
// 关闭弹框
|
||||
closeRejectDialog()
|
||||
// 刷新数据
|
||||
await initData()
|
||||
} else {
|
||||
ElMessage.error(res.data?.msg || '驳回失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('驳回失败:', error)
|
||||
ElMessage.error('驳回失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 同意整改
|
||||
const approveRectify = async () => {
|
||||
try {
|
||||
// 获取当前记录的ID
|
||||
const currentId = fileList.value[0]?.id
|
||||
if (!currentId) {
|
||||
ElMessage.error('获取记录ID失败')
|
||||
return
|
||||
}
|
||||
|
||||
// 弹出确认提示
|
||||
await ElMessageBox.confirm('是否确认同意整改?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
|
||||
// 调用同意接口
|
||||
const res = await approveApi({
|
||||
id: currentId
|
||||
})
|
||||
|
||||
if (res.data?.code === 200) {
|
||||
ElMessage.success('同意成功')
|
||||
// 刷新数据
|
||||
await initData()
|
||||
} else {
|
||||
ElMessage.error(res.data?.msg || '同意失败')
|
||||
}
|
||||
} catch (error) {
|
||||
// 用户点击取消时,error.message 通常是 "cancel"
|
||||
if (error !== 'cancel') {
|
||||
console.error('同意失败:', error)
|
||||
ElMessage.error('同意失败')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
@ -319,20 +456,24 @@ const saveRectify = async () => {
|
|||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.rectify-button-section .el-button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
/* 整改记录区域 */
|
||||
.rectification-records-section {
|
||||
margin: 24px 0;
|
||||
padding: 16px;
|
||||
//border: 1px solid #ebeef5;
|
||||
/*border: 1px solid #ebeef5;*/
|
||||
border-radius: 4px;
|
||||
//background-color: #fafafa;
|
||||
/*background-color: #fafafa;*/
|
||||
}
|
||||
|
||||
.rectification-records-section h3 {
|
||||
margin: 0 0 16px 0;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
//color: #333;
|
||||
/*color: #333;*/
|
||||
}
|
||||
|
||||
.record-item {
|
||||
|
|
|
|||
Loading…
Reference in New Issue