This commit is contained in:
liang.chao 2025-12-04 10:07:34 +08:00
parent e12ed0bedf
commit c05299b003
2 changed files with 103 additions and 3 deletions

View File

@ -15,3 +15,10 @@ export function getRectifyDetailApi(params) {
data: params,
})
}
export function rectifyApi(params) {
return request({
url: '/blade-system/rectFeedback/rectify',
method: 'POST',
data: params,
})
}

View File

@ -69,6 +69,11 @@
<span>联系方式{{ issuerPhone || '--' }}</span>
</div>
<!-- 整改按钮 -->
<div class="rectify-button-section">
<el-button type="primary" @click="showRectifyDialog">整改</el-button>
</div>
<!-- 预览文件组件新增 -->
<ViewFile
v-if="isViewFlag"
@ -77,20 +82,47 @@
@close-dialog="isViewFlag = false"
:width="600"
/>
<!-- 整改弹框 -->
<el-dialog
v-model="rectifyDialogVisible"
title="整改"
width="500px"
@close="closeRectifyDialog"
>
<el-form :model="rectifyForm" label-width="80px">
<el-form-item label="整改描述">
<el-input
v-model="rectifyForm.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="closeRectifyDialog">取消</el-button>
<el-button type="primary" @click="saveRectify">保存</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Close, Timer } from '@element-plus/icons-vue'
// ViewFile
import ViewFile from '@/views/viewFile/viewFile.vue'
// API
import { getRectifyDetailApi } from '@/api/filesTransfer/rectFeedback.js'
import { getRectifyDetailApi, rectifyApi } from '@/api/filesTransfer/rectFeedback.js'
const route = useRoute()
const router = useRouter()
@ -108,6 +140,12 @@ const issuerPhone = ref('')
const isViewFlag = ref(false)
const currentRow = ref({})
//
const rectifyDialogVisible = ref(false)
const rectifyForm = ref({
description: ''
})
//
onMounted(() => {
document.body.style.overflow = 'hidden'
@ -164,6 +202,55 @@ const viewFile = (row) => {
currentRow.value = row
isViewFlag.value = true
}
//
const showRectifyDialog = () => {
rectifyDialogVisible.value = true
//
rectifyForm.value.description = ''
}
//
const closeRectifyDialog = () => {
rectifyDialogVisible.value = false
rectifyForm.value.description = ''
}
//
const saveRectify = async () => {
if (!rectifyForm.value.description.trim()) {
ElMessage.warning('请输入整改描述')
return
}
try {
// ID
const currentId = fileList.value[0]?.id
if (!currentId) {
ElMessage.error('获取记录ID失败')
return
}
//
const res = await rectifyApi({
id: currentId,
description: rectifyForm.value.description
})
if (res.data?.code === 200) {
ElMessage.success('整改提交成功')
//
closeRectifyDialog()
//
// router.go(-1) //
} else {
ElMessage.error(res.data?.msg || '整改提交失败')
}
} catch (error) {
console.error('整改提交失败:', error)
ElMessage.error('整改提交失败')
}
}
</script>
<style scoped>
@ -207,7 +294,13 @@ const viewFile = (row) => {
margin-bottom: 24px;
}
/* ✅ 新增:复用 data-detail 的链接样式 */
/* 整改按钮区域 */
.rectify-button-section {
text-align: right;
margin-bottom: 24px;
padding-right: 20px;
}
.archive-name-cell {
white-space: normal;
word-break: break-word;