提交 2044e9e8 authored 作者: 郑伟娜's avatar 郑伟娜

联调接口

上级 0d656e3a
...@@ -16,3 +16,50 @@ export const bondDetail = (params) => { ...@@ -16,3 +16,50 @@ export const bondDetail = (params) => {
params params
}) })
} }
// 充值保证金
export const addBond = (data) => {
return request({
url: '/system/addBond',
method: 'post',
data
})
}
// 保证金额度说明
export const bondByCate = (params) => {
return request({
url: '/local/getBondByCate',
method: 'get',
params
})
}
// 账户/列表
export const accountList = (data) => {
return request({
url: '/system/bank/account/list',
method: 'post',
data
})
}
// 申请退保
export const bondApply = (data) => {
return request({
url: '/local/bondApply',
method: 'post',
data
})
}
// 获取支付账户
export const payDetails = (params) => {
return request({
url: '/system/payDetails',
method: 'get',
params
})
}
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</div> </div>
</div> </div>
<div style="text-align: center; margin-top: 50px; width: 100%;"> <div style="text-align: center; margin-top: 50px; width: 100%;">
<el-button type="primary" size="mini" style="width: 80px;" @click="payDialog = true" :disabled="bond == cate_bond">充值</el-button> <el-button type="primary" size="mini" style="width: 80px;" @click="payDialog = true" :disabled="bond == cate_bond || !isShowPay">充值</el-button>
<el-button size="mini" style="width: 80px;" @click="cancellationDialog = true" :disabled="bond == 0">申请退保</el-button> <el-button size="mini" style="width: 80px;" @click="cancellationDialog = true" :disabled="bond == 0">申请退保</el-button>
</div> </div>
</div> </div>
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
center center
:close-on-click-modal="false" :close-on-click-modal="false"
append-to-body append-to-body
@close="initData"
> >
<div> <div>
<div class="header" style="text-align: center; font-size: 12px; line-height: 20px;"> <div class="header" style="text-align: center; font-size: 12px; line-height: 20px;">
...@@ -124,21 +125,21 @@ ...@@ -124,21 +125,21 @@
</div> </div>
<el-form ref="payForm" :model="payForm" label-width="110px" style="margin-top: 20px;"> <el-form ref="payForm" :model="payForm" label-width="110px" style="margin-top: 20px;">
<el-form-item label="应缴纳额度:"> <el-form-item label="应缴纳额度:">
<el-input v-model="payForm.name" :disabled="true"></el-input> <el-input v-model="payForm.money" :disabled="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="缴纳方式:"> <el-form-item label="缴纳方式:">
<el-radio v-model="payRadio" label="1">线下转账</el-radio> <el-radio v-model="payRadio" label="1" v-if="isShowPay1">线下转账</el-radio>
<el-radio v-model="payRadio" label="2">支付宝</el-radio> <el-radio v-model="payRadio" label="2" v-if="isShowPay2">支付宝</el-radio>
</el-form-item> </el-form-item>
<div v-if="payRadio == 1"> <div v-if="payRadio == 1">
<el-form-item label="开户名称:"> <el-form-item label="开户名称:">
<el-input v-model="payForm.name" placeholder="北京胜天半子科技有限公司" :disabled="true"></el-input> <el-input v-model="payForm.name" placeholder="北京胜天半子科技有限公司" :disabled="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="开户银行:"> <el-form-item label="开户银行:">
<el-input v-model="payForm.name" placeholder="招商银行北京分行丰台科技园支行" :disabled="true"></el-input> <el-input v-model="payForm.bank" placeholder="招商银行北京分行丰台科技园支行" :disabled="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="银行账号:"> <el-form-item label="银行账号:">
<el-input v-model="payForm.name" placeholder="110945259110901" :disabled="true"></el-input> <el-input v-model="payForm.bankNum" placeholder="110945259110901" :disabled="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="汇款凭证:"> <el-form-item label="汇款凭证:">
<el-upload <el-upload
...@@ -159,7 +160,7 @@ ...@@ -159,7 +160,7 @@
<span>最多上传2张,支持png/jpg,大小不超过500KB</span> <span>最多上传2张,支持png/jpg,大小不超过500KB</span>
</el-form-item> </el-form-item>
<el-form-item label="汇款公户名称:"> <el-form-item label="汇款公户名称:">
<el-input v-model="payForm.name" placeholder=" 请输入您汇款的账户名称"></el-input> <el-input v-model="payForm.account" placeholder=" 请输入您汇款的账户名称"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div v-if="payRadio == 2"> <div v-if="payRadio == 2">
...@@ -172,8 +173,8 @@ ...@@ -172,8 +173,8 @@
</div> </div>
</el-form> </el-form>
<div style="text-align: right;"> <div style="text-align: right;">
<el-button type="primary" @click="onSubmit" v-if="payRadio == 1">提交</el-button> <el-button type="primary" @click="onSubmit(1)" v-if="payRadio == 1">提交</el-button>
<el-button type="primary" @click="onSubmit" v-if="payRadio == 2">立即付款</el-button> <el-button type="primary" @click="onSubmit(2)" v-if="payRadio == 2">立即付款</el-button>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
...@@ -187,7 +188,7 @@ ...@@ -187,7 +188,7 @@
center center
:close-on-click-modal="false" :close-on-click-modal="false"
append-to-body append-to-body
@close="isSubmit = false" @close="cancellationinitData"
> >
<div v-if="!isSubmit"> <div v-if="!isSubmit">
<div class="header" style="text-align: center; font-size: 12px; line-height: 20px;"> <div class="header" style="text-align: center; font-size: 12px; line-height: 20px;">
...@@ -196,17 +197,20 @@ ...@@ -196,17 +197,20 @@
</div> </div>
<el-form ref="cancellationForm" :model="cancellationForm" label-width="110px" style="margin-top: 20px;"> <el-form ref="cancellationForm" :model="cancellationForm" label-width="110px" style="margin-top: 20px;">
<el-form-item label="退保金额:"> <el-form-item label="退保金额:">
<el-input v-model="cancellationForm.name" :disabled="true"></el-input> <el-input v-model="cancellationForm.money" :disabled="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="退保至:"> <el-form-item label="退保至:">
<el-select v-model="cancellationForm.account" placeholder="请选择退保的账户" style="width: 100%;"> <el-select v-model="cancellationForm.account" placeholder="请选择退保的账户" style="width: 100%;">
<el-option :label="item.label" :value="item.value" v-for="item in option" :key="item.value"/> <el-option :label="item.bank_name" :value="item.id" v-for="item in optionAcount" :key="item.id"/>
</el-select> </el-select>
<div style="font-size: 12px; color: #FF4D4F;">选择您的提现账户,如果没有请在【资产】页面当中添加</div> <div style="font-size: 12px; color: #FF4D4F;">选择您的提现账户,如果没有请在【资产】页面当中添加</div>
</el-form-item> </el-form-item>
<el-form-item label="短信验证码:"> <el-form-item label="短信验证码:">
<el-input v-model="cancellationForm.name" style="width: 70%;" placeholder="请输入手机158****2563的验证码"></el-input> <el-input v-model="cancellationForm.code" style="width: 70%;" :placeholder="`请输入手机${getTel(emergency_tel)}的验证码`"></el-input>
<el-button @click="getCode">获取短信验证码</el-button> <el-button @click="getCode" v-if="isAccountCode">获取短信验证码</el-button>
<el-button style="width: 109px" :disabled="true" v-if="!isAccountCode">倒计时 {{ accountCountDown }}
S
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right;"> <div style="text-align: right;">
...@@ -256,11 +260,11 @@ ...@@ -256,11 +260,11 @@
:close-on-click-modal="false" :close-on-click-modal="false"
append-to-body append-to-body
> >
<div> <div style="height: 500px; overflow-y: auto;">
<el-table <el-table
:data="[]" :data="bondByCateList"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%; margin-top: 10px;" style="width: 100%;"
> >
<el-table-column <el-table-column
align="center" align="center"
...@@ -275,7 +279,7 @@ ...@@ -275,7 +279,7 @@
label="一级类目" label="一级类目"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.receipt_media}} {{ scope.row.cate_name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -283,7 +287,7 @@ ...@@ -283,7 +287,7 @@
label="保证金额度(元)" label="保证金额度(元)"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.month}} {{ getFixed(scope.row.bond) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -292,7 +296,7 @@ ...@@ -292,7 +296,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
{{scope.row.created_time}} 采取就高原则,取类目保证金最大值
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -310,8 +314,9 @@ ...@@ -310,8 +314,9 @@
</template> </template>
<script> <script>
import { upLoadImg } from '@/api/module/entry'; import { UploadImg } from '@/api/module/goods'
import { shopInfo, bondDetail } from '@/api/securityFund'; import { shopInfo, bondDetail, addBond, bondByCate, accountList, bondApply, payDetails } from '@/api/securityFund';
import { getTelphoneCode } from '@/api/module/settings'
export default { export default {
data() { data() {
...@@ -326,8 +331,18 @@ ...@@ -326,8 +331,18 @@
ruleDialog: false, ruleDialog: false,
limitDialog: false, limitDialog: false,
payDialog: false, payDialog: false,
payForm: {}, payForm: {
cancellationForm: {}, money: '',
name: '北京胜天半子科技有限公司',
bank: '招商银行北京分行丰台科技园支行',
bankNum: '110945259110901',
account: ''
},
cancellationForm: {
money: '',
account: '',
code: ''
},
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
total: 0, total: 0,
...@@ -335,14 +350,23 @@ ...@@ -335,14 +350,23 @@
ruleFormdialogLogo: [], // 汇款凭证 ruleFormdialogLogo: [], // 汇款凭证
dialogVisibleLogo: false, dialogVisibleLogo: false,
dialogImageLogo: '', dialogImageLogo: '',
option: [ optionAcount: [],
{label: '工商银行', value: '1'} bondByCateList: [],
] seller_id: '',
emergency_tel: '',
isAccountCode: true,
timer: null,
accountCountDown: 60,
isShowPay1: true,
isShowPay2: true,
isShowPay: true
} }
}, },
mounted() { mounted() {
this.getShopInfo() this.getShopInfo()
this.getBondDetail() this.getBondDetail()
this.getbondByCate()
this.getPayDetails()
}, },
methods: { methods: {
// 处理金额 // 处理金额
...@@ -353,6 +377,59 @@ ...@@ -353,6 +377,59 @@
} }
return data return data
}, },
getTel(val) {
let tel = ''
tel = val.substring(0, 3) + '****' + val.substring(7, val.length)
return tel
},
// 获取支付账户
getPayDetails() {
payDetails().then(res => {
if (res.code == 1) {
if (res.data) {
// 线下转账-是否开启 0关闭 1开启
if (res.data.BankSettings.is_bank_open) {
this.isShowPay1 = true
} else {
this.isShowPay1 = false
this.payRadio = '2'
}
// 支付宝--是否开启 0关闭 1开启
if (res.data.AlipaySettings.is_alipay_open) {
this.isShowPay2 = true
} else {
this.isShowPay2 = false
this.payRadio = '1'
}
} else { // 没有设置支付账户
this.isShowPay = false
}
}
})
},
// 获取账户列表
getAccountList() {
let params = {
page: 1,
limit: 100,
seller_id: this.seller_id
}
accountList(params).then(res => {
if (res.code == 1) {
this.optionAcount = res.data.data
}
})
},
// 保证金额度说明
getbondByCate() {
bondByCate().then(res => {
if (res.code == 1) {
this.bondByCateList = res.data
}
})
},
// 获取店铺信息 // 获取店铺信息
getShopInfo() { getShopInfo() {
shopInfo().then(res => { shopInfo().then(res => {
...@@ -361,6 +438,13 @@ ...@@ -361,6 +438,13 @@
this.frozen_bond = res.data.frozen_bond || 0 this.frozen_bond = res.data.frozen_bond || 0
this.cate_bond = res.data.cate_bond || 0 this.cate_bond = res.data.cate_bond || 0
this.isPay = res.data.is_take_bond == 0 ? true : false // 是否需要缴纳保证金 0否 1是 this.isPay = res.data.is_take_bond == 0 ? true : false // 是否需要缴纳保证金 0否 1是
this.seller_id = res.data.seller_id
this.emergency_tel = res.data.emergency_tel
this.cancellationForm.money = this.getFixed(this.bond)
this.payForm.money = this.getFixed(this.cate_bond - this.bond)
this.getAccountList()
} }
}) })
}, },
...@@ -377,17 +461,159 @@ ...@@ -377,17 +461,159 @@
} }
}) })
}, },
initData() {
this.ruleFormdialogLogo = []
this.payForm.account = ''
},
// 充值保证金
getAddBond(type) {
let params
if (type == 1) {
params = {
recharge_type: 1,
voucher: this.ruleFormdialogLogo || undefined,
remitting_public_account: this.payForm.account || undefined
}
} else {
params = {
recharge_type: 2
}
}
addBond(params).then(res => {
if (res.code == 1) {
if (type == 1) {
this.$message({
type: 'warning',
message: '提交成功'
})
} else {
// 支付宝支付
window.open(res.data.pay_url,'_blank')
this.$confirm('请在支付宝充值页面进行充值。充值完成后,请回到此页面,根据您的情况,点击下方的按钮','充值',{
confirmButtonText: '充值成功',
cancelButtonText: '充值失败',
type: 'warning'
}).then(async()=> {
// this.isKnow = false
// this.activeAliPay = true
// let payResult = await AlipayGet({sn: res.data.orderSn});
// if(payResult.code === 1) {
// if (payResult.message == '支付成功') this.$message({type: 'success',message: '充值成功!'});
// if (payResult.message == '支付失败') this.$message({type: 'error',message: payResult.message});
// // 如果充值成功,则需要初始化数据
// this.rechargeForm.aliPayAmount = 1000
// this.getIncome()
// }
}).catch((err)=> {});
}
this.payDialog = false
this.getShopInfo()
} else {
this.$message({
type: 'error',
message: res.message
})
}
})
},
// 提交凭证 // 提交凭证
onSubmit() { onSubmit(type) {
this.payDialog = false if (type == 1) {
if (!this.ruleFormdialogLogo.length) {
this.$message({
type: 'warning',
message: '请上传汇款凭证'
})
return
}
if (!this.payForm.account) {
this.$message({
type: 'warning',
message: '请输入汇款的账户名称'
})
return
}
this.getAddBond(1)
} else {
this.getAddBond(2)
}
}, },
// 获取短信验证码 // 获取短信验证码
getCode() { getCode() {
const TIME_COUNT = 60;
if (!this.timer) {
this.accountCountDown = TIME_COUNT;
this.isAccountCode = false;
this.timer = setInterval(() => {
if (this.accountCountDown > 0 && this.accountCountDown <= TIME_COUNT) {
this.accountCountDown--;
} else {
this.isAccountCode = true;
clearInterval(this.timer);
this.timer = null;
}
}, 1000)
}
// 获取验证码
getTelphoneCode(this.emergency_tel).then(res => {
if(res.code == 1) {
this.$message({type:"success",message: '验证码发送成功'})
}else {
this.$message({type:"error",message: '验证码发送失败'})
}
});
},
// 清空申请退保数据
cancellationinitData() {
this.cancellationForm.account = ''
this.cancellationForm.code = ''
if (this.isSubmit) {
this.isSubmit = false
this.getShopInfo()
}
}, },
// 申请退保 // 申请退保
submitCancellation() { submitCancellation() {
this.isSubmit = true if (!this.cancellationForm.account) {
this.$message({
type: 'warning',
message: '请选择退保的账户'
})
return
}
if (!this.cancellationForm.code) {
this.$message({
type: 'warning',
message: '请输入短信验证码'
})
return
}
let params = {
money: this.cancellationForm.money,
bank_id: this.cancellationForm.account,
code: this.cancellationForm.code
}
bondApply(params).then(res => {
if (res.code == 1) {
this.$message({
type: 'warning',
message: '提交成功'
})
this.isSubmit = true
} else {
this.$message({
type: 'error',
message: res.message
})
}
})
}, },
// 商品主图 数量限制 // 商品主图 数量限制
limitCount1(files, fileList) { limitCount1(files, fileList) {
...@@ -451,10 +677,10 @@ ...@@ -451,10 +677,10 @@
this.getBase64(param.file).then((res) => { this.getBase64(param.file).then((res) => {
let result = res.split(","); let result = res.split(",");
this.Base64img = result[1]; this.Base64img = result[1];
let data = {"image": this.Base64img} let data = {"img_data": this.Base64img}
upLoadImg(data).then(res => { UploadImg(data).then(res => {
if (res && res.code == 1) { if (res && res.code == 1) {
this.ruleFormdialogLogo.push({'url': res.data.imageUrl}) this.ruleFormdialogLogo.push({'url': res.data.image_url})
this.$message({message: '上传成功', type: 'success'}); this.$message({message: '上传成功', type: 'success'});
} else { } else {
this.ruleFormdialogLogo = []; this.ruleFormdialogLogo = [];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论