车辆对接
This commit is contained in:
@ -1,12 +1,4 @@
|
||||
import { preloaderFinished } from '@delon/theme';
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-14 14:03:07
|
||||
* @LastEditTime: 2021-12-20 16:54:21
|
||||
* @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
|
||||
*/
|
||||
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import {
|
||||
SFComponent,
|
||||
@ -27,11 +19,13 @@ import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||
import { Observable, Observer } from 'rxjs';
|
||||
import { WaybillManagementServe } from 'src/app/routes/waybill-management/services/waybill-management.service';
|
||||
import { EAEnvironmentService, EADateUtil } from '@shared';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-order-management-vehicle-sure-depart',
|
||||
templateUrl: './sure-depart.component.html',
|
||||
styleUrls: ['./sure-depart.component.less']
|
||||
styleUrls: ['./sure-depart.component.less'],
|
||||
providers: [DatePipe]
|
||||
})
|
||||
export class VehicleSureDepartComponent implements OnInit {
|
||||
record: any = {};
|
||||
@ -44,24 +38,31 @@ export class VehicleSureDepartComponent 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 envSrv: EAEnvironmentService,) {}
|
||||
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, public service: WaybillManagementServe, private envSrv: EAEnvironmentService,private datePipe: DatePipe) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initSF();
|
||||
console.log(this.i)
|
||||
this.data.weight = this.i?.weight
|
||||
this.i.time = this.i.loadingTime;
|
||||
console.log(this.Status)
|
||||
}
|
||||
initSF() {
|
||||
if(this.Status === 1) {
|
||||
this.schema = {
|
||||
properties: {
|
||||
datetime: {
|
||||
time: {
|
||||
type: 'string',
|
||||
title: '装货时间',
|
||||
format: 'date-time',
|
||||
},
|
||||
no4: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
widget: 'text',
|
||||
},
|
||||
default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式',
|
||||
},
|
||||
imgUrl1: {
|
||||
type: 'string',
|
||||
title: '装货凭证',
|
||||
@ -252,7 +253,7 @@ export class VehicleSureDepartComponent implements OnInit {
|
||||
} as SFUploadWidgetSchema,
|
||||
}
|
||||
},
|
||||
required: ['reason']
|
||||
required: ['time', 'weight']
|
||||
};
|
||||
}
|
||||
|
||||
@ -266,27 +267,51 @@ export class VehicleSureDepartComponent implements OnInit {
|
||||
};
|
||||
}
|
||||
save(value: any): void {
|
||||
|
||||
console.log(value)
|
||||
const params = {
|
||||
id: this.i.id,
|
||||
imgUrl1: value.imgUrl1.data.fullFilePath,
|
||||
imgUrl2: value.imgUrl2.data.fullFilePath,
|
||||
time: value.time,
|
||||
volume: this.data.volume,
|
||||
weight: this.data.weight
|
||||
if(this.Status === 1) {
|
||||
if(!value.time) {
|
||||
this.service.msgSrv.warning('必填项为空!')
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
id: this.i.id,
|
||||
imgUrl1: value.imgUrl1.data.fullFilePath,
|
||||
imgUrl2: value.imgUrl2.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_insertWholeStartCarInfo, params).subscribe((res) => {
|
||||
if(res) {
|
||||
this.service.msgSrv.success('确认发车成功!')
|
||||
this.modal.destroy();
|
||||
} else{
|
||||
this.service.msgSrv.error(res.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if(!value.time || !this.data.weight) {
|
||||
this.service.msgSrv.warning('必填项为空!')
|
||||
return;
|
||||
}
|
||||
console.log(value)
|
||||
const params = {
|
||||
id: this.i.id,
|
||||
imgUrl1: value.imgUrl1.data.fullFilePath,
|
||||
imgUrl2: value.imgUrl2.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 ')
|
||||
this.service.request(this.service.$api_get_insertBulkStartCarInfo, params).subscribe((res) => {
|
||||
if(res) {
|
||||
this.service.msgSrv.success('确认发车成功!')
|
||||
this.modal.destroy();
|
||||
} else{
|
||||
this.service.msgSrv.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(EADateUtil.yearToDateTime(value.time))
|
||||
params.time = EADateUtil.yearToDateTime(value.time)
|
||||
console.log(params)
|
||||
|
||||
// this.service.request(this.service.$api_get_insertBulkStartCarInfo, params).subscribe((res) => {
|
||||
// if(res) {
|
||||
// this.service.msgSrv.success('确认发车成功!')
|
||||
// } else{
|
||||
// this.service.msgSrv.error(res.msg)
|
||||
// }
|
||||
// })
|
||||
|
||||
}
|
||||
|
||||
close(): void {
|
||||
|
||||
Reference in New Issue
Block a user