Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center-ui
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
吴学德
gdtel-gztel-school-center-ui
Commits
0ea05723
Commit
0ea05723
authored
Feb 20, 2020
by
吴学德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
套餐管理
parent
f4fa9538
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
185 additions
and
10 deletions
+185
-10
src/api/school-center/packageManagementAPI.js
+6
-3
src/views/school-center/packageManagement/package.vue
+179
-7
No files found.
src/api/school-center/packageManagementAPI.js
View file @
0ea05723
...
...
@@ -13,8 +13,10 @@ let modify = (params) => postAction(prefix + "/packageManagement/package/update"
//新增
let
insert
=
(
params
)
=>
postAction
(
prefix
+
"/packageManagement/package/insert"
,
params
);
//隐藏状态
let
hidestatus
=
(
params
)
=>
postAction
(
prefix
+
"/packageManagement/package/hidestatus"
,
params
);
//删除
let
delet
=
(
params
)
=>
postAction
(
prefix
+
"/packageManagement/package/delete"
,
params
);
//套餐全称列表
let
packageAllList
=
()
=>
postAction
(
prefix
+
"/packageManagement/package/packageAllList"
);
export
{
findByList
,
choosepages
,
modify
,
insert
,
hidestatus
findByList
,
choosepages
,
modify
,
insert
,
packageAllList
,
delet
}
\ No newline at end of file
src/views/school-center/packageManagement/package.vue
View file @
0ea05723
...
...
@@ -25,16 +25,68 @@
<!--列表-->
<s-table
:columns=
"columns"
:data=
"rowdata"
bordered
ref=
"table"
size=
"small"
class=
"flex-filling"
>
<template
slot=
"operation"
slot-scope=
"text,record"
>
<a
>
编辑
</a>
<a
@
click=
"modifyfunction(record)"
>
编辑
</a>
<a-divider
type=
"vertical"
/>
<a-popconfirm
title=
"是否删除?"
@
confirm=
"delet(record.id)"
>
<a>
删除
</a>
</a-popconfirm>
</
template
>
</s-table>
<!--编辑----弹框-->
<a-modal
:title=
"titleName"
:visible=
"modifyvisible"
@
ok=
"createfunctionOk"
@
cancel=
"createfunctionCancel"
html-type=
"submit"
width=
"840px"
>
<a-form
:form=
"Formtable"
>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"套餐名称"
>
<a-input
placeholder=
"套餐名称"
v-decorator=
"[ 'packageName', {rules: [{ required: true, message: '套餐名称不能为空!' ,whitespace:true}]} ]"
></a-input>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"套餐全称"
>
<a-auto-complete
placeholder=
"套餐全称"
v-decorator=
"[ 'name', {rules: [{ required: true, message: '县分不能为空!' ,whitespace:true}]} ]"
>
<
template
slot=
"dataSource"
>
<a-select-option
v-for=
"website in autoCompleteResult"
:key=
"website"
>
{{
website
}}
</a-select-option>
</
template
>
</a-auto-complete>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"卡品类型"
>
<a-radio-group
v-decorator=
"['isXbCard']"
:defaultValue=
"0"
>
<a-radio
:value=
"0"
>
小白卡
</a-radio>
<a-radio
:value=
"1"
>
预制卡
</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"月基本费用"
>
<a-input
placeholder=
"月基本费用"
v-decorator=
"[ 'monthFee', {rules: [{ required: true, message: '月基本费用不能为空!' ,whitespace:true}]} ]"
></a-input>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"流量"
>
<a-input
placeholder=
"流量"
v-decorator=
"[ 'flow', {rules: [{ required: true, message: '流量不能为空!' ,whitespace:true}]} ]"
></a-input>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"语音"
>
<a-input
placeholder=
"语音"
v-decorator=
"[ 'voice', {rules: [{ required: true, message: '语音不能为空!' ,whitespace:true}]} ]"
></a-input>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"小白卡套餐id"
>
<a-input
placeholder=
"小白卡套餐id"
v-decorator=
"[ 'xbId', {rules: [{ required: true, message: '小白卡套餐id不能为空!' ,whitespace:true}]} ]"
></a-input>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"温馨提示"
>
<a-input
placeholder=
"温馨提示"
v-decorator=
"[ 'warmTip']"
></a-input>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"简介"
>
<a-input
placeholder=
"简介"
v-decorator=
"[ 'explains', {rules: [{ required: true, message: '简介不能为空!' ,whitespace:true}]}]"
></a-input>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"背景图"
>
<img
style=
"width: 150px"
>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"小图"
>
<img
style=
"width: 150px"
>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<
script
>
import
STable
from
'@/components/table'
;
import
{
findByList
,
choosepages
,
modify
,
insert
,
hidestatus
}
from
"@/api/school-center/packageManagementAPI"
import
{
findByList
,
modify
,
insert
,
packageAllList
,
delet
}
from
"@/api/school-center/packageManagementAPI"
import
{
cloneObject
}
from
'@/utils/util'
;
export
default
{
name
:
"package"
,
...
...
@@ -43,15 +95,31 @@
},
data
:
function
()
{
return
{
Formtable
:
this
.
$form
.
createForm
(
this
,
{
name
:
'Formtable'
}),
//输入框列表
autoCompleteResult
:[],
modifyForm
:
{
id
:
""
,
packageName
:
""
,
name
:
""
,
isXbCard
:
""
,
monthFee
:
""
,
flow
:
""
,
voice
:
""
,
xbId
:
""
,
warmTip
:
""
,
explains
:
""
,
},
queryParam
:
{
name
:
''
,
},
modifyvisible
:
false
,
titleName
:
""
,
columns
:
[
{
dataIndex
:
'packageName'
,
width
:
200
,
title
:
'
学校
名称'
,
align
:
"center"
},
{
dataIndex
:
'monthFee'
,
width
:
200
,
title
:
'
学校名称
'
,
align
:
"center"
},
{
dataIndex
:
'flow'
,
width
:
200
,
title
:
'
学校名称
'
,
align
:
"center"
},
{
dataIndex
:
'voice'
,
width
:
200
,
title
:
'
学校名称
'
,
align
:
"center"
},
{
dataIndex
:
'packageName'
,
width
:
200
,
title
:
'
套餐
名称'
,
align
:
"center"
},
{
dataIndex
:
'monthFee'
,
width
:
200
,
title
:
'
标准月租
'
,
align
:
"center"
},
{
dataIndex
:
'flow'
,
width
:
200
,
title
:
'
流量
'
,
align
:
"center"
},
{
dataIndex
:
'voice'
,
width
:
200
,
title
:
'
语音
'
,
align
:
"center"
},
{
dataIndex
:
'operation'
,
width
:
100
,
...
...
@@ -94,6 +162,110 @@
search
()
{
this
.
$refs
.
table
.
refresh
({
search
:
true
})
},
delet
(
id
){
let
parent
=
{
id
:
id
}
delet
(
parent
).
then
(
res
=>
{
if
(
res
.
state
==
"success"
)
{
this
.
$message
.
success
(
res
.
data
?
res
.
data
:
'修改成功!'
,
5
);
this
.
search
();
return
null
;
}
this
.
$message
.
error
(
res
.
data
?
res
.
data
:
'修改失败!'
,
5
);
})
},
add
(){
this
.
modifyvisible
=
true
this
.
modifyForm
.
id
=
""
this
.
titleName
=
"添加"
packageAllList
().
then
(
res
=>
{
if
(
res
.
state
==
"success"
){
this
.
autoCompleteResult
=
res
.
data
}
})
setTimeout
(()
=>
{
this
.
Formtable
.
setFieldsValue
({
isXbCard
:
0
,
})
},
0
)
},
modifyfunction
(
data
){
this
.
modifyForm
.
id
=
data
.
id
this
.
titleName
=
"编辑"
this
.
modifyvisible
=
true
setTimeout
(()
=>
{
this
.
Formtable
.
setFieldsValue
({
packageName
:
data
.
packageName
,
name
:
data
.
name
,
isXbCard
:
data
.
isXbCard
,
monthFee
:
data
.
monthFee
,
flow
:
data
.
flow
,
voice
:
data
.
voice
,
xbId
:
data
.
xbId
,
warmTip
:
data
.
warmTip
,
explains
:
data
.
explains
,
})
},
0
)
packageAllList
().
then
(
res
=>
{
if
(
res
.
state
==
"success"
){
this
.
autoCompleteResult
=
res
.
data
}
})
},
//提交表单
createfunctionOk
(){
this
.
Formtable
.
validateFields
([
'packageName'
,
'name'
,
"isXbCard"
,
"monthFee"
,
'flow'
,
"voice"
,
'xbId'
,
"warmTip"
,
'explains'
],
{
force
:
true
},
(
err
,
values
)
=>
{
if
(
!
err
){
this
.
modifyForm
.
packageName
=
values
.
packageName
this
.
modifyForm
.
name
=
values
.
name
this
.
modifyForm
.
isXbCard
=
values
.
isXbCard
this
.
modifyForm
.
monthFee
=
values
.
monthFee
this
.
modifyForm
.
flow
=
values
.
flow
this
.
modifyForm
.
voice
=
values
.
voice
this
.
modifyForm
.
xbId
=
values
.
xbId
this
.
modifyForm
.
warmTip
=
values
.
warmTip
this
.
modifyForm
.
explains
=
values
.
explains
//插入数据
if
(
this
.
modifyForm
.
id
==
""
){
insert
(
this
.
modifyForm
).
then
(
res
=>
{
if
(
res
.
state
==
"success"
)
{
this
.
$message
.
success
(
res
.
data
?
res
.
data
:
'添加成功!'
,
5
);
this
.
search
();
return
null
;
}
this
.
$message
.
error
(
res
.
data
?
res
.
data
:
'添加失败!'
,
5
);
})
return
null
;
}
//修改数据
modify
(
this
.
modifyForm
).
then
(
res
=>
{
if
(
res
.
state
==
"success"
)
{
this
.
$message
.
success
(
res
.
data
?
res
.
data
:
'修改成功!'
,
5
);
this
.
search
();
return
null
;
}
this
.
$message
.
error
(
res
.
data
?
res
.
data
:
'修改失败!'
,
5
);
})
}
})
},
createfunctionCancel
(){
this
.
modifyvisible
=
false
this
.
autoCompleteResult
=
[]
this
.
Formtable
.
setFieldsValue
({
packageName
:
""
,
name
:
""
,
isXbCard
:
0
,
monthFee
:
""
,
flow
:
""
,
voice
:
""
,
xbId
:
""
,
warmTip
:
""
,
explains
:
""
,
})
}
}
}
...
...
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