snow il y a 9 mois
Parent
commit
6602bbfbb0

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/index.html


BIN
dist/static/css/app.2afed481.css.gz


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/css/app.bf286833.css


BIN
dist/static/css/app.bf286833.css.gz


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/app.c931d63c.js


BIN
dist/static/js/app.c931d63c.js.gz


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/app.e71e1f85.js


BIN
dist/static/js/app.e71e1f85.js.gz


+ 41 - 9
src/components/newResults/department.vue

@@ -223,11 +223,12 @@ export default {
     ];
 
     const cp_list = this.cp_companies.map(item => item.label);
-
     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;
 
@@ -245,6 +246,11 @@ export default {
     addition,
     subtraction,
     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 }) {
       const { label } = column;
 
@@ -353,10 +359,36 @@ export default {
     async requestData() {
       this.loading = true;
       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) {
         // 非万宇 营业目标重取
@@ -458,7 +490,7 @@ export default {
               qd_cost: mchannel_cost_total, // 渠道成本
               post_fee: post_fee,
               depart: mapToDepartment[depart],
-              company: company.label,
+              company: company ? company.label : '--',
               currentMonthPure: [
                 {
                   zy: mzy_sale_total, 

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff