Browse Source

对接分账接口

master
ltlzx 4 years ago
parent
commit
2a1b4c1a18
  1. 72
      src/api/index.js
  2. 47
      src/components/accountDetails/index.vue
  3. 140
      src/components/billDetails/index.vue
  4. 140
      src/components/page/fundSettlement/index.vue
  5. 82
      src/components/page/fundSettlement/paymentMethod.vue
  6. 228
      src/components/page/fundSettlement/splitProportion.vue
  7. 1
      src/components/page/layout/index.vue
  8. 4
      src/utils/request.js

72
src/api/index.js

@ -160,3 +160,75 @@ export const manualGetGoods = query => {
params: query
});
};
//资金结算对账账单列表
export const closeList = query => {
return request({
url: '/admin/order.AccountClose/closeList',
method: 'get',
params: query
});
};
//资金结算获取账户详情
export const getCloseAccountInfo = query => {
return request({
url: '/admin/order.AccountClose/getCloseAccountInfo',
method: 'get',
params: query
});
};
//资金结算获取账单明细
export const getBillDetail = query => {
return request({
url: '/admin/order.AccountClose/getBillDetail',
method: 'post',
data: query
});
};
//分账比例设置列表
export const ratioList = query => {
return request({
url: '/admin/order.AccountClose/ratioList',
method: 'post',
data: query
});
};
//修改分账比例状态
export const ratioStatus = query => {
return request({
url: '/admin/order.AccountClose/ratioStatus',
method: 'post',
data: query
});
};
//设置分账比例
export const setRatio = query => {
return request({
url: '/admin/order.AccountClose/setRatio',
method: 'post',
data: query
});
};
//分账比例设置详情
export const ratioDetail = query => {
return request({
url: '/admin/order.AccountClose/ratioDetail',
method: 'post',
data: query
});
};
//获取支付方式
export const getPaySetting = query => {
return request({
url: '/admin/order.AccountClose/getPaySetting',
method: 'get',
params: query
});
};
//设置支付方式
export const setPaySetting = query => {
return request({
url: '/admin/order.AccountClose/setPaySetting',
method: 'post',
data: query
});
};

47
src/components/accountDetails/index.vue

@ -1,20 +1,20 @@
<template>
<div>
<a-modal v-model="newVisible" title="账户详情" :afterClose="onClose" width="870px" :bodyStyle="modeStyle">
<p class="details_p">结算账号5678656789</p>
<p class="details_p">结算卡开户银行中国农业银行海辉支行</p>
<p class="details_p">结算账号--</p>
<p class="details_p">结算卡开户银行{{data.bank_address}}</p>
<p class="details_p">
结算银行卡6228487678878909899
结算银行卡{{data.bank_account}}
<!-- <span class="changeBind">更换绑定</span> -->
</p>
<div class="details_content">
<p>注册时间2021-02-16 10:00:00</p>
<p>认证时间2021-02-16 10:00:00</p>
<p>认证类型机构</p>
<p>认证状态已认证</p>
<p>基本信息新疆生产建设兵团军垦博物馆</p>
<p>统一社会信用代码12990800H41793127X</p>
<p>账户ISLI标识码010002-000000000090000117259999-8</p>
<!-- <p>注册时间{{data.bank_account}}</p>
<p>认证时间{{data.bank_account}}</p> -->
<p>认证类型{{data.agency_type==1?'个人':'机构'}}</p>
<p>认证状态{{data.attest_status==1?'认证中':data.attest_status==2?'认证成功':'认证失败'}}</p>
<p>基本信息{{data.username}}</p>
<p v-if="data.institution_code">统一社会信用代码{{data.institution_code}}</p>
<p>账户ISLI标识码{{data.user_isli}}</p>
</div>
<template slot="footer">
<div>
@ -26,33 +26,46 @@
</template>
<script>
import {getCloseAccountInfo} from '../../api/index'
export default {
props:{
visible:{
type:Boolean,
require: true
},
user_isli:{
type:String
}
},
data(){
return{
newVisible:false,
newVisible:true,
modeStyle:{
'min-height':'311px',
'padding-top':'0px'
},
data:{}
}
},
created(){
this.getList()
},
methods:{
getList(){
let data={user_isli:this.user_isli}
getCloseAccountInfo(data).then(res=>{
if(res.code==200){
this.data=res.data
}else{
this.$message.error(res.msg);
}
})
},
onClose() {
this.newVisible=false
// this.newVisible=false
this.$emit('update:visible', false)
}
},
watch:{
visible(val){
this.newVisible=val
}
}
}
</script>

