Files
bbq/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts
wangshiming 1c5ca651ea 车辆对接
2021-12-28 16:33:45 +08:00

119 lines
3.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ViewChild } from '@angular/core';
/*
* @Author: your name
* @Date: 2021-12-03 15:31:52
* @LastEditTime: 2021-12-28 16:22:50
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\order-management\components\vehicle-detail\vehicle-detail.component.ts
*/
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STColumn } from '@delon/abc/st';
import { _HttpClient } from '@delon/theme';
import { NzCardComponent } from 'ng-zorro-antd/card';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { OrderManagementService } from '../../services/order-management.service';
@Component({
selector: 'app-supply-management-vehicle-detail',
templateUrl: './vehicle-detail.component.html',
styleUrls: ['./vehicle-detail.component.less']
})
export class OrderManagementVehicleDetailComponent implements OnInit {
id = this.route.snapshot.params.id;
i: any = {
unLoadingPlaceList: [],
billExpenseDetails: [],
goodsInfoList: [],
goodsResource: []
};
imges: any;
attObj: any;
totalObj: any;
approvalLsit: any;
isVisible = false;
logColumns: STColumn[] = [
{ title: '款项', index: 'costName' },
{ title: '总费用(元)', index: 'price' },
{ title: '协议金额(元)', index: 'price' },
{ title: '附加费(元)', index: 'surcharge' },
{ title: '附加费率(%', index: 'paymentMethodRate' },
{ title: '支付时间', index: ' paymentTime' },
{
title: '支付状态',
className: 'text-center',
index: 'paymentStatus',
type: 'badge',
width: '120px',
badge: {
'1': { text: '待申请', color: 'warning' },
'2': { text: '已支付', color: 'success' },
'3': { text: '已拒绝', color: 'warning' },
'4': { text: '申请中', color: 'warning' }
}
}
];
constructor(
private route: ActivatedRoute,
private msgSrv: NzMessageService,
private service: OrderManagementService,
private modalService: NzModalService,
private router: Router
) {}
ngOnInit(): void {
console.log(this.id);
this.initData();
}
initData() {
this.service.request(this.service.$api_get_getWholeBillDetail, { id: this.id }).subscribe(res => {
console.log(res);
if (res) {
this.i = res;
this.approvalLsit = res.scheduleVOList;
this.attObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'ATT')[0];
this.totalObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TOTAL')[0];
this.approvalLsit.map((item: any, key: any) => {
console.log(item);
if (item.displayStatus === 'HIDE') {
delete this.approvalLsit[key];
}
});
console.log(this.approvalLsit);
}
});
}
goBack() {
window.history.go(-1);
}
// 修改订单
changeOrder() {
console.log(this.id);
this.router.navigate(['order-management/vehicle-detailChange', this.id]);
}
agreement(value: any) {
if (value === '1') {
this.imges = this.i?.agreementFilePath;
} else if (value === '2') {
this.imges = this.i?.agreementFilePath;
}
this.isVisible = true;
}
handleCancel() {
this.isVisible = false;
}
handleOK() {
this.isVisible = false;
}
goDistance(elf: NzCardComponent) {
if (elf) {
elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' , yOffset : 400 });
}
}
}