Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5d844dc1
authored
May 09, 2025
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复第一轮测试BUG
1 parent
e89cba20
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
28 deletions
src/views/financeManage/theAssetData/components/importOne.vue
src/views/financeManage/theAssetData/components/importTwo.vue
src/views/financeManage/theAssetData/index.vue
src/views/financeManage/theAssetData/components/importOne.vue
View file @
5d844dc
...
...
@@ -58,7 +58,7 @@
<input
type=
"file"
id=
"fileUpload-receipt"
class=
"import-input"
accept=
"application/zip,
application/
rar,application/pdf"
accept=
"application/zip,
.
rar,application/pdf"
@
change=
"importReceiptFile($event)"
/>
</el-button>
<div
class=
"file-box"
...
...
@@ -135,7 +135,7 @@ export default {
},
formRules
:
{
detailFileName
:
[
{
required
:
true
,
message
:
"请上传
明细表
"
,
trigger
:
"change"
}
{
required
:
true
,
message
:
"请上传
银行流水明细
"
,
trigger
:
"change"
}
]
},
baseData
:
{},
...
...
@@ -198,21 +198,32 @@ export default {
// 上传银行流水明细文件,转码为base64
importDetailFile
(
e
)
{
const
fileName
=
e
.
target
.
files
[
0
].
name
if
(
!
fileName
.
includes
(
".xlsx"
)
&&
!
fileName
.
includes
(
".xls"
)
)
{
this
.
$message
({
message
:
"文件格式不支持上传"
,
type
:
"error"
})
return
false
}
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
if
(
size
<
10
)
{
this
.
$set
(
this
.
infoForm
,
"detailFileName"
,
e
.
target
.
files
[
0
].
n
ame
)
if
(
size
<
10
0
)
{
this
.
$set
(
this
.
infoForm
,
"detailFileName"
,
fileN
ame
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
(
event
)
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
","
)
// this.fileInfo =
e.target.files[0].name.split('.')[e.target.files[0].n
ame.split('.')?.length - 1] + '@' + arrBase64[1]
// this.fileInfo =
fileName.split('.')[fileN
ame.split('.')?.length - 1] + '@' + arrBase64[1]
this
.
$set
(
this
.
infoForm
,
"detailFileInfo"
,
e
.
target
.
files
[
0
].
n
ame
.
split
(
"."
)[
e
.
target
.
files
[
0
].
n
ame
.
split
(
"."
)?.
length
-
1
fileN
ame
.
split
(
"."
)[
fileN
ame
.
split
(
"."
)?.
length
-
1
]
+
"@"
+
arrBase64
[
1
]
...
...
@@ -222,6 +233,7 @@ export default {
}
}
else
{
this
.
notice
.
errorTips
(
"上传文件不可超过10M"
)
document
.
getElementById
(
"fileUpload-detail"
).
value
=
""
}
},
...
...
@@ -251,9 +263,21 @@ export default {
// 上传回单文件,转码为base64
importReceiptFile
(
e
)
{
const
fileName
=
e
.
target
.
files
[
0
].
name
if
(
!
fileName
.
includes
(
".rar"
)
&&
!
fileName
.
includes
(
".zip"
)
&&
!
fileName
.
includes
(
".pdf"
)
)
{
this
.
$message
({
message
:
"文件格式不支持上传"
,
type
:
"error"
})
return
false
}
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
if
(
size
<
10
)
{
this
.
$set
(
this
.
infoForm
,
"receiptFileName"
,
e
.
target
.
files
[
0
].
n
ame
)
if
(
size
<
10
0
)
{
this
.
$set
(
this
.
infoForm
,
"receiptFileName"
,
fileN
ame
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
...
...
@@ -264,17 +288,18 @@ export default {
this
.
$set
(
this
.
infoForm
,
"receiptFileInfo"
,
e
.
target
.
files
[
0
].
n
ame
.
split
(
"."
)[
e
.
target
.
files
[
0
].
n
ame
.
split
(
"."
)?.
length
-
1
fileN
ame
.
split
(
"."
)[
fileN
ame
.
split
(
"."
)?.
length
-
1
]
+
"@"
+
arrBase64
[
1
]
)
document
.
getElementById
(
"fileUpload-
detail
"
).
value
=
""
document
.
getElementById
(
"fileUpload-
receipt
"
).
value
=
""
this
.
handleReceiptImport
()
}
}
else
{
this
.
notice
.
errorTips
(
"上传文件不可超过10M"
)
document
.
getElementById
(
"fileUpload-receipt"
).
value
=
""
}
},
...
...
src/views/financeManage/theAssetData/components/importTwo.vue
View file @
5d844dc
...
...
@@ -189,9 +189,9 @@ export default {
// console.log("this.tableData_filter", this.tableData_filter)
console
.
log
(
"this.allData"
,
this
.
allData
)
if
(
value
==
0
)
{
this
.
tableData
=
this
.
this
.
allData
.
filter
(
item
=>
!
item
.
receipt
)
this
.
tableData
=
this
.
allData
.
filter
(
item
=>
!
item
.
receipt
)
}
else
if
(
value
==
1
)
{
this
.
tableData
=
this
.
this
.
allData
.
filter
(
item
=>
item
.
receipt
)
this
.
tableData
=
this
.
allData
.
filter
(
item
=>
item
.
receipt
)
}
this
.
total
=
this
.
tableData
.
length
}
...
...
@@ -500,7 +500,7 @@ export default {
},
routerBack
()
{
this
.
$confirm
(
'
请确认是否要执行当前操作
?'
,
'提示'
,
{
this
.
$confirm
(
'
当前操作会删除已导入数据,是否继续
?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
...
...
@@ -525,6 +525,14 @@ export default {
params
.
associationData
=
this
.
allData
console
.
log
(
'params'
,
params
)
if
(
params
.
associationData
.
length
==
0
)
{
this
.
$message
({
message
:
"暂无数据,请重新导入"
,
type
:
"warning"
,
showClose
:
true
})
return
false
}
for
(
const
key
in
params
.
associationData
)
{
console
.
log
(
'params.associationData[key]'
,
params
.
associationData
[
key
])
const
detail
=
params
.
associationData
[
key
].
detail
...
...
@@ -535,10 +543,14 @@ export default {
delete
detail
[
key
]
}
}
for
(
const
key
in
receipt
)
{
if
(
receipt
[
key
]
===
null
||
receipt
[
key
]
===
''
||
receipt
[
key
].
length
==
0
)
{
delete
receipt
[
key
]
if
(
receipt
)
{
for
(
const
key
in
receipt
)
{
if
(
receipt
[
key
]
===
null
||
receipt
[
key
]
===
''
||
receipt
[
key
].
length
==
0
)
{
delete
receipt
[
key
]
}
}
}
else
{
delete
params
.
associationData
[
key
].
receipt
}
}
saveAssociation
(
params
).
then
(
res
=>
{
...
...
@@ -634,4 +646,20 @@ export default {
text-align
:
center
;
/* margin-bottom: 40px; */
}
.m-l-md
{
margin-left
:
20px
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
</
style
>
src/views/financeManage/theAssetData/index.vue
View file @
5d844dc
...
...
@@ -802,22 +802,26 @@ export default {
if
(
this
.
$refs
.
recordTable
.
mutiSelectArr
.
transferAccounts
)
{
selectedData
=
this
.
$refs
.
recordTable
.
mutiSelectArr
.
transferAccounts
}
if
(
!
selectedData
?.
length
)
{
this
.
$message
({
message
:
"请选择要打印的明细"
,
type
:
"warning"
,
showClose
:
true
})
return
false
}
//
if (!selectedData?.length) {
//
this.$message({
//
message: "请选择要打印的明细",
//
type: "warning",
//
showClose: true
//
})
//
return false
//
}
this
.
printIds
=
selectedData
.
map
((
item
)
=>
{
return
item
.
id
})
this
.
batchPrintVisible
=
true
},
handlePrintConfirm
()
{
cons
t
params
=
deepClone
(
this
.
printForm
)
le
t
params
=
deepClone
(
this
.
printForm
)
params
.
detailIds
=
this
.
printIds
if
(
this
.
printIds
.
length
==
0
)
{
params
=
{
...
params
,
...
deepClone
(
this
.
searchFormSearch
)
}
}
// return console.log('params', params)
batchPrinting
(
params
).
then
(
res
=>
{
if
(
res
)
{
window
.
open
(
res
)
...
...
@@ -862,7 +866,7 @@ export default {
gotoImportTwo
()
{
const
query
=
{}
const
taskInfo
=
deepClone
(
this
.
taskInfo
)
taskInfo
.
detailResultSuccessCount
=
taskInfo
.
detailResult
.
successList
.
length
taskInfo
.
detailResultSuccessCount
=
taskInfo
.
detailResult
.
successList
?.
length
||
0
taskInfo
.
detailResultFailCount
=
taskInfo
.
detailResult
.
failList
?.
length
||
0
taskInfo
.
detailResultTotalCount
=
taskInfo
.
detailResultSuccessCount
+
taskInfo
.
detailResultFailCount
taskInfo
.
detailResultFailUrl
=
taskInfo
.
detailResult
.
failListUrl
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment