snow il y a 7 mois
Parent
commit
5a4142bc4b

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


BIN
dist/static/css/app.4875354f.css.gz


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


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


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


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


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


BIN
dist/static/js/app.57c47288.js.gz


+ 1 - 11
src/components/newEarningReport/company.vue

@@ -1,15 +1,7 @@
 <template>
   <div v-loading="loading">
     <div class="search clear" style="align-items: center;">
-      <el-tooltip placement="top" width="50px" trigger="hover" content="平台公司">
-            <i
-              class="el-icon-warning-outline"
-              style="font-size:16px;cursor:pointer;;display:inline-block;padding-right: 5px"
-            ></i>
-        </el-tooltip>
-
-        <span style="font-size: 15px;">月度完成情况</span>
-
+      <span style="font-size: 15px;">预定单E企购-月度完成情况</span>
       <div style="float:right">
         <el-date-picker class="fr picker no-padding" v-model="daytime" style="width:95px" value-format="yyyy-MM-dd"
           :editable="false" :disabled="isEmpty" :clearable="false" :size="'small'" format="yyyy-MM-dd" type="date"
@@ -26,7 +18,6 @@
         :header-cell-class-name="setHeaderClassName"
         :cell-class-name="setCellClassName"
         row-key="companyNo"
-        default-expand-all
         :load="load"
         lazy
        >
@@ -296,7 +287,6 @@ export default {
         return Number(subtraction(sourceData[prop], this.filterCompany[prop])).toFixed(2)
       } else {
         const [i1, i2,i3] = prop.split('.') 
-        console.log(sourceData.info[i1][i2][i3], this.filterCompany.info[i1][i2][i3])
         return Number(subtraction(sourceData.info[i1][i2][i3], this.filterCompany.info[i1][i2][i3])).toFixed(2)
       }
     },

+ 69 - 27
src/components/newEarningReport/supplier.vue

@@ -75,7 +75,14 @@
 
           <el-table-column label="营业收入(净)" align="center" min-width="115px">
             <template slot-scope="scope">
