Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_web
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_web
Commits
4dac456e
Commit
4dac456e
authored
Oct 31, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加套餐管理页面
parent
0a36f3a7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
423 additions
and
0 deletions
+423
-0
pack.js
src/api/system/pack.js
+51
-0
room.js
src/api/system/room.js
+7
-0
index.vue
src/views/system/pack/index.vue
+323
-0
index.vue
src/views/system/room/index.vue
+42
-0
No files found.
src/api/system/pack.js
0 → 100644
View file @
4dac456e
import
request
from
'@/utils/request'
// 查询套餐列表
export
function
listPack
(
query
)
{
return
request
({
url
:
'/system/pack/list'
,
method
:
'get'
,
params
:
query
})
}
export
function
query
()
{
return
request
({
url
:
'/system/pack/query'
,
method
:
'get'
,
})
}
// 查询套餐详细
export
function
getPack
(
id
)
{
return
request
({
url
:
'/system/pack/'
+
id
,
method
:
'get'
})
}
// 新增套餐
export
function
addPack
(
data
)
{
return
request
({
url
:
'/system/pack'
,
method
:
'post'
,
data
:
data
})
}
// 修改套餐
export
function
updatePack
(
data
)
{
return
request
({
url
:
'/system/pack'
,
method
:
'put'
,
data
:
data
})
}
// 删除套餐
export
function
delPack
(
id
)
{
return
request
({
url
:
'/system/pack/'
+
id
,
method
:
'delete'
})
}
src/api/system/room.js
View file @
4dac456e
...
@@ -42,3 +42,10 @@ export function delRoom(id) {
...
@@ -42,3 +42,10 @@ export function delRoom(id) {
method
:
'delete'
method
:
'delete'
})
})
}
}
export
function
getRoomPack
(
id
)
{
return
request
({
url
:
'/system/roomPack/getPackId/'
+
id
,
method
:
'get'
})
}
src/views/system/pack/index.vue
0 → 100644
View file @
4dac456e
This diff is collapsed.
Click to expand it.
src/views/system/room/index.vue
View file @
4dac456e
...
@@ -126,6 +126,13 @@
...
@@ -126,6 +126,13 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"房间单价"
width=
"80"
align=
"center"
prop=
"price"
/>
<el-table-column
label=
"房间单价"
width=
"80"
align=
"center"
prop=
"price"
/>
<el-table-column
label=
"套餐"
align=
"center"
prop=
"packIds"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.packIds"
style=
"display: flex;flex-wrap: wrap;width: 100%;"
>
<dict-tag
style=
"margin: 0 3px;"
v-for=
"(item ,k) in packList"
:key=
"k"
:options=
"packIds"
:value=
"item.name+'-'+'时段'+item.packaStartPeriod+'-'+item.packaEndPeriod"
/>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
...
@@ -201,6 +208,16 @@
...
@@ -201,6 +208,16 @@
<el-form-item
label=
"房间单价"
prop=
"price"
required
>
<el-form-item
label=
"房间单价"
prop=
"price"
required
>
<el-input
v-model=
"form.price"
placeholder=
"请输入房间单价(默认单位:元/小时)"
/>
<el-input
v-model=
"form.price"
placeholder=
"请输入房间单价(默认单位:元/小时)"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"套餐"
prop=
"packIds"
>
<el-select
style=
"width: 100%;"
v-model=
"packIds"
multiple
placeholder=
"套餐"
@
change=
"onChangePackId"
>
<el-option
v-for=
"item in packList"
:key=
"item.id"
:label=
"item.name+'-'+'时段'+item.packaStartPeriod+'-'+item.packaEndPeriod"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form-item>
...
@@ -216,6 +233,7 @@
...
@@ -216,6 +233,7 @@
<
script
>
<
script
>
import
{
listRoom
,
getRoom
,
delRoom
,
addRoom
,
updateRoom
}
from
"@/api/system/room"
;
import
{
listRoom
,
getRoom
,
delRoom
,
addRoom
,
updateRoom
}
from
"@/api/system/room"
;
import
{
allList
}
from
'@/api/system/store'
import
{
allList
}
from
'@/api/system/store'
import
{
query
}
from
'@/api/system/pack'
export
default
{
export
default
{
name
:
"Room"
,
name
:
"Room"
,
...
@@ -234,6 +252,8 @@ export default {
...
@@ -234,6 +252,8 @@ export default {
// 显示搜索条件
// 显示搜索条件
showSearch
:
true
,
showSearch
:
true
,
options
:
[],
options
:
[],
packList
:
[],
packIds
:
[],
// 总条数
// 总条数
total
:
0
,
total
:
0
,
// 房间表格数据
// 房间表格数据
...
@@ -279,6 +299,7 @@ export default {
...
@@ -279,6 +299,7 @@ export default {
},
},
created
()
{
created
()
{
this
.
onGetAllStoreList
()
this
.
onGetAllStoreList
()
this
.
onPackList
()
this
.
getList
();
this
.
getList
();
},
},
methods
:
{
methods
:
{
...
@@ -286,11 +307,21 @@ export default {
...
@@ -286,11 +307,21 @@ export default {
console
.
log
(
e
)
console
.
log
(
e
)
this
.
form
.
facilities
=
e
.
join
()
this
.
form
.
facilities
=
e
.
join
()
},
},
onChangePackId
(
e
){
console
.
log
(
e
)
this
.
form
.
packIds
=
e
.
join
()
},
onGetAllStoreList
(){
onGetAllStoreList
(){
allList
().
then
(
res
=>
{
allList
().
then
(
res
=>
{
this
.
options
=
res
.
data
this
.
options
=
res
.
data
})
})
},
},
onPackList
(){
query
().
then
(
res
=>
{
this
.
packList
=
res
.
data
})
},
/** 查询房间列表 */
/** 查询房间列表 */
getList
()
{
getList
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
...
@@ -357,6 +388,7 @@ export default {
...
@@ -357,6 +388,7 @@ export default {
handleAdd
()
{
handleAdd
()
{
this
.
reset
();
this
.
reset
();
this
.
open
=
true
;
this
.
open
=
true
;
console
.
log
(
this
.
facilities
)
this
.
title
=
"添加房间"
;
this
.
title
=
"添加房间"
;
},
},
/** 修改按钮操作 */
/** 修改按钮操作 */
...
@@ -368,6 +400,13 @@ export default {
...
@@ -368,6 +400,13 @@ export default {
if
(
this
.
form
.
facilities
){
if
(
this
.
form
.
facilities
){
this
.
facilities
=
this
.
form
.
facilities
.
split
(
","
)
this
.
facilities
=
this
.
form
.
facilities
.
split
(
","
)
}
}
if
(
this
.
form
.
packIds
){
//字符串转数字
var
int
=
this
.
form
.
packIds
.
split
(
","
)
this
.
packIds
=
int
.
map
((
item
)
=>
{
return
Number
(
item
);
});
}
this
.
open
=
true
;
this
.
open
=
true
;
this
.
title
=
"修改房间"
;
this
.
title
=
"修改房间"
;
});
});
...
@@ -383,6 +422,9 @@ export default {
...
@@ -383,6 +422,9 @@ export default {
this
.
getList
();
this
.
getList
();
});
});
}
else
{
}
else
{
if
(
this
.
form
.
packIds
){
this
.
packIds
=
this
.
form
.
packIds
.
split
(
","
)
}
addRoom
(
this
.
form
).
then
(
response
=>
{
addRoom
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
open
=
false
;
...
...
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