Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
klck
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
位宇华
klck
Commits
c4f5679a
Commit
c4f5679a
authored
Aug 28, 2023
by
xiangjiaojunxp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料转换和批量对比
parent
1b098b31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
ruoyi-ui/src/views/system/supplies/index.vue
ruoyi-ui/src/views/system/supplies/index.vue
+23
-0
ruoyi-ui/src/views/system/supplies/viewuploads.vue
ruoyi-ui/src/views/system/supplies/viewuploads.vue
+28
-1
No files found.
ruoyi-ui/src/views/system/supplies/index.vue
View file @
c4f5679a
...
...
@@ -165,6 +165,29 @@ export default {
roleId
=
this
.
selectedRule
;
rule
=
response
.
rows
;
});
if
(
tempId
===
7
){
getSuppliesTemplate
(
7
).
then
(
response
=>
{
uuid1
=
this
.
uuid
=
uuidv4
().
substring
(
0
,
8
);
console
.
log
(
this
.
uuid
);
const
sysSupplies
=
response
.
rows
;
this
.
luckysheetData
=
sysSupplies
[
0
].
templateContent
;
//将接收到的json存到json_data中
//const json_data = response.data;
let
json_data
=
JSON
.
parse
(
sysSupplies
[
0
].
templateContent
);
//luckysheet.destroy()
luckysheet
.
create
({
container
:
"
luckysheet
"
,
// Luckysheet 的容器元素 ID
title
:
fileName
,
// Excel 文件名
data
:
json_data
,
// Excel 数据
showinfobar
:
false
,
//是否显示顶部名称栏
lang
:
'
zh
'
,
});
}).
catch
(()
=>
{
// 处理错误逻辑,这里是一个空的错误处理函数
this
.
$message
.
error
(
'
查询失败,发生未知错误!
'
);
});
}
},
/** 回车事件和保存提交绑定 */
...
...
ruoyi-ui/src/views/system/supplies/viewuploads.vue
View file @
c4f5679a
...
...
@@ -151,6 +151,7 @@ export default {
const
originalName
=
item
.
name
;
let
newName
=
originalName
;
let
count
=
1
;
// 检查是否存在同名文件,如果存在则进行递增命名
while
(
this
.
isFileNameExists
(
newName
))
{
const
dotIndex
=
originalName
.
lastIndexOf
(
'
.
'
);
...
...
@@ -164,6 +165,12 @@ export default {
item
.
name
=
newName
;
this
.
fileName1
.
splice
(
index
+
1
,
0
,
item
);
this
.
fileName1
[
index
+
1
].
copy
=
`(
${
count
-
1
}
)`
;
if
(
!
this
.
fileName1
[
index
+
1
].
hasOwnProperty
(
'
oldname
'
))
{
let
suffixArr
=
originalName
.
split
(
'
.
'
);
suffixArr
.
pop
();
// 删除数组中的最后一项,即 '.xlsx'
const
newname
=
suffixArr
.
join
(
'
.
'
);
// 将数组中剩下的部分通过 . 连接起来
this
.
fileName1
[
index
+
1
].
oldname
=
newname
;
}
},
uploadFolder2
()
{
this
.
$refs
.
folderInput2
.
value
=
''
;
// 清空文件选择框的值
...
...
@@ -328,7 +335,18 @@ export default {
this
.
isDivVisible
=
false
;
this
.
isluckysheet
=
true
;
for
(
let
i
=
0
;
i
<
this
.
fileName1
.
length
;
i
++
){
await
this
.
handleFileChange
(
this
.
fileName1
[
i
].
data
,
this
.
fileName1
[
i
].
copy
);
let
sda
=
this
.
fileName1
;
const
name
=
this
.
fileName1
[
i
].
name
;
//ACCOUNT通用 (1) (1).xlsx
let
suffixArr
=
name
.
split
(
'
.
'
);
suffixArr
.
pop
();
// 删除数组中的最后一项,即 '.xlsx'
const
newname
=
suffixArr
.
join
(
'
.
'
);
// 将数组中剩下的部分通过 . 连接起来
const
oldname
=
this
.
fileName1
[
i
].
oldname
;
//ACCOUNT通用.xlsx
let
extraPart
if
(
oldname
!==
undefined
){
extraPart
=
newname
.
replace
(
oldname
,
''
).
trim
();
// 去掉前后空格
}
//const newcode = extraPart ? extraPart : '没有多余的部分';
await
this
.
handleFileChange
(
this
.
fileName1
[
i
].
data
,
extraPart
);
await
this
.
handleFileChange1
(
this
.
fileName2
[
i
].
data
);
}
luckysheet
.
create
({
...
...
@@ -377,6 +395,7 @@ export default {
}
else
{
name1
=
exportJson
.
sheets
[
0
].
name
;
}
//console.log(name1);
datast
=
exportJson
.
sheets
;
namest
=
exportJson
.
info
.
name
;
let
suffixArr
=
exportJson
.
info
.
name
.
split
(
'
.
'
);
...
...
@@ -419,6 +438,9 @@ export default {
let
cell
=
(
c1
<=
c2
)
?
c1
:
c2
;
let
array
=
[];
let
r
=
this
.
row
-
1
;
try
{
for
(
let
i
=
r
;
i
<
row
;
i
++
)
{
for
(
let
j
=
0
;
j
<
cell
;
j
++
)
{
//第一个表的单元格为null直接跳出
...
...
@@ -494,6 +516,11 @@ export default {
type
:
"
success
"
});
}
}
catch
(
err
){
this
.
$message
({
message
:
"
导入失败,导入文件与对比文件有所不匹
"
,
type
:
"
error
"
});
}
data1
=
''
;
ddd
=
''
;
resolve
(
data1
);
...
...
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