snow 1 년 전
부모
커밋
c7373152bd
5개의 변경된 파일34개의 추가작업 그리고 6개의 파일을 삭제
  1. 0 0
      dist/index.html
  2. 0 0
      dist/static/js/app.036597ee.js
  3. BIN
      dist/static/js/app.036597ee.js.gz
  4. BIN
      dist/static/js/app.695abb41.js.gz
  5. 34 6
      src/components/newReport/src/notDeliverGood.vue

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/index.html


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/js/app.036597ee.js


BIN
dist/static/js/app.036597ee.js.gz


BIN
dist/static/js/app.695abb41.js.gz


+ 34 - 6
src/components/newReport/src/notDeliverGood.vue

@@ -9,7 +9,7 @@
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="下单月份" align="center" v-if="months">
       <el-table-column label="下单月份" align="center" v-if="months">
-        <el-table-column :label="'0' + month" v-for="month in months" :key="month" min-width="100px">
+        <el-table-column :label="month.length > 1 ? month : '0' + month" v-for="month in months" :key="month" min-width="100px">
           <template slot-scope="scope">
           <template slot-scope="scope">
               {{getField(month, scope.row, scope.row.name === '无地址订单总金额')}}
               {{getField(month, scope.row, scope.row.name === '无地址订单总金额')}}
           </template>
           </template>
@@ -50,7 +50,7 @@ export default {
   data() {
   data() {
     return {
     return {
       tableData:[],
       tableData:[],
-      months: [],
+      months: ['1','2','3','4','5','6','7','8','9','10','11','12'],
       loading:false,
       loading:false,
       statusOptions: [
       statusOptions: [
         { id: "0", label: "待发货" },
         { id: "0", label: "待发货" },
@@ -125,7 +125,7 @@ export default {
     getTotal(row, isTotalPrice){
     getTotal(row, isTotalPrice){
       if(isTotalPrice){
       if(isTotalPrice){
         const total =  this.months.reduce((prev, month) => {
         const total =  this.months.reduce((prev, month) => {
-          return addition(prev, row.result[month]['total_price'] || 0)
+          return addition(prev, row.result[month] ? row.result[month]['total_price'] : 0)
         },0)
         },0)
         return Number(total) === 0 ? "0元" : unit2TenThousand(total) + "元"
         return Number(total) === 0 ? "0元" : unit2TenThousand(total) + "元"
       }
       }
@@ -143,7 +143,7 @@ export default {
 
 
       if(isTotalPrice){
       if(isTotalPrice){
         const { total_price } =  row.result[month]
         const { total_price } =  row.result[month]
-        console.log(total_price,month)
+
         return Number(total_price) === 0 ? "0元" : unit2TenThousand(total_price) + "元"
         return Number(total_price) === 0 ? "0元" : unit2TenThousand(total_price) + "元"
       }
       }
 
 
@@ -182,8 +182,23 @@ export default {
           }
           }
         }
         }
 
 
-        this.tableData = tableData
-        this.months = Object.keys(this.tableData[0].result).filter(month => month !== 'status')
+        this.tableData = tableData.reduce((prev,current) => {
+            return [...prev, {
+              name: current.name,
+              result: this.months.reduce((pre,month) => {
+               return {
+                ...pre,
+                [month]:{
+                  '1': current.result[month] && current.result[month]['1'] ? current.result[month]['1'] : {num: 0 ,send_status : null},
+                  '2': current.result[month] && current.result[month]['2'] ? current.result[month]['2'] : {num: 0, send_status : null },
+                }
+              }
+              },{})
+            }]
+        },[])
+
+        console.log(this.tableData)
+
         const totalItemDefault = this.months.reduce((prev,month) => ({
         const totalItemDefault = this.months.reduce((prev,month) => ({
           ...prev,
           ...prev,
           [month]:{ 1:{ num:0 }}
           [month]:{ 1:{ num:0 }}
@@ -208,7 +223,20 @@ export default {
         this.tableData.push(totalItem)
         this.tableData.push(totalItem)
 
 
         noAddr.name = "无地址订单总金额"
         noAddr.name = "无地址订单总金额"
+        
+        noAddr.result = this.months.reduce((prev,month) => ({
+          ...prev,
+          [month]:{
+            total_price:noAddr.result[month] && noAddr.result[month].total_price 
+            ? noAddr.result[month].total_price 
+            : 0 
+          }
+        }),{})
+
+
         noAddr.result.status = "--"
         noAddr.result.status = "--"
+
+        console.log(noAddr)
         this.tableData.push(noAddr)
         this.tableData.push(noAddr)
       } else {
       } else {
         this.tableData = [];
         this.tableData = [];

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.