Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
提交
议题看板
打开侧边栏
jingqi.liu
pica.cloud.web-education-admin
提交
b09d8baf
提交
b09d8baf
编写于
12月 03, 2021
作者:
shuang.zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
屏蔽人员 批量导入
上级
ff60539f
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
122 行增加
和
0 行删除
+122
-0
educationApi.js
src/utils/education/educationApi.js
+11
-0
item-shield.vue
src/views/education/item-shield.vue
+111
-0
未找到文件。
src/utils/education/educationApi.js
浏览文件 @
b09d8baf
...
...
@@ -47,3 +47,14 @@ export const uploadPersonExcel = (data, projectId) => {
})
// })
}
export
const
uploadShieldExcel
=
(
data
,
projectId
)
=>
{
return
fetch
({
headers
:
{
token
:
localStorage
.
getItem
(
'storageToken'
),
},
url
:
getBaseUrl
(
'black/setPeopleBlackStatus/batch/'
+
projectId
),
method
:
'post'
,
data
:
data
,
description
:
'上传excel文件'
,
})
}
\ No newline at end of file
src/views/education/item-shield.vue
浏览文件 @
b09d8baf
...
...
@@ -49,6 +49,7 @@
</el-col>
<el-col
:span=
"6"
style=
"padding:0;text-align:right;padding-right:10px;"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"searchList()"
>
搜索
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"importOrder()"
v-if=
"shieldType == 1"
>
批量导入
</el-button>
</el-col>
</el-form>
</el-row>
...
...
@@ -103,12 +104,60 @@
</span>
</el-dialog>
</div>
<!-- 导入屏蔽人员名单 -->
<el-dialog
class=
"exportlogistics-dialog"
title=
"批量导入"
:visible=
"isShowImport"
@
close=
"isShowImport = false"
width=
"600px"
>
<el-form
label-width=
"120px"
>
<el-form-item
label=
"导入文档:"
>
<el-upload
class=
"upload-excel"
action=
"#"
accept=
".xlsx"
multiple
:limit=
"1"
:show-file-list=
"true"
:before-upload=
"uploadfile"
>
<div
class=
"upload-container"
>
<el-input
class=
"file-name"
v-model=
"fileData.fileName"
size=
"mini"
readonly
></el-input
>
<el-button
type=
"primary"
size=
"mini"
>
选择文件
</el-button>
</div>
</el-upload>
</el-form-item>
<el-form-item
label=
"模板:"
>
<a
class=
"import-url"
:href=
"logisticsUrl"
style=
"color: #449284"
>
批量导入模板.xlxs
</a>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"small"
@
click=
"cancelImport"
>
取消
</el-button>
<el-button
size=
"small"
:loading=
"isLoading"
type=
"primary"
@
click=
"confirmImport"
>
确认
</el-button
>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
import
{
mapGetters
}
from
"vuex"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
{
uploadShieldExcel
}
from
"@/utils/education/educationApi"
;
import
*
as
commonUtil
from
"../../utils/utils"
;
import
*
as
operationData
from
"../../utils/operation"
;
let
vm
=
null
;
...
...
@@ -118,6 +167,14 @@ export default {
},
data
()
{
return
{
isShowImport
:
false
,
isLoading
:
false
,
logisticsUrl
:
'https://files.yunqueyi.com/template/portal_template.xlsx'
,
fileData
:
{
ext
:
''
,
file
:
""
,
fileName
:
""
,
},
curmbFirst
:
"教培项目"
,
curmbSecond
:
"屏蔽"
,
projectId
:
""
,
...
...
@@ -232,6 +289,60 @@ export default {
// }
// },
methods
:
{
// 批量导入
importOrder
()
{
this
.
isShowImport
=
true
;
},
uploadfile
(
file
)
{
console
.
log
(
file
,
'导入file'
);
let
_this
=
this
;
let
arr
=
file
.
name
.
split
(
"."
);
let
ext
=
"."
+
arr
[
1
];
let
name
=
file
.
name
;
let
reader
=
new
FileReader
();
reader
.
onload
=
function
(
e
)
{
_this
.
fileData
.
fileName
=
name
;
_this
.
fileData
.
file
=
e
.
target
.
result
.
substr
(
e
.
target
.
result
.
indexOf
(
"base64,"
)
+
7
);
_this
.
fileData
.
ext
=
ext
;
console
.
log
(
"fileJson"
,
_this
.
fileData
);
};
reader
.
readAsDataURL
(
file
);
},
// 确认导入
confirmImport
()
{
this
.
isLoading
=
true
;
uploadShieldExcel
(
this
.
fileData
,
this
.
projectId
).
then
(
res
=>
{
if
(
res
.
code
==
'000000'
)
{
if
(
res
.
data
==
''
)
{
this
.
isLoading
=
false
;
this
.
$message
({
message
:
'导入成功'
,
type
:
'success'
});
}
else
{
let
a
=
document
.
createElement
(
'a'
);
let
href
=
res
.
data
;
a
.
setAttribute
(
'href'
,
href
);
a
.
click
();
this
.
isLoading
=
false
;
this
.
$message
.
error
(
'导入失败'
);
}
}
}).
catch
(
error
=>
{
this
.
isLoading
=
false
;
this
.
$message
.
error
(
error
.
message
);
})
},
// 取消导入
cancelImport
()
{
this
.
fileData
=
{
file
:
""
,
fileName
:
""
,
};
this
.
isShowImport
=
false
;
},
handleChange
(
value
)
{
let
areaId
=
"000"
;
for
(
let
i
=
0
;
i
<
value
.
length
;
i
++
)
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录