Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qr-consistency-vue3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
刘怀志
qr-consistency-vue3
Commits
58203947
Commit
58203947
authored
Apr 14, 2025
by
祁正
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
市场法规清单列表
parent
94894cad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
345 additions
and
3 deletions
+345
-3
list.js
src/api/marketRegulations/list.js
+44
-0
index.vue
src/views/baseData/marketRegulations/index.vue
+301
-3
No files found.
src/api/marketRegulations/list.js
0 → 100644
View file @
58203947
import
request
from
'@/utils/request'
// 查询市场法规清单列表
export
function
listList
(
query
)
{
return
request
({
url
:
'/control/marketRegulations/list'
,
method
:
'get'
,
params
:
query
})
}
// 查询市场法规清单详细
export
function
getDataList
(
id
)
{
return
request
({
url
:
'/control/marketRegulations/'
+
id
,
method
:
'get'
})
}
// 新增市场法规清单
export
function
addList
(
data
)
{
return
request
({
url
:
'/control/marketRegulations'
,
method
:
'post'
,
data
:
data
})
}
// 修改市场法规清单
export
function
updateList
(
data
)
{
return
request
({
url
:
'/control/marketRegulations'
,
method
:
'put'
,
data
:
data
})
}
// 删除市场法规清单
export
function
delList
(
id
)
{
return
request
({
url
:
'/control/marketRegulations/'
+
id
,
method
:
'delete'
})
}
src/views/baseData/marketRegulations/index.vue
View file @
58203947
<
template
>
市场法规清单
<div
class=
"app-container"
>
<el-form
v-model=
"queryParams"
ref=
"queryRef"
:inline=
"true"
v-show=
"showSearch"
label-width=
"70px"
>
<el-form-item
label=
"适用市场"
prop=
"applicableMarket"
>
<el-input
v-model=
"queryParams.applicableMarket"
placeholder=
"请输入适用市场"
clearable
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"清单编号"
prop=
"listCode"
>
<el-input
v-model=
"queryParams.listCode"
placeholder=
"请输入清单编号"
clearable
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"清单名称"
prop=
"listName"
>
<el-input
v-model=
"queryParams.listName"
placeholder=
"请输入清单名称"
clearable
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"清单版本"
prop=
"listVersion"
>
<el-input
v-model=
"queryParams.listVersion"
placeholder=
"请输入清单版本"
clearable
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"清单状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.listStatus"
placeholder=
"清单状态"
clearable
style=
"width: 200px"
>
<el-option
v-for=
"dict in marketregulations_list_status"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
>
<el-button
type=
"primary"
icon=
"Search"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"Refresh"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-table
v-loading=
"loading"
:data=
"tableList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"index"
width=
"55"
align=
"center"
label=
"序号"
/>
<el-table-column
label=
"适用市场"
align=
"center"
prop=
"applicableMarket"
/>
<el-table-column
label=
"清单编号"
align=
"center"
prop=
"listCode"
/>
<el-table-column
label=
"清单名称"
align=
"center"
prop=
"listName"
/>
<el-table-column
label=
"左/右舵"
align=
"center"
prop=
"steeringType"
/>
<el-table-column
label=
"清单版本"
align=
"center"
prop=
"listVersion"
/>
<el-table-column
label=
"发布时间"
align=
"center"
prop=
"releaseDate"
width=
"180"
sortable
:sort-method=
"sortByTime"
>
<template
#
default=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
releaseDate
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"作者"
align
=
"center"
prop
=
"author"
/>
<
el
-
table
-
column
label
=
"清单状态"
align
=
"center"
prop
=
"listStatus"
>
<
template
#
default
=
"scope"
>
<
dict
-
tag
:
options
=
"marketregulations_list_status"
:
value
=
"scope.row.listStatus"
/>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"操作"
align
=
"center"
class
-
name
=
"small-padding fixed-width"
>
<
template
#
default
=
"scope"
>
<
el
-
button
type
=
"text"
@
click
=
"handleView(scope.row)"
>
查询详情
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
v
-
model
:
page
=
"queryParams.pageNum"
v
-
model
:
limit
=
"queryParams.pageSize"
@
pagination
=
"getList"
/>
<!--
添加或修改市场法规清单对话框
-->
<
el
-
dialog
:
title
=
"title"
v
-
model
=
"open"
width
=
"500px"
append
-
to
-
body
>
<
el
-
form
ref
=
"listRef"
:
model
=
"form"
:
rules
=
"rules"
label
-
width
=
"80px"
>
<
el
-
form
-
item
label
=
"适用市场"
prop
=
"applicableMarket"
>
<
el
-
input
v
-
model
=
"form.applicableMarket"
placeholder
=
"请输入适用市场"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"清单编号"
prop
=
"listCode"
>
<
el
-
input
v
-
model
=
"form.listCode"
placeholder
=
"请输入清单编号"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"清单名称"
prop
=
"listName"
>
<
el
-
input
v
-
model
=
"form.listName"
placeholder
=
"请输入清单名称"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"清单版本"
prop
=
"listVersion"
>
<
el
-
input
v
-
model
=
"form.listVersion"
placeholder
=
"请输入清单版本"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"发布时间"
prop
=
"releaseDate"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.releaseDate"
type
=
"date"
value
-
format
=
"YYYY-MM-DD"
placeholder
=
"请选择发布时间"
>
<
/el-date-picker
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"作者"
prop
=
"author"
>
<
el
-
input
v
-
model
=
"form.author"
placeholder
=
"请输入作者"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"备注"
prop
=
"remark"
>
<
el
-
input
v
-
model
=
"form.remark"
type
=
"textarea"
placeholder
=
"请输入内容"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"${comment
}
"
prop
=
"delFlag"
>
<
el
-
input
v
-
model
=
"form.delFlag"
placeholder
=
"请输入${comment
}
"
/>
<
/el-form-item
>
<
/el-form
>
<
template
#
footer
>
<
div
class
=
"dialog-footer"
>
<
el
-
button
type
=
"primary"
@
click
=
"submitForm"
>
确
定
<
/el-button
>
<
el
-
button
@
click
=
"cancel"
>
取
消
<
/el-button
>
<
/div
>
<
/template
>
<
/el-dialog
>
<
/div
>
<
/template
>
<
script
setup
>
import
{
listList
,
getDataList
,
delList
,
addList
,
updateList
}
from
"@/api/marketRegulations/list"
;
</
script
>
const
{
proxy
}
=
getCurrentInstance
();
const
{
marketregulations_list_status
}
=
proxy
.
useDict
(
'marketregulations_list_status'
)
const
tableList
=
ref
([]);
<
style
scoped
lang=
"scss"
>
const
open
=
ref
(
false
);
const
loading
=
ref
(
true
);
const
showSearch
=
ref
(
true
);
const
ids
=
ref
([]);
const
single
=
ref
(
true
);
const
multiple
=
ref
(
true
);
const
total
=
ref
(
0
);
const
title
=
ref
(
""
);
const
queryParams
=
ref
({
pageNum
:
1
,
pageSize
:
10
,
applicableMarket
:
null
,
listCode
:
null
,
listName
:
null
,
listVersion
:
null
,
listStatus
:
null
,
}
)
const
data
=
reactive
({
form
:
{
}
,
rules
:
{
}
}
);
const
{
form
,
rules
}
=
toRefs
(
data
);
/** 查询市场法规清单列表 */
function
getList
()
{
loading
.
value
=
true
;
listList
(
queryParams
.
value
).
then
(
response
=>
{
tableList
.
value
=
response
.
rows
;
total
.
value
=
response
.
total
;
loading
.
value
=
false
;
}
);
}
// 取消按钮
function
cancel
()
{
open
.
value
=
false
;
reset
();
}
const
sortByTime
=
(
a
,
b
)
=>
{
const
timeA
=
new
Date
(
a
.
releaseDate
).
getTime
();
const
timeB
=
new
Date
(
b
.
releaseDate
).
getTime
();
return
timeB
-
timeA
;
// 降序排序
}
;
// 表单重置
function
reset
()
{
form
.
value
=
{
id
:
null
,
applicableMarket
:
null
,
listCode
:
null
,
listName
:
null
,
steeringType
:
null
,
listVersion
:
null
,
releaseDate
:
null
,
author
:
null
,
listStatus
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
,
remark
:
null
,
delFlag
:
null
}
;
proxy
.
resetForm
(
"listRef"
);
}
/** 搜索按钮操作 */
function
handleQuery
()
{
queryParams
.
value
.
pageNum
=
1
;
getList
();
}
/** 重置按钮操作 */
function
resetQuery
()
{
proxy
.
resetForm
(
"queryRef"
);
queryParams
.
value
=
{
pageNum
:
1
,
pageSize
:
10
,
applicableMarket
:
null
,
listCode
:
null
,
listName
:
null
,
listVersion
:
null
,
listStatus
:
null
,
}
handleQuery
();
}
function
handleView
(
row
){
console
.
log
(
row
)
}
// 多选框选中数据
function
handleSelectionChange
(
selection
)
{
ids
.
value
=
selection
.
map
(
item
=>
item
.
id
);
single
.
value
=
selection
.
length
!==
1
;
multiple
.
value
=
!
selection
.
length
;
}
/** 新增按钮操作 */
function
handleAdd
()
{
reset
();
open
.
value
=
true
;
title
.
value
=
"添加市场法规清单"
;
}
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
reset
();
const
_id
=
row
.
id
||
ids
.
value
getDataList
(
_id
).
then
(
response
=>
{
form
.
value
=
response
.
data
;
open
.
value
=
true
;
title
.
value
=
"修改市场法规清单"
;
}
);
}
/** 提交按钮 */
function
submitForm
()
{
proxy
.
$refs
[
"listRef"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
form
.
value
.
id
!=
null
)
{
updateList
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"修改成功"
);
open
.
value
=
false
;
getList
();
}
);
}
else
{
addList
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
open
.
value
=
false
;
getList
();
}
);
}
}
}
);
}
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
const
_ids
=
row
.
id
||
ids
.
value
;
proxy
.
$modal
.
confirm
(
'是否确认删除市场法规清单编号为"'
+
_ids
+
'"的数据项?'
).
then
(
function
()
{
return
delList
(
_ids
);
}
).
then
(()
=>
{
getList
();
proxy
.
$modal
.
msgSuccess
(
"删除成功"
);
}
).
catch
(()
=>
{
}
);
}
/** 导出按钮操作 */
function
handleExport
()
{
proxy
.
download
(
'marketRegulations/list/export'
,
{
...
queryParams
.
value
}
,
`list_${new Date().getTime()
}
.xlsx`
)
}
getList
();
<
/script
>
<
style
scoped
lang
=
"scss"
>
:
deep
(.
el
-
form
--
inline
.
el
-
form
-
item
)
{
margin
-
right
:
20
px
;
}
<
/style
>
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