Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-app-operator-master
Commits
2b91e754
Commit
2b91e754
authored
Jul 09, 2023
by
邓春圆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增汇率列表
parent
4fb0fa81
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
163 additions
and
67 deletions
+163
-67
exchangeRate.js
src/api/ecw/exchangeRate.js
+8
-1
index.vue
src/views/ecw/exchangeRate/index.vue
+155
-66
No files found.
src/api/ecw/exchangeRate.js
View file @
2b91e754
...
...
@@ -42,7 +42,14 @@ export function getExchangeRatePage(query) {
params
:
query
})
}
// 汇率日志查询
export
function
getExchangeRateLogList
(
params
){
return
request
({
url
:
'
/ecw/exchange-rate-log/list
'
,
method
:
'
get
'
,
params
,
})
}
// 导出汇率管理 Excel
export
function
exportExchangeRateExcel
(
query
)
{
return
request
({
...
...
src/views/ecw/exchangeRate/index.vue
View file @
2b91e754
...
...
@@ -3,22 +3,18 @@
<!-- 搜索工作栏 -->
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"
原币种
"
prop=
"sourceCurrencyId"
>
<el-select
v-model=
"queryParams.sourceCurrencyId"
placeholder=
"请选择
原
币种"
clearable
size=
"small"
>
<el-option
v-for=
"dict in this.getDictDatas(DICT_TYPE.SYSTEM_USER_SEX)
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
<el-form-item
label=
"
币种1
"
prop=
"sourceCurrencyId"
>
<el-select
v-model=
"queryParams.sourceCurrencyId"
placeholder=
"请选择币种"
clearable
size=
"small"
>
<el-option
v-for=
"dict in currencyList
"
:key=
"dict.id"
:label=
"$l(dict,'title') + dict.fuhao"
:value=
"dict.id"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"
目标币种
"
prop=
"targetCurrencyId"
>
<el-select
v-model=
"queryParams.targetCurrencyId"
placeholder=
"请选择
目标
币种"
clearable
size=
"small"
>
<el-option
v-for=
"dict in this.getDictDatas(DICT_TYPE.SYSTEM_USER_SEX)
"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
<el-form-item
label=
"
币种2
"
prop=
"targetCurrencyId"
>
<el-select
v-model=
"queryParams.targetCurrencyId"
placeholder=
"请选择币种"
clearable
size=
"small"
>
<el-option
v-for=
"dict in currencyList
"
:key=
"dict.id"
:label=
"$l(dict,'title') + dict.fuhao"
:value=
"dict.id"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"创建时间"
>
<el-date-picker
v-model=
"dateRangeCreateTime"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
@
click=
"resetQuery"
>
重置
</el-button>
...
...
@@ -28,43 +24,58 @@
<!-- 操作工具栏 -->
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['ecw:exchange-rate:create']"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
:loading=
"exportLoading"
v-hasPermi=
"['ecw:exchange-rate:export']"
>
导出
</el-button>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
>
新增
</el-button>
<!-- v-hasPermi="['ecw:exchange-rate:create']"-->
</el-col>
<!--
<el-col
:span=
"1.5"
>
-->
<!--
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
:loading=
"exportLoading"
--
>
<!-- v-hasPermi="['ecw:exchange-rate:export']">导出
</el-button>
-->
<!--
</el-col>
-->
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
""
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"
原币种
"
align=
"center"
prop=
"sourceCurrencyId"
>
<el-table-column
label=
"
币种1
"
align=
"center"
prop=
"sourceCurrencyId"
>
<template
slot-scope=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.SYSTEM_USER_SEX"
:value=
"scope.row.sourceCurrencyId"
/>
{{
getCurrency
(
scope
.
row
.
sourceCurrencyId
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"原币种代码"
align=
"center"
prop=
"sourceCurrencyCode"
/>
<el-table-column
label=
"目标币种"
align=
"center"
prop=
"targetCurrencyId"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.SYSTEM_USER_SEX"
:value=
"scope.row.targetCurrencyId"
/>
<el-table-column
label=
"币种2"
>
<
template
v-slot=
"{row}"
>
{{
getCurrency
(
row
.
targetCurrencyId
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"目标种代码"
align=
"center"
prop=
"targetCurrencyCode"
/>
<el-table-column
label=
"汇率"
align=
"center"
prop=
"currencyRate"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
createTime
)
}}
</span>
<el-table-column
label=
"币种1 金额"
>
<
template
v-slot=
"{row}"
>
1
{{
getCurrency
(
row
.
sourceCurrencyId
,
true
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"币种1金额兑换币种2汇率"
prop=
"currencyRate"
></el-table-column>
<el-table-column
label=
"币种2金额"
>
<
template
v-slot=
"{row}"
>
{{
1
*
row
.
currencyRate
}}{{
getCurrency
(
row
.
targetCurrencyId
,
true
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"最后修改时间"
>
<
template
v-slot=
"{row}"
>
{{
parseTime
(
row
.
updateTime
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"最后修改人"
>
<
template
v-slot=
"{row}"
>
{{
getOperator
(
row
.
updater
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"备注"
prop=
"note"
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['ecw:exchange-rate:update']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['ecw:exchange-rate:delete']"
>
删除
</el-button>
<!-- v-hasPermi="['ecw:exchange-rate:update']"-->
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleLog(scope.row)"
>
日志
</el-button>
<!-- v-hasPermi="['ecw:exchange-rate:delete']"-->
</
template
>
</el-table-column>
</el-table>
...
...
@@ -74,48 +85,87 @@
<!-- 对话框(添加 / 修改) -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"
8
0px"
>
<el-form-item
label=
"
原币种
"
prop=
"sourceCurrencyId"
>
<el-select
v-model=
"form.sourceCurrencyId"
placeholder=
"请选择原
币种"
>
<el-option
v-for=
"dict in this.getDictDatas(DICT_TYPE.SYSTEM_USER_SEX)
"
:key=
"dict.
value"
:label=
"dict.label"
:value=
"parseInt(dict.value)
"
/>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"
10
0px"
>
<el-form-item
label=
"
币种1
"
prop=
"sourceCurrencyId"
>
<el-select
v-model=
"form.sourceCurrencyId"
placeholder=
"请选择
币种"
>
<el-option
@
click.native=
"() => form.sourceCurrencyCode = dict.fuhao"
v-for=
"dict in currencyList
"
:key=
"dict.
id"
:label=
"$l(dict,'title') + dict.fuhao"
:value=
"dict.id
"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"原币种代码"
prop=
"sourceCurrencyCode"
>
<el-input
v-model=
"form.sourceCurrencyCode"
placeholder=
"请输入原币种代码"
/>
</el-form-item>
<el-form-item
label=
"目标币种"
prop=
"targetCurrencyId"
>
<el-select
v-model=
"form.targetCurrencyId"
placeholder=
"请选择目标币种"
>
<el-option
v-for=
"dict in this.getDictDatas(DICT_TYPE.SYSTEM_USER_SEX)"
:key=
"dict.value"
:label=
"dict.label"
:value=
"parseInt(dict.value)"
/>
<el-form-item
label=
"币种2"
prop=
"targetCurrencyId"
>
<el-select
v-model=
"form.targetCurrencyId"
placeholder=
"请选择币种"
>
<el-option
@
click.native=
"() => form.targetCurrencyCode = dict.fuhao"
v-for=
"dict in currencyList"
:key=
"dict.id"
:label=
"$l(dict,'title') + dict.fuhao"
:value=
"dict.id"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"目标种代码"
prop=
"targetCurrencyCode"
>
<el-input
v-model=
"form.targetCurrencyCode"
placeholder=
"请输入目标种代码"
/>
</el-form-item>
<el-form-item
label=
"汇率"
prop=
"currencyRate"
>
<el-input
v-model=
"form.currencyRate"
placeholder=
"请输入汇率"
/>
<p
style=
"margin: 0;"
>
例子:1RMB = 0.138611USD
</p>
</el-form-item>
<el-form-item
label=
"备注"
>
<el-input
type=
"textarea"
v-model=
"form.note"
></el-input>
</el-form-item>
<
template
v-if=
"form.id"
>
<el-form-item
label=
"创建人"
>
{{
getOperator
(
form
.
updater
)
}}
</el-form-item>
<el-form-item
label=
"创建时间"
>
{{
parseTime
(
form
.
createTime
)
}}
</el-form-item>
<el-form-item
label=
"最后更新人"
>
{{
parseTime
(
form
.
updateTime
)
}}
</el-form-item>
<el-form-item
label=
"最后更新人"
>
{{
getOperator
(
form
.
updater
)
}}
</el-form-item>
</
template
>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<el-dialog
:visible.sync=
"openLog"
>
<el-table
:data=
"listLog"
>
<el-table-column
label=
"修改人"
prop=
"changeName"
></el-table-column>
<el-table-column
label=
"修改时间"
>
<
template
v-slot=
"{row}"
>
{{
parseTime
(
row
.
createTime
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"修改前内容"
>
<
template
v-slot=
"{row}"
>
币种1:【
{{
row
.
beforeChangeSourceValue
}}
】
<br/>
币种2:【
{{
row
.
beforeChangeTargetValue
}}
】
<br/>
汇率:【
{{
row
.
beforeChangeValue
}}
】
<br/>
</
template
>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<
script
>
import
{
createExchangeRate
,
updateExchangeRate
,
deleteExchangeRate
,
getExchangeRate
,
getExchangeRatePage
,
exportExchangeRateExcel
}
from
"
@/api/ecw/exchangeRate
"
;
import
{
createExchangeRate
,
updateExchangeRate
,
deleteExchangeRate
,
getExchangeRate
,
getExchangeRatePage
,
exportExchangeRateExcel
,
getExchangeRateLogList
}
from
"
@/api/ecw/exchangeRate
"
;
import
{
getCurrencyPage
}
from
"
@/api/ecw/currency
"
;
import
{
listAllSimpl
}
from
"
@/api/system/user
"
;
import
Template
from
"
@/views/cms/template/index.vue
"
;
export
default
{
name
:
"
ExchangeRate
"
,
components
:
{
Template
},
data
()
{
return
{
currencyList
:[],
allSimplList
:[],
listLog
:[],
openLog
:
false
,
// 遮罩层
loading
:
tru
e
,
loading
:
fals
e
,
// 导出遮罩层
exportLoading
:
false
,
// 显示搜索条件
...
...
@@ -140,24 +190,53 @@ export default {
form
:
{},
// 表单校验
rules
:
{
sourceCurrencyId
:
[{
required
:
true
,
message
:
"
原币种
不能为空
"
,
trigger
:
"
change
"
}],
sourceCurrencyId
:
[{
required
:
true
,
message
:
"
币种1
不能为空
"
,
trigger
:
"
change
"
}],
sourceCurrencyCode
:
[{
required
:
true
,
message
:
"
原币种代码不能为空
"
,
trigger
:
"
blur
"
}],
targetCurrencyId
:
[{
required
:
true
,
message
:
"
目标币种
不能为空
"
,
trigger
:
"
change
"
}],
targetCurrencyId
:
[{
required
:
true
,
message
:
"
币种2
不能为空
"
,
trigger
:
"
change
"
}],
targetCurrencyCode
:
[{
required
:
true
,
message
:
"
目标种代码不能为空
"
,
trigger
:
"
blur
"
}],
currencyRate
:
[{
required
:
true
,
message
:
"
汇率不能为空
"
,
trigger
:
"
blur
"
}],
}
};
},
created
()
{
listAllSimpl
().
then
(
r
=>
{
this
.
allSimplList
=
r
.
data
})
getCurrencyPage
({
pageNo
:
1
,
pageSize
:
1000
,}).
then
(
res
=>
this
.
currencyList
=
res
.
data
.
list
)
this
.
getList
();
},
methods
:
{
handleLog
(
row
){
this
.
openLog
=
true
;
getExchangeRateLogList
({
ids
:
row
.
id
}).
then
(
r
=>
{
console
.
log
(
r
,
'
rrr
'
)
this
.
listLog
=
r
.
data
;
})
},
getOperator
(
val
){
if
(
val
){
let
n
=
this
.
allSimplList
.
find
(
i
=>
i
.
id
==
val
)
return
n
?.
nickname
}
return
''
},
getCurrency
(
val
,
isEn
=
false
){
if
(
val
){
let
r
=
this
.
currencyList
.
find
(
i
=>
i
.
id
===
val
)
if
(
isEn
){
return
r
?.
titleEn
}
else
{
return
r
?.
titleZh
+
`(
${
r
?.
titleEn
})
`
}
}
return ''
},
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this
.
addBeginAndEndTime
(
params
,
this
.
dateRangeCreateTime
,
'
createTime
'
);
// 执行查询
getExchangeRatePage(params).then(response => {
this.list = response.data.list;
...
...
@@ -173,12 +252,13 @@ export default {
/** 表单重置 */
reset() {
this.form = {
id
:
undefined
,
sourceCurrencyId
:
undefined
,
sourceCurrencyCode
:
undefined
,
targetCurrencyId
:
undefined
,
targetCurrencyCode
:
undefined
,
currencyRate
:
undefined
,
"currencyRate": "",
"note": "",
"sourceCurrencyCode": "",
"sourceCurrencyId":'' ,
"targetCurrencyCode": "",
"targetCurrencyId": '',
id: null,
};
this.resetForm("form");
},
...
...
@@ -197,7 +277,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this
.
title
=
"
添加汇率管理
"
;
this.title = "
新增
";
},
/** 修改按钮操作 */
handleUpdate(row) {
...
...
@@ -206,7 +286,7 @@ export default {
getExchangeRate(id).then(response => {
this.form = response.data;
this.open = true;
this
.
title
=
"
修改
汇率管理
"
;
this.title = "修改";
});
},
/** 提交按钮 */
...
...
@@ -217,7 +297,16 @@ export default {
}
// 修改的提交
if (this.form.id != null) {
updateExchangeRate
(
this
.
form
).
then
(
response
=>
{
let p = {
currencyRate: Number(this.form.currencyRate),
id: this.form.id,
note: this.form.no,
sourceCurrencyCode: this.form.sourceCurrencyCode,
sourceCurrencyId: this.form.sourceCurrencyId ,
targetCurrencyCode: this.form.targetCurrencyCode,
targetCurrencyId: this.form.targetCurrencyId
}
updateExchangeRate(p).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment