123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <template>
- <div class="subPage">
- <div class="list flex-h">
- <div class="flex-item">
- <div class="flex-h" style="margin: 20px 0 0;border:none;">
- <div class="flex-item">
- <div class="userInfo">
- <span>用户名:</span>
- <b>{{customerName}}</b>
- <span>手机号:</span>
- <b>{{phone}}</b>
- </div>
- </div>
- <el-button
- size="mini"
- type="warning"
- @click="reback">返回</el-button>
- </div>
- <div v-if="(courses.list||[]).length>0">
- <el-table
- :data="courses.list"
- stripe
- style="width: 100%">
- <el-table-column
- prop="CaseName"
- label="所在案场">
- </el-table-column>
- <el-table-column
- prop="LocationName"
- label="课程分类">
- </el-table-column>
- <el-table-column
- prop="CourseName"
- label="课程名称">
- </el-table-column>
- <el-table-column
- prop="DetailName"
- label="课时名称">
- </el-table-column>
- <el-table-column
- prop="StartDate"
- label="课程开始时间">
- <template slot-scope="scope">
- <span>{{toolClass.dateFormat(scope.row.StartDate)}}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="EndDate"
- label="课程结束时间">
- <template slot-scope="scope">
- <span>{{toolClass.dateFormat(scope.row.EndDate)}}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="操作">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="success"
- v-if="scope.row.VerifyStatus!=='used'"
- @click="check(scope.row)">核销</el-button>
- <span v-else>已完成</span>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @current-change="handleCurrentChange"
- :current-page.sync="courses.page"
- :page-size="courses.pagesize"
- layout="prev, pager, next, jumper"
- :total="courses.pagenum">
- </el-pagination>
- </div>
- <span class="noData" v-else>今日暂无可核销的课程</span>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- import { createNamespacedHelpers } from 'vuex'
-
- const { mapState: mapVerifState, mapActions: mapVerifActions } = createNamespacedHelpers('verification')
-
- export default {
- name: '',
- data () {
- return {
- customerName: '',
- phone: this.$route.query.tel,
- code: '',
- tel: '',
- page: 1,
- pagesize: 10,
- }
- },
- mounted () {
- this.$nextTick(function () {
- this.getCustomerName({
- id: this.phone
- }).then((res) => {
- console.log(res)
- const { code, tel } = this.$route.query
- this.code = code
- this.tel = tel
- this.getList()
- })
- })
- },
- computed: {
- ...mapVerifState({
- courses: x => x.courseVerifs
- })
- },
- methods: {
- ...mapVerifActions([
- 'GetCourseVerList',
- 'CourseVerifs',
- 'GetCourseVerListByTel',
- 'getCustomerName'
- ]),
- check (item) { // 核销
- this.$confirm('确认核销此课程?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- this.CourseVerifs({id: item.CustomerDetailId, callback: this.afterCheck})
- })
- },
- getList () {
- if (this.code && this.code !== '') {
- this.GetCourseVerList({id: this.code, page: this.page, pagesize: this.pagesize})
- } else {
- if (this.tel && this.tel !== '') {
- this.GetCourseVerListByTel({tel: this.tel, page: this.page, pagesize: this.pagesize})
- }
- }
- },
- handleCurrentChange (val) { // 跳转到分页
- this.page = val
- this.getList()
- },
- afterCheck () {
- this.$message({
- type: 'success',
- message: '操作成功!'
- })
- this.getList()
- },
- reback () { // 返回
- this.$router.push({name: 'phoneVerification'})
- },
- }
- }
- </script>
-
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style lang="scss" scoped>
- .subPage {
- .userInfo{
- white-space: nowrap;
- font-size: 0;
- >*{
- display: inline-block;
- margin-right: 10px;
- }
- >b{
- font-weight: bolder;
- font-size: 15px;
- margin-right: 30px;
- }
- }
- .list {
- > div {
- margin: 0 20px;
- > div {
- width: 100%;
- position: relative;
- overflow: hidden;
- box-sizing: border-box;
- border: 1px solid #eee;
- border-bottom: none;
- margin-top: 20px;
- }
- }
- }
- .noData{
- width: 100%;
- display: block;
- line-height: 40px;
- font-size: 30px;
- color: #ccc;
- text-align: center;
- margin: 40px auto 0;
- }
- }
- </style>
|