Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
komatsu-lease-app
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
komatsu
komatsu-lease-app
Commits
92f7c49e
Commit
92f7c49e
authored
Mar 07, 2024
by
14699
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:合同签约及发票附件下载调整
parent
0a05f5b3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
174 additions
and
60 deletions
+174
-60
pdfPre.vue
src/modules/contractSign/views/pdfPre.vue
+46
-27
pdfPreList.vue
src/modules/contractSign/views/pdfPreList.vue
+46
-27
invoiceList.vue
src/modules/repayPlan/views/invoiceList.vue
+56
-5
downfileHips.js
src/utils/downfileHips.js
+26
-1
No files found.
src/modules/contractSign/views/pdfPre.vue
View file @
92f7c49e
...
...
@@ -9,12 +9,12 @@
</
template
>
<
script
setup
>
import
{
goBack
}
from
"@/utils/globalFun"
import
{
NavBar
,
Toast
}
from
"vant"
;
import
{
Copy
,
goBack
,
isAndroid
}
from
"@/utils/globalFun"
import
{
Dialog
,
NavBar
,
Toast
}
from
"vant"
;
import
VuePdfEmbed
from
'vue-pdf-embed'
import
{
watchEffect
}
from
'vue'
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
downfileHips
from
"@/utils/downfileHips"
import
{
downfileHips
,
openFileUrl
}
from
"@/utils/downfileHips"
const
route
=
useRoute
();
const
router
=
useRouter
();
...
...
@@ -33,30 +33,49 @@ watchEffect(() => {
})
const
download
=
()
=>
{
downfileHips
(
pdfSource
,
(
msg
)
=>
{
console
.
log
(
msg
);
const
msgObj
=
JSON
.
parse
(
msg
)
switch
(
msgObj
.
status
)
{
case
"PROGRESS"
:
console
.
log
(
"正在传输"
)
break
case
"FINISH"
:
Toast
({
message
:
`下载成功!保存地址是:
${
msgObj
.
response
}
`
,
position
:
'bottom'
,
});
break
case
"FAIL"
:
Toast
.
fail
(
'下载失败'
);
}
},
(
err
)
=>
{
console
.
error
(
'下载失败:'
,
err
)
Toast
.
fail
(
'下载失败'
);
})
Copy
(
pdfSource
,
'已将文件地址复制至剪切板,请至浏览器下载'
)
// if (isAndroid()) {
// downfileHips(
// pdfSource,
// (msg) => {
// console.log(msg);
// const msgObj = JSON.parse(msg)
// switch (msgObj.status) {
// case "PROGRESS":
// console.log("正在传输")
// Toast.loading({
// duration: 0,
// forbidClick: true,
// message: '下载中...',
// });
// break
// case "FINISH":
// Toast.clear();
// Dialog.alert({
// title: "下载成功",
// message: `保存地址是:${msgObj.response}`
// });
// break
// case "FAIL":
// Toast.clear();
// Toast.fail('下载失败');
// }
//
// },
// (err) => {
// console.error('下载失败:', err)
// Toast.fail('下载失败');
// })
// } else {
// openFileUrl(
// pdfSource,
// (msg) => {
// console.log(msg);
// },
// (err) => {
// Copy(pdfSource, '已将文件地址复制至剪切板,请至浏览器下载')
// })
// }
}
const
handleDocumentRender
=
(
args
)
=>
{
...
...
src/modules/contractSign/views/pdfPreList.vue
View file @
92f7c49e
...
...
@@ -21,11 +21,11 @@
</
template
>
<
script
setup
>
import
{
goBack
}
from
"@/utils/globalFun"
import
{
NavBar
,
List
,
PullRefresh
,
Toast
}
from
"vant"
;
import
{
Copy
,
goBack
,
isAndroid
}
from
"@/utils/globalFun"
import
{
NavBar
,
List
,
PullRefresh
,
Toast
,
Dialog
}
from
"vant"
;
import
api
from
"../api"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
downfileHips
from
"@/utils/downfileHips"
import
{
downfileHips
,
openFileUrl
}
from
"@/utils/downfileHips"
const
route
=
useRoute
();
const
router
=
useRouter
();
...
...
@@ -49,30 +49,49 @@ const getDailyLiquidatedDetail = async () => {
getDailyLiquidatedDetail
();
const
download
=
(
item
)
=>
{
downfileHips
(
item
.
fileUrl
,
(
msg
)
=>
{
console
.
log
(
msg
);
const
msgObj
=
JSON
.
parse
(
msg
)
switch
(
msgObj
.
status
)
{
case
"PROGRESS"
:
console
.
log
(
"正在传输"
)
break
case
"FINISH"
:
Toast
({
message
:
`下载成功!保存地址是:
${
msgObj
.
response
}
`
,
position
:
'bottom'
,
});
break
case
"FAIL"
:
Toast
.
fail
(
'下载失败'
);
}
},
(
err
)
=>
{
console
.
error
(
'下载失败:'
,
err
)
Toast
.
fail
(
'下载失败'
);
})
Copy
(
item
.
fileUrl
,
'已将文件地址复制至剪切板,请至浏览器下载'
)
// if (isAndroid()) {
// downfileHips(
// item.fileUrl,
// (msg) => {
// console.log(msg);
// const msgObj = JSON.parse(msg)
// switch (msgObj.status) {
// case "PROGRESS":
// console.log("正在传输")
// Toast.loading({
// duration: 0,
// forbidClick: true,
// message: '下载中...',
// });
// break
// case "FINISH":
// Toast.clear();
// Dialog.alert({
// title: "下载成功",
// message: `保存地址是:${msgObj.response}`
// });
// break
// case "FAIL":
// Toast.clear();
// Toast.fail('下载失败');
// }
//
// },
// (err) => {
// console.error('下载失败:', err)
// Toast.fail('下载失败');
// })
// } else {
// openFileUrl(
// item.fileUrl,
// (msg) => {
// console.log(msg);
// },
// (err) => {
// Copy(item.fileUrl, '已将文件地址复制至剪切板,请至浏览器下载')
// })
// }
}
const
jump
=
(
item
)
=>
{
...
...
src/modules/repayPlan/views/invoiceList.vue
View file @
92f7c49e
...
...
@@ -9,7 +9,10 @@
<img
src=
"../../../assets/list.png"
/>
<div
class=
"title"
>
{{
item
.
documentName
}}
</div>
</div>
<div
style=
"display: flex;"
>
<div
class=
"button-status sign"
@
click=
"jump(item)"
>
查看
</div>
<div
class=
"button-status sign"
@
click=
"download(item)"
>
下载
</div>
</div>
</div>
</List>
</PullRefresh>
...
...
@@ -18,12 +21,13 @@
</
template
>
<
script
setup
>
import
{
goBack
,
HIPSDownLoa
d
}
from
"@/utils/globalFun"
import
{
NavBar
,
List
,
PullRefresh
,
Empty
,
Toast
}
from
"vant"
;
import
{
Copy
,
goBack
,
HIPSDownLoad
,
isAndroi
d
}
from
"@/utils/globalFun"
import
{
NavBar
,
List
,
PullRefresh
,
Empty
,
Toast
,
Dialog
}
from
"vant"
;
import
ListItem
from
'@/components/ListItem.vue'
import
api
from
"../api"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
useIntention
}
from
"../store"
;
import
{
downfileHips
,
openFileUrl
}
from
"@/utils/downfileHips"
;
const
route
=
useRoute
();
const
router
=
useRouter
();
...
...
@@ -60,6 +64,52 @@ const jump = (item) => {
}
}
const
download
=
(
item
)
=>
{
Copy
(
item
.
downloadUrl
,
'已将文件地址复制至剪切板,请至浏览器下载'
)
// if (isAndroid()) {
// downfileHips(
// item.downloadUrl,
// (msg) => {
// console.log(msg);
// const msgObj = JSON.parse(msg)
// switch (msgObj.status) {
// case "PROGRESS":
// console.log("正在传输")
// Toast.loading({
// duration: 0,
// forbidClick: true,
// message: '下载中...',
// });
// break
// case "FINISH":
// Toast.clear();
// Dialog.alert({
// title: "下载成功",
// message: `保存地址是:${msgObj.response}`
// });
// break
// case "FAIL":
// Toast.clear();
// Toast.fail('下载失败');
// }
//
// },
// (err) => {
// console.error('下载失败:', err)
// Toast.fail('下载失败');
// })
// } else {
// openFileUrl(
// item.downloadUrl,
// (msg) => {
// console.log(msg);
// },
// (err) => {
// Copy(item.downloadUrl, '已将文件地址复制至剪切板,请至浏览器下载')
// })
// }
}
</
script
>
<
style
scoped
lang=
"less"
>
...
...
@@ -90,6 +140,7 @@ const jump = (item) => {
}
.left {
display: flex;
//width: calc(100% - 100px);
}
.item img{
width: 20px;
...
...
@@ -102,16 +153,16 @@ const jump = (item) => {
margin-left: 16px;
font-weight: 600;
line-height: 20px;
word-break:break-all;
}
.button-status{
width: 5
4
px;
width: 5
0
px;
height: 20px;
font-size: 12px;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
margin-right: 15px;
}
.sign{
color: #2499FF;
...
...
src/utils/downfileHips.js
View file @
92f7c49e
...
...
@@ -23,6 +23,8 @@ function downloadFile(source, target, isTemp = 'N',succesE,errorE) {
HandBridge
.
postMessage
(
JSON
.
stringify
(
args
))
}
// {
// "status":"PROGRESS"/"FINISH"/"FAIL" //正在传输/完成/失败
// "fileSize":1234 //文件总大小,当为-1时则表示文件的大小不可获取
...
...
@@ -30,6 +32,29 @@ function downloadFile(source, target, isTemp = 'N',succesE,errorE) {
// "response":"xxxxx" //传输完成后文件的本地路径
// }
export
default
function
downfileHips
(
source
,
succesE
,
errorE
,
target
,
isTemp
=
'N'
)
{
export
function
downfileHips
(
source
,
succesE
,
errorE
,
target
,
isTemp
=
'N'
)
{
downloadFile
(
source
,
target
,
isTemp
,
succesE
,
errorE
)
}
export
function
openFileUrl
(
source
,
succesE
,
errorE
)
{
window
.
onSuccess
=
function
(
res
){
console
.
log
(
'success:'
,
res
);
succesE
(
res
)
};
window
.
onError
=
function
(
res
){
console
.
log
(
'download:'
,
res
);
errorE
(
res
)
};
let
options
=
{
scheme
:
source
}
let
args
=
{
className
:
"BaseBridge"
,
function
:
"gotoScheme"
,
params
:
options
,
successCallBack
:
"onSuccess"
,
failCallBack
:
"onError"
}
console
.
log
(
JSON
.
stringify
(
args
));
HandBridge
.
postMessage
(
JSON
.
stringify
(
args
))
}
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