Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
06bb1660
提交
06bb1660
authored
1月 12, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
865eabf1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
90 行增加
和
45 行删除
+90
-45
uploadReport.vue
src/pages/affairsHall/uploadReport.vue
+90
-45
没有找到文件。
src/pages/affairsHall/uploadReport.vue
浏览文件 @
06bb1660
...
...
@@ -2,15 +2,23 @@
<div>
<div
class=
"con-title"
>
{{
$t
(
'pages.affairsHall.uploadReport.title'
)
}}
</div>
<div
class=
"con-box"
>
<el-button
type=
"text"
@
click=
'gobackActiveList'
>
{{
$t
(
'pages.affairsHall.uploadReport.backText'
)
}}
</el-button>
<el-button
type=
"text"
@
click=
"gobackActiveList"
>
{{
$t
(
'pages.affairsHall.uploadReport.backText'
)
}}
</el-button>
<el-row
type=
"flex"
justify=
"center"
>
<el-col
:xs=
"24"
:sm=
"24"
:md=
"16"
:lg=
"12"
:xl=
"8"
>
<el-form
ref=
"setSubmitForm"
:label-width=
"labelWidth"
:model=
"setSubmit"
:rules=
"submitRules"
>
<el-form-item
:label=
"$t('pages.affairsHall.uploadReport.name')"
prop=
"name"
>
<el-input
v-model=
"setSubmit.name"
:placeholder=
"$t('pages.affairsHall.uploadReport.placename')"
type=
"text"
/>
<el-input
v-model=
"setSubmit.name"
:placeholder=
"$t('pages.affairsHall.uploadReport.placename')"
type=
"text"
/>
</el-form-item>
<el-form-item
:label=
"$t('pages.affairsHall.uploadReport.labeltitle')"
prop=
"title"
>
<el-input
v-model=
"setSubmit.title"
:placeholder=
"$t('pages.affairsHall.uploadReport.placetitle')"
type=
"text"
/>
<el-input
v-model=
"setSubmit.title"
:placeholder=
"$t('pages.affairsHall.uploadReport.placetitle')"
type=
"text"
/>
</el-form-item>
<el-form-item
:label=
"$t('pages.affairsHall.uploadReport.file')"
prop=
"file"
>
<el-upload
...
...
@@ -22,11 +30,21 @@
:show-file-list=
"false"
:on-change=
"handleChange"
:http-request=
"uploadFile"
:file-list=
"filesArr"
>
<el-button
size=
"small"
type=
"primary"
>
{{
$t
(
'pages.affairsHall.uploadReport.uploadButtonText'
)
}}
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
{{
$t
(
'pages.affairsHall.uploadReport.uploadTips'
)
}}
<a
href=
"http://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/static/build/learn-mba/%E3%80%8AMBA%E5%AD%A6%E7%94%9F%E5%AD%A6%E6%9C%AF%E6%B4%BB%E5%8A%A8%E8%AE%B0%E5%BD%95%E6%8A%A5%E5%91%8A%E3%80%8B%E6%A8%A1%E6%9D%BFXXX%E5%AD%A6%E7%94%9F.docx"
>
{{
$t
(
'pages.affairsHall.uploadReport.downloadTemplateText'
)
}}
</a></div>
:file-list=
"filesArr"
>
<el-button
size=
"small"
type=
"primary"
>
{{
$t
(
'pages.affairsHall.uploadReport.uploadButtonText'
)
}}
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
{{
$t
(
'pages.affairsHall.uploadReport.uploadTips'
)
}}
<a
href=
"https://zws-imgs-pub.ezijing.com/static/build/learn-mba/%E3%80%8AMBA%E5%AD%A6%E7%94%9F%E5%AD%A6%E6%9C%AF%E6%B4%BB%E5%8A%A8%E8%AE%B0%E5%BD%95%E6%8A%A5%E5%91%8A%E3%80%8B%E6%A8%A1%E6%9D%BFXXX%E5%AD%A6%E7%94%9F.docx"
download
>
{{
$t
(
'pages.affairsHall.uploadReport.downloadTemplateText'
)
}}
</a
>
</div>
<template
v-if=
"successFileUrl"
>
{{
successFileUrl
.
replace
(
/.*
\/([^\/]
*
\.[^
.
]
+
)
$/gi
,
'$1'
)
}}
{{
successFileUrl
.
replace
(
/.*
\/([^\/]
*
\.[^
.
]
+
)
$/gi
,
'$1'
)
}}
</
template
>
</el-upload>
<
template
v-if=
"successFileUrl"
>
...
...
@@ -34,7 +52,9 @@
</
template
>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"onSubmitFrom"
>
{{ $t('pages.affairsHall.uploadReport.savesubmit') }}
</el-button>
<el-button
type=
"primary"
@
click=
"onSubmitFrom"
>
{{
$t('pages.affairsHall.uploadReport.savesubmit')
}}
</el-button>
</el-form-item>
</el-form>
</el-col>
...
...
@@ -52,7 +72,7 @@ export default {
reid
:
{
type
:
String
,
required
:
false
}
},
components
:
{},
data
()
{
data
()
{
return
{
labelWidth
:
'110px'
,
setSubmit
:
{
...
...
@@ -60,9 +80,7 @@ export default {
title
:
''
},
submitRules
:
{
name
:
[
{
required
:
true
,
message
:
'报告主题不能为空'
,
trigger
:
'blur'
}
],
name
:
[{
required
:
true
,
message
:
'报告主题不能为空'
,
trigger
:
'blur'
}],
title
:
[]
},
successFileUrl
:
''
,
...
...
@@ -77,16 +95,23 @@ export default {
}
}
},
mounted
()
{
mounted
()
{
if
(
this
.
reid
!==
'-1'
)
{
const
loading
=
this
.
$loading
({
lock
:
true
,
text
:
''
,
spinner
:
''
,
background
:
'rgba(255, 255, 255, 0.9)'
})
cAction
.
Affairs
.
getSubmitReport
(
this
.
rid
,
this
.
reid
).
then
(
data
=>
{
if
(
data
.
report_name
)
{
this
.
setSubmit
.
name
=
data
.
report_name
this
.
setSubmit
.
title
=
data
.
report_description
this
.
successFileUrl
=
data
.
file_url
}
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
loading
.
close
()
})
cAction
.
Affairs
.
getSubmitReport
(
this
.
rid
,
this
.
reid
)
.
then
(
data
=>
{
if
(
data
.
report_name
)
{
this
.
setSubmit
.
name
=
data
.
report_name
this
.
setSubmit
.
title
=
data
.
report_description
this
.
successFileUrl
=
data
.
file_url
}
})
.
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
})
.
finally
(()
=>
{
loading
.
close
()
})
}
window
.
addEventListener
(
'resize'
,
()
=>
{
const
width
=
document
.
documentElement
.
clientWidth
...
...
@@ -98,25 +123,33 @@ export default {
})
},
methods
:
{
handleChange
(
file
,
filelist
)
{
handleChange
(
file
,
filelist
)
{
this
.
file
.
name
=
file
.
raw
.
name
this
.
file
.
type
=
file
.
raw
.
type
this
.
file
.
lastModifiedDate
=
file
.
raw
.
lastModifiedDate
this
.
file
.
size
=
file
.
raw
.
size
this
.
file
.
file
=
file
.
raw
},
uploadFile
()
{
uploadFile
()
{
const
loading
=
this
.
$loading
({
lock
:
true
,
text
:
''
,
spinner
:
''
,
background
:
'rgba(255, 255, 255, 0.9)'
})
cAction
.
Affairs
.
uploadFile
(
this
.
file
).
then
(
data
=>
{
this
.
successFileUrl
=
data
.
url
this
.
filesArr
.
pop
()
}).
catch
(
e
=>
{
this
.
filesArr
.
pop
();
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
loading
.
close
()
})
cAction
.
Affairs
.
uploadFile
(
this
.
file
)
.
then
(
data
=>
{
this
.
successFileUrl
=
data
.
url
this
.
filesArr
.
pop
()
})
.
catch
(
e
=>
{
this
.
filesArr
.
pop
()
this
.
$message
.
error
(
e
.
message
)
})
.
finally
(()
=>
{
loading
.
close
()
})
},
gobackActiveList
()
{
gobackActiveList
()
{
this
.
$router
.
push
({
path
:
'/app/offices'
})
},
onSubmitFrom
()
{
this
.
$refs
.
setSubmitForm
.
validate
(
(
valid
)
=>
{
onSubmitFrom
()
{
this
.
$refs
.
setSubmitForm
.
validate
(
valid
=>
{
if
(
valid
)
{
// if (!this.successFileUrl) {
// this.$message.error('请上传附件')
...
...
@@ -130,30 +163,42 @@ export default {
report
=
cAction
.
Affairs
.
updateSubmitReport
(
this
.
rid
,
this
.
reid
,
{
report_name
:
this
.
setSubmit
.
name
,
report_description
:
this
.
setSubmit
.
title
,
file_url
:
JSON
.
stringify
([{
name
:
this
.
file
.
name
,
url
:
this
.
successFileUrl
}])
file_url
:
JSON
.
stringify
([
{
name
:
this
.
file
.
name
,
url
:
this
.
successFileUrl
}
])
})
}
else
{
/* 新建 */
report
=
cAction
.
Report
.
submitReport
(
this
.
rid
,
{
report_name
:
this
.
setSubmit
.
name
,
report_description
:
this
.
setSubmit
.
title
,
file_url
:
JSON
.
stringify
([{
name
:
this
.
file
.
name
,
url
:
this
.
successFileUrl
}])
file_url
:
JSON
.
stringify
([
{
name
:
this
.
file
.
name
,
url
:
this
.
successFileUrl
}
])
})
}
report
.
then
(
data
=>
{
if
(
data
.
flag
)
{
this
.
$message
({
type
:
'success'
,
message
:
'提交成功'
})
setTimeout
(()
=>
{
this
.
$router
.
push
({
path
:
`/app/affairs-hall/view-report/
${
this
.
rid
}
`
})
},
500
)
}
}).
catch
(
e
=>
{
this
.
filesArr
.
pop
();
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
loading
.
close
()
})
report
.
then
(
data
=>
{
if
(
data
.
flag
)
{
this
.
$message
({
type
:
'success'
,
message
:
'提交成功'
})
setTimeout
(()
=>
{
this
.
$router
.
push
({
path
:
`/app/affairs-hall/view-report/
${
this
.
rid
}
`
})
},
500
)
}
})
.
catch
(
e
=>
{
this
.
filesArr
.
pop
()
this
.
$message
.
error
(
e
.
message
)
})
.
finally
(()
=>
{
loading
.
close
()
})
}
else
{
this
.
$message
.
error
(
'请检查输入项,确认无误后,重新提交'
)
return
false
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论