snow 1 gadu atpakaļ
vecāks
revīzija
211aacf025

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/index.html


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/app.887f962d.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/app.e56f1a18.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.8c6943e5.js


BIN
dist/static/js/app.8c6943e5.js.gz


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.fedb33fe.js


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


+ 7 - 14
src/components/newResults/company-month.vue

@@ -9,7 +9,7 @@
         />
 
       <el-select size="small" style="margin-right:10px" v-model="companyNo" @change="requestData">
-        <el-option v-for="depart in departItems" :key="depart.id" :value="depart.value" :label="depart.label" />
+        <el-option v-for="depart in companies" :key="depart.id" :value="depart.value" :label="depart.label" />
       </el-select>
 
       <el-date-picker class="fr picker" v-model="daytime" style=";width:100px" value-format="yyyy" :editable="false"
@@ -67,19 +67,12 @@ export default {
       daytime: "",
       tableData: [],
       companyNo: "",
-      departItems:[
-        { value: "", label: "所有公司"},
-        { value: "GS2302231125079621", label: "北京百辰荣达国际科贸有限公司"},
-        { value: "GS2302231323386950", label: "北京泓源广诚国际商贸有限公司"},
-        // { value: "GS2304031312553746", label: "北京锦兴弘昌科技有限公司"},
-        // { value: "GS2302231124114965", label: "北京普润心堂商贸有限公司"},
-        { value: "GS2203161855277894", label: "北京万宇恒通国际科贸有限公司"},
-        { value: "GS2302231124114965", label:"普润&锦兴&知事" },
-        // {value:'',label:'所有平台'},
-        // {value:'52',label:'百辰荣达'},
-        // {value:'53',label:'普润心堂&锦兴弘昌'},
-        // {value:'56',label:'泓源广诚'},
-        // {value:'57',label:'万宇恒通'}
+      companies:[
+        { value:"",label: "所有公司"},
+        { value:"GS2302231125079621",label: "北京百辰荣达国际科贸有限公司"},
+        { value:"GS2302231323386950",label: "北京泓源广诚国际商贸有限公司"},
+        { value:"GS2203161855277894 ",label: "北京万宇恒通国际科贸有限公司"},
+        { value:"GS2302231124114965",label: "普润&锦兴&知事"}
       ]
     }
   },

+ 52 - 66
src/components/newResults/company.vue

@@ -8,7 +8,7 @@
         inactive-text="元" 
         />
 
-      <el-select size="small" style="margin-right:10px" v-model="companyName" @change="requestData">
+      <el-select size="small" style="margin-right:10px" v-model="companyNo" @change="requestData">
         <el-option label="所有公司" v-for="company in companies" :key="company.value" :value="company.value" :label="company.label" />
       </el-select>
 
@@ -31,13 +31,17 @@
           </template>
         </el-table-column>
 
-        <el-table-column label="当月营业收入(净)" align="center" width="400px">
+        <el-table-column label="当月营业收入(净)" align="center" width="450px">
           <template slot-scope="scope">
             <div style="display:flex;flex-direction: column;">
               <p style="text-align: center;">{{unit2TenThousand(scope.row.msale_total, isTenThound)}}</p>
-              <div>
-                <p>直营/</p>
+              <div class="table-size">
+                <p>直营/自营: {{unit2TenThousand(scope.row.info[0][0].monthinfo.msale_total, isTenThound)}}</p>
+                <p>渠道: {{ unit2TenThousand(scope.row.info[0][1].monthinfo.msale_total,isTenThound)}}</p>
+                <p>供应商端: {{ unit2TenThousand(scope.row.info[0][2].monthinfo.msale_total,isTenThound)}}</p>
               </div>
+            </div>
+
               <!-- <el-table border size="mini" :data="scope.row.info">
                 <el-table-column align="center" label="直营/自营">
                   <template slot-scope="scope">
@@ -56,7 +60,6 @@
                   </template>
                 </el-table-column>
               </el-table> -->
-            </div>
           </template>
         </el-table-column>
 
@@ -85,11 +88,27 @@
             {{unit2TenThousand(scope.row.gross_sale_completion_rate) + "%"}}
           </template>
         </el-table-column>
