平板端快衣店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

261 lines
6.9 KiB

<template>
<view>
<!-- <view style="position: fixed;top: 0;z-index: 99;width:100%;"> -->
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" type="daterange" @change="searchList" />
<!-- <view class="IndexContent">
<view class="contentPadding">
<u-grid :col="3">
<u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalAmount"></u-count-to>
<text class="grid-text">销售总金额</text>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalAlreadyEarn"></u-count-to>
<text class="grid-text">实收总额</text>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="type==0?shopInfo.totalProfit:0" :decimals="2"></u-count-to>
<view class="grid-text">利润</view>
</u-grid-item>
</u-grid>
<u-grid :col="5">
<view class="u-zidingyi">
<u-count-to :start-val="0" :end-val="shopInfo.totalCCount"></u-count-to>
<view class="grid-text">下单客户</view>
</view>
<view class="u-zidingyi">
<u-count-to :start-val="0" :end-val="shopInfo.purchasingCost"></u-count-to>
<view class="grid-text">进货金额</view>
</view>
<view class="u-zidingyi">
<u-count-to :start-val="0" :end-val="shopInfo.returnTotalAmount"></u-count-to>
<view class="grid-text">退货金额</view>
</view>
<view class="u-zidingyi">
<u-count-to :start-val="0" :end-val="shopInfo.returnTotalCount"></u-count-to>
<view class="grid-text">退货笔数</view>
</view>
</u-grid>
</view>
</view>
</view>
<view style="margin-top: 520rpx;">
<view v-for="(item,index) in priceList" :key="index">
<uni-card :title="item.day == null ?'暂无':item.day">
<view class="uni-body">
<view class="cardText"> 开单数:{{item.totalCount == null ?'暂无':item.totalCount}} </view>
<view class="priceText">总金额:{{item.price == null ?'暂无':item.price}}</view>
</view>
</uni-card>
</view>
</view> -->
<view style="width: 100%;margin: 20rpx auto;background: #fff;">
<view class="box" v-for="(item,index) in dataList" :key="index" @tap="goDetail(item)">
<view style="width: 69%;">
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;">
<uni-icons :type="item.icon" size="24" color="red"></uni-icons>
</view>
{{item.name}}
</view>
<view style="width: 30%;">
<text style="display: inline-block;width: 150rpx;text-align: center;">{{item.name == '销售金额'?shopInfo.totalAmount:item.name == '实收金额'?shopInfo.totalAlreadyEarn:item.name == '利润' && type == 0?shopInfo.totalProfit:item.name == '进货金额' && type == 0?shopInfo.purchasingCost:item.name == '退货金额'?shopInfo.returnTotalAmount:item.name == '下单客户'?shopInfo.totalCCount:""}}</text>
<uni-icons type="right" size="24" color="#777"></uni-icons>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
range:[],
shopInfo:{},
type:uni.getStorageSync('type'),
dataList:[{
name:'销售金额',
value:'xiaoshou',
icon:'cart',
},{
name:'实收金额',
value:'shishou',
icon:'auth'
},{
name:'利润',
value:'lirun',
icon:'wallet'
},{
name:'进货金额',
value:'jinhuo',
icon:'home'
},{
name:'退货金额',
value:'tuihuo',
icon:'refreshempty'
},{
name:'下单客户',
value:'xiadankehu',
icon:'staff'
}]
};
},
onShow(){
if(this.range ==''){
this.getMonth();
}
this.getSaleInfo();
},
methods: {
goDetail(item){
uni.navigateTo({
url:'/package1/index/statisticsDetail?value='+ item.value + '&range=' + JSON.stringify(this.range)
})
},
getSaleInfo() {
this.shopInfo = {}
this.tui.request("/app/sale/getShopAll", "POST", {
pageVo: {
pageSize: 5,
pageNumber: 1
},
startTime:this.range[0],
endTime:this.range[1]
}, false, false).then((res) => {
if (res.code == 200) {
this.shopInfo = res.result
} else {
this.tui.toast(res.message)
}
})
},
//获取当月1日到当前时间
getMonth() {
let date = new Date()
let year = date.getFullYear().toString() //'年'
let month = date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1).toString():(date.getMonth()+1).toString() //'月'
let da = date.getDate() < 10 ? '0'+date.getDate().toString():date.getDate().toString() //'日'
let end = year + '-' + month + '-' + da //当天
let beg = year + '-' + month + '-01' //当月第一天
this.range = [beg,end]
},
searchList() {
this.priceList = [];
this.getSaleInfo()
},
}
}
</script>
<style lang="scss">
.contentPadding {
padding: 28upx 20upx;
background-color: #fff;
color: #909399;
.title {
padding-left: 20rpx;
font-size: 32rpx;
color: #303133;
margin-bottom: 26rpx;
line-height: 66rpx;
image {
display: inline-block;
width: 40rpx;
vertical-align: middle;
}
.btn {
text-align: right;
width: 24%;
float: right;
font-size: 26rpx;
color: $u-primary;
}
}
.grid-text {
font-size: 28rpx;
margin-bottom: 26rpx;
text-align: center;
}
}
.u-grid-item {
width: 30% !important;
height: 160rpx;
background: linear-gradient(#84C1FF, #C4E1FF) !important;
margin-left: 3%;
border-radius: 30rpx;
margin-top: 20rpx !important;
color: #fff !important;
}
.cardText {
font-size: 12px;
}
.priceText {
color: $u-primary;
font-size: 14px;
}
.u-grid-item:nth-child(2) {
background: linear-gradient(#FFBB77, #FFDCB9) !important;
}
.u-grid-item:nth-child(3) {
background: linear-gradient(#1AFD9C, #7AFEC6) !important;
}
.u-grid-item:nth-child(4) {
background: linear-gradient(#1AFD9C, #7AFEC6) !important;
}
.u-grid-item:nth-child(5) {
background: linear-gradient(#FFBB77, #FFDCB9) !important;
}
.u-grid-item:nth-child(6) {
background: linear-gradient(#84C1FF, #C4E1FF) !important;
}
.u-count-num {
color: #FFF !important;
text-align:center;
}
.uni-date{
background: #fff;
}
.uni-tooltip-popup{
width: 180rpx;
}
.u-icon{
padding: 0 0 0 8px !important;
}
.u-zidingyi{
width: 22% !important;
height: 160rpx;
background: linear-gradient(#84C1FF, #C4E1FF) !important;
margin-left: 3%;
border-radius: 30rpx;
margin-top: 20rpx !important;
color: #fff !important;
text-align: center;
padding-top: 20rpx;
}
.u-zidingyi:nth-child(2) {
background: linear-gradient(#FFBB77, #C4E1FF) !important;
}
.u-zidingyi:nth-child(3) {
background: linear-gradient(#84C1FF, #7AFEC6) !important;
}
.u-zidingyi:nth-child(4) {
background: linear-gradient(#84C1FF, #C4E1FF) !important;
}
.box{
width: 100%;
height: 100rpx;
padding-left: 20rpx;
display: flex;
line-height: 100rpx;
font-size: 34rpx;
border-bottom: 1px solid #eee;
}
</style>