车辆对接

This commit is contained in:
wangshiming
2021-12-21 10:52:28 +08:00
parent 4aad1e6a47
commit f27a6bddbc
20 changed files with 1021 additions and 477 deletions

View File

@ -1,67 +1,53 @@
<!--
* @Author: your name
* @Date: 2021-12-14 14:03:07
* @LastEditTime: 2021-12-14 15:43:01
* @LastEditors: Please set LastEditors
* @Date: 2021-12-15 13:17:42
* @LastEditTime: 2021-12-20 20:56:54
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\order-management\modal\bulk\update-freight\update-freight.component.html
* @FilePath: \tms-obc-web\src\app\routes\order-management\modal\vehicle\confir-receipt\confir-receipt.component.html
-->
<nz-alert
style="padding-bottom: 15px;"
nzType="warning"
nzCloseable
nzMessage="签收后不可再修改运费,请确保运费等信息准确无误后,再进行签收。"
style="padding-bottom: 15px"
nzType="warning"
nzCloseable
nzMessage="签收后不可再修改运费,请确保运费等信息准确无误后,再进行签收。"
></nz-alert>
<sv-container col="1">
<sv label="货物单价">
<span>
100元/吨
100元/方
100元/车</span>
</sv>
<sv label="结算依据">
<div style="display: flex; justify-content: space-between;">
<div>以发货为准 / 以收货为准</div>
<div>保留小数/抹除小数/抹除个数</div>
</div>
</sv>
</sv-container>
<sv-container col="2">
<sv label="装货重量">
<div>xx吨</div>
</sv>
<sv label="装货体积">
<div>xx吨</div>
</sv>
</sv-container>
<sv-container col="2">
<sv label="卸货重量">
<div>xx吨</div>
</sv>
<sv label="卸货体积">
<div>xx吨</div>
</sv>
</sv-container>
<sv-container col="1">
<sv label="总运费">
<div>1000元 </div>
<sv-container col="1">
<sv label="费用明细">
<st #st [widthMode]="{ type: 'strict' }" [data]="dataInfo" [columns]="columns" bordered="true" [page]="{ show: false }"></st>
</sv>
<sv label="司机车辆">
<div>张三 / 18888888888 / 粤GJ401</div>
</sv>
<sv label="收款人">
<div>李四 / 1888888888</div>
</sv>
<div>{{ i.driverName }} / {{ i.driverTelephone }} / {{ i.carNo }}</div>
</sv>
<sv label="收款人">
<div>{{ i.payeeName }} / {{ i.payeePhone }}</div>
</sv>
<sv label="回单凭证">
<!-- <app-imagelist
[imgList]="[userIdentityDetail?.certificatePhotoFrontWatermark,userIdentityDetail?.certificatePhotoBackWatermark]">
</app-imagelist> -->
<nz-upload
class="avatar-uploader"
[nzAction]="service.$api_upload_url"
[nzName]="'multipartFile'"
nzListType="picture-card"
[(nzFileList)]="listImagUrls"
[nzShowButton]="listImagUrls.length < 5"
[nzPreview]="handlePreview1"
[nzBeforeUpload]="beforeUpload"
(nzChange)="handleChange1($event)"
>
<div>
<i nz-icon nzType="plus"></i>
<div style="margin-top: 8px">请上传图片</div>
</div>
</nz-upload>
<nz-modal [nzVisible]="previewVisible1" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible1 = false">
<ng-template #modalContent>
<img [src]="previewImage1" [ngStyle]="{ width: '100%' }" />
</ng-template>
</nz-modal>
</sv>
</sv-container>
<div class="modal-footer">
<button nz-button type="button" (click)="close()">关闭</button>
<button nz-button type="submit" nzType="primary" (click)="save()" [nzLoading]="http.loading"
>确认签收</button
>
<button nz-button type="submit" nzType="primary" (click)="save()" [nzLoading]="http.loading">确认签收</button>
</div>

View File

