This commit is contained in:
wangshiming
2022-04-01 14:54:14 +08:00
parent 7798b51ee9
commit 5c9f68c967
4 changed files with 83 additions and 33 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-18 09:51:21
* @LastEditors : Shiming
* @LastEditTime : 2022-03-31 14:02:38
* @LastEditTime : 2022-04-01 14:41:31
* @FilePath : \\tms-obc-web\\proxy.conf.js
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -28,4 +28,14 @@ module.exports = {
changeOrigin: true,
logLevel: 'debug'
},
'//sascs': {
target: {
host: 'sascs-tj-tms-test.obs.cn-south-1.myhuaweicloud.com',
protocol: 'https:',
port: 443
},
secure: false,
changeOrigin: true,
logLevel: 'debug'
},
};

View File

@ -397,25 +397,25 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
{
text: '生成电子单据',
click: _record => this.generate(_record, 2),
iif: item => item.auditStatus == '1',
iif: item => item.auditStatus == '1' && !item.loadingLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-electronicBillingOne'] },
},
{
text: '通过',
click: _record => this.sign(_record),
iif: item => item.auditStatus == '1',
iif: item => item.auditStatus == '1' && !item.loadingLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-billAuditPassBatch'] },
},
{
text: '修改',
click: _record => this.modification(_record),
iif: item => item.auditStatus == '1',
iif: item => item.auditStatus == '1' && !item.loadingLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-updateBillExamine'] },
},
{
text: '查看凭证',
click: _record => this.generate(_record, 3),
iif: item => item.auditStatus == '2',
iif: item => item.loadingLadingBillFilePath,
acl: { ability: ['ORDER-RECEIPTS-view'] },
},
]
@ -544,23 +544,14 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
nzTitle: `<b>已选择${this.selectedRows.length}条订单,确认批量生成电子单据吗?</b>`,
nzContent: `<b>确认后单据不可修改,请谨慎操作。</b>`,
nzOnOk: () =>
// this.service.request(this.service.$api_get_cancelAnOrder, { ids: params }).subscribe(res => {
// if (res === true) {
// this.service.msgSrv.success('操作成功!');
// this.st?.reload(1);
// this.getGoodsSourceStatistical();
// this.initST();
// }
// this.st?.reload(1);
// this.getGoodsSourceStatistical();
// })
{
this.service.downloadFile(this.service.$api_createBillTakeGoods,params)
this.service.downloadFile(this.service.$api_createBillDischargeGoods,params)}
});
this.service.downloadFile(this.service.$api_createBillDischargeGoods,params)
this.service.msgSrv.success('生成成功!');
this.st?.reload()
// this.getGoodsSourceStatistical();
}
})
}
// 获取所属项目
getRegionCode(regionCode: any) {

View File

@ -4,23 +4,20 @@
* @Author : Shiming
* @Date : 2021-12-15 13:17:42
* @LastEditors : Shiming
* @LastEditTime : 2022-02-21 20:25:47
* @LastEditTime : 2022-04-01 14:27:47
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\audit\\voucher-view\\voucher-view.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<div class="sfBox" [ngClass]="Status !== 1 ? 'hideBtn' : ''">
<sf #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="formData" button="none">
<ng-template sf-template="weight" let-me let-ui="ui" let-schema="schema">
<div style="display: flex">
<nz-input-number [(ngModel)]="data.weight" [nzMin]="1" [nzMax]="10" [nzStep]="1"></nz-input-number>
<div class="left_btn"></div>
<ng-template sf-template="no0" let-me let-ui="ui" let-schema="schema">
<div style="color: #1890FF" >
<!-- <a [href]="loadPDF" (click)="openlaod(me)">电子装货单</a> -->
<div (click)="openlaod(me)">电子装货单</div>
</div>
</ng-template>
<ng-template sf-template="volume" let-me let-ui="ui" let-schema="schema">
<div style="display: flex">
<nz-input-number [(ngModel)]="data.volume" [nzMin]="1" [nzMax]="10" [nzStep]="1"></nz-input-number>
<div class="left_btn"></div>
</div>
<ng-template sf-template="no6" let-me let-ui="ui" let-schema="schema">
<div style="color: #1890FF">电子卸货单</div>
</ng-template>
</sf>
</div>

View File

@ -30,6 +30,7 @@ import { OrderManagementService } from '../../../services/order-management.servi
export class orderManagementVoucherViewComponent implements OnInit {
record: any = {};
i: any;
loadPDF: string = '';
formData: any;
Status: any;
data: any ={
@ -52,6 +53,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
if(this.Status == 1) {
this.schema = {
properties: {
loadingLadingBillFilePath: {
type: 'string',
@ -217,9 +219,15 @@ export class orderManagementVoucherViewComponent implements OnInit {
required: ['loadingLadingBillFilePath', 'loadingPeopleVehiclesGoodsFilePath','unloadingLadingBillFilePath','unloadingPeopleVehiclesGoodsFilePath' ]
};
}else {
console.log('只读')
this.schema = {
properties: {
no0: {
type: 'string',
title: '',
ui: {
widget: 'custom',
},
},
loadingLadingBillFilePath: {
type: 'string',
title: '装货凭证',
@ -298,6 +306,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
listType: 'picture-card',
} as SFUploadWidgetSchema,
},
no4: {
type: 'string',
title: '',
@ -306,6 +315,13 @@ export class orderManagementVoucherViewComponent implements OnInit {
},
default: '单张大小不超过5M支持.jpg、.jpeg和 .png格式',
},
no6: {
type: 'string',
title: '',
ui: {
widget: 'custom',
},
},
unloadingLadingBillFilePath: {
type: 'string',
title: '卸货凭证',
@ -486,5 +502,41 @@ export class orderManagementVoucherViewComponent implements OnInit {
close(): void {
this.modal.destroy(true);
}
openlaod(value: any) {
"https://sascs-tj-tms-test.obs.cn-south-1.myhuaweicloud.com:443/854be85a81d4471ebeb9cda464dcc5eb.pdf"
let url: any = 'https://sascs-tj-tms-test.obs.cn-south-1.myhuaweicloud.com:443/854be85a81d4471ebeb9cda464dcc5eb.pdf';
const xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'blob';
//xhr.setRequestHeader('Authorization', 'Basic a2VybWl0Omtlcm1pdA==');
xhr.onload = () => {
if (xhr.status === 200) {
// 获取文件blob数据并保存
var fileName = this.getFileName(url);
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;
}
}