Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a319d090
authored
Apr 02, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REVIEW 支付商户
parent
aea1270d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
107 deletions
+111
-107
src/api/pay/merchant/index.ts
+9
-8
src/views/pay/merchant/MerchantForm.vue
+17
-17
src/views/pay/merchant/index.vue
+82
-79
src/views/system/notice/index.vue
+3
-3
No files found.
src/api/pay/merchant/index.ts
View file @
a319d090
...
@@ -29,17 +29,17 @@ export interface MerchantExportReqVO {
...
@@ -29,17 +29,17 @@ export interface MerchantExportReqVO {
}
}
// 查询列表支付商户
// 查询列表支付商户
export
const
getMerchantPage
Api
=
(
params
:
MerchantPageReqVO
)
=>
{
export
const
getMerchantPage
=
(
params
:
MerchantPageReqVO
)
=>
{
return
request
.
get
({
url
:
'/pay/merchant/page'
,
params
})
return
request
.
get
({
url
:
'/pay/merchant/page'
,
params
})
}
}
// 查询详情支付商户
// 查询详情支付商户
export
const
getMerchant
Api
=
(
id
:
number
)
=>
{
export
const
getMerchant
=
(
id
:
number
)
=>
{
return
request
.
get
({
url
:
'/pay/merchant/get?id='
+
id
})
return
request
.
get
({
url
:
'/pay/merchant/get?id='
+
id
})
}
}
// 根据商户名称搜索商户列表
// 根据商户名称搜索商户列表
export
const
getMerchantListByName
Api
=
(
name
:
string
)
=>
{
export
const
getMerchantListByName
=
(
name
:
string
)
=>
{
return
request
.
get
({
return
request
.
get
({
url
:
'/pay/merchant/list-by-name?id='
,
url
:
'/pay/merchant/list-by-name?id='
,
params
:
{
params
:
{
...
@@ -49,26 +49,27 @@ export const getMerchantListByNameApi = (name: string) => {
...
@@ -49,26 +49,27 @@ export const getMerchantListByNameApi = (name: string) => {
}
}
// 新增支付商户
// 新增支付商户
export
const
createMerchant
Api
=
(
data
:
MerchantVO
)
=>
{
export
const
createMerchant
=
(
data
:
MerchantVO
)
=>
{
return
request
.
post
({
url
:
'/pay/merchant/create'
,
data
})
return
request
.
post
({
url
:
'/pay/merchant/create'
,
data
})
}
}
// 修改支付商户
// 修改支付商户
export
const
updateMerchant
Api
=
(
data
:
MerchantVO
)
=>
{
export
const
updateMerchant
=
(
data
:
MerchantVO
)
=>
{
return
request
.
put
({
url
:
'/pay/merchant/update'
,
data
})
return
request
.
put
({
url
:
'/pay/merchant/update'
,
data
})
}
}
// 删除支付商户
// 删除支付商户
export
const
deleteMerchant
Api
=
(
id
:
number
)
=>
{
export
const
deleteMerchant
=
(
id
:
number
)
=>
{
return
request
.
delete
({
url
:
'/pay/merchant/delete?id='
+
id
})
return
request
.
delete
({
url
:
'/pay/merchant/delete?id='
+
id
})
}
}
// 导出支付商户
// 导出支付商户
export
const
exportMerchant
Api
=
(
params
:
MerchantExportReqVO
)
=>
{
export
const
exportMerchant
=
(
params
:
MerchantExportReqVO
)
=>
{
return
request
.
download
({
url
:
'/pay/merchant/export-excel'
,
params
})
return
request
.
download
({
url
:
'/pay/merchant/export-excel'
,
params
})
}
}
// 支付商户状态修改
// 支付商户状态修改
export
const
changeMerchantStatusApi
=
(
id
:
number
,
status
:
number
)
=>
{
export
const
updateMerchantStatus
=
(
id
:
number
,
status
:
number
)
=>
{
const
data
=
{
const
data
=
{
id
,
id
,
status
status
...
...
src/views/pay/merchant/
f
orm.vue
→
src/views/pay/merchant/
MerchantF
orm.vue
View file @
a319d090
<
template
>
<
template
>
<Dialog
:title=
"modelTitle"
v-model=
"modelVisible"
width=
"800"
>
<Dialog
:title=
"modelTitle"
v-model=
"modelVisible"
>
<!-- 对话框(添加 / 修改) -->
<el-form
ref=
"formRef"
:model=
"formData"
:rules=
"formRules"
label-width=
"80px"
>
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"formRules"
label-width=
"80px"
>
<el-form-item
label=
"商户全称"
prop=
"name"
>
<el-form-item
label=
"商户全称"
prop=
"name"
>
<el-input
v-model=
"form.name"
placeholder=
"请输入商户全称"
/>
<el-input
v-model=
"form
Data
.name"
placeholder=
"请输入商户全称"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"商户简称"
prop=
"shortName"
>
<el-form-item
label=
"商户简称"
prop=
"shortName"
>
<el-input
v-model=
"form.shortName"
placeholder=
"请输入商户简称"
/>
<el-input
v-model=
"form
Data
.shortName"
placeholder=
"请输入商户简称"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"开启状态"
prop=
"status"
>
<el-form-item
label=
"开启状态"
prop=
"status"
>
<el-select
v-model=
"form.status"
placeholder=
"请选择状态"
clearable
>
<el-select
v-model=
"form
Data
.status"
placeholder=
"请选择状态"
clearable
>
<el-option
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value"
:key=
"dict.value"
...
@@ -19,7 +18,7 @@
...
@@ -19,7 +18,7 @@
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form
.remark"
placeholder=
"请输入备注"
/>
<el-input
type=
"textarea"
v-model=
"formData
.remark"
placeholder=
"请输入备注"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<template
#
footer
>
<template
#
footer
>
...
@@ -31,6 +30,7 @@
...
@@ -31,6 +30,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
*
as
MerchantApi
from
'@/api/pay/merchant'
import
*
as
MerchantApi
from
'@/api/pay/merchant'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
const
{
t
}
=
useI18n
()
// 国际化
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
...
@@ -38,11 +38,11 @@ const modelVisible = ref(false) // 弹窗的是否展示
...
@@ -38,11 +38,11 @@ const modelVisible = ref(false) // 弹窗的是否展示
const
modelTitle
=
ref
(
''
)
// 弹窗的标题
const
modelTitle
=
ref
(
''
)
// 弹窗的标题
const
formLoading
=
ref
(
false
)
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const
formLoading
=
ref
(
false
)
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const
formType
=
ref
(
''
)
// 表单的类型:create - 新增;update - 修改
const
formType
=
ref
(
''
)
// 表单的类型:create - 新增;update - 修改
const
form
=
ref
({
const
form
Data
=
ref
({
id
:
undefined
,
id
:
undefined
,
name
:
''
,
name
:
''
,
shortName
:
''
,
shortName
:
''
,
status
:
undefined
,
status
:
CommonStatusEnum
.
ENABLE
,
remark
:
''
remark
:
''
})
})
const
formRules
=
reactive
({
const
formRules
=
reactive
({
...
@@ -53,7 +53,7 @@ const formRules = reactive({
...
@@ -53,7 +53,7 @@ const formRules = reactive({
const
formRef
=
ref
()
// 表单 Ref
const
formRef
=
ref
()
// 表单 Ref
/** 打开弹窗 */
/** 打开弹窗 */
const
open
Modal
=
async
(
type
:
string
,
id
?:
number
)
=>
{
const
open
=
async
(
type
:
string
,
id
?:
number
)
=>
{
modelVisible
.
value
=
true
modelVisible
.
value
=
true
modelTitle
.
value
=
t
(
'action.'
+
type
)
modelTitle
.
value
=
t
(
'action.'
+
type
)
formType
.
value
=
type
formType
.
value
=
type
...
@@ -62,13 +62,13 @@ const openModal = async (type: string, id?: number) => {
...
@@ -62,13 +62,13 @@ const openModal = async (type: string, id?: number) => {
if
(
id
)
{
if
(
id
)
{
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
form
.
value
=
await
MerchantApi
.
getMerchantApi
(
id
)
form
Data
.
value
=
await
MerchantApi
.
getMerchant
(
id
)
}
finally
{
}
finally
{
formLoading
.
value
=
false
formLoading
.
value
=
false
}
}
}
}
}
}
defineExpose
({
open
Modal
})
// 提供 openModal
方法,用于打开弹窗
defineExpose
({
open
})
// 提供 open
方法,用于打开弹窗
/** 提交表单 */
/** 提交表单 */
const
emit
=
defineEmits
([
'success'
])
// 定义 success 事件,用于操作成功后的回调
const
emit
=
defineEmits
([
'success'
])
// 定义 success 事件,用于操作成功后的回调
...
@@ -80,12 +80,12 @@ const submitForm = async () => {
...
@@ -80,12 +80,12 @@ const submitForm = async () => {
// 提交请求
// 提交请求
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
const
data
=
form
.
value
as
unknown
as
MerchantApi
.
MerchantVO
const
data
=
form
Data
.
value
as
unknown
as
MerchantApi
.
MerchantVO
if
(
formType
.
value
===
'create'
)
{
if
(
formType
.
value
===
'create'
)
{
await
MerchantApi
.
createMerchant
Api
(
data
)
await
MerchantApi
.
createMerchant
(
data
)
message
.
success
(
t
(
'common.createSuccess'
))
message
.
success
(
t
(
'common.createSuccess'
))
}
else
{
}
else
{
await
MerchantApi
.
updateMerchant
Api
(
data
)
await
MerchantApi
.
updateMerchant
(
data
)
message
.
success
(
t
(
'common.updateSuccess'
))
message
.
success
(
t
(
'common.updateSuccess'
))
}
}
modelVisible
.
value
=
false
modelVisible
.
value
=
false
...
@@ -98,11 +98,11 @@ const submitForm = async () => {
...
@@ -98,11 +98,11 @@ const submitForm = async () => {
/** 重置表单 */
/** 重置表单 */
const
resetForm
=
()
=>
{
const
resetForm
=
()
=>
{
form
.
value
=
{
form
Data
.
value
=
{
id
:
undefined
,
id
:
undefined
,
name
:
''
,
name
:
''
,
shortName
:
''
,
shortName
:
''
,
status
:
undefined
,
status
:
CommonStatusEnum
.
ENABLE
,
remark
:
''
remark
:
''
}
}
formRef
.
value
?.
resetFields
()
formRef
.
value
?.
resetFields
()
...
...
src/views/pay/merchant/index.vue
View file @
a319d090
<
template
>
<
template
>
<content-wrap>
<content-wrap>
<!-- 搜索工作栏 -->
<el-form
<el-form
class=
"-mb-15px"
:model=
"queryParams"
:model=
"queryParams"
ref=
"queryFormRef"
ref=
"queryFormRef"
:inline=
"true"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
label-width=
"68px"
><el-form-item
label=
"商户号"
prop=
"no"
>
>
<el-input
v-model=
"queryParams.no"
placeholder=
"请输入商户号"
clearable
/>
<el-form-item
label=
"商户号"
prop=
"no"
>
<el-input
v-model=
"queryParams.no"
placeholder=
"请输入商户号"
clearable
class=
"!w-240px"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"商户全称"
prop=
"name"
>
<el-form-item
label=
"商户全称"
prop=
"name"
>
<el-input
v-model=
"queryParams.name"
placeholder=
"请输入商户全称"
clearable
/>
<el-input
v-model=
"queryParams.name"
placeholder=
"请输入商户全称"
clearable
class=
"!w-240px"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"商户简称"
prop=
"shortName"
>
<el-form-item
label=
"商户简称"
prop=
"shortName"
>
<el-input
v-model=
"queryParams.shortName"
placeholder=
"请输入商户简称"
clearable
/>
<el-input
v-model=
"queryParams.shortName"
placeholder=
"请输入商户简称"
clearable
class=
"!w-240px"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"开启状态"
prop=
"status"
>
<el-form-item
label=
"开启状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"字典状态"
clearable
class=
"!w-240px"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"字典状态"
clearable
class=
"!w-240px"
>
<el-option
<el-option
v-for=
"dict in getDictOptions(DICT_TYPE.COMMON_STATUS)"
v-for=
"dict in get
Int
DictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"
parseInt(dict.value)
"
:key=
"
dict.value
"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"queryParams.remark"
placeholder=
"请输入备注"
clearable
/>
<el-input
v-model=
"queryParams.remark"
placeholder=
"请输入备注"
clearable
class=
"!w-240px"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"创建时间"
prop=
"createTime"
>
<el-form-item
label=
"创建时间"
prop=
"createTime"
>
<el-date-picker
<el-date-picker
v-model=
"queryParams.createTime"
v-model=
"queryParams.createTime"
style=
"width: 240px"
value-format=
"YYYY-MM-DD HH:mm:ss"
value-format=
"YYYY-MM-DD HH:mm:ss"
type=
"datetimerange"
type=
"datetimerange"
range-separator=
"-"
start-placeholder=
"开始日期"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
end-placeholder=
"结束日期"
class=
"!w-240px"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
@
click=
"handleQuery"
><Icon
icon=
"ep:search"
class=
"mr-5px"
/>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
@
click=
"resetQuery"
>
重置
</el-button>
<el-button
@
click=
"resetQuery"
><Icon
icon=
"ep:refresh"
class=
"mr-5px"
/>
重置
</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"primary"
plain
plain
icon=
"el-icon-plus"
type=
"primary"
size=
"small"
@
click=
"openForm('create')"
@
click=
"openModal('create')"
v-hasPermi=
"['pay:merchant:create']"
v-hasPermi=
"['pay:merchant:create']"
>
新增
</el-button
>
>
</el-col>
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
新增
<el-col
:span=
"1.5"
>
</el-button
>
<el-button
<el-button
type=
"
warning
"
type=
"
success
"
plain
plain
icon=
"el-icon-download"
size=
"small"
:loading=
"exportLoading"
@
click=
"handleExport"
@
click=
"handleExport"
:loading=
"exportLoading"
v-hasPermi=
"['pay:merchant:export']"
v-hasPermi=
"['pay:merchant:export']"
>
导出
</el-button
>
>
</el-col>
<Icon
icon=
"ep:download"
class=
"mr-5px"
/>
导出
</el-row>
</el-button>
</el-form-item>
</el-form>
</content-wrap>
</content-wrap>
<!-- 列表 -->
<content-wrap>
<content-wrap>
<!-- 列表 -->
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"商户编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"商户编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"商户号"
align=
"center"
prop=
"no"
/>
<el-table-column
label=
"商户号"
align=
"center"
prop=
"no"
/>
...
@@ -92,52 +99,51 @@
...
@@ -92,52 +99,51 @@
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
<el-table-column
label=
"创建时间"
label=
"创建时间"
:formatter=
"dateFormatter"
align=
"center"
align=
"center"
prop=
"createTime"
prop=
"createTime"
:formatter=
"dateFormatter"
width=
"180"
width=
"180"
/>
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
<el-button
link
link
type=
"primary"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"openForm('update', scope.row.id)"
@
click=
"openModal('update', scope.row.id)"
v-hasPermi=
"['pay:merchant:update']"
v-hasPermi=
"['pay:merchant:update']"
>
修改
</el-button
>
>
修改
</el-button>
<el-button
<el-button
link
link
type=
"danger"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row.id)"
@
click=
"handleDelete(scope.row.id)"
v-hasPermi=
"['pay:merchant:delete']"
v-hasPermi=
"['pay:merchant:delete']"
>
删除
</el-button
>
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!-- 分页组件 -->
<!-- 分页 -->
<pagination
<Pagination
v-show=
"total > 0"
:total=
"total"
:total=
"total"
v-model:page=
"queryParams.pageNo"
v-model:page=
"queryParams.pageNo"
v-model:limit=
"queryParams.pageSize"
v-model:limit=
"queryParams.pageSize"
@
pagination=
"getList"
@
pagination=
"getList"
/>
/>
<!-- 表单弹窗:添加/修改 -->
<MerchantForm
ref=
"modalRef"
@
success=
"getList"
/>
</content-wrap>
</content-wrap>
</template>
<!-- 表单弹窗:添加/修改 -->
<MerchantForm
ref=
"formRef"
@
success=
"getList"
/>
</template>
<
script
setup
lang=
"ts"
name=
"Merchant"
>
<
script
setup
lang=
"ts"
name=
"Merchant"
>
import
{
DICT_TYPE
,
getDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
*
as
MerchantApi
from
'@/api/pay/merchant'
import
MerchantForm
from
'./form.vue'
import
download
from
'@/utils/download'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
download
from
'@/utils/download'
import
*
as
MerchantApi
from
'@/api/pay/merchant'
import
MerchantForm
from
'./MerchantForm.vue'
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
const
{
t
}
=
useI18n
()
// 国际化
const
{
t
}
=
useI18n
()
// 国际化
...
@@ -145,21 +151,20 @@ const loading = ref(true) // 列表的加载中
...
@@ -145,21 +151,20 @@ const loading = ref(true) // 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
([])
// 列表的数据
const
list
=
ref
([])
// 列表的数据
const
queryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
name
:
''
,
name
:
''
,
shortName
:
''
,
shortName
:
''
,
status
:
undefined
,
status
:
undefined
pageNo
:
1
,
pageSize
:
100
})
})
const
queryFormRef
=
ref
()
// 搜索的表单
const
queryFormRef
=
ref
()
// 搜索的表单
const
showSearch
=
ref
(
true
)
const
exportLoading
=
ref
(
false
)
// 导出的加载中
const
exportLoading
=
ref
(
false
)
// 导出的加载中
/** 查询列表 */
/** 查询列表 */
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
const
data
=
await
MerchantApi
.
getMerchantPageApi
(
queryParams
)
const
data
=
await
MerchantApi
.
getMerchantPage
(
queryParams
)
list
.
value
=
data
.
list
list
.
value
=
data
.
list
total
.
value
=
data
.
total
total
.
value
=
data
.
total
}
finally
{
}
finally
{
...
@@ -180,9 +185,9 @@ const resetQuery = () => {
...
@@ -180,9 +185,9 @@ const resetQuery = () => {
}
}
/** 添加/修改操作 */
/** 添加/修改操作 */
const
modal
Ref
=
ref
()
const
form
Ref
=
ref
()
const
open
Modal
=
(
type
:
string
,
id
?:
number
)
=>
{
const
open
Form
=
(
type
:
string
,
id
?:
number
)
=>
{
modalRef
.
value
.
openModal
(
type
,
id
)
formRef
.
value
.
open
(
type
,
id
)
}
}
/** 删除按钮操作 */
/** 删除按钮操作 */
...
@@ -191,30 +196,28 @@ const handleDelete = async (id: number) => {
...
@@ -191,30 +196,28 @@ const handleDelete = async (id: number) => {
// 删除的二次确认
// 删除的二次确认
await
message
.
delConfirm
()
await
message
.
delConfirm
()
// 发起删除
// 发起删除
await
MerchantApi
.
deleteMerchant
Api
(
id
)
await
MerchantApi
.
deleteMerchant
(
id
)
message
.
success
(
t
(
'common.delSuccess'
))
message
.
success
(
t
(
'common.delSuccess'
))
// 刷新列表
// 刷新列表
await
getList
()
await
getList
()
}
catch
{}
}
catch
{}
}
}
// 启用状态修改
/** 修改状态操作 */
const
handleStatusChange
=
(
row
:
MerchantApi
.
MerchantVO
)
=>
{
const
handleStatusChange
=
async
(
row
:
MerchantApi
.
MerchantVO
)
=>
{
let
info
=
row
.
status
===
CommonStatusEnum
.
ENABLE
?
'启用'
:
'停用'
try
{
message
// 修改状态的二次确认
.
confirm
(
'确认要"'
+
info
+
'""'
+
row
.
name
+
'"商户吗?'
,
t
(
'common.reminder'
))
const
text
=
row
.
status
===
CommonStatusEnum
.
ENABLE
?
'启用'
:
'停用'
.
then
(
async
()
=>
{
await
message
.
confirm
(
'确认要"'
+
text
+
'""'
+
row
.
name
+
'"商户吗?'
,
t
(
'common.reminder'
))
row
.
status
=
// 发起修改状态
row
.
status
===
CommonStatusEnum
.
ENABLE
?
CommonStatusEnum
.
ENABLE
:
CommonStatusEnum
.
DISABLE
await
MerchantApi
.
updateMerchantStatus
(
row
.
id
,
row
.
status
)
await
MerchantApi
.
updateMerchantApi
(
row
)
// 刷新列表
message
.
success
(
info
+
'成功'
)
await
getList
()
// 刷新列表
}
catch
{
getList
()
// 取消后,进行恢复按钮
})
row
.
status
=
.
catch
(()
=>
{
row
.
status
===
CommonStatusEnum
.
ENABLE
?
CommonStatusEnum
.
DISABLE
:
CommonStatusEnum
.
ENABLE
row
.
status
=
}
row
.
status
===
CommonStatusEnum
.
ENABLE
?
CommonStatusEnum
.
DISABLE
:
CommonStatusEnum
.
ENABLE
})
}
}
/** 导出按钮操作 */
/** 导出按钮操作 */
...
@@ -224,7 +227,7 @@ const handleExport = async () => {
...
@@ -224,7 +227,7 @@ const handleExport = async () => {
await
message
.
exportConfirm
()
await
message
.
exportConfirm
()
// 发起导出
// 发起导出
exportLoading
.
value
=
true
exportLoading
.
value
=
true
const
data
=
await
MerchantApi
.
exportMerchant
Api
(
queryParams
)
const
data
=
await
MerchantApi
.
exportMerchant
(
queryParams
)
download
.
excel
(
data
,
'商户信息.xls'
)
download
.
excel
(
data
,
'商户信息.xls'
)
}
catch
{
}
catch
{
}
finally
{
}
finally
{
...
...
src/views/system/notice/index.vue
View file @
a319d090
...
@@ -114,11 +114,11 @@ const loading = ref(true) // 列表的加载中
...
@@ -114,11 +114,11 @@ const loading = ref(true) // 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
([])
// 列表的数据
const
list
=
ref
([])
// 列表的数据
const
queryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
title
:
''
,
title
:
''
,
type
:
undefined
,
type
:
undefined
,
status
:
undefined
,
status
:
undefined
pageNo
:
1
,
pageSize
:
100
})
})
const
queryFormRef
=
ref
()
// 搜索的表单
const
queryFormRef
=
ref
()
// 搜索的表单
...
...
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