获取首页信息

jg-waiwang-pro
XI_TENG\xixi_ 5 months ago
parent 472cb2f2f7
commit 18448362a3

@ -1,128 +1,194 @@
<template> <template>
<view class="u-page u-page-home"> <view class="">
<view class="sty-statistics-top-b">
<u-row gutter="16">
<u-col span="12" text-align="center"> <!-- 卡片 -->
<view class="sty-statistics-top-item"> <!-- <block v-if="item.show && item.jnpfKey === 'card'">
<view><span>济钢城市矿产再生资源智慧管家平台</span></view> <view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<view class="card-inner u-p-l-8 u-p-r-8 u-p-t-8">
<Item v-for="(child, index) in item.children" :item="child" :key="index" />
</view> </view>
</u-col> </template>
</u-row> </HCard>
</view> </view>
<view class="sty-statistics-top"> </block> -->
<u-row gutter="16"> <!-- 排行榜 -->
<u-col span="4" text-align="center" class="line-right"> <!-- <block v-if="item.show && item.jnpfKey === 'rankList'">
<view class="sty-statistics-top-item"> <view class="u-m-b-20">
<view><span class="fsizeA">{{homeInfo.avgPurchasePrice}}</span></view> <HCard :cardData="item">
<view><span class="fsizeA">磅单采购数1</span></view> <template slot='content'>
</view> <HRankList :config="item"></HRankList>
</u-col> </template>
<u-col span="4" text-align="center" class="line-right"> </HCard>
<view class="sty-statistics-top-item">
<view><span class="fsizeA">{{homeInfo.todayPurchasePrice}}</span></view>
<view><span class="fsizeA">今日采购量</span></view>
</view>
</u-col>
<u-col span="4" text-align="center">
<view class="sty-statistics-top-item">
<view><span class="fsizeA">{{homeInfo.salesVolumeToday}}</span></view>
<view><span class="fsizeA">今日销售量</span></view>
</view>
</u-col>
</u-row>
</view> </view>
<view class="sty-msg"> </block> -->
<u-notice-bar :duration="5000" mode="horizontal" :is-circular="false" @click="goMsg" :list="list"> <!-- 文本 -->
</u-notice-bar> <block v-if="item.show && item.jnpfKey === 'text'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HText :config="item"></HText>
</template>
</HCard>
</view> </view>
<view class="sty-statistics"> </block>
<u-row gutter="22" justify="space-between"> <!-- 图片 -->
<u-col span="12" gutter="0"> <block v-if="item.show && item.jnpfKey === 'image'">
<u-row gutter="22" justify="space-between"> <view class="u-m-b-20">
<u-col span="6"> <HCard :cardData="item">
<view class="sty-item sty-item-a"> <template slot='content'>
<u-row> <HImage :config="item"></HImage>
<u-col span="12" text-align="center"> </template>
<view> </HCard>
<u-icon name="red-packet" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
待支付:{{homeInfo.unpaid}}
</view>
</u-col>
</u-row>
</view>
</u-col>
<u-col span="6">
<view class="sty-item sty-item-b">
<u-row>
<u-col span="12" text-align="center">
<view>
<u-icon name="car" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
今日付款:{{homeInfo.todayPay}}
</view>
</u-col>
</u-row>
</view>
</u-col>
</u-row>
</u-col>
</u-row>
<u-row gutter="22" justify="space-between">
<u-col span="12" gutter="0">
<u-row gutter="22" justify="space-between">
<u-col span="6">
<view class="sty-item sty-item-c">
<u-row>
<u-col span="12" text-align="center">
<view>
<u-icon name="rmb" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
待回款:{{homeInfo.moneyCollected}}
</view>
</u-col>
</u-row>
</view>
</u-col>
<u-col span="6">
<view class="sty-item sty-item-d">
<u-row>
<u-col span="12" text-align="center">
<view>
<u-icon name="home" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
今日回款:{{homeInfo.todayPayment}}
</view>
</u-col>
</u-row>
</view>
</u-col>
</u-row>
</u-col>
</u-row>
</view> </view>
</view> </block>
<!-- 轮播图 -->
<!-- <block v-if="item.show && item.jnpfKey === 'carousel'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HCarousel :config="item"></HCarousel>
</template>
</HCard>
</view>
</block> -->
<!-- 视频 -->
<block v-if="item.show && item.jnpfKey === 'video'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HVideo :config="item"></HVideo>
</template>
</HCard>
</view>
</block>
<!-- 图表 -->
<!-- <block v-if="item.show && (item.jnpfKey === 'barChart' || item.jnpfKey === 'lineChart' || item.jnpfKey === 'pieChart'||
item.jnpfKey=='radarChart' || item.jnpfKey === 'mapChart')">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HCharts :config="item" :key="key">
</HCharts>
</template>
</HCard>
</view>
</block> -->
<!-- 我的待办 -->
<block v-if="item.show && item.jnpfKey === 'todo'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HTodo :config="item" :key="key">
</HTodo>
</template>
</HCard>
</view>
</block>
<!-- 常用功能 -->
<!-- <block v-if="item.show && item.jnpfKey === 'dataBoard'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HDataBoard :config="item" :key="key">
</HDataBoard>
</template>
</HCard>
</view>
</block> -->
<!-- 数据面板 -->
<!-- <block v-if="item.show && item.jnpfKey === 'commonFunc'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HCommonFunc :config="item" :key="key">
</HCommonFunc>
</template>
</HCard>
</view>
</block> -->
<!-- 时间轴 -->
<!-- <block v-if="item.show && item.jnpfKey === 'timeAxis'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HTimeAxis :config="item"></HTimeAxis>
</template>
</HCard>
</view>
</block> -->
<!-- 表格 -->
<block v-if="item.show && item.jnpfKey === 'tableList'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HTable :config="item">
</HTable>
</template>
</HCard>
</view>
</block>
<!-- 日程 -->
<block v-if="item.show && item.jnpfKey === 'schedule'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HSchedule :config="item" />
</template>
</HCard>
</view>
</block>
<!-- 待办事项 -->
<block v-if="item.show && item.jnpfKey === 'todoList'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HTodoList :config="item">
</HTodoList>
</template>
</HCard>
</view>
</block>
<!-- 未读邮件 -->
<block v-if="item.show && item.jnpfKey === 'email'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HEmail :config="item">
</HEmail>
</template>
</HCard>
</view>
</block>
<!-- 公告通知 -->
<block v-if="item.show && item.jnpfKey === 'notice'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HNotice :config="item">
</HNotice>
</template>
</HCard>
</view>
</block>
<!-- 标签 -->
<block v-if="item.show && item.jnpfKey === 'tab'">
<view class="u-m-b-20" style="background-color: #ffffff;">
<u-tabs :list="item.children" name="title" :is-scroll="item.children.length>3?true:false"
:current="tabCurrent" @change="onTabChange" :show-bar="item.type?false:true" :class="tabsClass"
:inactive-color="item.type==='border-card'?' #9ea1a6':'#303133'"
:active-item-style='activeItemStyle' :bg-color="item.type==='border-card'?'#f5f7fa':'#fff'">
</u-tabs>
<view v-for="(item,i) in item.children" :key='i' class="tab-inner u-p-l-8 u-p-r-8 u-p-b-8 u-p-t-8">
<view v-show="i == tabCurrent">
<Item v-for="(child, index) in item.children" :item="child" :key="key" />
</view>
</view>
</view>
</block>
</view>
</template> </template>
<script> <script>
import Item from './index' import Item from './index'
@ -178,12 +244,10 @@
tabsClass: '', tabsClass: '',
activeItemStyle: { activeItemStyle: {
'background-color': '#fff', 'background-color': '#fff',
}, }
homeInfo: {},
} }
}, },
created() { created() {
if (this.item.jnpfKey === 'tab') { if (this.item.jnpfKey === 'tab') {
const list = this.item.children const list = this.item.children
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
@ -197,11 +261,7 @@
} }
} }
}, },
methods: { methods: {
change(index) { change(index) {
this.current = index; this.current = index;
}, },
@ -215,122 +275,4 @@
</script> </script>
<style lang="scss"> <style lang="scss">
@import "@/static/iconfont.css";
.u-page {
.fsizeA {
font-size: 18px;
}
a {
text-decoration: none
}
}
.page-home {}
.sty-statistics-top {
// background-color: #2DA9FA;
background-color: #66B3FF;
padding: 0px;
//padding: 5px 0px 15px 0px;
color: #ffffff;
.sty-statistics-top-item {
padding: 5px 0px;
}
.line-right {
border-right: solid 1px #ffffff;
}
}
.sty-statistics-top-b {
background-color: #97CBFF;
padding: 0px;
//padding: 5px 0px 15px 0px;
color: #ffffff;
.sty-statistics-top-item {
padding: 5px 0px;
}
.line-right {
border-right: solid 1px #ffffff;
}
}
.sty-statistics {
.sty-item {
margin-top: 11px;
padding: 8px 0px;
color: #ffffff;
border-radius: 10px;
}
.sty-item-a {
background-color: #81CBFC;
}
.sty-item-b {
background-color: #1EC695;
}
.sty-item-c {
background-color: #FF9800;
}
.sty-item-d {
background-color: #2DA9FA;
}
}
.sty-sch-box {
margin-top: 11px;
}
.sty-nav-list {
background-color: #f0f2f6;
.sty-navg-item {
background-color: #ffffff;
border-bottom: solid 3px #f0f2f6;
padding: 11px 0px 0px 0px;
.title {
font-size: 16px;
line-height: 16px;
font-weight: bold;
}
.item-list {
font-size: 12px;
display: flex;
align-content: flex-start;
flex-wrap: wrap;
margin-top: 11px;
.item {
width: 25%;
margin-bottom: 12px;
}
}
}
}
.item-icon {
width: 80px;
height: 80px;
line-height: 48px;
text-align: center;
border-radius: 5px;
padding: 5px;
color: #fff;
font-size: 30px;
&.more {
background: #ECECEC;
color: #666666;
font-size: 30px;
}
}
</style> </style>

@ -1,702 +0,0 @@
<template>
<view class="u-page u-page-home">
<view class="sty-statistics-top-b">
<u-row gutter="16">
<u-col span="12" text-align="center">
<view class="sty-statistics-top-item">
<view><span>济钢城市矿产再生资源智慧管家平台</span></view>
</view>
</u-col>
</u-row>
</view>
<view class="sty-statistics-top">
<u-row gutter="16">
<u-col span="4" text-align="center" class="line-right">
<view class="sty-statistics-top-item">
<view><span class="fsizeA">{{homeInfo.avgPurchasePrice}}</span></view>
<view><span class="fsizeA">磅单采购数</span></view>
</view>
</u-col>
<u-col span="4" text-align="center" class="line-right">
<view class="sty-statistics-top-item">
<view><span class="fsizeA">{{homeInfo.todayPurchasePrice}}</span></view>
<view><span class="fsizeA">今日采购量</span></view>
</view>
</u-col>
<u-col span="4" text-align="center">
<view class="sty-statistics-top-item">
<view><span class="fsizeA">{{homeInfo.salesVolumeToday}}</span></view>
<view><span class="fsizeA">今日销售量</span></view>
</view>
</u-col>
</u-row>
</view>
<view class="sty-msg">
<u-notice-bar :duration="5000" mode="horizontal" :is-circular="false" @click="goMsg" :list="list">
</u-notice-bar>
</view>
<view class="sty-statistics">
<u-row gutter="22" justify="space-between">
<u-col span="12" gutter="0">
<u-row gutter="22" justify="space-between">
<u-col span="6">
<view class="sty-item sty-item-a">
<u-row>
<u-col span="12" text-align="center">
<view>
<u-icon name="red-packet" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
待支付:{{homeInfo.unpaid}}
</view>
</u-col>
</u-row>
</view>
</u-col>
<u-col span="6">
<view class="sty-item sty-item-b">
<u-row>
<u-col span="12" text-align="center">
<view>
<u-icon name="car" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
今日付款:{{homeInfo.todayPay}}
</view>
</u-col>
</u-row>
</view>
</u-col>
</u-row>
</u-col>
</u-row>
<u-row gutter="22" justify="space-between">
<u-col span="12" gutter="0">
<u-row gutter="22" justify="space-between">
<u-col span="6">
<view class="sty-item sty-item-c">
<u-row>
<u-col span="12" text-align="center">
<view>
<u-icon name="rmb" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
待回款:{{homeInfo.moneyCollected}}
</view>
</u-col>
</u-row>
</view>
</u-col>
<u-col span="6">
<view class="sty-item sty-item-d">
<u-row>
<u-col span="12" text-align="center">
<view>
<u-icon name="home" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
今日回款:{{homeInfo.todayPayment}}
</view>
</u-col>
</u-row>
</view>
</u-col>
</u-row>
</u-col>
</u-row>
</view>
</view>
</template>
<script>
var _ = require('lodash');
import request from '@/utils/request'
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
import IndexMixin from "./mixin.js";
import {
mapGetters
} from "vuex";
import {
getIMReply
} from "@/api/message.js";
import {
FlowLaunchList
} from '@/api/workFlow/flowLaunch'
import {
FlowBeforeList
} from '@/api/workFlow/flowBefore'
import {
versionUpgrade
} from '@/api/common.js'
import {
getAppVersion
} from '@/components/updataApp.js'
export default {
mixins: [MescrollMixin, IndexMixin],
data() {
return {
todayInfo: {
"purchasingGuidePrice": 2700,
"purchaseVolumeToday": 2800,
"salesVolumeToday": 2900,
},
homeInfo: {},
list: [],
listInfo: [],
upOption: {
use: false,
},
msgCountAll: 0,
btnGroupListO: [],
btnGroupList: [],
mapIcon: {
"jgdatamanagement": {
'text': '贸易',
'type': 'icon-maoyi',
'color': '#FFCC33',
},
"jgdatamanagementexamine": {
'text': '磅单审核',
'type': 'icon-jiesuan',
'color': '#66CCFF',
},
"jgpoundlist": {
'text': '磅单列表',
'type': 'icon-bangdan',
'color': '#0000CC',
},
"jgpurchaseorder": {
'text': '采购订单',
'type': 'icon-hetong',
'color': '#FFCC33',
},
"jgpurchasereturn": {
'text': '采购退货',
'type': 'icon-caigoutuihuo',
'color': '#66CCFF',
},
"jgsaleorder": {
'text': '销售订单',
'type': 'icon-hetong',
'color': '#FFCC33',
},
"jgsaleback": {
'text': '销售退货',
'type': 'icon-caigoutuihuo',
'color': '#66CCFF',
},
"jgpaymentrequest": {
'text': '付款申请单',
'type': 'icon-hetong',
'color': '#FFCC33',
},
"jgpayment": {
'text': '付款单',
'type': 'icon-hetong',
'color': '#FFCC33',
},
"jgcollection": {
'text': '收款单',
'type': 'icon-hetong',
'color': '#FFCC33',
},
"jgsupplyprocessanalysis": {
'text': '供应进程分析',
'type': 'icon-jindu',
'color': '#FFCC33',
},
"jgcustomerprofit": {
'text': '客户利润统计',
'type': 'icon-lirunfenxi',
'color': '#66CCFF',
},
"jgcustomer": {
'text': '客户档案',
'type': 'icon-kehuda',
'color': '#33CC33',
},
"jgsupplier": {
'text': '供应商档案',
'type': 'icon-gongyingshang',
'color': '#0000CC',
},
"jgmaterialarchive": {
'text': '物料档案',
'type': 'icon-wuliaoda',
'color': '#FF0033',
},
"jgvehicle": {
'text': '车辆档案',
'type': 'icon-huocheda',
'color': '#FFCC33',
},
"jgwarehousemanage": {
'text': '仓库管理',
'type': 'icon-cangku',
'color': '#FFCC33',
},
"jgareamanage": {
'text': '库区管理',
'type': 'icon-kuweiguanli',
'color': '#66CCFF',
},
"jgcontract": {
'text': '合同档案',
'type': 'icon-hetong',
'color': '#0000CC',
},
"jgnatural": {
'text': '业务员2',
'type': 'icon-renqun',
'color': '#FFCC33',
},
"jgproductionMonitoring": {
'text': '生产监控',
'type': 'icon-jiankong',
'color': '#FFCC33',
},
},
};
},
watch: {
badgeNum(val) {
this.setTabBarBadge();
},
},
computed: {
...mapGetters(["msgInfo"]),
baseURL() {
return this.define.baseURL;
},
report() {
return this.define.report;
},
token() {
return this.$store.getters.token;
},
},
onShow() {
console.log('2222')
this.getBtnGroupList()
// this.btnGroupList = this.btnGroupListO;
this.getHomeInfo()
this.getMsgList()
this.getMsgCount()
},
onLoad() {
console.log('1111')
let javaApk = 'http://221.214.32.166:8000/api/file/Image/annex/scApp.apk';
versionUpgrade().then(res => {
let resVersion = res.data.appVersion;
let forceUpdates = res.data.forceUpdates;
let updatesDescription = res.data.updatesDescription;
resVersion = Number(resVersion.replace(/[^0-9]/ig, ""));
getAppVersion(true, resVersion, javaApk, forceUpdates, updatesDescription)
})
this.$store.dispatch('user/getCurrentUser');
},
onUnload() {
uni.$off("updateList");
uni.$off("updateMsgNum");
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.scanCode({
success: (res) => {
if (this.isJSON(res.result)) {
const result = JSON.parse(res.result);
if (result.t === "ADP") {
uni.navigateTo({
url: "/pages/apply/dynamicModel/index?isPreview=1&id=" + result.id,
fail: (err) => {
this.$u.toast("暂无此页面");
},
});
}
if (result.t === "DFD") {
let config = JSON.stringify(result);
uni.navigateTo({
url: "/pages/apply/dynamicModel/scanForm?config=" + config,
fail: (err) => {
this.$u.toast("暂无此页面");
},
});
}
if (result.t === "report") {
let url =
`${this.report}/preview.html?id=${result.id}&token=${this.token}&page=1&from=menu`;
uni.navigateTo({
url: "/pages/apply/externalLink/index?url=" +
encodeURIComponent(url),
fail: (err) => {
this.$u.toast("暂无");
},
});
}
} else {
uni.navigateTo({
url: "/pages/my/scanResult/index?result=" + res.result,
fail: (err) => {
this.$u.toast("暂无此页面");
},
});
}
},
});
}
},
methods: {
getBtnGroupList() {
request({
url: '/api/oauth/CurrentUser?type=app',
method: 'get'
}).then(res => {
let _menuList = res.data.menuList;
_menuList = _.map(_menuList, (o1) => {
o1.children = _.map(o1.children, (o2) => {
if (_.has(this.mapIcon, o2.enCode)) {
o2.iconCus = this.mapIcon[o2.enCode];
} else {
o2.iconCus = null;
}
return o2;
})
return o1;
})
this.btnGroupListO = _menuList;
this.btnGroupList = this.btnGroupListO;
}).catch(() => {})
},
getHomeInfo() {
request({
url: '/api/messageCenter/MessageCenter/getHomePage',
method: 'get'
}).then(res => {
let _info = res.data[0];
this.homeInfo = _info;
}).catch(() => {})
},
getMsgList() {
const query = {
currentPage: 1,
pageSize: 20,
menuId: '',
}
request({
url: '/api/messageCenter/MessageCenter/getMobileList',
method: 'post',
data: query,
}).then(res => {
let _list = this.dataList(res.data);
let _listA = _.map(_list, (o1) => {
return o1.head;
})
this.list = _listA;
this.listInfo = _list;
this.mescroll.endSuccess(_list.length);
}).catch(() => {})
},
goMsg(idx) {
let _info = this.listInfo[idx];
let query = {
id: [_info.id]
};
request({
url: '/api/messageCenter/MessageCenter/isRead',
method: 'post',
data: query,
}).then(res => {
uni.navigateTo({
url: _info.skipUrl
})
}).catch(() => {})
},
schNav(val) {
let listO = _.cloneDeep(this.btnGroupListO);
listO = _.map(listO, (o1) => {
o1.children = _.filter(o1.children, (o2) => {
return _.includes(o2.fullName, val);
})
return o1;
})
listO = _.filter(listO, (o1) => {
return o1.children.length > 0;
})
this.btnGroupList = listO;
},
isJSON(str) {
try {
var obj = JSON.parse(str);
if (typeof obj == "object" && obj) {
return true;
} else {
return false;
}
} catch (e) {
return false;
}
},
downCallback(page) {
getIMReply()
.then((res) => {
this.list = res.data.list || [];
this.mescroll.endSuccess(res.data.list.length, false);
uni.hideLoading();
})
.catch(() => {
this.mescroll.endErr();
});
},
search() {
return;
this.searchTimer && clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.list = [];
this.mescroll.resetUpScroll();
}, 300);
},
updateReply(data) {
let boo = false;
const len = this.list.length;
for (let i = 0; i < len; i++) {
if (data.id === this.list[i].id) {
this.list[i].unreadMessage += data.unreadMessage;
this.list[i].latestMessage = data.latestMessage;
this.list[i].messageType = data.messageType;
this.list[i].latestDate = data.latestDate;
boo = true;
break;
}
}
if (boo) return;
data.unreadMessage = data.unreadMessage;
this.list.unshift(data);
},
updateMsgNum(id) {
const len = this.list.length;
for (let i = 0; i < len; i++) {
if (id === this.list[i].id) {
const num = this.list[i].unreadMessage;
this.$store.commit("chat/REDUCE_BADGE_NUM", num);
this.list[i].unreadMessage = 0;
break;
}
}
},
getMsgText(text, type) {
let message = "";
switch (type) {
case "voice":
message = "[语音]";
break;
case "image":
message = "[图片]";
break;
default:
message = text;
break;
}
return message;
},
openPage(path) {
if (!path) return;
uni.navigateTo({
url: path,
});
},
toIm(item) {
const name = item.realName + "/" + item.account;
if (item.unreadMessage) {
this.$store.commit("chat/REDUCE_BADGE_NUM", item.unreadMessage);
item.unreadMessage = 0;
}
uni.navigateTo({
url: "/pages/message/im/index?name=" +
name +
"&formUserId=" +
item.id +
"&headIcon=" +
item.headIcon,
});
},
dataList(data) {
let _list = []
for (let i = 0; i < data.list.length; i++) {
let _data = data.list[i]
_list.push(_data)
}
return _list;
},
getMsgCount() {
let query = {
currentPage: 1,
pageSize: 1,
keyword: ""
}
this.msgCountAll = 0;
FlowBeforeList(1, query, {
load: true
}).then(res => {
this.msgCountAll = this.msgCountAll + res.data.pagination.total;
FlowBeforeList(3, query, {
load: true
}).then(res => {
this.msgCountAll = this.msgCountAll + res.data.pagination.total;
if (this.msgCountAll > 0) {
uni.setTabBarBadge({
index: 3,
text: "" + this.msgCountAll + ""
})
} else {
uni.removeTabBarBadge({
index: 3
})
}
})
})
},
},
};
</script>
<style lang="scss">
@import "@/static/iconfont.css";
.u-page {
.fsizeA {
font-size: 18px;
}
a {
text-decoration: none
}
}
.page-home {}
.sty-statistics-top {
// background-color: #2DA9FA;
background-color: #66B3FF;
padding: 0px;
//padding: 5px 0px 15px 0px;
color: #ffffff;
.sty-statistics-top-item {
padding: 5px 0px;
}
.line-right {
border-right: solid 1px #ffffff;
}
}
.sty-statistics-top-b {
background-color: #97CBFF;
padding: 0px;
//padding: 5px 0px 15px 0px;
color: #ffffff;
.sty-statistics-top-item {
padding: 5px 0px;
}
.line-right {
border-right: solid 1px #ffffff;
}
}
.sty-statistics {
.sty-item {
margin-top: 11px;
padding: 8px 0px;
color: #ffffff;
border-radius: 10px;
}
.sty-item-a {
background-color: #81CBFC;
}
.sty-item-b {
background-color: #1EC695;
}
.sty-item-c {
background-color: #FF9800;
}
.sty-item-d {
background-color: #2DA9FA;
}
}
.sty-sch-box {
margin-top: 11px;
}
.sty-nav-list {
background-color: #f0f2f6;
.sty-navg-item {
background-color: #ffffff;
border-bottom: solid 3px #f0f2f6;
padding: 11px 0px 0px 0px;
.title {
font-size: 16px;
line-height: 16px;
font-weight: bold;
}
.item-list {
font-size: 12px;
display: flex;
align-content: flex-start;
flex-wrap: wrap;
margin-top: 11px;
.item {
width: 25%;
margin-bottom: 12px;
}
}
}
}
.item-icon {
width: 80px;
height: 80px;
line-height: 48px;
text-align: center;
border-radius: 5px;
padding: 5px;
color: #fff;
font-size: 30px;
&.more {
background: #ECECEC;
color: #666666;
font-size: 30px;
}
}
</style>

@ -1,278 +0,0 @@
<template>
<view class="">
<!-- 卡片 -->
<!-- <block v-if="item.show && item.jnpfKey === 'card'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<view class="card-inner u-p-l-8 u-p-r-8 u-p-t-8">
<Item v-for="(child, index) in item.children" :item="child" :key="index" />
</view>
</template>
</HCard>
</view>
</block> -->
<!-- 排行榜 -->
<!-- <block v-if="item.show && item.jnpfKey === 'rankList'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HRankList :config="item"></HRankList>
</template>
</HCard>
</view>
</block> -->
<!-- 文本 -->
<block v-if="item.show && item.jnpfKey === 'text'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HText :config="item"></HText>
</template>
</HCard>
</view>
</block>
<!-- 图片 -->
<block v-if="item.show && item.jnpfKey === 'image'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HImage :config="item"></HImage>
</template>
</HCard>
</view>
</block>
<!-- 轮播图 -->
<!-- <block v-if="item.show && item.jnpfKey === 'carousel'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HCarousel :config="item"></HCarousel>
</template>
</HCard>
</view>
</block> -->
<!-- 视频 -->
<block v-if="item.show && item.jnpfKey === 'video'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HVideo :config="item"></HVideo>
</template>
</HCard>
</view>
</block>
<!-- 图表 -->
<!-- <block v-if="item.show && (item.jnpfKey === 'barChart' || item.jnpfKey === 'lineChart' || item.jnpfKey === 'pieChart'||
item.jnpfKey=='radarChart' || item.jnpfKey === 'mapChart')">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HCharts :config="item" :key="key">
</HCharts>
</template>
</HCard>
</view>
</block> -->
<!-- 我的待办 -->
<block v-if="item.show && item.jnpfKey === 'todo'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HTodo :config="item" :key="key">
</HTodo>
</template>
</HCard>
</view>
</block>
<!-- 常用功能 -->
<!-- <block v-if="item.show && item.jnpfKey === 'dataBoard'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HDataBoard :config="item" :key="key">
</HDataBoard>
</template>
</HCard>
</view>
</block> -->
<!-- 数据面板 -->
<!-- <block v-if="item.show && item.jnpfKey === 'commonFunc'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HCommonFunc :config="item" :key="key">
</HCommonFunc>
</template>
</HCard>
</view>
</block> -->
<!-- 时间轴 -->
<!-- <block v-if="item.show && item.jnpfKey === 'timeAxis'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HTimeAxis :config="item"></HTimeAxis>
</template>
</HCard>
</view>
</block> -->
<!-- 表格 -->
<block v-if="item.show && item.jnpfKey === 'tableList'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HTable :config="item">
</HTable>
</template>
</HCard>
</view>
</block>
<!-- 日程 -->
<block v-if="item.show && item.jnpfKey === 'schedule'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HSchedule :config="item" />
</template>
</HCard>
</view>
</block>
<!-- 待办事项 -->
<block v-if="item.show && item.jnpfKey === 'todoList'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HTodoList :config="item">
</HTodoList>
</template>
</HCard>
</view>
</block>
<!-- 未读邮件 -->
<block v-if="item.show && item.jnpfKey === 'email'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HEmail :config="item">
</HEmail>
</template>
</HCard>
</view>
</block>
<!-- 公告通知 -->
<block v-if="item.show && item.jnpfKey === 'notice'">
<view class="u-m-b-20">
<HCard :cardData="item">
<template slot='content'>
<HNotice :config="item">
</HNotice>
</template>
</HCard>
</view>
</block>
<!-- 标签 -->
<block v-if="item.show && item.jnpfKey === 'tab'">
<view class="u-m-b-20" style="background-color: #ffffff;">
<u-tabs :list="item.children" name="title" :is-scroll="item.children.length>3?true:false"
:current="tabCurrent" @change="onTabChange" :show-bar="item.type?false:true" :class="tabsClass"
:inactive-color="item.type==='border-card'?' #9ea1a6':'#303133'"
:active-item-style='activeItemStyle' :bg-color="item.type==='border-card'?'#f5f7fa':'#fff'">
</u-tabs>
<view v-for="(item,i) in item.children" :key='i' class="tab-inner u-p-l-8 u-p-r-8 u-p-b-8 u-p-t-8">
<view v-show="i == tabCurrent">
<Item v-for="(child, index) in item.children" :item="child" :key="key" />
</view>
</view>
</view>
</block>
</view>
</template>
<script>
import Item from './index'
import HCard from './HCard'
import HDataBoard from './HDataBoard'
import HTable from './HTable'
import HNotice from './HNotice'
import HEmail from './HEmail'
import HTodoList from './HTodoList'
import HCharts from './HCharts'
import HRankList from './HRankList'
import HSchedule from './HSchedule'
import HImage from './HImage'
import HCarousel from './HCarousel'
import HText from './HText'
import HVideo from './HVideo'
import HTodo from './HTodo'
import HCommonFunc from './HCommonFunc'
import HTimeAxis from './HTimeAxis'
export default {
name: 'Item',
props: {
item: {
type: Object,
default: () => ({})
}
},
components: {
Item,
HCard,
HDataBoard,
HTable,
HNotice,
HEmail,
HTodoList,
HCharts,
HRankList,
HSchedule,
HImage,
HCarousel,
HText,
HVideo,
HTodo,
HCommonFunc,
HTimeAxis
},
data() {
return {
cardData: {},
current: 0,
tabCurrent: 0,
key: +new Date(),
tabsClass: '',
activeItemStyle: {
'background-color': '#fff',
}
}
},
created() {
if (this.item.jnpfKey === 'tab') {
const list = this.item.children
for (var i = 0; i < list.length; i++) {
if (this.item.active == list[i].name) {
this.tabCurrent = i
break
}
}
if (this.item.type === "border-card" || this.item.type === "card") {
this.tabsClass = 'htabs'
}
}
},
methods: {
change(index) {
this.current = index;
},
onTabChange(index) {
if (this.tabCurrent === index) return
this.tabCurrent = index;
this.key = +new Date()
},
}
}
</script>
<style lang="scss">
</style>

