feat(开通国家支付页面-->关联渠道组件): 添加渠道后执行更新数据的操作,以获取国家列表的项id
This commit is contained in:
parent
77d48af4f6
commit
17392fab0a
@ -9,7 +9,9 @@
|
|||||||
top="20px"
|
top="20px"
|
||||||
>
|
>
|
||||||
<div class="form-edit">
|
<div class="form-edit">
|
||||||
|
<!-- 头部国家信息 -->
|
||||||
<div v-loading="loading" class="operation-but">
|
<div v-loading="loading" class="operation-but">
|
||||||
|
<!-- 国家基本信息 -->
|
||||||
<div class="flex-r">
|
<div class="flex-r">
|
||||||
<el-image
|
<el-image
|
||||||
style="width: 30px; height: 18px;margin: 0px 5px;"
|
style="width: 30px; height: 18px;margin: 0px 5px;"
|
||||||
@ -20,9 +22,10 @@
|
|||||||
<i class="el-icon-picture-outline" />
|
<i class="el-icon-picture-outline" />
|
||||||
</div>
|
</div>
|
||||||
</el-image>
|
</el-image>
|
||||||
{{ row.country.aliasName }}、
|
{{ row.country.aliasName }}、 国家货币: {{ row.currency }}、
|
||||||
国家货币: {{ row.currency }}、
|
|
||||||
美元汇率: {{ row.usdExchangeRate }}
|
美元汇率: {{ row.usdExchangeRate }}
|
||||||
|
|
||||||
|
<!-- 添加渠道 按钮 -->
|
||||||
<div style="margin-left: 20px;">
|
<div style="margin-left: 20px;">
|
||||||
<transfer-channel
|
<transfer-channel
|
||||||
:selected-channels="channelCodes"
|
:selected-channels="channelCodes"
|
||||||
@ -33,58 +36,159 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 渠道列表 -->
|
||||||
<el-form ref="form" label-position="top">
|
<el-form ref="form" label-position="top">
|
||||||
<el-collapse v-if="list && list.length > 0" v-model="activeNames">
|
<el-collapse v-if="list && list.length > 0" v-model="activeNames">
|
||||||
<el-collapse-item v-for="(item,index) in list" :key="index" :name="item.channelCode">
|
<!-- 渠道列表项 -->
|
||||||
|
<el-collapse-item
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:key="index"
|
||||||
|
:name="item.channelCode"
|
||||||
|
>
|
||||||
|
<!-- 标题插槽 -->
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<div class="flex-l" style="width: 100%;">
|
<div class="flex-l" style="width: 100%;">
|
||||||
<img class="channel-icon" :src="item.channel.channelIcon" alt="icon" width="30" height="30">
|
<img
|
||||||
<div style="width: 100%;" class="channel-name nowrap-ellipsis">{{ item.channel.channelName }}</div>
|
class="channel-icon"
|
||||||
|
:src="item.channel.channelIcon"
|
||||||
|
alt="icon"
|
||||||
|
width="30"
|
||||||
|
height="30"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
style="width: 100%;"
|
||||||
|
class="channel-name nowrap-ellipsis"
|
||||||
|
>
|
||||||
|
{{ item.channel.channelName }}
|
||||||
|
</div>
|
||||||
<!-- <div>
|
<!-- <div>
|
||||||
<el-button type="text" style="color: #F56C6C;" @click.stop="clickDeleteChannel"><i class="el-icon-delete" />删除</el-button>
|
<el-button type="text" style="color: #F56C6C;" @click.stop="clickDeleteChannel"><i class="el-icon-delete" />删除</el-button>
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div v-for="(aItem,aIndex) in item.countryChannels" :key="aIndex" class="channel-item">
|
|
||||||
|
<!-- 详细信息 -->
|
||||||
|
<div
|
||||||
|
v-for="(aItem, aIndex) in item.countryChannels"
|
||||||
|
:key="aIndex"
|
||||||
|
class="channel-item"
|
||||||
|
>
|
||||||
|
<!-- 支付方式 -->
|
||||||
<el-col :md="4">
|
<el-col :md="4">
|
||||||
<div class="flex-l input-content">
|
<div class="flex-l input-content">
|
||||||
<img class="channel-icon" :src="aItem.payFactory.factoryIcon" alt="icon" width="30" height="30">
|
<img
|
||||||
<div class="channel-name nowrap-ellipsis">{{ aItem.payFactory.factoryName }}</div>
|
class="channel-icon"
|
||||||
|
:src="aItem.payFactory.factoryIcon"
|
||||||
|
alt="icon"
|
||||||
|
width="30"
|
||||||
|
height="30"
|
||||||
|
/>
|
||||||
|
<div class="channel-name nowrap-ellipsis">
|
||||||
|
{{ aItem.payFactory.factoryName }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 设置项 -->
|
||||||
<el-col :md="20">
|
<el-col :md="20">
|
||||||
|
<!-- 最小额度 -->
|
||||||
<el-col :md="8" class="channel-item-form">
|
<el-col :md="8" class="channel-item-form">
|
||||||
<el-form-item label="最小额度">
|
<el-form-item label="最小额度">
|
||||||
<el-input v-model.trim="aItem.countryChannelDetails.factoryMinLimit" :disabled="aItem.disabled" placeholder="最小限额" class="input-with-select" maxlength="10" @change="()=> changeFactoryVal(aItem, 'factoryMinLimit')">
|
<el-input
|
||||||
<template slot="append">USD</template>
|
v-model.trim="
|
||||||
</el-input>
|
aItem.countryChannelDetails.factoryMinLimit
|
||||||
</el-form-item>
|
"
|
||||||
</el-col>
|
:disabled="aItem.disabled"
|
||||||
<el-col :md="8" class="channel-item-form">
|
placeholder="最小限额"
|
||||||
<el-form-item label="最大额度">
|
class="input-with-select"
|
||||||
<el-input v-model.trim="aItem.countryChannelDetails.factoryMaxLimit" :disabled="aItem.disabled" placeholder="最小限额" class="input-with-select" maxlength="10" @change="()=> changeFactoryVal(aItem, 'factoryMaxLimit')">
|
maxlength="10"
|
||||||
<template slot="append">USD</template>
|
@change="
|
||||||
</el-input>
|
() => changeFactoryVal(aItem, 'factoryMinLimit')
|
||||||
</el-form-item>
|
"
|
||||||
</el-col>
|
>
|
||||||
<el-col :md="8" class="channel-item-form">
|
<template slot="append"
|
||||||
<el-form-item label="每日限额">
|
>USD</template
|
||||||
<el-input v-model.trim="aItem.countryChannelDetails.factoryDailyLimit" :disabled="aItem.disabled" placeholder="每日限额" class="input-with-select" maxlength="10" @change="()=> changeFactoryVal(aItem, 'factoryDailyLimit')">
|
>
|
||||||
<template slot="append">USD</template>
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 最大额度 -->
|
||||||
|
<el-col :md="8" class="channel-item-form">
|
||||||
|
<el-form-item label="最大额度">
|
||||||
|
<el-input
|
||||||
|
v-model.trim="
|
||||||
|
aItem.countryChannelDetails.factoryMaxLimit
|
||||||
|
"
|
||||||
|
:disabled="aItem.disabled"
|
||||||
|
placeholder="最小限额"
|
||||||
|
class="input-with-select"
|
||||||
|
maxlength="10"
|
||||||
|
@change="
|
||||||
|
() => changeFactoryVal(aItem, 'factoryMaxLimit')
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template slot="append"
|
||||||
|
>USD</template
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 每日额度 -->
|
||||||
|
<el-col :md="8" class="channel-item-form">
|
||||||
|
<el-form-item label="每日限额">
|
||||||
|
<el-input
|
||||||
|
v-model.trim="
|
||||||
|
aItem.countryChannelDetails.factoryDailyLimit
|
||||||
|
"
|
||||||
|
:disabled="aItem.disabled"
|
||||||
|
placeholder="每日限额"
|
||||||
|
class="input-with-select"
|
||||||
|
maxlength="10"
|
||||||
|
@change="
|
||||||
|
() => changeFactoryVal(aItem, 'factoryDailyLimit')
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template slot="append"
|
||||||
|
>USD</template
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 渠道CODE -->
|
||||||
<el-col :md="8" class="channel-item-form">
|
<el-col :md="8" class="channel-item-form">
|
||||||
<el-form-item label="第三方渠道CODE">
|
<el-form-item label="第三方渠道CODE">
|
||||||
<el-input v-model="aItem.countryChannelDetails.factoryChannel" :disabled="aItem.disabled" placeholder="请输入第三方厂商渠道CODE" @change="(val)=>changeFactoryVal(aItem, 'factoryChannel')" />
|
<el-input
|
||||||
|
v-model="aItem.countryChannelDetails.factoryChannel"
|
||||||
|
:disabled="aItem.disabled"
|
||||||
|
placeholder="请输入第三方厂商渠道CODE"
|
||||||
|
@change="
|
||||||
|
val => changeFactoryVal(aItem, 'factoryChannel')
|
||||||
|
"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 货币小数点 -->
|
||||||
<el-col :md="8" class="channel-item-form">
|
<el-col :md="8" class="channel-item-form">
|
||||||
<el-form-item label="货币小数点(暂时没用)">
|
<el-form-item label="货币小数点(暂时没用)">
|
||||||
<el-input v-model="aItem.countryChannelDetails.factoryCurrencyPoint" :disabled="aItem.disabled" placeholder="货币小数点,默认2位" @change="(val)=>changeFactoryVal(aItem, 'factoryCurrencyPoint')" />
|
<el-input
|
||||||
|
v-model="
|
||||||
|
aItem.countryChannelDetails.factoryCurrencyPoint
|
||||||
|
"
|
||||||
|
:disabled="aItem.disabled"
|
||||||
|
placeholder="货币小数点,默认2位"
|
||||||
|
@change="
|
||||||
|
val => changeFactoryVal(aItem, 'factoryCurrencyPoint')
|
||||||
|
"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 是否启动 -->
|
||||||
<el-col :md="8" class="channel-item-form">
|
<el-col :md="8" class="channel-item-form">
|
||||||
<el-form-item label="是否启动">
|
<el-form-item label="是否启动">
|
||||||
<el-switch
|
<el-switch
|
||||||
@ -98,18 +202,21 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-col>
|
</el-col>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { listPayCountryChannel, addBatchCountyAssociateChannel, delBatchPayCountryChannel, addOrUpdateCountyChannelDetails } from '@/api/sys-pay'
|
import {
|
||||||
import TransferChannel from './../comp/transfer-channel'
|
listPayCountryChannel,
|
||||||
|
addBatchCountyAssociateChannel,
|
||||||
|
delBatchPayCountryChannel,
|
||||||
|
addOrUpdateCountyChannelDetails
|
||||||
|
} from "@/api/sys-pay";
|
||||||
|
import TransferChannel from "./../comp/transfer-channel";
|
||||||
export default {
|
export default {
|
||||||
components: { TransferChannel },
|
components: { TransferChannel },
|
||||||
props: {
|
props: {
|
||||||
@ -121,118 +228,128 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeNames: 'PAER_MAX',
|
activeNames: "PAER_MAX",
|
||||||
loading: false,
|
loading: false,
|
||||||
list: [],
|
list: [],
|
||||||
channelCodes: [],
|
channelCodes: [],
|
||||||
payCountryId: ''
|
payCountryId: ""
|
||||||
}
|
};
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
},
|
},
|
||||||
|
computed: {},
|
||||||
watch: {
|
watch: {
|
||||||
row: {
|
row: {
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
if (!newVal) {
|
if (!newVal) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
this.payCountryId = newVal.id
|
this.payCountryId = newVal.id;
|
||||||
this.renderData()
|
this.renderData();
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeFactoryVal(item, field) {
|
changeFactoryVal(item, field) {
|
||||||
console.log('item', item)
|
console.log("item", item);
|
||||||
if (field === 'factoryMinLimit' ||
|
if (
|
||||||
field === 'factoryMaxLimit' ||
|
field === "factoryMinLimit" ||
|
||||||
field === 'factoryDailyLimit') {
|
field === "factoryMaxLimit" ||
|
||||||
const regx = /^\d{1,8}(\.\d{0,2})?$/
|
field === "factoryDailyLimit"
|
||||||
|
) {
|
||||||
|
const regx = /^\d{1,8}(\.\d{0,2})?$/;
|
||||||
if (!regx.test(item.countryChannelDetails[field])) {
|
if (!regx.test(item.countryChannelDetails[field])) {
|
||||||
this.$opsMessage.fail('输入支持范围0 ~ 99999999最多2位小数')
|
this.$opsMessage.fail("输入支持范围0 ~ 99999999最多2位小数");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (field === 'factoryCurrencyPoint') {
|
if (field === "factoryCurrencyPoint") {
|
||||||
if (item.factoryCurrencyPoint < 0 || item.factoryCurrencyPoint > 6) {
|
if (item.factoryCurrencyPoint < 0 || item.factoryCurrencyPoint > 6) {
|
||||||
this.$opsMessage.fail('货币小数点范围0 ~ 6')
|
this.$opsMessage.fail("货币小数点范围0 ~ 6");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item.disabled = !item.countryChannelDetails.id
|
item.disabled = !item.countryChannelDetails.id;
|
||||||
item.loading = true
|
item.loading = true;
|
||||||
addOrUpdateCountyChannelDetails(item.countryChannelDetails).then(res => {
|
addOrUpdateCountyChannelDetails(item.countryChannelDetails)
|
||||||
item.loading = false
|
.then(res => {
|
||||||
item.disabled = false
|
item.loading = false;
|
||||||
item.countryChannelDetails.id = res.body.id
|
item.disabled = false;
|
||||||
}).catch(er => {
|
item.countryChannelDetails.id = res.body.id;
|
||||||
item.disabled = false
|
this.renderData();
|
||||||
item.loading = false
|
})
|
||||||
console.error(er)
|
.catch(er => {
|
||||||
})
|
item.disabled = false;
|
||||||
|
item.loading = false;
|
||||||
|
console.error(er);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
hideTransferChannel(isChange) {
|
hideTransferChannel(isChange) {
|
||||||
if (isChange) {
|
if (isChange) {
|
||||||
this.renderData()
|
this.renderData();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleChange(value, direction, movedKeys) {
|
handleChange(value, direction, movedKeys) {
|
||||||
const that = this
|
const that = this;
|
||||||
if (direction === 'right') {
|
if (direction === "right") {
|
||||||
addBatchCountyAssociateChannel({
|
addBatchCountyAssociateChannel({
|
||||||
payCountryId: that.payCountryId,
|
payCountryId: that.payCountryId,
|
||||||
channelCodes: movedKeys
|
channelCodes: movedKeys
|
||||||
}).then(res => {
|
|
||||||
that.$opsMessage.success()
|
|
||||||
}).catch(er => {
|
|
||||||
console.error(er)
|
|
||||||
})
|
})
|
||||||
return
|
.then(res => {
|
||||||
|
that.$opsMessage.success();
|
||||||
|
})
|
||||||
|
.catch(er => {
|
||||||
|
console.error(er);
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
delBatchPayCountryChannel({
|
delBatchPayCountryChannel({
|
||||||
payCountryId: that.payCountryId,
|
payCountryId: that.payCountryId,
|
||||||
channelCodes: movedKeys
|
channelCodes: movedKeys
|
||||||
}).then(res => {
|
|
||||||
that.$opsMessage.success()
|
|
||||||
}).catch(er => {
|
|
||||||
console.error(er)
|
|
||||||
})
|
})
|
||||||
|
.then(res => {
|
||||||
|
that.$opsMessage.success();
|
||||||
|
})
|
||||||
|
.catch(er => {
|
||||||
|
console.error(er);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
renderData() {
|
renderData() {
|
||||||
this.loadListPayCountryChannel(this.payCountryId)
|
this.loadListPayCountryChannel(this.payCountryId);
|
||||||
},
|
},
|
||||||
loadListPayCountryChannel(payCountryId) {
|
loadListPayCountryChannel(payCountryId) {
|
||||||
const that = this
|
const that = this;
|
||||||
that.loading = true
|
that.loading = true;
|
||||||
listPayCountryChannel(payCountryId).then(res => {
|
listPayCountryChannel(payCountryId)
|
||||||
that.loading = false
|
.then(res => {
|
||||||
const list = res.body || []
|
that.loading = false;
|
||||||
list.forEach(item => {
|
const list = res.body || [];
|
||||||
item.countryChannels.forEach(cItem => {
|
list.forEach(item => {
|
||||||
cItem.loading = false
|
item.countryChannels.forEach(cItem => {
|
||||||
cItem.disabled = false
|
cItem.loading = false;
|
||||||
})
|
cItem.disabled = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
that.list = list;
|
||||||
|
that.channelCodes = list.map(item => item.associated.channelCode);
|
||||||
})
|
})
|
||||||
that.list = list
|
.catch(er => {
|
||||||
that.channelCodes = list.map(item => item.associated.channelCode)
|
that.loading = false;
|
||||||
}).catch(er => {
|
console.error(er);
|
||||||
that.loading = false
|
});
|
||||||
console.error(er)
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.$emit('close')
|
this.$emit("close");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.associated-channels {
|
.associated-channels {
|
||||||
.el-switch__label {
|
.el-switch__label {
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.associated-channels {
|
.associated-channels {
|
||||||
@ -240,45 +357,43 @@ export default {
|
|||||||
max-height: 70vh;
|
max-height: 70vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
.operation-but {
|
.operation-but {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding: 0px 20px;
|
padding: 0px 20px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
top: 45px;
|
top: 45px;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
|
||||||
}
|
}
|
||||||
.channel-name {
|
.channel-name {
|
||||||
padding: 0px 5px;
|
padding: 0px 5px;
|
||||||
}
|
}
|
||||||
.channel-icon {
|
.channel-icon {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
.col {
|
.col {
|
||||||
padding: 0px 10px;
|
padding: 0px 10px;
|
||||||
}
|
}
|
||||||
.margin-top-10 {
|
.margin-top-10 {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.channel-item + .channel-item {
|
.channel-item + .channel-item {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.channel-item {
|
.channel-item {
|
||||||
background-color: #828f98;
|
background-color: #828f98;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
.channel-item-form {
|
.channel-item-form {
|
||||||
padding: 0px 5px;
|
padding: 0px 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.input-content {
|
.input-content {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
|
<!-- 搜索条件 -->
|
||||||
<div class="filter-container">
|
<div class="filter-container">
|
||||||
|
<!-- 上下架 -->
|
||||||
<el-select
|
<el-select
|
||||||
v-model="listQuery.shelf"
|
v-model="listQuery.shelf"
|
||||||
style="width: 120px"
|
style="width: 120px"
|
||||||
@ -9,12 +10,14 @@
|
|||||||
@change="handleSearch"
|
@change="handleSearch"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item, index ) in shelfStatus"
|
v-for="(item, index) in shelfStatus"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
|
<!-- 添加 按钮 -->
|
||||||
<el-button
|
<el-button
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -23,6 +26,8 @@
|
|||||||
>
|
>
|
||||||
添加
|
添加
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
|
<!-- 刷新 按钮 -->
|
||||||
<el-button
|
<el-button
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -33,6 +38,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 表单 -->
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="list"
|
:data="list"
|
||||||
@ -40,6 +46,7 @@
|
|||||||
fit
|
fit
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
>
|
>
|
||||||
|
<!-- 国家信息 -->
|
||||||
<el-table-column width="200" label="国家信息" align="center">
|
<el-table-column width="200" label="国家信息" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-image
|
<el-image
|
||||||
@ -53,7 +60,16 @@
|
|||||||
</el-image>
|
</el-image>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="200" label="国家名称" prop="country.aliasName" align="center" />
|
|
||||||
|
<!-- 国家名称 -->
|
||||||
|
<el-table-column
|
||||||
|
width="200"
|
||||||
|
label="国家名称"
|
||||||
|
prop="country.aliasName"
|
||||||
|
align="center"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 国家货币 -->
|
||||||
<el-table-column label="国家货币" prop="currency" align="center">
|
<el-table-column label="国家货币" prop="currency" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="clickInputCurrency(scope.row)">
|
<el-button type="text" @click="clickInputCurrency(scope.row)">
|
||||||
@ -62,7 +78,13 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="美元概率(?=$)" prop="usdExchangeRate" align="center">
|
|
||||||
|
<!-- 汇率 -->
|
||||||
|
<el-table-column
|
||||||
|
label="美元概率(?=$)"
|
||||||
|
prop="usdExchangeRate"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="clickUpdateRate(scope.row)">
|
<el-button type="text" @click="clickUpdateRate(scope.row)">
|
||||||
<span v-if="!scope.row.usdExchangeRate">点击入汇率</span>
|
<span v-if="!scope.row.usdExchangeRate">点击入汇率</span>
|
||||||
@ -70,6 +92,8 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<!-- 展示权重 -->
|
||||||
<el-table-column label="展示权重" prop="sort" align="center">
|
<el-table-column label="展示权重" prop="sort" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="clickInputUpdateSort(scope.row)">
|
<el-button type="text" @click="clickInputUpdateSort(scope.row)">
|
||||||
@ -78,6 +102,8 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<!-- 上下架 -->
|
||||||
<el-table-column label="上/下架" align="center">
|
<el-table-column label="上/下架" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
@ -88,14 +114,20 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<!-- 操作 -->
|
||||||
<el-table-column fixed="right" label="操作" align="center" width="100">
|
<el-table-column fixed="right" label="操作" align="center" width="100">
|
||||||
|
<!-- 关联渠道 -->
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="clickAssociateChannel(scope.row)">关联渠道</el-button>
|
<el-button type="text" @click="clickAssociateChannel(scope.row)"
|
||||||
|
>关联渠道</el-button
|
||||||
|
>
|
||||||
<!-- <el-button type="text" @click="clickAssociateChannelDetails(scope.row)">详情</el-button> -->
|
<!-- <el-button type="text" @click="clickAssociateChannelDetails(scope.row)">详情</el-button> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
<!-- 分页 组件 -->
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total > 0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
@ -104,171 +136,188 @@
|
|||||||
@pagination="renderData"
|
@pagination="renderData"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- 关联渠道组件 -->
|
||||||
<associated-channels
|
<associated-channels
|
||||||
v-if="formAssociatedChannelVisible"
|
v-if="formAssociatedChannelVisible"
|
||||||
:row="selectedRow"
|
:row="selectedRow"
|
||||||
@close="formAssociatedChannelVisible=false;selectedRow={}"
|
@close="
|
||||||
/>
|
formAssociatedChannelVisible = false;
|
||||||
<country-select
|
selectedRow = {};
|
||||||
v-if="countrySelectVisible"
|
"
|
||||||
@close="countrySelectClose"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<country-select v-if="countrySelectVisible" @close="countrySelectClose" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { pagePayOpenCounty, updatePayOpenCountyShelf, updatePayOpenCountryExchangeRate, updatePayOpenCountryCurrent, updatePayOpenCountrySort } from '@/api/sys-pay'
|
import {
|
||||||
import Pagination from '@/components/Pagination'
|
pagePayOpenCounty,
|
||||||
import AssociatedChannels from './associated-channels'
|
updatePayOpenCountyShelf,
|
||||||
import CountrySelect from './country-select'
|
updatePayOpenCountryExchangeRate,
|
||||||
|
updatePayOpenCountryCurrent,
|
||||||
|
updatePayOpenCountrySort
|
||||||
|
} from "@/api/sys-pay";
|
||||||
|
import Pagination from "@/components/Pagination";
|
||||||
|
import AssociatedChannels from "./associated-channels";
|
||||||
|
import CountrySelect from "./country-select";
|
||||||
export default {
|
export default {
|
||||||
name: 'CountryCodeInfo',
|
name: "CountryCodeInfo",
|
||||||
components: { Pagination, AssociatedChannels, CountrySelect },
|
components: { Pagination, AssociatedChannels, CountrySelect },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
shelfStatus: [
|
shelfStatus: [
|
||||||
{ value: true, name: '上架' },
|
{ value: true, name: "上架" },
|
||||||
{ value: false, name: '下架' }
|
{ value: false, name: "下架" }
|
||||||
],
|
],
|
||||||
countrySelectVisible: false,
|
countrySelectVisible: false,
|
||||||
formAssociatedChannelVisible: false,
|
formAssociatedChannelVisible: false,
|
||||||
selectedRow: {},
|
selectedRow: {},
|
||||||
//
|
//
|
||||||
formVisible: false,
|
formVisible: false,
|
||||||
textOptTitle: '',
|
textOptTitle: "",
|
||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
cursor: 1,
|
cursor: 1,
|
||||||
limit: 30,
|
limit: 30,
|
||||||
shelf: true,
|
shelf: true,
|
||||||
countryId: '',
|
countryId: "",
|
||||||
id: ''
|
id: ""
|
||||||
},
|
},
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
uploadLoading: false
|
uploadLoading: false
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.renderData()
|
this.renderData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
renderData(isClean) {
|
renderData(isClean) {
|
||||||
const that = this
|
const that = this;
|
||||||
that.listLoading = true
|
that.listLoading = true;
|
||||||
if (isClean === true) {
|
if (isClean === true) {
|
||||||
that.list = []
|
that.list = [];
|
||||||
that.listQuery.cursor = 1
|
that.listQuery.cursor = 1;
|
||||||
}
|
}
|
||||||
pagePayOpenCounty(that.listQuery).then(res => {
|
pagePayOpenCounty(that.listQuery).then(res => {
|
||||||
const { body } = res
|
const { body } = res;
|
||||||
that.total = body.total || 0
|
that.total = body.total || 0;
|
||||||
that.list = body.records
|
that.list = body.records;
|
||||||
that.listLoading = false
|
that.listLoading = false;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
handleSearch() {
|
handleSearch() {
|
||||||
this.renderData(true)
|
this.renderData(true);
|
||||||
},
|
},
|
||||||
createCountry() {
|
createCountry() {
|
||||||
this.countrySelectVisible = true
|
this.countrySelectVisible = true;
|
||||||
},
|
},
|
||||||
countrySelectClose() {
|
countrySelectClose() {
|
||||||
this.countrySelectVisible = false
|
this.countrySelectVisible = false;
|
||||||
this.renderData()
|
this.renderData();
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
handleClose() {
|
handleClose() {
|
||||||
// 去除校验
|
// 去除校验
|
||||||
this.$refs.form.clearValidate()
|
this.$refs.form.clearValidate();
|
||||||
this.formVisible = false
|
this.formVisible = false;
|
||||||
},
|
},
|
||||||
clickInputUpdateSort(row) {
|
clickInputUpdateSort(row) {
|
||||||
const that = this
|
const that = this;
|
||||||
that.$prompt('请输入新的权重数', '提示', {
|
that
|
||||||
confirmButtonText: '确定',
|
.$prompt("请输入新的权重数", "提示", {
|
||||||
cancelButtonText: '取消',
|
confirmButtonText: "确定",
|
||||||
inputPattern: /^\d{1,5}$/,
|
cancelButtonText: "取消",
|
||||||
inputErrorMessage: '范围0~99999小数最多两位',
|
inputPattern: /^\d{1,5}$/,
|
||||||
closeOnClickModal: false
|
inputErrorMessage: "范围0~99999小数最多两位",
|
||||||
}).then(({ value }) => {
|
closeOnClickModal: false
|
||||||
updatePayOpenCountrySort(row.id, value).then(res => {
|
|
||||||
that.$opsMessage.success()
|
|
||||||
that.renderData()
|
|
||||||
}).catch(er => {
|
|
||||||
console.error(er)
|
|
||||||
that.$opsMessage.fail()
|
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
.then(({ value }) => {
|
||||||
})
|
updatePayOpenCountrySort(row.id, value)
|
||||||
|
.then(res => {
|
||||||
|
that.$opsMessage.success();
|
||||||
|
that.renderData();
|
||||||
|
})
|
||||||
|
.catch(er => {
|
||||||
|
console.error(er);
|
||||||
|
that.$opsMessage.fail();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
clickInputCurrency(row) {
|
clickInputCurrency(row) {
|
||||||
const that = this
|
const that = this;
|
||||||
that.$prompt('请输入新的国家货币Code', '提示', {
|
that
|
||||||
confirmButtonText: '确定',
|
.$prompt("请输入新的国家货币Code", "提示", {
|
||||||
cancelButtonText: '取消',
|
confirmButtonText: "确定",
|
||||||
closeOnClickModal: false
|
cancelButtonText: "取消",
|
||||||
}).then(({ value }) => {
|
closeOnClickModal: false
|
||||||
updatePayOpenCountryCurrent(row.id, value).then(res => {
|
|
||||||
that.$opsMessage.success()
|
|
||||||
that.renderData()
|
|
||||||
}).catch(er => {
|
|
||||||
console.error(er)
|
|
||||||
that.$opsMessage.fail()
|
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
.then(({ value }) => {
|
||||||
})
|
updatePayOpenCountryCurrent(row.id, value)
|
||||||
|
.then(res => {
|
||||||
|
that.$opsMessage.success();
|
||||||
|
that.renderData();
|
||||||
|
})
|
||||||
|
.catch(er => {
|
||||||
|
console.error(er);
|
||||||
|
that.$opsMessage.fail();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
clickUpdateRate(row) {
|
clickUpdateRate(row) {
|
||||||
const that = this
|
const that = this;
|
||||||
that.$prompt('请输入新的美元汇率', '提示', {
|
that
|
||||||
confirmButtonText: '确定',
|
.$prompt("请输入新的美元汇率", "提示", {
|
||||||
cancelButtonText: '取消',
|
confirmButtonText: "确定",
|
||||||
inputPattern: /^\d{1,5}(\.\d{0,8})?$/,
|
cancelButtonText: "取消",
|
||||||
inputErrorMessage: '范围0~99999小数最多八位',
|
inputPattern: /^\d{1,5}(\.\d{0,8})?$/,
|
||||||
closeOnClickModal: false
|
inputErrorMessage: "范围0~99999小数最多八位",
|
||||||
}).then(({ value }) => {
|
closeOnClickModal: false
|
||||||
updatePayOpenCountryExchangeRate(row.id, value).then(res => {
|
|
||||||
that.$opsMessage.success()
|
|
||||||
that.renderData()
|
|
||||||
}).catch(er => {
|
|
||||||
console.error(er)
|
|
||||||
that.$opsMessage.fail()
|
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
.then(({ value }) => {
|
||||||
})
|
updatePayOpenCountryExchangeRate(row.id, value)
|
||||||
|
.then(res => {
|
||||||
|
that.$opsMessage.success();
|
||||||
|
that.renderData();
|
||||||
|
})
|
||||||
|
.catch(er => {
|
||||||
|
console.error(er);
|
||||||
|
that.$opsMessage.fail();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
clickAssociateChannel(row) {
|
clickAssociateChannel(row) {
|
||||||
const that = this
|
const that = this;
|
||||||
that.selectedRow = row
|
that.selectedRow = row;
|
||||||
that.formAssociatedChannelVisible = true
|
that.formAssociatedChannelVisible = true;
|
||||||
},
|
|
||||||
clickAssociateChannelDetails() {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
clickAssociateChannelDetails() {},
|
||||||
handleSwitchChange(row) {
|
handleSwitchChange(row) {
|
||||||
updatePayOpenCountyShelf(row.id, row.shelf)
|
updatePayOpenCountyShelf(row.id, row.shelf)
|
||||||
.then((res) => {})
|
.then(res => {})
|
||||||
.catch(er => {
|
.catch(er => {
|
||||||
row.shelf = !row.shelf
|
row.shelf = !row.shelf;
|
||||||
})
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.bottom {
|
||||||
|
color: #666;
|
||||||
|
font-size: 14px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
line-height: 25px;
|
||||||
|
.line {
|
||||||
|
display: flex;
|
||||||
|
> div {
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.bottom {
|
|
||||||
color: #666;
|
|
||||||
font-size: 14px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
line-height: 25px;
|
|
||||||
.line {
|
|
||||||
display: flex;
|
|
||||||
>div {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user