diff --git a/src/components/Modal/GoodsModal/GoodsModal.vue b/src/components/Modal/GoodsModal/GoodsModal.vue index bd79f82..e755974 100644 --- a/src/components/Modal/GoodsModal/GoodsModal.vue +++ b/src/components/Modal/GoodsModal/GoodsModal.vue @@ -120,16 +120,17 @@ export default { // 当前表单元素 searchForm: this.$form.createForm(this), // 查询参数 - queryParam: { - channel: 'zy', + queryParam: {}, + queryNew:{ + channel: 'zy', status: 10, }, // table表头 columns, // 加载数据方法 必须为 Promise 对象 loadData: (param) => { - this.queryParam = this.source == 1 ? this.queryParam : {} - return GoodsApi.list({ ...param, ...this.queryParam }).then((response) => { + this.queryNew = this.source == 1 ? this.queryNew : {} + return GoodsApi.list({ ...param, ...this.queryParam,...this.queryNew }).then((response) => { return response.data.list }) }, diff --git a/src/config/router.config.js b/src/config/router.config.js index 8f3a36d..3c88776 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -515,12 +515,12 @@ export const asyncRouterMap = [ meta: { title: '会员价格', keepAlive: false, permission: ['/user/identity/index'] }, moduleKey: 'user-grade', }, - // { - // path: '/user/order/Index', - // component: () => import(/* webpackChunkName: "user" */ '@/views/user/order/Index'), - // meta: { title: '会员订单', keepAlive: false, permission: ['/user/order/Index'] }, - // moduleKey: 'user-grade', - // }, + { + path: '/user/order/Index', + component: () => import(/* webpackChunkName: "user" */ '@/views/user/order/Index'), + meta: { title: '会员订单', keepAlive: false, permission: ['/user/order/Index'] }, + moduleKey: 'user-grade', + }, { path: '/user/balance', component: RouteView, diff --git a/src/views/user/order/Index.vue b/src/views/user/order/Index.vue index b2e037f..c670bac 100644 --- a/src/views/user/order/Index.vue +++ b/src/views/user/order/Index.vue @@ -8,12 +8,6 @@ - - - 全部 - {{ item.name }} - - 全部 @@ -21,8 +15,22 @@ 已支付 + + + 全部 + 会员 + 分销商 + + + + + 全部 + 会员 + 分销商 + + - + 搜索 @@ -31,19 +39,28 @@ + + + + + + + 会员 + 分销商 +

{{ text }}个月

- - - {{ RechargeTypeEnum[text].name }} + + + {{ text=='wechat'?'微信支付':'余额支付' }} {{ text == 20 ? '已支付' : '待支付' }} - + {{ text | formatDate }}
@@ -54,108 +71,123 @@ import * as Api from '@/api/user/order' import { STable, UserItem } from '@/components/Table' import PayStatusEnum from '@/common/enum/recharge/order/PayStatus' -import RechargeTypeEnum from '@/common/enum/recharge/order/RechargeType' - +import moment from 'moment' export default { - name: 'Index', - components: { - STable, - UserItem - }, - filters: { - formatDate (value) { - return value ? moment(value*1000).format('YYYY-MM-DD HH:mm:ss') : '' + name: 'Index', + components: { + STable, + UserItem, + }, + filters: { + formatDate(value) { + 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() { - return { - // 枚举类 - PayStatusEnum, - RechargeTypeEnum, - // 当前表单元素 - searchForm: this.$form.createForm(this), - // 查询参数 - 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: { + created() {}, + methods: { + /** + * 刷新列表 + * @param Boolean bool 强制刷新到第一页 + */ + handleRefresh(bool = false) { + this.$refs.table.refresh(bool) + }, - /** - * 刷新列表 - * @param Boolean bool 强制刷新到第一页 - */ - handleRefresh(bool = false) { - this.$refs.table.refresh(bool) - }, - - // 确认搜索 - handleSearch(e) { - e.preventDefault() - this.searchForm.validateFields((error, values) => { - if (!error) { - 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) + } + }) + }, + }, } - + \ No newline at end of file