diff --git a/proxy.conf.js b/proxy.conf.js index a4074f73..69fce180 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -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' + }, }; diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts index fad07423..1a208dab 100644 --- a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts @@ -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: `已选择${this.selectedRows.length}条订单,确认批量生成电子单据吗?`, nzContent: `确认后单据不可修改,请谨慎操作。`, 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.service.downloadFile(this.service.$api_createBillTakeGoods,params) + this.service.downloadFile(this.service.$api_createBillDischargeGoods,params) + this.service.msgSrv.success('生成成功!'); + this.st?.reload() // this.getGoodsSourceStatistical(); - // }) - { - this.service.downloadFile(this.service.$api_createBillTakeGoods,params) - - - this.service.downloadFile(this.service.$api_createBillDischargeGoods,params)} - - }); + } + }) } // 获取所属项目 getRegionCode(regionCode: any) { diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html index 95f1d062..80895431 100644 --- a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html @@ -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. -->
- -
- -
+ +
+ +
电子装货单
- -
- -
-
+ +
电子卸货单
diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts index 54b91f69..b3262631 100644 --- a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts @@ -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; + } }