-        <el-table-column label="当月成本合计" align="center" width="120px">
+
+        <el-table-column label="当月成本合计" align="center" width="450px">
+          <template slot-scope="scope">
+            <div style="display:flex;flex-direction: column;">
+              <p style="text-align: center;"> {{unit2TenThousand(scope.row.mcost_total,isTenThound)}}</p>
+              <div class="table-size">
+                <p>直营/自营: {{unit2TenThousand(scope.row.info[0][0].monthinfo.mcost_total, isTenThound)}}</p>
+                <p>渠道: {{ unit2TenThousand(scope.row.info[0][1].monthinfo.mcost_total,isTenThound)}}</p>
+                <p>供应商端: {{ unit2TenThousand(scope.row.info[0][2].monthinfo.mcost_total,isTenThound)}}</p>
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        
+        <!-- 
+         <el-table-column label="当月成本合计" align="center" width="120px">
           <template slot-scope="scope">
             {{unit2TenThousand(scope.row.mcost_total,isTenThound)}}
           </template>
         </el-table-column>
+
         <el-table-column label="直营/自营成本" align="center" width="120px">
           <template slot-scope="scope">
             {{ unit2TenThousand(scope.row.info[0][0].monthinfo.mcost_total,isTenThound)}}
@@ -104,7 +123,7 @@
           <template slot-scope="scope">
             {{ unit2TenThousand(scope.row.info[0][2].monthinfo.mcost_total,isTenThound)}}
           </template>
-        </el-table-column>
+        </el-table-column> -->
       </el-table>
     </el-row>
   </div>
@@ -121,13 +140,13 @@ export default {
       daytime: "",
       loading: false,
       tableData: [],
-      companyName: "",
+      companyNo: "",
       companies:[
         { value:"",label: "所有公司"},
-        { value:"北京百辰荣达国际科贸有限公司",label: "北京百辰荣达国际科贸有限公司"},
-        { value:"北京泓源广诚国际商贸有限公司",label: "北京泓源广诚国际商贸有限公司"},
-        { value:"北京锦兴弘昌科技有限公司&\n北京普润心堂商贸有限公司&\n北京知事文化产业发展有限公司",label: "普润&锦兴&知事"},
-        { value:"北京万宇恒通国际科贸有限公司",label: "北京万宇恒通国际科贸有限公司"},
+        { value:"GS2302231125079621",label: "北京百辰荣达国际科贸有限公司"},
+        { value:"GS2302231323386950",label: "北京泓源广诚国际商贸有限公司"},
+        { value:"GS2203161855277894 ",label: "北京万宇恒通国际科贸有限公司"},
+        { value:"GS2302231124114965",label: "普润&锦兴&知事"}
       ]
     }
   },
