ll
liukangdong
2025-02-18 031d0f428f58b008f7a59476fcf3e6ba86d10048
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
<template>
  <div class="main_app">
    <Breadcrumb />
    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
    <div class="table_btns">
      <el-button type="primary" @click="handleEx()">导出</el-button>
    </div>
    <el-table v-loading="loading" :data="list" stripe border>
      <el-table-column prop="code" align="center" label="订单编号" min-width="140" show-overflow-tooltip>
        <template scope="{row}">
          <span class="primaryColor pointer">{{ row.orderId }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="" align="center" label="套餐卡" min-width="120" show-overflow-tooltip />
      <el-table-column prop="" align="center" label="合计(元)" min-width="80" show-overflow-tooltip />
      <el-table-column prop="" align="center" label="实付(元)" min-width="80" show-overflow-tooltip />
      <el-table-column prop="" align="center" label="已退金额(元)" min-width="100" show-overflow-tooltip />
      <el-table-column prop="" align="center" label="用户信息" min-width="120" show-overflow-tooltip />
      <el-table-column prop="" align="center" label="订单状态" min-width="110" show-overflow-tooltip />
      <el-table-column label="操作" fixed="right" align="center" min-width="80" show-overflow-tooltip>
        <template v-slot="{ row }">
          <span @click="handleDetail(row.id)" v-permissions="['business:ywoutinboundrecord:query']"
            class="primaryColor pointer">查看详情</span>
        </template>
      </el-table-column>
    </el-table>
    <div class="table_btns">
      <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
    </div>
    <!--  -->
    <OrderDetail v-if="isShowDetail" ref="OrderDetailRef" />
  </div>
</template>
 
<script>
import BasePageTemp from '@/components/base/BasePageTemp'
import Breadcrumb from '@/layouts/Breadcrumb'
import OrderDetail from './components/OrderDetail.vue'
export default {
  extends: BasePageTemp,
  components: {
    Breadcrumb,
    OrderDetail
  },
  data() {
    return {
      loading: false,
      isShowDetail: false,
      queryFormConfig: {
        formItems: [
          {
            filed: 'orderId',
            type: 'input',
            label: '订单编号',
          },
          {
            filed: 'name',
            type: 'input',
            label: '套餐卡',
            placeholder: '请输入卡名称',
          },
          {
            filed: 'pay',
            type: 'select',
            label: '支付方式',
            options: []
          },
          {
            filed: 'status',
            type: 'select',
            label: '订单状态',
            options: []
          },
          {
            filed: 'time',
            type: 'date',
            label: '支付时间',
          },
          {
            filed: 'username',
            type: 'input',
            label: '用户信息',
          },
        ],
        online: true
      }
    }
  },
  created() {
    // this.getList()
    // this.initData()
  },
  methods: {
    handleDetail(id) {
      getDetail(id)
        .then(res => {
          this.$refs.OrderDetailRef.open('订单详情', res)
        })
        .catch(err => {
          this.$tip.apiFailed(err)
        })
    },
    handleEx() {
      this.$dialog.exportConfirm('确认导出吗?')
        .then(() => {
          this.loading = true
          ywOutinboundEx({
            page: this.pagination.page,
            capacity: 1000000,
            model: this.filters
          })
            .then(response => {
              this.download(response)
            })
            .catch(e => {
              this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.loading = false
            })
        })
        .catch(() => { })
    },
    initData() {
      getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => {
        this.queryFormConfig.formItems[1].options = res.records || []
      })
    },
    getList(page) {
      const { pagination, filters } = this
      this.loading = true
      if (page) { pagination.page = page }
      ywOutinboundPage({
        model: {
          ...filters,
          inOut: 0
        },
        // sorts: [{ direction: 'DESC', property: 'param1' }],
        capacity: pagination.pageSize,
        page: page,
      }).then(res => {
        this.loading = false
        this.list = res.records || []
        this.list.forEach(item => {
          item.typeName = this.StoreTypeOps[item.type].name
        })
        this.pagination.total = res.total || 0
      }, () => {
        this.loading = false
      })
    },
  }
}
</script>
 
<style></style>