140
src/components/billDetails/index.vue

@ -1,20 +1,29 @@
<template>
<div>
<a-modal v-model="newVisible" title="账单明细" :afterClose="onClose" width="1175px" :bodyStyle="modeStyle">
<p>本月总收入10,000.00</p>
<p>本月总支出3,000.00</p>
<p>本月总收入{{income}}</p>
<p>本月总支出{{disburse}}</p>
<div class="bill_content">
<a-table :columns="columns" :data-source="data" bordered :pagination="false"></a-table>
<a-table :columns="columns" :data-source="data" bordered :pagination="false">
<template slot="close_status" slot-scope="close_status">
<span v-if="close_status==1">无结算信息</span>
<span v-else-if="close_status==2">结算中</span>
<span v-else-if="close_status==3">用户名和收款人不一致</span>
<span v-else-if="close_status==4">收款信息错误</span>
<span v-else-if="close_status==5">结算成功</span>
</template>
</a-table>
</div>
<a-pagination
class="pagination"
size="small"
:total="total"
v-model="current"
:page-size="pageSize"
:show-total="total => `第 ${current} / ${pageSize} 条 / 总共 ${total} 条`"
v-model="page"
:page-size="limit"
:show-total="total => `第 ${startTotal} - ${endTotal} 条 / 总共 ${total} 条`"
:page-size-options="pageSizeOptions"
@showSizeChange="onShowSizeChange"
@change="changePage"
show-size-changer >
<template slot="buildOptionText" slot-scope="props">
<span >{{ props.value }}/</span>
@ -30,194 +39,209 @@
</template>
<script>
import {getBillDetail} from '../../api/index'
export default {
props:{
visible:{
type:Boolean,
require: true
},
user_isli:{
type:String
}
},
data(){
return{
newVisible:false,
newVisible:true,
modeStyle:{
'min-height':'311px',
'padding-top':'15px'
},
pageSizeOptions: ['10', '20', '30', '40', '50'],
//
pageSize:10,
total:500,
startTotal:1,
endTotal:10,
limit:10,
//
current: 1,
data:[
{
key: '1',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park',
},
{
key: '2',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park',
},
{
key: '3',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park',
},
],
page:1,
disburse:'',
income:'',
data:[],
columns:[
{
title: '序号',
className: 'table_column',
dataIndex: 'id',
width:'65px',
align:'center'
},
{
title: '结算时间',
dataIndex: 'money',
dataIndex: '',
width:'120px',
align:'center'
},
{
title: '用户编码',
dataIndex: 'name',
dataIndex: 'user_isli',
width:'120px',
align:'center'
},
{
title: '客户名称',
dataIndex: '',
dataIndex: 'order_user.name',
width:'120px',
align:'center'
},
{
title: '订单编号',
dataIndex: '',
dataIndex: 'batchcode',
width:'120px',
align:'center'
},
{
title: '分中心编号',
dataIndex: '',
dataIndex: 'center_number',
width:'120px',
align:'center'
},
{
title: '分中心名称',
dataIndex: '',
dataIndex: 'center_name',
width:'120px',
align:'center'
},
{
title: '服务机构编号',
dataIndex: '',
dataIndex: 'service_number',
width:'120px',
align:'center'
},
{
title: '服务机构名称',
dataIndex: '',
dataIndex: 'service_name',
width:'120px',
align:'center'
},
{
title: '银行卡号',
dataIndex: '',
dataIndex: 'order_user.publicAccount',
width:'120px',
align:'center'
},
{
title: '银行名称',
dataIndex: '',
dataIndex: 'order_user.bankName',
width:'120px',
align:'center'
},
{
title: '期初资金',
dataIndex: '',
dataIndex: 'preliminary_capital',
width:'120px',
align:'center'
},
{
title: '可用资金',
dataIndex: '',
dataIndex: 'available_capital',
width:'120px',
align:'center'
},
{
title: '可出资金',
dataIndex: '',
dataIndex: 'disburse_capital',
width:'120px',
align:'center'
},
{
title: '佣金/服务费(含税)',
dataIndex: '',
dataIndex: 'service_charge',
width:'120px',
align:'center'
},
{
title: '委托费',
dataIndex: '',
dataIndex: 'entrust_cost',
width:'120px',
align:'center'
},
{
title: '当日买入金额',
dataIndex: '',
dataIndex: 'thatday_buy_money',
width:'120px',
align:'center'
},
{
title: '当日卖出金额',
dataIndex: '',
dataIndex: 'thatday_sale_money',
width:'120px',
align:'center'
},
{
title: '服务费分配',
dataIndex: '',
dataIndex: 'service_charge_allot',
width:'120px',
align:'center'
},
{
title: '资金余额',
dataIndex: '',
dataIndex: 'capital_remaining',
width:'120px',
align:'center'
},
{
title: '冻结保证金',
dataIndex: '',
dataIndex: 'freeze_earnest_money',
width:'120px',
align:'center'
},
{
title: '结算状态',
dataIndex: '',
dataIndex: 'close_status',
scopedSlots: { customRender: 'close_status' },
width:'120px',
align:'center'
},
],
}
},
created(){
this.getList()
},
methods:{
getList(){
let data={}
data.user_isli=this.user_isli
data.limit=this.limit
data.page=this.page
getBillDetail(data).then(res=>{
if(res.code==200){
this.data=res.data.data
this.startTotal=res.data.start
this.endTotal=res.data.end
this.total=res.data.total
this.disburse=res.data.disburse
this.income=res.data.income
}else{
this.$message.error(res.msg);
}
})
},
onClose() {
this.newVisible=false
// this.newVisible=false
this.$emit('update:visible', false)
}
},
//
onShowSizeChange(current, pageSize){
this.limit = pageSize;
this.getList()
},
//
changePage(page, pageSize){
this.page=page
this.getList()
},
},
watch:{
visible(val){
this.newVisible=val
}
}
}
</script>

