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
Hide 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 @@
...
@@ -9,12 +9,12 @@
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
goBack
}
from
"@/utils/globalFun"
import
{
Copy
,
goBack
,
isAndroid
}
from
"@/utils/globalFun"
import
{
NavBar
,
Toast
}
from
"vant"
;
import
{
Dialog
,
NavBar
,
Toast
}
from
"vant"
;
import
VuePdfEmbed
from
'vue-pdf-embed'
import
VuePdfEmbed
from
'vue-pdf-embed'
import
{
watchEffect
}
from
'vue'
import
{
watchEffect
}
from
'vue'
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
downfileHips
from
"@/utils/downfileHips"
import
{
downfileHips
,
openFileUrl
}
from
"@/utils/downfileHips"
const
route
=
useRoute
();
const
route
=
useRoute
();
const
router
=
useRouter
();
const
router
=
useRouter
();
...
@@ -33,30 +33,49 @@ watchEffect(() => {
...
@@ -33,30 +33,49 @@ watchEffect(() => {
})
})
const
download
=
()
=>
{
const
download
=
()
=>
{
downfileHips
(
Copy
(
pdfSource
,
'已将文件地址复制至剪切板,请至浏览器下载'
)
pdfSource
,
// if (isAndroid()) {
(
msg
)
=>
{
// downfileHips(
console
.
log
(
msg
);
// pdfSource,
const
msgObj
=
JSON
.
parse
(
msg
)
// (msg) => {
switch
(
msgObj
.
status
)
{
// console.log(msg);
case
"PROGRESS"
:
// const msgObj = JSON.parse(msg)
console
.
log
(
"正在传输"
)
// switch (msgObj.status) {
break
// case "PROGRESS":
case
"FINISH"
:
// console.log("正在传输")
Toast
({
// Toast.loading({
message
:
`下载成功!保存地址是:
${
msgObj
.
response
}
`
,
// duration: 0,
position
:
'bottom'
,
// forbidClick: true,
});
// message: '下载中...',
break
// });
case
"FAIL"
:
// break
Toast
.
fail
(
'下载失败'
);
// case "FINISH":
}
// Toast.clear();
// Dialog.alert({
},
// title: "下载成功",
(
err
)
=>
{
// message: `保存地址是:${msgObj.response}`
console
.
error
(
'下载失败:'
,
err
)
// });
Toast
.
fail
(
'下载失败'
);
// 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
)
=>
{
const
handleDocumentRender
=
(
args
)
=>
{
...
...
src/modules/contractSign/views/pdfPreList.vue
View file @
92f7c49e
...
@@ -21,11 +21,11 @@
...
@@ -21,11 +21,11 @@
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
goBack
}
from
"@/utils/globalFun"
import
{
Copy
,
goBack
,
isAndroid
}
from
"@/utils/globalFun"
import
{
NavBar
,
List
,
PullRefresh
,
Toast
}
from
"vant"
;
import
{
NavBar
,
List
,
PullRefresh
,
Toast
,
Dialog
}
from
"vant"
;
import
api
from
"../api"
;
import
api
from
"../api"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
downfileHips
from
"@/utils/downfileHips"
import
{
downfileHips
,
openFileUrl
}
from
"@/utils/downfileHips"
const
route
=
useRoute
();
const
route
=
useRoute
();
const
router
=
useRouter
();
const
router
=
useRouter
();
...
@@ -49,30 +49,49 @@ const getDailyLiquidatedDetail = async () => {
...
@@ -49,30 +49,49 @@ const getDailyLiquidatedDetail = async () => {
getDailyLiquidatedDetail
();
getDailyLiquidatedDetail
();
const
download
=
(
item
)
=>
{
const
download
=
(
item
)
=>
{
downfileHips
(
Copy
(
item
.
fileUrl
,
'已将文件地址复制至剪切板,请至浏览器下载'
)
item
.
fileUrl
,
// if (isAndroid()) {
(
msg
)
=>
{
// downfileHips(
console
.
log
(
msg
);
// item.fileUrl,
const
msgObj
=
JSON
.
parse
(
msg
)
// (msg) => {
switch
(
msgObj
.
status
)
{
// console.log(msg);
case
"PROGRESS"
:
// const msgObj = JSON.parse(msg)
console
.
log
(
"正在传输"
)
// switch (msgObj.status) {
break
// case "PROGRESS":
case
"FINISH"
:
// console.log("正在传输")
Toast
({
// Toast.loading({
message
:
`下载成功!保存地址是:
${
msgObj
.
response
}
`
,
// duration: 0,
position
:
'bottom'
,
// forbidClick: true,
});
// message: '下载中...',
break
// });
case
"FAIL"
:
// break
Toast
.
fail
(
'下载失败'
);
// case "FINISH":
}
// Toast.clear();
// Dialog.alert({
},
// title: "下载成功",
(
err
)
=>
{
// message: `保存地址是:${msgObj.response}`
console
.
error
(
'下载失败:'
,
err
)
// });
Toast
.
fail
(
'下载失败'
);
// 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
)
=>
{
const
jump
=
(
item
)
=>
{
...
...
src/modules/repayPlan/views/invoiceList.vue
View file @
92f7c49e
...
@@ -9,7 +9,10 @@
...
@@ -9,7 +9,10 @@
<img
src=
"../../../assets/list.png"
/>
<img
src=
"../../../assets/list.png"
/>
<div
class=
"title"
>
{{
item
.
documentName
}}
</div>
<div
class=
"title"
>
{{
item
.
documentName
}}
</div>
</div>
</div>
<div
class=
"button-status sign"
@
click=
"jump(item)"
>
查看
</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>
</div>
</List>
</List>
</PullRefresh>
</PullRefresh>
...
@@ -18,12 +21,13 @@
...
@@ -18,12 +21,13 @@
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
goBack
,
HIPSDownLoa
d
}
from
"@/utils/globalFun"
import
{
Copy
,
goBack
,
HIPSDownLoad
,
isAndroi
d
}
from
"@/utils/globalFun"
import
{
NavBar
,
List
,
PullRefresh
,
Empty
,
Toast
}
from
"vant"
;
import
{
NavBar
,
List
,
PullRefresh
,
Empty
,
Toast
,
Dialog
}
from
"vant"
;
import
ListItem
from
'@/components/ListItem.vue'
import
ListItem
from
'@/components/ListItem.vue'
import
api
from
"../api"
;
import
api
from
"../api"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
{
useIntention
}
from
"../store"
;
import
{
useIntention
}
from
"../store"
;
import
{
downfileHips
,
openFileUrl
}
from
"@/utils/downfileHips"
;
const
route
=
useRoute
();
const
route
=
useRoute
();
const
router
=
useRouter
();
const
router
=
useRouter
();
...
@@ -60,6 +64,52 @@ const jump = (item) => {
...
@@ -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
>
</
script
>
<
style
scoped
lang=
"less"
>
<
style
scoped
lang=
"less"
>
...
@@ -90,6 +140,7 @@ const jump = (item) => {
...
@@ -90,6 +140,7 @@ const jump = (item) => {
}
}
.left {
.left {
display: flex;
display: flex;
//width: calc(100% - 100px);
}
}
.item img{
.item img{
width: 20px;
width: 20px;
...
@@ -102,16 +153,16 @@ const jump = (item) => {
...
@@ -102,16 +153,16 @@ const jump = (item) => {
margin-left: 16px;
margin-left: 16px;
font-weight: 600;
font-weight: 600;
line-height: 20px;
line-height: 20px;
word-break:break-all;
}
}
.button-status{
.button-status{
width: 5
4
px;
width: 5
0
px;
height: 20px;
height: 20px;
font-size: 12px;
font-size: 12px;
border-radius: 10px;
border-radius: 10px;
display: flex;
display: flex;
justify-content: center;
justify-content: center;
align-items: center;
align-items: center;
margin-right: 15px;
}
}
.sign{
.sign{
color: #2499FF;
color: #2499FF;
...
...
src/utils/downfileHips.js
View file @
92f7c49e
...
@@ -23,6 +23,8 @@ function downloadFile(source, target, isTemp = 'N',succesE,errorE) {
...
@@ -23,6 +23,8 @@ function downloadFile(source, target, isTemp = 'N',succesE,errorE) {
HandBridge
.
postMessage
(
JSON
.
stringify
(
args
))
HandBridge
.
postMessage
(
JSON
.
stringify
(
args
))
}
}
// {
// {
// "status":"PROGRESS"/"FINISH"/"FAIL" //正在传输/完成/失败
// "status":"PROGRESS"/"FINISH"/"FAIL" //正在传输/完成/失败
// "fileSize":1234 //文件总大小,当为-1时则表示文件的大小不可获取
// "fileSize":1234 //文件总大小,当为-1时则表示文件的大小不可获取
...
@@ -30,6 +32,29 @@ function downloadFile(source, target, isTemp = 'N',succesE,errorE) {
...
@@ -30,6 +32,29 @@ function downloadFile(source, target, isTemp = 'N',succesE,errorE) {
// "response":"xxxxx" //传输完成后文件的本地路径
// "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
)
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