Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
周远喜
mes-ui
Commits
f3684646
Commit
f3684646
authored
Nov 12, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import plan
parent
e2597f34
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
4 deletions
+61
-4
process.vue
components/page/import/process.vue
+57
-2
zh-CN.js
i18n/locale/zh-CN.js
+3
-1
index.vue
pages/project/plan/index.vue
+1
-1
No files found.
components/page/import/process.vue
View file @
f3684646
...
...
@@ -61,6 +61,7 @@
<
script
>
import
XLSX
from
"xlsx"
;
import
Api
from
'@/plugins/request'
import
{
Switch
}
from
"view-design"
;
...
...
@@ -82,6 +83,7 @@ export default {
formatList
:
[
"xlsx"
],
columnsImport
:
[],
departArr
:
[],
//部门list
usersArr
:
[],
sheetNames
:
[],
//excel的表明
workBook
:
{},
openDatas
:
[],
...
...
@@ -129,9 +131,21 @@ export default {
this
.
$api
.
get
(
`
${
systemUrl
}
/Department/GetDepartments`
).
then
((
r
)
=>
{
this
.
departArr
=
r
.
result
.
items
;
});
this
.
$api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
usersArr
=
r
.
result
}
})
//导出对列表头进行预加载end
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
await
store
.
dispatch
(
"loadUsers"
);
// 加载数据字典
},
mounted
()
{
//if (this.eid > 0) {
// this.load(this.eid);
...
...
@@ -144,6 +158,7 @@ export default {
this
.
tdHeightExcel
=
window
.
screenHeight
-
180
;
})();
};
},
methods
:
{
//重新处理colum
...
...
@@ -198,6 +213,8 @@ export default {
temData
=
this
.
$u
.
clone
(
this
.
$refs
.
comExcel
.
excelData
);
}
let
arrTitleUse
=
[];
////使用数据字典的字段
let
arrUseName
=
[];
////使用单个用户字段
let
arrUseNames
=
[];
////使用多用户字段
temColPage
.
forEach
((
elCode
)
=>
{
if
(
elCode
.
code
)
{
arrTitleUse
.
push
({
...
...
@@ -205,6 +222,18 @@ export default {
code
:
elCode
.
code
,
});
}
if
(
elCode
.
type
==
"user"
)
{
arrUseName
.
push
({
key
:
elCode
.
key
,
code
:
elCode
.
type
,
});
}
if
(
elCode
.
type
==
"users"
)
{
arrUseNames
.
push
({
key
:
elCode
.
key
,
code
:
elCode
.
type
,
});
}
});
let
useData
=
[];
//重新组织list列表数据
temData
.
forEach
((
elData
,
index
)
=>
{
...
...
@@ -215,7 +244,7 @@ export default {
useData
.
push
(
objTm
);
});
//对列表里的部门及数据字典项进行处理
//对列表里的部门及数据字典项
、用户等
进行处理
useData
.
forEach
((
eles
)
=>
{
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if
(
...
...
@@ -247,7 +276,32 @@ export default {
}
});
}
//人员名称转换为userid,如果查不到此人员,则为空
arrUseName
.
forEach
((
euser
)
=>
{
if
(
eles
[
euser
.
key
]
&&
eles
[
euser
.
key
]
!=
""
&&
eles
[
euser
.
key
]
!=
null
)
{
this
.
usersArr
.
forEach
(
eluser
=>
{
if
(
eles
[
euser
.
key
]
==
eluser
.
name
)
{
eles
[
euser
.
key
]
=
eluser
.
id
}
})
}
});
//多个名称转换为数组
arrUseNames
.
forEach
((
eusers
)
=>
{
if
(
eles
[
eusers
.
key
]
&&
eles
[
eusers
.
key
]
!=
""
&&
eles
[
eusers
.
key
]
!=
null
)
{
let
arruserstemp
=
this
.
$u
.
clone
(
eles
[
eusers
.
key
].
split
(
','
)
||
eles
[
eusers
.
key
].
split
(
','
))
let
tempUserIds
=
[]
arruserstemp
.
forEach
(
eltempUsers
=>
{
this
.
usersArr
.
forEach
(
elusers
=>
{
if
(
eltempUsers
==
elusers
.
name
)
{
tempUserIds
.
push
(
elusers
.
id
)
}
})
})
eles
[
eusers
.
key
]
=
tempUserIds
}
});
arrTitleUse
.
forEach
((
elem
)
=>
{
if
(
eles
[
elem
.
key
]
&&
...
...
@@ -436,6 +490,7 @@ export default {
this
.
dataIm
=
formatList
;
this
.
batchImportUrl
=
url
;
},
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
...
...
i18n/locale/zh-CN.js
View file @
f3684646
...
...
@@ -1824,7 +1824,8 @@ export default {
type
:
'类型'
,
attachment
:
'附件'
,
executor
:
'执行人'
,
upTitle
:
'上级名称'
upTitle
:
'上级名称'
,
deliverable
:
"交付物"
,
},
project_main
:
{
creationTime
:
'创建时间'
,
...
...
@@ -2022,6 +2023,7 @@ document_category: {
deliverable
:
"交付物"
,
upId
:
'父级'
,
title
:
'标题'
,
upTitle
:
'上级名称'
,
status
:
'状态'
,
note
:
'描述'
,
startDate
:
'开始日期'
,
...
...
pages/project/plan/index.vue
View file @
f3684646
...
...
@@ -489,7 +489,7 @@ export default {
startDate
:
ele
.
startDate
?
ele
.
startDate
:
""
,
//?
endDate
:
ele
.
endDate
?
ele
.
endDate
:
""
,
//?
direction
:
ele
.
direction
?
ele
.
direction
:
0
,
executor
:
ele
.
executor
?
ele
.
executor
:
null
,
//?
executor
:
ele
.
executor
?
ele
.
executor
:
[]
,
//?
};
if
(
ele
.
title
&&
ele
.
title
!=
''
)
{
...
...
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