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
d6e8348e
Commit
d6e8348e
authored
Jun 03, 2021
by
陈浩建
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动申报+kpi打分+销售预警数据设置
parent
2659d1b9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
468 additions
and
12 deletions
+468
-12
src/api/school-center/louZhang/KpiScoreAPI.js
+21
-0
src/api/school-center/louZhang/salesAlertAPI.js
+21
-0
src/views/school-center/activity/activityList.vue
+0
-8
src/views/school-center/activity/addActivity.vue
+189
-3
src/views/school-center/louZhang/KpiScore.vue
+237
-1
src/views/school-center/louZhang/salesAlert.vue
+0
-0
No files found.
src/api/school-center/louZhang/KpiScoreAPI.js
0 → 100644
View file @
d6e8348e
import
{
postAction
,
downFilePost
}
from
'@/api/manage'
const
prefix
=
'/manager/ciop'
;
//查询
let
listData
=
(
params
)
=>
postAction
(
prefix
+
"/kpiScore/list"
,
params
);
// 新增数据
let
addData
=
(
params
)
=>
postAction
(
prefix
+
"/kpiScore/addData"
,
params
);
// 更新数据
let
updateData
=
(
params
)
=>
postAction
(
prefix
+
"/kpiScore/updateData"
,
params
);
// 删除数据
let
deleteData
=
(
params
)
=>
postAction
(
prefix
+
"/kpiScore/deleteData"
,
params
);
export
{
listData
,
addData
,
updateData
,
deleteData
}
src/api/school-center/louZhang/salesAlertAPI.js
0 → 100644
View file @
d6e8348e
import
{
postAction
,
downFilePost
}
from
'@/api/manage'
const
prefix
=
'/manager/ciop'
;
//查询
let
listData
=
(
params
)
=>
postAction
(
prefix
+
"/salesAlert/list"
,
params
);
// 新增数据
let
addData
=
(
params
)
=>
postAction
(
prefix
+
"/salesAlert/addData"
,
params
);
// 更新数据
let
updateData
=
(
params
)
=>
postAction
(
prefix
+
"/salesAlert/updateData"
,
params
);
// 删除数据
let
deleteData
=
(
params
)
=>
postAction
(
prefix
+
"/salesAlert/deleteData"
,
params
);
export
{
listData
,
addData
,
updateData
,
deleteData
}
src/views/school-center/activity/activityList.vue
View file @
d6e8348e
...
@@ -72,7 +72,6 @@
...
@@ -72,7 +72,6 @@
<!--编辑----弹框-->
<!--编辑----弹框-->
<a-modal
:title=
"titleName"
:visible=
"modifyvisible"
@
ok=
"createfunctionOk"
@
cancel=
"createfunctionCancel"
html-type=
"submit"
width=
"840px"
>
<a-modal
:title=
"titleName"
:visible=
"modifyvisible"
@
ok=
"createfunctionOk"
@
cancel=
"createfunctionCancel"
html-type=
"submit"
width=
"840px"
>
<a-form
:form=
"Formtable"
>
<a-form
:form=
"Formtable"
>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"活动标题"
>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"活动标题"
>
<a-input
placeholder=
"活动标题"
v-decorator=
"[ 'title', {rules: [{ required: true, message: '活动标题不能为空!' ,whitespace:true}]} ]"
></a-input>
<a-input
placeholder=
"活动标题"
v-decorator=
"[ 'title', {rules: [{ required: true, message: '活动标题不能为空!' ,whitespace:true}]} ]"
></a-input>
</a-form-item>
</a-form-item>
...
@@ -88,7 +87,6 @@
...
@@ -88,7 +87,6 @@
<a-radio
value=
"团队活动"
>
团队活动
</a-radio>
<a-radio
value=
"团队活动"
>
团队活动
</a-radio>
</a-radio-group>
</a-radio-group>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"活动小类"
>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"活动小类"
>
<a-select
placeholder=
"请选择"
v-decorator=
"[ 'subclass', {rules: [{ required: true, message: '活动小类不能为空!' ,whitespace:true}]} ]"
>
<a-select
placeholder=
"请选择"
v-decorator=
"[ 'subclass', {rules: [{ required: true, message: '活动小类不能为空!' ,whitespace:true}]} ]"
>
<a-select-option
key=
""
>
请选择
</a-select-option>
<a-select-option
key=
""
>
请选择
</a-select-option>
...
@@ -98,13 +96,11 @@
...
@@ -98,13 +96,11 @@
<a-select-option
key=
"线下活动"
>
线下活动
</a-select-option>
<a-select-option
key=
"线下活动"
>
线下活动
</a-select-option>
</a-select>
</a-select>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"活动封面图片"
>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"活动封面图片"
>
<a-upload
:beforeUpload=
"uploadPicture"
>
<a-upload
:beforeUpload=
"uploadPicture"
>
<a-button>
<a-icon
type=
"upload"
/>
上传图片
</a-button>
<a-button>
<a-icon
type=
"upload"
/>
上传图片
</a-button>
</a-upload>
</a-upload>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"活动范围"
>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"活动范围"
>
<a-select
v-model=
"modifyForm.range"
>
<a-select
v-model=
"modifyForm.range"
>
<a-select-option
key=
"全市"
>
全市
</a-select-option>
<a-select-option
key=
"全市"
>
全市
</a-select-option>
...
@@ -112,11 +108,9 @@
...
@@ -112,11 +108,9 @@
</a-select-option>
</a-select-option>
</a-select>
</a-select>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"排序号"
>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"排序号"
>
<a-input
v-decorator=
"[ 'sort', {rules: [{ required: true, type:'number', message: '排序号不能为空!' ,whitespace:true,transform:(value)=> {return Number(value)} }]} ]"
></a-input>
<a-input
v-decorator=
"[ 'sort', {rules: [{ required: true, type:'number', message: '排序号不能为空!' ,whitespace:true,transform:(value)=> {return Number(value)} }]} ]"
></a-input>
</a-form-item>
</a-form-item>
</a-form>
</a-form>
</a-modal>
</a-modal>
<!--编辑----弹框-->
<!--编辑----弹框-->
...
@@ -442,7 +436,6 @@
...
@@ -442,7 +436,6 @@
},
},
uploadPicture
(
file
)
{
uploadPicture
(
file
)
{
let
fileSize
=
file
.
size
/
1024
/
1024
let
fileSize
=
file
.
size
/
1024
/
1024
console
.
log
(
fileSize
)
if
(
fileSize
>
this
.
pictureSize
){
if
(
fileSize
>
this
.
pictureSize
){
this
.
$message
.
error
(
'上传失败!图片大小不能超过'
+
this
.
pictureSize
+
'M'
,
5
);
this
.
$message
.
error
(
'上传失败!图片大小不能超过'
+
this
.
pictureSize
+
'M'
,
5
);
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
...
@@ -468,7 +461,6 @@
...
@@ -468,7 +461,6 @@
ctx
.
fillRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
)
ctx
.
fillRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
)
ctx
.
drawImage
(
img
,
0
,
0
,
width
,
height
)
ctx
.
drawImage
(
img
,
0
,
0
,
width
,
height
)
const
picture
=
canvas
.
toDataURL
(
'image/jpeg'
)
const
picture
=
canvas
.
toDataURL
(
'image/jpeg'
)
console
.
log
(
picture
.
length
)
return
uploadImg
({
picture
}).
then
(
res
=>
{
return
uploadImg
({
picture
}).
then
(
res
=>
{
if
(
res
==
'error'
){
if
(
res
==
'error'
){
this
.
$message
.
error
(
'上传失败!'
,
5
);
this
.
$message
.
error
(
'上传失败!'
,
5
);
...
...
src/views/school-center/activity/addActivity.vue
View file @
d6e8348e
<
template
>
<
template
>
<a>
6666666666666666666666666666666666666666666666666666666666666666666
</a>
<div
class=
"flex-container"
>
<a-form
:form=
"Formtable"
>
<a-form-item
:labelCol=
"
{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动标题">
<a-input
placeholder=
"活动标题"
v-decorator=
"[ 'title',
{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=
"[ 'desc',
{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=
"[ 'integral',
{rules: [{ required: false, type:'number', message: '活动积分不能为空!' ,transform:(value)=> {return Number(value)} }]} ]">
</a-input>
</a-form-item>
<a-form-item
:labelCol=
"
{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动类型">
<a-radio-group
v-decorator=
"['activityType',
{rules: [{ required: true, message: '活动类型不能为空!'}]} ]">
<a-radio
value=
"个人活动"
>
个人活动
</a-radio>
<a-radio
value=
"团队活动"
>
团队活动
</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item
:labelCol=
"
{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动小类">
<a-select
placeholder=
"请选择"
v-decorator=
"[ 'subclass',
{rules: [{ required: true, message: '活动小类不能为空!' ,whitespace:true}]} ]">
<a-select-option
key=
""
>
请选择
</a-select-option>
<a-select-option
key=
"部长考核"
>
部长考核
</a-select-option>
<a-select-option
key=
"前置营销"
>
前置营销
</a-select-option>
<a-select-option
key=
"线上活动"
>
线上活动
</a-select-option>
<a-select-option
key=
"线下活动"
>
线下活动
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
:labelCol=
"
{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动封面图片">
<a-upload
:beforeUpload=
"uploadPicture"
>
<a-button>
<a-icon
type=
"upload"
/>
上传图片
</a-button>
</a-upload>
</a-form-item>
<a-form-item
:labelCol=
"
{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动范围">
<a-select
v-model=
"modifyForm.range"
>
<a-select-option
key=
"全市"
>
全市
</a-select-option>
<a-select-option
v-for=
"d in subNames"
:key=
"d.value"
:value=
"d.value"
>
{{
d
.
text
}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
:labelCol=
"
{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="排序号">
<a-input
v-decorator=
"[ 'sort',
{rules: [{ required: true, type:'number', message: '排序号不能为空!' ,whitespace:true,transform:(value)=> {return Number(value)} }]} ]">
</a-input>
</a-form-item>
<a-form-item>
<a-button
style=
"width:200px;margin-left: 35%"
@
click=
"createfunctionOk()"
type=
"primary"
>
提交
</a-button>
</a-form-item>
</a-form>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
initSubstName
}
from
"../../../api/school-center/userManager/newUserAPI"
;
import
{
addActivity
,
uploadImg
}
from
"../../../api/school-center/activity/activityAPI"
;
export
default
{
export
default
{
name
:
"addActivity"
name
:
"addActivity"
,
data
:
function
()
{
return
{
Formtable
:
this
.
$form
.
createForm
(
this
,
{
name
:
'Formtable'
}),
modifyForm
:
{
id
:
''
,
title
:
''
,
desc
:
''
,
integral
:
''
,
activityType
:
''
,
subclass
:
''
,
imageUrl
:
''
,
range
:
''
,
sort
:
''
,
},
subNames
:
[],
chosePages
:[],
}
},
mounted
()
{
this
.
initSubstName
();
},
methods
:{
initSubstName
()
{
initSubstName
().
then
((
res
)
=>
{
if
(
res
.
state
==
"success"
)
{
const
result
=
res
.
data
result
.
forEach
((
r
)
=>
{
if
(
r
.
subName
===
'null'
)
return
;
this
.
subNames
.
push
({
value
:
r
.
subName
,
text
:
r
.
subName
})
})
}
})
},
uploadPicture
(
file
)
{
let
fileSize
=
file
.
size
/
1024
/
1024
if
(
fileSize
>
this
.
pictureSize
){
this
.
$message
.
error
(
'上传失败!图片大小不能超过'
+
this
.
pictureSize
+
'M'
,
5
);
return
new
Promise
(
resolve
=>
{
console
.
log
(
resolve
);
})
}
else
{
return
new
Promise
(
resolve
=>
{
console
.
log
(
resolve
);
const
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
file
);
reader
.
onload
=
()
=>
{
const
img
=
document
.
createElement
(
'img'
);
img
.
src
=
reader
.
result
;
img
.
onload
=
()
=>
{
const
limitWidth
=
arguments
[
2
]
?
arguments
[
2
]
:
640
;
const
width
=
img
.
width
>
limitWidth
?
limitWidth
:
img
.
width
;
const
height
=
img
.
width
>
limitWidth
?
parseInt
((
img
.
height
*
limitWidth
)
/
img
.
width
)
:
img
.
height
;
const
canvas
=
document
.
createElement
(
'canvas'
);
const
ctx
=
canvas
.
getContext
(
'2d'
);
canvas
.
width
=
width
canvas
.
height
=
height
ctx
.
fillStyle
=
'#fff'
ctx
.
fillRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
)
ctx
.
drawImage
(
img
,
0
,
0
,
width
,
height
)
const
picture
=
canvas
.
toDataURL
(
'image/jpeg'
)
return
uploadImg
({
picture
}).
then
(
res
=>
{
if
(
res
==
'error'
){
this
.
$message
.
error
(
'上传失败!'
,
5
);
}
if
(
res
.
state
==
'success'
){
this
.
modifyForm
.
imageUrl
=
res
.
data
;
this
.
$message
.
success
(
'上传成功'
,
5
);
}
})
};
};
});
}
},
//提交表单
createfunctionOk
(){
this
.
Formtable
.
validateFields
([
'title'
,
'desc'
,
"integral"
,
"activityType"
,
'subclass'
,
'sort'
,
"range"
],
{
force
:
true
},
(
err
,
values
)
=>
{
if
(
!
err
){
debugger
this
.
modifyForm
.
title
=
values
.
title
this
.
modifyForm
.
desc
=
values
.
desc
this
.
modifyForm
.
integral
=
values
.
integral
this
.
modifyForm
.
activityType
=
values
.
activityType
this
.
modifyForm
.
subclass
=
values
.
subclass
this
.
modifyForm
.
sort
=
values
.
sort
this
.
chosePages
.
forEach
(
value
=>
{
if
(
value
!=
undefined
){
this
.
modifyForm
.
chosePages
=
value
+
","
+
this
.
modifyForm
.
chosePages
}
})
//插入数据
if
(
this
.
modifyForm
.
id
==
""
){
for
(
let
key
in
this
.
modifyForm
)
{
if
(
this
.
modifyForm
[
key
]
==
undefined
){
this
.
modifyForm
[
key
]
=
""
}
}
addActivity
(
this
.
modifyForm
).
then
(
res
=>
{
if
(
res
.
state
==
"success"
)
{
this
.
$message
.
success
(
res
.
data
?
res
.
data
:
'添加成功!'
,
5
);
this
.
createfunctionCancel
();
return
null
;
}
this
.
$message
.
error
(
res
.
data
?
res
.
data
:
'添加失败!'
,
5
);
})
return
null
;
}
}
})
},
createfunctionCancel
(){
this
.
Formtable
.
setFieldsValue
({
id
:
''
,
title
:
''
,
desc
:
''
,
integral
:
''
,
activityType
:
''
,
subclass
:
''
,
imageUrl
:
''
,
range
:
''
,
sort
:
''
,
})
this
.
modifyForm
.
id
=
""
this
.
modifyForm
.
range
=
""
this
.
modifyForm
.
chosePages
=
""
this
.
chosePages
.
splice
(
0
,
this
.
chosePages
.
length
)
this
.
modifyvisible
=
false
;
},
},
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.ant-form-item
{
margin-bottom
:
5px
;
}
</
style
>
</
style
>
src/views/school-center/louZhang/KpiScore.vue
View file @
d6e8348e
<
template
>
<
template
>
<div
class=
"flex-container"
>
<!-- 查询区域 -->
<div
class=
"table-page-search-wrapper"
>
<!-- 搜索区域 -->
<a-form
layout=
"inline"
>
<a-row
:gutter=
"24"
>
<a-col
:md=
"4"
:sm=
"8"
>
<a-form-item
label=
"职位:"
>
<a-input
placeholder=
"职位"
v-model=
"queryParam.position"
></a-input>
</a-form-item>
</a-col>
<span
class=
"table-page-search-submitButtons"
style=
"float: left; overflow: hidden;"
>
<a-col
:md=
"6"
:sm=
"24"
>
<a-button
@
click=
"search()"
type=
"primary"
>
查询
</a-button>
<a-divider
type=
"vertical"
/>
<a-button
@
click=
"add()"
type=
"primary"
>
添加
</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!--列表-->
<s-table
:locale=
"emptyText"
:columns=
"columns"
:data=
"rowdata"
bordered
ref=
"table"
size=
"small"
class=
"flex-filling"
>
<template
slot=
"operation"
slot-scope=
"text,record"
>
<a
@
click=
"update(record)"
>
编辑
</a>
<a-divider
type=
"vertical"
/>
<a-popconfirm
title=
"是否要删除此行?"
@
confirm=
"deleteActivity(record.id)"
>
<a>
删除
</a>
</a-popconfirm>
<!--
<a-divider
type=
"vertical"
/>
-->
</
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-model=
"modifyForm.position"
></a-input>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"最低销售指标"
>
<a-input
placeholder=
"最低销售指标"
v-model=
"modifyForm.score"
></a-input>
</a-form-item>
<a-form-item
:labelCol=
"{span: 6}"
:wrapperCol=
"{span: 8, offset: 1}"
label=
"备注"
>
<a-input
placeholder=
"备注"
v-model=
"modifyForm.remarks"
></a-input>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
</template>
<
script
>
<
script
>
import
STable
from
'@/components/table'
;
import
{
cloneObject
}
from
'@/utils/util'
;
import
{
listData
,
addData
,
updateData
,
deleteData
,
}
from
"../../../api/school-center/louZhang/KpiScoreAPI"
;
export
default
{
export
default
{
name
:
"KpiScore"
name
:
"KpiScore"
,
components
:
{
STable
,
cloneObject
},
data
:
function
()
{
return
{
emptyText
:
{
emptyText
:
'暂无数据'
},
previewVisible
:
false
,
previewImage
:
''
,
fileList
:
[
],
apis
:
''
,
fileid
:{},
// form
Formtable
:
this
.
$form
.
createForm
(
this
,
{
name
:
'Formtable'
}),
titleName
:
""
,
modifyForm
:
{
id
:
''
,
position
:
''
,
score
:
''
,
remarks
:
''
,
},
subNameList
:
[],
packageName
:[],
chosePages
:[],
products
:[],
//输入框列表
queryParam
:
{
position
:
''
,
},
modifyvisible
:
false
,
visiblepicture
:
false
,
columns
:
[
{
dataIndex
:
'position'
,
width
:
200
,
title
:
'职位'
,
align
:
"center"
},
{
dataIndex
:
'score'
,
width
:
200
,
title
:
'最低销售指标'
,
align
:
"center"
},
{
dataIndex
:
'remarks'
,
width
:
200
,
title
:
'备注'
,
align
:
"center"
},
{
dataIndex
:
'operation'
,
width
:
200
,
title
:
'操作'
,
align
:
"center"
,
scopedSlots
:
{
customRender
:
'operation'
},
fixed
:
"right"
}]
,
rowdata
:
parameter
=>
{
const
env
=
process
.
env
.
NODE_ENV
;
//获取当前环境
if
(
env
===
'development'
)
{
//测试环境默认添加前缀
this
.
apis
=
'/api/'
;
}
let
params
=
{
pageNo
:
parameter
.
pageNo
,
pageSize
:
parameter
.
pageSize
};
let
obj
=
cloneObject
(
this
.
queryParam
);
//表示
return
listData
(
Object
.
assign
(
params
,
obj
)).
then
(
res
=>
{
let
data
=
{};
if
(
res
.
page
.
state
!==
"success"
)
{
this
.
$message
.
error
(
"查询失败!"
,
5
);
this
.
emptyText
.
emptyText
=
'查询失败!'
data
=
{
data
:
[],
pageSize
:
parameter
.
pageSize
,
pageNo
:
1
,
totalCount
:
0
};
}
else
{
data
=
{
data
:
res
.
page
.
data
.
records
,
pageSize
:
parameter
.
pageSize
,
pageNo
:
parameter
.
pageNo
,
totalCount
:
res
.
page
.
data
.
total
};
}
return
data
;
});
}
}
},
methods
:{
search
()
{
this
.
$refs
.
table
.
refresh
({
search
:
true
})
},
add
(){
this
.
titleName
=
"添加"
this
.
modifyForm
.
id
=
""
;
this
.
modifyForm
.
position
=
""
;
this
.
modifyForm
.
score
=
""
;
this
.
modifyForm
.
remarks
=
""
;
setTimeout
(()
=>
{
this
.
Formtable
.
setFieldsValue
({
id
:
""
,
position
:
""
,
score
:
""
,
remarks
:
""
,
})
},
0
)
this
.
modifyvisible
=
true
;
},
update
(
data
){
this
.
titleName
=
"编辑"
this
.
modifyForm
.
id
=
data
.
id
;
this
.
modifyForm
.
position
=
data
.
position
;
this
.
modifyForm
.
score
=
data
.
score
;
this
.
modifyForm
.
remarks
=
data
.
remarks
;
setTimeout
(()
=>
{
this
.
Formtable
.
setFieldsValue
({
id
:
data
.
id
,
position
:
data
.
position
,
score
:
data
.
score
,
remarks
:
data
.
remarks
,
})
},
0
)
this
.
modifyvisible
=
true
;
},
//提交表单
createfunctionOk
(){
let
obj
=
cloneObject
(
this
.
modifyForm
);
//插入数据
if
(
this
.
modifyForm
.
id
==
""
){
addData
(
obj
).
then
(
res
=>
{
if
(
res
.
state
==
"success"
)
{
this
.
$notification
.
success
({
message
:
"添加成功!"
,
description
:
""
,
duration
:
4
});
}
else
{
let
msg
=
res
.
msg
!=
undefined
?
res
.
msg
:
"删除成功!"
;
this
.
$notification
.
error
({
message
:
msg
,
description
:
""
,
duration
:
4
});
}
this
.
search
();
});
}
else
{
updateData
(
obj
).
then
(
res
=>
{
if
(
res
.
state
==
"success"
)
{
this
.
$notification
.
success
({
message
:
"更新成功!"
,
description
:
""
,
duration
:
4
});
}
else
{
let
msg
=
res
.
msg
!=
undefined
?
res
.
msg
:
"删除成功!"
;
this
.
$notification
.
error
({
message
:
msg
,
description
:
""
,
duration
:
4
});
}
this
.
search
();
});
}
this
.
modifyvisible
=
false
;
},
createfunctionCancel
(){
this
.
modifyvisible
=
false
;
},
deleteActivity
(
id
){
deleteData
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
state
==
"success"
)
{
this
.
$notification
.
success
({
message
:
"删除成功!"
,
description
:
""
,
duration
:
4
});
}
else
{
this
.
$notification
.
error
({
message
:
"删除失败!"
,
description
:
""
,
duration
:
4
});
}
this
.
search
();
});
},
}
}
}
</
script
>
</
script
>
...
...
src/views/school-center/louZhang/salesAlert.vue
View file @
d6e8348e
This diff is collapsed.
Click to expand it.
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