|
|
@@ -21,7 +21,7 @@
|
|
|
</el-button>
|
|
|
</page-title>
|
|
|
<div class="filters-container">
|
|
|
- <el-select v-model="status" placeholder="筛选状态" clearable @change="getData">
|
|
|
+ <el-select v-model="status" placeholder="筛选状态" clearable @change="getData" style="margin-right: 10px">
|
|
|
<el-option
|
|
|
v-for="item in statusOptions"
|
|
|
:key="item.value"
|
|
|
@@ -29,6 +29,7 @@
|
|
|
:label="item.label"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
+ <created-at-picker v-model="createdAt" @input="getData"></created-at-picker>
|
|
|
<el-input
|
|
|
placeholder="搜索..."
|
|
|
v-model="search"
|
|
|
@@ -109,8 +110,10 @@
|
|
|
<script>
|
|
|
import { mapState } from 'vuex';
|
|
|
import pageableTable from '@/mixins/pageableTable';
|
|
|
+import CreatedAtPicker from '../components/CreatedAtPicker.vue';
|
|
|
|
|
|
export default {
|
|
|
+ components: { CreatedAtPicker },
|
|
|
name: 'OrderList',
|
|
|
mixins: [pageableTable],
|
|
|
data() {
|
|
|
@@ -129,7 +132,8 @@ export default {
|
|
|
{ label: '微信', value: 'WEIXIN' },
|
|
|
{ label: '支付宝', value: 'ALIPAY' }
|
|
|
],
|
|
|
- status: null
|
|
|
+ status: null,
|
|
|
+ createdAt: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -152,8 +156,27 @@ export default {
|
|
|
}
|
|
|
return '';
|
|
|
},
|
|
|
+ getParams() {
|
|
|
+ let data = {
|
|
|
+ sort: 'createdAt,desc',
|
|
|
+ query: {
|
|
|
+ del: false
|
|
|
+ }
|
|
|
+ };
|
|
|
+ if (this.search) {
|
|
|
+ data.search = this.search;
|
|
|
+ }
|
|
|
+ if (this.createdAt) {
|
|
|
+ data.query.createdAt = this.createdAt;
|
|
|
+ }
|
|
|
+ if (this.status) {
|
|
|
+ data.query.status = this.status;
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ },
|
|
|
beforeGetData() {
|
|
|
- return { search: this.search, query: { del: false, status: this.status } };
|
|
|
+ // return { search: this.search, query: { del: false, status: this.status } };
|
|
|
+ return this.getParams();
|
|
|
},
|
|
|
toggleMultipleMode(multipleMode) {
|
|
|
this.multipleMode = multipleMode;
|