Commit ab029187 authored by 潘自豪's avatar 潘自豪

营业额明显页面修改

parent 3ec45876
<template>
<div class="turnover-detail">
<div class="card-board">
<contrast-card v-for="(data,key) in currentData.head" style="height: 100%;width: 20%;"
<contrast-card v-for="(data,key) in currentData.head" style="height: 100%;width: 23%;"
:class="{'selectCard': currentCard === key}"
@click.native="selectLegend(key)">
<title-content-mark style="color: #369afa;float: left;width: 40%;font-size: 18px"
<title-content-mark style="color: #369afa;float: left;width: 30%;font-size: 18px"
:title-style="{'font-weight': 'bold','line-height': '30px'}" :mark-style="{'bottom': '12%'}" :title="key" :content="data.amount" mark="万元" isBold/>
<div
style="width: 60%; height: 100%; float:left; padding: 2% 2% 0 8%; line-height: 60px; display: flex; align-items: center;font-size: 16px;">
style="width: 70%; height: 100%; float:left; padding: 2% 2% 0 8%; line-height: 60px; display: flex; align-items: center;font-size: 16px;">
<table-column style="float: left;width: 25%;" :data="data.hb" name="title"/>
<table-column style="float: left;width: 40%;" :data="data.hb" name="amount"/>
<table-column style="float: left;width: 35%;" :data="data.hb" name="rate"
......
......@@ -174,6 +174,12 @@ export const initSumDataDay = function () {
let turnOver = new Object()
turnOver.title = '营业额'
turnOver.amount = "0.0"
let hb = new Array()
let yesterday = initRate('昨日')
hb.push(yesterday)
yesterday = initRate('上月')
hb.push(yesterday)
turnOver.hb = hb
return turnOver;
}
......
<template>
<div class="main" @click="log()">
<div class="main">
<div class="middle">
<display-board class="trade_left" title="营业情况">
<div
......
//环比值=(当日营业额-昨日营业额)/昨日营业额*100%计算
export const calc_hb_str = function (cur, pre) {
if (cur == 0 || pre == 0){
if (cur == 0 || pre == 0) {
return '0.00%'
}
return conver_num_rate(formater((cur - pre) / pre * 100));
......@@ -8,12 +8,15 @@ export const calc_hb_str = function (cur, pre) {
//同比值=(当日营业额上个月同一日营业额)/上个月同一日营业额*100%计算
export const calc_tb_str = function (cur, pre) {
if (cur == 0 || pre == 0) {
return '0.00%'
}
return conver_num_rate(formater(cur / pre * 100));
};
//计算占比
export const calc_zb_str = function (item, total) {
if (item == 0 || total == 0){
if (item == 0 || total == 0) {
return '0.00%'
}
return formater(item / total * 100) + '%';
......@@ -22,7 +25,7 @@ export const calc_zb_str = function (item, total) {
//conver amont
export const conver_amont = function (amont) {
return formater(amont / 10000);
return amont ? formater(amont / 10000) : "0.0";
};
//Positive and negative
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment