车辆接口更新

This commit is contained in:
wangshiming
2022-01-21 17:15:10 +08:00
parent ec41f11e47
commit 30587959b9
13 changed files with 752 additions and 64 deletions

View File

@ -17,9 +17,9 @@ import { apiConf } from '@conf/api.conf';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { WaybillManagementServe } from 'src/app/routes/waybill-management/services/waybill-management.service';
import { Observable, Observer } from 'rxjs';
import { EAEnvironmentService } from '@shared';
import { OrderManagementService } from '../../../services/order-management.service';
@Component({
selector: 'app-order-management-voucher-view',
@ -39,10 +39,10 @@ export class orderManagementVoucherViewComponent implements OnInit {
@ViewChild('sf', { static: false }) sf!: SFComponent;
schema: SFSchema = {};
ui: SFUISchema = {};
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, public service: WaybillManagementServe,private datePipe: DatePipe,private envSrv: EAEnvironmentService, ) {}
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, public service: OrderManagementService,private datePipe: DatePipe,private envSrv: EAEnvironmentService, ) {}
ngOnInit(): void {
console.log(this.i)
// console.log(this.i)
this.initData()
this.i.time = this.i.loadingTime;
this.initSF();
@ -52,7 +52,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
this.schema = {
properties: {
imgUrl3: {
loadingLadingBillFilePath: {
type: 'string',
title: '装货凭证',
ui: {
@ -90,7 +90,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
listType: 'picture-card',
} as SFUploadWidgetSchema,
},
imgUrl4: {
loadingPeopleVehiclesGoodsFilePath: {
type: 'string',
title: '',
ui: {
@ -136,7 +136,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
},
default: '单张大小不超过5M支持.jpg、.jpeg和 .png格式',
},
imgUrl1: {
unloadingLadingBillFilePath: {
type: 'string',
title: '卸货凭证',
ui: {
@ -174,7 +174,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
listType: 'picture-card',
} as SFUploadWidgetSchema,
},
imgUrl2: {
unloadingPeopleVehiclesGoodsFilePath: {
type: 'string',
title: '',
ui: {
@ -218,7 +218,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
}else {
this.schema = {
properties: {
imgUrl3: {
loadingLadingBillFilePath: {
type: 'string',
title: '装货凭证',
readOnly: true,
@ -257,7 +257,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
listType: 'picture-card',
} as SFUploadWidgetSchema,
},
imgUrl4: {
loadingPeopleVehiclesGoodsFilePath: {
type: 'string',
title: '',
readOnly: true,
@ -304,7 +304,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
},
default: '单张大小不超过5M支持.jpg、.jpeg和 .png格式',
},
imgUrl1: {
unloadingLadingBillFilePath: {
type: 'string',
title: '卸货凭证',
readOnly: true,
@ -343,7 +343,7 @@ export class orderManagementVoucherViewComponent implements OnInit {
listType: 'picture-card',
} as SFUploadWidgetSchema,
},
imgUrl2: {
unloadingPeopleVehiclesGoodsFilePath: {
type: 'string',
title: '',
readOnly: true,
@ -391,10 +391,10 @@ export class orderManagementVoucherViewComponent implements OnInit {
spanLabelFixed: 100,
grid: { span: 20 }
},
$imgUrl1: { grid: { span: 12} },
$imgUrl2: { grid: { span: 12} },
$imgUrl3: { grid: { span: 12} },
$imgUrl4: { grid: { span: 12} },
$unloadingLadingBillFilePath: { grid: { span: 12} },
$unloadingPeopleVehiclesGoodsFilePath: { grid: { span: 12} },
$loadingLadingBillFilePath: { grid: { span: 12} },
$loadingPeopleVehiclesGoodsFilePath: { grid: { span: 12} },
};
}
save(value: any): void {
@ -405,17 +405,17 @@ export class orderManagementVoucherViewComponent implements OnInit {
}
const params = {
id: this.i.id,
imgUrl1: value.imgUrl1.data.fullFilePath,
imgUrl2: value.imgUrl2.data.fullFilePath,
unloadingLadingBillFilePath: value.unloadingLadingBillFilePath.data.fullFilePath,
unloadingPeopleVehiclesGoodsFilePath: value.unloadingPeopleVehiclesGoodsFilePath.data.fullFilePath,
time: value.time,
}
params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss ')
this.service.request(this.service.$api_get_insertWholeUnloadCarInfo, params).subscribe((res) => {
if(res) {
this.service.msgSrv.success('确认到车成功!')
this.modal.destroy(true);
}
})
// params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss ')
// this.service.request(this.service.$api_get_insertWholeUnloadCarInfo, params).subscribe((res) => {
// if(res) {
// this.service.msgSrv.success('确认到车成功!')
// this.modal.destroy(true);
// }
// })
} else {
if(!value.time || !this.data.weight) {
this.service.msgSrv.warning('必填项为空!')
@ -425,48 +425,70 @@ export class orderManagementVoucherViewComponent implements OnInit {
console.log(this.i)
const params = {
id: this.i?.id,
imgUrl1: value.imgUrl1.data.fullFilePath,
imgUrl2: value.imgUrl2.data.fullFilePath,
unloadingLadingBillFilePath: value.unloadingLadingBillFilePath.data.fullFilePath,
unloadingPeopleVehiclesGoodsFilePath: value.unloadingPeopleVehiclesGoodsFilePath.data.fullFilePath,
time: value.time,
volume: this.data.volume,
weight: this.data.weight
}
params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss ')
console.log(params)
this.service.request(this.service.$api_get_insertBulkUnloadCarInfo, params).subscribe((res) => {
if(res) {
this.service.msgSrv.success('确认到车成功!')
this.modal.destroy(true);
}
})
// params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss ')
// console.log(params)
// this.service.request(this.service.$api_get_insertBulkUnloadCarInfo, params).subscribe((res) => {
// if(res) {
// this.service.msgSrv.success('确认到车成功!')
// this.modal.destroy(true);
// }
// })
}
}
// 确认到车界面信息(两个只能看的图片)
initData() {
this.service.request(this.service.$api_get_getUnloadCarInfo, { id : this.i?.id}).subscribe((res) => {
this.service.request(this.service.$api_get_getCredentials, { id : this.i?.id}).subscribe((res) => {
console.log(res)
if (res.imgUrl1) {
this.formData = {
imgUrl3: [
if (res.unloadingLadingBillFilePath) {
this.formData = {
loadingLadingBillFilePath: [
{
uid: 'logo',
name: 'LOGO',
status: 'done',
url: res.imgUrl1,
url: res.loadingLadingBillFilePath,
response: {
url: res.imgUrl1,
url: res.loadingLadingBillFilePath,
},
},
],
imgUrl4: [
loadingPeopleVehiclesGoodsFilePath: [
{
uid: 'logo',
name: 'LOGO',
status: 'done',
url: res.loadingPeopleVehiclesGoodsFilePath,
response: {
url: res.loadingPeopleVehiclesGoodsFilePath,
},
},
],
unloadingLadingBillFilePath: [
{
uid: 'logo',
name: 'LOGO',
status: 'done',
url: res.unloadingLadingBillFilePath,
response: {
url: res.unloadingLadingBillFilePath,
},
},
],
unloadingPeopleVehiclesGoodsFilePath: [
{
uid: 'logo',
name: 'LOGO',
status: 'done',
url: res.imgUrl2,
url: res.unloadingPeopleVehiclesGoodsFilePath,
response: {
url: res.imgUrl2,
url: res.unloadingPeopleVehiclesGoodsFilePath,
},
},
],