123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <template>
- <div class="subPage">
- <div class="system-table-search">
- <div class="flex-h">
- <div class="flex-item flex-h"></div>
- <ul>
- <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-select v-model="postData.ctype" placeholder="请选择卡券类型">
- <el-option
- v-for="item in typeList"
- :key="item.id"
- :label="item.value"
- :value="item.id">
- </el-option>
- </el-select>
- </li>
- <li>
- <el-input
- placeholder="请输入卡券名称"
- v-model="postData.name"
- clearable>
- </el-input>
- </li>
- </ul>
- <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="cardCouponList"
- stripe
- style="width: 100%">
- <el-table-column
- prop="CaseName"
- label="所属案场">
- </el-table-column>
- <el-table-column
- prop="CName"
- label="卡券名称">
- </el-table-column>
- <el-table-column
- prop="TypeName"
- label="卡券类型">
- </el-table-column>
- <el-table-column
- prop="SendType"
- label="发送类型">
- <template slot-scope="scope">
- {{scope.row.SendType === 'case' ? '案场' : scope.row.SendType === 'system' ? '系统' : '渠道'}}
- </template>
- </el-table-column>
- <el-table-column
- prop="Price"
- label="价格">
- </el-table-column>
- <el-table-column
- prop="SentCount"
- label="领取数">
- </el-table-column>
- <el-table-column
- prop="UsedCount"
- label="实际使用数">
- </el-table-column>
- <el-table-column
- prop="UsedCount"
- label="总费用">
- <template slot-scope="scope">
- {{(scope.row.Price - 0) * (scope.row.UsedCount - 0)}}
- </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
- ctype: '', // 卡券类型
- name: '', // 卡券名称
- page: 1, // 当前页码
- pagesize: 10, // 请求数据量
- },
- typeList: [{
- value: '课程体验卡',
- id: 'card'
- }, {
- value: '商品优惠券',
- id: 'goodscoupon'
- }, {
- value: '课程优惠券',
- id: 'coursecoupon'
- }],
- }
- },
- computed: {
- ...mapState({
- cases: x => x.app.cases.list,
- defaultCaseId: x => x.app.cases.default
- }),
- ...mapStaState({
- cardCouponList: x => x.cardCoupon.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([
- 'getCardCouponList',
- 'getCardCouponListExcel',
- ]),
- search () { // 搜索
- this.page = 1
- this.getList()
- },
- handleCurrentChange (val) { // 跳转到分页
- this.page = val
- this.getList()
- },
- getList () {
- this.getCardCouponList(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.cardCouponListExcel.url)}?token=${localStorage.getItem('JWT')}`
- },
- }
- }
- </script>
-
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style lang="scss" scoped>
- @import "page.scss";
- </style>
|