|
@@ -5,36 +5,33 @@
|
|
|
|
|
|
<div class="mui-content vongi-kqtj-center vongi-dktz-c">
|
|
<div class="mui-content vongi-kqtj-center vongi-dktz-c">
|
|
<div class="fyy-temper-date margin10">
|
|
<div class="fyy-temper-date margin10">
|
|
- <a href="" class="mui-col-xs-8">02-19 23:00 至 02-26 01:00<span
|
|
|
|
- class="mui-icon mui-icon-arrowdown"></span></a>
|
|
|
|
- <a href="" class="mui-col-xs-4">登记人<span class="mui-icon mui-icon-arrowdown"></span></a>
|
|
|
|
|
|
+ <a class="mui-col-xs-12">
|
|
|
|
+ <span @click="selectStartTime">{{listForm.startTime}}</span>
|
|
|
|
+ 至
|
|
|
|
+ <span @click="selectEndTime">{{listForm.endTime}}</span>
|
|
|
|
+ <span class="mui-icon mui-icon-arrowdown"></span>
|
|
|
|
+ </a>
|
|
|
|
+ <!-- <a href="" class="mui-col-xs-4">登记人<span class="mui-icon mui-icon-arrowdown"></span></a> -->
|
|
</div>
|
|
</div>
|
|
<div class="vongi-clasadmin vongi-bagfff">
|
|
<div class="vongi-clasadmin vongi-bagfff">
|
|
<div class="vongi-xzdw-search">
|
|
<div class="vongi-xzdw-search">
|
|
- <input type="search" placeholder="请输入车牌号查询">
|
|
|
|
|
|
+ <input type="search" @keyup.enter="reloadList" v-model="listForm.carNumber" placeholder="请输入车牌号查询">
|
|
<span class="mui-icon mui-icon-search"></span>
|
|
<span class="mui-icon mui-icon-search"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="vongi-archives">
|
|
<div class="vongi-archives">
|
|
<ul class="mui-table-view">
|
|
<ul class="mui-table-view">
|
|
- <li class="mui-table-view-cell">
|
|
|
|
- <a class="mui-navigate-right" href="#">
|
|
|
|
- 鄂D99999
|
|
|
|
- <span class="mui-pull-right mui-h6">
|
|
|
|
- 02-24 12:00
|
|
|
|
- </span>
|
|
|
|
- </a>
|
|
|
|
- </li>
|
|
|
|
- <li class="mui-table-view-cell">
|
|
|
|
- <a class="mui-navigate-right" href="#">
|
|
|
|
- 鄂D99999
|
|
|
|
- <span class="mui-pull-right mui-h6">
|
|
|
|
- 02-24 12:00
|
|
|
|
- </span>
|
|
|
|
- </a>
|
|
|
|
|
|
+ <li v-for="(item,index) in recordList" class="mui-table-view-cell">
|
|
|
|
+ <router-link class="mui-navigate-right" :to="{name:'MerchantHistoryInfo',query:{id:item.id}}">
|
|
|
|
+ {{item.carNumber}}
|
|
|
|
+ <span class="mui-pull-right mui-h6" v-text="item.createTime"></span>
|
|
|
|
+ </router-link>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <NullList :remark="'暂无历史记录'" v-if="!recordList.length"></NullList>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<loading :visible="isLoading"></loading>
|
|
<loading :visible="isLoading"></loading>
|
|
@@ -42,46 +39,155 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ require('$project/assets/js/mui.picker.min.js');
|
|
|
|
+ import * as API_Merchant from '@/apis/merchant'
|
|
import CommonMerchant from '@/components/CommonMerchant.vue'
|
|
import CommonMerchant from '@/components/CommonMerchant.vue'
|
|
import Loading from '$project/components/Loading.vue'
|
|
import Loading from '$project/components/Loading.vue'
|
|
import TopHeader from '$project/components/TopHeader.vue'
|
|
import TopHeader from '$project/components/TopHeader.vue'
|
|
|
|
+ import isReachBottom from '$project/utils/isReachBottom'
|
|
|
|
+ import NullList from '$project/components/NullList.vue'
|
|
import {
|
|
import {
|
|
mapGetters,
|
|
mapGetters,
|
|
mapMutations
|
|
mapMutations
|
|
} from 'vuex'
|
|
} from 'vuex'
|
|
|
|
+ import {
|
|
|
|
+ currentTimeStamp,
|
|
|
|
+ parseUnixTime,
|
|
|
|
+ afterTimeStamp
|
|
|
|
+ } from '$project/utils'
|
|
export default {
|
|
export default {
|
|
name: 'MerchantHistoryList',
|
|
name: 'MerchantHistoryList',
|
|
components: {
|
|
components: {
|
|
CommonMerchant,
|
|
CommonMerchant,
|
|
Loading,
|
|
Loading,
|
|
TopHeader,
|
|
TopHeader,
|
|
|
|
+ NullList
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
isLoading: false,
|
|
isLoading: false,
|
|
|
|
|
|
pageTitle: '历史记录',
|
|
pageTitle: '历史记录',
|
|
|
|
+
|
|
|
|
+ listForm: {
|
|
|
|
+ pageIndex: 1,
|
|
|
|
+ pageSize: 20,
|
|
|
|
+ totalPage: 1,
|
|
|
|
+ startTime: '',
|
|
|
|
+ endTime: '',
|
|
|
|
+ carNumber: ''
|
|
|
|
+ },
|
|
|
|
+ recordList: [],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- created() {},
|
|
|
|
|
|
+ created() {
|
|
|
|
+ this.listForm.startTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d} 00:00');
|
|
|
|
+ this.listForm.endTime = parseUnixTime(afterTimeStamp(1, this.listForm.startTime), '{y}-{m}-{d} 00:00');
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //获取列表
|
|
|
|
+ getList() {
|
|
|
|
+ this.isLoading = true;
|
|
|
|
+ API_Merchant.discountTicketList(this.listForm).then(response => {
|
|
|
|
+ if (response) {
|
|
|
|
+ if (this.listForm.pageIndex == 1) {
|
|
|
|
+ this.recordList = response.data;
|
|
|
|
+ this.listForm.pageIndex = response.pageNumber;
|
|
|
|
+ this.listForm.totalPage = response.totalPage;
|
|
|
|
+ } else {
|
|
|
|
+ this.recordList = [
|
|
|
|
+ ...this.recordList,
|
|
|
|
+ ...response.data
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.listForm.pageIndex++;
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ mui.toast(error);
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //下拉事件
|
|
|
|
+ handleScrool() {
|
|
|
|
+ if (isReachBottom()) {
|
|
|
|
+ console.log('到达底部')
|
|
|
|
+ if (this.listForm.pageIndex <= this.listForm.totalPage && this.isLoading == false) {
|
|
|
|
+ this.getList();
|
|
|
|
+ } else {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //重载列表
|
|
|
|
+ reloadList() {
|
|
|
|
+ this.listForm.pageIndex = 1;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ //选择开始时间
|
|
|
|
+ selectStartTime() {
|
|
|
|
+ var _this = this;
|
|
|
|
+ var picker = new mui.DtPicker({
|
|
|
|
+ "type": "datetime",
|
|
|
|
+ "beginYear": 2020,
|
|
|
|
+ "endDate": new Date(),
|
|
|
|
+ "value": _this.listForm.startTime
|
|
|
|
+ });
|
|
|
|
+ picker.show(function(rs) {
|
|
|
|
+ _this.listForm.startTime = rs.text;
|
|
|
|
+ picker.dispose();
|
|
|
|
+ _this.reloadList();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //选择结束时间
|
|
|
|
+ selectEndTime() {
|
|
|
|
+ var _this = this;
|
|
|
|
+ var picker = new mui.DtPicker({
|
|
|
|
+ "type": "datetime",
|
|
|
|
+ "beginDate": new Date(_this.listForm.startTime),
|
|
|
|
+ "value": _this.listForm.endTime
|
|
|
|
+ });
|
|
|
|
+ picker.show(function(rs) {
|
|
|
|
+ _this.listForm.endTime = rs.text;
|
|
|
|
+ picker.dispose();
|
|
|
|
+ _this.reloadList();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
asynCallBack() {
|
|
asynCallBack() {
|
|
|
|
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- mounted() {},
|
|
|
|
|
|
+ mounted() {
|
|
|
|
+ this.getList();
|
|
|
|
+ //监控下拉加载事件
|
|
|
|
+ var _this = this;
|
|
|
|
+ window.addEventListener('scroll', _this.handleScrool);
|
|
|
|
+ },
|
|
destroyed() {
|
|
destroyed() {
|
|
-
|
|
|
|
|
|
+ //销毁监听事件
|
|
|
|
+ var _this = this;
|
|
|
|
+ window.removeEventListener('scroll', _this.handleScrool);
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapGetters({
|
|
...mapGetters({
|
|
openId: 'wx_openid',
|
|
openId: 'wx_openid',
|
|
})
|
|
})
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ //keepalive监控判断
|
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
|
+ console.log(to.name);
|
|
|
|
+ if (['MerchantHistoryInfo'].indexOf(to.name) > -1) {
|
|
|
|
+ this.$store.commit('SET_KEEP_ALIVE_COMPONENTS', ['MerchantHistoryList'])
|
|
|
|
+ } else {
|
|
|
|
+ this.$store.commit('SET_KEEP_ALIVE_COMPONENTS', [])
|
|
|
|
+ }
|
|
|
|
+ next()
|
|
|
|
+ },
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
|
|
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
|
|
<style src="$project/assets/css/iconfont.css"></style>
|
|
<style src="$project/assets/css/iconfont.css"></style>
|
|
|
|
+<style src="$project/assets/css/mui.picker.min.css"></style>
|
|
<style>
|
|
<style>
|
|
</style>
|
|
</style>
|