Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-register-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-register-show-h5
Commits
ba3d7b05
提交
ba3d7b05
authored
4月 06, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
二期开发
上级
5194cc70
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
251 行增加
和
3 行删除
+251
-3
api.js
src/modules/home/api.js
+13
-0
BatchImport.vue
src/modules/home/components/BatchImport.vue
+215
-0
SignForm.vue
src/modules/home/components/SignForm.vue
+23
-3
没有找到文件。
src/modules/home/api.js
浏览文件 @
ba3d7b05
...
@@ -32,3 +32,16 @@ export function getOrderList(params) {
...
@@ -32,3 +32,16 @@ export function getOrderList(params) {
export
function
uploadPay
(
data
)
{
export
function
uploadPay
(
data
)
{
return
httpRequest
.
post
(
'/api/register/v1/activity/upload-pay'
,
data
)
return
httpRequest
.
post
(
'/api/register/v1/activity/upload-pay'
,
data
)
}
}
/**
* 导入
*/
export
function
importPeople
(
data
)
{
return
httpRequest
({
url
:
'/api/register/v1/activity/upload-file'
,
method
:
'post'
,
headers
:
{
'Content-Type'
:
'multipart/form-data'
},
timeout
:
900000
,
data
,
withCredentials
:
true
})
}
src/modules/home/components/BatchImport.vue
0 → 100644
浏览文件 @
ba3d7b05
<
template
>
<div
class=
"main"
>
<!-- 111
<a
href=
"https://webapp-pub.ezijing.com/admission/prp/%E6%8A%A5%E5%90%8D%E8%AE%B0%E5%BD%951111.xlsx"
>
下载
</a>
<div
@
click=
"idShowPopup = true"
>
aaa
</div>
-->
<van-popup
round
closeable
close-icon-position=
"top-right"
v-bind=
"$attrs"
v-on=
"$listeners"
position=
"bottom"
:style=
"
{ height: '30%' }"
class="main_upload"
>
<van-uploader
v-model=
"fileList"
:before-read=
"handleBeforeRead"
:after-read=
"handleAfterRead"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
:max-count=
"1"
:upload-icon=
"icon"
>
</van-uploader>
<div
class=
"upload_tips"
@
click=
"down"
>
下载人员模板
</div>
<van-button
class=
"upload_btn"
@
click=
"onSubmit"
>
确定
</van-button>
</van-popup>
</div>
</
template
>
<
script
>
import
{
Toast
}
from
'vant'
import
{
importPeople
}
from
'../api.js'
export
default
{
props
:
{
stepList
:
{
type
:
Array
},
data
:
{
type
:
Object
}
},
data
()
{
return
{
icon
:
'https://webapp-pub.oss-cn-beijing.aliyuncs.com/highway/h5/form_add.png'
,
fileList
:
[],
fileData
:
{}
}
},
methods
:
{
down
()
{
window
.
location
.
href
=
`
${
window
.
location
.
origin
}
/api/register/v1/activity/download-file?activity_detail_id=
${
this
.
data
.
id
}
`
},
// 上传前置处理
handleBeforeRead
(
file
)
{
if
(
file
.
type
!==
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
)
{
Toast
(
'请上传正确的文件格式'
)
return
false
}
return
true
},
// 上传文件后的处理
handleAfterRead
(
file
)
{
this
.
fileData
=
file
.
file
},
// 提交
onSubmit
()
{
const
params
=
{
file
:
this
.
fileData
,
activity_detail_id
:
this
.
data
.
id
}
importPeople
(
params
).
then
(
res
=>
{
this
.
$emit
(
'upload'
,
res
.
data
)
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.main
{
background-color
:
#f7f7f7
;
.main_content
{
padding
:
0
.21rem
0
.3rem
4
.13rem
0
.3rem
;
.main_content_banner
{
margin-top
:
0
.84rem
;
width
:
100%
;
}
.main_content_form
{
width
:
6
.9rem
;
opacity
:
1
;
margin-top
:
0
.32rem
;
}
.main_content_form_list
{
border-radius
:
20px
;
margin-top
:
0
.43rem
;
background
:
#fff
;
padding-bottom
:
0
.68rem
;
padding-top
:
0
.4rem
;
.formItemList_item
{
.showTime
{
cursor
:
pointer
;
}
.showSelectPicker
{
cursor
:
pointer
;
}
}
.btn_minus
{
float
:
right
;
width
:
0
.5072rem
;
height
:
0
.5072rem
;
margin
:
0
.3rem
0
.3rem
0
0
;
cursor
:
pointer
;
}
}
.btn_operate
{
margin-top
:
0
.15rem
;
display
:
flex
;
justify-content
:
flex-end
;
align-items
:
center
;
.btn_import
{
width
:
2
.35rem
;
height
:
0
.81rem
;
line-height
:
0
.81rem
;
background
:
rgba
(
255
,
255
,
255
,
0
.39
);
box-shadow
:
0px
3px
6px
rgba
(
0
,
0
,
0
,
0
.09
);
border-radius
:
0
.44rem
;
font-size
:
0
.28rem
;
font-weight
:
400
;
color
:
#333333
;
text-align
:
center
;
}
img
{
width
:
0
.5072rem
;
height
:
0
.5072rem
;
}
.btn_add
{
cursor
:
pointer
;
margin-left
:
0
.3rem
;
margin-right
:
0
.31rem
;
}
}
}
.main_footer
{
width
:
100%
;
height
:
1
.81rem
;
background
:
#fff
;
position
:
fixed
;
bottom
:
0
;
display
:
flex
;
justify-content
:
space-around
;
align-items
:
flex-start
;
flex-direction
:
column
;
.main_footer_top
{
font-size
:
0
.24rem
;
font-weight
:
400
;
color
:
#999999
;
margin-left
:
0
.8rem
;
margin-top
:
0
.15rem
;
}
.main_footer_bottom
{
margin-top
:
-0
.18rem
;
cursor
:
pointer
;
width
:
6
.9rem
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
.main_content_btn
{
background
:
#b80140
;
color
:
#ffffff
;
margin-left
:
0
.28rem
;
margin-top
:
-0
.18rem
;
}
.main_content_btn1
{
background
:
#b80140
;
color
:
#ffffff
;
margin-left
:
0
.28rem
;
margin-top
:
0
.3rem
;
}
}
}
.main_upload
{
display
:
flex
;
justify-content
:
space-around
;
align-items
:
center
;
flex-direction
:
column
;
padding-top
:
1rem
;
.upload_tips
{
color
:
#b80140
;
font-size
:
0
.16rem
;
}
.upload_btn
{
border-radius
:
3rem
;
width
:
3rem
;
background
:
#b80140
;
color
:
#ffffff
;
}
}
}
::v-deep
{
.van-checkbox__icon
{
border-radius
:
3px
;
overflow
:
hidden
;
}
.main_content_banner
p
img
{
width
:
6
.9rem
;
height
:
100%
;
border-radius
:
0
.1rem
;
}
.van-uploader__upload
{
width
:
120px
;
height
:
120px
;
}
}
</
style
>
src/modules/home/components/SignForm.vue
浏览文件 @
ba3d7b05
...
@@ -98,7 +98,7 @@
...
@@ -98,7 +98,7 @@
</div>
</div>
<div
style=
"display:flex;"
v-if=
"formIndex === 0"
>
<div
style=
"display:flex;"
v-if=
"formIndex === 0"
>
<div
class=
"btn_operate"
style=
"margin-left:auto;"
>
<div
class=
"btn_operate"
style=
"margin-left:auto;"
>
<div
class=
"batch-import"
>
批量导入人员
</div>
<div
class=
"batch-import"
@
click=
"isbatchImport = true"
>
批量导入人员
</div>
<img
src=
"https://webapp-pub.ezijing.com/highway/h5/form_add.png"
class=
"btn_add"
@
click=
"handleAdd"
/>
<img
src=
"https://webapp-pub.ezijing.com/highway/h5/form_add.png"
class=
"btn_add"
@
click=
"handleAdd"
/>
</div>
</div>
</div>
</div>
...
@@ -123,15 +123,18 @@
...
@@ -123,15 +123,18 @@
>
>
</div>
</div>
</div>
</div>
<batch-import
@
upload=
"upload"
:data=
"data"
v-model=
"isbatchImport"
></batch-import>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
Toast
}
from
'vant'
import
{
Toast
}
from
'vant'
import
BatchImport
from
'../components/BatchImport.vue'
import
Commonheader
from
'../components/Commonheader.vue'
import
Commonheader
from
'../components/Commonheader.vue'
import
{
saveStepInfo
}
from
'../api'
import
{
saveStepInfo
}
from
'../api'
import
allFormList
from
'@/utils/formList'
export
default
{
export
default
{
components
:
{
Commonheader
},
components
:
{
Commonheader
,
BatchImport
},
props
:
{
props
:
{
stepList
:
{
type
:
Array
},
stepList
:
{
type
:
Array
},
data
:
{
type
:
Object
}
data
:
{
type
:
Object
}
...
@@ -139,6 +142,7 @@ export default {
...
@@ -139,6 +142,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
isbatchImport
:
false
,
title
:
'报名'
,
title
:
'报名'
,
checkedPay
:
false
,
// 勾选是否跳过按钮
checkedPay
:
false
,
// 勾选是否跳过按钮
index
:
0
,
index
:
0
,
...
@@ -148,6 +152,23 @@ export default {
...
@@ -148,6 +152,23 @@ export default {
},
},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
// 批量上传
upload
(
data
)
{
const
arr
=
[]
// 回显信息
data
.
forEach
((
item
,
index
)
=>
{
arr
.
push
([])
Object
.
keys
(
item
).
forEach
(
cItem
=>
{
const
fd
=
allFormList
.
find
(
f
=>
f
.
key
===
cItem
)
const
clone
=
Object
.
assign
({},
fd
)
clone
.
value
=
item
[
cItem
]
cItem
===
'gender'
?
clone
.
value
=
item
[
cItem
].
toString
()
:
clone
.
value
=
item
[
cItem
]
fd
&&
arr
[
index
].
push
(
Object
.
assign
({},
clone
))
})
})
this
.
data
.
user_fields
=
[...
this
.
data
.
user_fields
,
...
arr
]
this
.
isbatchImport
=
false
},
isRemoveInfo
(
item
)
{
isRemoveInfo
(
item
)
{
return
!!
item
.
find
(
f
=>
f
.
enable_edit
===
false
)
return
!!
item
.
find
(
f
=>
f
.
enable_edit
===
false
)
},
},
...
@@ -210,7 +231,6 @@ export default {
...
@@ -210,7 +231,6 @@ export default {
// 完成步骤跳转
// 完成步骤跳转
this
.
$router
.
push
({
path
:
'/'
})
this
.
$router
.
push
({
path
:
'/'
})
}
else
{
}
else
{
console
.
log
(
this
.
stepList
,
'stepList'
)
this
.
$emit
(
'next'
,
res
.
data
)
this
.
$emit
(
'next'
,
res
.
data
)
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论