Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
biz.qingxiao.com
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
biz.qingxiao.com
Commits
f4bdeb04
Commit
f4bdeb04
authored
Jan 14, 2020
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'最新代码提交'
parent
585967c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
12 deletions
+75
-12
crm.js
src/models/crm.js
+8
-4
ClueImport.js
src/pages/crm/ClueImport.js
+39
-8
ClueImport.less
src/pages/crm/ClueImport.less
+28
-0
No files found.
src/models/crm.js
View file @
f4bdeb04
...
...
@@ -37,7 +37,7 @@ export default {
uploadTaskList
:
[],
taskListQueryParams
:
{
page
:
1
,
perPage
:
2
0
,
perPage
:
1
0
,
},
uploadTaskTotal
:
0
,
countdown
:
60
,
...
...
@@ -293,13 +293,14 @@ export default {
payload
:
{
signature
,
files
,
uploaderLoading
,
},
});
}
},
*
uploadexcel
({
payload
},
{
call
,
put
})
{
const
{
signature
,
files
,
signature
,
files
,
uploaderLoading
,
}
=
payload
;
const
file
=
files
?
files
[
0
]
:
null
;
const
filename
=
`
${
signature
.
dir
}${
getRandomFilename
(
file
.
name
)}
`
;
...
...
@@ -313,10 +314,11 @@ export default {
};
const
uploadExcel
=
yield
call
(
uploader
.
uploadImg
,
params
);
const
fileName
=
`https://shangjiadao.oss-cn-hangzhou.aliyuncs.com/
${
filename
}
`
;
console
.
log
(
file
,
'file'
)
;
document
.
getElementById
(
'uploadexcel'
).
value
=
''
;
yield
put
({
type
:
'uploadStudents'
,
payload
:
{
uploaderLoading
,
file_name
:
fileName
,
file_info
:
JSON
.
stringify
({
name
:
file
.
name
||
''
,
...
...
@@ -327,7 +329,7 @@ export default {
});
},
*
uploadStudents
({
payload
},
{
call
,
put
,
select
})
{
const
{
file_name
,
file_info
}
=
payload
;
const
{
file_name
,
file_info
,
uploaderLoading
}
=
payload
;
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
importData
=
yield
call
(
crmAjax
.
uploadStudents
,
{
file_name
,
...
...
@@ -335,8 +337,10 @@ export default {
school_id
:
sid
,
type
:
1
,
});
setTimeout
(
uploaderLoading
);
const
{
code
,
data
}
=
importData
;
if
(
code
==
200
)
{
message
.
success
(
'导入学员成功'
);
yield
put
({
type
:
'queryUploadTasks'
,
payload
:
{
...
...
src/pages/crm/ClueImport.js
View file @
f4bdeb04
...
...
@@ -17,6 +17,7 @@ import {
Pagination
,
Tooltip
,
DatePicker
,
Divider
,
Popover
,
}
from
'antd'
;
import
moment
from
'moment'
;
import
{
routerRedux
}
from
'dva/router'
;
...
...
@@ -53,6 +54,14 @@ class ClueImport extends React.Component {
upload
,
refresh
,
}
=
this
.
props
;
const
PopoverContent
=
(
props
)
=>
{
const
{
error_message
}
=
props
.
content
;
return
(
<
div
style
=
{{
maxHeight
:
200
,
overflowY
:
'auto'
}}
>
{
error_message
.
data
.
map
(
ele
=>
<
div
><
div
style
=
{{
fontWeight
:
700
,
fontSize
:
16
}}
>
{
ele
.
mobile
}:
<
/div>{ele.msg.map
(
msg => <div>{msg}</
div
>
)}
<
/div>
)
}
<
/div
>
);
};
const
columns
=
[
{
title
:
'文件名'
,
...
...
@@ -66,7 +75,7 @@ class ClueImport extends React.Component {
fileInfo
=
{};
}
return
(
<
span
className
=
"hreflink"
>
{
fileInfo
.
name
||
record
.
file_name
}
<
/span
>
<
span
>
{
fileInfo
.
name
||
record
.
file_name
}
<
/span
>
);
},
},
...
...
@@ -91,11 +100,33 @@ class ClueImport extends React.Component {
key
:
'status'
,
render
:
(
text
,
record
)
=>
{
return
(
<
span
>
{
record
.
status
==
1
&&
'正在上传'
}
<
div
>
{
/* {
record.status == 1 && '正在上传'}
{record.status == 2 && '上传成功'}
{
record
.
status
==
3
&&
'上传失败'
}
<
/span
>
{record.status == 3 && '上传失败'} */
}
<
div
className
=
{
pageStyle
.
uploadStatus
}
>
<
div
className
=
{
`
${
pageStyle
.
dot
}
${
pageStyle
.
totaldot
}
`
}
/
>
<
div
className
=
{
pageStyle
.
totalcounttext
}
>
总共
{
record
.
total
}
条
<
/div
>
<
/div
>
<
div
className
=
{
pageStyle
.
uploadStatus
}
>
<
div
className
=
{
`
${
pageStyle
.
dot
}
${
pageStyle
.
successdot
}
`
}
/
>
<
div
className
=
{
pageStyle
.
successcounttext
}
>
成功
{
record
.
success_total
}
条
<
/div
>
<
/div
>
{
record
.
failed_total
==
0
&&
<
div
className
=
{
pageStyle
.
uploadStatus
}
>
<
div
className
=
{
`
${
pageStyle
.
dot
}
${
pageStyle
.
faildot
}
`
}
/
>
<
div
className
=
{
pageStyle
.
failcounttext
}
>
失败
{
record
.
failed_total
}
条
<
/div
>
<
/div
>
}
{
record
.
failed_total
>
0
&&
<
Popover
content
=
{
<
PopoverContent
content
=
{
record
}
/>} trigger="hover"
>
<
div
className
=
{
pageStyle
.
uploadStatus
}
>
<
div
className
=
{
`
${
pageStyle
.
dot
}
${
pageStyle
.
faildot
}
`
}
/
>
<
div
className
=
{
pageStyle
.
failcounttext
}
>
失败
{
record
.
failed_total
}
条
<
span
style
=
{{
fontSize
:
12
}}
>
(
悬浮鼠标查看失败原因
)
<
/span></
div
>
<
/div
>
<
/Popover
>
}
<
/div
>
);
},
},
...
...
@@ -117,17 +148,17 @@ class ClueImport extends React.Component {
<
div
style
=
{{
marginBottom
:
20
,
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
<
div
>
<
Button
size
=
"small"
type
=
"primary"
style
=
{{
marginRight
:
20
}}
onClick
=
{
goBindSjdAccount
}
>
关联商家岛账号
<
/Button
>
<
Button
size
=
"small"
type
=
"primary"
style
=
{{
marginRight
:
20
,
position
:
'relative'
}}
><
input
onChange
=
{
upload
}
type
=
"file"
className
=
{
pageStyle
.
uploadExcel
}
accept
=
".xls, .xlsx"
/>
上传表格
<
/Button
>
<
Button
size
=
"small"
type
=
"primary"
style
=
{{
marginRight
:
20
,
position
:
'relative'
}}
><
input
id
=
"uploadexcel"
onChange
=
{
upload
}
type
=
"file"
className
=
{
pageStyle
.
uploadExcel
}
accept
=
".xls, .xlsx"
/>
上传表格
<
/Button
>
<
Button
size
=
"small"
type
=
"primary"
style
=
{{
marginRight
:
5
}}
onClick
=
{
this
.
downLoadExcelTemp
}
>
下载模板
<
/Button
>
<
Tooltip
placement
=
"top"
title
=
"下载规定模板,按照顺序要求填写潜在学员信息,即可上传"
>
<
Icon
type
=
"question-circle"
theme
=
"filled"
style
=
{{
opacity
:
0.5
,
fontSize
:
18
,
cursor
:
'pointer'
}}
/
>
<
/Tooltip
>
<
/div
>
<
div
>
{
/*
<div>
<Tooltip placement="top" title="点击更新文件上传进度">
<Icon type="sync" style={{ marginLeft: 150, fontSize: 18, cursor: 'pointer' }} onClick={refresh} />
</Tooltip>
<
/div
>
</div>
*/
}
<
/div
>
<
Table
rowKey
=
"id"
...
...
src/pages/crm/ClueImport.less
View file @
f4bdeb04
...
...
@@ -38,4 +38,32 @@
left: 0;
top: 0;
opacity: 0;
}
.uploadStatus {
display: flex;
align-items: center;
.totalcounttext {
color: #1890ff;
}
.successcounttext {
color: #52c41a;
}
.failcounttext {
color: red;
}
.dot {
width: 5px;
height: 5px;
border-radius: 50%;
margin-right: 5px;
&.totaldot {
background-color: #1890ff;
}
&.faildot {
background-color: red;
}
&.successdot {
background-color: #52c41a;
}
}
}
\ No newline at end of file
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