Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peizhen-vue
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PeiZhen-Java
peizhen-vue
Commits
420a520a
Commit
420a520a
authored
Sep 08, 2023
by
‘巴博尔’
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature_lyj' of git.nyinhong.com:PeiZhen-Java/peizhen-vue into feature/v1/plb
parents
5e0efc57
2014bb03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
980 additions
and
753 deletions
+980
-753
src/views/operation/banner/index.vue
+349
-287
src/views/operation/business/index.vue
+294
-206
src/views/operation/notice/index.vue
+337
-260
No files found.
src/views/operation/banner/index.vue
View file @
420a520a
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"城市"
prop=
"cityId"
>
<el-input
v-model=
"queryParams.cityId"
placeholder=
"请输入城市"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"位置"
prop=
"site"
>
<el-select
v-model=
"queryParams.site"
placeholder=
"请选择"
>
<el-option
v-for=
"item in placeOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"handleQuery"
>
刷新
</el-button
>
</el-form-item>
</el-form>
<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=
"['accompany:carousel:add']"
>
新增
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['accompany:carousel:remove']"
>
删除
</el-button
>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"carouselList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"ID"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"描述"
align=
"center"
prop=
"descr"
/>
<el-table-column
label=
"位置"
align=
"center"
prop=
"site"
/>
<el-table-column
label=
"城市"
align=
"center"
prop=
"cityId"
/>
<el-table-column
label=
"图片"
align=
"center"
prop=
"imgUrl"
>
<template
slot-scope=
"
{ row }">
<el-image
style=
"width: 30px; height: 30px"
:src=
"row.imgUrl"
:preview-src-list=
"[row.imgUrl]"
>
</el-image>
</
template
>
</el-table-column>
<el-table-column
label=
"链接"
align=
"center"
prop=
"linkUrl"
/>
<!-- 状态;0-禁用,1-启用 -->
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.status"
:active-value=
"1"
:inactive-value=
"0"
>
</el-switch>
</
template
>
</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=
"['accompany:carousel:edit']"
>
编辑
</el-button
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['accompany:carousel:remove']"
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total > 0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改轮播图对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"位置"
prop=
"site"
>
<el-input
v-model=
"queryParams.site"
placeholder=
"请输入位置"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
<!-- <el-input v-model="form.site" placeholder="请输入位置" /> -->
<el-select
v-model=
"form.site"
placeholder=
"请选择"
>
<el-option
v-for=
"item in placeOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"城市"
prop=
"cityId"
>
<el-select
v-model=
"form.cityId"
placeholder=
"请选择"
>
<el-option
v-for=
"item in cityList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
<!-- <el-input v-model="form.cityId" placeholder="请输入城市" /> -->
</el-form-item>
<el-form-item
label=
"描述"
prop=
"descr"
>
<el-input
v-model=
"queryParams.descr"
type=
"textarea"
autosize
v-model=
"form.descr"
placeholder=
"请输入描述"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"图片"
prop=
"imgUrl"
>
<el-input
v-model=
"
queryParams
.imgUrl"
placeholder=
"请输入图片
"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/
>
<
!-- <
el-input
v-model="
form
.imgUrl"
type="textarea
"
placeholder="请输入内容"
/> -->
<imageUpload
v-model=
"form.imgUrl"
:limit=
"1"
></imageUpload
>
</el-form-item>
<el-form-item
label=
"链接"
prop=
"linkUrl"
>
<el-input
v-model=
"queryParams.linkUrl"
placeholder=
"请输入链接"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/
>
<el-input
placeholder=
"请输入内容"
v-model=
"form.linkUrl"
>
<!-- <template slot="prepend">Http://</template> -->
<
template
slot=
"prepend"
>
<i
class=
"el-icon-link"
></i>
</
template
>
</el-input
>
</el-form-item>
<el-form-item>
<el-
button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button
>
<el-
button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button
>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-
radio
v-model=
"form.status"
label=
"0"
>
禁用
</el-radio
>
<el-
radio
v-model=
"form.status"
label=
"1"
>
启用
</el-radio
>
</el-form-item>
</el-form>
<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=
"['accompany:carousel:add']"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['accompany:carousel:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['accompany:carousel:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['accompany:carousel:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"carouselList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
""
align=
"center"
prop=
"id"
v-if=
"true"
/>
<el-table-column
label=
"城市"
align=
"center"
prop=
"cityId"
/>
<el-table-column
label=
"位置"
align=
"center"
prop=
"site"
/>
<el-table-column
label=
"描述"
align=
"center"
prop=
"descr"
/>
<el-table-column
label=
"图片"
align=
"center"
prop=
"imgUrl"
/>
<el-table-column
label=
"链接"
align=
"center"
prop=
"linkUrl"
/>
<el-table-column
label=
"状态;0-禁用,1-启用"
align=
"center"
prop=
"status"
/>
<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=
"['accompany:carousel:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['accompany:carousel:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改轮播图对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"城市"
prop=
"cityId"
>
<el-input
v-model=
"form.cityId"
placeholder=
"请输入城市"
/>
</el-form-item>
<el-form-item
label=
"位置"
prop=
"site"
>
<el-input
v-model=
"form.site"
placeholder=
"请输入位置"
/>
</el-form-item>
<el-form-item
label=
"描述"
prop=
"descr"
>
<el-input
v-model=
"form.descr"
placeholder=
"请输入描述"
/>
</el-form-item>
<el-form-item
label=
"图片"
prop=
"imgUrl"
>
<el-input
v-model=
"form.imgUrl"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
<el-form-item
label=
"链接"
prop=
"linkUrl"
>
<el-input
v-model=
"form.linkUrl"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listCarousel
,
getCarousel
,
delCarousel
,
addCarousel
,
updateCarousel
}
from
"@/api/operation/carousel"
;
export
default
{
name
:
"Carousel"
,
data
()
{
return
{
// 按钮loading
buttonLoading
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 轮播图表格数据
carouselList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
cityId
:
undefined
,
site
:
undefined
,
descr
:
undefined
,
imgUrl
:
undefined
,
linkUrl
:
undefined
,
status
:
undefined
,
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
提 交
</el-button
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listCarousel
,
getCarousel
,
delCarousel
,
addCarousel
,
updateCarousel
,
}
from
"@/api/operation/carousel"
;
export
default
{
name
:
"Carousel"
,
data
()
{
return
{
// 按钮loading
buttonLoading
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 轮播图表格数据
carouselList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
cityId
:
undefined
,
site
:
undefined
,
descr
:
undefined
,
imgUrl
:
undefined
,
linkUrl
:
undefined
,
status
:
undefined
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{},
placeOptions
:
[
{
value
:
"首页"
,
label
:
"首页"
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
}
{
value
:
"商城首页"
,
label
:
"商城首页"
,
},
],
cityList
:
[
{
value
:
"1"
,
label
:
"北京"
,
},
{
value
:
"2"
,
label
:
"上海"
,
},
],
};
},
created
()
{
this
.
getList
();
},
methods
:
{
/** 查询轮播图列表 */
getList
()
{
this
.
loading
=
true
;
listCarousel
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
carouselList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
undefined
,
cityId
:
undefined
,
site
:
undefined
,
descr
:
undefined
,
imgUrl
:
undefined
,
linkUrl
:
undefined
,
status
:
undefined
,
createBy
:
undefined
,
createTime
:
undefined
,
updateBy
:
undefined
,
updateTime
:
undefined
,
delFlag
:
undefined
,
status
:
"1"
,
};
this
.
resetForm
(
"form"
);
},
created
()
{
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
methods
:
{
/** 查询轮播图列表 */
getList
()
{
this
.
loading
=
true
;
listCarousel
(
this
.
queryParams
).
then
(
response
=>
{
this
.
carouselList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
undefined
,
cityId
:
undefined
,
site
:
undefined
,
descr
:
undefined
,
imgUrl
:
undefined
,
linkUrl
:
undefined
,
status
:
undefined
,
createBy
:
undefined
,
createTime
:
undefined
,
updateBy
:
undefined
,
updateTime
:
undefined
,
delFlag
:
undefined
};
this
.
resetForm
(
"form"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
((
item
)
=>
item
.
id
);
this
.
single
=
selection
.
length
!==
1
;
this
.
multiple
=
!
selection
.
length
;
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加轮播图"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
loading
=
true
;
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
;
getCarousel
(
id
).
then
((
response
)
=>
{
this
.
loading
=
false
;
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"添加轮播图"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
loading
=
true
;
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getCarousel
(
id
).
then
(
response
=>
{
this
.
loading
=
false
;
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改轮播图"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
buttonLoading
=
true
;
if
(
this
.
form
.
id
!=
null
)
{
updateCarousel
(
this
.
form
).
then
(
response
=>
{
this
.
title
=
"修改轮播图"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
buttonLoading
=
true
;
if
(
this
.
form
.
id
!=
null
)
{
updateCarousel
(
this
.
form
)
.
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
}).
finally
(()
=>
{
})
.
finally
(()
=>
{
this
.
buttonLoading
=
false
;
});
}
else
{
addCarousel
(
this
.
form
).
then
(
response
=>
{
}
else
{
addCarousel
(
this
.
form
)
.
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
}).
finally
(()
=>
{
})
.
finally
(()
=>
{
this
.
buttonLoading
=
false
;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除轮播图编号为"'
+
ids
+
'"的数据项?'
).
then
(()
=>
{
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除轮播图编号为"'
+
ids
+
'"的数据项?'
)
.
then
(()
=>
{
this
.
loading
=
true
;
return
delCarousel
(
ids
);
}).
then
(()
=>
{
})
.
then
(()
=>
{
this
.
loading
=
false
;
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{
}).
finally
(()
=>
{
})
.
catch
(()
=>
{})
.
finally
(()
=>
{
this
.
loading
=
false
;
});
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'accompany/carousel/export'
,
{
...
this
.
queryParams
},
`carousel_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
};
</
script
>
\ No newline at end of file
},
},
};
</
script
>
src/views/operation/business/index.vue
View file @
420a520a
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"提供医院"
prop=
"hospitals"
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<!--
<el-form-item
label=
"提供医院"
prop=
"hospitals"
>
<el-input
v-model=
"queryParams.hospitals"
placeholder=
"请输入提供医院"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"业务名称"
prop=
"name"
>
<el-input
v-model=
"queryParams.name"
placeholder=
"请输入业务名称"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
</el-form-item>
-->
<el-form-item
label=
"业务名称"
prop=
"name"
>
<el-input
v-model=
"queryParams.name"
placeholder=
"请输入业务名称"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button
>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button
>
</el-form-item>
</el-form>
<!--
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
...
...
@@ -67,213 +82,287 @@
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"businessList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
""
align=
"center"
prop=
"id"
v-if=
"true"
/>
<el-table-column
label=
"提供医院"
align=
"center"
prop=
"hospitals"
/>
<el-table-column
label=
"业务名称"
align=
"center"
prop=
"name"
/>
<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=
"['system:business:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:business:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改业务对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"提供医院"
prop=
"hospitals"
>
<el-input
v-model=
"form.hospitals"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
<el-form-item
label=
"业务名称"
prop=
"name"
>
<el-input
v-model=
"form.name"
placeholder=
"请输入业务名称"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listBusiness
,
getBusiness
,
delBusiness
,
addBusiness
,
updateBusiness
}
from
"@/api/operation/business"
;
export
default
{
name
:
"Business"
,
data
()
{
return
{
// 按钮loading
buttonLoading
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 业务表格数据
businessList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
hospitals
:
undefined
,
name
:
undefined
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
</el-row>
-->
<el-table
v-loading=
"loading"
:data=
"businessList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"ID"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"提供医院"
align=
"center"
prop=
"hospitals"
/>
<el-table-column
label=
"业务名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"服务"
align=
"center"
prop=
"name"
>
<template
slot-scope=
"
{ row }">
<el-button
type=
"text"
@
click=
"toogleExpand(row)"
>
查看服务
</el-button>
</
template
>
</el-table-column>
<el-table-column
type=
"expand"
width=
"1"
>
<
template
slot-scope=
"props"
>
<el-form
label-position=
"left"
inline
class=
"demo-table-expand"
>
<el-form-item
label=
"商品名称"
>
<span>
{{
props
.
row
.
name
}}
</span>
</el-form-item>
<el-form-item
label=
"所属店铺"
>
<span>
{{
props
.
row
.
shop
}}
</span>
</el-form-item>
<el-form-item
label=
"商品 ID"
>
<span>
{{
props
.
row
.
id
}}
</span>
</el-form-item>
<el-form-item
label=
"店铺 ID"
>
<span>
{{
props
.
row
.
shopId
}}
</span>
</el-form-item>
<el-form-item
label=
"商品分类"
>
<span>
{{
props
.
row
.
category
}}
</span>
</el-form-item>
<el-form-item
label=
"店铺地址"
>
<span>
{{
props
.
row
.
address
}}
</span>
</el-form-item>
<el-form-item
label=
"商品描述"
>
<span>
{{
props
.
row
.
desc
}}
</span>
</el-form-item>
</el-form>
</
template
>
</el-table-column>
<el-table-column
label=
"更新时间"
align=
"center"
prop=
"name"
/>
<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=
"['system:business:edit']"
>
修改
</el-button
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:business:remove']"
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total > 0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改业务对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"提供医院"
prop=
"hospitals"
>
<el-input
v-model=
"form.hospitals"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
<el-form-item
label=
"业务名称"
prop=
"name"
>
<el-input
v-model=
"form.name"
placeholder=
"请输入业务名称"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listBusiness
,
getBusiness
,
delBusiness
,
addBusiness
,
updateBusiness
,
}
from
"@/api/operation/business"
;
export
default
{
name
:
"Business"
,
data
()
{
return
{
// 按钮loading
buttonLoading
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 业务表格数据
businessList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
hospitals
:
undefined
,
name
:
undefined
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{},
};
},
created
()
{
this
.
getList
();
},
methods
:
{
/** 查询业务列表 */
getList
()
{
this
.
loading
=
true
;
listBusiness
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
businessList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
toogleExpand
(
row
)
{
let
$table
=
this
.
$refs
.
table
;
this
.
tableData
.
map
((
item
)
=>
{
if
(
row
.
id
!=
item
.
id
)
{
$table
.
toggleRowExpansion
(
item
,
false
);
}
});
$table
.
toggleRowExpansion
(
row
);
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
undefined
,
hospitals
:
undefined
,
name
:
undefined
,
createBy
:
undefined
,
createTime
:
undefined
,
updateBy
:
undefined
,
updateTime
:
undefined
,
delFlag
:
undefined
,
};
this
.
resetForm
(
"form"
);
},
created
()
{
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
methods
:
{
/** 查询业务列表 */
getList
()
{
this
.
loading
=
true
;
listBusiness
(
this
.
queryParams
).
then
(
response
=>
{
this
.
businessList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
undefined
,
hospitals
:
undefined
,
name
:
undefined
,
createBy
:
undefined
,
createTime
:
undefined
,
updateBy
:
undefined
,
updateTime
:
undefined
,
delFlag
:
undefined
};
this
.
resetForm
(
"form"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
((
item
)
=>
item
.
id
);
this
.
single
=
selection
.
length
!==
1
;
this
.
multiple
=
!
selection
.
length
;
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加业务"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
loading
=
true
;
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
;
getBusiness
(
id
).
then
((
response
)
=>
{
this
.
loading
=
false
;
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"添加业务"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
loading
=
true
;
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getBusiness
(
id
).
then
(
response
=>
{
this
.
loading
=
false
;
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改业务"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
buttonLoading
=
true
;
if
(
this
.
form
.
id
!=
null
)
{
updateBusiness
(
this
.
form
).
then
(
response
=>
{
this
.
title
=
"修改业务"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
buttonLoading
=
true
;
if
(
this
.
form
.
id
!=
null
)
{
updateBusiness
(
this
.
form
)
.
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
}).
finally
(()
=>
{
})
.
finally
(()
=>
{
this
.
buttonLoading
=
false
;
});
}
else
{
addBusiness
(
this
.
form
).
then
(
response
=>
{
}
else
{
addBusiness
(
this
.
form
)
.
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
}).
finally
(()
=>
{
})
.
finally
(()
=>
{
this
.
buttonLoading
=
false
;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除业务编号为"'
+
ids
+
'"的数据项?'
).
then
(()
=>
{
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除业务编号为"'
+
ids
+
'"的数据项?'
)
.
then
(()
=>
{
this
.
loading
=
true
;
return
delBusiness
(
ids
);
}).
then
(()
=>
{
})
.
then
(()
=>
{
this
.
loading
=
false
;
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{
}).
finally
(()
=>
{
})
.
catch
(()
=>
{})
.
finally
(()
=>
{
this
.
loading
=
false
;
});
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'system/business/export'
,
{
...
this
.
queryParams
},
`business_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
};
</
script
>
\ No newline at end of file
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
"system/business/export"
,
{
...
this
.
queryParams
,
},
`business_
${
new
Date
().
getTime
()}
.xlsx`
);
},
},
};
</
script
>
src/views/operation/notice/index.vue
View file @
420a520a
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"城市"
prop=
"cityId"
>
<el-input
v-model=
"queryParams.cityId"
placeholder=
"请输入城市"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"位置"
prop=
"site"
>
<el-select
v-model=
"queryParams.site"
placeholder=
"请选择"
>
<el-option
v-for=
"item in placeOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button
>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button
>
</el-form-item>
</el-form>
<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=
"['system:notice:add']"
>
新增
</el-button
>
</el-col>
<!--
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['system:notice:edit']"
>
修改
</el-button
>
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['system:notice:remove']"
>
删除
</el-button
>
</el-col>
<!--
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['system:notice:export']"
>
导出
</el-button
>
</el-col>
-->
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"noticeList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"ID"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"城市"
align=
"center"
prop=
"cityId"
/>
<el-table-column
label=
"内容"
align=
"center"
prop=
"info"
/>
<el-table-column
label=
"位置"
align=
"center"
prop=
"site"
/>
<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=
"['system:notice:edit']"
>
编辑
</el-button
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:notice:remove']"
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total > 0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改公告对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"内容"
prop=
"info"
>
<el-input
v-model=
"queryParams.info"
autosize
v-model=
"form.info"
type=
"textarea"
placeholder=
"请输入内容"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"位置"
prop=
"site"
>
<el-input
v-model=
"queryParams.site"
placeholder=
"请输入位置"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
<el-form-item
label=
"城市"
prop=
"cityId"
>
<el-select
v-model=
"form.cityId"
placeholder=
"请输入城市"
>
<el-option
v-for=
"item in placeOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
<el-form-item
label=
"位置"
prop=
"site"
>
<el-select
v-model=
"form.site"
placeholder=
"请输入位置"
>
<el-option
v-for=
"item in placeOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<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=
"['system:notice:add']"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['system:notice:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['system:notice:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['system:notice:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"noticeList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
""
align=
"center"
prop=
"id"
v-if=
"true"
/>
<el-table-column
label=
"城市"
align=
"center"
prop=
"cityId"
/>
<el-table-column
label=
"内容"
align=
"center"
prop=
"info"
/>
<el-table-column
label=
"位置"
align=
"center"
prop=
"site"
/>
<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=
"['system:notice:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:notice:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改公告对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"城市"
prop=
"cityId"
>
<el-input
v-model=
"form.cityId"
placeholder=
"请输入城市"
/>
</el-form-item>
<el-form-item
label=
"内容"
prop=
"info"
>
<el-input
v-model=
"form.info"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
<el-form-item
label=
"位置"
prop=
"site"
>
<el-input
v-model=
"form.site"
placeholder=
"请输入位置"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listNotice
,
getNotice
,
delNotice
,
addNotice
,
updateNotice
}
from
"@/api/operation/notice"
;
export
default
{
name
:
"Notice"
,
data
()
{
return
{
// 按钮loading
buttonLoading
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 公告表格数据
noticeList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
cityId
:
undefined
,
info
:
undefined
,
site
:
undefined
,
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
提 交
</el-button
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listNotice
,
getNotice
,
delNotice
,
addNotice
,
updateNotice
,
}
from
"@/api/operation/notice"
;
export
default
{
name
:
"Notice"
,
data
()
{
return
{
// 按钮loading
buttonLoading
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 公告表格数据
noticeList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
cityId
:
undefined
,
info
:
undefined
,
site
:
undefined
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{},
placeOptions
:
[
{
value
:
"首页公告"
,
label
:
"首页公告"
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
}
{
value
:
"代办挂号公告"
,
label
:
"代办挂号公告"
,
},
],
cityList
:
[
{
value
:
"1"
,
label
:
"北京"
,
},
{
value
:
"2"
,
label
:
"上海"
,
},
],
};
},
created
()
{
this
.
getList
();
},
methods
:
{
/** 查询公告列表 */
getList
()
{
this
.
loading
=
true
;
listNotice
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
noticeList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
undefined
,
cityId
:
undefined
,
info
:
undefined
,
site
:
undefined
,
createBy
:
undefined
,
createTime
:
undefined
,
updateBy
:
undefined
,
updateTime
:
undefined
,
};
this
.
resetForm
(
"form"
);
},
created
()
{
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
methods
:
{
/** 查询公告列表 */
getList
()
{
this
.
loading
=
true
;
listNotice
(
this
.
queryParams
).
then
(
response
=>
{
this
.
noticeList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
id
:
undefined
,
cityId
:
undefined
,
info
:
undefined
,
site
:
undefined
,
createBy
:
undefined
,
createTime
:
undefined
,
updateBy
:
undefined
,
updateTime
:
undefined
};
this
.
resetForm
(
"form"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
((
item
)
=>
item
.
id
);
this
.
single
=
selection
.
length
!==
1
;
this
.
multiple
=
!
selection
.
length
;
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加公告"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
loading
=
true
;
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
;
getNotice
(
id
).
then
((
response
)
=>
{
this
.
loading
=
false
;
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"添加公告"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
loading
=
true
;
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getNotice
(
id
).
then
(
response
=>
{
this
.
loading
=
false
;
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改公告"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
buttonLoading
=
true
;
if
(
this
.
form
.
id
!=
null
)
{
updateNotice
(
this
.
form
).
then
(
response
=>
{
this
.
title
=
"修改公告"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
buttonLoading
=
true
;
if
(
this
.
form
.
id
!=
null
)
{
updateNotice
(
this
.
form
)
.
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
}).
finally
(()
=>
{
})
.
finally
(()
=>
{
this
.
buttonLoading
=
false
;
});
}
else
{
addNotice
(
this
.
form
).
then
(
response
=>
{
}
else
{
addNotice
(
this
.
form
)
.
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
}).
finally
(()
=>
{
})
.
finally
(()
=>
{
this
.
buttonLoading
=
false
;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除公告编号为"'
+
ids
+
'"的数据项?'
).
then
(()
=>
{
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除公告编号为"'
+
ids
+
'"的数据项?'
)
.
then
(()
=>
{
this
.
loading
=
true
;
return
delNotice
(
ids
);
}).
then
(()
=>
{
})
.
then
(()
=>
{
this
.
loading
=
false
;
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{
}).
finally
(()
=>
{
})
.
catch
(()
=>
{})
.
finally
(()
=>
{
this
.
loading
=
false
;
});
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'system/notice/export'
,
{
...
this
.
queryParams
},
`notice_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
};
</
script
>
\ No newline at end of file
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
"system/notice/export"
,
{
...
this
.
queryParams
,
},
`notice_
${
new
Date
().
getTime
()}
.xlsx`
);
},
},
};
</
script
>
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