123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <template>
- <div class="subPage">
- <div class="system-table-search">
- <div class="flex-h">
- <ul class="searchFilterLine" style="white-space: normal;">
- <li>
- <el-select v-model="postData.caseid" placeholder="请选择案场">
- <el-option
- v-for="item in cases"
- :key="item.CaseId"
- :label="item.CaseName"
- :value="item.CaseId">
- </el-option>
- </el-select>
- </li>
- <li>
- <el-input
- placeholder="请输入课程活动名称"
- v-model="postData.name"
- clearable>
- </el-input>
- </li>
- <li>
- <el-input
- placeholder="请输入手机号"
- v-model="postData.tel"
- clearable>
- </el-input>
- </li>
- <li>
- <el-select v-model="postData.status" placeholder="请选择状态">
- <el-option
- v-for="item in statusList"
- :key="item.id"
- :label="item.value"
- :value="item.id">
- </el-option>
- </el-select>
- </li>
- </ul>
- </div>
- <div class="flex-h">
- <div class="flex-item flex-h"></div>
- <el-button
- size="mini"
- type="primary" @click="search">搜索</el-button>
- <el-button
- size="mini"
- type="success" @click="exportExcel">导出Excel</el-button>
- </div>
- <div class="moreFilter"></div>
- </div>
- <div class="system-table-box">
- <el-table
- :data="courseVerifyList"
- stripe
- style="width: 100%">
- <el-table-column
- prop="CaseName"
- label="所属案场">
- </el-table-column>
- <el-table-column
- prop="CourseName"
- label="课程名称">
- </el-table-column>
- <el-table-column
- prop="BeginDate"
- label="课程时间"
- width="140px">
- <template slot-scope="scope">
- {{toolClass.dateFormat(scope.row.BeginDate)}}<br>
- -<br>
- {{toolClass.dateFormat(scope.row.EndDate)}}
- </template>
- </el-table-column>
- <el-table-column
- prop="CustomerName"
- label="用户姓名">
- </el-table-column>
- <el-table-column
- prop="Name"
- label="微信昵称">
- </el-table-column>
- <el-table-column
- prop="Phone"
- label="手机号">
- </el-table-column>
- <el-table-column
- prop="CreateDate"
- label="下单时间"
- width="140px">
- <template slot-scope="scope">
- {{toolClass.dateFormat(scope.row.CreateDate)}}
- </template>
- </el-table-column>
- <el-table-column
- prop="VerifyDate"
- label="核销时间"
- width="140px">
- <template slot-scope="scope">
- {{toolClass.dateFormat(scope.row.VerifyDate)}}
- </template>
- </el-table-column>
- <el-table-column
- prop="Status"
- label="状态">
- <template slot-scope="scope">
- {{scope.row.Status === 'useable' ? '未使用' : scope.row.Status === 'used' ? '已使用' : scope.row.Status === 'late' ? '逾期核销' : ''}}
- </template>
- </el-table-column>
- </el-table>
- </div>
- <el-pagination
- @current-change="handleCurrentChange"
- :current-page.sync="postData.page"
- :page-size="postData.pagesize"
- layout="prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </template>
-
- <script>
- import { mapState, createNamespacedHelpers } from 'vuex'
- import tableSearch from '@/components/tableSearch/index'
- const { mapState: mapStaState, mapActions: mapStaActions } = createNamespacedHelpers('sta')
-
- export default {
- name: '',
- data () {
- return {
- total: 0,
- postData: { // 表格搜索条件
- caseid: '', // 案场id
- tel: '', // 手机号
- status: '', // 状态
- name: '', // 卡券名称
- page: 1, // 当前页码
- pagesize: 10, // 请求数据量
- },
- statusList: [{
- value: '',
- id: ''
- }, {
- value: '未使用',
- id: 'useable'
- }, {
- value: '已使用',
- id: 'used'
- }, {
- value: '逾期核销',
- id: 'late'
- }],
- }
- },
- computed: {
- ...mapState({
- cases: x => x.app.cases.list,
- defaultCaseId: x => x.app.cases.default
- }),
- ...mapStaState({
- courseVerifyList: x => x.courseVerifyList.list || [],
- }),
- CaseId: {
- get () {
- return this.postData.caseid || this.defaultCaseId
- },
- set (val) {
- this.postData.caseid = val
- }
- }
- },
- components: {
- tableSearch,
- },
- mounted () {
- this.$nextTick(function () {
- this.getList()
- })
- },
- methods: {
- ...mapStaActions([
- 'getCourseVerifyList',
- ]),
- search () { // 搜索
- this.page = 1
- this.getList()
- },
- handleCurrentChange (val) { // 跳转到分页
- this.page = val
- this.getList()
- },
- getList () {
- this.getCourseVerifyList(this.postData).then((res) => {
- // console.log(JSON.stringify(res))
- this.postData.page = res.page
- this.total = res.total
- })
- },
- exportExcel () {
- window.location.href = `${this.toolClass.ReplaceOrg(this.$api.statistics.courseVerifyListExcel.url)}?token=${localStorage.getItem('JWT')}`
- },
- }
- }
- </script>
-
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style lang="scss" scoped>
- @import "page.scss";
- .searchFilterLine {
- > li {
- margin-bottom: 20px;
- }
- }
- </style>
|