@ -4,7 +4,7 @@
<u-row gutter="16"> <u-row gutter="16">
<u-col span="12" text-align="center"> <u-col span="12" text-align="center">
<view class="sty-statistics-top-item"> <view class="sty-statistics-top-item">
<view><span>济钢城市矿产再生资源智慧管家平台</span></view> <view><span>济钢城市矿产再生资源智慧管家平台1</span></view>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>

@ -1,89 +1,131 @@
<template> <template>
<view class="menhu-v"> <view class="u-page u-page-home">
<!-- #ifndef MP --> <view class="sty-statistics-top-b">
<!-- <uni-nav-bar class='nav' :fixed="true" :statusBar="true" :border="false" :right-icon="rightIcon" <u-row gutter="16">
@clickRight="scan"> <u-col span="12" text-align="center">
<block slot="default"> <view class="sty-statistics-top-item">
<view class="nav-left" @click="showSelectBox"> <view><span>济钢城市矿产再生资源智慧管家平台</span></view>
<view class="nav-left-text">
{{portalTitle}}
</view>
<uni-icons class='right-icons' type="arrowdown" color="#000000" size="14"
v-if="portalList.length>0 &&userInfo.appPortalId" :class="{'select-right-icons':showSelect}" />
</view>
</block>
</uni-nav-bar> -->
<template>
<template v-if="userInfo.appPortalId">
<mescroll-body ref="mescrollRef" @down="downCallback" :down="downOption" :sticky="true" @up="upCallback"
:up="upOption" :bottombar="false" style="min-height: 100%" @init="mescrollInit">
<!-- 常规门户 -->
<view class="portal-v" v-if="authConfig.type==0">
<template v-if="formData.length">
<view class="portal-box" v-for="(item,index) in formData" :key="index">
<portalItem :item='item' ref="portalItem" :key="key" :protalData="formData"
v-if="item.show" />
</view>
</template>
<view v-else class="portal-v portal-nodata">
<view class="u-flex-col" style="align-items: center;">
<u-image width="280rpx" height="280rpx" :src="emptyImg1"></u-image>
<text class="u-m-t-20" style="color: #909399;">暂无数据</text>
</view>
</view> </view>
</view> </u-col>
<!-- 设计门户 --> </u-row>
<template v-if="authConfig.type==1"> </view>
<!-- #ifdef APP-PLUS --> <view class="sty-statistics-top">
<view v-if="authConfig.linkType==1 && showWebView"> <u-row gutter="16">
<web-view :src="authConfig.customUrl"></web-view> <u-col span="4" text-align="center" class="line-right">
<view class="sty-statistics-top-item">
<view><span class="fsizeA">{{homeInfo.avgPurchasePrice}}</span></view>
<view><span class="fsizeA">磅单采购数</span></view>
</view> </view>
<!-- #endif --> </u-col>
<!-- #ifdef H5 --> <u-col span="4" text-align="center" class="line-right">
<view v-if="authConfig.linkType==1 && showWebView" style="height:calc(100vh - 100px)"> <view class="sty-statistics-top-item">
<web-view :src="authConfig.customUrl"></web-view> <view><span class="fsizeA">{{homeInfo.todayPurchasePrice}}</span></view>
<view><span class="fsizeA">今日采购量</span></view>
</view> </view>
<!-- #endif --> </u-col>
<view v-else class="portal-v portal-nodata"> <u-col span="4" text-align="center">
<view class="u-flex-col" style="align-items: center;"> <view class="sty-statistics-top-item">
<u-image width="280rpx" height="280rpx" :src="emptyImg"></u-image> <view><span class="fsizeA">{{homeInfo.salesVolumeToday}}</span></view>
<text class="u-m-t-20" style="color: #909399;">当前内容无法在APP上显示请前往PC门户查看</text> <view><span class="fsizeA">今日销售量</span></view>
</view>
</view> </view>
</template> </u-col>
</mescroll-body> </u-row>
</template>
<view class="portal-v" v-else>
<view class="portal-box">
<defaultPortal></defaultPortal>
</view>
</view> </view>
</template> <view class="sty-msg">
<!-- #endif --> <u-notice-bar :duration="5000" mode="horizontal" :is-circular="false" @click="goMsg" :list="list">
<!-- #ifdef MP --> </u-notice-bar>
<view> </view>
<web-view :src="mpPortalUrl"></web-view> <view class="sty-statistics">
</view> <u-row gutter="22" justify="space-between">
<!-- #endif --> <u-col span="12" gutter="0">
<!-- #ifndef MP --> <u-row gutter="22" justify="space-between">
<u-popup v-model="showSelect" mode="top" class="select-box" height="600rpx" @close="closePopup"> <u-col span="6">
<!-- #ifdef APP-PLUS --> <view class="sty-item sty-item-a">
<view :style="{'margin-top':statusBarHeight+88+'px'}"></view> <u-row>
<!-- #endif --> <u-col span="12" text-align="center">
<!-- #ifdef H5 --> <view>
<view :style="{'margin-top':statusBarHeight+88+'rpx'}"></view> <u-icon name="red-packet" color="#ffffff" size="80"></u-icon>
<!-- #endif --> </view>
<view v-for="(item,index) in portalList" :key="index" class="select-item" @click="selectItem(item,index)"> </u-col>
<text class="u-m-r-12 u-font-40" </u-row>
:class="[item.icon,{'currentItem':item.id === userInfo.appPortalId}]" /> <u-row>
<text class="item-text sysName">{{item.fullName}}</text> <u-col span="12" text-align="center">
<u-icon name="checkbox-mark " class="currentItem" v-if="item.id === userInfo.appPortalId"></u-icon> <view>
待支付:{{homeInfo.unpaid}}
</view>
</u-col>
</u-row>
</view>
</u-col>
<u-col span="6">
<view class="sty-item sty-item-b">
<u-row>
<u-col span="12" text-align="center">
<view>
<u-icon name="car" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
今日付款:{{homeInfo.todayPay}}
</view>
</u-col>
</u-row>
</view>
</u-col>
</u-row>
</u-col>
</u-row>
<u-row gutter="22" justify="space-between">
<u-col span="12" gutter="0">
<u-row gutter="22" justify="space-between">
<u-col span="6">
<view class="sty-item sty-item-c">
<u-row>
<u-col span="12" text-align="center">
<view>
<u-icon name="rmb" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
待回款:{{homeInfo.moneyCollected}}
</view>
</u-col>
</u-row>
</view>
</u-col>
<u-col span="6">
<view class="sty-item sty-item-d">
<u-row>
<u-col span="12" text-align="center">
<view>
<u-icon name="home" color="#ffffff" size="80"></u-icon>
</view>
</u-col>
</u-row>
<u-row>
<u-col span="12" text-align="center">
<view>
今日回款:{{homeInfo.todayPayment}}
</view>
</u-col>
</u-row>
</view>
</u-col>
</u-row>
</u-col>
</u-row>
</view> </view>
</u-popup> </view>
<!-- #endif -->
</view>
</template> </template>
<script> <script>
var wv; //webview var wv; //webview
import { import {
@ -96,6 +138,7 @@
import chat from '@/libs/chat.js' import chat from '@/libs/chat.js'
import portalItem from '@/components/visualPortal/components/index.vue' import portalItem from '@/components/visualPortal/components/index.vue'
import defaultPortal from '@/components/visualPortal/components/defaultPortal.vue' import defaultPortal from '@/components/visualPortal/components/defaultPortal.vue'
import request from '@/utils/request'
import { import {
auth auth
} from '@/api/portal/portal.js' } from '@/api/portal/portal.js'
@ -113,6 +156,7 @@
}, },
data() { data() {
return { return {
homeInfo: {},
showWebView: true, showWebView: true,
emptyImg: require(`@/static/image/defProtal.png`), emptyImg: require(`@/static/image/defProtal.png`),
emptyImg1: resources.message.nodata, emptyImg1: resources.message.nodata,
@ -150,6 +194,8 @@
}; };
}, },
onShow() { onShow() {
console.log('11112')
this.getHomeInfo()
this.$forceUpdate() this.$forceUpdate()
this.token = uni.getStorageSync('token') this.token = uni.getStorageSync('token')
if (!this.$store.state.chat.socket) chat.initSocket() if (!this.$store.state.chat.socket) chat.initSocket()
@ -159,8 +205,9 @@
// #ifndef MP // #ifndef MP
this.getPortalList() this.getPortalList()
this.$nextTick(() => { this.$nextTick(() => {
this.mescroll.resetUpScroll(); // this.mescroll.resetUpScroll();
this.portalList = [] this.portalList = []
}) })
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
@ -176,11 +223,21 @@
// #ifndef MP // #ifndef MP
uni.$on('refresh', () => { uni.$on('refresh', () => {
this.formData = []; this.formData = [];
this.mescroll.resetUpScroll(); // this.mescroll.resetUpScroll();
}) })
// #endif // #endif
}, },
methods: { methods: {
getHomeInfo() {
request({
url: '/api/scm/BusinessEnterpriseRelational/getHomePage',
method: 'get'
}).then(res => {
let _info = res.data[0];
this.homeInfo = _info;
}).catch(() => {})
},
setWebview() { setWebview() {
if (this.authConfig.linkType == 1) { if (this.authConfig.linkType == 1) {
var currentWebview = this.$scope var currentWebview = this.$scope
@ -362,17 +419,17 @@
}, },
}); });
}, },
selectItem(item, index) { // selectItem(item, index) {
SetPortal(item.id).then(res => { // SetPortal(item.id).then(res => {
this.portalTitle = this.portalList[index].fullName // this.portalTitle = this.portalList[index].fullName
this.userInfo.appPortalId = item.id // this.userInfo.appPortalId = item.id
// #ifndef MP // // #ifndef MP
this.mescroll.resetUpScroll(); // this.mescroll.resetUpScroll();
// #endif // // #endif
this.showSelectBox() // this.showSelectBox()
uni.setStorageSync('userInfo', this.userInfo) // uni.setStorageSync('userInfo', this.userInfo)
}) // })
} // }
} }
} }
</script> </script>
@ -470,4 +527,122 @@
z-index: 100; z-index: 100;
background-color: #f0f2f6; background-color: #f0f2f6;
} }
@import "@/static/iconfont.css";
.u-page {
.fsizeA {
font-size: 18px;
}
a {
text-decoration: none
}
}
.page-home {}
.sty-statistics-top {
// background-color: #2DA9FA;
background-color: #66B3FF;
padding: 0px;
//padding: 5px 0px 15px 0px;
color: #ffffff;
.sty-statistics-top-item {
padding: 5px 0px;
}
.line-right {
border-right: solid 1px #ffffff;
}
}
.sty-statistics-top-b {
background-color: #97CBFF;
padding: 0px;
//padding: 5px 0px 15px 0px;
color: #ffffff;
.sty-statistics-top-item {
padding: 5px 0px;
}
.line-right {
border-right: solid 1px #ffffff;
}
}
.sty-statistics {
.sty-item {
margin-top: 11px;
padding: 8px 0px;
color: #ffffff;
border-radius: 10px;
}
.sty-item-a {
background-color: #81CBFC;
}
.sty-item-b {
background-color: #1EC695;
}
.sty-item-c {
background-color: #FF9800;
}
.sty-item-d {
background-color: #2DA9FA;
}
}
.sty-sch-box {
margin-top: 11px;
}
.sty-nav-list {
background-color: #f0f2f6;
.sty-navg-item {
background-color: #ffffff;
border-bottom: solid 3px #f0f2f6;
padding: 11px 0px 0px 0px;
.title {
font-size: 16px;
line-height: 16px;
font-weight: bold;
}
.item-list {
font-size: 12px;
display: flex;
align-content: flex-start;
flex-wrap: wrap;
margin-top: 11px;
.item {
width: 25%;
margin-bottom: 12px;
}
}
}
}
.item-icon {
width: 80px;
height: 80px;
line-height: 48px;
text-align: center;
border-radius: 5px;
padding: 5px;
color: #fff;
font-size: 30px;
&.more {
background: #ECECEC;
color: #666666;
font-size: 30px;
}
}
</style> </style>

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.BusinessEnterpriseRelationalMapper">
<resultMap id="getHomePageDataMap" type="map">
<!--采购平均价-->
<result property="avgPurchasePrice" column="avgPurchasePrice"/>
<!--今日采购量-->
<result property="todayPurchasePrice" column="todayPurchasePrice"/>
<!--今日销售量-->
<result property="salesVolumeToday" column="salesVolumeToday"/>
<!--待支付-->
<result property="unpaid" column="unpaid"/>
<!--今日付款-->
<result property="todayPay" column="todayPay"/>
<!--待回款-->
<result property="moneyCollected" column="moneyCollected"/>
<!--今日回款-->
<result property="todayPayment" column="todayPayment"/>
</resultMap>
<select id="getHomePageData" resultMap="getHomePageDataMap">
SELECT
*
FROM
(
SELECT
COUNT( b.id ) AS avgPurchasePrice,
IFNULL( SUM( Round( IF ( b.unit = '千克', b.net_weight / 1000, net_weight ), 3 )), 0 ) AS todayPurchasePrice
FROM
jg_receipt_order a
LEFT JOIN jg_delivery_voucher_relation b ON a.id = b.order_id
AND b.f_delete_mark IS NULL
WHERE
-- to_days( a.f_creator_time ) = to_days(
-- now())
-- AND
a.f_delete_mark IS NULL
AND a.receipt_type = '1'
) a,
(
SELECT
IFNULL( SUM( Round( IF ( b.unit = '千克', b.net_weight / 1000, net_weight ), 3 )), 0 ) AS salesVolumeToday
FROM
jg_receipt_order a
LEFT JOIN jg_delivery_voucher_relation b ON a.id = b.order_id
AND b.f_delete_mark IS NULL
WHERE
to_days( a.f_creator_time ) = to_days(
now())
AND a.f_delete_mark IS NULL
AND a.receipt_type = '2'
) b,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.apply_amount, 0 )), 0 ), 6 )/ 10000 unpaid -- 待支付
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '1'
AND a.apply_amount &lt;= a.payment_amount
AND a.f_delete_mark IS NULL
) c,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.payment_amount, 0 )), 0 ), 6 )/ 10000 todayPay -- 今日支付
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '1'
AND to_days( a.f_creator_time ) = to_days(
now())
AND a.f_delete_mark IS NULL
) d,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.apply_amount, 0 )), 0 ), 6 )/ 10000 moneyCollected -- 待回款
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '2'
AND a.apply_amount &lt;= a.payment_amount
AND a.f_delete_mark IS NULL
) e,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.payment_amount, 0 )), 0 ), 6 )/ 10000 todayPayment -- 今日回款
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '2'
AND to_days( a.f_creator_time ) = to_days(
now())
AND a.f_delete_mark IS NULL
) f
</select>
</mapper>

