fix bug
This commit is contained in:
		| @ -10,6 +10,7 @@ import { VehicleImgViewComponent } from '../img-view/img-view.component'; | ||||
| import { apiConf } from '@conf/api.conf'; | ||||
| import { NzModalService } from 'ng-zorro-antd/modal'; | ||||
| import { ImageViewComponent } from 'src/app/shared/components/imagelist'; | ||||
| import { EADateUtil } from '@shared'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'app-supplier-components-list-view', | ||||
| @ -48,7 +49,7 @@ export class VehicleComponentsListDetailComponent implements OnInit { | ||||
|     private route: ActivatedRoute, | ||||
|     private modalHelper: ModalHelper, | ||||
|     private msgSrv: NzMessageService, | ||||
|     private nzModalService: NzModalService | ||||
|     private nzModalService: NzModalService, | ||||
|   ) {} | ||||
|  | ||||
|   ngOnInit() { | ||||
| @ -57,6 +58,7 @@ export class VehicleComponentsListDetailComponent implements OnInit { | ||||
|     this.initSF(); | ||||
|     this.initSF1(); | ||||
|     this.initST(); | ||||
|  | ||||
|   } | ||||
|     /** | ||||
|    * 查询参数 | ||||
| @ -248,8 +250,23 @@ export class VehicleComponentsListDetailComponent implements OnInit { | ||||
|  | ||||
|   save() { | ||||
|     this.isEdit = false; | ||||
|     console.log(this.detailData) | ||||
|       this.detailData.driverLicenseRegisterTime = EADateUtil.yearToDate(this.detailData?.driverLicenseRegisterTime) | ||||
|  | ||||
|       this.detailData.driverLicenseEndTime = EADateUtil.yearToDate(this.detailData?.driverLicenseEndTime) | ||||
|  | ||||
|       this.detailData.driverLicenseGetTime = EADateUtil.yearToDate(this.detailData?.driverLicenseGetTime) | ||||
|  | ||||
|       this.detailData.roadTransportStartTime = EADateUtil.yearToDate(this.detailData?.roadTransportStartTime) | ||||
|  | ||||
|       this.detailData.roadTransportEndTime = EADateUtil.yearToDate(this.detailData?.roadTransportEndTime) | ||||
|     // EADateUtil.timestampToDate('') | ||||
|     console.log(this.detailData) | ||||
|   } | ||||
|   // if(typeof(this.validateForm1.value.unloadingTime) !== 'string' ) { | ||||
|   //   var c = new Date(this.validateForm1.value.unloadingTime);   | ||||
|   //   this.validateForm1.value.unloadingTime = c.getFullYear() + '-' + this.addPreZero(c.getMonth() + 1) + '-' + this.addPreZero(c.getDate()) + ' ' + this.addPreZero(c.getHours()) + ':' + this.addPreZero(c.getMinutes()) + ':' + this.addPreZero(c.getSeconds()) | ||||
|   // } | ||||
|   private initData() { | ||||
|     return { | ||||
|       carNo: '', | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| /* | ||||
|  * @Author: your name | ||||
|  * @Date: 2021-11-29 15:22:34 | ||||
|  * @LastEditTime: 2021-12-15 16:58:21 | ||||
|  * @LastEditTime: 2021-12-15 20:26:59 | ||||
|  * @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\usercenter\services\usercenter.service.ts | ||||
| @ -23,7 +23,7 @@ export class VehicleService extends BaseService { | ||||
|   // 获取车辆认证表 | ||||
|   $api_get_operate_get = `/api/mdc/cuc/carLicense/operate/get`; | ||||
|   // 获取车辆认证司机列表 | ||||
|   $api_get_queryDriverByCarId = `/api/mdc/cuc/userCarLicense/operate/queryDriverByCarId`; | ||||
|   $api_get_queryDriverByCarId = `/api/mdc/cuc/carLicenseAudit/operate/queryDriverByCarId`; | ||||
|   // 详情需要的下拉框数据 | ||||
|   $api_get_getDictValue = `/api/mdc/pbc/dictItems/getDictValue`; | ||||
|  | ||||
|  | ||||
| @ -1,3 +1,11 @@ | ||||
| /* | ||||
|  * @Author: your name | ||||
|  * @Date: 2021-11-29 10:04:12 | ||||
|  * @LastEditTime: 2021-12-15 20:50:49 | ||||
|  * @LastEditors: Please set LastEditors | ||||
|  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||||
|  * @FilePath: \tms-obc-web\src\app\shared\utils\date.util.ts | ||||
|  */ | ||||
| export class EADateUtil { | ||||
|   /** | ||||
|    * @description 时间戳转换日期 | ||||
| @ -53,4 +61,41 @@ export class EADateUtil { | ||||
|   static dateDiff(start: Date, end: Date): number { | ||||
|     return start.getTime() - end.getTime(); | ||||
|   } | ||||
|   /** | ||||
|    * @description 国际时间转换成YYYY-MM-DD 00:00:00 | ||||
|    * @param start 开始日期 | ||||
|    * @returns YYYY-MM-DD 00:00:00 | ||||
|    */ | ||||
|   static yearToDateTime(start: Date): number { | ||||
|     let Dates : any=''; | ||||
|     if(typeof(start) !== 'string') { | ||||
|         var c = new Date(start);   | ||||
|         Dates = c.getFullYear() + '-' + this.addPreZero(c.getMonth() + 1) + '-' + this.addPreZero(c.getDate()) + ' ' + this.addPreZero(c.getHours()) + ':' + this.addPreZero(c.getMinutes()) + ':' + this.addPreZero(c.getSeconds()) | ||||
|       } else { | ||||
|        return start; | ||||
|       } | ||||
|     return Dates; | ||||
|   } | ||||
|    /** | ||||
|    * @description 国际时间转换YYYY-MM-DD | ||||
|    * @param start 开始日期 | ||||
|    * @returns YYYY-MM-DD | ||||
|    */ | ||||
|   static yearToDate(start: Date): number { | ||||
|     let Dates : any=''; | ||||
|     if(typeof(start) !== 'string' ) { | ||||
|         var c = new Date(start);   | ||||
|         Dates = c.getFullYear() + '-' + this.addPreZero(c.getMonth() + 1) + '-' + this.addPreZero(c.getDate()); | ||||
|       } else { | ||||
|         return start; | ||||
|       } | ||||
|     return Dates; | ||||
|   } | ||||
|   static addPreZero(num: any) { | ||||
|     if(num<10){ | ||||
|       return '0'+num; | ||||
|      } else { | ||||
|       return num; | ||||
|      } | ||||
|   } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user