From d1fa642b83444b6f97b9e5a28480dbb97bdabec1 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 3 Mar 2022 14:13:13 +0800 Subject: [PATCH] fix bug --- .../onecar-publish.component.ts | 8 ++-- .../release-publish.component.ts | 7 ++- .../tran-agreement.component.ts | 47 ++++++++++++------- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts index 9af7b78f..1d6b1d28 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts @@ -58,10 +58,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { totalTime = 0.0; //路程总时间 currentRate = 0; //实时计算的费率 id = this.route.snapshot.params.id; - // // 单位 startInfo: any = []; // 发货地数据 endInfo: any = []; // 卸货地数据 PageStatus = ''; + shipperName = ''; changeSub = new Subject(); envCache: any; enterpriseProjectIds: any; @@ -163,10 +163,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { return of([]); } }, - change: (q: any) => { + change: (q: any, qs: any) => { let str = q.replace(/^\s+|\s+$/g, ''); if (str) { this.getRegionCode(str); + this.shipperName = qs?.label; this.payChange(); } } @@ -1003,7 +1004,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { nzContent: TranAgreementComponent, nzWidth: 900, nzFooter: null, - nzComponentParams: { Object: params } + nzComponentParams: { object: params, shipperName: this.shipperName } }); modalRef.afterClose.subscribe(result => { if (result) { @@ -1102,6 +1103,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { // 初始化赋值信息函数 dataR(res: any) { if (res?.shipperAppUserName) { + this.shipperName = res?.shipperAppUserName; const List: any = []; this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => { rs?.forEach((element: any) => { diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts index 41616ab9..ba50f7e1 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts @@ -51,6 +51,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { totalDistance = 0.0; //总里程 totalTime = 0.0; //路程总时间 currentRate = 0; //实时计算的费率 + shipperAppName = ''; constructor( private http: _HttpClient, fb: FormBuilder, @@ -156,10 +157,12 @@ export class SupplyManagementReleasePublishComponent implements OnInit { return of([]); } }, - change: (q: any) => { + change: (q: any, qq: any) => { let str = q.replace(/^\s+|\s+$/g, ''); if (str) { + console.log(qq) this.getRegionCode(str); + this.shipperAppName = qq; this.payChange(); } } @@ -977,7 +980,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { nzContent: TranAgreementComponent, nzWidth: 900, nzFooter: null, - nzComponentParams: { Object: params } + nzComponentParams: { object: params } }); modalRef.afterClose.subscribe(result => { if (result) { diff --git a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts index 05977ab4..c2e2fb8f 100644 --- a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts +++ b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-02-24 20:19:51 * @LastEditors : Shiming - * @LastEditTime : 2022-02-28 20:55:59 + * @LastEditTime : 2022-03-03 14:08:28 * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\tran-agreement\\tran-agreement.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -28,33 +28,48 @@ import { SupplyManagementService } from '../../services/supply-management.servic styleUrls: ['./tran-agreement.component.less'] }) export class TranAgreementComponent { - Object: any; + object: any; agreement:any; + envCache:any; + shipperName:any; constructor(private modal: NzModalRef,public service: SupplyManagementService,) { } ngOnInit() { - console.log(Object) + console.log(this.object) const params = { contractType:'1', - parametersDTO: { - // 回单付 - back: 'dsfgffdsg', - // 发货地址 - consignorAddress: 'gfdgdfdg', - // 发货时间 - consignorDate: 'dsggdsgsfgds', - // 发货时间 - // consignorDate: '', - - }, resourceType: '1', signingObject: '1', templateType: 'MX', - } + parametersDTO: { + contractCode:'', + shipperName:this?.shipperName, //托运人 + carrierName:this.object?.enterpriseInfoName, //承运人 + consignorInfo: `${this.object?.unLoadingPlaceDTOList[0].appUserName} ${this.object?.unLoadingPlaceDTOList[0].contractTelephone}`, // 发货信息 + consignorAddress: this.object?.unLoadingPlaceDTOList[0].detailedAddress, // 发货地址 + consignorDate: this.object?.loadingTime, // 发货时间 + consigneeInfo: `${this.object?.unLoadingPlaceDTOList[this.object?.unLoadingPlaceDTOList.length-1].appUserName} ${this.object?.unLoadingPlaceDTOList[this.object?.unLoadingPlaceDTOList.length-1].contractTelephone}`, // 收货信息 + consigneeDate: this.object?.unloadingTime, // 收货时间 + consigneeAddress: this.object?.unLoadingPlaceDTOList[this.object?.unLoadingPlaceDTOList.length-1].detailedAddress, // 收货地址 + goodsName:this.object?.goodsInfoDTOList[0].goodsName, // 货物名称 + shippingType:'整车运输', + consignmentVolume:`${this.object?.goodsInfoDTOList[0].weight}吨/${this.object?.goodsInfoDTOList[0].volume}方/${this.object?.goodsInfoDTOList[0].number}件`, //托运量 + transporterInfo:'', //运输方信息 + freightAmount:this.object?.total, // 订单运费金额(元) + pre:this.object?.expenseDTOList.filter((item:any) => item.expenseCode === 'PRE')[0].price, //预付 + rece:this.object?.expenseDTOList.filter((item:any) => item.expenseCode === 'RECE')[0].price,// 到付 + back:this.object?.expenseDTOList.filter((item:any) => item.expenseCode === 'BACK')[0].price,// 回单付 + lunarKnot:0, + total:this.object?.subtotal, // 合计(元) + paymentTime:`到货后${this.object?.paymentDays}天`, // 承诺支付运费时间 + year:new Date().getFullYear(), // 签约年份 + month:new Date().getMonth()+1, // 签约月份 + day:new Date().getDate(), // 签约日期 + } + } console.log(params) - this.service.request(this.service.$api_getContractContent,params).subscribe((res) => { if (res) {