会员订单

master
fanfan 8 months ago
parent 03320e0b99
commit 60de5e9f81
  1. 9
      src/components/Modal/GoodsModal/GoodsModal.vue
  2. 12
      src/config/router.config.js
  3. 242
      src/views/user/order/Index.vue

@ -120,16 +120,17 @@ export default {
// //
searchForm: this.$form.createForm(this), searchForm: this.$form.createForm(this),
// //
queryParam: { queryParam: {},
channel: 'zy', queryNew:{
channel: 'zy',
status: 10, status: 10,
}, },
// table // table
columns, columns,
// Promise // Promise
loadData: (param) => { loadData: (param) => {
this.queryParam = this.source == 1 ? this.queryParam : {} this.queryNew = this.source == 1 ? this.queryNew : {}
return GoodsApi.list({ ...param, ...this.queryParam }).then((response) => { return GoodsApi.list({ ...param, ...this.queryParam,...this.queryNew }).then((response) => {
return response.data.list return response.data.list
}) })
}, },

@ -515,12 +515,12 @@ export const asyncRouterMap = [
meta: { title: '会员价格', keepAlive: false, permission: ['/user/identity/index'] }, meta: { title: '会员价格', keepAlive: false, permission: ['/user/identity/index'] },
moduleKey: 'user-grade', moduleKey: 'user-grade',
}, },
// { {
// path: '/user/order/Index', path: '/user/order/Index',
// component: () => import(/* webpackChunkName: "user" */ '@/views/user/order/Index'), component: () => import(/* webpackChunkName: "user" */ '@/views/user/order/Index'),
// meta: { title: '会员订单', keepAlive: false, permission: ['/user/order/Index'] }, meta: { title: '会员订单', keepAlive: false, permission: ['/user/order/Index'] },
// moduleKey: 'user-grade', moduleKey: 'user-grade',
// }, },
{ {
path: '/user/balance', path: '/user/balance',
component: RouteView, component: RouteView,

@ -8,12 +8,6 @@
<a-form-item label="会员订单号"> <a-form-item label="会员订单号">
<a-input v-decorator="['search']" placeholder="请输入会员订单号" /> <a-input v-decorator="['search']" placeholder="请输入会员订单号" />
</a-form-item> </a-form-item>
<a-form-item label="充值方式">
<a-select v-decorator="['recharge_type', { initialValue: 0 }]">
<a-select-option :value="0">全部</a-select-option>
<a-select-option v-for="(item, index) in RechargeTypeEnum.data" :key="index" :value="item.value">{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="支付状态"> <a-form-item label="支付状态">
<a-select v-decorator="['pay_status', { initialValue: 0 }]"> <a-select v-decorator="['pay_status', { initialValue: 0 }]">
<a-select-option :value="0">全部</a-select-option> <a-select-option :value="0">全部</a-select-option>
@ -21,8 +15,22 @@
<a-select-option :value="20">已支付</a-select-option> <a-select-option :value="20">已支付</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="订单类型">
<a-select v-decorator="['order_type', { initialValue: 0 }]">
<a-select-option :value="0">全部</a-select-option>
<a-select-option :value="10">会员</a-select-option>
<a-select-option :value="20">分销商 </a-select-option>
</a-select>
</a-form-item>
<a-form-item label="支付方式">
<a-select v-decorator="['pay_method', { initialValue: 0 }]">
<a-select-option :value="''">全部</a-select-option>
<a-select-option :value="'wechat'">会员</a-select-option>
<a-select-option :value="'balance'">分销商 </a-select-option>
</a-select>
</a-form-item>
<a-form-item label="付款时间"> <a-form-item label="付款时间">
<a-range-picker format="YYYY-MM-DD" v-decorator="['betweenTime']" /> <a-range-picker format="YYYY-MM-DD" style="width:220px" v-decorator="['pay_time']" />
</a-form-item> </a-form-item>
<a-form-item class="search-btn"> <a-form-item class="search-btn">
<a-button type="primary" icon="search" html-type="submit">搜索</a-button> <a-button type="primary" icon="search" html-type="submit">搜索</a-button>
@ -31,19 +39,28 @@
</a-row> </a-row>
</div> </div>
<s-table ref="table" rowKey="order_id" :loading="isLoading" :columns="columns" :data="loadData" :pagination="pagination"> <s-table ref="table" rowKey="order_id" :loading="isLoading" :columns="columns" :data="loadData" :pagination="pagination">
<!-- 会员信息 -->
<span slot="user" slot-scope="text">
<UserItem :user="text" />
</span>
<!-- 充值方式 -->
<span slot="order_type" slot-scope="text">
<a-tag v-if="text==10">会员</a-tag>
<a-tag v-if="text==20">分销商</a-tag>
</span>
<!-- 时效 --> <!-- 时效 -->
<span slot="month" slot-scope="text"> <span slot="month" slot-scope="text">
<p class="twoline-hide">{{ text }}个月</p> <p class="twoline-hide">{{ text }}个月</p>
</span> </span>
<!-- 充值方式 --> <!-- 支付方式 -->
<span slot="recharge_type" slot-scope="text"> <span slot="pay_method" slot-scope="text">
<a-tag>{{ RechargeTypeEnum[text].name }}</a-tag> <a-tag v-if="text">{{ text=='wechat'?'微信支付':'余额支付' }}</a-tag>
</span> </span>
<!-- 状态 --> <!-- 状态 -->
<span slot="pay_status" slot-scope="text"> <span slot="pay_status" slot-scope="text">
<a-tag :color="text == 20 ? 'green' : ''">{{ text == 20 ? '已支付' : '待支付' }}</a-tag> <a-tag :color="text == 20 ? 'green' : ''">{{ text == 20 ? '已支付' : '待支付' }}</a-tag>
</span> </span>
<span slot="pay_status" slot-scope="text"> <span slot="pay_time" slot-scope="text">
<span>{{ text | formatDate }}</span> <span>{{ text | formatDate }}</span>
</span> </span>
</s-table> </s-table>
@ -54,108 +71,123 @@
import * as Api from '@/api/user/order' import * as Api from '@/api/user/order'
import { STable, UserItem } from '@/components/Table' import { STable, UserItem } from '@/components/Table'
import PayStatusEnum from '@/common/enum/recharge/order/PayStatus' import PayStatusEnum from '@/common/enum/recharge/order/PayStatus'
import RechargeTypeEnum from '@/common/enum/recharge/order/RechargeType' import moment from 'moment'
export default { export default {
name: 'Index', name: 'Index',
components: { components: {
STable, STable,
UserItem UserItem,
}, },
filters: { filters: {
formatDate (value) { formatDate(value) {
return value ? moment(value*1000).format('YYYY-MM-DD HH:mm:ss') : '' return value ? moment(value * 1000).format('YYYY-MM-DD HH:mm:ss') : '-'
},
},
data() {
return {
//
PayStatusEnum,
//
searchForm: this.$form.createForm(this),
//
queryParam: {},
//
isLoading: false,
//
// {
// title: '',
// dataIndex: 'month'
// },
columns: [
{
title: 'ID',
dataIndex: 'order_id',
},
{
title: '会员信息',
dataIndex: 'user',
scopedSlots: { customRender: 'user' }
},
{
title: '订单号',
dataIndex: 'order_no',
},
{
title: '订单类型',
dataIndex: 'order_type',
scopedSlots: { customRender: 'order_type' }
},
{
title: '会员时效',
dataIndex: 'month',
scopedSlots: { customRender: 'month' },
},
{
title: '支付金额',
dataIndex: 'pay_price',
},
{
title: '支付方式',
dataIndex: 'pay_method',
scopedSlots: { customRender: 'pay_method' },
},
{
title: '支付状态',
dataIndex: 'pay_status',
scopedSlots: { customRender: 'pay_status' },
},
{
title: '支付时间',
dataIndex: 'pay_time',
scopedSlots: { customRender: 'pay_time' },
},
{
title: '创建时间',
dataIndex: 'create_time',
scopedSlots: { customRender: 'create_time' },
},
],
// Promise
loadData: (param) => {
return Api.order({ ...param, ...this.queryParam }).then((response) => {
return response.data.list
})
},
} }
}, },
data() { created() {},
return { methods: {
// /**
PayStatusEnum, * 刷新列表
RechargeTypeEnum, * @param Boolean bool 强制刷新到第一页
// */
searchForm: this.$form.createForm(this), handleRefresh(bool = false) {
// this.$refs.table.refresh(bool)
queryParam: {}, },
//
isLoading: false,
//
// {
// title: '',
// dataIndex: 'month'
// },
columns: [
{
title: 'ID',
dataIndex: 'order_id'
},
{
title: '订单号',
dataIndex: 'order_no'
},
{
title: '会员时效',
dataIndex: 'month',
scopedSlots: { customRender: 'month' }
},
{
title: '支付方式',
dataIndex: 'pay_method',
scopedSlots: { customRender: 'pay_method' }
},
{
title: '支付状态',
dataIndex: 'pay_status',
scopedSlots: { customRender: 'pay_status' }
},
{
title: '支付时间',
dataIndex: 'pay_time'
},
{
title: '创建时间',
dataIndex: 'create_time'
}
],
// Promise
loadData: param => {
return Api.order({ ...param, ...this.queryParam })
.then(response => {
return response.data.list
})
}
}
},
created() {
},
methods: {
/** //
* 刷新列表 handleSearch(e) {
* @param Boolean bool 强制刷新到第一页 e.preventDefault()
*/ this.searchForm.validateFields((error, values) => {
handleRefresh(bool = false) { if (!error) {
this.$refs.table.refresh(bool) this.queryParam = { ...this.queryParam, ...values }
}, this.handleRefresh(true)
}
// })
handleSearch(e) { },
e.preventDefault() },
this.searchForm.validateFields((error, values) => {
if (!error) {
this.queryParam = { ...this.queryParam, ...values }
this.handleRefresh(true)
}
})
}
}
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ant-card-body { .ant-card-body {
padding: 22px 29px 25px; padding: 22px 29px 25px;
}
/deep/.ant-table-tbody td {
text-align: center;
}
/deep/.ant-table-thead th {
text-align: center;
} }
</style> </style>
Loading…
Cancel
Save