|
|
<template>
|
|
|
<layout-body>
|
|
|
<Form ref="withdraw" :model="data" class="detail" :label-width="100" :rules="ruleValidate">
|
|
|
<Form v-if="showLoading" ref="withdraw" :model="data" class="detail" :label-width="100" :rules="ruleValidate">
|
|
|
<Form-item label="店铺名称">
|
|
|
<span>{{ data.shopName }}</span>
|
|
|
</Form-item>
|
...
|
...
|
@@ -10,21 +10,16 @@ |
|
|
<span class="red">*支付宝每日转账最高限额10万元人民币,单日超过10万人民币限额的,请联系平台客服</span>
|
|
|
</Form-item>
|
|
|
<Form-item label="提现方式">
|
|
|
<span>最大可提现</span><span>{{ formatDate(data.billBeginTime) }}</span>
|
|
|
<span>最大可提现</span><span>{{ beginTimeStr }}</span>
|
|
|
~
|
|
|
<span>{{ formatDate(data.billEndTime) }}</span>
|
|
|
<span>{{ endTimeStr }}</span>
|
|
|
<br />
|
|
|
<span>请选择账单日期</span>
|
|
|
<Date-picker
|
|
|
:value="data.range"
|
|
|
type="datetimerange"
|
|
|
format="yyyy-MM-dd"
|
|
|
placeholder="选择日期时间"
|
|
|
@on-change="clickAvailableDate"
|
|
|
/>
|
|
|
<Date-picker v-model="beginStr" type="date" placeholder="选择日期时间" @on-change="changeBeginStr" />
|
|
|
<Date-picker v-model="endStr" type="date" placeholder="选择日期时间" @on-change="changeEndStr" />
|
|
|
</Form-item>
|
|
|
<Form-item label="提现金额">
|
|
|
<input :value="data.availableAmount" placeholder="请输入..." />
|
|
|
<input v-model="data.withdrawAmount" disabled placeholder="请选择日期时间" />
|
|
|
</Form-item>
|
|
|
<Form-item label="提现到帐号">
|
|
|
<span>{{ data.withdrawAccount }}</span>
|
...
|
...
|
@@ -37,16 +32,16 @@ |
|
|
</Form-item>
|
|
|
<Form-item>
|
|
|
<Button id="btnSubmit" type="primary" size="large" @click="save">确认提现</Button>
|
|
|
<Button type="primary" size="large">联系客服</Button>
|
|
|
<Button id="cancel" type="primary" size="large">联系客服</Button>
|
|
|
<Button id="cancel" type="primary" size="large" @click="backList">取消</Button>
|
|
|
</Form-item>
|
|
|
</Form>
|
|
|
<Spin v-else-if="showLoading" size="large" fix></Spin>
|
|
|
</layout-body>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import _ from 'lodash';
|
|
|
import moment from 'moment';
|
|
|
import crypto from 'util/crypto';
|
|
|
import FinanceService from 'services/finance/finance-service';
|
|
|
import { WithdrawApply } from './store';
|
|
|
|
...
|
...
|
@@ -60,15 +55,26 @@ export default { |
|
|
timestamps: Math.round(new Date().getTime() / 1000),
|
|
|
};
|
|
|
this.financeService = new FinanceService();
|
|
|
this.financeService.shopWithdrawApplyInit(params).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
Object.assign(this.data, result.data);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getInfo();
|
|
|
this.financeService
|
|
|
.shopWithdrawApplyInit(params)
|
|
|
.then(result => {
|
|
|
if (result.code === 200) {
|
|
|
this.data = result.data;
|
|
|
this.beginStr = this.formatDate(result.data.billBeginTime);
|
|
|
this.endStr = this.formatDate(result.data.billEndTime);
|
|
|
this.beginTimeStr = this.formatDate(result.data.billBeginTime);
|
|
|
this.endTimeStr = this.formatDate(result.data.billEndTime);
|
|
|
this.data.beginTime = result.data.billBeginTime;
|
|
|
this.data.endTime = result.data.billEndTime;
|
|
|
this.data.withdrawAmount = result.data.withdrawAmount ? result.data.withdrawAmount : 0;
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$Message.error('请求出错');
|
|
|
this.showLoading = false;
|
|
|
});
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
backList() {
|
|
|
this.$router.push({ name: 'finance.withdraw.withdrawlist' });
|
...
|
...
|
@@ -93,30 +99,36 @@ export default { |
|
|
});
|
|
|
},
|
|
|
beforeSave() {
|
|
|
const newApply = {};
|
|
|
newApply.availableAmount = this.data.availableAmount;
|
|
|
newApply.applyType = this.data.applyType;
|
|
|
newApply.beginTime = this.data.beginTime;
|
|
|
newApply.endTime = this.data.endTime;
|
|
|
newApply.applyAmount = this.data.applyAmount;
|
|
|
newApply.targetAccount = this.data.targetAccount;
|
|
|
newApply.remarks = this.data.remarks;
|
|
|
newApply.timestamp = this.data.timestamp;
|
|
|
newApply.token = this.data.token;
|
|
|
newApply.sign = this.data.sign;
|
|
|
return newApply;
|
|
|
const params = {};
|
|
|
params.shopId = this.$user.currentShop.shopsId;
|
|
|
params.applyPid = this.$user.pid;
|
|
|
params.applyAmount = this.data.withdrawAmount ? this.data.withdrawAmount : 0;
|
|
|
params.applyType = this.apply.applyType;
|
|
|
params.beginTime = this.data.beginTime;
|
|
|
params.endTime = this.data.endTime;
|
|
|
params.applyPhone = this.apply.applyPhone;
|
|
|
params.targetAccount = this.data.withdrawAccount;
|
|
|
params.token = this.$user.token;
|
|
|
params.timestamp = Math.round(new Date().getTime() / 1000);
|
|
|
params.salt = this.apply.salt;
|
|
|
const arrParams = Object.keys(params).map(key => {
|
|
|
return params[key];
|
|
|
});
|
|
|
params.sign = crypto.md5(arrParams.join('|'));
|
|
|
params.account = this.$user.name;
|
|
|
return params;
|
|
|
},
|
|
|
save() {
|
|
|
const newApply = this.beforeSave();
|
|
|
const applyParams = this.beforeSave();
|
|
|
this.$Loading.start();
|
|
|
return this.financeService.shopWithdrawApply(newApply).then(result => {
|
|
|
return this.financeService.shopWithdrawApply(applyParams).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
this.$Loading.finish();
|
|
|
this.$Notice.success({
|
|
|
title: '提交成功',
|
|
|
desc: '确认提现成功!',
|
|
|
});
|
|
|
this.go(this.from);
|
|
|
this.backList();
|
|
|
} else {
|
|
|
this.$Loading.error();
|
|
|
this.$Notice.error({
|
...
|
...
|
@@ -147,38 +159,14 @@ export default { |
|
|
return moment.unix(date).format('YYYY-MM-DD');
|
|
|
}
|
|
|
},
|
|
|
clickAvailableDate(time) {
|
|
|
if (!_.isArray(time)) {
|
|
|
time = time.split(' - ');
|
|
|
}
|
|
|
if ((time[0] + '').length) {
|
|
|
const billBeginStr = moment.unix(this.data.billBeginTime).format('YYYY-MM-DD');
|
|
|
const billEndStr = moment.unix(this.data.billEndTime).format('YYYY-MM-DD');
|
|
|
if (time[0] < billBeginStr || time[1] > billEndStr) {
|
|
|
this.data.beginTime = '';
|
|
|
this.data.endTime = '';
|
|
|
this.$Notice.error({
|
|
|
title: '时间选择错误',
|
|
|
desc: '请选择范围内时间',
|
|
|
});
|
|
|
}
|
|
|
this.data.beginTime = time[0];
|
|
|
this.data.endTime = time[1];
|
|
|
this.getAvailableAmount();
|
|
|
} else {
|
|
|
this.data.beginTime = '';
|
|
|
this.data.endTime = '';
|
|
|
}
|
|
|
},
|
|
|
getAvailableAmount() {
|
|
|
const params = {};
|
|
|
params.beginTime = this.data.beginTime;
|
|
|
params.endTime = this.data.endTime;
|
|
|
params.beginTime = this.beginStr;
|
|
|
params.endTime = this.endStr;
|
|
|
this.financeService.shopGetAvailableAmount(params).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
this.data.availableAmount = result.availableAmount;
|
|
|
this.data.withdrawAmount = result.data.availableAmount;
|
|
|
} else {
|
|
|
this.$Loading.error();
|
|
|
this.$Notice.error({
|
|
|
title: '查询错误',
|
|
|
desc: result.message,
|
...
|
...
|
@@ -186,6 +174,13 @@ export default { |
|
|
}
|
|
|
});
|
|
|
},
|
|
|
changeBeginStr(value) {
|
|
|
this.beginStr = value;
|
|
|
},
|
|
|
changeEndStr(value) {
|
|
|
this.endStr = value;
|
|
|
this.getAvailableAmount();
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
</script>
|
...
|
...
|
|