Vue.component('m-coupon-send-record', { template: `
全部 未使用 已使用 已过期 搜索
`, props: { 'showSendRecord': { type: Boolean, default: false, }, 'id': { type: String, default: '0', },//优惠券或券包的ID 'couponMold': { type: Number, default: '1', },//类型 1优惠券 2券包 'storeId': { type: String, default: '', } }, data() { return { searchForm: { search_type: 2, search_text: '', usage_status: '', }, page: 1, limit: 10, currentLen: 0, recordList: [], loading: false, } }, methods: { closeDialog() { this.$emit('close'); }, // 切换记录每页数量 limitRecordChange(val) { this.limit = val; this.page = 1; this.couponRecordList(); }, // 切换记录页数 pageRecordChange(val) { this.page = val; this.couponRecordList(); }, // 优惠券发放记录 couponRecordList() { this.loading = true; $.ajax({ url: '/index.php/Retail/' + (this.storeId ? 'StoreCoupon' : 'Mcoupon') + '/' + (this.couponMold == 2 ? 'couponGroupRecordList' : 'couponRecordList'), type: "post", data: { id: this.id, search_info: this.searchForm, page: this.page, limit: this.limit, }, success: (res) => { if (res.status == 1) { this.recordList = res.data.list; this.currentLen = res.data.count * 1; } else { this.recordList = []; this.currentLen = 0; } this.loading = false; } }) }, }, mounted() { }, created() { }, watch: { showSendRecord(n, o) { if (n) { this.pageRecordChange(1); } else { this.recordList = []; this.searchForm = { search_type: 1, search_text: '', usage_status: '', page: 1, limit: 10, }; } }, }, });