fix bug
This commit is contained in:
@ -397,19 +397,19 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
text: '生成电子单据',
|
text: '生成电子单据',
|
||||||
click: _record => this.generate(_record, 2),
|
click: _record => this.generate(_record, 2),
|
||||||
iif: item => item.auditStatus == '1' && !item.loadingLadingBillFilePath,
|
iif: item => !item.loadingLadingBillFilePath,
|
||||||
acl: { ability: ['ORDER-RECEIPTS-electronicBillingOne'] },
|
acl: { ability: ['ORDER-RECEIPTS-electronicBillingOne'] },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '通过',
|
text: '通过',
|
||||||
click: _record => this.sign(_record),
|
click: _record => this.sign(_record),
|
||||||
iif: item => item.auditStatus == '1' && !item.loadingLadingBillFilePath,
|
iif: item => !item.loadingLadingBillFilePath,
|
||||||
acl: { ability: ['ORDER-RECEIPTS-billAuditPassBatch'] },
|
acl: { ability: ['ORDER-RECEIPTS-billAuditPassBatch'] },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '修改',
|
text: '修改',
|
||||||
click: _record => this.modification(_record),
|
click: _record => this.modification(_record),
|
||||||
iif: item => item.auditStatus == '1' && !item.loadingLadingBillFilePath,
|
iif: item => !item.loadingLadingBillFilePath,
|
||||||
acl: { ability: ['ORDER-RECEIPTS-updateBillExamine'] },
|
acl: { ability: ['ORDER-RECEIPTS-updateBillExamine'] },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* @Author : Shiming
|
* @Author : Shiming
|
||||||
* @Date : 2021-12-15 13:17:42
|
* @Date : 2021-12-15 13:17:42
|
||||||
* @LastEditors : Shiming
|
* @LastEditors : Shiming
|
||||||
* @LastEditTime : 2022-04-01 14:27:47
|
* @LastEditTime : 2022-04-01 15:28:44
|
||||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\audit\\voucher-view\\voucher-view.component.html
|
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\audit\\voucher-view\\voucher-view.component.html
|
||||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||||
-->
|
-->
|
||||||
@ -12,12 +12,11 @@
|
|||||||
<sf #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="formData" button="none">
|
<sf #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="formData" button="none">
|
||||||
<ng-template sf-template="no0" let-me let-ui="ui" let-schema="schema">
|
<ng-template sf-template="no0" let-me let-ui="ui" let-schema="schema">
|
||||||
<div style="color: #1890FF" >
|
<div style="color: #1890FF" >
|
||||||
<!-- <a [href]="loadPDF" (click)="openlaod(me)">电子装货单</a> -->
|
<div (click)="openlaod(1)">电子装货单</div>
|
||||||
<div (click)="openlaod(me)">电子装货单</div>
|
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template sf-template="no6" let-me let-ui="ui" let-schema="schema">
|
<ng-template sf-template="no6" let-me let-ui="ui" let-schema="schema">
|
||||||
<div style="color: #1890FF">电子卸货单</div>
|
<div style="color: #1890FF" (click)="openlaod(2)">电子卸货单</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</sf>
|
</sf>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -32,6 +32,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
|
|||||||
i: any;
|
i: any;
|
||||||
loadPDF: string = '';
|
loadPDF: string = '';
|
||||||
formData: any;
|
formData: any;
|
||||||
|
datas: any;
|
||||||
Status: any;
|
Status: any;
|
||||||
data: any ={
|
data: any ={
|
||||||
weight: 0,
|
weight: 0,
|
||||||
@ -438,17 +439,16 @@ export class orderManagementVoucherViewComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
sure() {
|
sure() {
|
||||||
const params = [this.i.id];
|
const params = [this.i.id];
|
||||||
this.service.request(this.service.$api_get_billAuditPass, params).subscribe((res) => {
|
this.service.downloadFile(this.service.$api_createBillTakeGoods,params)
|
||||||
if(res) {
|
this.service.downloadFile(this.service.$api_createBillDischargeGoods,params)
|
||||||
this.service.msgSrv.success('生成电子单据成功!')
|
this.service.msgSrv.success('生成电子单据成功!')
|
||||||
this.modal.destroy(true);
|
this.modal.destroy(true);
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 确认到车界面信息(两个只能看的图片)
|
// 确认到车界面信息(两个只能看的图片)
|
||||||
initData() {
|
initData() {
|
||||||
this.service.request(this.service.$api_get_getCredentials, { id : this.i?.id}).subscribe((res) => {
|
this.service.request(this.service.$api_get_getCredentials, { id : this.i?.id}).subscribe((res) => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
this.datas = res
|
||||||
if (res.unloadingLadingBillFilePath) {
|
if (res.unloadingLadingBillFilePath) {
|
||||||
this.formData = {
|
this.formData = {
|
||||||
loadingLadingBillFilePath: [
|
loadingLadingBillFilePath: [
|
||||||
@ -503,40 +503,17 @@ export class orderManagementVoucherViewComponent implements OnInit {
|
|||||||
this.modal.destroy(true);
|
this.modal.destroy(true);
|
||||||
}
|
}
|
||||||
openlaod(value: any) {
|
openlaod(value: any) {
|
||||||
"https://sascs-tj-tms-test.obs.cn-south-1.myhuaweicloud.com:443/854be85a81d4471ebeb9cda464dcc5eb.pdf"
|
if(value === 1) {
|
||||||
let url: any = 'https://sascs-tj-tms-test.obs.cn-south-1.myhuaweicloud.com:443/854be85a81d4471ebeb9cda464dcc5eb.pdf';
|
const a = document.createElement('a');
|
||||||
const xhr = new XMLHttpRequest();
|
console.log(this.datas?.loadingLadingBillFilePath);
|
||||||
xhr.open('GET', url, true);
|
a.href = this.datas?.loadingLadingBillFilePath;
|
||||||
xhr.responseType = 'blob';
|
a.click();
|
||||||
//xhr.setRequestHeader('Authorization', 'Basic a2VybWl0Omtlcm1pdA==');
|
} else {
|
||||||
xhr.onload = () => {
|
const a = document.createElement('a');
|
||||||
if (xhr.status === 200) {
|
console.log(this.datas?.loadingPeopleVehiclesGoodsFilePath);
|
||||||
// 获取文件blob数据并保存
|
a.href = this.datas?.loadingPeopleVehiclesGoodsFilePath;
|
||||||
var fileName = this.getFileName(url);
|
a.click();
|
||||||
console.log(xhr.response);
|
}
|
||||||
|
|
||||||
// saveAs(xhr.response, fileName);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
xhr.send();
|
|
||||||
// const disp = res.headers.get('Content-Disposition');
|
|
||||||
// const blob = new Blob([res.body], { type: 'text/plain;charset=utf-8' });
|
|
||||||
// const url = window.URL.createObjectURL(blob);
|
|
||||||
// const a = document.createElement('a');
|
|
||||||
// const fileName = disp.split(';')[1].split('=')[1];
|
|
||||||
// a.href = url;
|
|
||||||
// a.download = decodeURI(fileName);
|
|
||||||
// a.click();
|
|
||||||
// window.URL.revokeObjectURL(url);
|
|
||||||
// console.log(value?.loadingLadingBillFilePath);
|
|
||||||
// this.loadPDF = value?.loadingLadingBillFilePath;
|
|
||||||
}
|
|
||||||
getFileName(url:any)
|
|
||||||
{
|
|
||||||
var num = url.lastIndexOf('/')+1
|
|
||||||
var fileName = url.substring(num)
|
|
||||||
//把参数和文件名分割开
|
|
||||||
fileName = decodeURI(fileName.split("?")[0]);
|
|
||||||
return fileName;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user