|
@@ -223,11 +223,12 @@ export default {
|
|
];
|
|
];
|
|
|
|
|
|
const cp_list = this.cp_companies.map(item => item.label);
|
|
const cp_list = this.cp_companies.map(item => item.label);
|
|
-
|
|
|
|
list = list.filter(item => cp_list.includes(item));
|
|
list = list.filter(item => cp_list.includes(item));
|
|
- this.cp_companies = list.map(item =>
|
|
|
|
- this.cp_companies.find(cp_item => cp_item.label === item)
|
|
|
|
- );
|
|
|
|
|
|
+ this.cp_companies = list.map(item =>this.cp_companies.find(cp_item => cp_item.label === item));
|
|
|
|
+
|
|
|
|
+ if(this.hasCompose()){
|
|
|
|
+ this.cp_companies.unshift({ value: '', label: '万宇 + 预算单E企购' })
|
|
|
|
+ }
|
|
|
|
|
|
this.companyNo = this.cp_companies[0].value;
|
|
this.companyNo = this.cp_companies[0].value;
|
|
|
|
|
|
@@ -245,6 +246,11 @@ export default {
|
|
addition,
|
|
addition,
|
|
subtraction,
|
|
subtraction,
|
|
unit2TenThousand,
|
|
unit2TenThousand,
|
|
|
|
+ hasCompose(){
|
|
|
|
+ const hasWANYU = this.cp_companies.findIndex(({value}) => value === 'GS2203161855277894')
|
|
|
|
+ const hasTwo = this.cp_companies.findIndex(({value}) => value === 'GS2404151642335170')
|
|
|
|
+ return hasWANYU !== -1 && hasTwo !== -1
|
|
|
|
+ },
|
|
setCellClassName({ column, row }) {
|
|
setCellClassName({ column, row }) {
|
|
const { label } = column;
|
|
const { label } = column;
|
|
|
|
|
|
@@ -353,10 +359,36 @@ export default {
|
|
async requestData() {
|
|
async requestData() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
this.list = [];
|
|
this.list = [];
|
|
- const res = await asyncRequest.departmentEveryDay({
|
|
|
|
- daytime: this.daytime,
|
|
|
|
- companyNo: this.companyNo
|
|
|
|
- });
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let res = {}
|
|
|
|
+ // 预算单 + 万宇
|
|
|
|
+ if(this.companyNo === ''){
|
|
|
|
+ res = await asyncRequest.departmentEveryDay({ daytime: this.daytime, companyNo: 'GS2203161855277894' })
|
|
|
|
+ const two = await asyncRequest.departmentEveryDay({ daytime: this.daytime, companyNo: 'GS2404151642335170' })
|
|
|
|
+
|
|
|
|
+ const { data: data1 } = res
|
|
|
|
+ const { data: data2 } = two
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const newData = []
|
|
|
|
+ data1.forEach(item => {
|
|
|
|
+ const twoItem = data2.find(({depart}) => depart === item.depart)
|
|
|
|
+ const keys = Object.keys(item)
|
|
|
|
+ const newItem = keys.reduce((prev,current) => ({
|
|
|
|
+ ...prev,
|
|
|
|
+ [current]: current === 'depart' ? item.depart : Number(addition(item[current],twoItem[current])).toFixed(2)
|
|
|
|
+ }),{})
|
|
|
|
+ newData.push(newItem)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ res.data = newData
|
|
|
|
+ }else {
|
|
|
|
+ res = await asyncRequest.departmentEveryDay({ daytime: this.daytime, companyNo: this.companyNo });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
if (res.code === 0 && res.data && res.data.length > 0) {
|
|
if (res.code === 0 && res.data && res.data.length > 0) {
|
|
// 非万宇 营业目标重取
|
|
// 非万宇 营业目标重取
|
|
@@ -458,7 +490,7 @@ export default {
|
|
qd_cost: mchannel_cost_total, // 渠道成本
|
|
qd_cost: mchannel_cost_total, // 渠道成本
|
|
post_fee: post_fee,
|
|
post_fee: post_fee,
|
|
depart: mapToDepartment[depart],
|
|
depart: mapToDepartment[depart],
|
|
- company: company.label,
|
|
|
|
|
|
+ company: company ? company.label : '--',
|
|
currentMonthPure: [
|
|
currentMonthPure: [
|
|
{
|
|
{
|
|
zy: mzy_sale_total,
|
|
zy: mzy_sale_total,
|