From 3ba6d074cb74a5b1a229b1dfc25e448c0334c99c Mon Sep 17 00:00:00 2001 From: wangshiming Date: Wed, 15 Dec 2021 20:24:24 +0800 Subject: [PATCH] fix bug --- .../bulk-publish/bulk-publish.component.ts | 4 +- .../onecar-publish.component.html | 4 +- .../onecar-publish.component.ts | 26 ++-- .../list/detail/detail.component.html | 101 +++++++++---- .../list/detail/detail.component.less | 133 ++++++++++++++---- .../list/detail/detail.component.ts | 39 ++++- .../list/img-view/img-view.component.html | 23 ++- .../list/img-view/img-view.component.ts | 4 +- .../components/list/list.component.html | 12 +- .../vehicle/components/list/list.component.ts | 65 +++++---- .../vehicle/services/vehicle.service.ts | 4 +- 11 files changed, 294 insertions(+), 121 deletions(-) diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts index 82c211f8..6d7d88e9 100644 --- a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts @@ -591,7 +591,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { this.sf1data.id = res?.id; } res?.unLoadingPlaceVOList.forEach((element: any) => { - if(element.type === 1) { + if(element.type === 1 || element.type === '1') { const controlId = this.startInfo.length; if(this.PageStatus === '大宗修改') { this.startInfo.push({ @@ -626,7 +626,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); - } else if(element.type === 2) { + } else if(element.type === 2 || element.type === '2') { const controlId = this.endInfo.length; if( this.PageStatus === '大宗修改') { this.endInfo.push({ diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html index b11b0eec..44c8bd24 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html @@ -35,7 +35,7 @@ > X @@ -77,7 +77,7 @@ X diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts index 3ed4b0de..4c3b0b71 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts @@ -694,25 +694,25 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { nzWidth: 900, nzOnOk: item => { const poi = item.poi; - const locList = poi.location.toString().split(','); + const locList = poi.pois; switch (type) { case 'start': - this.startInfo[index].detailedAddress = poi.district + poi.name; + this.startInfo[index].detailedAddress = poi.formattedAddress; this.startInfo[index].longitude = locList[0]; this.startInfo[index].latitude = locList[1]; - this.startInfo[index].province = poi.cityInfo.province; - this.startInfo[index].city = poi.cityInfo.city; - this.startInfo[index].area = poi.cityInfo.district; - this.startInfo[index].address = poi.name; + this.startInfo[index].province = poi.addressComponent.province; + this.startInfo[index].city = poi.addressComponent.city; + this.startInfo[index].area = poi.addressComponent.district; + this.startInfo[index].address = poi.formattedAddress; break; case 'end': - this.endInfo[index].detailedAddress = poi.district + poi.name; + this.endInfo[index].detailedAddress = poi.formattedAddress; this.endInfo[index].longitude = locList[0]; this.endInfo[index].latitude = locList[1]; - this.endInfo[index].province = poi.cityInfo.province; - this.endInfo[index].city = poi.cityInfo.city; - this.endInfo[index].area = poi.cityInfo.district; - this.endInfo[index].address = poi.name; + this.endInfo[index].province = poi.addressComponent.province; + this.endInfo[index].city = poi.addressComponent.city; + this.endInfo[index].area = poi.addressComponent.district; + this.endInfo[index].address = poi.formattedAddress; break; default: break; @@ -753,7 +753,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.sf1data.id = res?.id; } res?.unLoadingPlaceVOList.forEach((element: any) => { - if(element.type === 1) { + if(element.type === 1 || element.type === '1') { const controlId = this.startInfo.length; if(this.PageStatus === '整车修改') { this.startInfo.push({ @@ -785,7 +785,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); - } else if(element.type === 2) { + } else if(element.type === 2 || element.type === '2') { const controlId = this.endInfo.length; if(this.PageStatus === '整车修改') { this.endInfo.push({ diff --git a/src/app/routes/vehicle/components/list/detail/detail.component.html b/src/app/routes/vehicle/components/list/detail/detail.component.html index 0dc368fc..b8fef1b0 100644 --- a/src/app/routes/vehicle/components/list/detail/detail.component.html +++ b/src/app/routes/vehicle/components/list/detail/detail.component.html @@ -28,16 +28,47 @@ [placeholder]="isEdit?'':'-'"> - + + + + - + + + + - - + + + + + + + + + + + + *ngTemplateOutlet="uploadTemplate;context:{image:detailData?.carFrontPhoto,key:'carFrontPhoto'}"> @@ -65,19 +96,31 @@ [placeholder]="isEdit?'':'-'"> - + + + + - + + - + + - + + - - + + @@ -118,14 +163,10 @@ - - - + *ngTemplateOutlet="uploadTemplate;context:{image:detailData?.certificatePhotoFront,key:'certificatePhotoFront'}"> @@ -141,17 +182,21 @@ [placeholder]="isEdit?'':'-'"> - + + - + + + *ngTemplateOutlet="uploadTemplate;context:{image:detailData?.roadTransportPhoto,key:'roadTransportPhoto'}"> diff --git a/src/app/routes/vehicle/components/list/detail/detail.component.less b/src/app/routes/vehicle/components/list/detail/detail.component.less index c77bde67..a472c0b0 100644 --- a/src/app/routes/vehicle/components/list/detail/detail.component.less +++ b/src/app/routes/vehicle/components/list/detail/detail.component.less @@ -1,40 +1,115 @@ -@import '~@delon/theme/index'; :host { ::ng-deep { - .ant-steps-dot { - .ant-steps-item-content { - width: 200px; - } - .ant-steps-item-icon { - margin-left: 96px; - } - .ant-steps-item-tail::after { - margin-left: 40px; - } - } - .success { - color: @success-color; + + .sv__label, + .sv__detail { + line-height: 30px; } - .warning { - color: @warning-color; + .edit-box { + input { + max-width: 250px; + } + + nz-date-picker { + min-width: 250px; + } } - .error { - color: @error-color; + .readOnly-box { + input { + padding-left: 0; + color : #000; + } + + nz-select-top-control { + padding-left: 0 !important; + } } - } - .mt16 { - margin-top: 16px; - } - .user-info { - display: flex; - font-size: 16px; - .enterprise-name { - margin-right: 15px; + + .ant-select { + min-width: 250px; + + nz-select-top-control { + color : #000 !important; + cursor: text !important; + } } - .user-info-des { - margin-bottom: 5px; + + // 图片展示工具样式改造 + .ant-upload.ant-upload-disabled { + cursor: pointer; + } + + .ant-upload.ant-upload-select-picture-card { + width : 200px; + height: 160px; + } + + .ant-upload-picture-card-wrapper { + width: auto; } } } + +.image-hover { + .delete-icon { + position : absolute; + top : -15px; + right : -15px; + color : #F55656; + font-size : 28px; + background-color: #fff; + border-radius : 50%; + cursor : pointer; + } + + .show-icon { + color : #fff; + font-size: 30px; + cursor : pointer; + } +} + +.image-hover:hover .mask { + opacity: 0.8; +} + +.mask { + position : absolute; + width : 200px; + height : 160px; + margin-top : -160px; + background-color : #4F4F4F; + // top : 6px; + // left : 12px; + border-radius : 6px; + opacity : 0; +} + +.mask-over { + position : absolute; + display : flex; + align-items : center; + justify-content : center; + width : 200px; + height : 160px; + margin-top : -160px; + // top : 6px; + // left : 12px; + border-radius : 6px; + + label { + color : #FFF; + font-size : 20px; + line-height : 24px; + letter-spacing: 0.7px; + } + +} +input { + width: 200px; +} +.sv__container { + padding-top: 10px; +} \ No newline at end of file diff --git a/src/app/routes/vehicle/components/list/detail/detail.component.ts b/src/app/routes/vehicle/components/list/detail/detail.component.ts index 53b6701d..60e58ad7 100644 --- a/src/app/routes/vehicle/components/list/detail/detail.component.ts +++ b/src/app/routes/vehicle/components/list/detail/detail.component.ts @@ -27,7 +27,7 @@ export class VehicleComponentsListDetailComponent implements OnInit { modalName = ''; ui!: SFUISchema; columns!: STColumn[]; - uploadURl = apiConf.waterFileUpload; + uploadURl = apiConf.fileUpload; schema!: SFSchema; @ViewChild('sf', { static: false }) sf!: SFComponent; schema1!: SFSchema; @@ -35,8 +35,11 @@ export class VehicleComponentsListDetailComponent implements OnInit { validData: any = ['suppliersType']; suppliersData: any = {}; disabledUpload = false; - detailData: any = this.getDetailList(); + detailData: any = this.initData(); tempalateData :any; + contenCarNoColor: any; + contencarModel: any; + contenCarLength: any; constructor( private http: _HttpClient, @@ -49,6 +52,7 @@ export class VehicleComponentsListDetailComponent implements OnInit { ) {} ngOnInit() { + this.getSelectList(); this.getDetailList(); this.initSF(); this.initSF1(); @@ -145,13 +149,34 @@ export class VehicleComponentsListDetailComponent implements OnInit { }; } // 获取录单员 + getSelectList() { + this.Serveice("CarColor") + this.Serveice("CarModel") + this.Serveice("CarLength") + } + Serveice(param :any) { + let value: any; + this.service.request(`${this.service.$api_get_getDictValue}`, + { + dictKey: param + }).subscribe((res) => { + if(param === 'CarColor') { + this.contenCarNoColor = res; + } else if(param === 'CarModel') { + this.contencarModel = res; + } else if(param === 'CarLength') { + this.contenCarLength = res; + } + }) + return value; + } + // 获取录单员 getDetailList() { console.log( this.route.snapshot?.params?.id) const params = { id: this.route.snapshot?.params?.id }; this.service.request(`${this.service.$api_get_operate_get}`, params).subscribe((res) => { - console.log(res) this.detailData = res; this.tempalateData = res; }) @@ -170,7 +195,7 @@ export class VehicleComponentsListDetailComponent implements OnInit { *查看评价 */ viewEvaluate(item: any) { - this.modal.createStatic(VehicleImgViewComponent, { i: { imgUrl: item } }).subscribe(() => { + this.modal.createStatic(VehicleImgViewComponent, { i: item } ).subscribe(() => { // this.st.reload(); }); } @@ -178,7 +203,7 @@ export class VehicleComponentsListDetailComponent implements OnInit { *查看评价 */ updateEvaluate(item: any) { - this.modal.createStatic(VehicleComponentsListEditComponent, { i: { item }, infoData: item }).subscribe(() => { + this.modal.createStatic(VehicleComponentsListEditComponent, { i: item }).subscribe(() => { // this.st.reload(); // this.getInfo(); }); @@ -192,10 +217,11 @@ export class VehicleComponentsListDetailComponent implements OnInit { changeUpload({ file, fileList, type }: any, key: string) { console.log({ file, fileList, type }); if (type === 'success') { - this.detailData[key] = file.response.data.fullFileWatermarkPath; + this.detailData[key] = file.response.data.fullFilePath; } } deleteImg(key: string) { + console.log(key) this.nzModalService.warning({ nzTitle: '是否确认删除该图片', nzOnOk: () => { @@ -222,6 +248,7 @@ export class VehicleComponentsListDetailComponent implements OnInit { save() { this.isEdit = false; + console.log(this.detailData) } private initData() { return { diff --git a/src/app/routes/vehicle/components/list/img-view/img-view.component.html b/src/app/routes/vehicle/components/list/img-view/img-view.component.html index 198181d3..37c315ad 100644 --- a/src/app/routes/vehicle/components/list/img-view/img-view.component.html +++ b/src/app/routes/vehicle/components/list/img-view/img-view.component.html @@ -1,16 +1,31 @@ + - -
+
+ {{this.i?.carProtocal}} +
+
+ + + + +