增加待审批页面

This commit is contained in:
xuli3099
2025-08-22 21:58:11 +08:00
parent 8e8fdc02c6
commit ad49a47367
6 changed files with 285 additions and 9 deletions

View File

@@ -7,3 +7,11 @@ export function noticeList(data) {
data
})
}
// 获取用户审批的待办和已办详情
export function flowList(data) {
return request.post({
url: '/acc/message/flow/detail',
data
})
}

View File

@@ -106,11 +106,13 @@
{
"path": "pages/notice/notice",
"style": {
"navigationBarTitleText": "",
"app-plus" : {
"bounce" : "none" // 取消APP端iOS回弹,避免与下拉刷新冲突 (可统一配在 'globalStyle')
},
"mp-alipay":{"allowsBounceVertical":"NO"} // 取消支付宝和钉钉小程序的iOS回弹,避免与下拉刷新冲突 (可统一配在 'globalStyle')
"navigationBarTitleText": ""
}
},
{
"path": "pages/notice/waitApprove",
"style": {
"navigationBarTitleText": ""
}
},
{

View File

@@ -25,7 +25,7 @@
<view class="font-number">{{ backBlogObj.count1 }}</view>
<view class="font-title">待办</view>
</view>
<view class="backlog-b-item">
<view class="backlog-b-item" @click="handleJump('/pages/notice/waitApprove')">
<view class="font-number">{{ backBlogObj.count2 }}</view>
<view class="font-title">待审查</view>
</view>
@@ -141,12 +141,12 @@
</template>
<script setup>
import { ref,onMounted,computed } from 'vue';
import { ref,onMounted } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import customHeader from '@/components/customHeader.vue'
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
import customSteps from '@/components/customSteps.vue'
import customSearch from '@/components/customSearch.vue'
// import customSearch from '@/components/customSearch.vue'
import { getNavBarPaddingTop} from '@/utils/system.js'
// ,swiperList,stepData,salesTask,commonServices,newsQueryList
import { messageNotifyCount,messageFlowCount,getUserFavorite} from '@/api/home.js';

View File

@@ -0,0 +1,216 @@
<template>
<view class="con-body">
<view class="con-bg">
<!-- 头部 -->
<customHeader ref="customHeaderRef" :title="'待审批'" :leftFlag="true" :rightFlag="true"></customHeader>
<!-- 高度来避免头部遮挡 -->
<view class="top-height"></view>
<!-- 正文内容 -->
<view class="all-body">
<!-- 分页部分 -->
<mescroll-uni ref="mescrollRef"
@init="mescrollInit"
@down="downCallback"
@up="upCallback"
:up="upOption"
:down="downOption"
:fixed="false"
textColor="#ffffff"
bgColor="#ffffff"
class="scroll-h"
:class="{'loading-scroll':cssFlag}"
>
<view class="white-bg margin-bottom20" v-for="(item, index) in list" :key="index" @click="handleJump(item)">
<view class="report-list">
<view class="r-list">
<view class="r-name">{{ item.subject }}</view>
<view class="r-right btn-orange" size="mini" v-if="item.status==1">待处理</view>
<view v-else-if="item.status==2">已处理</view>
</view>
<view class="r-list">
<view class="r-left">来自 <text>{{ item.appName }}</text></view>
<view class="r-right">
<text style="color:#FF2B44" v-if="item.status==1 && (item.level==1 || item.level==2)">
{{ formatLevel(item.level) }}
</text>
<text v-else>{{ formatLevel(item.level) }}</text>
</view>
</view>
<view class="border-bottom"></view>
<view class="r-list">
<view class="r-left">创建人 <text>{{ item.createUser.userId }}</text></view>
<view class="r-right">{{ parseTime(item.createTime,'{y}-{m}-{d} {h}:{i}') }}</view>
</view>
</view>
</view>
</mescroll-uni>
</view>
</view>
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import customHeader from '@/components/customHeader.vue'
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
import { getNavBarPaddingTop } from '@/utils/system.js'
import { flowList } from '@/api/notice.js'
import {formatLevel} from '@/utils/status.js'
import { parseTime } from '@/utils/datetime.js'
// 获取导航栏高度用于内容区域padding
const navBarPaddingTop = ref(0);
onMounted(() => {
navBarPaddingTop.value = getNavBarPaddingTop() * 2;
})
// 查询列表
let list = ref([]);
const mescrollRef = ref(null);
const upOption = ref({
page: { num: 0, size: 10 },
noMoreSize: 5,
empty: { tip: '~ 空空如也 ~' },
textLoading: '加载中...',
textNoMore: '已经到底了'
});
const downOption = ref({
auto: false,
textInOffset: '下拉刷新',
textOutOffset: '释放更新',
textLoading: '刷新中...'
});
let cssFlag=ref(false);//控制样式
const mescrollInit = (mescroll) => {
console.log("mescrollInit=>")
cssFlag.value = true;
mescrollRef.value = mescroll;
};
// 下拉刷新
const downCallback = async (mescroll) => {
try {
console.log("downCallback=>下拉刷新")
const res = await getFlowList(1, upOption.value.page.size);
cssFlag.value = false;
list.value = res.list;
mescroll.resetUpScroll();
} catch (error) {
mescroll.endErr();
} finally {
mescroll.endSuccess();
}
}
// 上拉加载更多
const upCallback = async (mescroll) => {
try {
console.log("upCallback=>上拉加载更多")
const res = await getFlowList(mescroll.num, mescroll.size);
if (mescroll.num === 1) {
list.value = res.list;
} else {
list.value.push(...res.list);
}
mescroll.endBySize(res.list.length, res.total);
} catch (error) {
mescroll.endErr();
}
}
// 获取数据列表
const getFlowList = (pageIndex, pageSize) => {
return new Promise(async (resolve) => {
let param = {
pageIndex,
pageSize
}
let res = await flowList(param);
let list = res.list || [];
resolve({
list,
total: res.recordCount
});
});
}
// 跳转webview
const handleJump = (item)=>{
uni.navigateTo({
url: '/pages/h5-webview/h5-webview?url=' + item.mobileLink+"&title="+item.subject
});
}
</script>
<style scoped>
.all-body {
/* #ifdef APP-PLUS */
top: 150rpx;
height: calc(100vh - 75px);
/* #endif */
/* #ifndef APP-PLUS */
top:120rpx;
height: calc(100vh);
/* #endif */
}
.search{
display: flex;
}
.search .btn-search{
border:none;
background: none;
line-height: normal;
color:#fff;
line-height: 56rpx !important;
padding:10rpx 0 0;
text-align: left;
cursor: pointer;
}
.search .btn-search::after{
display: none;
}
.search .custom-search{
width:80%;
}
.search .custom-search.uni-searchbar{
padding-right:0 !important;
}
.scroll-h{
/* #ifdef APP-PLUS */
height:calc(100vh - 78px) !important;
/* #endif */
/* #ifndef APP-PLUS */
height: calc(100vh - 65px) !important;
/* #endif */
}
.white-bg{
padding-top:0rpx;
padding-bottom:10rpx;
}
/* .report-list .r-list{
padding: 10rpx 0;
} */
.report-list .r-list:first-child{
padding-bottom:10rpx;
}
.report-list .r-list .r-name {
color: #3384DF;
font-size: 38rpx;
font-weight: bold;
}
.report-list .r-list .r-left text{
font-size: 28rpx;
color:#919191;
}
</style>

View File

@@ -87,3 +87,44 @@ export function getDate(type) {
return `${year}-${month}-${day}`;
}
// 日期格式化
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}

View File

@@ -8,4 +8,13 @@ export function formatIOS(type){
return result[type];
}
// 紧急程度 1-紧急 2-急 3-一般
export function formatLevel(type){
const result = {
1:'紧急',
2:'急',
3:'一般',
}
return result[type];
}