87 lines
3.6 KiB
TypeScript
87 lines
3.6 KiB
TypeScript
/*
|
|
* @Description :
|
|
* @Version : 1.0
|
|
* @Author : Shiming
|
|
* @Date : 2022-02-24 20:19:51
|
|
* @LastEditors : Shiming
|
|
* @LastEditTime : 2022-03-03 14:24:51
|
|
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\tran-agreement\\tran-agreement.component.ts
|
|
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
|
*/
|
|
/*
|
|
* @Description :
|
|
* @Version : 1.0
|
|
* @Author : Shiming
|
|
* @Date : 2022-01-06 15:01:40
|
|
* @LastEditors : Shiming
|
|
* @LastEditTime : 2022-02-28 20:55:07
|
|
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\tran-agreement\\tran-agreement.component.ts
|
|
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
|
*/
|
|
import { Component } from '@angular/core';
|
|
import { NzModalRef } from 'ng-zorro-antd/modal';
|
|
import { SupplyManagementService } from '../../services/supply-management.service';
|
|
|
|
@Component({
|
|
selector: 'publish-goods-tran-agreement',
|
|
templateUrl: './tran-agreement.component.html',
|
|
styleUrls: ['./tran-agreement.component.less']
|
|
})
|
|
export class TranAgreementComponent {
|
|
object: any;
|
|
agreement:any;
|
|
envCache:any;
|
|
shipperName:any;
|
|
constructor(private modal: NzModalRef,public service: SupplyManagementService,) {
|
|
|
|
}
|
|
|
|
ngOnInit() {
|
|
console.log(this.object)
|
|
const params = {
|
|
contractType:'1',
|
|
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) {
|
|
|
|
this.agreement = res.contractContent;
|
|
}
|
|
});
|
|
}
|
|
|
|
handleOk(){
|
|
this.modal.close(true);
|
|
}
|
|
|
|
|
|
}
|