|
@@ -1,123 +1,91 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
<el-table
|
|
<el-table
|
|
|
- :key="tableKey"
|
|
|
|
|
v-loading="listLoading"
|
|
v-loading="listLoading"
|
|
|
- :data="list"
|
|
|
|
|
- border
|
|
|
|
|
- fit
|
|
|
|
|
- highlight-current-row
|
|
|
|
|
- style="width: 100%;"
|
|
|
|
|
- :span-method="objectSpanMethod"
|
|
|
|
|
|
|
+ fit
|
|
|
|
|
+ lazy
|
|
|
|
|
+ highlight-current-row
|
|
|
|
|
+ :data="tableData"
|
|
|
>
|
|
>
|
|
|
- <el-table-column width="130px" align="center" :label="$t('shop.productCode')" prop="SKU_CODE">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.SKU_CODE }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="250px" align="center" :label="$t('shop.productName')" prop="GOODS_TITLE">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span style="height: auto; display:-webkit-box; overflow: hidden; text-overflow: ellipsis; -webkit-box-orient:vertical; -webkit-line-clamp:1;">
|
|
|
|
|
- {{ row.GOODS_TITLE }}
|
|
|
|
|
- </span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="130px" align="center" :label="$t('shop.orderType')" prop="ORDER_TYPE">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.ORDER_TYPE }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="120px" align="center" :label="$t('shop.productBV')" prop="REAL_PV">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row | bvFilter }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="120px" align="center" :label="$t('shop.productPrice')" prop="REAL_PRICE">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.REAL_PRICE }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="80px" align="center" :label="$t('shop.qty')" prop="BUY_NUMS">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.BUY_NUMS }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="120px" align="center" :label="$t('shop.totalPrice')" prop="TOTAL_AMOUNT">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.TOTAL_AMOUNT }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="80px" align="center" :label="$t('shop.taxRate')" prop="TAX_RATE">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.TAX_RATE / 100 }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="120px" align="center" :label="$t('shop.taxAmount')" prop="TAX_AMOUNT">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.TAX_AMOUNT }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="200px" align="center" :label="$t('shop.orderCode')" prop="SN">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.SN }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="230px" align="center" :label="$t('shop.memberCode')" prop="USER_NAME">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.USER_NAME }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="230px" align="center" :label="$t('shop.memberName')" prop="REAL_NAME">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.REAL_NAME }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="130px" align="center" :label="$t('shop.recipientName')" prop="CONSIGNEE">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.CONSIGNEE }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="130px" align="center" :label="$t('shop.phoneNumber')" prop="MOBILE">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.MOBILE }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="150px" align="center" :label="$t('shop.shippingAddress')" prop="FULL_ADDRESS">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.FULL_ADDRESS }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="130px" align="center" :label="$t('shop.payment')" prop="PAY_TYPE">
|
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
- <span>{{ row.PAY_TYPE }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column width="150px" align="center" :label="$t('shop.createdTime')" prop="CREATED_AT">
|
|
|
|
|
|
|
+ <el-table-column type="expand">
|
|
|
|
|
+ <template slot-scope="props">
|
|
|
|
|
+ <el-col :xs="24" :sm="24" :lg="24">
|
|
|
|
|
+ <el-card class="box-card" shadow="hover">
|
|
|
|
|
+ <el-table v-loading="listLoading" fit lazy highlight-current-row :data="props.row.hasChildren">
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.productCode')" prop="SKU_CODE"></el-table-column >
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.productName')" prop="GOODS_TITLE"></el-table-column >
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.qty')" prop="BUY_NUMS"></el-table-column >
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.productPrice')">
|
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
|
+ {{ $t('currency.sign') }} {{ row.REAL_PRICE | amountFilter }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column >
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.totalPrice')">
|
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
|
+ {{ $t('currency.sign') }} {{ row | priceAmountFilter | amountFilter }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column >
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.totalBV')">
|
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
|
+ {{ row | bvFilter | amountFilter }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column >
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.taxRate')">
|
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
|
+ {{ row.TAX_RATE / 100 }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column >
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.taxAmount')">
|
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
|
+ {{ $t('currency.sign') }} {{ row | taxAmountFilter | amountFilter }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column >
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.orderCode')" prop="SN" min-width="120px" style="white-space: pre-wrap;">
|
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
|
+ <span style="white-space: pre-wrap; display: inline-block; min-width: 120px; word-break: break-all;">{{ row.SN }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.memberCode')" prop="USER_NAME" min-width="150px"></el-table-column>
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.memberName')" prop="REAL_NAME" min-width="150px"></el-table-column>
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.recipientName')" prop="CONSIGNEE" min-width="140px"></el-table-column>
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.phoneNumber')" prop="MOBILE" min-width="130px"></el-table-column>
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.shippingAddress')" prop="FULL_ADDRESS" min-width="140px">
|
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
|
+ <span>{{ row.FULL_ADDRESS }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.payment')" prop="PAY_TYPE" min-width="100px"></el-table-column>
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.createdTime')" prop="CREATED_AT" min-width="110px">
|
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ row.CREATED_AT | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
|
<span>{{ row.CREATED_AT | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column width="150px" align="center" :label="$t('shop.payTime')" prop="PAY_AT">
|
|
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.payTime')" prop="PAY_AT" min-width="110px">
|
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ row.PAY_AT | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
|
<span>{{ row.PAY_AT | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column class-name="status-col" align="center" width="100" :label="$t('shop.payStatus')" prop="STATUS">
|
|
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.payStatus')" prop="STATUS" min-width="110px">
|
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
|
<el-tag :type="row.STATUS | statusFilter">
|
|
<el-tag :type="row.STATUS | statusFilter">
|
|
|
{{ row.STATUS }}
|
|
{{ row.STATUS }}
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
-
|
|
|
|
|
- <el-table-column width="100px" align="center" :label="$t('shop.action')" class-name="small-padding fixed-width">
|
|
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.orderType')" prop="ORDER_TYPE" min-width="110px"></el-table-column>
|
|
|
|
|
+ <el-table-column align="center" :label="$t('shop.action')" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
|
- <el-button type="primary" size="mini" @click="handleDownload(row.SN)">{{ $t('shop.download') }}</el-button>
|
|
|
|
|
|
|
+ <el-button type="text" size="mini" @click="handleDownload(row.SN)">{{ $t('shop.download') }}</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
|
|
|
|
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -126,6 +94,7 @@ import {downloadOrder, fetchOrderList} from '@/api/shop'
|
|
|
import waves from '@/directive/waves'
|
|
import waves from '@/directive/waves'
|
|
|
import tool from '@/utils/tool'
|
|
import tool from '@/utils/tool'
|
|
|
import Pagination from '@/components/Pagination'
|
|
import Pagination from '@/components/Pagination'
|
|
|
|
|
+import {formatAmount, getScreenWidth} from "@/utils"
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'orderList',
|
|
name: 'orderList',
|
|
@@ -136,8 +105,14 @@ export default {
|
|
|
return tool.calculateBV(row.REAL_PV, row.BUY_NUMS)
|
|
return tool.calculateBV(row.REAL_PV, row.BUY_NUMS)
|
|
|
},
|
|
},
|
|
|
taxAmountFilter(row) {
|
|
taxAmountFilter(row) {
|
|
|
- return tool.calculateTax(row.REAL_PV, row.BUY_NUMS)
|
|
|
|
|
|
|
+ return tool.calculateTax(row.REAL_PRICE, row.BUY_NUMS)
|
|
|
},
|
|
},
|
|
|
|
|
+ priceAmountFilter(row) {
|
|
|
|
|
+ return tool.formatPrice(row.REAL_PRICE, row.BUY_NUMS)
|
|
|
|
|
+ },
|
|
|
|
|
+ amountFilter(amount) {
|
|
|
|
|
+ return formatAmount(amount)
|
|
|
|
|
+ },
|
|
|
statusFilter(status) {
|
|
statusFilter(status) {
|
|
|
const statusMap = {
|
|
const statusMap = {
|
|
|
Unpaid: 'info',
|
|
Unpaid: 'info',
|
|
@@ -149,38 +124,32 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
tableKey: 0,
|
|
tableKey: 0,
|
|
|
- list: null,
|
|
|
|
|
- tableData: null,
|
|
|
|
|
- total: 0,
|
|
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+ tableData: [],
|
|
|
listLoading: true,
|
|
listLoading: true,
|
|
|
downloadLoading: false,
|
|
downloadLoading: false,
|
|
|
listQuery: {
|
|
listQuery: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
pageSize: 20
|
|
pageSize: 20
|
|
|
},
|
|
},
|
|
|
- spanArr: [],
|
|
|
|
|
- pos: 0
|
|
|
|
|
|
|
+ childrenNode: [],
|
|
|
|
|
+ screenWidth: getScreenWidth() > 600 ? '500px' : getScreenWidth() + 'px',
|
|
|
|
|
+ labelPosition: getScreenWidth() > 600 ? 'right' : 'top',
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- // 列表查询
|
|
|
|
|
this.getList()
|
|
this.getList()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getList() {
|
|
getList() {
|
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
|
fetchOrderList(this.listQuery).then(response => {
|
|
fetchOrderList(this.listQuery).then(response => {
|
|
|
- this.list = response.data.list
|
|
|
|
|
- this.total = response.data.totalCount
|
|
|
|
|
- const settingObj = this.list
|
|
|
|
|
- this.tableData = Object.keys(this.list).map(key => {
|
|
|
|
|
- return settingObj[key]
|
|
|
|
|
- })
|
|
|
|
|
- this.getSpanArr(this.tableData)
|
|
|
|
|
|
|
+ this.tableData = response.data.list
|
|
|
|
|
+ this.total = +response.data.totalCount
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.listLoading = false
|
|
this.listLoading = false
|
|
|
- }, 1.5 * 1000)
|
|
|
|
|
|
|
+ }, 0.5 * 1000)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
handleDownload(orderSn) {
|
|
handleDownload(orderSn) {
|
|
@@ -196,49 +165,18 @@ export default {
|
|
|
|
|
|
|
|
this.downloadLoading = false
|
|
this.downloadLoading = false
|
|
|
},
|
|
},
|
|
|
- objectSpanMethod(obj) {
|
|
|
|
|
- if (obj.columnIndex > 8) {
|
|
|
|
|
- const _row = this.spanArr[obj.rowIndex]
|
|
|
|
|
- const _col = _row > 0 ? 1 : 0
|
|
|
|
|
- return {
|
|
|
|
|
- rowspan: _row,
|
|
|
|
|
- colspan: _col
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- getSpanArr(orderList) {
|
|
|
|
|
- this.pos = 0
|
|
|
|
|
- orderList.forEach((item, index) => {
|
|
|
|
|
- // 判断是否是第⼀项
|
|
|
|
|
- if (index === 0) {
|
|
|
|
|
- this.spanArr.push(1)
|
|
|
|
|
- this.pos = 0
|
|
|
|
|
- } else {
|
|
|
|
|
- // 不是第⼀项时,就根据标识去存储
|
|
|
|
|
- if (
|
|
|
|
|
- orderList[index].ORDER_SN === orderList[index - 1].ORDER_SN &&
|
|
|
|
|
- orderList[index].USER_NAME === orderList[index - 1].USER_NAME &&
|
|
|
|
|
- orderList[index].REAL_NAME === orderList[index - 1].REAL_NAME &&
|
|
|
|
|
- orderList[index].CONSIGNEE === orderList[index - 1].CONSIGNEE &&
|
|
|
|
|
- orderList[index].MOBILE === orderList[index - 1].MOBILE &&
|
|
|
|
|
- orderList[index].PAY_AT === orderList[index - 1].PAY_AT &&
|
|
|
|
|
- orderList[index].STATUS === orderList[index - 1].STATUS &&
|
|
|
|
|
- orderList[index].PAY_TYPE === orderList[index - 1].PAY_TYPE &&
|
|
|
|
|
- orderList[index].CREATED_AT === orderList[index - 1].CREATED_AT
|
|
|
|
|
- ) {
|
|
|
|
|
- // 查找到符合条件的数据时每次要把之前存储的数据+1
|
|
|
|
|
- this.spanArr[this.pos] += 1
|
|
|
|
|
- this.spanArr.push(0)
|
|
|
|
|
- } else {
|
|
|
|
|
- // 没有符合的数据时,要记住当前的index
|
|
|
|
|
- this.spanArr.push(1)
|
|
|
|
|
- this.pos = index
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+
|
|
|
|
|
+<style>
|
|
|
|
|
+.el-table th.el-table__cell > .cell {
|
|
|
|
|
+ /*word-break: keep-all;*/
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.el-table td.el-table__cell > .cell {
|
|
|
|
|
+ word-break: keep-all;
|
|
|
|
|
+ white-space: pre-wrap;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|