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 59c2f5dc
authored
May 15, 2025
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
打印屏蔽一页两张,关联数据上传会带改为OSS,接口访问超时时间改为300秒
1 parent
4fe9392f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
47 deletions
src/plugin/axios/index_code.js
src/views/financeManage/theAssetData/components/importTwo.vue
src/views/financeManage/theAssetData/index.vue
src/plugin/axios/index_code.js
View file @
59c2f5d
...
...
@@ -40,7 +40,7 @@ function errorLog(error) {
// 创建一个 axios 实例
const
service
=
axios
.
create
({
// baseURL: baseURL,
timeout
:
1
00000
,
// 请求超时时间
timeout
:
3
00000
,
// 请求超时时间
transformRequest
:
[
function
(
data
)
{
return
Qs
.
stringify
(
data
)
...
...
src/views/financeManage/theAssetData/components/importTwo.vue
View file @
59c2f5d
...
...
@@ -132,6 +132,7 @@ import { Util, deepClone } from '@/common/util'
import
{
mapActions
,
mapState
,
mapMutations
}
from
'vuex'
import
{
cdSignOpt
,
receiptStatusOpt
,
associationOpt
}
from
'@/common/constants.js'
import
{
receiptImport
,
association
,
saveAssociation
,
getImportTask
}
from
'@api/theAssetData'
import
alyOss
from
'@/common/oss.js'
export
default
{
name
:
'ImportTwo'
,
props
:
{
...
...
@@ -453,17 +454,19 @@ export default {
if
(
size
<
10
)
{
this
.
$set
(
this
.
fileForm
,
'fileName'
,
e
.
target
.
files
[
0
].
name
)
// // 转码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
].
name
.
split
(
'.'
)?.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
// 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].name.split('.')?.length - 1] + '@' + arrBase64[1]
// document.getElementById('fileUpload').value = ''
// }
this
.
fileInfo
=
e
.
target
.
files
[
0
]
}
else
{
this
.
notice
.
errorTips
(
'上传文件不可超过10M'
)
}
document
.
getElementById
(
'fileUpload'
).
value
=
''
},
handleImport
()
{
this
.
fileForm
=
{
...
...
@@ -475,22 +478,53 @@ export default {
handleConfirmImport
()
{
this
.
$refs
.
fileRuleForm
.
validate
(
valid
=>
{
if
(
valid
)
{
var
params
=
{
file
:
this
.
fileInfo
,
fileName
:
this
.
fileForm
.
fileName
,
fileType
:
this
.
fileForm
.
fileName
.
substr
(
this
.
fileForm
.
fileName
.
lastIndexOf
(
'.'
)
+
1
)
}
receiptImport
(
params
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
if
(
res
&&
res
.
data
&&
res
.
data
.
length
>
0
)
{
this
.
notice
.
okTips
(
'上传成功'
)
this
.
handleImport
()
this
.
tableData
.
find
(
item
=>
item
===
this
.
currentRow
).
receipt
=
res
.
data
[
0
]
this
.
allData
.
find
(
item
=>
item
===
this
.
currentRow
).
receipt
=
res
.
data
[
0
]
// this.statReceiptCount(this.allData) // 重新统计关联数
console
.
log
(
'this.tableData'
,
this
.
tableData
)
}
})
// var params = {
// file: this.fileInfo,
// fileName: this.fileForm.fileName,
// fileType: this.fileForm.fileName.substr(this.fileForm.fileName.lastIndexOf('.') + 1)
// }
// receiptImport(params).then(res => {
// console.log('res', res)
// if (res && res.data && res.data.length > 0) {
// this.notice.okTips('上传成功')
// this.handleImport()
// this.tableData.find(item => item === this.currentRow).receipt = res.data[0]
// this.allData.find(item => item === this.currentRow).receipt = res.data[0]
// // this.statReceiptCount(this.allData) // 重新统计关联数
// console.log('this.tableData', this.tableData)
// }
// })
const
bucketName
=
'zzl-filerepostorypublic'
// 桶名
const
file
=
this
.
fileInfo
const
fileType
=
this
.
fileForm
.
fileName
.
substr
(
this
.
fileForm
.
fileName
.
lastIndexOf
(
'.'
)
+
1
)
alyOss
.
bucketUpload
(
file
,
(
res
)
=>
{
var
params
=
{
fileUrl
:
res
.
aliyunAddress
,
fileName
:
res
.
attachment
,
fileType
:
res
.
attachment
.
substr
(
res
.
attachment
.
lastIndexOf
(
'.'
)
+
1
)
}
receiptImport
(
params
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
if
(
res
&&
res
.
data
&&
res
.
data
.
length
>
0
)
{
this
.
notice
.
okTips
(
'上传成功'
)
this
.
handleImport
()
this
.
tableData
.
find
(
item
=>
item
===
this
.
currentRow
).
receipt
=
res
.
data
[
0
]
this
.
allData
.
find
(
item
=>
item
===
this
.
currentRow
).
receipt
=
res
.
data
[
0
]
// this.statReceiptCount(this.allData) // 重新统计关联数
console
.
log
(
'this.tableData'
,
this
.
tableData
)
}
})
},
(
err
)
=>
{
console
.
log
(
err
)
this
.
btLoading
=
false
},
bucketName
,
fileType
)
}
})
},
...
...
src/views/financeManage/theAssetData/index.vue
View file @
59c2f5d
...
...
@@ -447,10 +447,11 @@ export default {
{
confId
:
1
,
confLabel
:
'一页一张'
},
{
confId
:
2
,
confLabel
:
'一页两张'
}
// {
// confId: 2,
// confLabel: '一页两张'
// }
],
printIds
:
[],
// pdfList: [
...
...
@@ -775,25 +776,25 @@ export default {
},
changePageType
(
val
)
{
if
(
val
==
1
)
{
this
.
usageList
=
[
{
confId
:
1
,
confLabel
:
'一页一张'
},
{
confId
:
2
,
confLabel
:
'一页两张'
}
]
}
else
if
(
val
==
2
)
{
this
.
usageList
=
[
{
confId
:
1
,
confLabel
:
'一页一张'
}
]
}
this
.
printForm
.
usage
=
this
.
usageList
[
0
].
confId
//
if (val == 1) {
//
this.usageList = [
//
{
//
confId: 1,
//
confLabel: '一页一张'
//
}, {
//
confId: 2,
//
confLabel: '一页两张'
//
}
//
]
//
} else if (val == 2) {
//
this.usageList = [
//
{
//
confId: 1,
//
confLabel: '一页一张'
//
}
//
]
//
}
//
this.printForm.usage = this.usageList[0].confId
},
// 批量打印
...
...
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