quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<template>
  <!--
      作者:年卡订单管理
      时间:2025-11-21
      描述:供应商-年卡管理-订单管理
  -->
  <div class="supplier">
    <!--搜索表单-->
    <div class="common-seach-wrap">
      <el-form size="small" :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="订单号">
          <el-input v-model="formInline.order_no" placeholder="请输入订单号"></el-input>
        </el-form-item>
        <el-form-item label="支付状态">
          <el-select v-model="formInline.pay_status" placeholder="请选择">
            <el-option label="全部" :value="-1"></el-option>
            <el-option label="待支付" :value="10"></el-option>
            <el-option label="已支付" :value="20"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <!--内容-->
    <div class="product-content">
      <div class="table-wrap">
        <el-table size="small" :data="tableData" border style="width: 100%" v-loading="loading">
          <el-table-column prop="order_id" label="ID"></el-table-column>
          <el-table-column prop="order_no" label="订单号"></el-table-column>
          <el-table-column prop="supplier.name" label="供应商"></el-table-column>
          <el-table-column prop="plan_name" label="套餐名称"></el-table-column>
          <el-table-column prop="price" label="价格(元)"></el-table-column>
          <el-table-column label="支付状态">
            <template slot-scope="scope">
              <el-tag v-if="scope.row.pay_status == 10">待支付</el-tag>
              <el-tag v-else type="success">已支付</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="pay_time" label="支付时间"></el-table-column>
          <el-table-column prop="create_time" label="创建时间"></el-table-column>
          <el-table-column fixed="right" label="操作" width="120">
            <template slot-scope="scope">
              <el-button v-if="scope.row.pay_status == 10" @click="activateClick(scope.row)" type="text" size="small" 
                v-auth="'/supplier/member/order/activate'">激活年卡</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <!--分页-->
      <div class="pagination">
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" background
          :current-page="curPage" :page-size="pageSize" layout="total, prev, pager, next, jumper"
          :total="totalDataNumber">
        </el-pagination>
      </div>
    </div>
  </div>
</template>
 
<script>
import MemberApi from '@/api/supplier/member.js';
export default {
  data() {
    return {
      formInline: {
        order_no: '',
        pay_status: -1
      },
      /*是否加载完成*/
      loading: true,
      /*当前是第几页*/
      curPage: 1,
      /*一页多少条*/
      pageSize: 15,
      /*一共多少条*/
      totalDataNumber: 0,
      /*表格数据*/
      tableData: []
    };
  },
  created() {
    this.getTableList();
  },
  methods: {
    /*获取列表*/
    getTableList() {
      let self = this;
      self.loading = true;
      let params = {
        page: self.curPage,
        order_no: self.formInline.order_no,
        pay_status: self.formInline.pay_status
      };
      MemberApi.orders(params, true)
        .then(data => {
          self.loading = false;
          self.tableData = data.data.list.data;
          self.totalDataNumber = data.data.list.total;
        })
        .catch(error => {
          self.loading = false;
        });
    },
    /*搜索*/
    onSubmit() {
      this.curPage = 1;
      this.getTableList();
    },
    /*分页大小*/
    handleSizeChange(val) {
      this.pageSize = val;
      this.getTableList();
    },
    /*分页切换*/
    handleCurrentChange(val) {
      this.curPage = val;
      this.getTableList();
    },
    /*激活年卡*/
    activateClick(row) {
      let self = this;
      self.$confirm('确认要手动激活该年卡订单吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        self.loading = true;
        MemberApi.activate({
          order_id: row.order_id
        }, true)
          .then(data => {
            self.loading = false;
            if (data.code == 1) {
              self.$message({
                message: '年卡激活成功',
                type: 'success'
              });
              self.getTableList();
            } else {
              self.$message.error(data.msg);
            }
          })
          .catch(error => {
            self.loading = false;
          });
 
      }).catch(() => {
 
      });
    }
  }
};
</script>
 
<style></style>