Commit 31bcfa65 authored by 潘自豪's avatar 潘自豪

流失客户bug修复

parent aafa21a7
...@@ -49,9 +49,9 @@ export default { ...@@ -49,9 +49,9 @@ export default {
}, },
}, },
async mounted() { async mounted() {
this.lostCustomer = await getAllDatas(this.today, 1) this.lostCustomer = await getAllDatas(this.today, 2)
console.log(this.lostCustomer) console.log(this.lostCustomer)
this.addCustomer = await getAllDatas(this.today, 2) this.addCustomer = await getAllDatas(this.today, 1)
console.log(this.addCustomer) console.log(this.addCustomer)
}, },
} }
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
} }
.content_card { .content_card {
width: 30%; width: 35%;
margin-top: 5%; margin-top: 5%;
height: 100%; height: 100%;
} }
......
...@@ -130,7 +130,7 @@ export const adapterSumData = function (dimension, type, data) { ...@@ -130,7 +130,7 @@ export const adapterSumData = function (dimension, type, data) {
* @param data * @param data
*/ */
export const adapterSumDataDay = function (type, data) { export const adapterSumDataDay = function (type, data) {
let turnOver = new Object() let turnOver = initSumDataDay();
let hb = new Array() let hb = new Array()
if (type == 'yye') { if (type == 'yye') {
turnOver.title = '营业额' turnOver.title = '营业额'
...@@ -141,7 +141,7 @@ export const adapterSumDataDay = function (type, data) { ...@@ -141,7 +141,7 @@ export const adapterSumDataDay = function (type, data) {
yesterday.title = '昨日' yesterday.title = '昨日'
yesterday.amount = conver_amont(data.pre_sell_settle_amount); yesterday.amount = conver_amont(data.pre_sell_settle_amount);
yesterday.rate = calc_hb_str(data.cur_sell_settle_amount, data.pre_sell_settle_amount); yesterday.rate = calc_hb_str(data.cur_sell_settle_amount, data.pre_sell_settle_amount);
hb.push(yesterday) turnOver[hb].push(yesterday)
} }
//昨日环比 //昨日环比
if (data.pre_month_sell_settle_amount) { if (data.pre_month_sell_settle_amount) {
...@@ -149,9 +149,8 @@ export const adapterSumDataDay = function (type, data) { ...@@ -149,9 +149,8 @@ export const adapterSumDataDay = function (type, data) {
premonth.title = '上月' premonth.title = '上月'
premonth.amount = conver_amont(data.pre_month_sell_settle_amount); premonth.amount = conver_amont(data.pre_month_sell_settle_amount);
premonth.rate = calc_tb_str(data.cur_sell_settle_amount, data.pre_month_sell_settle_amount); premonth.rate = calc_tb_str(data.cur_sell_settle_amount, data.pre_month_sell_settle_amount);
hb.push(premonth) turnOver[hb].push(premonth)
} }
turnOver.hb = hb;
} }
if (type == 'cb') { if (type == 'cb') {
turnOver.title = '成本' turnOver.title = '成本'
...@@ -162,7 +161,7 @@ export const adapterSumDataDay = function (type, data) { ...@@ -162,7 +161,7 @@ export const adapterSumDataDay = function (type, data) {
yesterday.title = '昨日' yesterday.title = '昨日'
yesterday.amount = conver_amont(data.pre_buy_settle_amount); yesterday.amount = conver_amont(data.pre_buy_settle_amount);
yesterday.rate = calc_hb_str(data.cur_buy_settle_amount, data.pre_buy_settle_amount); yesterday.rate = calc_hb_str(data.cur_buy_settle_amount, data.pre_buy_settle_amount);
hb.push(yesterday) turnOver[hb].push(yesterday)
} }
//昨日环比 //昨日环比
if (data.pre_month_buy_settle_amount) { if (data.pre_month_buy_settle_amount) {
...@@ -170,9 +169,9 @@ export const adapterSumDataDay = function (type, data) { ...@@ -170,9 +169,9 @@ export const adapterSumDataDay = function (type, data) {
premonth.title = '上月' premonth.title = '上月'
premonth.amount = conver_amont(data.pre_month_buy_settle_amount); premonth.amount = conver_amont(data.pre_month_buy_settle_amount);
premonth.rate = calc_tb_str(data.cur_buy_settle_amount, data.pre_month_buy_settle_amount); premonth.rate = calc_tb_str(data.cur_buy_settle_amount, data.pre_month_buy_settle_amount);
hb.push(premonth) turnOver[hb].push(premonth)
} }
turnOver.hb = hb;
} }
if (type == 'ml') { if (type == 'ml') {
turnOver.title = '毛利' turnOver.title = '毛利'
...@@ -183,7 +182,7 @@ export const adapterSumDataDay = function (type, data) { ...@@ -183,7 +182,7 @@ export const adapterSumDataDay = function (type, data) {
yesterday.title = '昨日' yesterday.title = '昨日'
yesterday.amount = conver_amont(data.pre_gross_profit_amount); yesterday.amount = conver_amont(data.pre_gross_profit_amount);
yesterday.rate = calc_hb_str(data.cur_gross_profit_amount, data.pre_gross_profit_amount); yesterday.rate = calc_hb_str(data.cur_gross_profit_amount, data.pre_gross_profit_amount);
hb.push(yesterday) turnOver[hb].push(yesterday)
} }
//昨日环比 //昨日环比
if (data.pre_month_gross_profit_amount) { if (data.pre_month_gross_profit_amount) {
...@@ -191,9 +190,9 @@ export const adapterSumDataDay = function (type, data) { ...@@ -191,9 +190,9 @@ export const adapterSumDataDay = function (type, data) {
premonth.title = '上月' premonth.title = '上月'
premonth.amount = conver_amont(data.pre_month_gross_profit_amount); premonth.amount = conver_amont(data.pre_month_gross_profit_amount);
premonth.rate = calc_tb_str(data.cur_gross_profit_amount, data.pre_month_gross_profit_amount); premonth.rate = calc_tb_str(data.cur_gross_profit_amount, data.pre_month_gross_profit_amount);
hb.push(premonth) turnOver[hb].push(premonth)
} }
turnOver.hb = hb;
} }
return turnOver; return turnOver;
} }
...@@ -228,7 +227,7 @@ export const initSumDataDay = function () { ...@@ -228,7 +227,7 @@ export const initSumDataDay = function () {
* @param data * @param data
*/ */
export const adapterSumDataMonth = function (type, data) { export const adapterSumDataMonth = function (type, data) {
let turnOver = new Object() let turnOver = initSumDataDay()
let hb = new Array() let hb = new Array()
if (type == 'yye') { if (type == 'yye') {
turnOver.title = '营业额' turnOver.title = '营业额'
...@@ -239,7 +238,7 @@ export const adapterSumDataMonth = function (type, data) { ...@@ -239,7 +238,7 @@ export const adapterSumDataMonth = function (type, data) {
yesterday.title = '上月' yesterday.title = '上月'
yesterday.amount = conver_amont(data.pre_month_sell_settle_amount); yesterday.amount = conver_amont(data.pre_month_sell_settle_amount);
yesterday.rate = calc_hb_str(data.cur_month_buy_settle_amount, data.pre_month_sell_settle_amount); yesterday.rate = calc_hb_str(data.cur_month_buy_settle_amount, data.pre_month_sell_settle_amount);
hb.push(yesterday) turnOver[hb].push(yesterday)
} }
//昨日环比 //昨日环比
if (data.pre_year_sell_settle_amount) { if (data.pre_year_sell_settle_amount) {
...@@ -247,9 +246,9 @@ export const adapterSumDataMonth = function (type, data) { ...@@ -247,9 +246,9 @@ export const adapterSumDataMonth = function (type, data) {
premonth.title = '去年' premonth.title = '去年'
premonth.amount = conver_amont(data.pre_year_sell_settle_amount); premonth.amount = conver_amont(data.pre_year_sell_settle_amount);
premonth.rate = calc_tb_str(data.cur_sell_settle_amount, data.pre_year_sell_settle_amount); premonth.rate = calc_tb_str(data.cur_sell_settle_amount, data.pre_year_sell_settle_amount);
hb.push(premonth) turnOver[hb].push(premonth)
} }
turnOver.hb = hb;
} }
if (type == 'cb') { if (type == 'cb') {
turnOver.title = '成本' turnOver.title = '成本'
...@@ -260,7 +259,7 @@ export const adapterSumDataMonth = function (type, data) { ...@@ -260,7 +259,7 @@ export const adapterSumDataMonth = function (type, data) {
yesterday.title = '上月' yesterday.title = '上月'
yesterday.amount = conver_amont(data.pre_month_buy_settle_amount); yesterday.amount = conver_amont(data.pre_month_buy_settle_amount);
yesterday.rate = calc_hb_str(data.cur_month_buy_settle_amount, data.pre_month_buy_settle_amount); yesterday.rate = calc_hb_str(data.cur_month_buy_settle_amount, data.pre_month_buy_settle_amount);
hb.push(yesterday) turnOver[hb].push(yesterday)
} }
//去年环比 //去年环比
if (data.pre_year_buy_settle_amount) { if (data.pre_year_buy_settle_amount) {
...@@ -268,9 +267,9 @@ export const adapterSumDataMonth = function (type, data) { ...@@ -268,9 +267,9 @@ export const adapterSumDataMonth = function (type, data) {
premonth.title = '去年' premonth.title = '去年'
premonth.amount = conver_amont(data.pre_year_buy_settle_amount); premonth.amount = conver_amont(data.pre_year_buy_settle_amount);
premonth.rate = calc_tb_str(data.cur_month_buy_settle_amount, data.pre_year_buy_settle_amount); premonth.rate = calc_tb_str(data.cur_month_buy_settle_amount, data.pre_year_buy_settle_amount);
hb.push(premonth) turnOver[hb].push(premonth)
} }
turnOver.hb = hb;
} }
if (type == 'ml') { if (type == 'ml') {
turnOver.title = '毛利' turnOver.title = '毛利'
...@@ -281,7 +280,7 @@ export const adapterSumDataMonth = function (type, data) { ...@@ -281,7 +280,7 @@ export const adapterSumDataMonth = function (type, data) {
yesterday.title = '上月' yesterday.title = '上月'
yesterday.amount = conver_amont(data.pre_month_gross_profit_amount); yesterday.amount = conver_amont(data.pre_month_gross_profit_amount);
yesterday.rate = calc_hb_str(data.cur_month_gross_profit_amount, data.pre_month_gross_profit_amount); yesterday.rate = calc_hb_str(data.cur_month_gross_profit_amount, data.pre_month_gross_profit_amount);
hb.push(yesterday) turnOver[hb].push(yesterday)
} }
//昨日环比 //昨日环比
if (data.pre_year_gross_profit_amount) { if (data.pre_year_gross_profit_amount) {
...@@ -289,9 +288,9 @@ export const adapterSumDataMonth = function (type, data) { ...@@ -289,9 +288,9 @@ export const adapterSumDataMonth = function (type, data) {
premonth.title = '去年' premonth.title = '去年'
premonth.amount = conver_amont(data.pre_year_gross_profit_amount); premonth.amount = conver_amont(data.pre_year_gross_profit_amount);
premonth.rate = calc_tb_str(data.cur_month_gross_profit_amount, data.pre_year_gross_profit_amount); premonth.rate = calc_tb_str(data.cur_month_gross_profit_amount, data.pre_year_gross_profit_amount);
hb.push(premonth) turnOver[hb].push(premonth)
} }
turnOver.hb = hb;
} }
return turnOver; return turnOver;
} }
...@@ -302,7 +301,7 @@ export const adapterSumDataMonth = function (type, data) { ...@@ -302,7 +301,7 @@ export const adapterSumDataMonth = function (type, data) {
* @param data * @param data
*/ */
export const adapterSumDataYear = function (type, data) { export const adapterSumDataYear = function (type, data) {
let turnOver = new Object() let turnOver = initSumDataDay()
let hb = new Array() let hb = new Array()
if (type == 'yye') { if (type == 'yye') {
turnOver.title = '营业额' turnOver.title = '营业额'
...@@ -313,9 +312,9 @@ export const adapterSumDataYear = function (type, data) { ...@@ -313,9 +312,9 @@ export const adapterSumDataYear = function (type, data) {
yesterday.title = '去年' yesterday.title = '去年'
yesterday.amount = conver_amont(data.pre_year_sell_settle_amount); yesterday.amount = conver_amont(data.pre_year_sell_settle_amount);
yesterday.rate = calc_hb_str(data.cur_year_sell_settle_amount, data.pre_year_sell_settle_amount); yesterday.rate = calc_hb_str(data.cur_year_sell_settle_amount, data.pre_year_sell_settle_amount);
hb.push(yesterday) turnOver[hb].push(yesterday)
} }
turnOver.hb = hb;
} }
if (type == 'cb') { if (type == 'cb') {
turnOver.title = '成本' turnOver.title = '成本'
...@@ -326,9 +325,9 @@ export const adapterSumDataYear = function (type, data) { ...@@ -326,9 +325,9 @@ export const adapterSumDataYear = function (type, data) {
yesterday.title = '去年' yesterday.title = '去年'
yesterday.amount = conver_amont(data.pre_year_buy_settle_amount); yesterday.amount = conver_amont(data.pre_year_buy_settle_amount);
yesterday.rate = calc_hb_str(data.cur_year_buy_settle_amount, data.pre_year_buy_settle_amount); yesterday.rate = calc_hb_str(data.cur_year_buy_settle_amount, data.pre_year_buy_settle_amount);
hb.push(yesterday) turnOver[hb].push(yesterday)
} }
turnOver.hb = hb;
} }
if (type == 'ml') { if (type == 'ml') {
turnOver.title = '毛利' turnOver.title = '毛利'
...@@ -339,9 +338,9 @@ export const adapterSumDataYear = function (type, data) { ...@@ -339,9 +338,9 @@ export const adapterSumDataYear = function (type, data) {
yesterday.title = '去年' yesterday.title = '去年'
yesterday.amount = conver_amont(data.pre_year_gross_profit_amount); yesterday.amount = conver_amont(data.pre_year_gross_profit_amount);
yesterday.rate = calc_hb_str(data.cur_year_gross_profit_amount, data.pre_year_gross_profit_amount); yesterday.rate = calc_hb_str(data.cur_year_gross_profit_amount, data.pre_year_gross_profit_amount);
hb.push(yesterday) turnOver[hb].push(yesterday)
} }
turnOver.hb = hb;
} }
return turnOver; return turnOver;
} }
......
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