添加初始额度设置

zqqdev
liushaodong 5 years ago
parent 4eece51ee0
commit 135d24eaff
  1. 33
      src/api/server.js
  2. 9
      src/common/js/route-list.js
  3. 228
      src/views/system/wallet-init.vue

@ -301,6 +301,11 @@ export const Login = new (class {
export const SysConf = new (class {
constructor() {
//钱包初始额度
this.insertWalletInitApi = sysconfApi + "/walletInit/insert"; //新增
this.updWalletInitApi = sysconfApi + "/walletInit/update"; //修改
this.delWalletInitApi = sysconfApi + "/walletInit/delete"; //删除
this.getWalletInitListApi = sysconfApi + "/walletInit/list"; //列表
//版本
this.insertVersionApi = sysconfApi + "/version/add"; //新增版本
this.updVersionApi = sysconfApi + "/version/edit"; //修改版本
@ -370,6 +375,33 @@ export const SysConf = new (class {
this.deleteReportApi = sysconfApi + "/projectCenterReport/remove"; //删除
}
//钱包初始额度
insertWalletInit(params) {
return axios
.post(this.insertWalletInitApi, qs.stringify(params))
.then(res => res.data);
}
updWalletInit(params) {
return axios
.post(this.updWalletInitApi, qs.stringify(params))
.then(res => res.data);
}
delWalletInit(params) {
return axios
.post(this.delWalletInitApi, qs.stringify(params))
.then(res => res.data);
}
getWalletInitList(params) {
return axios
.get(this.getWalletInitListApi, {
params: params
})
.then(res => res.data);
}
//服务协议
insertAgreement(params) {
return axios
@ -397,6 +429,7 @@ export const SysConf = new (class {
.then(res => res.data);
}
//版本
insertVersion(params) {
return axios

@ -97,6 +97,7 @@ const Version = resolve => require(['@/views/system/version.vue'], resolve)
const SystemApi = resolve => require(['@/views/system/system-api.vue'], resolve)
const SystemImage = resolve => require(['@/views/system/system-image.vue'], resolve)
const SystemNotice = resolve => require(['@/views/system/system-notice.vue'], resolve)
const WalletInit = resolve => require(['@/views/system/wallet-init.vue'], resolve)
const ContactUs = resolve => require(['@/views/system/contact-us.vue'], resolve)
const ConfNews = resolve => require(['@/views/system/conf-news.vue'], resolve)
const TradeNews = resolve => require(['@/views/system/trade-news.vue'], resolve)
@ -1007,6 +1008,14 @@ export default {
Name: '公告管理'
}
},
'WalletInit': {
path: '/system/wallet-init',
component: WalletInit,
name: 'WalletInit',
meta: {
Name: '充值额度'
}
},
'ContactUs': {
path: '/system/contact-us',
component: ContactUs,

@ -0,0 +1,228 @@
<template>
<section>
<section class="table-c">
<nav class="table-top-tools">
<el-button-group>
<el-button type="primary" size="mini" @click="beforeAdd('add','')"><i class="iconfont iconadd"></i> 新增</el-button>
</el-button-group>
</nav>
<!--列表-->
<el-table :data="tableData.rows" border highlight-current-row v-loading="listLoading" style="width: 100%;">
<el-table-column type="index" width="60"></el-table-column>
<el-table-column prop="coin" label="币种" ></el-table-column>
<el-table-column prop="walletType" label="钱包类型" >
<template slot-scope="scope">
<span v-if="scope.row.walletType == 'CCT'">币币钱包</span>
<span v-else>法币钱包</span>
</template>
</el-table-column>
<el-table-column prop="balance" label="可用额度"></el-table-column>
<el-table-column prop="createTime" label="创建时间"></el-table-column>
<el-table-column prop="updateTime" label="修改时间"></el-table-column>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button type="text" @click="delRow = true;setDelId(scope.row.id)">删除</el-button>
<el-button type="text" @click="beforeAdd('update',scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</section>
<!--工具条-->
<el-col :span="24" class="toolbar">
<el-pagination layout="total, prev, pager, next,jumper" @current-change="handleCurrentChange"
:page-size="tableData.pageSize"
:total="tableData.total" style="float:right;">
</el-pagination>
</el-col>
<div class="clear"></div>
<!-- 新增的弹出层 -->
<el-dialog
:title="type=='add'?'新增':'编辑'"
:visible.sync="dialogVisible"
width="60%"
height="60%"
class="add-dialog"
@close="resetAddData()">
<el-form :model="addData" class="add-form" :rules="rules" ref="addForm" label-width="120px">
<el-form-item label="币种" prop="coin">
<el-input v-model="addData.coin" placeholder=""></el-input>
</el-form-item>
<el-form-item label="钱包类型" v-if="type=='add'">
<el-radio v-model="addData.walletType" label="CCT">币币钱包</el-radio>
<el-radio v-model="addData.walletType" label="OTC">法币钱包</el-radio>
</el-form-item>
<el-form-item label="可用额度" prop="balance">
<el-input v-model="addData.balance" placeholder=""></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="addNotice(addData)"> </el-button>
</span>
</el-dialog>
<!-- 删除 -->
<el-dialog title="删除" :visible.sync="delRow " width="30%" center>
<div class="del-dialog-cnt">删除不可恢复是否确定删除</div>
<span slot="footer" class="dialog-footer">
<el-button @click="delRow = false"> </el-button>
<el-button type="primary" @click="delNotice"> </el-button>
</span>
</el-dialog>
</section>
</template>
<script>
import {SysConf} from '@/api/server.js';
export default {
data() {
return {
Y: true,
N: false,
delRow: false,
delId: null,
searchData: {
pageNum: 1
},
tableData:[
{
rank:'1'
}
],
addData:{
id:null,
coin:null,
walletType:'CCT',
balance:null,
},
rules:{
coin: [
{required: true, message: '请输入币种', trigger: 'blur'}
],
balance: [
{required: true, message: '请输入可用额度', trigger: 'blur'}
]
},
listLoading: false,
dialogVisible:false,
type:'update',
}
},
created(){
this.getList();
},
methods: {
handleCurrentChange(val) {
this.searchData.pageNum = val;
this.getList(this.searchData);
},
beforeAdd(params,row){
if (row){
this.addData.id = row.id;
this.addData.coin = row.coin;
this.addData.walletType = row.walletType;
this.addData.balance = row.balance;
}
this.dialogVisible=true;
this.type = params;
},
resetAddData(){
this.addData.id = null;
this.addData.coin = null;
this.addData.walletType = 'CCT';
this.addData.balance = null;
},
//
getList(params) {
this.listLoading = true;
SysConf.getWalletInitList(params).then((res) => {
if (res.code == 200) {
this.listLoading = false;
this.tableData = res.data;
} else {
this.$message.error(res.msg);
}
});
},
delNotice() {
SysConf.delWalletInit({id: this.delId}).then(data => {
let {msg, code} = data;
if (code !== 200) {
this.$message({
message: msg,
type: 'error'
})
} else {
this.delRow = false;//
this.getList();
this.$message.success('删除成功')
}
}).catch(error => {
this.delRow = false;//
})
},
addNotice(addData) {
this.$refs.addForm.validate((valid) => {
if (valid) {
if(!addData.id){
SysConf.insertWalletInit(addData).then(data => {
let {msg, code} = data;
if (code !== 200) {
this.$message({
message: msg,
type: 'error'
})
} else {
this.dialogVisible = false;//
this.getList();
this.$message.success('添加成功')
}
}).catch(error => {
this.dialogVisible = false;//
})
}else {
SysConf.updWalletInit(addData).then(data => {
let {msg, code} = data;
if (code !== 200) {
this.$message({
message: msg,
type: 'error'
})
} else {
this.dialogVisible = false;//
this.getList();
this.$message.success('修改成功');
}
}).catch(error => {
this.dialogVisible = false;//
})
}
} else {
return false;
}
});
},
setDelId(id) {
this.delId = id;
},
}
}
</script>
<style scoped lang="scss">
@import '../../styles/link.scss';
.add-form {
.el-input {
width: 340px;
}
}
</style>
<style lang="scss" >
.add-dialog{
.el-dialog {
width: 30%;
}
}
</style>
Loading…
Cancel
Save