140
src/components/page/fundSettlement/index.vue

@ -11,37 +11,37 @@
<a-row justify="space-between" >
<a-col :span="5" class="query_item">
<span>客户名称</span>
<a-input/>
<a-input v-model="query.user_name"/>
</a-col>
<a-col :span="5" class="query_item">
<span>结算账户</span>
<a-input/>
<a-input v-model="query.close_account"/>
</a-col>
<a-col :span="5" class="query_item">
<span>银行账号</span>
<a-input/>
<a-input v-model="query.bank_account"/>
</a-col>
<a-col :span="5" class="query_item" >
<span>结算状态</span>
<a-select default-value="全部" @change="handleChange">
<a-select-option value="全部">
全部
</a-select-option>
<a-select default-value="" v-model="query.status">
<a-select-option value="">全部</a-select-option>
<a-select-option value="1">待结算</a-select-option>
<a-select-option value="2">已结算</a-select-option>
</a-select>
</a-col>
<a-col :span="5" class="query_item">
<span>用户类型</span>
<a-select default-value="全部" @change="handleChange">
<a-select-option value="全部">
全部
</a-select-option>
<a-select default-value="" v-model="query.type">
<a-select-option value="">全部</a-select-option>
<a-select-option value="2">统一门户</a-select-option>
<a-select-option value="1">平台注册</a-select-option>
</a-select>
</a-col>
<a-col :span="19" class="query_item query_item1">
<a-space :size="21">
<a-button type="primary" class="query_button"> </a-button>
<a-button class="query_button"> </a-button>
<a-button type="primary" class="query_button" @click="getList"> </a-button>
<a-button class="query_button" @click="resetQurey"> </a-button>
</a-space>
</a-col>
</a-row>
@ -52,10 +52,17 @@
<!-- <a-button type="primary" class="query_button"> </a-button> -->
</div>
<a-table :columns="columns" :data-source="data" bordered :pagination="false">
<template slot="operation">
<template slot="close_status" slot-scope="close_status">
<span v-if="close_status==1">无结算信息</span>
<span v-else-if="close_status==2">结算中</span>
<span v-else-if="close_status==3">用户名和收款人不一致</span>
<span v-else-if="close_status==4">收款信息错误</span>
<span v-else-if="close_status==5">结算成功</span>
</template>
<template slot="operation" slot-scope="item">
<a-space :size="24">
<span class="table_operation" @click="showDetails">账户详情</span>
<span class="table_operation" @click="showBill">账单明细</span>
<span class="table_operation" @click="showDetails(item.islicode)">账户详情</span>
<span class="table_operation" @click="showBill(item.islicode)">账单明细</span>
</a-space>
</template>
</a-table>
@ -63,11 +70,12 @@
class="pagination"
size="small"
:total="total"
v-model="current"
:page-size="pageSize"
:show-total="total => `第 ${current} / ${pageSize} 条 / 总共 ${total} 条`"
v-model="page"
:page-size="limit"
:show-total="total => `第 ${startTotal} - ${endTotal} 条 / 总共 ${total} 条`"
:page-size-options="pageSizeOptions"
@showSizeChange="onShowSizeChange"
@change="changePage"
show-size-changer >
<template slot="buildOptionText" slot-scope="props">
<span >{{ props.value }}/</span>
@ -75,12 +83,13 @@
</a-pagination>
</div>
</div>
<accountDetails :visible.sync="visible"></accountDetails>
<billDetails :visible.sync="visible1"></billDetails>
<accountDetails :visible.sync="visible" v-if="visible" :user_isli="islicode"></accountDetails>
<billDetails :visible.sync="visible1" v-if="visible1" :user_isli="islicode"></billDetails>
</div>
</template>
<script>
import Operation from '../../Operation.vue'
import {closeList}from '../../../api/index'
export default {
data() {
return{
@ -90,44 +99,35 @@ export default {
//
pageSize:10,
total:500,
startTotal:1,
endTotal:10,
limit:10,
//
current: 1,
data:[
{
key: '1',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park',
},
{
key: '2',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park',
},
{
key: '3',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park',
},
],
page:1,
query:{
user_name:'',
close_account:'',
bank_account:'',
status:'',
type:''
},
islicode:'',
data:[],
columns:[
{
title: '序号',
className: 'table_column',
dataIndex: 'id',
width:'65px',
align:'center'
},
{
title: '用户编码',
dataIndex: 'money',
dataIndex: 'islicode',
align:'center'
},
{
title: '客户名称',
dataIndex: 'name',
dataIndex: 'userinfo.name',
align:'center'
},
{
@ -137,23 +137,23 @@ export default {
},
{
title: '银行账号',
dataIndex: '',
dataIndex: 'userinfo.publicAccount',
align:'center'
},
{
title: '银行名称',
dataIndex: '',
dataIndex: 'userinfo.bankName',
align:'center'
},
{
title: '用户类型',
dataIndex: '',
dataIndex: 'userinfo.userType',
align:'center'
},
{
title: '结算状态',
dataIndex: '',
dataIndex: 'close_status',
scopedSlots: { customRender: 'close_status' },
align:'center'
},
{
@ -170,25 +170,47 @@ export default {
billDetails:() => import('../../billDetails/index.vue'),
},
created(){
console.info(this.$route)
this.getList()
},
methods:{
showBill(){
getList(){
let data=this.query
data.limit=this.limit
data.page=this.page
closeList(data).then(res=>{
if(res.code==200){
this.data=res.data.data
this.startTotal=res.data.start
this.endTotal=res.data.end
this.total=res.data.total
}else{
this.$message.error(res.msg);
}
})
},
// query
resetQurey(){
Object.assign(this.query, this.$options.data().query)
this.getList()
},
showBill(val){
this.islicode=val
this.visible1=true
},
showDetails(){
showDetails(val){
this.islicode=val
this.visible=true
},
//
onShowSizeChange(current, pageSize){
this.pageSize = pageSize;
this.limit = pageSize;
this.getList()
},
handleChange(){
//
changePage(page, pageSize){
this.page=page
this.getList()
},
onChange(){
}
}
}
</script>

82
src/components/page/fundSettlement/paymentMethod.vue

@ -9,7 +9,12 @@
<div class="body ">
<div class="body1">
<p class="f_title">请选择可用支付方式</p>
<a-radio-group v-model="value" name="radioGroup">
<div class="pay">
<a-checkbox v-model="checked">微信</a-checkbox>
<a-checkbox v-model="checked1">支付宝</a-checkbox>
<a-checkbox v-model="checked2">网银支付</a-checkbox>
</div>
<!-- <a-radio-group v-model="value" name="radioGroup">
<a-radio :value="1">
微信
</a-radio>
@ -19,8 +24,8 @@
<a-radio :value="3">
网银支付
</a-radio>
</a-radio-group>
<a-button type="primary" class="query_button"> </a-button>
</a-radio-group> -->
<a-button type="primary" class="query_button" @click="setPaySetting"> </a-button>
</div>
</div>
@ -28,10 +33,74 @@
</template>
<script>
import {getPaySetting,setPaySetting}from '../../../api/index'
export default {
data(){
return{
value:1
checked:false,
checked1:false,
checked2:false,
query:{
alipay:0,
ebank_pay:0,
wechat_pay:0,
}
}
},
created(){
this.getList()
},
methods:{
setPaySetting(){
if(this.checked){
this.query.wechat_pay=1
}else{
this.query.wechat_pay=0
}
if(this.checked1){
this.query.alipay=1
}else{
this.query.alipay=0
}
if(this.checked2){
this.query.ebank_pay=1
}else{
this.query.ebank_pay=0
}
setPaySetting(this.query).then(res=>{
if(res.code==200){
this.$message.success('设置成功!');
}else{
this.$message.error(res.msg);
}
})
},
getList(){
getPaySetting().then(res=>{
if(res.code==200){
this.query=res.data
this.pay()
}else{
this.$message.error(res.msg);
}
})
},
pay(){
if(this.query.wechat_pay==0){
this.checked=false
}else{
this.checked=true
}
if(this.query.alipay==0){
this.checked1=false
}else{
this.checked1=true
}
if(this.query.ebank_pay==0){
this.checked2=false
}else{
this.checked2=true
}
}
}
}
@ -47,4 +116,9 @@
flex-direction: column;
justify-content: space-between;
}
.pay{
display: flex;
width: 350px;
justify-content: space-between;
}
</style>

228
src/components/page/fundSettlement/splitProportion.vue

@ -11,33 +11,33 @@
<a-row justify="space-between" >
<a-col :span="5" class="query_item">
<span>规则名称</span>
<a-input/>
<a-input v-model="query.rule_name"/>
</a-col>
<a-col :span="5" class="query_item" >
<span>创建人员</span>
<a-select default-value="全部" >
<a-select-option value="全部">
全部
<a-select v-model="query.user_id">
<a-select-option :value="item.id" v-for="(item,index) in userList" :key="index">
{{item.account_name}}
</a-select-option>
</a-select>
</a-col>
<a-col :span="5" class="query_item">
<span>使用状态</span>
<a-select default-value="全部" >
<a-select-option value="全部">
全部
</a-select-option>
<a-select default-value="" v-model="query.status">
<a-select-option value="">全部</a-select-option>
<a-select-option value="0">禁用</a-select-option>
<a-select-option value="1">启用</a-select-option>
</a-select>
</a-col>
<a-col :span="5" class="query_item query_item2">
<span>创建时间</span>
<a-range-picker />
<a-range-picker v-model="query.createtime" valueFormat="YYYY-MM-DD"/>
</a-col>
<a-col :span="19" class="query_item ">
<a-space :size="21">
<a-button type="primary" class="query_button"> </a-button>
<a-button class="query_button"> </a-button>
<a-button type="primary" class="query_button" @click="getList"> </a-button>
<a-button class="query_button" @click="resetQurey"> </a-button>
</a-space>
</a-col>
</a-row>
@ -48,10 +48,13 @@
<a-button type="primary" class="query_button" @click="visible2=true"> </a-button>
</div>
<a-table :columns="columns" :data-source="data" bordered :pagination="false">
<template slot="operation">
<template slot="status" slot-scope="status">
<span >{{status==0?'禁用':'启用'}}</span>
</template>
<template slot="operation" slot-scope="item">
<a-space :size="24">
<span class="table_operation">禁用</span>
<span class="table_operation">查看</span>
<span class="table_operation" @click="ratioStatus(item.id)">{{item.status==0?'启用':'禁用'}}</span>
<span class="table_operation" @click="ratioDetail(item.id)">查看</span>
</a-space>
</template>
</a-table>
@ -59,11 +62,12 @@
class="pagination"
size="small"
:total="total"
v-model="current"
:page-size="pageSize"
:show-total="total => `第 ${current} / ${pageSize} 条 / 总共 ${total} 条`"
v-model="page"
:page-size="limit"
:show-total="total => `第 ${startTotal} - ${endTotal} 条 / 总共 ${total} 条`"
:page-size-options="pageSizeOptions"
@showSizeChange="onShowSizeChange"
@change="changePage"
show-size-changer >
<template slot="buildOptionText" slot-scope="props">
<span >{{ props.value }}/</span>
@ -74,34 +78,36 @@
<!-- 创建规则 -->
<a-modal v-model="visible2" title="创建规则" width="1186px" :bodyStyle="modeStyle">
<div >
<a-row justify="space-between" class="modal_select">
<a-row justify="space-between" class="modal_select" v-for="(item,index) in query1" :key="index">
<a-col :span="5" class="query_item rule_item">
<span>角色名称</span>
<a-select default-value="1" v-model="query1.goods_type">
<a-select v-model="item.role_type">
<a-select-option value="1">委托方</a-select-option>
<a-select-option value="2">购买方</a-select-option>
<a-select-option value="3">深圳文化产权交易所</a-select-option>
<a-select-option value="4">区域中心</a-select-option>
<a-select-option value="5">第三方服务机构</a-select-option>
<!-- <a-select-option value="4">区域中心</a-select-option>
<a-select-option value="5">第三方服务机构</a-select-option> -->
</a-select>
</a-col>
<a-col :span="6" class="query_item rule_item">
<span>费用名称</span>
<a-select default-value="1" v-model="query1.data_type">
<a-select-option value="1">委托服务费用</a-select-option>
<a-select v-model="item.cost_type">
<!-- <a-select-option value="1">委托服务费用</a-select-option>
<a-select-option value="2">交易服务费用</a-select-option>
<a-select-option value="3">认证服务费用</a-select-option>
<a-select-option value="3">认证服务费用</a-select-option> -->
<a-select-option value="1">平台服务费用</a-select-option>
</a-select>
</a-col>
<a-col :span="7" class="query_item rule_item">
<span>计算方式</span>
<a-select default-value="1" v-model="query1.transaction">
<a-select-option value="1">固定</a-select-option>
<a-select-option value="2">比例</a-select-option>
<a-select v-model="item.calculate">
<!-- <a-select-option value="2">固定</a-select-option> -->
<a-select-option value="1">比例</a-select-option>
</a-select>
<a-input v-model="query1.islicode"/>
<a-input v-model="item.amount" v-if="item.calculate==2"/>
<a-input v-model="item.ratio" v-if="item.calculate==1"/>
</a-col>
<a-col :span="6" class="query_item rule_item" >
<!-- <a-col :span="6" class="query_item rule_item" >
<span>结算周期</span>
<a-select default-value="1" v-model="query1.show">
<a-select-option value="1">3</a-select-option>
@ -113,12 +119,12 @@
<a-select-option value="7">20</a-select-option>
<a-select-option value="8">30</a-select-option>
</a-select>
</a-col>
</a-col> -->
</a-row>
<div class="caozuo">
<!-- <div class="caozuo">
<img src="../../../assets/img/add.svg" alt="">
<img src="../../../assets/img/jian.svg" alt="">
</div>
</div> -->
</div>
<template slot="footer">
<div>
@ -127,23 +133,51 @@
</div>
</template>
</a-modal>
<!-- 查看规则 -->
<a-modal v-model="visible" title="查看规则" width="570px" :bodyStyle="{'height':'300px'}">
<div class="rule_item1" v-for="(item,i) in ruleList" :key="i">
<span>{{item.role_type==1?'委托方':item.role_type==2?'购买方':'深圳文化产权交易所'}}</span>
<span class="rule_item1_span">交易服务费用{{item.calculate==1?'比例':'固定'}}</span>
<span v-if="item.calculate==1">{{item.ratio}}%</span>
<span v-if="item.calculate==2">{{item.amount}}%</span>
</div>
<template slot="footer">
<div>
<a-button type="white" @click="visible=false"> </a-button>
</div>
</template>
</a-modal>
</div>
</template>
<script>
import Operation from '../../Operation.vue'
import {ratioList,getUser,ratioStatus,setRatio,ratioDetail}from '../../../api/index'
export default {
data() {
return{
query1:{
},
query1:[
{role_type:'1',cost_type:'1',calculate:'1',amount:'',ratio:null,},
{role_type:'2',cost_type:'1',calculate:'1',amount:'',ratio:null,},
{role_type:'3',cost_type:'1',calculate:'1',amount:'',ratio:null,},
],
pageSizeOptions: ['10', '20', '30', '40', '50'],
//
pageSize:10,
total:500,
startTotal:1,
endTotal:10,
limit:10,
//
current: 1,
page:1,
query:{
rule_name:'',
user_id:'',
status:'',
createtime:[],
type:''
},
visible:false,
visible2:false,
modeStyle:{
'height':'240px'
@ -152,29 +186,29 @@ export default {
columns:[
{
title: '序号',
className: 'table_column',
dataIndex: 'id',
width:'65px',
align:'center'
},
{
title: '创建时间',
dataIndex: 'money',
dataIndex: 'createtime',
align:'center'
},
{
title: '规则名称',
dataIndex: 'name',
dataIndex: 'rule_name',
align:'center'
},
{
title: '使用状态',
dataIndex: '',
dataIndex: 'status',
scopedSlots: { customRender: 'status' },
align:'center'
},
{
title: '创建人员',
dataIndex: '',
dataIndex: 'username',
align:'center'
},
{
@ -182,22 +216,102 @@ export default {
scopedSlots: { customRender: 'operation' },
align:'center'
},
]
],
userList:[],
ruleList:[]
}
},
components:{
Operation
},
created(){
console.info(this.$route)
this.getList()
this.getUser()
},
methods:{
ratioDetail(val){
let data={id:val}
ratioDetail(data).then(res=>{
if(res.code==200){
this.visible=true
this.ruleList=res.data
}else{
this.$message.error(res.msg);
}
})
},
ratioStatus(val){
let data={id:val}
ratioStatus(data).then(res=>{
if(res.code==200){
this.$message.success('修改状态成功!');
this.getList()
}else{
this.$message.error(res.msg);
}
})
},
//
getUser(){
getUser().then(res=>{
if(res.code==200){
this.userList=res.data
}else{
this.$message.error(res.msg);
}
})
},
getList(){
let data=this.query
data.limit=this.limit
data.page=this.page
ratioList(data).then(res=>{
if(res.code==200){
this.data=res.data.data
this.startTotal=res.data.start
this.endTotal=res.data.end
this.total=res.data.total
}else{
this.$message.error(res.msg);
}
})
},
// query
resetQurey(){
Object.assign(this.query, this.$options.data().query)
this.getList()
},
// query
resetQurey1(){
for(let i=0;i<this.query1.length;i++){
this.query1[i].ratio=''
}
},
addRule(){
if(parseInt(this.query1[0].ratio)+parseInt(this.query1[2].ratio)!=100){
this.$message.error('委托方和平台方的加起来比列要等于100');
return
}
let data={ratio:this.query1}
setRatio(data).then(res=>{
if(res.code==200){
this.$message.success('创建成功!');
this.getList()
this.resetQurey1()
}else{
this.$message.error(res.msg);
}
})
},
//
onShowSizeChange(current, pageSize){
this.pageSize = pageSize;
this.limit = pageSize;
this.getList()
},
//
changePage(page, pageSize){
this.page=page
this.getList()
},
}
}
@ -219,4 +333,28 @@ export default {
.caozuo img{
margin-right: 10px;
}
/deep/ .ant-modal-header{
border-bottom: none;
}
/deep/ .ant-modal-footer{
border-top: none;
padding: 10px 16px;
}
/deep/ .ant-modal-body{
padding: 12px 24px;
}
.rule_item1{
margin-bottom: 22px;
}
.rule_item1 span{
display: inline-block;
}
.rule_item1 span:first-child{
min-width:140px;
}
.rule_item1_span{
margin-left: 80px;
margin-right: 70px;
}
</style>

1
src/components/page/layout/index.vue

@ -329,6 +329,7 @@ export default {
// query
resetQurey(){
Object.assign(this.query1, this.$options.data().query1)
this.showAdd()
},
onSelectChange(keys){
this.selectedRowKeys = keys;

4
src/utils/request.js

@ -3,8 +3,8 @@ import axios from 'axios';
const service = axios.create({
// process.env.NODE_ENV === 'development' 来判断是否开发环境
// baseURL:process.env.NODE_ENV == 'production' ? 'https://yztapi.xingtongworld.com' : '/api/',
baseURL:'http://jiao.api.alpha.xingtongworld.com',
// baseURL:'http://192.168.66.254:8080',
// baseURL:'http://jiao.api.alpha.xingtongworld.com',
baseURL:'http://192.168.66.254:8080',
timeout: 5000,
});

Loading…
Cancel
Save