@ -3,102 +3,5 @@
<mapper namespace="jnpf.mapper.BusinessOrderProductRelationalMapper"> <mapper namespace="jnpf.mapper.BusinessOrderProductRelationalMapper">
<resultMap id="getHomePageDataMap" type="map">
<!--采购平均价-->
<result property="avgPurchasePrice" column="avgPurchasePrice"/>
<!--今日采购量-->
<result property="todayPurchasePrice" column="todayPurchasePrice"/>
<!--今日销售量-->
<result property="salesVolumeToday" column="salesVolumeToday"/>
<!--待支付-->
<result property="unpaid" column="unpaid"/>
<!--今日付款-->
<result property="todayPay" column="todayPay"/>
<!--待回款-->
<result property="moneyCollected" column="moneyCollected"/>
<!--今日回款-->
<result property="todayPayment" column="todayPayment"/>
</resultMap>
<select id="getHomePageData" resultMap="getHomePageDataMap">
SELECT
*
FROM
(
SELECT
COUNT( b.id ) AS avgPurchasePrice,
IFNULL( SUM( Round( IF ( b.unit = '千克', b.net_weight / 1000, net_weight ), 3 )), 0 ) AS todayPurchasePrice
FROM
jg_receipt_order a
LEFT JOIN jg_delivery_voucher_relation b ON a.id = b.order_id
AND b.f_delete_mark IS NULL
WHERE
-- to_days( a.f_creator_time ) = to_days(
-- now())
-- AND
a.f_delete_mark IS NULL
AND a.receipt_type = '1'
) a,
(
SELECT
IFNULL( SUM( Round( IF ( b.unit = '千克', b.net_weight / 1000, net_weight ), 3 )), 0 ) AS salesVolumeToday
FROM
jg_receipt_order a
LEFT JOIN jg_delivery_voucher_relation b ON a.id = b.order_id
AND b.f_delete_mark IS NULL
WHERE
to_days( a.f_creator_time ) = to_days(
now())
AND a.f_delete_mark IS NULL
AND a.receipt_type = '2'
) b,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.apply_amount, 0 )), 0 ), 6 )/ 10000 unpaid -- 待支付
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '1'
AND a.apply_amount &lt; a.payment_amount
AND a.f_delete_mark IS NULL
) c,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.payment_amount, 0 )), 0 ), 6 )/ 10000 todayPay -- 今日支付
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '1'
AND to_days( a.f_creator_time ) = to_days(
now())
AND a.f_delete_mark IS NULL
) d,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.apply_amount, 0 )), 0 ), 6 )/ 10000 moneyCollected -- 待回款
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '2'
AND a.apply_amount &lt; a.payment_amount
AND a.f_delete_mark IS NULL
) e,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.payment_amount, 0 )), 0 ), 6 )/ 10000 todayPayment -- 今日回款
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '2'
AND to_days( a.f_creator_time ) = to_days(
now())
AND a.f_delete_mark IS NULL
) f
</select>
</mapper> </mapper>

@ -48,7 +48,7 @@ public class BusinessEnterpriseRelationalServiceImpl extends ServiceImpl<Busines
@Autowired @Autowired
private UserProvider userProvider; private UserProvider userProvider;
@Resource @Autowired
private BusinessEnterpriseRelationalMapper businessEnterpriseRelationalMapper; private BusinessEnterpriseRelationalMapper businessEnterpriseRelationalMapper;
@Override @Override

@ -2,6 +2,7 @@ package jnpf.controller;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSort;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -329,8 +330,7 @@ public class BusinessEnterpriseRelationalController {
* @return * @return
*/ */
@GetMapping("/getHomePage") @GetMapping("/getHomePage")
@Operation(summary ="获取首页信息") public ActionResult getHomePage() {
public ActionResult getHomePage() throws IOException {
List<Map> list = businessEnterpriseRelationalService.getHomePage(); List<Map> list = businessEnterpriseRelationalService.getHomePage();
return ActionResult.success(list); return ActionResult.success(list);
} }

Loading…
Cancel
Save