<template>
|
<view class="approve-page">
|
<PageHeader title="总结"
|
@back="goBack" />
|
<!-- 申请信息 -->
|
<view class="application-info">
|
<view class="info-header">
|
<text class="info-title">会议信息</text>
|
</view>
|
<view class="info-content">
|
<view class="info-row">
|
<text class="info-label">会议主题</text>
|
<text class="info-value">{{ approvalData.title }}</text>
|
</view>
|
<view class="info-row">
|
<text class="info-label">申请人</text>
|
<text class="info-value">{{ approvalData.applicant }}</text>
|
</view>
|
<view class="info-row">
|
<text class="info-label">主理人</text>
|
<text class="info-value">{{ approvalData.host }}</text>
|
</view>
|
<view class="info-row">
|
<text class="info-label">会议时间</text>
|
<text class="info-value">{{ formatDateTime(approvalData.meetingTime) }}</text>
|
</view>
|
<view class="info-row">
|
<text class="info-label">会议地点</text>
|
<text class="info-value">{{ approvalData.location }}</text>
|
</view>
|
<view class="info-row">
|
<text class="info-label">审批状态</text>
|
<text class="info-value tag"
|
:class="getTagClass(approvalData.approveNodeStatus)">
|
{{ formatReceiptType(approvalData.approveNodeStatus) }}
|
</text>
|
</view>
|
<view class="info-row">
|
<text class="info-label">会议说明</text>
|
<text class="info-value">{{ approvalData.description }}</text>
|
</view>
|
<view class="info-row">
|
<text class="info-label">参会人数</text>
|
<text class="info-value">{{ approvalData.participants.length }}</text>
|
</view>
|
<view class="info-row">
|
<text class="info-label">参会人员</text>
|
<text class="info-value">{{ approvalData.participants.map(it => it.name).join("、") }}</text>
|
</view>
|
</view>
|
</view>
|
<!-- 提交意见输入 -->
|
<view v-if="isEdit"
|
class="approval-input">
|
<view class="input-header">
|
<text class="input-title">会议纪要</text>
|
</view>
|
<view class="input-content">
|
<Editor v-model:modelValue="minutesContent"
|
:height="300" />
|
</view>
|
</view>
|
<!-- 底部操作按钮 -->
|
<view v-if="isEdit"
|
class="footer-actions">
|
<u-button class="approve-btn"
|
@click="handleApprove">提交</u-button>
|
</view>
|
</view>
|
</template>
|
<script setup>
|
import { ref, onMounted, nextTick } from "vue";
|
import { onLoad } from "@dcloudio/uni-app";
|
import {
|
saveMeetingMinutes,
|
getMeetingMinutesByMeetingId,
|
} from "@/api/managementMeetings/meetExamine";
|
import { getToken } from "@/utils/auth";
|
import PageHeader from "@/components/PageHeader.vue";
|
import Editor from "@/components/Editor/index.vue";
|
|
const approvalData = ref({});
|
const approvalSteps = ref([]);
|
const isEdit = ref(false);
|
const showToast = message => {
|
uni.showToast({
|
title: message,
|
icon: "none",
|
});
|
};
|
onLoad(options => {
|
console.log(options, "options");
|
if (options.item) {
|
approvalData.value = JSON.parse(options.item);
|
}
|
// 编辑模式下,默认提交意见为当前审批意见
|
if (options.edit) {
|
isEdit.value = options.edit === "true" ? true : false;
|
}
|
getMeetingMinutes();
|
console.log(approvalData.value, "approvalData.value");
|
});
|
const goBack = () => {
|
uni.removeStorageSync("approveId");
|
uni.navigateBack();
|
};
|
const formatDateTime = dateTime => {
|
if (!dateTime) return "";
|
return dateTime.replace(" ", "\n");
|
};
|
|
// 格式化回款方式
|
const formatReceiptType = params => {
|
if (params == 0) {
|
return "待审批";
|
} else if (params == 1) {
|
return "已通过";
|
} else if (params == 2) {
|
return "未通过";
|
} else if (params == 3) {
|
return "已取消";
|
} else {
|
return "未知";
|
}
|
};
|
// 获取标签样式类
|
const getTagClass = type => {
|
if (type == 0) {
|
return "info";
|
} else if (type == 1) {
|
return "success";
|
} else if (type == 2) {
|
return "warning";
|
} else if (type == 3) {
|
return "danger";
|
} else {
|
return "info";
|
}
|
};
|
const minutesContent = ref("");
|
const minutesContentId = ref("");
|
const getMeetingMinutes = () => {
|
getMeetingMinutesByMeetingId(approvalData.value.id)
|
.then(res => {
|
console.log(res.data, "res.data");
|
|
if (res.data) {
|
minutesContent.value = res.data.content;
|
minutesContentId.value = res.data.id;
|
} else {
|
minutesContent.value = `<h2>${approvalData.value.title}会议纪要</h2>
|
<p><strong>会议时间:</strong>${
|
approvalData
|
.value
|
.meetingTime
|
}</p>
|
<p><strong>会议地点:</strong>${
|
approvalData
|
.value
|
.location
|
}</p>
|
<p><strong>主持人:</strong>${
|
approvalData
|
.value
|
.host
|
}</p>
|
<p><strong>参会人员:</strong></p>
|
<ol>
|
${approvalData.value.participants
|
.map(
|
p =>
|
`<li>${p.name}</li>`
|
)
|
.join(
|
""
|
)}
|
</ol>
|
<p><strong>会议内容:</strong></p>
|
<ol>
|
<li>议题一:
|
<ul>
|
<li>讨论内容:</li>
|
<li>决议事项:</li>
|
</ul>
|
</li>
|
<li>议题二:
|
<ul>
|
<li>讨论内容:</li>
|
<li>决议事项:</li>
|
</ul>
|
</li>
|
</ol>
|
<p><strong>备注:</strong></p>`;
|
}
|
})
|
.catch(error => {
|
console.error("获取会议纪要失败:", error);
|
showToast("获取会议纪要失败,请重试");
|
});
|
};
|
const submitForm = status => {
|
console.log(minutesContent.value, "富文本");
|
if (!minutesContent.value) {
|
ElMessage.warning("请输入会议纪要内容");
|
return;
|
}
|
|
// 调用后端
|
saveMeetingMinutes({
|
id: minutesContentId.value,
|
content: minutesContent.value,
|
meetingId: approvalData.value.id,
|
title: approvalData.value.title,
|
})
|
.then(res => {
|
if (res.code === 200) {
|
showToast("提交成功");
|
// 提示后返回上一个页面
|
setTimeout(() => {
|
goBack(); // 内部是 uni.navigateBack()
|
}, 800);
|
} else {
|
showToast(res.message || "提交操作失败,请重试");
|
}
|
})
|
.catch(error => {
|
console.error("提交操作失败:", error);
|
showToast("提交操作失败,请重试");
|
});
|
};
|
|
const handleApprove = () => {
|
uni.showModal({
|
title: "确认操作",
|
content: "确定要提交该会议总结吗?",
|
success: res => {
|
if (res.confirm) submitForm(1);
|
},
|
});
|
};
|
// 原始节点数据(用于提交逻辑)
|
const activities = ref([]);
|
</script>
|
|
<style scoped lang="scss">
|
.approve-page {
|
min-height: 100vh;
|
background: #f8f9fa;
|
padding-bottom: 80px;
|
}
|
|
.header {
|
display: flex;
|
align-items: center;
|
background: #fff;
|
padding: 16px 20px;
|
border-bottom: 1px solid #f0f0f0;
|
position: sticky;
|
top: 0;
|
z-index: 100;
|
}
|
|
.title {
|
flex: 1;
|
text-align: center;
|
font-size: 18px;
|
font-weight: 600;
|
color: #333;
|
}
|
|
.application-info {
|
background: #fff;
|
margin: 16px;
|
border-radius: 12px;
|
overflow: hidden;
|
}
|
|
.info-header {
|
padding: 16px;
|
border-bottom: 1px solid #f0f0f0;
|
background: #f8f9fa;
|
}
|
|
.info-title {
|
font-size: 16px;
|
font-weight: 600;
|
color: #333;
|
}
|
|
.info-content {
|
padding: 16px;
|
}
|
|
.info-row {
|
display: flex;
|
align-items: center;
|
margin-bottom: 12px;
|
|
&:last-child {
|
margin-bottom: 0;
|
}
|
}
|
|
.info-label {
|
font-size: 14px;
|
color: #666;
|
width: 80px;
|
flex-shrink: 0;
|
}
|
|
.info-value {
|
font-size: 14px;
|
color: #333;
|
flex: 1;
|
}
|
|
.approval-process {
|
background: #fff;
|
margin: 16px;
|
border-radius: 12px;
|
overflow: hidden;
|
}
|
|
.process-header {
|
padding: 16px;
|
border-bottom: 1px solid #f0f0f0;
|
background: #f8f9fa;
|
}
|
|
.process-title {
|
font-size: 16px;
|
font-weight: 600;
|
color: #333;
|
}
|
|
.process-steps {
|
padding: 20px;
|
}
|
|
.process-step {
|
display: flex;
|
position: relative;
|
margin-bottom: 24px;
|
|
&:last-child {
|
margin-bottom: 0;
|
|
.step-line {
|
display: none;
|
}
|
}
|
}
|
|
.step-indicator {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
margin-right: 16px;
|
}
|
|
.step-dot {
|
width: 32px;
|
height: 32px;
|
border-radius: 50%;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
font-size: 14px;
|
font-weight: 600;
|
position: relative;
|
z-index: 2;
|
}
|
|
.process-step.completed .step-dot {
|
background: #52c41a;
|
color: #fff;
|
}
|
|
.process-step.current .step-dot {
|
background: #1890ff;
|
color: #fff;
|
animation: pulse 2s infinite;
|
}
|
|
.process-step.pending .step-dot {
|
background: #d9d9d9;
|
color: #999;
|
}
|
|
.step-line {
|
width: 2px;
|
height: 40px;
|
background: #d9d9d9;
|
margin-top: 8px;
|
}
|
|
.process-step.completed .step-line {
|
background: #52c41a;
|
}
|
|
.process-step.rejected .step-dot {
|
background: #ff4d4f;
|
color: #fff;
|
}
|
.process-step.rejected .step-line {
|
background: #ff4d4f;
|
}
|
|
.step-content {
|
flex: 1;
|
padding-top: 4px;
|
}
|
|
.step-info {
|
margin-bottom: 8px;
|
}
|
|
.step-title {
|
font-size: 16px;
|
font-weight: 600;
|
color: #333;
|
display: block;
|
margin-bottom: 4px;
|
}
|
|
.step-approver {
|
font-size: 14px;
|
color: #666;
|
display: block;
|
margin-bottom: 4px;
|
}
|
|
.step-time {
|
font-size: 12px;
|
color: #999;
|
display: block;
|
}
|
|
.step-opinion {
|
background: #f8f9fa;
|
padding: 12px;
|
border-radius: 8px;
|
border-left: 4px solid #52c41a;
|
}
|
|
.opinion-label {
|
font-size: 12px;
|
color: #666;
|
display: block;
|
margin-bottom: 4px;
|
}
|
|
.opinion-content {
|
font-size: 14px;
|
color: #333;
|
line-height: 1.5;
|
}
|
|
.approval-input {
|
background: #fff;
|
margin: 16px;
|
border-radius: 12px;
|
overflow: hidden;
|
}
|
|
.input-header {
|
padding: 16px;
|
border-bottom: 1px solid #f0f0f0;
|
background: #f8f9fa;
|
}
|
|
.input-title {
|
font-size: 16px;
|
font-weight: 600;
|
color: #333;
|
}
|
|
.input-content {
|
padding: 16px;
|
}
|
|
.footer-actions {
|
position: fixed;
|
left: 0;
|
right: 0;
|
bottom: 0;
|
background: #fff;
|
display: flex;
|
justify-content: space-around;
|
align-items: center;
|
padding: 16px;
|
box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
|
z-index: 1000;
|
}
|
|
.reject-btn {
|
width: 120px;
|
background: #ff4d4f;
|
color: #fff;
|
}
|
|
.approve-btn {
|
width: 120px;
|
background: #52c41a;
|
color: #fff;
|
}
|
|
/* 适配u-button样式 */
|
:deep(.u-button) {
|
border-radius: 6px;
|
}
|
|
@keyframes pulse {
|
0% {
|
box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.7);
|
}
|
70% {
|
box-shadow: 0 0 0 10px rgba(24, 144, 255, 0);
|
}
|
100% {
|
box-shadow: 0 0 0 0 rgba(24, 144, 255, 0);
|
}
|
}
|
.signature-section {
|
background: #fff;
|
padding: 12px 16px 16px;
|
border-top: 1px solid #f0f0f0;
|
}
|
.signature-header {
|
margin-bottom: 8px;
|
}
|
.signature-title {
|
font-size: 14px;
|
font-weight: 600;
|
color: #333;
|
}
|
.signature-box {
|
width: 100%;
|
height: 180px;
|
background: #fff;
|
border: 1px dashed #d9d9d9;
|
border-radius: 8px;
|
overflow: hidden;
|
}
|
.signature-actions {
|
margin-top: 8px;
|
display: flex;
|
justify-content: flex-end;
|
}
|
/* 工具栏按钮样式 */
|
:deep(.ql-toolbar.ql-snow .ql-button) {
|
height: 28px;
|
width: 28px;
|
padding: 4px;
|
}
|
:deep(.ql-toolbar.ql-snow .ql-picker-label) {
|
height: 28px;
|
padding: 4px 8px;
|
}
|
</style>
|