|
@@ -27,8 +27,8 @@
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="订单状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<v-select
|
|
|
- v-model="queryParam.orderStatus"
|
|
|
- ref="orderStatus"
|
|
|
+ v-model="queryParam.orderState"
|
|
|
+ ref="orderState"
|
|
|
id="shopOrder-status"
|
|
|
code="SETTLE_STATUS_ALL"
|
|
|
placeholder="请选择订单状态"
|
|
@@ -53,13 +53,9 @@
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
bordered>
|
|
|
- <!-- 订单状态 -->
|
|
|
- <template slot="orderStatus" slot-scope="text, record">
|
|
|
- <span>{{ record.orderStatus==1 ? '已启用' : '已禁用' }}</span>
|
|
|
- </template>
|
|
|
<!-- 订单总额 -->
|
|
|
- <template slot="orderPrice" slot-scope="text, record">
|
|
|
- <span>{{ record.orderPrice || 0 }}乐豆</span>
|
|
|
+ <template slot="originalGold" slot-scope="text, record">
|
|
|
+ <span>{{ record.originalGold || 0 }}乐豆</span>
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -74,6 +70,7 @@
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
import moment from 'moment'
|
|
|
+import { orderList } from '@/api/order'
|
|
|
export default {
|
|
|
name: 'ShopOrder',
|
|
|
components: { STable, VSelect },
|
|
@@ -89,42 +86,39 @@ export default {
|
|
|
endDate: null, // 结束时间
|
|
|
contactPhone: '', // 用户手机
|
|
|
orderNo: '', // 订单编号
|
|
|
- orderStatus: null // 订单状态
|
|
|
+ orderState: null // 订单状态
|
|
|
},
|
|
|
loading: false, // 导出loading
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '下单时间', dataIndex: 'orderDate', width: 200, align: 'center' },
|
|
|
+ { title: '下单时间', dataIndex: 'orderTime', width: 200, align: 'center' },
|
|
|
{ title: '用户手机', dataIndex: 'userMoblie', width: 200, align: 'center' },
|
|
|
{ title: '订单编号', dataIndex: 'orderNo', width: 200, align: 'center' },
|
|
|
- { title: '订单状态', scopedSlots: { customRender: 'orderStatus' }, width: 200, align: 'center' },
|
|
|
- { title: '订单总额', scopedSlots: { customRender: 'orderPrice' }, width: 200, align: 'center' },
|
|
|
+ { title: '订单状态', dataIndex: 'orderStateDictValue', width: 200, align: 'center' },
|
|
|
+ { title: '订单总额', scopedSlots: { customRender: 'originalGold' }, width: 200, align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
- // return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // const no = (res.data.pageNo - 1) * res.data.pageSize
|
|
|
- // for (let i = 0; i < res.data.list.length; i++) {
|
|
|
- // const _item = res.data.list[i]
|
|
|
- // _item.no = no + i + 1
|
|
|
- // _item.status = _item.status + '' === '1'
|
|
|
- // }
|
|
|
- // return res.data
|
|
|
- // }
|
|
|
- // })
|
|
|
- return new Promise((resolve) => {
|
|
|
- const data = [
|
|
|
- { no: 1, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
|
|
|
- { no: 2, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' },
|
|
|
- { no: 3, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
|
|
|
- { no: 4, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
|
|
|
- { no: 5, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' },
|
|
|
- { no: 6, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' }
|
|
|
- ]
|
|
|
- resolve(data)
|
|
|
+ const searchData = Object.assign(parameter, this.queryParam)
|
|
|
+ if (this.time && this.time.length) {
|
|
|
+ searchData.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
|
|
|
+ searchData.endDate = moment(this.time[1]).format('YYYY-MM-DD')
|
|
|
+ } else {
|
|
|
+ searchData.beginDate = ''
|
|
|
+ searchData.endDate = ''
|
|
|
+ }
|
|
|
+ return orderList(searchData).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ const no = (res.data.pageNo - 1) * res.data.pageSize
|
|
|
+ for (let i = 0; i < res.data.list.length; i++) {
|
|
|
+ const _item = res.data.list[i]
|
|
|
+ _item.no = no + i + 1
|
|
|
+ _item.status = _item.status + '' === '1'
|
|
|
+ }
|
|
|
+ return res.data
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
// 将默认当天时间日期回显在时间选择框中
|
|
@@ -135,11 +129,6 @@ export default {
|
|
|
dateFormat: 'YYYY-MM-DD'
|
|
|
}
|
|
|
},
|
|
|
- beforeRouteEnter (to, from, next) {
|
|
|
- next(vm => {
|
|
|
- vm.handleReset()
|
|
|
- })
|
|
|
- },
|
|
|
methods: {
|
|
|
moment,
|
|
|
// 不可选日期
|
|
@@ -167,7 +156,7 @@ export default {
|
|
|
]
|
|
|
this.queryParam.contactPhone = ''
|
|
|
this.queryParam.orderNo = ''
|
|
|
- this.queryParam.orderStatus = null
|
|
|
+ this.queryParam.orderState = null
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 导出
|
|
@@ -177,7 +166,7 @@ export default {
|
|
|
endDate: this.queryParam.endDate == null ? getDate.getToday().endtime : this.queryParam.endDate,
|
|
|
contactPhone: this.queryParam.contactPhone,
|
|
|
orderNo: this.queryParam.orderNo,
|
|
|
- orderStatus: this.queryParam.orderStatus
|
|
|
+ orderState: this.queryParam.orderState
|
|
|
}
|
|
|
if (!params.beginDate && !params.endDate) {
|
|
|
this.$message.error('请先选择需要导出的下单时间区间再进行导出!')
|
|
@@ -187,7 +176,7 @@ export default {
|
|
|
if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
|
|
|
this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
}
|
|
|
- // this.loading = true
|
|
|
+ this.loading = true
|
|
|
// exportBundle(params).then(res => {
|
|
|
// this.loading = false
|
|
|
// this.download(res)
|