fix bug
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
* @Author : Shiming
|
* @Author : Shiming
|
||||||
* @Date : 2021-12-06 20:20:26
|
* @Date : 2021-12-06 20:20:26
|
||||||
* @LastEditors : Shiming
|
* @LastEditors : Shiming
|
||||||
* @LastEditTime : 2022-03-29 14:30:11
|
* @LastEditTime : 2022-04-11 22:31:18
|
||||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.ts
|
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.ts
|
||||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||||
*/
|
*/
|
||||||
@ -127,13 +127,13 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
|
|||||||
agreement(value: any) {
|
agreement(value: any) {
|
||||||
if(value ==='1'){
|
if(value ==='1'){
|
||||||
this.modalTitle = '附件信息';
|
this.modalTitle = '附件信息';
|
||||||
this.modalcontent = this.i?.contractContent?.contractContent;
|
// this.modalcontent = this.i?.contractContent?.contractContent;
|
||||||
|
this.service.reviewPDF(this.i?.contractContent?.contractFilePath)
|
||||||
}else if(value === '2'){
|
}else if(value === '2'){
|
||||||
this.modalTitle = '补充协议';
|
this.modalTitle = '补充协议';
|
||||||
this.modalcontent = this.i?.supplementContent?.contractContent;
|
this.modalcontent = this.i?.supplementContent?.contractContent;
|
||||||
|
this.isVisible = true;
|
||||||
}
|
}
|
||||||
this.isVisible = true;
|
|
||||||
}
|
}
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
this.isVisible = false;
|
this.isVisible = false;
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* @Author : Shiming
|
* @Author : Shiming
|
||||||
* @Date : 2021-12-03 15:31:52
|
* @Date : 2021-12-03 15:31:52
|
||||||
* @LastEditors : Shiming
|
* @LastEditors : Shiming
|
||||||
* @LastEditTime : 2022-04-11 14:35:08
|
* @LastEditTime : 2022-04-11 22:29:34
|
||||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\services\\order-management.service.ts
|
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\services\\order-management.service.ts
|
||||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||||
*/
|
*/
|
||||||
@ -244,4 +244,25 @@ export class OrderManagementService extends ShipperBaseService {
|
|||||||
constructor(public injector: Injector) {
|
constructor(public injector: Injector) {
|
||||||
super(injector);
|
super(injector);
|
||||||
}
|
}
|
||||||
|
public reviewPDF(url: string) {
|
||||||
|
if (!url) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const uA = window.navigator.userAgent; // 判断浏览器内核
|
||||||
|
const isIE =
|
||||||
|
/msie\s|trident\/|edge\//i.test(uA) &&
|
||||||
|
!!('uniqueID' in document || 'documentMode' in document || 'ActiveXObject' in window || 'MSInputMethodContext' in window);
|
||||||
|
const objectUrl = url;
|
||||||
|
const a = document.createElement('a');
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.href = objectUrl;
|
||||||
|
a.download = '附件.pdf';
|
||||||
|
if (isIE) {
|
||||||
|
// 兼容IE11无法触发下载的问题
|
||||||
|
(navigator as any).msSaveBlob(url, a.download);
|
||||||
|
} else {
|
||||||
|
a.click();
|
||||||
|
}
|
||||||
|
a.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user