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

营业额明显页面修改

parent 46ede36b
...@@ -44,9 +44,6 @@ export default async (url = '', data = {}, type = 'GET', method = 'fetch') => { ...@@ -44,9 +44,6 @@ export default async (url = '', data = {}, type = 'GET', method = 'fetch') => {
try { try {
const response = await fetch(url, requestConfig); const response = await fetch(url, requestConfig);
const responseJson = await response.json(); const responseJson = await response.json();
if(response.status === 403){
parent.window.location = "/";
}
return responseJson return responseJson
} catch (error) { } catch (error) {
throw new Error(error) throw new Error(error)
......
...@@ -36,7 +36,7 @@ export const adapterLostAdd = function (data) { ...@@ -36,7 +36,7 @@ export const adapterLostAdd = function (data) {
let lostAddDataCol = new Array(); let lostAddDataCol = new Array();
lostAddDataCol[0] = adapterLostAddCol("订单量(万吨) ", conver_amont(data.unit_weight), "red") lostAddDataCol[0] = adapterLostAddCol("订单量(万吨) ", conver_amont(data.unit_weight), "red")
lostAddDataCol[1] = adapterLostAddCol("订单件数", data.qty, "#eaa749") lostAddDataCol[1] = adapterLostAddCol("订单件数", data.qty, "#eaa749")
lostAddDataCol[2] = adapterLostAddCol("营额(万元)", conver_amont(data.sell_settle_amount), "#49eb29") lostAddDataCol[2] = adapterLostAddCol("营额(万元)", conver_amont(data.sell_settle_amount), "#49eb29")
lostAddData['column'] = lostAddDataCol; lostAddData['column'] = lostAddDataCol;
return lostAddData; return lostAddData;
} }
......
...@@ -3,11 +3,13 @@ ...@@ -3,11 +3,13 @@
<div class="content"> <div class="content">
<display-board class="content_card" :title="lostCustomerTitle" title_size="large"> <display-board class="content_card" :title="lostCustomerTitle" title_size="large">
<winners-list style="height: 100%;overflow: auto;" id="ar_company_list" <winners-list style="height: 100%;overflow: auto;" id="ar_company_list"
:columns-style="{'title':{'width':'45%'}}"
:rows="lostCustomer" :rows="lostCustomer"
/> />
</display-board> </display-board>
<display-board class="content_card" :title="addCustomerTitle" title_size="large"> <display-board class="content_card" :title="addCustomerTitle" title_size="large">
<winners-list style="height: 100%;overflow: auto;" id="ar_company_list" <winners-list style="height: 100%;overflow: auto;" id="ar_company_list"
:columns-style="{'title':{'width':'45%'}}"
:rows="addCustomer" :rows="addCustomer"
/> />
</display-board> </display-board>
...@@ -50,9 +52,7 @@ export default { ...@@ -50,9 +52,7 @@ export default {
}, },
async mounted() { async mounted() {
this.lostCustomer = await getAllDatas(this.today, 2) this.lostCustomer = await getAllDatas(this.today, 2)
console.log(this.lostCustomer)
this.addCustomer = await getAllDatas(this.today, 1) this.addCustomer = await getAllDatas(this.today, 1)
console.log(this.addCustomer)
}, },
} }
</script> </script>
......
...@@ -136,64 +136,33 @@ export const adapterSumDataDay = function (type, data) { ...@@ -136,64 +136,33 @@ export const adapterSumDataDay = function (type, data) {
turnOver.title = '营业额' turnOver.title = '营业额'
turnOver.amount = conver_amont(data.cur_sell_settle_amount); turnOver.amount = conver_amont(data.cur_sell_settle_amount);
//昨日环比 //昨日环比
if (data.pre_sell_settle_amount) { let yesterday = initRate('昨日', conver_amont(data.pre_sell_settle_amount), calc_hb_str(data.cur_sell_settle_amount, data.pre_sell_settle_amount))
let yesterday = new Object() hb.push(yesterday)
yesterday.title = '昨日'
yesterday.amount = conver_amont(data.pre_sell_settle_amount);
yesterday.rate = calc_hb_str(data.cur_sell_settle_amount, data.pre_sell_settle_amount);
turnOver[hb].push(yesterday)
}
//昨日环比 //昨日环比
if (data.pre_month_sell_settle_amount) { let premonth = initRate('上月', conver_amont(data.pre_month_sell_settle_amount), calc_tb_str(data.cur_sell_settle_amount, data.pre_month_sell_settle_amount))
let premonth = new Object() hb.push(premonth)
premonth.title = '上月'
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);
turnOver[hb].push(premonth)
}
} }
if (type == 'cb') { if (type == 'cb') {
turnOver.title = '成本' turnOver.title = '成本'
turnOver.amount = conver_amont(data.cur_buy_settle_amount); turnOver.amount = conver_amont(data.cur_buy_settle_amount);
//昨日环比 //昨日环比
if (data.pre_buy_settle_amount) { let yesterday = initRate('昨日', conver_amont(data.pre_buy_settle_amount), calc_hb_str(data.cur_buy_settle_amount, data.pre_buy_settle_amount))
let yesterday = new Object() hb.push(yesterday)
yesterday.title = '昨日'
yesterday.amount = conver_amont(data.pre_buy_settle_amount);
yesterday.rate = calc_hb_str(data.cur_buy_settle_amount, data.pre_buy_settle_amount);
turnOver[hb].push(yesterday)
}
//昨日环比 //昨日环比
if (data.pre_month_buy_settle_amount) { let premonth = initRate('上月', conver_amont(data.pre_month_buy_settle_amount), calc_tb_str(data.cur_buy_settle_amount, data.pre_month_buy_settle_amount))
let premonth = new Object() hb.push(premonth)
premonth.title = '上月'
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);
turnOver[hb].push(premonth)
}
} }
if (type == 'ml') { if (type == 'ml') {
turnOver.title = '毛利' turnOver.title = '毛利'
turnOver.amount = conver_amont(data.cur_gross_profit_amount); turnOver.amount = conver_amont(data.cur_gross_profit_amount);
//昨日环比 //昨日环比
if (data.pre_gross_profit_amount) { let yesterday = initRate('昨日', conver_amont(data.pre_gross_profit_amount), calc_hb_str(data.cur_gross_profit_amount, data.pre_gross_profit_amount))
let yesterday = new Object() hb.push(yesterday)
yesterday.title = '昨日'
yesterday.amount = conver_amont(data.pre_gross_profit_amount);
yesterday.rate = calc_hb_str(data.cur_gross_profit_amount, data.pre_gross_profit_amount);
turnOver[hb].push(yesterday)
}
//昨日环比 //昨日环比
if (data.pre_month_gross_profit_amount) { let premonth = initRate('上月', conver_amont(data.pre_month_gross_profit_amount), calc_tb_str(data.cur_gross_profit_amount, data.pre_month_gross_profit_amount))
let premonth = new Object() hb.push(premonth)
premonth.title = '上月'
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);
turnOver[hb].push(premonth)
}
} }
turnOver['hb'] = hb
return turnOver; return turnOver;
} }
...@@ -205,22 +174,18 @@ export const initSumDataDay = function () { ...@@ -205,22 +174,18 @@ export const initSumDataDay = function () {
let turnOver = new Object() let turnOver = new Object()
turnOver.title = '营业额' turnOver.title = '营业额'
turnOver.amount = "0.0" turnOver.amount = "0.0"
let hb = new Array()
let yesterday = new Object()
yesterday.title = '昨日'
yesterday.amount = "0.0"
yesterday.rate = "0.0"
hb.push(yesterday)
yesterday = new Object()
yesterday.title = '上月'
yesterday.amount = "0.0"
yesterday.rate = "0.0"
hb.push(yesterday)
turnOver.hb = hb
return turnOver; return turnOver;
}
export const initRate = function (title, amount, rate) {
let rateVo = new Object()
rateVo.title = title
rateVo.amount = amount ? amount : "0.0"
rateVo.rate = rate ? rate : "0%"
return rateVo;
} }
/** /**
* 月维度汇总 * 月维度汇总
* @param type * @param type
...@@ -231,67 +196,35 @@ export const adapterSumDataMonth = function (type, data) { ...@@ -231,67 +196,35 @@ export const adapterSumDataMonth = function (type, data) {
let hb = new Array() let hb = new Array()
if (type == 'yye') { if (type == 'yye') {
turnOver.title = '营业额' turnOver.title = '营业额'
turnOver.amount = conver_amont(data.cur_month_buy_settle_amount); turnOver.amount = conver_amont(data.cur_month_sell_settle_amount);
//昨日环比 //昨日环比
if (data.pre_month_sell_settle_amount) { let yesterday = initRate('上月', conver_amont(data.pre_month_sell_settle_amount), calc_hb_str(data.cur_month_sell_settle_amount, data.pre_month_sell_settle_amount))
let yesterday = new Object() hb.push(yesterday)
yesterday.title = '上月'
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);
turnOver[hb].push(yesterday)
}
//昨日环比 //昨日环比
if (data.pre_year_sell_settle_amount) { let premonth = initRate('去年', conver_amont(data.pre_year_sell_settle_amount), calc_tb_str(data.cur_month_sell_settle_amount, data.pre_year_sell_settle_amount))
let premonth = new Object() hb.push(premonth)
premonth.title = '去年'
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);
turnOver[hb].push(premonth)
}
} }
if (type == 'cb') { if (type == 'cb') {
turnOver.title = '成本' turnOver.title = '成本'
turnOver.amount = conver_amont(data.cur_month_buy_settle_amount); turnOver.amount = conver_amont(data.cur_month_buy_settle_amount);
//上月环比 //上月环比
if (data.pre_month_buy_settle_amount) { let yesterday = initRate('上月', conver_amont(data.pre_month_buy_settle_amount), calc_hb_str(data.cur_month_buy_settle_amount, data.pre_month_buy_settle_amount))
let yesterday = new Object() hb.push(yesterday)
yesterday.title = '上月'
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);
turnOver[hb].push(yesterday)
}
//去年环比 //去年环比
if (data.pre_year_buy_settle_amount) { let premonth = initRate('去年', conver_amont(data.pre_year_buy_settle_amount), calc_tb_str(data.cur_month_buy_settle_amount, data.pre_year_buy_settle_amount))
let premonth = new Object() hb.push(premonth)
premonth.title = '去年'
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);
turnOver[hb].push(premonth)
}
} }
if (type == 'ml') { if (type == 'ml') {
turnOver.title = '毛利' turnOver.title = '毛利'
turnOver.amount = conver_amont(data.cur_month_gross_profit_amount); turnOver.amount = conver_amont(data.cur_month_gross_profit_amount);
//昨日环比 //昨日环比
if (data.pre_month_gross_profit_amount) { let yesterday = initRate('上月', conver_amont(data.pre_month_gross_profit_amount), calc_hb_str(data.cur_month_gross_profit_amount, data.pre_month_gross_profit_amount))
let yesterday = new Object() hb.push(yesterday)
yesterday.title = '上月'
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);
turnOver[hb].push(yesterday)
}
//昨日环比 //昨日环比
if (data.pre_year_gross_profit_amount) { let premonth = initRate('去年', conver_amont(data.pre_year_gross_profit_amount), calc_tb_str(data.cur_month_gross_profit_amount, data.pre_year_gross_profit_amount))
let premonth = new Object() hb.push(premonth)
premonth.title = '去年'
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);
turnOver[hb].push(premonth)
}
} }
turnOver['hb'] = hb
return turnOver; return turnOver;
} }
...@@ -307,41 +240,24 @@ export const adapterSumDataYear = function (type, data) { ...@@ -307,41 +240,24 @@ export const adapterSumDataYear = function (type, data) {
turnOver.title = '营业额' turnOver.title = '营业额'
turnOver.amount = conver_amont(data.cur_year_sell_settle_amount); turnOver.amount = conver_amont(data.cur_year_sell_settle_amount);
//昨日环比 //昨日环比
if (data.pre_year_sell_settle_amount) { let yesterday = initRate('去年', conver_amont(data.pre_year_sell_settle_amount), calc_hb_str(data.cur_year_sell_settle_amount, data.pre_year_sell_settle_amount))
let yesterday = new Object() hb.push(yesterday)
yesterday.title = '去年'
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);
turnOver[hb].push(yesterday)
}
} }
if (type == 'cb') { if (type == 'cb') {
turnOver.title = '成本' turnOver.title = '成本'
turnOver.amount = conver_amont(data.cur_year_buy_settle_amount); turnOver.amount = conver_amont(data.cur_year_buy_settle_amount);
//上月环比 //上月环比
if (data.pre_year_buy_settle_amount) { let yesterday = initRate('去年', conver_amont(data.pre_year_buy_settle_amount), calc_hb_str(data.cur_year_buy_settle_amount, data.pre_year_buy_settle_amount))
let yesterday = new Object() hb.push(yesterday)
yesterday.title = '去年'
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);
turnOver[hb].push(yesterday)
}
} }
if (type == 'ml') { if (type == 'ml') {
turnOver.title = '毛利' turnOver.title = '毛利'
turnOver.amount = conver_amont(data.cur_year_gross_profit_amount); turnOver.amount = conver_amont(data.cur_year_gross_profit_amount);
//昨日环比 //昨日环比
if (data.pre_year_gross_profit_amount) { let yesterday = initRate('去年', conver_amont(data.pre_year_gross_profit_amount), calc_hb_str(data.cur_year_gross_profit_amount, data.pre_year_gross_profit_amount))
let yesterday = new Object() hb.push(yesterday)
yesterday.title = '去年'
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);
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