This commit is contained in:
parent
e12ed0bedf
commit
c05299b003
|
|
@ -15,3 +15,10 @@ export function getRectifyDetailApi(params) {
|
||||||
data: params,
|
data: params,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function rectifyApi(params) {
|
||||||
|
return request({
|
||||||
|
url: '/blade-system/rectFeedback/rectify',
|
||||||
|
method: 'POST',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,11 @@
|
||||||
<span>联系方式:{{ issuerPhone || '--' }}</span>
|
<span>联系方式:{{ issuerPhone || '--' }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 整改按钮 -->
|
||||||
|
<div class="rectify-button-section">
|
||||||
|
<el-button type="primary" @click="showRectifyDialog">整改</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 预览文件组件(新增) -->
|
<!-- 预览文件组件(新增) -->
|
||||||
<ViewFile
|
<ViewFile
|
||||||
v-if="isViewFlag"
|
v-if="isViewFlag"
|
||||||
|
|
@ -77,20 +82,47 @@
|
||||||
@close-dialog="isViewFlag = false"
|
@close-dialog="isViewFlag = false"
|
||||||
:width="600"
|
: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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
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'
|
import { Close, Timer } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
// 新增:引入 ViewFile 组件
|
// 新增:引入 ViewFile 组件
|
||||||
import ViewFile from '@/views/viewFile/viewFile.vue'
|
import ViewFile from '@/views/viewFile/viewFile.vue'
|
||||||
|
|
||||||
// API(请根据你实际路径调整)
|
// API(请根据你实际路径调整)
|
||||||
import { getRectifyDetailApi } from '@/api/filesTransfer/rectFeedback.js'
|
import { getRectifyDetailApi, rectifyApi } from '@/api/filesTransfer/rectFeedback.js'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
@ -108,6 +140,12 @@ const issuerPhone = ref('')
|
||||||
const isViewFlag = ref(false)
|
const isViewFlag = ref(false)
|
||||||
const currentRow = ref({})
|
const currentRow = ref({})
|
||||||
|
|
||||||
|
// 新增:整改弹框相关变量
|
||||||
|
const rectifyDialogVisible = ref(false)
|
||||||
|
const rectifyForm = ref({
|
||||||
|
description: ''
|
||||||
|
})
|
||||||
|
|
||||||
// 生命周期
|
// 生命周期
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
document.body.style.overflow = 'hidden'
|
document.body.style.overflow = 'hidden'
|
||||||
|
|
@ -164,6 +202,55 @@ const viewFile = (row) => {
|
||||||
currentRow.value = row
|
currentRow.value = row
|
||||||
isViewFlag.value = true
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
@ -207,7 +294,13 @@ const viewFile = (row) => {
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ✅ 新增:复用 data-detail 的链接样式 */
|
/* 整改按钮区域 */
|
||||||
|
.rectify-button-section {
|
||||||
|
text-align: right;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.archive-name-cell {
|
.archive-name-cell {
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue