From 2e659b1d3c156f6ce55294b5107f08d531ac915d Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 16 Dec 2021 17:00:33 +0800 Subject: [PATCH] edit --- .../enterprise-audit.component.ts | 5 +- .../enterprise-audit/view/view.component.html | 15 +- .../freight/list/detail/detail.component.html | 266 +++++++++++++----- .../freight/list/detail/detail.component.less | 56 ++-- .../freight/list/detail/detail.component.ts | 221 +++++++++++---- .../freight/list/new/new.component.ts | 36 --- src/app/routes/usercenter/less/edit.less | 4 + .../usercenter/services/usercenter.service.ts | 14 +- .../usercenter/usercenter-routing.module.ts | 2 +- 9 files changed, 417 insertions(+), 202 deletions(-) diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts index 60f6c865..c6622cd7 100644 --- a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts @@ -120,9 +120,7 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { } View(record: any) { - this.router.navigate(['./view', record.id], { - relativeTo: this.ar - }); + this.router.navigate([`/usercenter/freight/enterprise/detail/${record.id}`]); } // 切换Tab @@ -137,7 +135,6 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { private adminAuditUser(params: any, modal: any) { this.service.request(this.service.$api_audit_enterprise_admin, params, 'POST', false).subscribe(res => { - console.log(res); if (res) { this.service.msgSrv.success('审核成功'); modal.destroy(); diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html index a41453d6..cfca010c 100644 --- a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html @@ -1,5 +1,5 @@ - + - +
- - - - + + + + + + + + + + + + + + + + +
@@ -76,27 +101,37 @@
- + 企业管理员信息 - {{ detailData?.adminUserInfo?.name }} + - {{ detailData?.adminUserInfo?.mobile }} + {{detailData.adminUserInfo?.mobile}} - {{ detailData?.adminUserInfo?.certificateNumber }} + - - +
+ + + + +
- + +
+ @@ -112,85 +147,137 @@ - {{ detailData?.enterpriseName }} + - {{ detailData?.unifiedSocialCreditCode }} + - {{ detailData?.enterpriseType }} + - {{ detailData?.registrationCapital }} + + + + + {{detailData?.registrationCapital}} + 万元 - {{ detailData?.enterpriseRegistrationTime }} + -
- {{ detailData?.operatingStartTime }} 至 {{ detailData?.operatingEndTime }} -
-
长期
-
{{ detailData?.operatingStartTime - }} 至 长期
+ + + - + + + + + + + + +
-
- - {{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{ - detailData?.fullRegionVO?.areaName }} + + + + + + {{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{ + detailData?.fullRegionVO?.areaName }} + - - {{ detailData?.enterpriseAddress }} + + - - - - {{ detailData?.businessScope }} + + - - - - {{ detailData?.taxAuthority }} + + - - + + + 法人信息 - {{ detailData?.legalPersonIdentityVO?.name }} + - {{ detailData?.legalPersonIdentityVO?.certificateNumber }} + - {{ detailData?.legalPersonIdentityVO?.validStartTime }} - - {{ detailData?.legalPersonIdentityVO?.validEndTime || '长期' }} + + - + + + + + + + + - - +
+ + + + + + +
企业开票信息 - {{ detailData?.createBank }} + - {{ detailData?.bankAccount }} + - {{ detailData?.registerPhone }} + - {{ detailData?.registerAddress }} +
@@ -204,4 +291,55 @@ {{content}} + + + +
+
+ + {{ detailData?.enterpriseName }} + + + + + + + +
+
+
+ + +
+
+ + {{ detailData?.enterpriseName }} + + + + +
+
+
+ + + + + +
上传
+
+
+ +
+
+ +
+ +
+
+
+
\ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/detail/detail.component.less b/src/app/routes/usercenter/components/freight/list/detail/detail.component.less index ecad9a04..f296f271 100644 --- a/src/app/routes/usercenter/components/freight/list/detail/detail.component.less +++ b/src/app/routes/usercenter/components/freight/list/detail/detail.component.less @@ -1,45 +1,21 @@ -@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; - } +@import '../../../../less/edit.less'; - .warning { - color: @warning-color; - } - .error { - color: @error-color; - } +.user-info { + font-size: 16px; + + .enterprise-name { + margin-right: 15px; } - .mt16 { - margin-top: 16px; + + img { + width : 64px; + height : 64px; + margin-right : 15px; + border-radius: 50%; } - .user-info { - font-size: 16px; - .enterprise-name { - margin-right: 15px; - } - img { - width: 64px; - height: 64px; - margin-right: 15px; - border-radius: 50%; - } - .user-info-des { - margin-bottom: 5px; - } + + .user-info-des { + margin-bottom: 5px; } -} +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts b/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts index dfc6aabb..8e0aaf4d 100644 --- a/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts +++ b/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts @@ -1,21 +1,43 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; import { STColumn, STComponent } from '@delon/abc/st'; import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; -import { ModalHelper, _HttpClient } from '@delon/theme'; +import { DatePipe, ModalHelper, _HttpClient } from '@delon/theme'; import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; import { UsermanageService } from '../../../../services/usercenter.service'; @Component({ selector: 'app-supplier-components-list-view', templateUrl: './detail.component.html', - styleUrls: ['./detail.component.less'] + styleUrls: ['./detail.component.less'], + providers: [DatePipe] }) export class FreightComponentsListDetailComponent implements OnInit { - detailData: any; + @ViewChild('approvedModal', { static: false }) + approvedModal!: any; + @ViewChild('redectModal', { static: false }) + redectModal!: any; + + detailData: any = { adminUserInfo: { name: '' }, legalPersonIdentityVO: { name: '' } }; + tempalateData = { ...this.detailData }; suppliersData: any = {}; - constructor(public service: UsermanageService, private route: ActivatedRoute) {} + isEdit = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + enterpriseAddressCode: any = []; + + approvalOpinion = ''; + networkTransporter = null; + constructor( + public service: UsermanageService, + private route: ActivatedRoute, + private nzModalService: NzModalService, + private datePipe: DatePipe + ) {} ngOnInit() { this.initData(); @@ -28,55 +50,17 @@ export class FreightComponentsListDetailComponent implements OnInit { .subscribe(res => { if (res) { this.detailData = res; + this.tempalateData = { ...this.detailData }; + this.enterpriseAddressCode = [ + Number(this.detailData.fullRegionVO?.provinceCode), + Number(this.detailData.fullRegionVO?.cityCode), + Number(this.detailData.fullRegionVO?.areaCode) + ]; } console.log(res); }); - // // 商品资质 - // if (res.enterpriseBusinessJson) { - // res.enterpriseBusinessJson.aptitudes = res.enterpriseBusinessJson?.aptitudes ? res.enterpriseBusinessJson.aptitudes.split(',') : []; - // } - // // // 申请人身份证证件 - // // res.applyUserJson.imagelist = []; - // // res.applyUserJson.imagelist.push(res.applyUserJson.certificatePhotoFront); - // // res.applyUserJson.imagelist.push(res.applyUserJson.certificatePhotoBack); - // // res.applyUserJson.imagelist.push(res.applyUserJson.handCertificate); - - // 法人身份证证件 - // const imagelist = []; - // imagelist.push(res?.certificatePhotoFront); - // imagelist.push(res?.certificatePhotoBack); - // res.certificatePhoto = imagelist; - - // // 营业执照 - // res.enterpriseQualificationCertificate = res.enterpriseQualificationCertificate - // ? res.enterpriseQualificationCertificate.split(',') - // : []; - - // // 返回所在地 - // res.enterpriseAddressCodeStr = await this.getRegionFullName(res.enterpriseAddressCode); - - // this.detailData = res; - // this.suppliersData = { - // suppliersType: res?.suppliersType, - // externalSuppliersId: res?.externalSuppliersId - // }; } - /** - * 根据地区code查询地区详情 - * @param code 地区代码 - */ - async getRegionFullName(code: any) { - const params = { - regionCode: code - }; - const res = await this.service.asyncRequest(this.service.$api_get_one, params, 'POST', true); - // if (res && res.regionFullName) { - // const arr = res.regionFullName.split(','); - // res.regionFullName = arr.reverse().join('-'); - // } - return res && res.regionFullName; - } goBack() { window.history.go(-1); } @@ -125,4 +109,145 @@ export class FreightComponentsListDetailComponent implements OnInit { } }); } + + auditPass() { + this.networkTransporter = null; + this.nzModalService.create({ + nzTitle: '审核通过', + nzContent: this.approvedModal, + nzOnOk: () => { + if (!this.networkTransporter) { + return false; + } + this.auditEnterprise(20); + return; + } + }); + } + auditNo() { + this.approvalOpinion = ''; + this.nzModalService.create({ + nzTitle: '审核驳回', + nzContent: this.redectModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + return false; + } + this.auditEnterprise(30); + return; + } + }); + } + + private auditEnterprise(status: number) { + this.service + .request(this.service.$api_audit_freight, { + approvalStatus: status, + id: this.detailData.id, + approvalOpinion: this.approvalOpinion, + networkTransporter: this.networkTransporter + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(status === 20 ? '审核通过' : '驳回成功'); + } + this.initData(); + }); + } + + ratify() { + this.isEdit = true; + } + + deleteImg(data: any, key: string, key2: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + data[key] = ''; + data[key2] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + } + } + + /** + * 级联获取地区数据 + * @param node 节点 + * @param index 层级 + * @returns + */ + loadRegionData = (node: any, index: number) => { + return new Promise(resolve => { + this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.regionCode || '' }).subscribe( + res => { + node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1, value: item.regionCode, label: item.name })); + }, + _ => {}, + () => { + resolve(node); + } + ); + }); + }; + + reset() { + this.detailData = { ...this.tempalateData }; + this.isEdit = false; + } + + save() { + const dateil = { ...this.detailData }; + Object.assign(dateil.legalPersonIdentityVO, { + validStartTime: this.datePipe.transform(dateil.legalPersonIdentityVO.validStartTime, 'yyyy-MM-dd'), + validEndTime: this.datePipe.transform(dateil.legalPersonIdentityVO.validEndTime, 'yyyy-MM-dd') + }); + const params = {}; + Object.assign(params, { + adminMobile: dateil.adminMobile, + adminAppUserId: dateil.adminAppUserId, + adminUserInfo: { ...dateil.adminUserInfo }, + bankAccount: dateil.bankAccount, + businessScope: dateil.businessScope, + createBank: dateil.createBank, + creditPhoto: dateil.creditPhoto, + creditPhotoWatermark: dateil.creditPhotoWatermark, + enterpriseAddress: dateil.enterpriseAddress, + enterpriseAddressCode: this.enterpriseAddressCode[2], + enterpriseLogo: dateil.enterpriseLogo, + enterpriseName: dateil.enterpriseName, + enterpriseRegistrationTime: this.datePipe.transform(dateil.enterpriseRegistrationTime, 'yyyy-MM-dd'), + enterpriseType: dateil.enterpriseType, + id: dateil.id, + legalPersonIdentityDTO: { ...dateil.legalPersonIdentityVO }, + licensePhoto: dateil.licensePhoto, + licensePhotoWatermark: dateil.licensePhotoWatermark, + networkTransporter: dateil.networkTransporter, + oftenUsedServices: dateil.oftenUsedServices, + operatingEndTime: this.datePipe.transform(dateil.operatingEndTime, 'yyyy-MM-dd'), + operatingStartTime: this.datePipe.transform(dateil.operatingStartTime, 'yyyy-MM-dd'), + passTime: this.datePipe.transform(dateil.passTime, 'yyyy-MM-dd'), + promotersTelephone: dateil.promotersTelephone, + registerAddress: dateil.registerAddress, + registerPhone: dateil.registerPhone, + registrationCapital: dateil.registrationCapital, + taxAuthority: dateil.taxAuthority, + unifiedSocialCreditCode: dateil.unifiedSocialCreditCode + }); + this.service.request(this.service.$api_save_enterprise_admin, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('企业修改成功'); + this.initData(); + this.isEdit = false; + } + }); + } } diff --git a/src/app/routes/usercenter/components/freight/list/new/new.component.ts b/src/app/routes/usercenter/components/freight/list/new/new.component.ts index 2818b347..117e6a8b 100644 --- a/src/app/routes/usercenter/components/freight/list/new/new.component.ts +++ b/src/app/routes/usercenter/components/freight/list/new/new.component.ts @@ -123,42 +123,6 @@ export class FreightComponentsListNewComponent implements OnInit { return this.service.request(this.service.$api_get_region_by_code, { regionCode }); } - longTime(i: boolean | SFSchemaEnum[], type: string) { - if (type === 'schema') { - if (i) { - // this.sf?.setValue('/validStartTime', Date); - this.sf?.setValue('/validEndTime', Date); - // this.sf.getProperty('/validStartTime').schema.readOnly = true; - this.sf.getProperty('/validEndTime')!.schema.readOnly = true; - } else { - // this.sf.getProperty('/validStartTime').schema.readOnly = false; - this.sf.getProperty('/validEndTime')!.schema.readOnly = false; - } - } - if (type === 'schema1') { - if (i) { - // this.sf1?.setValue('/operatingStartTime', Date); - this.sf1?.setValue('/operatingEndTime', Date); - // this.sf1.getProperty('/operatingStartTime').schema.readOnly = true; - this.sf1.getProperty('/operatingEndTime')!.schema.readOnly = true; - } else { - // this.sf1.getProperty('/operatingStartTime').schema.readOnly = false; - this.sf1.getProperty('/operatingEndTime')!.schema.readOnly = false; - } - } - if (type === 'schema11') { - if (i) { - // this.sf1?.setValue('/validStartTime', Date); - this.sf1?.setValue('/validEndTime', Date); - // this.sf1.getProperty('/validStartTime').schema.readOnly = true; - this.sf1.getProperty('/validEndTime')!.schema.readOnly = true; - } else { - // this.sf1.getProperty('/validStartTime').schema.readOnly = false; - this.sf1.getProperty('/validEndTime')!.schema.readOnly = false; - } - } - } - checkIdCard(imgurl: any, isFront: number, type: number) { // 识别身份证 参数isFront:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 const params = { diff --git a/src/app/routes/usercenter/less/edit.less b/src/app/routes/usercenter/less/edit.less index 9652786c..22cfcaf0 100644 --- a/src/app/routes/usercenter/less/edit.less +++ b/src/app/routes/usercenter/less/edit.less @@ -18,6 +18,10 @@ nz-date-picker { min-width: 250px; } + + .calendar { + min-width: 130px; + } } .readOnly-box { diff --git a/src/app/routes/usercenter/services/usercenter.service.ts b/src/app/routes/usercenter/services/usercenter.service.ts index f4fb4fc0..706a1960 100644 --- a/src/app/routes/usercenter/services/usercenter.service.ts +++ b/src/app/routes/usercenter/services/usercenter.service.ts @@ -9,6 +9,8 @@ import { Injectable, Injector } from '@angular/core'; import { _HttpClient } from '@delon/theme'; import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; import { BaseService } from 'src/app/shared/services/core/base.service'; import { EAFileUtil } from 'src/app/shared/utils/file.util'; @@ -39,7 +41,7 @@ export class UsermanageService extends BaseService { // 冻结或恢复员工 $api_lock_staff = '/api/mdc/cuc/userApp/freezeOrResumeStaff'; - + // 冻结或恢复应用用户 $api_lock_app_user = '/api/mdc/cuc/userApp/freezeOrResume'; @@ -84,7 +86,15 @@ export class UsermanageService extends BaseService { // 根据地区code查询列表 $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode'; - constructor(public injector: Injector) { + constructor(public injector: Injector, private nzModalService: NzModalService) { super(injector); } + + showImg(url: any) { + const params = { + imgList: [url], + index: 0 + }; + this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } } diff --git a/src/app/routes/usercenter/usercenter-routing.module.ts b/src/app/routes/usercenter/usercenter-routing.module.ts index 0b4a70fb..b1ae5462 100644 --- a/src/app/routes/usercenter/usercenter-routing.module.ts +++ b/src/app/routes/usercenter/usercenter-routing.module.ts @@ -28,8 +28,8 @@ const routes: Routes = [ { path: 'freight/list/view/:id', component: FreightComponentsListViewComponent }, { path: 'freight/list/new', component: FreightComponentsListNewComponent }, { path: 'freight/list/detail/:id', component: FreightComponentsListDetailComponent }, + { path: 'freight/enterprise/detail/:id', component: FreightComponentsListDetailComponent }, { path: 'freight/enterprise', component: FreightComponentsEnterpriseAuditComponent }, - { path: 'freight/enterprise/view/:id', component: FreightComponentsEnterpriseAuditViewComponent }, { path: 'freight/user', component: FreightComponentsUserComponent }, { path: 'freight/user/view/:id', component: FreightComponentsUserDetailComponent }, { path: 'driver', component: UserCenterComponentsDriverComponent },