@@ -139,7 +158,7 @@ export default {
     unit2TenThousand,
     setCellClassName({ column }) {
       const { label } = column;
-      return label === "当月营业收入(净)" ? "pure__cell" : "";
+      return label === "当月营业收入(净)" || label === '当月成本合计' ? "pure__cell" : "";
     },
     transformTime() {
       let time = new Date();
@@ -148,60 +167,11 @@ export default {
       let d = time.getDate();
       return y + "-" + (M < 10 ? "0" + M : M) + "-" + (d < 10 ? "0" + d : d);
     },
-    addDataToCompany(c1,c2){
-     return {
-        companyName:'北京锦兴弘昌科技有限公司&\n北京普润心堂商贸有限公司&\n北京知事文化产业发展有限公司',
-        cost_tips:Number(addition(c1.cost_tips,c2.cost_tips)).toFixed(2),
-        total_tips:Number(addition(c1.total_tips,c2.total_tips)).toFixed(2),
-        monthinfo:c1.monthinfo.map((item,index) => ({
-          mcgd_th_total:Number(addition(item.mcgd_th_total,c2.monthinfo[index].mcgd_th_total)).toFixed(2),
-          mcgd_total:Number(addition(item.mcgd_total,c2.monthinfo[index].mcgd_total)).toFixed(2),
-          msale_total:Number(addition(item.msale_total,c2.monthinfo[index].msale_total)).toFixed(2),
-          mth_total:Number(addition(item.mth_total,c2.monthinfo[index].mth_total)).toFixed(2),
-          type:item.type
-        })),
-        dayinfo:c1.monthinfo.map((item,index) => ({
-          cgd_th_total:Number(addition(item.cgd_th_total,c2.monthinfo[index].cgd_th_total)).toFixed(2),
-          cgd_total:Number(addition(item.cgd_total,c2.monthinfo[index].cgd_total)).toFixed(2),
-          sale_total:Number(addition(item.sale_total,c2.monthinfo[index].sale_total)).toFixed(2),
-          th_total:Number(addition(item.th_total,c2.monthinfo[index].th_total)).toFixed(2),
-          type:item.type
-        })),
-      }
-    },
     async requestData() {
       this.loading = true;
       this.tableData = [];
 
-      const res = await asyncRequest.companyEveryMonth({ daytime: this.daytime });
-      // 锦兴下标
-      const jx_index = res.data.findIndex(({companyName}) => companyName === "北京锦兴弘昌科技有限公司");
-      // 普润下标
-      const pr_index = res.data.findIndex(({companyName}) => companyName === "北京普润心堂商贸有限公司");
-      // 知事下标
-      const zs_index = res.data.findIndex(({companyName}) => companyName === "北京知事文化产业发展有限公司");
-
-
-      if(pr_index >= 0 && jx_index >= 0){
-        const pr_item = res.data.splice(pr_index, 1);
-        res.data[jx_index] = this.addDataToCompany(res.data[jx_index],pr_item[0])
-      }
-
-      if(zs_index >= 0 && jx_index >= 0){
-        const zs_item = res.data.splice(zs_index, 1);
-        res.data[jx_index] = this.addDataToCompany(res.data[jx_index],zs_item[0])
-      }
-
-
-      if(this.companyNo && companyNo === "1"){
-          res.data = res.data.filter(({companyName}) => companyName === "北京百辰荣达国际科贸有限公司")
-      }
-
-
-      if(this.companyName){
-          res.data = res.data.filter(({companyName}) => companyName === this.companyName)
-      }
-
+      const res = await asyncRequest.companyEveryMonth({ daytime: this.daytime , companyNo: this.companyNo});
 
       // const isBeforeDate = this.getDiffDay() < 0 && this.companyNo === "GS2302231323386950"
 
@@ -274,7 +244,7 @@ export default {
           this.tableData = [
             ...this.tableData,
             { 
-              companyName,  // 公司名称
+              companyName:companyName.indexOf('普润') !== -1 ? "普润&锦兴&知事" : companyName,  // 公司名称
               cost_tips, // 当月成本指标
               total_tips, // 当月营收目标
               info: [{...item}], // 直营.. 渠道 销售
@@ -284,9 +254,9 @@ export default {
               mcost_total: prev_mcost_total,// 当月成本总额
               gross_completion, //当月毛利完成 = 月营收 - 月成本
 
-              completion_rate:multiplication(division(prev_msale_total,total_tips), 100).toFixed(2), // 当月应收完成率
+              completion_rate: multiplication(division(prev_msale_total,total_tips), 100).toFixed(2), // 当月应收完成率
               gross_completion_rate: Number(cost_tips) === 0 ? 0 : multiplication(division(gross_completion,cost_tips) || 0, 100).toFixed(2), // 当月毛利完成率
-              gross_sale_completion_rate:Number(multiplication(division(gross_completion,prev_msale_total) || 0, 100)).toFixed(2), // 本月毛利率 =  当月毛利完成 / 当月营业收入
+              gross_sale_completion_rate: Number(multiplication(division(gross_completion,prev_msale_total) || 0, 100)).toFixed(2), // 本月毛利率 =  当月毛利完成 / 当月营业收入
             }
           ]
         })
@@ -309,6 +279,22 @@ export default {
     padding: 0px 10px;
     margin-top: 10px
   }
+
+  .table-size{
+    display: flex;
+    border-top: 1px solid #ebeef5;
+
+    p {
+      flex:1;
+      border-right: 1px solid #ebeef5;
+      padding: 5px 10px;
+      margin: 0px;
+
+      &:last-child {
+        border: none;
+      }
+    }
+  }
 }
 </style>
 

+ 19 - 30
src/components/newResults/department.vue

@@ -8,9 +8,9 @@
         inactive-text="元" 
         />
 
-      <el-select size="small" style="margin-right:10px" v-model="depart_id" @change="requestData">
+      <el-select size="small" style="margin-right:10px" v-model="companyNo" @change="requestData">
         <el-option 
-          v-for="depart in departItems" 
+          v-for="depart in companies" 
           :key="depart.value" 
           :label="depart.label" 
           :value="depart.value" 
@@ -106,18 +106,22 @@ export default {
     return {
       list: [],
       daytime: "",
-      depart_id: "",
+      companyNo: "GS2203161855277894",
       loading: false,
       isTenThound: true,
-      departItems:[
-        { value: '', label: '所有平台' },
-        { value: '52', label: '百辰荣达' },
-        { value: '53', label: '普润心堂&锦兴弘昌' },
-        { value: '56', label: '泓源广诚' },
-        { value: '57', label: '万宇恒通' }
+      companies:[
+        { value:"GS2302231125079621",label: "北京百辰荣达国际科贸有限公司"},
+        { value:"GS2302231323386950",label: "北京泓源广诚国际商贸有限公司"},
+        { value:"GS2203161855277894",label: "北京万宇恒通国际科贸有限公司"},
+        { value:"GS2302231124114965",label: "普润&锦兴&知事"}
       ]
     }
   },
+  computed:{
+    currentCompanyName(){
+      return this.companies.find(item => item.value === this.companyNo).label;
+    }
+  },
   mounted() {
     this.daytime = this.transformTime();
     this.requestData();
@@ -169,7 +173,7 @@ export default {
       this.loading = true;
       this.list = [];
 
-      const res = await asyncRequest.departmentEveryDay({ daytime: this.daytime });
+      const res = await asyncRequest.departmentEveryDay({ daytime: this.daytime, companyNo: this.companyNo });
 
       if (res.code === 0 && res.data && res.data.length > 0) {
         let list = (res.data || [])
@@ -189,29 +193,14 @@ export default {
 
 
         let mapDepart = ["百辰","泓源","普润","平台"]
-        if(this.depart_id === "52"){
-          list = list.filter(({ depart }) => depart === "百辰")
-          mapDepart = mapDepart.filter(depart  => depart === "百辰")
-        }
-
-        if(this.depart_id === "53"){
-          list = list.filter(({ depart }) => depart === "普润")
-          mapDepart = mapDepart.filter(depart  => depart === "普润")
-        }
 
-        if(this.depart_id === "56"){
-          list = list.filter(({ depart }) => depart === "泓源")
-          mapDepart = mapDepart.filter(depart  => depart === "泓源")
-        }
 
-        if(this.depart_id === "57"){
-          list = list.filter(({ depart }) => depart === "平台")
-          mapDepart = mapDepart.filter(depart  => depart === "平台")
-        }
+        list = mapDepart.map(d => list.find(({ depart }) => depart === d))
+        const mapToDepartment = { 百辰:"客服部@百辰荣达", 泓源:"网络部@泓源广诚", 普润:"	项目部@普润心堂", 平台:"	平台部@万宇恒通" }
 
+        const company = this.companies.find(item => item.value === this.companyNo);
 
-        list = mapDepart.map(d => list.find(({ depart }) => depart === d))
-        const mapToDepartment = { 百辰:"百辰荣达", 泓源:"泓源广诚", 普润:"普润心堂&锦兴弘昌", 平台:"万宇恒通" }
+        console.log(this.companies,'===',this.companyNo)
         this.list = list.map(({depart,total_tips,dayinfo,monthinfo,mchannel_sale_total,mzy_sale_total,zy_cost_total,channel_cost_total}) => {
           /* 月净销售 = 月销售 - 月退货 **/
           const monthNetSales = subtraction(monthinfo.msale_total, monthinfo.mth_total)
@@ -222,7 +211,7 @@ export default {
             zy_cost: zy_cost_total, // 自营成本
             qd_cost: channel_cost_total, // 渠道成本
             depart: mapToDepartment[depart],
-            company: "北京万宇恒通国际科贸有限公司",
+            company: company.label,
             currentMonthPure:[ { zy : mzy_sale_total, qd: mchannel_sale_total } ], // 当月营业收入(净)
             zy_gross:Number(subtraction(mzy_sale_total,zy_cost_total)).toFixed(2), // 自营毛利  = 自营营收 - 自营成本
             qd_gross:Number(subtraction(mchannel_sale_total,channel_cost_total)).toFixed(2), // 渠道毛利 = 渠道营收 - 渠道成本

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels