| | |
| | | style="width: 180px" |
| | | /> |
| | | </FormItem> |
| | | <FormItem label="中奖状态" prop="beginTime"> |
| | | <FormItem label="中奖状态" prop="grantStatus"> |
| | | <Select |
| | | v-model="searchForm.grantStatus" |
| | | placeholder="请选择中奖状态" |
| | |
| | | </Option> |
| | | </Select> |
| | | </FormItem> |
| | | |
| | | <FormItem label="报名开始时间" prop="time"> |
| | | <DatePicker |
| | | v-model="time" |
| | | type="datetimerange" |
| | | placeholder="选择开始时间" |
| | | style="width: 180px" |
| | | @on-clear="handleSearch" |
| | | @on-change="handleSearch" |
| | | ></DatePicker> |
| | | </FormItem> |
| | | <Button |
| | | @click="handleSearch" |
| | | type="primary" |
| | |
| | | modelShow:false, |
| | | modelTitle:'', |
| | | loading:false, |
| | | time:[], |
| | | columns:[ |
| | | { |
| | | title: '用户昵称', |
| | |
| | | } |
| | | }, |
| | | { |
| | | title: '抽奖时间', |
| | | key: 'createTime', |
| | | minWidth: 100, |
| | | render: (h, params) => { |
| | | return h('div', [ |
| | | h('div', `${this.formatDate(params.row.createTime,'YYYY-MM-DD HH:mm:ss')}`), |
| | | ]) |
| | | } |
| | | }, |
| | | { |
| | | title: '操作', |
| | | slot: 'action', |
| | | width: 280, |
| | |
| | | pageNumber:1, |
| | | nickName:'', |
| | | activityName:'', |
| | | grantStatus:'' |
| | | grantStatus:'', |
| | | startTime:'', |
| | | endTime:'' |
| | | }, |
| | | typeSelect:[ |
| | | {id: 1, value: 'SUCCESS', label: '发放成功'}, |
| | |
| | | this.init(); |
| | | }, |
| | | methods: { |
| | | formatDate(date, format = 'YYYY-MM-DD HH:mm:ss') { |
| | | if (!date) return ''; |
| | | |
| | | const d = new Date(date); |
| | | if (isNaN(d.getTime())) return ''; |
| | | |
| | | const padZero = (num) => String(num).padStart(2, '0'); // 更可靠的补零方法 |
| | | |
| | | const year = d.getFullYear(); |
| | | const month = padZero(d.getMonth() + 1); // 月份 0-11 → +1 |
| | | const day = padZero(d.getDate()); |
| | | const hours = padZero(d.getHours()); |
| | | const minutes = padZero(d.getMinutes()); |
| | | const seconds = padZero(d.getSeconds()); |
| | | return format |
| | | .replace('YYYY', year) |
| | | .replace('MM', month) |
| | | .replace('DD', day) |
| | | .replace('HH', hours) |
| | | .replace('mm', minutes) |
| | | .replace('ss', seconds); |
| | | }, |
| | | queryExport(){ |
| | | queryExport(this.searchForm).then(res =>{ |
| | | const blob = new Blob([res], { |
| | |
| | | resetSearch(){ |
| | | this.$refs.searchForm.resetFields() |
| | | this.searchForm.pageNumber = 1 |
| | | this.searchForm.startTime = ''; |
| | | this.searchForm.endTime = ''; |
| | | this.time =[]; |
| | | this.getPage() |
| | | }, |
| | | infoModelClose(){ |
| | |
| | | }, |
| | | |
| | | handleSearch(type,value){ |
| | | if (type === 'beginTime') { |
| | | this.searchForm.beginTime = value |
| | | } else if (type === 'endTime') { |
| | | this.searchForm.endTime = value |
| | | } |
| | | this.searchForm.startTime = this.formatDate(this.time[0]); |
| | | this.searchForm.endTime = this.formatDate(this.time[1]); |
| | | this.getPage() |
| | | }, |
| | | |
| | |
| | | init() { |
| | | this.getPage() |
| | | }, |
| | | changePage(){ |
| | | changePage(page){ |
| | | this.searchForm.pageNumber = page |
| | | this.getPage() |
| | | }, |
| | | changePageSize(pageSize){ |
| | | this.searchForm.pageNumber = 1 |
| | | this.searchForm.pageSize = pageSize |
| | | this.getPage() |
| | | }, |
| | | changePageSize(){ |
| | | this.searchForm.pageNumber = page |
| | | this.getPage() |
| | | |
| | | }, |
| | | |
| | | }, |