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
07042656
Commit
07042656
authored
Nov 02, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增/修改房间时添加增加套餐功能
parent
8b898627
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
58 deletions
+76
-58
pack.js
src/api/system/pack.js
+8
-0
index.vue
src/views/system/pack/index.vue
+24
-25
index.vue
src/views/system/room/index.vue
+44
-33
No files found.
src/api/system/pack.js
View file @
07042656
...
...
@@ -33,6 +33,14 @@ export function addPack(data) {
})
}
export
function
insertPack
(
data
)
{
return
request
({
url
:
'/system/pack/add'
,
method
:
'post'
,
data
:
data
})
}
// 修改套餐
export
function
updatePack
(
data
)
{
return
request
({
...
...
src/views/system/pack/index.vue
View file @
07042656
...
...
@@ -58,28 +58,28 @@
v-hasPermi=
"['system:pack: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:pack: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:pack:remove']"
>
删除
</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:pack: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:pack:remove']"-->
<!-- >删除
</el-button>
--
>
<!--
</el-col>
--
>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
...
...
@@ -94,7 +94,7 @@
</el-row>
<el-table
v-loading=
"loading"
:data=
"packList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/
>
<!--
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
--
>
<el-table-column
label=
"套餐名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"时长"
align=
"center"
prop=
"duration"
/>
<el-table-column
label=
"金额"
align=
"center"
prop=
"price"
/>
...
...
@@ -305,13 +305,12 @@ export default {
roomnNameStr
=
`是否确认删除
${
row
.
name
}
数据及其关联的房间
${
str
}
下的绑定套餐?`
}
this
.
$modal
.
confirm
(
roomnNameStr
).
then
((
result
)
=>
{
return
delPack
(
ids
);
return
delPack
(
row
.
id
);
}).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
});
},
/** 导出按钮操作 */
handleExport
()
{
...
...
src/views/system/room/index.vue
View file @
07042656
...
...
@@ -218,8 +218,8 @@
:value=
"item.id"
></el-option>
</el-select>
<el-button
type=
"primary"
icon=
"el-icon-circle-plus"
@
change=
"packAdd"
/
>
<!-- <i class="el-icon-circle-plus" style="font-size: 32px;color: #1c84c6;margin-left:4px;" @change="packAdd"></i>--
>
<!-- <el-button type="primary" icon="el-icon-circle-plus" @change="packAdd"/>--
>
<i
class=
"el-icon-circle-plus"
style=
"font-size: 32px;color: #1c84c6;margin-left:4px;"
@
click=
"packAdd"
></i
>
</div>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
...
...
@@ -232,30 +232,30 @@
</div>
</el-dialog>
<!-- 添加或修改套餐对话框 -->
<el-dialog
:title=
"packTitle"
:visible
.
sync=
"packOpen"
width=
"
500px"
>
<el-form
ref=
"
form"
:model=
"packFro
m"
label-width=
"120px"
>
<el-dialog
:title=
"packTitle"
:visible
.
sync=
"packOpen"
width=
"
80%px"
append-to-bod
>
<el-form
ref=
"
packForm"
:model=
"packFor
m"
label-width=
"120px"
>
<el-form-item
label=
"套餐名称"
prop=
"name"
>
<el-input
v-model=
"packF
ro
m.name"
placeholder=
"请输入套餐名称"
/>
<el-input
v-model=
"packF
or
m.name"
placeholder=
"请输入套餐名称"
/>
</el-form-item>
<el-form-item
label=
"时长"
prop=
"duration"
>
<el-input
v-model=
"packF
ro
m.duration"
placeholder=
"请输入时长"
/>
<el-input
v-model=
"packF
or
m.duration"
placeholder=
"请输入时长"
/>
</el-form-item>
<el-form-item
label=
"金额"
prop=
"price"
>
<el-input
v-model=
"packF
ro
m.price"
placeholder=
"请输入金额"
/>
<el-input
v-model=
"packF
or
m.price"
placeholder=
"请输入金额"
/>
</el-form-item>
<el-form-item
label=
"套餐开始时段"
prop=
"packaStartPeriod"
>
<el-input
v-model=
"packF
ro
m.packaStartPeriod"
placeholder=
"请输入套餐开始时段"
/>
<el-input
v-model=
"packF
or
m.packaStartPeriod"
placeholder=
"请输入套餐开始时段"
/>
</el-form-item>
<el-form-item
label=
"套餐结束时段"
prop=
"packaEndPeriod"
>
<el-input
v-model=
"packF
ro
m.packaEndPeriod"
placeholder=
"请输入套餐结束时段"
/>
<el-input
v-model=
"packF
or
m.packaEndPeriod"
placeholder=
"请输入套餐结束时段"
/>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"packF
ro
m.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
<el-input
v-model=
"packF
or
m.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"
c
ancel"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submit
Pack
Form"
>
确 定
</el-button>
<el-button
@
click=
"
packC
ancel"
>
取 消
</el-button>
</div>
</el-dialog>
...
...
@@ -265,7 +265,7 @@
<
script
>
import
{
listRoom
,
getRoom
,
delRoom
,
addRoom
,
updateRoom
}
from
"@/api/system/room"
;
import
{
allList
}
from
'@/api/system/store'
import
{
query
}
from
'@/api/system/pack'
import
{
insertPack
,
query
}
from
'@/api/system/pack'
export
default
{
name
:
"Room"
,
...
...
@@ -317,7 +317,7 @@ export default {
},
// 表单参数
form
:
{},
packF
ro
m
:
{},
packF
or
m
:
{},
// 表单校验
rules
:
{
storeId
:
[
...
...
@@ -335,18 +335,12 @@ export default {
created
()
{
this
.
onGetAllStoreList
()
this
.
onPackList
()
},
mounted
()
{
console
.
log
(
this
.
dict
)
},
methods
:
{
onChange
(
e
){
console
.
log
(
e
)
this
.
form
.
facilities
=
e
.
join
()
},
onChangePackId
(
e
){
console
.
log
(
e
)
this
.
form
.
packIds
=
e
.
join
()
},
onGetAllStoreList
(){
...
...
@@ -367,11 +361,9 @@ export default {
},
value
:
obj
.
id
.
toString
(),
label
:
obj
.
name
+
'-'
+
'时段'
+
obj
.
packaStartPeriod
+
'-'
+
obj
.
packaEndPeriod
,
}
})
console
.
log
(
this
.
packList
,
9090999
)
this
.
$forceUpdate
();
this
.
getList
();
})
},
...
...
@@ -396,8 +388,13 @@ export default {
this
.
open
=
false
;
this
.
reset
();
},
packCancel
()
{
this
.
packOpen
=
false
;
this
.
packReset
();
},
// 表单重置
reset
()
{
this
.
packIds
=
[]
this
.
facilities
=
[]
this
.
form
=
{
id
:
null
,
...
...
@@ -410,6 +407,7 @@ export default {
info
:
null
,
status
:
"0"
,
price
:
null
,
packIds
:
''
,
doorLockCode
:
null
,
electricControlCode
:
null
,
password
:
null
,
...
...
@@ -424,7 +422,7 @@ export default {
this
.
resetForm
(
"form"
);
},
packReset
()
{
this
.
packF
ro
m
=
{
this
.
packF
or
m
=
{
id
:
null
,
name
:
null
,
duration
:
null
,
...
...
@@ -437,7 +435,7 @@ export default {
updateTime
:
null
,
remark
:
null
};
this
.
resetForm
(
"packF
ro
m"
);
this
.
resetForm
(
"packF
or
m"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
...
...
@@ -477,11 +475,7 @@ export default {
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
.
packIds
=
this
.
form
.
packIds
.
split
(
","
).
map
(
item
=>
Number
(
item
))
}
this
.
open
=
true
;
this
.
title
=
"修改房间"
;
...
...
@@ -492,14 +486,17 @@ export default {
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
if
(
this
.
packIds
.
length
){
this
.
form
.
packIds
=
this
.
packIds
.
join
();
}
updateRoom
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
if
(
this
.
form
.
packIds
){
this
.
packIds
=
this
.
form
.
packIds
.
split
(
","
)
if
(
this
.
packIds
.
length
){
this
.
form
.
packIds
=
this
.
packIds
.
join
();
}
addRoom
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
...
...
@@ -525,7 +522,21 @@ export default {
this
.
download
(
'system/room/export'
,
{
...
this
.
queryParams
},
`room_
${
new
Date
().
getTime
()}
.xlsx`
)
}
},
submitPackForm
()
{
this
.
$refs
[
"packForm"
].
validate
(
valid
=>
{
if
(
valid
)
{
insertPack
(
this
.
packForm
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
packOpen
=
false
;
this
.
onPackList
();
this
.
$nextTick
(()
=>
{
this
.
packIds
.
push
(
response
.
data
)
});
});
}
});
},
}
};
</
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