Authored by jiran.zhao

申请提现

... ... @@ -3,6 +3,7 @@ export default function() {
form: '',
showLoading: true,
data: {
withdrawAmount: 0,
applyType: 0,
},
beginStr: '',
... ... @@ -19,7 +20,7 @@ export default function() {
applyType: 0,
beginTime: '',
endTime: '',
applyPhone: '',
// applyPhone: '',
targetAccount: '',
token: '',
timestamp: '',
... ...
... ... @@ -20,18 +20,18 @@
type="date"
format="yyyy-MM-dd"
placeholder="选择日期时间"
@on-change="changeTimeStr"
@on-change="changeBeginStr"
/>
<Date-picker
v-model="endStr"
type="date"
format="yyyy-MM-dd"
placeholder="选择日期时间"
@on-change="changeTimeStr"
@on-change="changeEndStr"
/>
</Form-item>
<Form-item label="提现金额">
<input :value="data.withdrawAmount" placeholder="请输入..." />
<input v-model="data.withdrawAmount" />
</Form-item>
<Form-item label="提现到帐号">
<span>{{ data.withdrawAccount }}</span>
... ... @@ -60,11 +60,6 @@ export default {
data() {
return WithdrawApply.call(this);
},
// watch: {
// beginTimeStr() {
// this.getAvailableAmount();
// },
// },
created() {
const params = {
token: this.$user.token,
... ... @@ -114,27 +109,29 @@ export default {
});
},
beforeSave() {
this.apply.shopId = this.$user.currentShop.shopsId;
this.apply.applyPid = this.$user.pid;
this.apply.applyAmount = this.data.withdrawAmount;
this.apply.applyType = this.data.applyType;
this.apply.beginTime = this.data.beginTime;
this.apply.endTime = this.data.endTime;
this.apply.applyPhone = this.data.accountPhone;
this.apply.targetAccount = this.data.withdrawAccount;
this.apply.token = this.$user.token;
this.apply.timestamp = Math.round(new Date().getTime() / 1000);
const params = this.apply;
const params = {};
params.shopId = this.$user.currentShop.shopsId;
params.applyPid = this.$user.pid;
params.applyAmount = this.data.withdrawAmount;
params.applyType = this.apply.applyType;
params.beginTime = this.data.beginTime;
params.endTime = this.data.endTime;
// params.applyPhone = this.data.accountPhone;
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 this.apply[key];
return params[key];
});
this.apply.sign = crypto.md5(arrParams.join('|'));
this.apply.account = this.$user.name;
params.sign = crypto.md5(arrParams.join('|'));
params.account = this.$user.name;
return params;
},
save() {
this.beforeSave();
const applyParams = this.beforeSave();
this.$Loading.start();
return this.financeService.shopWithdrawApply(this.apply).then(result => {
return this.financeService.shopWithdrawApply(applyParams).then(result => {
if (result.code === 200) {
this.$Loading.finish();
this.$Notice.success({
... ... @@ -178,7 +175,7 @@ export default {
params.endTime = this.endStr;
this.financeService.shopGetAvailableAmount(params).then(result => {
if (result.code === 200) {
this.data.withdrawAmount = result.data.availableAmount;
this.data.withdrawAmount = (result.data.availableAmount || 0) + '';
} else {
this.$Notice.error({
title: '查询错误',
... ... @@ -187,7 +184,14 @@ export default {
}
});
},
changeTimeStr() {},
changeBeginStr(newVal) {
this.beginStr = newVal;
this.getAvailableAmount();
},
changeEndStr(newVal) {
this.endStr = newVal;
this.getAvailableAmount();
},
},
};
</script>
... ...