// 审批管理主页面
|
<template>
|
<view class="sales-account">
|
<!-- 使用通用页面头部组件 -->
|
<PageHeader title="会议看板"
|
@back="goBack" />
|
<!-- 审批列表 -->
|
<view class="topbox">
|
<view class="boxItem">
|
<view class="boxItem-num">
|
{{stats.total}}
|
</view>
|
<view class="boxItem-title">
|
总会议数
|
</view>
|
</view>
|
<view class="boxItem">
|
<view class="boxItem-num">
|
{{stats.underWay}}
|
</view>
|
<view class="boxItem-title">
|
进行中
|
</view>
|
</view>
|
<view class="boxItem">
|
<view class="boxItem-num">
|
{{stats.completed}}
|
</view>
|
<view class="boxItem-title">
|
已完成
|
</view>
|
</view>
|
<view class="boxItem">
|
<view class="boxItem-num">
|
{{stats.toStart}}
|
</view>
|
<view class="boxItem-title">
|
即将开始
|
</view>
|
</view>
|
</view>
|
<view class="ledger-list"
|
v-if="ledgerList.length > 0">
|
<view v-for="(item, index) in ledgerList"
|
:key="index">
|
<view class="ledger-item">
|
<view class="item-header">
|
<view class="item-left">
|
<view class="document-icon">
|
<up-icon name="file-text"
|
size="16"
|
color="#ffffff"></up-icon>
|
</view>
|
<text class="item-id">{{ item.title }}</text>
|
</view>
|
<view class="item-tag">
|
<u-tag :type="getTagClass(item.status)">{{ formatReceiptType(item.status) }}</u-tag>
|
</view>
|
</view>
|
<up-divider></up-divider>
|
<view class="item-details">
|
<view class="detail-row">
|
<text class="detail-label">主持人</text>
|
<text class="detail-value">{{ item.host }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">参会人数</text>
|
<text class="detail-value">{{ item.participants.length }}</text>
|
</view>
|
<view class="detail-row-approveReason">
|
<text class="detail-label">会议时间</text>
|
<text class="detail-value highlightBlue">{{dayjs(item.startTime).format("YYYY-MM-DD")}}
|
{{ formatTime(item.startTime) }} - {{ formatTime(item.endTime) }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">会议地点</text>
|
<text class="detail-value">{{ item.location }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">参会人数</text>
|
<text class="detail-value">{{ item.participants.length }}</text>
|
</view>
|
<!-- <up-divider></up-divider> -->
|
<u-collapse @change="change"
|
@close="close"
|
@open="open"
|
accordion
|
border
|
:duration="300">
|
<u-collapse-item :title="`会议纪要 ${item.content ? '' : '(无)'}`"
|
:name="`meeting-${index}`">
|
<view class="meeting-content">
|
<view v-if="item.content"
|
v-html="item.content"
|
class="content-html"></view>
|
<view v-else
|
class="no-content">
|
<text>暂无会议纪要内容</text>
|
</view>
|
</view>
|
</u-collapse-item>
|
</u-collapse>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view v-else
|
class="no-data">
|
<text>暂无数据</text>
|
</view>
|
</view>
|
</template>
|
|
<script setup>
|
import { ref, toRefs, reactive } from "vue";
|
import PageHeader from "@/components/PageHeader.vue";
|
import {
|
getMeetSummaryItems,
|
getMeetSummary,
|
} from "@/api/managementMeetings/meetExamine";
|
import { onShow } from "@dcloudio/uni-app";
|
import dayjs from "dayjs";
|
import useUserStore from "@/store/modules/user";
|
// 数据
|
const ledgerList = ref([]);
|
const data = reactive({
|
searchForm: {
|
title: "",
|
},
|
});
|
|
// 返回上一页
|
const goBack = () => {
|
uni.navigateBack();
|
};
|
// 统计数据
|
const stats = ref({});
|
const getnum = () => {
|
getMeetSummary().then(res => {
|
stats.value = res.data;
|
});
|
};
|
// 格式化时间
|
const formatTime = timeStr => {
|
const date = new Date(timeStr);
|
return date.toLocaleTimeString("zh-CN", {
|
hour: "2-digit",
|
minute: "2-digit",
|
});
|
};
|
// 查询列表
|
const getList = () => {
|
showLoadingToast("加载中...");
|
|
getMeetSummaryItems()
|
.then(res => {
|
ledgerList.value = res.data.map(item => {
|
return {
|
...item,
|
participants: JSON.parse(item.participants),
|
};
|
});
|
closeToast();
|
})
|
.catch(() => {
|
closeToast();
|
});
|
};
|
// 显示加载提示
|
const showLoadingToast = message => {
|
uni.showLoading({
|
title: message,
|
mask: true,
|
});
|
};
|
const formatDateTime = dateTime => {
|
if (!dateTime) return "";
|
return dateTime.replace(" ", "\n");
|
};
|
|
// 关闭提示
|
const closeToast = () => {
|
uni.hideLoading();
|
};
|
|
// 格式化回款方式
|
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 "warning";
|
} else if (type == 2) {
|
return "success";
|
} else {
|
return "info";
|
}
|
};
|
|
// u-collapse 事件处理函数
|
const change = name => {
|
console.log("展开的面板名:", name);
|
};
|
|
const close = name => {
|
console.log("关闭的面板名:", name);
|
};
|
|
const open = name => {
|
console.log("打开的面板名:", name);
|
};
|
|
onShow(async () => {
|
// 页面加载完成后的初始化逻辑
|
try {
|
// 两个方法执行完成后再执行 getList()
|
getList();
|
getnum();
|
} catch (error) {
|
console.error("初始化数据失败:", error);
|
// 即使出错也执行 getList(),确保页面能正常加载
|
getList();
|
getnum();
|
}
|
});
|
</script>
|
|
<style scoped lang="scss">
|
@import "../../../styles/sales-common.scss";
|
|
.u-divider {
|
margin: 0 !important;
|
}
|
|
// 文档图标样式 - 覆盖公共样式中的背景色
|
.document-icon {
|
background: #ed8d05;
|
}
|
|
// 浮动按钮样式 - 覆盖公共样式中的背景色
|
.fab-button {
|
background: #ed8d05;
|
}
|
|
// 特有样式
|
.detail-row-user {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
}
|
|
.detail-row-approveReason {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-bottom: 8px;
|
}
|
|
.detail-value.highlightBlue {
|
color: #2979ff;
|
font-weight: 500;
|
}
|
|
.detail-value.highlightYellow {
|
color: #ed8d05;
|
font-weight: 500;
|
}
|
|
.approver-value {
|
display: flex;
|
justify-content: flex-end;
|
}
|
|
.approver-chip {
|
display: inline-flex;
|
align-items: center;
|
gap: 6px;
|
background: #f0f6ff;
|
color: #2b7cff;
|
border: 1px solid #e0efff;
|
border-radius: 999px;
|
padding: 4px 10px;
|
max-width: 100%;
|
}
|
|
.approver-name {
|
font-size: 12px;
|
color: #2b7cff;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
}
|
|
.actions {
|
display: flex;
|
gap: 10px;
|
align-items: center;
|
justify-content: flex-end;
|
margin-top: 18rpx;
|
}
|
|
.action-btn {
|
border-radius: 16px;
|
height: 28px;
|
line-height: 28px;
|
padding: 0 12px;
|
}
|
.topbox {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-left: 20px;
|
margin-right: 20px;
|
margin-top: 10px;
|
}
|
.boxItem {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
background-color: #fff;
|
width: 24%;
|
padding-top: 10px;
|
padding-bottom: 10px;
|
border-radius: 6px;
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
|
}
|
.boxItem-num {
|
margin-bottom: 5px;
|
font-weight: 500;
|
color: #2979ff;
|
}
|
|
// 会议纪要样式
|
.meeting-content {
|
padding: 15px;
|
line-height: 1.6;
|
font-size: 14px;
|
}
|
|
.content-html {
|
color: #333;
|
word-break: break-word;
|
}
|
|
.content-html :deep(p) {
|
margin-bottom: 10px;
|
}
|
|
.content-html :deep(ul),
|
.content-html :deep(ol) {
|
margin-bottom: 10px;
|
padding-left: 20px;
|
}
|
|
.content-html :deep(li) {
|
margin-bottom: 5px;
|
}
|
|
.no-content {
|
color: #999;
|
text-align: center;
|
padding: 20px 0;
|
font-size: 14px;
|
}
|
|
// u-collapse 样式优化
|
:deep(.u-collapse) {
|
margin-top: 10px;
|
border-radius: 6px;
|
overflow: hidden;
|
}
|
|
:deep(.u-collapse-item__header) {
|
font-size: 14px;
|
font-weight: 500;
|
}
|
|
:deep(.u-collapse-item__content) {
|
background-color: #fafafa;
|
border-top: 1px solid #f0f0f0;
|
}
|
</style>
|