68 lines
1.2 KiB
JavaScript
68 lines
1.2 KiB
JavaScript
import request from '@/utils/request'
|
|
|
|
// 查询汇率列表
|
|
export function listExchangeRate(query) {
|
|
return request({
|
|
url: '/data/exchangerate/list',
|
|
method: 'get',
|
|
params: query
|
|
})
|
|
}
|
|
|
|
// 查询汇率详细
|
|
export function getExchangeRate(rateId) {
|
|
return request({
|
|
url: '/data/exchangerate/' + rateId,
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
// 新增汇率
|
|
export function addExchangeRate(data) {
|
|
return request({
|
|
url: '/data/exchangerate',
|
|
method: 'post',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 修改汇率
|
|
export function updateExchangeRate(data) {
|
|
return request({
|
|
url: '/data/exchangerate',
|
|
method: 'put',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 删除汇率
|
|
export function delExchangeRate(rateIds) {
|
|
return request({
|
|
url: '/data/exchangerate/' + rateIds,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 汇率换算
|
|
* @param {Object} params amount/fromCurrency/toCurrency/rateType/bizDate
|
|
*/
|
|
export function convertExchangeRate(params) {
|
|
return request({
|
|
url: '/data/exchangerate/convert',
|
|
method: 'get',
|
|
params: params
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 任意币种金额折算本位币(CNY)
|
|
*/
|
|
export function convertToBase(params) {
|
|
return request({
|
|
url: '/data/exchangerate/toBase',
|
|
method: 'get',
|
|
params: params
|
|
})
|
|
}
|