|
@@ -5,7 +5,7 @@
|
|
|
|
|
|
<el-table-column label="订单状态" width="110px">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ getStatus(scope.row) }}
|
|
|
+ {{ scope.row.result.status }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="下单月份" align="center" v-if="months">
|
|
@@ -14,40 +14,6 @@
|
|
|
{{getField(month, scope.row, scope.row.name === '无地址订单总金额')}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column label="02">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{getField('2',scope.row)}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="03">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{getField('3',scope.row)}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="04">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{getField('4',scope.row)}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="05">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{getField('5',scope.row)}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="06">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{getField('6',scope.row)}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="07">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{getField('7',scope.row)}}
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
</el-table-column>
|
|
|
<el-table-column label="总计" width="110px">
|
|
|
<template slot-scope="scope">
|
|
@@ -59,6 +25,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import asyncRequest from "@/api/newReport";
|
|
|
+import setHeight from "@/mixins/index";
|
|
|
+import { addition, division } from "./_utils";
|
|
|
|
|
|
function unit2TenThousand(value){
|
|
|
if(value === NaN || value === "NaN" || Number(value) === 0) return '0'
|
|
@@ -66,10 +35,6 @@ function unit2TenThousand(value){
|
|
|
return division(value, 10000).toFixed(2) + 'W'
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-import asyncRequest from "@/api/newReport";
|
|
|
-import setHeight from "@/mixins/index";
|
|
|
-import { addition } from "./_utils";
|
|
|
export default {
|
|
|
name: "Consult",
|
|
|
mixins: [setHeight],
|
|
@@ -173,11 +138,13 @@ export default {
|
|
|
},
|
|
|
getField(month,row,isTotalPrice){
|
|
|
if(Array.isArray(row.result[month])) return 0
|
|
|
- // const {total_price, num} = (row.result[month]['1'] || {})
|
|
|
- // console.log(total_price)
|
|
|
+ if(month === 'status') {
|
|
|
+ return 0
|
|
|
+ }
|
|
|
|
|
|
if(isTotalPrice){
|
|
|
const { total_price } = row.result[month]
|
|
|
+ console.log(total_price,month)
|
|
|
return Number(total_price) === 0 ? "0元" : unit2TenThousand(total_price) + "万元"
|
|
|
}
|
|
|
|
|
@@ -203,6 +170,7 @@ export default {
|
|
|
tableData.push({name,
|
|
|
result: Object.keys(result).reduce((prev,month) => ({
|
|
|
...prev,
|
|
|
+ status: i === 0 ? '待发货' : '待发货完成',
|
|
|
[month]: {
|
|
|
'1':Array.isArray(result[month])
|
|
|
? { num : 0 ,send_status : null}
|
|
@@ -215,18 +183,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- console.log(tableData)
|
|
|
-
|
|
|
-
|
|
|
this.tableData = tableData
|
|
|
- this.months = Object.keys(this.tableData[0].result)
|
|
|
+ this.months = Object.keys(this.tableData[0].result).filter(month => month !== 'status')
|
|
|
const totalItemDefault = this.months.reduce((prev,month) => ({
|
|
|
...prev,
|
|
|
[month]:{ 1:{ num:0 }}
|
|
|
}), {})
|
|
|
|
|
|
-
|
|
|
- this.tableData.push({
|
|
|
+ const totalItem = {
|
|
|
name:'合计',
|
|
|
result: this.tableData.reduce((prev,current) => {
|
|
|
const { result} = current;
|
|
@@ -238,9 +202,14 @@ export default {
|
|
|
}
|
|
|
}, {})
|
|
|
},{...totalItemDefault})
|
|
|
- })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ totalItem.result.status = "--"
|
|
|
+ this.tableData.push(totalItem)
|
|
|
|
|
|
noAddr.name = "无地址订单总金额"
|
|
|
+ noAddr.result.status = "--"
|
|
|
this.tableData.push(noAddr)
|
|
|
} else {
|
|
|
this.tableData = [];
|