-              <div style="display:flex;justify-content:center" :style="`${isAmountProp(scope.row.companyName) ? '' :getCurrentValueStyle(scope.row.msale_total, scope.row.total_tips)}`">
+              <div 
+                style="display:flex;justify-content:center" 
+                :style="`${
+                  isAmountProp(scope.row.companyName) 
+                    ? getTotalValueStyle(scope.row, 'msale_total') 
+                    : getCurrentValueStyle(scope.row.msale_total, scope.row.total_tips)
+                  }`"
+              >
                {{ 
                 isAmountProp(scope.row.companyName)
                   ? unit2TenThousand(calcAmount('msale_total', scope.row.companyNo), isTenThound)
@@ -87,7 +94,7 @@
 
           <el-table-column label="营收完成%" align="center" min-width="85px">
             <template slot-scope="scope">
-              <div :style="`${isAmountProp(scope.row.companyName) ? '' : getCurrentRateStyle(scope.row.completion_rate)}`">
+              <div :style="`${isAmountProp(scope.row.companyName) ? getTotalRateStyle(scope.row,'completion_rate') : getCurrentRateStyle(scope.row.completion_rate)}`">
                 {{ 
                     isAmountProp(scope.row.companyName) 
                     ? calcAmountCompletionRate(scope.row.companyNo) 
@@ -111,7 +118,7 @@
 
             <el-table-column label="毛利完成" align="center" min-width="90px">
               <template slot-scope="scope">
-                <div :style="`${isAmountProp(scope.row.companyName) ? '' : getCurrentValueStyle(scope.row.gross_completion, scope.row.cost_tips)}`">
+                <div :style="`${isAmountProp(scope.row.companyName) ? getTotalValueStyle(scope.row,'gross_completion', true) : getCurrentValueStyle(scope.row.gross_completion, scope.row.cost_tips)}`">
                   {{ costField 
                     ?  isAmountProp(scope.row.companyName) ? unit2TenThousand(calcAmount('gross_completion', scope.row.companyNo), isTenThound) : unit2TenThousand(scope.row.gross_completion, isTenThound) 
                     : '***' 
@@ -123,7 +130,7 @@
 
             <el-table-column label="毛利完成%" align="center" min-width="85px">
               <template slot-scope="scope">
-                <div :style="isAmountProp(scope.row.companyName) ? '' : getCurrentRateStyle(scope.row.gross_completion_rate)">
+                <div :style="isAmountProp(scope.row.companyName) ? getTotalRateStyle(scope.row, 'gross_completion_rate') : getCurrentRateStyle(scope.row.gross_completion_rate)">
                   {{  isAmountProp(scope.row.companyName) ? calcAmountGrossCompletionRate(scope.row.companyNo) : scope.row.gross_completion_rate === '-' ? '-' : scope.row.gross_completion_rate  + '%' }}
                 </div>
               </template>
@@ -254,6 +261,39 @@ export default {
       const gross_completion = this.calcAmount('gross_completion', companyNo)
       return Number(multiplication(Number(division(gross_completion, cost_tips)).toFixed(2), 100)).toFixed(2) + '%'
     },
+    getTotalValueStyle(row, prop, isCost = false){
+      const days = dayjs(this.daytime).daysInMonth();
+        const total_tips = this.calcAmount(isCost ? 'cost_tips' : 'total_tips', row.companyNo)
+        const current = this.calcAmount(prop, row.companyNo)
+        const oneDay = Number(division(total_tips, days)).toFixed(2);
+        const currentDay = dayjs(this.daytime).date();
+        const currentTotalTip = Number(multiplication(currentDay, oneDay)).toFixed(2);
+        return Number(currentTotalTip) > Number(current) ? 'color: red' : '';
+
+    },
+    getTotalRateStyle(row, prop) {
+        const days = dayjs(this.daytime).daysInMonth();
+        const oneDay = Number(division(100, days)).toFixed(2);
+        const currentDay = dayjs(this.daytime).date();
+        const currentTotalTip = Number(multiplication(currentDay, oneDay)).toFixed(2);
+        const current = this.calcAmount(prop,row.companyNo)
+        return Number(currentTotalTip) > Number(current) ? 'color:red' : ''
+      
+    },
+    getCurrentRateStyle(current) {
+      const days = dayjs(this.daytime).daysInMonth();
+      const oneDay = Number(division(100, days)).toFixed(2);
+      const currentDay = dayjs(this.daytime).date();
+      const currentTotalTip = Number(multiplication(currentDay, oneDay)).toFixed(2);
+      return Number(currentTotalTip) > Number(current) ? 'color:red' : ''
+    },
+    getCurrentValueStyle(current, total = 0) {
+      const days = dayjs(this.daytime).daysInMonth();
+      const oneDay = Number(division(total, days)).toFixed(2);
+      const currentDay = dayjs(this.daytime).date();
+      const currentTotalTip = Number(multiplication(currentDay, oneDay)).toFixed(2);
+      return Number(currentTotalTip) > Number(current) ? 'color: red' : '';
+    },
     calcAmountCompletionRate(companyNo){
       const msale_total = this.calcAmount('msale_total', companyNo)
       const total_tips = this.calcAmount('total_tips', companyNo)
@@ -303,6 +343,7 @@ export default {
 
 
       return sourceData.reduce((prev, current) => {
+        if(!current) return 0
         const value = Number(addition(prev,isNaN(current[prop]) ? 0 : current[prop]))
         return value === 0 ? 0 : value.toFixed(2)
       }, 0)
@@ -315,15 +356,7 @@ export default {
       resolve(ylBusiness ? ylBusiness.children : [])
     },
     unit2TenThousand,
-    getCurrentRateStyle(current) {
-      const days = dayjs(this.daytime).daysInMonth();
-      const oneDay = Number(division(100, days)).toFixed(2);
-      const currentDay = dayjs(this.daytime).date();
-      const currentTotalTip = Number(multiplication(currentDay, oneDay)).toFixed(2);
-      return Number(currentTotalTip) > Number(current) ? 'color:red' : ''
-    },
     handleData(data){
-      // console.log(JSON.parse(JSON.stringify(data.companyArr[0])))
       let companyArr = []
       data.companyArr.forEach(({ 
           supplierName,
@@ -407,13 +440,7 @@ export default {
 
       return companyArr
     },
-    getCurrentValueStyle(current, total = 0) {
-      const days = dayjs(this.daytime).daysInMonth();
-      const oneDay = Number(division(total, days)).toFixed(2);
-      const currentDay = dayjs(this.daytime).date();
-      const currentTotalTip = Number(multiplication(currentDay, oneDay)).toFixed(2);
-      return Number(currentTotalTip) > Number(current) ? 'color: red' : '';
-    },
+
     setCellClassName({ column, row, columnIndex }) {
       const { label } = column;
       let base = ''
@@ -481,6 +508,7 @@ export default {
         selfSupport.companyArr = this.handleData(selfSupport) 
         otherSupport.companyArr = this.handleData(otherSupport)
 
+
         this.otherSupport = otherSupport
         this.selfSupport = selfSupport
 
@@ -489,7 +517,7 @@ export default {
         const companies = ['北京普润心堂商贸有限公司', '北京锦兴弘昌科技有限公司', '北京知事文化产业发展有限公司']
         children = companies.map(companyName => {
           return children.find(item => item.companyName === companyName)
-        })
+        }).filter(item => item !== undefined)
 
 
         this.selfSupport.companyArr = this.selfSupport.companyArr.filter(({companyNo}) => !this.composeCompanies.includes(companyNo))
@@ -497,23 +525,18 @@ export default {
         this.selfSupport.companyArr = [
           {
             ...amountData,
-            // order_type: '自营订单',
             companyNo: 'selfSupportOrderAmount',
             companyName: '合计'
           },
-          {
+          ...(children.length === 0? [] : [{
             ...amountData,
             companyNo: 'selfSupportOrderPR',
             companyName: '普润',
             children
-          },
+          }]),
           ...this.selfSupport.companyArr
         ]
 
-       this.lastSupportCompany = this.selfSupport.companyArr[this.selfSupport.companyArr.length -1].companyName
-       const middle = Math.floor(this.selfSupport.companyArr.length / 2)
-       this.selfSupport.companyArr[middle].order_type = '自营订单'
-
         this.otherSupport.companyAmount = [
           {
             ...amountData,
@@ -529,6 +552,25 @@ export default {
           companyName: '合计'
         }]
 
+
+        const zrIndex =  this.selfSupport.companyArr.findIndex(({companyNo}) => companyNo === 'QS2206011103304501')
+        const hyIndex = this.selfSupport.companyArr.findIndex(({companyNo}) => companyNo === 'QS2203150147015222')
+        if(zrIndex !== -1 && hyIndex !== -1){
+          const temp = this.selfSupport.companyArr[zrIndex]
+          this.selfSupport.companyArr[zrIndex] = this.selfSupport.companyArr[hyIndex]
+          this.selfSupport.companyArr[hyIndex] = temp
+        }
+
+               
+       if(this.selfSupport.companyArr.length === 1){
+        this.selfSupport.companyArr[0].order_type = '自营订单'
+       }else{
+         this.lastSupportCompany = this.selfSupport.companyArr[this.selfSupport.companyArr.length -1].companyName
+        const middle = Math.floor(this.selfSupport.companyArr.length / 2)
+        this.selfSupport.companyArr[middle].order_type = '自营订单'
+       }
+
+
         // this.otherCompanise = sourceData.filter(({is_sup}) => is_sup === 1)
         // sourceData = sourceData.filter(({companyNo}) =>  !this.composeCompanies.includes(companyNo) && this.notOtherCompanise.includes(companyNo))
         // , hasChildren: true, children

+ 5 - 5
src/pages/newEarningReport.vue

@@ -31,14 +31,14 @@
 
 
       <div class="container">
-        <result-company 
-          :companies="companies"
+        <result-supplier 
+          :companies="companies" 
           :costField="costField" 
           :isTenThound="isTenThound" 
         />
-
-        <result-supplier 
-          :companies="companies" 
+        
+        <result-company 
+          :companies="companies"
           :costField="costField" 
           :isTenThound="isTenThound" 
         />

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