<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">
|
<u-textarea v-model="approvalOpinion"
|
rows="4"
|
placeholder="请输入发布意见"
|
maxlength="200"
|
count />
|
</view>
|
</view>
|
<!-- 底部操作按钮 -->
|
<view v-if="isEdit"
|
class="footer-actions">
|
<!-- <u-button class="reject-btn"
|
@click="handleReject">不通过</u-button> -->
|
<u-button class="approve-btn"
|
@click="handleApprove">发布</u-button>
|
</view>
|
</view>
|
</template>
|
|
<script setup>
|
import { ref, onMounted, computed } from "vue";
|
import { onLoad } from "@dcloudio/uni-app";
|
import { saveMeetingApplication } from "@/api/managementMeetings/meetExamine";
|
const showToast = message => {
|
uni.showToast({
|
title: message,
|
icon: "none",
|
});
|
};
|
import PageHeader from "@/components/PageHeader.vue";
|
|
const approvalData = ref({});
|
const approvalSteps = ref([]);
|
const approvalOpinion = ref("");
|
const isEdit = ref(false);
|
|
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;
|
}
|
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 {
|
return "未知";
|
}
|
};
|
// 获取标签样式类
|
const getTagClass = type => {
|
if (type == 0) {
|
return "info";
|
} else if (type == 1) {
|
return "success";
|
} else if (type == 2) {
|
return "danger";
|
} else {
|
return "info";
|
}
|
};
|
const submitForm = status => {
|
// 校验发布意见
|
if (!approvalOpinion.value?.trim()) {
|
showToast("请输入发布意见");
|
return;
|
}
|
|
// 调用后端
|
saveMeetingApplication({
|
id: approvalData.value.id,
|
publishStatus: status,
|
publishComment: approvalOpinion.value, // 添加发布意见
|
})
|
.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 handleReject = () => {
|
uni.showModal({
|
title: "确认操作",
|
content: "确定不通过该会议申请吗?",
|
success: res => {
|
if (res.confirm) submitForm(2);
|
},
|
});
|
};
|
// 原始节点数据(用于提交逻辑)
|
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;
|
}
|
</style>
|