doum
9 小时以前 b05fea19990632b2ec6320cbfaab2bddc87006c0
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
158
<template>
  <TableLayout :permissions="['business:withdrawrecord:query']">
    <!-- 搜索表单 -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
      <el-form-item label="经销商" prop="shopName">
        <el-input v-model="searchForm.shopName" placeholder="请输入经销商名称" clearable @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="审核状态" prop="status"   >
        <!-- 0正常 1禁用 -->
        <el-select     v-model="searchForm.status"  placeholder="审核状态" style="width: 140px"   @change="search" clearable  >
          <el-option  :key="0" :value="0"  label="待审批"  ></el-option>
          <el-option   :key="1" :value="1" label="已通过"  ></el-option>
          <el-option   :key="2" :value="2" label="已驳回"  ></el-option>
        </el-select>
      </el-form-item>
      <div class="date-style" style="display: inline">
        <el-form-item label="申请时间" prop="starttime" >
          <el-date-picker
              style="width: 180px"
              v-model="searchForm.starttime"
              type="datetime"
              clearable
              value-format="yyyy-MM-dd HH:mm:ss"
              format="yyyy-MM-dd HH:mm:ss"
              range-separator="至"
              placeholder="开始时间"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="-" label-width="10px" prop="endtime" >
          <el-date-picker
              style="width: 180px"
              v-model="searchForm.endtime"
              type="datetime"
              clearable
              value-format="yyyy-MM-dd HH:mm:ss"
              format="yyyy-MM-dd HH:mm:ss"
              range-separator="至"
              placeholder="截止时间"
          ></el-date-picker>
        </el-form-item>
      </div>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </section>
    </el-form>
    <!-- 表格和分页 -->
    <template v-slot:table-wrap>
      <ul class="toolbar" >
        <li>累计提现:<span class="red">¥ {{(totalData.amount||0).toFixed(2)}}</span></li>
      </ul>
      <el-table
        v-loading="isWorking.search"
        :data="tableData.list"
        stripe
        border
        @selection-change="handleSelectionChange"
      >
        <!-- <el-table-column type="selection" width="55"></el-table-column> -->
        <el-table-column prop="shopName" label="经销商名称" fixed align="center" min-width="100px">  </el-table-column>
        <el-table-column prop="shopCode" label="门店ID" align="center" min-width="100px"></el-table-column>
        <el-table-column prop="integral" label="提现金额(元)" align="center" min-width="100px">
          <template slot-scope="{row}">
            <span class="orange">¥{{(row.amount || 0).toFixed(2)}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="收款人" align="center" min-width="100px"></el-table-column>
        <el-table-column prop="bankAccount" label="收款账号" align="center" min-width="150px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="bankName" label="提现银行" align="center" min-width="100px"></el-table-column>
        <el-table-column prop="createDate" label="申请时间" align="center" min-width="140px"></el-table-column>
        <el-table-column prop="status" label="审核状态" align="center" min-width="100px" fixed="right">
          <template slot-scope="{row}">
              <span v-if="row.status==0" class="orange">待审批</span>
              <span v-if="row.status==1" class="green">已通过</span>
              <span v-if="row.status==2" class="red">已驳回</span>
          </template>
        </el-table-column>
        <el-table-column
          v-if="containPermissions(['business:withdrawrecord:update', 'business:withdrawrecord:delete'])"
          label="操作"
          min-width="120"
          fixed="right"
          align="center"
        >
          <template slot-scope="{row}">
            <el-button type="text" @click="$refs.operaWithdrawRecordWindow.open('提现申请详情', row)" v-permissions="['business:withdrawrecord:update']">查看详情</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
        :pagination="tableData.pagination"
      >
      </pagination>
    </template>
    <!-- 新建/修改 -->
    <OperaWithdrawRecordWindow ref="operaWithdrawRecordWindow" @success="handlePageChange"/>
  </TableLayout>
</template>
 
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaWithdrawRecordWindow from '@/components/business/OperaWithdrawRecordWindow'
export default {
  name: 'Shop',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaWithdrawRecordWindow },
  data () {
    return {
      // 搜索
      totalData: {},
      searchForm: {
        shopName: '',
        starttime: '',
        endtime: '',
        status: ''
      }
    }
  },
  created () {
    this.config({
      module: '提现申请信息表',
      api: '/business/withdrawRecord',
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
  },
  methods: {
    handlePageChange (pageIndex) {
      this.tableData.pagination.pageIndex = pageIndex || this.tableData.pagination.pageIndex
      this.isWorking.search = true
      this.api.fetchList({
        page: this.tableData.pagination.pageIndex,
        capacity: this.tableData.pagination.pageSize,
        model: this.searchForm, // 销售模式变更
        sorts: this.tableData.sorts
      })
        .then(data => {
          this.tableData.list = data.records || []
          this.tableData.pagination.total = data.total || 0
          if (this.tableData.pagination.pageIndex === 1) {
            this.totalData = data.countData || {}
          }
        })
        .catch(e => {
          this.$tip.apiFailed(e)
        })
        .finally(() => {
          this.isWorking.search = false
        })
    }
  }
}
</script>