@ -1,12 +1,12 @@
import { preloaderFinished } from '@delon/theme';
/*
* @Author: your name
* @Date: 2021-12-14 14:03:07
* @LastEditTime: 2021-12-15 14:08:34
* @Date: 2021-12-15 13:17:42
* @LastEditTime: 2021-12-21 09:34:52
* @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\modal\bulk\update-freight\update-freight.component.ts
* @FilePath: \tms-obc-web\src\app\routes\order-management\modal\vehicle\confir-receipt\confir-receipt.component.ts
*/
import { Component, OnInit, ViewChild } from '@angular/core';
import {
SFComponent,
@ -18,10 +18,21 @@ import {
SFTextareaWidgetSchema,
SFUISchema
} from '@delon/form';
import { NzUploadChangeParam, NzUploadFile } from 'ng-zorro-antd/upload';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { OrderManagementService } from '../../../services/order-management.service';
import { Observable, Observer } from 'rxjs';
import { STColumn } from '@delon/abc/st';
function getBase64(file: File): Promise<string | ArrayBuffer | null> {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
@Component({
selector: 'app-order-management-vehicle-confir-receipt',
templateUrl: './confir-receipt.component.html',
@ -30,24 +41,130 @@ import { NzModalRef } from 'ng-zorro-antd/modal';
export class VehicleConfirReceiptComponent implements OnInit {
record: any = {};
i:any;
Status: any
columns!: STColumn[];
previewVisible1 = false;
dataInfo: any;
detailList: any
data: any = {};
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient) {}
previewImage1 = '';
listImagUrls: any[] = [];
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient,public service: OrderManagementService) {}
ngOnInit(): void {
this.initData()
}
save(): void {
// this.http.post(`/user/${this.record.id}`, value).subscribe(res => {
// this.msgSrv.success('保存成功');
// this.modal.close(true);
// });
this.service.request(this.service.$api_get_signWholeOrder, {id: this.i?.id}).subscribe((res: any) => {
console.log(res)
if(res) {
this.service.msgSrv.success('确认签收成功!')
} else {
this.service.msgSrv.error(res.msg)
}
})
}
handlePreview1 = async (file: NzUploadFile) => {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj!);
}
this.previewImage1 = file.url || file.preview;
this.previewVisible1 = true;
};
close(): void {
this.modal.destroy();
}
userAction() {
beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]) => {
return new Observable((observer: Observer<boolean>) => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif' || file.type === 'image/bmp';
if (!isJpgOrPng) {
this.service.msgSrv.warning('只能上传图片!');
observer.complete();
return;
}
// tslint:disable-next-line: no-non-null-assertion
const isLt2M = file.size! / 1024 / 1024 < 3;
if (!isLt2M) {
this.service.msgSrv.warning('图片大小超过3兆!');
observer.complete();
return;
}
observer.next(isJpgOrPng && isLt2M);
observer.complete();
});
};
initData() {
// this.dataInfo = [
// {
// prePay: this.i?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'PRE')[0]?.price || 0,
// toPay: this.i?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'RECE')[0]?.price || 0,
// receiptPay: this.i?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'OIL')[0]?.price || 0,
// traiPrice: this.i?.mybidDetailInfo?.filter((data: any) => data.expenseName === '运输费')[0]?.price || 0
// }
// ];
// if (this.i?.receiptCertificate?.length > 0) {
// this.i?.receiptCertificate.forEach((element: any) => {
// const image = {
// url: element,
// status: 'done',
// uid: '-1'
// };
// this.listImagUrls.push(image);
// });
// }
// 大宗
this.service.request(this.service.$api_get_getWholeSignForDetail, {id: this.i?.id}).subscribe((res: any) => {
console.log(res)
this.dataInfo = res;
})
}
initST() {
this.columns = [
{
title: '预付',
index: 'prePay'
},
{
title: '到付',
index: 'toPay'
},
// {
// title: '油卡',
// index: 'name3'
// },
{
title: '回单付',
index: 'receiptPay'
},
{
title: '总运费',
index: 'traiPrice'
}
];
}
handleChange1(info: NzUploadChangeParam): void {
switch (info.file.status) {
case 'uploading':
break;
case 'done':
const resData = info.file.response.data;
const arr = [
{
url: resData.fullFilePath,
status: 'done',
uid: '-1'
}
];
this.listImagUrls = arr;
break;
case 'error':
this.service.msgSrv.error('网络错误');
break;
}
}
}