This commit is contained in:
zkthink
2020-07-02 02:11:34 +08:00
parent 15c7b64f52
commit 107232d78a
26 changed files with 4811 additions and 27 deletions
+135
View File
@@ -0,0 +1,135 @@
<template>
<el-dialog
:title="dialogData.title"
:visible.sync="dialogData.isVisible"
width="45%"
>
<ul>
<li v-for="(item,index) in dataList" :key="index">
<span>{{ item.name }}</span>
<span>{{ index === 5 ? moneyUnit(item.value) : item.value }}</span>
</li>
<li v-if="!dialogData.type">
<span>处理时间:</span>
<span>{{ info.auditTime }}</span>
</li>
</ul>
<p v-if="dialogData.cash&&!dialogData.cash.auditStatus&&dialogData.type" class="tips">* 请确认您已转账成功,再点击确认</p>
<p
slot="footer"
class="dialog-footer"
>
<el-button
v-if="dialogData.cash&&!dialogData.cash.auditStatus&&dialogData.type"
type="primary"
@click="confirm()"
>
{{ dialogData.confirm || '确定' }}
</el-button>
<el-button @click="cancel()">
{{ dialogData.cancel || '取消' }}
</el-button>
</p>
</el-dialog>
</template>
<script>
import Cash from '@/api/Cash'
export default {
props: {
dialogData: {
type: Object,
default: () => {
}
}
},
data() {
return {
dataList: [
{ name: '店铺名称:', value: '', field: 'storeName' },
{ name: '店铺编码:', value: '', field: 'tenant' },
{ name: '银行名称:', value: '', field: 'bank' },
{ name: '银行卡号:', value: '', field: 'cardNumber' },
{ name: '收款人姓名:', value: '', field: 'cardholderName' },
{ name: '提现金额:', value: '', field: 'amount' },
{ name: '申请时间:', value: '', field: 'applyTime' }
],
params: {
id: '',
tenant: ''
},
info: {}
}
},
methods: {
async getDetail(id) {
const res = await Cash.getDetail( id )
const resData = res.data
if (resData.code === 0) {
const d = resData.data
this.info = d
this.dataList.map(item => {
item.value = d[item.field]
})
Object.keys(this.params).map(item => {
this.params[item] = d[item]
})
}
},
moneyUnit(v) {
return v ? (v / 100).toFixed(2) : 0
},
confirm() {
Cash.audiCash(this.params).then(() => {
this.$message({
message: '处理成功',
type: 'success'
})
this.close()
})
},
cancel() {
this.close()
},
close() {
this.$emit('closed', false)
}
}
}
</script>
<style scoped lang='less'>
.dialog-footer {
text-align: center;
.el-button {
padding: 15px 30px;
&:nth-child(1) {
margin-right: 40px;
}
}
}
ul {
list-style: none;
overflow: hidden;
margin: 0;
li {
width: 50%;
float: left;
height: 50px;
line-height: 50px;
color: #000;
span {
display: inline-block;
&:nth-child(1) {
margin-right: 10px;
}
}
}
}
.tips {
text-align: center;
color: red;
}
</style>
+235
View File
@@ -0,0 +1,235 @@
<template>
<div class="cash-page">
<div class="toolbar">
<el-form
:inline="true"
:model="formParams"
>
<el-form-item label="店铺名称">
<el-input
v-model="formParams.model.storeName"
size="mini"
/>
</el-form-item>
<el-form-item label="店铺编码">
<el-input
v-model="formParams.model.tenant"
size="mini"
/>
</el-form-item>
<el-form-item label="提现日期">
<el-date-picker
v-model="formParams.model.applyTimeString"
size="mini"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label="处理状态">
<el-select
v-model="formParams.model.auditStatus"
size="mini"
>
<el-option
v-for="(item, index) in auditStatus"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
size="mini"
@click="query"
>
查询
</el-button>
<el-button
plain
size="mini"
@click="reset"
>
重置
</el-button>
</el-form-item>
</el-form>
</div>
<div class="content">
<div class="content_table">
<el-table
:data="tableData.records"
style="width: 100%"
>
<el-table-column
prop="storeName"
label="店铺名称"
/>
<el-table-column
prop="tenant"
label="店铺编码"
/>
<el-table-column
prop="amount"
:formatter="getMoneyUnit"
label="提现金额"
/>
<el-table-column
prop="auditStatus"
label="处理状态"
:formatter="getAuditStatus"
/>
<el-table-column label="操作">
<template
slot-scope="scope"
>
<el-button
type="text"
size="small"
@click.native.prevent="look(scope.row)"
>
查看
</el-button>
<el-button
v-if="scope.row.auditStatus === 0"
type="text"
size="small"
@click.native.prevent="handle(scope.row)"
>
处理
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="tableData.total > 0"
:limit.sync="formParams.size"
:page.sync="formParams.current"
:total="Number(tableData.total)"
@pagination="fetch"
/>
</div>
<cashDetails ref="dialog" :dialog-data="dialogData" @closed="closed" />
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import Cash from '@/api/Cash'
import cashDetails from './details'
export default {
components: {
Pagination,
cashDetails
},
data() {
return {
formParams: {
model: {
storeName: '',
tenant: '',
applyTimeString: '',
auditStatus: ''
},
size: 10,
current: 1
},
auditStatus: [
{ label: '全部', value: '' },
{ label: '待处理', value: 0 },
{ label: '已处理', value: 1 }
],
tableData: {},
dialogData: {}
}
},
created() {
this.getCashList()
},
methods: {
async getCashList() {
const res = await Cash.getCashList(this.formParams)
const resData = res.data
if (resData.code === 0) {
this.tableData = resData.data
}
},
getAuditStatus(row, column, cellValue) {
let t = ''
this.auditStatus.map(item => {
if (item.value === cellValue) {
t = item.label
}
})
return t
},
getMoneyUnit(row, column, cellValue) {
return this.MoneyUnit(cellValue)
},
MoneyUnit (d) {
let v = 0
if (!d) return v
v = (d / 100).toFixed(2)
return v
},
query() {
this.getCashList()
},
reset() {
this.formParams = {
model: {
storeName: '',
tenant: '',
applyTimeString: '',
auditStatus: ''
},
size: 10,
current: 1
}
},
look(d) {
this.$refs.dialog.getDetail(d.id)
this.dialogData = {
title: '查看',
isVisible: true,
cash: d,
cancel: '关闭',
type: 0
}
},
handle(d) {
this.$refs.dialog.getDetail(d.id)
this.dialogData = {
title: '提现',
isVisible: true,
cash: d,
confirm: '确认打款',
cancel: '取消',
type: 1
}
},
fetch() {
this.getCashList()
},
closed(v) {
this.getCashList()
this.dialogData.isVisible = v
}
}
}
</script>
<style lang="less" scoped>
.cash-page {
padding: 15px 20px;
.toolbar {
margin-bottom: 25px;
.product-name {
width: 180px;
}
}
}
</style>