freight-web/src/PagesStatistics/index.vue

281 lines
6.4 KiB
Vue
Raw Normal View History

2024-03-04 07:10:11 +00:00
<template>
<NavBar :count="0" :title="'数据统计'"></NavBar>
2024-04-12 07:53:44 +00:00
<Box
v-if="
isShowModule(list[0].child.concat(list[1].child).concat(list[2].child))
"
:isShow="true"
2024-04-12 07:53:44 +00:00
>
<view
v-for="(item, index) in list"
:key="index"
v-show="isShowModule(item.child)"
>
2024-07-15 06:15:49 +00:00
<view class="title" :class="item.color">
2024-03-04 07:10:11 +00:00
<Title :title="item.title" />
</view>
<view class="box-content">
<view
v-for="(child, index) in item.child"
:key="index"
@click="(child as any).fn(child)"
v-show="isShowModule([{ title: child.title }])"
:class="{ box: isShowModule([{ title: child.title }]) }"
>
<view v-if="isShowModule([{ title: child.title }])">
2024-03-04 07:10:11 +00:00
<up-image
2024-07-15 06:15:49 +00:00
:src="`${url}/static/110/count/${child.icon}`"
2024-03-04 07:10:11 +00:00
mode="aspectFill"
2024-03-14 03:14:12 +00:00
width="60rpx"
height="60rpx"
2024-03-04 07:10:11 +00:00
></up-image>
</view>
<view v-if="isShowModule([{ title: child.title }])">{{
child.title
}}</view>
2024-03-04 07:10:11 +00:00
</view>
</view>
</view>
</Box>
2024-04-12 07:53:44 +00:00
<!-- 当收货 出货 常用app全部为空 显示暂无权限 -->
<up-empty
v-else
mode="permission"
icon="http://cdn.uviewui.com/uview/empty/permission.png"
:text="'暂无相关权限, 请联系管理员'"
>
</up-empty>
2024-07-07 01:20:57 +00:00
<TabBar :select="'统计'"></TabBar>
2024-03-04 07:10:11 +00:00
</template>
<script setup lang="ts">
2024-03-11 05:30:11 +00:00
import Box from "@/components/Box/index.vue";
import Title from "@/components/Title/index.vue";
2024-04-12 07:53:44 +00:00
import { useMemberStore } from "@/store/index";
import { ProfileApi } from "@/services";
2024-07-15 06:15:49 +00:00
import pinia from "@/store";
import { url } from "@/utils/data";
const store = useMemberStore(pinia);
2024-03-04 07:10:11 +00:00
const list = reactive([
{
2024-07-15 06:15:49 +00:00
title: "收货数据",
color: "green",
2024-03-04 07:10:11 +00:00
child: [
{
2024-07-15 06:15:49 +00:00
icon: "1.png",
2024-03-04 07:10:11 +00:00
title: "收货汇总",
fn: (item: any) => {
uni.navigateTo({
2024-03-11 05:30:11 +00:00
url: "/pagesStatistics/receivePanel", // 要跳转到的页面路径
});
},
2024-03-04 07:10:11 +00:00
},
{
2024-07-15 06:15:49 +00:00
icon: "2.png",
title: "收货明细",
fn: (item: any) => {
uni.navigateTo({
url: "/pagesApp/receiveDetail", // 要跳转到的页面路径
});
},
},
{
icon: "3.png",
title: "收货作废",
fn: (item: any) => {
uni.navigateTo({
url: "/pagesApp/receiveCl", // 要跳转到的页面路径
});
},
},
{
icon: "4.png",
2024-03-04 07:10:11 +00:00
title: "供应商排行",
fn: (item: any) => {
uni.navigateTo({
2024-03-11 05:30:11 +00:00
url: "/pagesStatistics/supplierRanking", // 要跳转到的页面路径
});
},
2024-03-04 07:10:11 +00:00
},
],
},
{
2024-07-15 06:15:49 +00:00
title: "出货数据",
color: "blue",
2024-03-04 07:10:11 +00:00
child: [
{
2024-07-15 06:15:49 +00:00
icon: "5.png",
2024-03-04 07:10:11 +00:00
title: "出货汇总",
fn: (item: any) => {
uni.navigateTo({
2024-03-11 05:30:11 +00:00
url: "/pagesStatistics/shipmentPanel", // 要跳转到的页面路径
});
},
2024-03-04 07:10:11 +00:00
},
{
2024-07-15 06:15:49 +00:00
icon: "6.png",
title: "出货明细",
fn: (item: any) => {
uni.navigateTo({
url: "/pagesApp/shipmentDetail", // 要跳转到的页面路径
});
},
},
{
icon: "7.png",
title: "出货作废",
fn: (item: any) => {
uni.navigateTo({
url: "/pagesApp/shipmentCl", // 要跳转到的页面路径
});
},
},
{
icon: "8.png",
2024-03-04 07:10:11 +00:00
title: "客户排行",
fn: (item: any) => {
uni.navigateTo({
2024-03-11 05:30:11 +00:00
url: "/pagesStatistics/customerRanking", // 要跳转到的页面路径
});
},
2024-03-04 07:10:11 +00:00
},
],
},
{
2024-07-15 06:15:49 +00:00
title: "我的账本",
color: "orange",
2024-03-04 07:10:11 +00:00
child: [
{
2024-07-15 06:15:49 +00:00
icon: "10.png",
title: "供应商对账",
2024-03-04 07:10:11 +00:00
fn: (item: any) => {
uni.navigateTo({
2024-07-15 06:15:49 +00:00
url: "/pagesStatistics/supplierChecking", // 要跳转到的页面路径
});
},
2024-03-04 07:10:11 +00:00
},
{
2024-07-15 06:15:49 +00:00
icon: "11.png",
title: "客户对账",
2024-03-04 07:10:11 +00:00
fn: (item: any) => {
uni.navigateTo({
2024-07-15 06:15:49 +00:00
url: "/pagesStatistics/customerChecking", // 要跳转到的页面路径
});
},
2024-03-04 07:10:11 +00:00
},
2024-07-15 06:15:49 +00:00
2024-03-04 07:10:11 +00:00
{
2024-07-15 06:15:49 +00:00
icon: "12.png",
title: "付款明细",
2024-03-04 07:10:11 +00:00
fn: (item: any) => {
uni.navigateTo({
2024-07-15 06:15:49 +00:00
url: "/pagesApp/paymentDetail", // 要跳转到的页面路径
});
},
},
{
icon: "13.png",
title: "收款明细",
fn: (item: any) => {
uni.navigateTo({
url: "/pagesApp/incomeDetail", // 要跳转到的页面路径
});
},
},
{
icon: "14.png",
title: "经营概况",
fn: (item: any) => {
uni.navigateTo({
url: "/pagesStatistics/businessOverview", // 要跳转到的页面路径
});
},
2024-03-04 07:10:11 +00:00
},
],
},
]);
2024-04-12 07:53:44 +00:00
// 收货、出货、常用app是否显示
const isShowModule = (list: any) => {
let flag = false;
list.forEach((item: any) => {
if (store.profile.menusNameList.indexOf(item.title) > -1) {
flag = true;
return;
}
});
return flag;
};
onMounted(() => {
// 重新获取权限
ProfileApi.getUserInfo().then((res: any) => {
2024-04-12 07:53:44 +00:00
if (res.code === 200) {
store.setProfile({ ...res.data, token: store.profile.token });
2024-04-12 07:53:44 +00:00
}
});
});
2024-03-04 07:10:11 +00:00
</script>
<style lang="scss" scoped>
.title {
line-height: 80rpx;
2024-03-14 03:14:12 +00:00
padding: 0rpx 20rpx;
2024-07-15 06:15:49 +00:00
&::before {
content: "";
position: absolute;
margin-top: 13px;
margin-left: 0rpx;
width: 6rpx;
height: 26rpx;
background: #22d594;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 3rpx;
}
}
.green {
&::before {
background: #22d594;
}
}
.blue {
&::before {
background: rgba(34, 114, 213, 1);
}
}
.orange {
&::before {
background: rgba(255, 120, 43, 1);
}
2024-03-04 07:10:11 +00:00
}
.box-content {
display: flex;
2024-03-14 03:14:12 +00:00
padding: 0rpx 20rpx;
2024-07-15 06:15:49 +00:00
flex-wrap: wrap;
2024-04-12 07:53:44 +00:00
.box {
2024-07-15 06:15:49 +00:00
width: 140rpx;
height: 140rpx;
2024-03-04 07:10:11 +00:00
border-radius: 26rpx;
font-family: Source Han Sans CN;
font-weight: 400;
2024-03-14 03:14:12 +00:00
font-size: 26rpx;
2024-03-04 07:10:11 +00:00
color: #000000;
display: flex;
align-items: center;
justify-content: space-evenly;
flex-direction: column;
> view {
display: grid;
place-content: center;
width: 100%;
}
}
2024-04-12 07:53:44 +00:00
> .box + .box {
2024-03-14 03:14:12 +00:00
margin-left: 32rpx;
2024-03-04 07:10:11 +00:00
}
2024-07-15 06:15:49 +00:00
.box:nth-child(5n) {
margin-left: 0rpx;
2024-03-04 07:10:11 +00:00
}
}
</style>