|
|
|
@ -50,18 +50,221 @@ |
|
|
|
</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 class="box" @tap="goDetail('xiaoshou')"> |
|
|
|
<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> |
|
|
|
<uni-icons type="cart" 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.totalJCount:item.name == '退货总件数'?shopInfo.returnTotalCount: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> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;">{{shopInfo.totalAmount}}</text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="box" @tap="goDetail('xiaoshou')"> |
|
|
|
<view style="width: 69%;"> |
|
|
|
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;"> |
|
|
|
<uni-icons type="cart" size="24" color="red"></uni-icons> |
|
|
|
</view> |
|
|
|
销售总件数 |
|
|
|
</view> |
|
|
|
<view style="width: 30%;"> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;">{{shopInfo.totalJCount}}</text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="width: 100%;height: 10rpx;background: #eee;"></view> |
|
|
|
<view class="box" @tap="goDetail('xiaoshoulirun')"> |
|
|
|
<view style="width: 69%;"> |
|
|
|
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;"> |
|
|
|
<uni-icons type="wallet" size="24" color="red"></uni-icons> |
|
|
|
</view> |
|
|
|
销售利润 |
|
|
|
</view> |
|
|
|
<view style="width: 30%;"> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;">{{shopInfo.totalProfit==null?0:shopInfo.totalProfit}}</text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="box" @tap="showDayPrice = true"> |
|
|
|
<view style="width: 69%;"> |
|
|
|
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;"> |
|
|
|
<uni-icons type="wallet" size="24" color="red"></uni-icons> |
|
|
|
</view> |
|
|
|
实际利润 |
|
|
|
</view> |
|
|
|
<view style="width: 30%;"> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;">{{((shopInfo.totalProfit == null?0:shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}</text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="width: 100%;height: 10rpx;background: #eee;"></view> |
|
|
|
<view class="box" @tap="goDetail('jinhuo')"> |
|
|
|
<view style="width: 69%;"> |
|
|
|
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;"> |
|
|
|
<uni-icons type="home" size="24" color="red"></uni-icons> |
|
|
|
</view> |
|
|
|
进货金额 |
|
|
|
</view> |
|
|
|
<view style="width: 30%;"> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;">{{shopInfo.purchasingCost}}</text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="box" @tap="goDetail('jinhuo')"> |
|
|
|
<view style="width: 69%;"> |
|
|
|
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;"> |
|
|
|
<uni-icons type="home" size="24" color="red"></uni-icons> |
|
|
|
</view> |
|
|
|
进货总件数 |
|
|
|
</view> |
|
|
|
<view style="width: 30%;"> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;">{{shopInfo.purchasingCount}}</text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="width: 100%;height: 10rpx;background: #eee;"></view> |
|
|
|
<view class="box" @tap="goDetail('tuihuo')"> |
|
|
|
<view style="width: 69%;"> |
|
|
|
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;"> |
|
|
|
<uni-icons type="refreshempty" size="24" color="red"></uni-icons> |
|
|
|
</view> |
|
|
|
退货金额 |
|
|
|
</view> |
|
|
|
<view style="width: 30%;"> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;">{{shopInfo.returnTotalAmount}}</text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="box" @tap="goDetail('tuihuo')"> |
|
|
|
<view style="width: 69%;"> |
|
|
|
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;"> |
|
|
|
<uni-icons type="refreshempty" size="24" color="red"></uni-icons> |
|
|
|
</view> |
|
|
|
退货总件数 |
|
|
|
</view> |
|
|
|
<view style="width: 30%;"> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;">{{shopInfo.returnTotalCount}}</text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="width: 100%;height: 10rpx;background: #eee;"></view> |
|
|
|
<view class="box" @tap="goDetail('shishou')"> |
|
|
|
<view style="width: 69%;"> |
|
|
|
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;"> |
|
|
|
<uni-icons type="auth" size="24" color="red"></uni-icons> |
|
|
|
</view> |
|
|
|
实收金额 |
|
|
|
</view> |
|
|
|
<view style="width: 30%;"> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;">{{shopInfo.totalAlreadyEarn}}</text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="box" @tap="goDetail('xiadankehu')"> |
|
|
|
<view style="width: 69%;"> |
|
|
|
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;"> |
|
|
|
<uni-icons type="staff" size="24" color="red"></uni-icons> |
|
|
|
</view> |
|
|
|
下单客户 |
|
|
|
</view> |
|
|
|
<view style="width: 30%;"> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;">{{shopInfo.totalCCount}}</text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="box" @tap="goDetail('rexiao')"> |
|
|
|
<view style="width: 69%;"> |
|
|
|
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;"> |
|
|
|
<uni-icons type="fire" size="24" color="red"></uni-icons> |
|
|
|
</view> |
|
|
|
热销商品 |
|
|
|
</view> |
|
|
|
<view style="width: 30%;"> |
|
|
|
<text style="display: inline-block;width: 150rpx;text-align: center;"></text> |
|
|
|
<uni-icons type="right" size="24" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="showDayPrice" style="width:100%;height:100%;position: fixed;top: 0;background: rgba(0,0,0,0.7);"> |
|
|
|
<view |
|
|
|
style="position: fixed;margin:auto;height:660rpx;left:0;right:0;top:0;bottom:0;width:600rpx;background:#fff;border-radius: 10px;color: #000;"> |
|
|
|
<view style="width:100%;height:80rpx;font-size: 30rpx;text-align: center;line-height: 80rpx;font-weight: bold;"> |
|
|
|
利润明细 |
|
|
|
</view> |
|
|
|
<view style="display: flex;"> |
|
|
|
<view style="width: 25%;display: flex;flex-direction: column;text-align: center;"> |
|
|
|
<text style="font-weight: bold;">{{shopInfo.totalAmount}}</text> |
|
|
|
<text>销售金额</text> |
|
|
|
</view> |
|
|
|
<view style="width: 25%;display: flex;flex-direction: column;text-align: center;"> |
|
|
|
<text style="font-weight: bold;">{{shopInfo.totalAmount - shopInfo.totalProfit}}</text> |
|
|
|
<text>销售成本</text> |
|
|
|
</view> |
|
|
|
<view style="width: 25%;display: flex;flex-direction: column;text-align: center;"> |
|
|
|
<text style="font-weight: bold;">{{shopInfo.returnTotalAmount}}</text> |
|
|
|
<text>退货金额</text> |
|
|
|
</view> |
|
|
|
<view style="width: 25%;display: flex;flex-direction: column;text-align: center;"> |
|
|
|
<text style="font-weight: bold;">{{shopInfo.saleReturnCost}}</text> |
|
|
|
<text>退货成本</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="width: 95%;height:380rpx;margin: 0 auto;margin-top: 20rpx;border-top: 1px solid #eee;"> |
|
|
|
<view style="background: #ecf5ff;width: 100%;color: #5fd9ee;height: 80rpx;line-height: 80rpx;padding-left: 10px;"> |
|
|
|
点击↓↓↓可查看计算公式 |
|
|
|
</view> |
|
|
|
<view class="tan-lirun" @tap="changeFormula('0')"> |
|
|
|
<text style="font-weight: bold;margin-top: 20rpx;">{{shopInfo.totalProfit}}</text> |
|
|
|
<text>销售利润</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view @tap="changeFormula('1')" class="tan-lirun" style="float: right;" > |
|
|
|
<text style="font-weight: bold;margin-top: 20rpx;">{{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}</text> |
|
|
|
<text>实际利润</text> |
|
|
|
</view> |
|
|
|
<view @tap="changeFormula('3')" class="tan-lirun"> |
|
|
|
<text style="font-weight: bold;margin-top: 20rpx;">{{shopInfo.totalProfit == 0?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}%</text> |
|
|
|
<text>销售利润率</text> |
|
|
|
</view> |
|
|
|
<view @tap="changeFormula('2')" class="tan-lirun" style="float: right;"> |
|
|
|
<text style="font-weight: bold;margin-top: 20rpx;">{{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}%</text> |
|
|
|
<text>实际利润率</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view @tap="showDayPrice = false" style="height: 100rpx;width: 100%;line-height: 100rpx;text-align: center;border-top: 1px solid #eee;font-size: 40rpx;"> |
|
|
|
确定 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="showFormula" |
|
|
|
style="height:230rpx;position: fixed;z-index:999;margin:auto;left:0;right:0;top:0;bottom:0;width:200px;background: rgba(0,0,0,0.7);border-radius: 10px;color: #eee;"> |
|
|
|
<view style="width:100%;height:80rpx;font-size: 30rpx;text-align: center;line-height: 80rpx;"> |
|
|
|
{{showDan == 0?'销售利润':showDan == 1?'实际利润':showDan == 2?'实际利润率':showDan == 3?'销售利润率':''}}计算公式 |
|
|
|
</view> |
|
|
|
<view style="text-align: center;line-height: 40rpx;"> |
|
|
|
<view v-if="showDan == 3" style="margin-top: 20rpx;"> |
|
|
|
<view>公式:销售利润/销售金额*100</view> |
|
|
|
<view>{{shopInfo.totalProfit}}/{{shopInfo.totalAmount}}*100={{(shopInfo.totalProfit == 0 && shopInfo.totalAmount == 0)?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}%</view> |
|
|
|
</view> |
|
|
|
<view v-if="showDan == 2" style="margin-top: 20rpx;"> |
|
|
|
<view>公式:实际利润/(销售金额-退货金额)</view> |
|
|
|
<view>{{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}/{{shopInfo.totalAmount - shopInfo.returnTotalAmount}} * 100={{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}%</view> |
|
|
|
</view> |
|
|
|
<view v-if="showDan == 1" style="margin-top: 20rpx;"> |
|
|
|
<view>公式:销售利润-(退货金额-退货成本)</view> |
|
|
|
<view>{{shopInfo.totalProfit}}-({{shopInfo.returnTotalAmount}}-{{shopInfo.saleReturnCost}})={{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}</view> |
|
|
|
</view> |
|
|
|
<view v-if="showDan == 0" style="margin-top: 20rpx;"> |
|
|
|
<view>公式:销售金额-销售成本</view> |
|
|
|
<view>{{shopInfo.totalAmount}}-{{shopInfo.totalAmount - shopInfo.totalProfit}}={{shopInfo.totalProfit}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
@ -70,8 +273,15 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
showDan:'', |
|
|
|
showFormula: false, |
|
|
|
range:[], |
|
|
|
shopInfo:{}, |
|
|
|
shopInfo:{ |
|
|
|
totalProfit:0, |
|
|
|
returnTotalAmount:0, |
|
|
|
saleReturnCost:0 |
|
|
|
}, |
|
|
|
showDayPrice: false, |
|
|
|
type:uni.getStorageSync('type'), |
|
|
|
dataList:[{ |
|
|
|
name:'销售金额', |
|
|
|
@ -86,13 +296,21 @@ |
|
|
|
value:'shishou', |
|
|
|
icon:'auth' |
|
|
|
},{ |
|
|
|
name:'利润', |
|
|
|
value:'lirun', |
|
|
|
name:'销售利润', |
|
|
|
value:'xiaoshoulirun', |
|
|
|
icon:'wallet' |
|
|
|
},{ |
|
|
|
name:'实际利润', |
|
|
|
value:'shijilirun', |
|
|
|
icon:'wallet' |
|
|
|
},{ |
|
|
|
name:'进货金额', |
|
|
|
value:'jinhuo', |
|
|
|
icon:'home' |
|
|
|
},{ |
|
|
|
name:'进货总件数', |
|
|
|
value:'jinhuo', |
|
|
|
icon:'home' |
|
|
|
},{ |
|
|
|
name:'退货金额', |
|
|
|
value:'tuihuo', |
|
|
|
@ -103,8 +321,12 @@ |
|
|
|
icon:'refreshempty' |
|
|
|
},{ |
|
|
|
name:'下单客户', |
|
|
|
value:'xiadankehu', |
|
|
|
value:'xiadan', |
|
|
|
icon:'staff' |
|
|
|
},{ |
|
|
|
name:'热销商品', |
|
|
|
value:'rexiao', |
|
|
|
icon:'fire' |
|
|
|
}] |
|
|
|
}; |
|
|
|
}, |
|
|
|
@ -116,19 +338,37 @@ |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
goDetail(item){ |
|
|
|
if(item.value == 'lirun'){ |
|
|
|
if(item == 'xiaoshoulirun'){ |
|
|
|
uni.navigateTo({ |
|
|
|
url:'/package1/index/lirun?value='+ item.value + '&range=' + JSON.stringify(this.range) |
|
|
|
url:'/package1/index/lirun?value='+ item + '&range=' + JSON.stringify(this.range) |
|
|
|
}) |
|
|
|
}else if(item == 'shijilirun'){ |
|
|
|
this.showDayPrice = true |
|
|
|
}else if(item == 'rexiao'){ |
|
|
|
uni.navigateTo({ |
|
|
|
url:'/package1/index/fireGoods' |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
uni.navigateTo({ |
|
|
|
url:'/package1/index/statisticsDetail?value='+ item.value + '&range=' + JSON.stringify(this.range) |
|
|
|
url:'/package1/index/statisticsDetail?value='+ item + '&range=' + JSON.stringify(this.range) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
changeFormula(type){ |
|
|
|
console.log(type) |
|
|
|
this.showFormula = true |
|
|
|
this.showDan = type |
|
|
|
setTimeout(res=>{ |
|
|
|
this.showFormula = false |
|
|
|
},2000) |
|
|
|
}, |
|
|
|
getSaleInfo() { |
|
|
|
this.shopInfo = {} |
|
|
|
this.shopInfo = { |
|
|
|
totalProfit:0, |
|
|
|
returnTotalAmount:0, |
|
|
|
saleReturnCost:0 |
|
|
|
} |
|
|
|
this.tui.request("/app/sale/getShopAll", "POST", { |
|
|
|
pageVo: { |
|
|
|
pageSize: 5, |
|
|
|
@ -273,4 +513,16 @@ |
|
|
|
font-size: 34rpx; |
|
|
|
border-bottom: 1px solid #eee; |
|
|
|
} |
|
|
|
.tan-lirun{ |
|
|
|
margin-top: 20rpx; |
|
|
|
width: 45%; |
|
|
|
height: 60px; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
text-align: center; |
|
|
|
float: left; |
|
|
|
background-image: linear-gradient(#84C1FF, #C4E1FF) !important; |
|
|
|
color: #fff; |
|
|
|
border-radius: 10px; |
|
|
|
} |
|
|
|
</style> |