车辆对接
This commit is contained in:
@ -1,17 +1,12 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-03 11:10:14
|
||||
* @LastEditTime: 2021-12-09 20:54:28
|
||||
* @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\supply-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 { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { SupplyManagementAssignedCarComponent } from '../assigned-car/assigned-car.component';
|
||||
import { SupplyManagementUpdateExternalSnComponent } from '../update-external-sn/update-external-sn.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-supply-management-vehicle-detail',
|
||||
@ -22,59 +17,144 @@ export class SupplyManagementVehicleDetailComponent implements OnInit {
|
||||
|
||||
id = this.route.snapshot.params.id;
|
||||
i: any;
|
||||
dataList: any;
|
||||
logColumns: STColumn[] = [
|
||||
{ title: '内容', index: 'theme' },
|
||||
{ title: '操作人', index: 'operationUserPhone' },
|
||||
{ title: '操作时间', index: ' createTime' },
|
||||
];
|
||||
serviceType: any = {
|
||||
1: '抢单',
|
||||
2: '指派'
|
||||
}
|
||||
status: any = { 1: '待接单', 2: '已接单', 3: '已取消' };
|
||||
totalExpensePrice = 0;
|
||||
expenseColumns: STColumn[] = [
|
||||
{
|
||||
title: '款项',
|
||||
width: '150px',
|
||||
className: 'text-center',
|
||||
index: 'expenseName'
|
||||
},
|
||||
{
|
||||
title: '总费用(元)',
|
||||
width: '150px',
|
||||
className: 'text-center',
|
||||
render: 'total'
|
||||
},
|
||||
{
|
||||
title: '协议金额(元)',
|
||||
width: '150px',
|
||||
className: 'text-center',
|
||||
index: 'price'
|
||||
},
|
||||
];
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private msgSrv: NzMessageService,
|
||||
private service: SupplyManagementService,
|
||||
private router: Router,private ar: ActivatedRoute
|
||||
public modal: NzModalService,
|
||||
public router: Router
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log(this.id)
|
||||
if(this.id) {
|
||||
this.getDetailList(this.id)
|
||||
}
|
||||
this.getGoodsSourceDetail()
|
||||
}
|
||||
|
||||
// 获取录单员
|
||||
getDetailList(id: any) {
|
||||
const params = {
|
||||
id: id
|
||||
};
|
||||
this.service.request(`${this.service.$api_get_getCompleteVehicleDetail}`, params).subscribe((res) => {
|
||||
console.log(res)
|
||||
this.dataList = res
|
||||
getGoodsSourceDetail() {
|
||||
this.service.request(this.service.$api_get_getCompleteVehicleDetail, { id: this.id }).subscribe(res => {
|
||||
const expenseList = res?.expenseList || [];
|
||||
this.totalExpensePrice = 0;
|
||||
expenseList.forEach((e: any) => {
|
||||
this.totalExpensePrice += e?.price * e?.rate;
|
||||
});
|
||||
this.i = { ...res, totalExpensePrice: this.totalExpensePrice };
|
||||
|
||||
})
|
||||
}
|
||||
// 修改货源
|
||||
modification() {
|
||||
this.router.navigate(['/supply-management/vehicle-amend', this.id], {
|
||||
/**
|
||||
* 修改货源
|
||||
*/
|
||||
updateGoodsSource(record: any) {
|
||||
this.router.navigate(['./pbg/onecar-publish'], {
|
||||
queryParams: {
|
||||
sta: 1
|
||||
},
|
||||
id: record?.id,
|
||||
type: 'edit'
|
||||
}
|
||||
})
|
||||
}
|
||||
// 再下一单
|
||||
nextOrder() {
|
||||
this.router.navigate(['/supply-management/vehicle-amend', this.id], {
|
||||
|
||||
/**
|
||||
* 取消货源
|
||||
*/
|
||||
cancleGoodsSource() {
|
||||
this.modal.confirm({
|
||||
nzTitle: '<b>确定取消货源吗?</b>',
|
||||
nzContent: `<b>取消后不可恢复,谨慎操作</b>`,
|
||||
nzOnOk: () =>
|
||||
this.service.msgSrv.success('操作成功!')
|
||||
// this.service.request(this.service.$api_cancle_goods_source, { id: this.i.id }).subscribe((res) => {
|
||||
// if (res === true) {
|
||||
// this.service.msgSrv.success('操作成功!');
|
||||
// this.getGoodsSourceDetail();
|
||||
// }
|
||||
// }),
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
*再下一单
|
||||
* @param record
|
||||
*/
|
||||
placeOrder(record: any) {
|
||||
this.router.navigate(['./pbg/onecar-publish'], {
|
||||
queryParams: {
|
||||
sta: 2
|
||||
},
|
||||
id: record?.id,
|
||||
type: 'add'
|
||||
}
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 编辑外部货源号
|
||||
* @param item st当前行对象
|
||||
*/
|
||||
editEnternalSn(item: any) {
|
||||
const modalRef = this.modal.create({
|
||||
nzWidth: '400px',
|
||||
nzContent: SupplyManagementUpdateExternalSnComponent,
|
||||
nzComponentParams: {
|
||||
orderObject: item,
|
||||
},
|
||||
nzFooter: null,
|
||||
nzClosable: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新指派
|
||||
*/
|
||||
assignedCar(item: any) {
|
||||
const modalRef = this.modal.create({
|
||||
nzTitle: '指派熟车',
|
||||
nzWidth: '1200px',
|
||||
nzContent: SupplyManagementAssignedCarComponent,
|
||||
nzComponentParams: {
|
||||
i: item,
|
||||
},
|
||||
nzFooter: null,
|
||||
|
||||
});
|
||||
modalRef.afterClose.subscribe((result) => {
|
||||
if (result) {
|
||||
this.getGoodsSourceDetail();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user