From 8091d8e274561e5fc6051682a5753c7503c6dac7 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 9 Dec 2021 16:15:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A7=E4=B8=BB=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enterprise-audit.component.html | 95 +---- .../enterprise-audit.component.less | 17 +- .../enterprise-audit.component.ts | 386 +++++++----------- .../enterprise-audit/view/view.component.html | 205 ++++++---- .../view/view.component.spec.ts | 31 -- .../enterprise-audit/view/view.component.ts | 247 +++++------ .../freight/list/detail/detail.component.html | 101 ++--- .../freight/list/detail/detail.component.ts | 58 +-- .../freight/user/detail/detail.component.html | 129 +++--- .../freight/user/detail/detail.component.ts | 292 +++---------- .../freight/user/user.component.html | 160 ++------ .../freight/user/user.component.less | 6 + .../freight/user/user.component.spec.ts | 23 -- .../components/freight/user/user.component.ts | 287 ++++++------- .../usercenter/services/usercenter.service.ts | 13 + .../components/imagelist/image-list.module.ts | 13 + .../imagelist/imagelist.component.html | 3 + .../imagelist/imagelist.component.spec.ts} | 12 +- .../imagelist/imagelist.component.ts | 23 ++ .../components/imagelist/imagelist.less | 9 + .../imageview/imageview.component.html | 12 + .../imageview/imageview.component.spec.ts | 23 ++ .../imageview/imageview.component.ts | 39 ++ .../imagelist/imageview/imageview.less | 39 ++ src/app/shared/components/imagelist/index.ts | 3 + src/app/shared/shared-zorro.module.ts | 4 +- src/app/shared/shared.module.ts | 2 + src/assets/mocks/menu-data.json | 2 +- 28 files changed, 971 insertions(+), 1263 deletions(-) delete mode 100644 src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.spec.ts create mode 100644 src/app/routes/usercenter/components/freight/user/user.component.less delete mode 100644 src/app/routes/usercenter/components/freight/user/user.component.spec.ts create mode 100644 src/app/shared/components/imagelist/image-list.module.ts create mode 100644 src/app/shared/components/imagelist/imagelist.component.html rename src/app/{routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.spec.ts => shared/components/imagelist/imagelist.component.spec.ts} (51%) create mode 100644 src/app/shared/components/imagelist/imagelist.component.ts create mode 100644 src/app/shared/components/imagelist/imagelist.less create mode 100644 src/app/shared/components/imagelist/imageview/imageview.component.html create mode 100644 src/app/shared/components/imagelist/imageview/imageview.component.spec.ts create mode 100644 src/app/shared/components/imagelist/imageview/imageview.component.ts create mode 100644 src/app/shared/components/imagelist/imageview/imageview.less create mode 100644 src/app/shared/components/imagelist/index.ts diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html index 9cd39253..45e077a6 100644 --- a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html @@ -1,51 +1,32 @@ - +
- -
- +
+ +
+
+ + + +
- - - -
- -
-
- - - - -
-
-
- + + - + [loading]="service.http.loading"> @@ -53,40 +34,4 @@ - - + \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.less b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.less index dfd3be23..0e1403ad 100644 --- a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.less +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.less @@ -1,10 +1,23 @@ :host { ::ng-deep { - .tabs-wrap > .ant-tabs-nav { + .tabs-wrap>.ant-tabs-nav { margin-bottom: 0; } - .myForm .ant-upload.ant-upload-select-picture-card > .ant-upload { + + .myForm .ant-upload.ant-upload-select-picture-card>.ant-upload { flex-direction: column !important; } } } + +.expend-options { + margin-top: 0px; +} + + +@media (min-width: 1200px) { + .expend-options { + margin-top: -40px; + } + +} \ No newline at end of file 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 2e4dbe0a..09161f53 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 @@ -8,13 +8,14 @@ import { UsermanageService } from '../../../services/usercenter.service'; @Component({ selector: 'app-Freight-components-enterprise-audit', templateUrl: './enterprise-audit.component.html', - styleUrls: ['./enterprise-audit.component.less'], + styleUrls: ['./enterprise-audit.component.less'] }) export class FreightComponentsEnterpriseAuditComponent implements OnInit { _$expand = false; - ui!: SFUISchema; - schema!: SFSchema; - columns!: STColumn[]; + ui: SFUISchema = { '*': { spanLabelFixed: 90, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } }; + schema: SFSchema = this.initSF(); + enterColumns: STColumn[] = this.initEnterST(); + adminColumns: STColumn[] = this.initAdminST(); @ViewChild('st', { static: false }) st!: STComponent; @ViewChild('sf', { static: false }) sf!: SFComponent; tabType = 1; @@ -22,80 +23,32 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { { name: '企业审核', type: 1, - isActived: false, + isActived: false }, { name: '企业管理员审核', type: 2, - isActived: false, - }, + isActived: false + } ]; - datalist = [ - { - storeName: '企业名称', - contactsName: '152746565', - enterpriseName: '湖南', - unifiedSocialCreditCode: '45454', - contactsPhone: '*97889461561', - effectiveDateStr: '废弃eww', - enStatusStr2: '已驳回', - enStatusStr3: '正常', - unifiedSocialCreditCode3: '常用服务', - unifiedSocialCreditCode2: '正常', - tenantId: 1, - id: 1 - }, - { - storeName: '企业名称', - contactsName: '152746565', - enterpriseName: '湖南', - unifiedSocialCreditCode: '45454', - contactsPhone: '*97889461561', - effectiveDateStr: '废弃eww', - enStatusStr2: '待审核', - enStatusStr3: '正常', - unifiedSocialCreditCode3: '常用服务', - unifiedSocialCreditCode2: '正常', - tenantId: 2, - id: 2 - }, - ] - isVisible = false; - mdType!: any; - cateData = []; - // stApi = this.service.$api_get_labelList; - constructor(public service: UsermanageService, private router: Router, private modal: NzModalService,private ar: ActivatedRoute) {} - - /** - * 查询字段个数 - */ - get queryFieldCount(): number { - return Object.keys(this.schema?.properties || {}).length; - } + constructor(public service: UsermanageService, private router: Router, private modal: NzModalService, private ar: ActivatedRoute) {} /** * 查询参数 */ get reqParams() { const params = Object.assign({}, this.sf?.value || {}, { - flag: this.tabType, + flag: this.tabType }); delete params._$expand; - return { ...params }; - } - - /** - * 选中行 - */ - get selectedRows() { - return this.st?.list.filter((item) => item.checked) || []; + return { ...params, listSource: 1 }; } /** * 伸缩查询条件 */ - expandToggle() { - this._$expand = !this._$expand; + expandToggle(status: boolean) { + this._$expand = status; this.sf?.setValue('/expand', this._$expand); } @@ -109,90 +62,7 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { /** * 程序初始化入口 */ - ngOnInit() { - this.initSF(); - this.initST(); - } - - /** - * 初始化查询表单 - */ - initSF() { - this.schema = { - properties: { - expand: { type: 'boolean', ui: { hidden: true } }, - name: { title: '企业名称', type: 'string' }, - contactsName: { - title: '联系人', - type: 'string', - ui: { - showRequired: false, - }, - }, - phone: { - title: '手机号', - type: 'string', - format: 'mobile', - maxLength: 11, - ui: { - placeholder: '请输入手机号', - }, - }, - enStatus2: { - type: 'string', - title: '状态', - enum: [ - { label: '全部', value: '' }, - { label: '正常', value: 0 }, - { label: '冻结', value: 1 }, - { label: '废弃', value: 2 }, - ], - default: '', - ui: { - widget: 'select', - visibleIf: { - expand: (value: boolean) => value, - }, - }, - }, - - }, - }; - this.ui = { '*': { spanLabelFixed: 100, grid: { span: 8, gutter: 4 } } }; - } - - /** - * 初始化数据列表 - */ - initST() { - this.columns = [ - { title: '企业名称', className: 'text-center', index: 'storeName' }, - { title: '联系人', className: 'text-center', index: 'contactsName' }, - { title: '手机号', className: 'text-center', render: 'enterpriseName' }, - { title: '申请时间', className: 'text-center', index: 'unifiedSocialCreditCode' }, - { - title: '状态', - className: 'text-center', - index: 'enStatusStr2', - type: 'badge', - badge: { - 待审核: { text: '待审核', color: 'success' }, - 已驳回: { text: '已驳回', color: 'warning' }, - }, - }, - { title: '常用服务', className: 'text-center', index: 'unifiedSocialCreditCode3' }, - { title: '推广业务员', className: 'text-center', index: 'unifiedSocialCreditCode2' }, - { - title: '操作', - fixed: 'right', - width: '180px', - className: 'text-center', - buttons: [ - { text: '查看', click: (_record) => this.View(_record) }, - ], - }, - ]; - } + ngOnInit() {} /** * 数据列表状态变化事件 @@ -202,109 +72,151 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { } /** - * 新增实例 + * 查看详情 */ View(record: any) { - console.log(record) - // this.router.navigate(['../add'], { relativeTo: this.ar }); - this.router.navigate(['./view', record.tenantId], { - relativeTo: this.ar + this.router.navigate(['./view', record.id], { + relativeTo: this.ar }); } - /** - * 编辑单个实例 - * @param record 记录实例 - */ - editOne(record: STData) { - // this.router.navigate(['../edit', record.uuid], { relativeTo: this.ar }); - } - - /** - * 删除单个实例 - * @param record 记录实例 - */ - delOne(record: STData) { - // let delApi = this.service.$api_label_deletebatch; - // if (this.tabType === 3) { - // delApi = this.service.$api_business_label_delete; - // } else { - // delApi = this.service.$api_label_deletebatch; - // } - this.modal.confirm({ - nzTitle: '删除确认', - nzContent: `即将删除 当前行数据,请仔细核对,避免误操作!
是否删除?
`, - nzOnOk: () => - console.log('1') - // this.service.http.post(delApi, [record.id]).subscribe((res) => { - // console.log(res, 'del'); - - // if (res === true || res.data === true) { - // this.service.msgSrv.success('删除成功!'); - // setTimeout(() => { - // this.st?.reload(); - // }, 500); - // } else { - // this.service.msgSrv.error('删除失败!'); - // } - // }), - }); - } - - /** - * 删除多个实例 - */ - delMany(record: STData) { - this.modal.confirm({ - nzTitle: '删除确认', - nzContent: `即将删除 当前行数据,请仔细核对,避免误操作!
是否删除?
`, - nzOnOk: () => - console.log('') - // this.service.http.post(this.service.$api_label_deletebatch, [record.id]).subscribe((res) => { - // if (res === true) { - // this.service.msgSrv.success('删除成功!'); - // this.st?.reload(); - // } - // }), - }); - /* - const delData = this.st.list.filter((item) => item.checked).map((item) => item.id); - if (delData.length > 0) { - this.modal.confirm({ - nzTitle: '删除确认', - nzContent: `即将删除 ${delData.length} 条数据,请仔细核对,避免误操作!
是否删除?
`, - nzOnOk: () => - this.service.delMany(delData).subscribe((res) => { - if (res === true) { - this.service.msgSrv.success('数据删除成功!'); - this.st?.reload(); - } - }), - }); - } - */ - } - // 切换Tab changeTab(item: any) { this.tabType = item.type; - console.log(item) + this.expandToggle(false); this.sf?.reset(); - // if (item.type === 3) { - // this.stApi = this.service.$api_get_business_labelList; - // } else { - // this.stApi = this.service.$api_get_labelList; - // } - // setTimeout(() => { - // this.tabs.forEach((i) => (i.isActived = false)); - // item.isActived = !item.isActived; - // this.st.load(1); - // this.st.resetColumns(); - // }, 500); + setTimeout(() => { + this.st.load(1); + }, 100); } - // checkType(): boolean { - // return this.mdType === 2 ? true : false; - // } + /** + * 初始化数据列表 + */ + initEnterST(): STColumn[] { + return [ + { title: '企业名称', className: 'text-center', index: 'enterpriseName' }, + { title: '联系人', className: 'text-center', index: 'contacter' }, + { title: '手机号', className: 'text-center', render: 'mobile' }, + { title: '申请时间', className: 'text-center', index: 'createTime' }, + { + title: '审核状态', + className: 'text-center', + index: 'approvalStatus', + type: 'badge', + badge: { + 10: { text: '待审核', color: 'processing' }, + 20: { text: '已成功', color: 'success' }, + 30: { text: '审核失败', color: 'warning' } + } + }, + { + title: '常用服务', + className: 'text-center', + index: 'oftenUsedServices', + type: 'enum', + enum: { 10: '整车发货', 20: '大宗发货' } + }, + { title: '推广业务员', className: 'text-center', index: 'promotersTelephone' }, + { + title: '操作', + fixed: 'right', + width: '180px', + className: 'text-center', + buttons: [{ text: '查看', click: _record => this.View(_record) }] + } + ]; + } + initAdminST(): STColumn[] { + return [ + { title: '企业名称', className: 'text-center', index: 'enterpriseName' }, + { title: '当前管理员', className: 'text-center', index: 'contacter' }, + { title: '当前管理员手机号', className: 'text-center', render: 'mobile' }, + { title: '转授对象', className: 'text-center', index: 'promotersTelephone' }, + { title: '转授对象手机号', className: 'text-center', index: 'promotersTelephone' }, + { title: '申请时间', className: 'text-center', index: 'createTime' }, + { + title: '状态', + className: 'text-center', + index: 'approvalStatus', + type: 'badge', + badge: { + 10: { text: '待审核', color: 'processing' }, + 20: { text: '已成功', color: 'success' }, + 30: { text: '审核失败', color: 'warning' } + } + }, + { + title: '操作', + fixed: 'right', + width: '180px', + className: 'text-center', + buttons: [{ text: '审核', click: _record => this.View(_record) }] + } + ]; + } + + /** + * 初始化查询表单 + */ + initSF(): SFSchema { + return { + properties: { + expand: { type: 'boolean', ui: { hidden: true } }, + enterpriseName: { + title: '企业名称', + type: 'string', + ui: { + placeholder: '请输入' + } + }, + contactName: { + title: '联系人', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => this.tabType === 1 + } + } + }, + contactName2: { + title: '管理员', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => this.tabType !== 1 + } + } + }, + mobile: { + title: '手机号', + type: 'string', + format: 'mobile', + maxLength: 11, + ui: { + placeholder: '请输入' + } + }, + lockedStatus: { + type: 'string', + title: '状态', + enum: [ + { label: '全部', value: '' }, + { label: '正常', value: 0 }, + { label: '冻结', value: 1 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } } 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 42e05a59..4850c009 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,4 +1,4 @@ - + @@ -7,54 +7,82 @@ -
长期
-
{{ detailData?.operatingStartTime }} 至 长期
+
{{ detailData?.operatingStartTime + }} 至 长期
- {{ detailData?.enterpriseAddressCodeStr }} + {{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{ + detailData?.fullRegionVO?.areaName }} {{ detailData?.enterpriseAddress }} @@ -91,63 +121,78 @@ {{ detailData?.businessScope }} + + + + {{ detailData?.taxAuthority }} + - + - 法人信息 + 企业法人信息 - {{ detailData?.name }} + {{ detailData?.legalPersonIdentityVO?.name }} - - {{ detailData?.certificateNumber }} + + {{ detailData?.legalPersonIdentityVO?.certificateNumber }} - {{ detailData?.validStartTime }} - - {{ detailData?.validEndTime ? detailData?.validEndTime : '长期' }} + {{ detailData?.legalPersonIdentityVO?.validStartTime }} - + {{ detailData?.legalPersonIdentityVO?.validEndTime || '长期' }} - + + + + + + + 企业开票信息 + + {{ detailData?.createBank }} + + + {{ detailData?.bankAccount }} + + + {{ detailData?.registerPhone }} + + + {{ detailData?.registerAddress }} -
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - + + +
+
+ + {{ detailData?.enterpriseName }} + + + + + + + +
+
+
+ + +
+
+ + {{ detailData?.enterpriseName }} + + + + +
+
+
\ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.spec.ts b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.spec.ts deleted file mode 100644 index a14af7b4..00000000 --- a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * @Author: your name - * @Date: 2021-11-30 10:25:50 - * @LastEditTime: 2021-11-30 10:26:29 - * @LastEditors: your name - * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE - * @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\enterprise-audit\view\view.component.spec.ts - */ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { FreightComponentsEnterpriseAuditViewComponent } from './view.component'; - -describe('FreightComponentsEnterpriseAuditViewComponent', () => { - let component: FreightComponentsEnterpriseAuditViewComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [FreightComponentsEnterpriseAuditViewComponent], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(FreightComponentsEnterpriseAuditViewComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts index dd77b304..9c264f67 100644 --- a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts @@ -4,113 +4,59 @@ import { STColumn, STComponent } from '@delon/abc/st'; import { ModalHelper, _HttpClient } from '@delon/theme'; import { NzMessageService } from 'ng-zorro-antd/message'; import { UsermanageService } from '../../../../services/usercenter.service'; -import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema, SFUploadWidgetSchema, SFSelectWidgetSchema, SFTextWidgetSchema, SFTagWidgetSchema } from '@delon/form'; +import { + SFComponent, + SFSchema, + SFDateWidgetSchema, + SFUISchema, + SFUploadWidgetSchema, + SFSelectWidgetSchema, + SFTextWidgetSchema, + SFTagWidgetSchema +} from '@delon/form'; import { Observable, Observer } from 'rxjs'; +import { NzModalService } from 'ng-zorro-antd/modal'; @Component({ selector: 'app-Freight-components-EnterpriseAudit-view', templateUrl: './view.component.html', - styleUrls: ['./view.component.less'], + styleUrls: ['./view.component.less'] }) export class FreightComponentsEnterpriseAuditViewComponent implements OnInit { - i: any; - url = `/rule?_allow_anonymous=true`; - @ViewChild('st', { static: false }) st!: STComponent; - detailData: any; - isVisible = false; - isVisibleNo = false; - modalTitle = '有效期'; - modalName = ''; - ui!: SFUISchema; - ui2!: SFUISchema; - schema!: SFSchema; - @ViewChild('sf', { static: false }) sf!: SFComponent; - schema2!: SFSchema; - @ViewChild('sf2', { static: false }) sf2!: SFComponent; - validData: any = ['suppliersType']; - suppliersData: any = {}; + @ViewChild('approvedModal', { static: false }) + approvedModal!: any; + @ViewChild('redectModal', { static: false }) + redectModal!: any; - constructor( - private http: _HttpClient, - private modal: ModalHelper, - public service: UsermanageService, - private route: ActivatedRoute, - private modalHelper: ModalHelper, - private msgSrv: NzMessageService, - ) {} + approvalOpinion = ''; + networkTransporter = null; + + detailData: any; + + statusE: any = { + 10: '待审核', + 20: '审核通过', + 30: '审核失败' + }; + + isEdit = false; + + constructor(private nzModalService: NzModalService, public service: UsermanageService, private route: ActivatedRoute) {} ngOnInit() { - console.log(this.route.snapshot); - // this.initData(); - this.initSF(); - this.initSFNo(); + this.initData(); // this.launchSign(); } - /** - * 初始化查询表单 - */ - initSF() { - this.schema = { - properties: { - '公司名称': { type: 'number', ui: { widget: 'text', defaultText: '深圳市星链供应链云科技有限公' } as SFTextWidgetSchema }, - status: { - type: 'string', - title: '税源地', - enum: [ - { label: '待支付', value: 'WAIT_BUYER_PAY', otherData: 1 }, - { label: '已支付', value: 'TRADE_SUCCESS' }, - { label: '交易完成', value: 'TRADE_FINISHED' }, - ], - default: 'WAIT_BUYER_PAY', - ui: { - widget: 'select', - change: (value, orgData) => console.log(value, orgData), - } as SFSelectWidgetSchema, - }, - }, - required: ['status'], - }; - this.ui = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; - } - initSFNo() { - this.schema2 = { - properties: { - '公司名称': { type: 'number', ui: { widget: 'text', defaultText: '深圳市星链供应链云科技有限公' } as SFTextWidgetSchema }, - roleDescription: { - title: '地址', - type: 'string', - maxLength: 30, - ui: { - placeholder: '请输入地址', - widget: 'textarea', - }, - }, - like: { - type: 'number', - title: '兴趣', - enum: [ - { value: 1, label: '电影' }, - { value: 2, label: '书' }, - { value: 3, label: '旅行' }, - ], - ui: { - widget: 'tag', - } as SFTagWidgetSchema, - default: [1, 2], - }, - }, - required: ['roleDescription'], - }; - this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; - } - - async initData() { - console.log(this.route.snapshot, 'this.route.snapshot'); - const params = { - tenantId: this.route.snapshot.params.id, - // tenantId: this.route.snapshot.queryParams.tenantId, - }; - const res = await this.service.asyncRequest(this.service.$api_get_one, params); + initData() { + this.service + .request(this.service.$api_get_freight_detail, { + id: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.detailData = res; + } + }); // // 商品资质 // if (res.enterpriseBusinessJson) { // res.enterpriseBusinessJson.aptitudes = res.enterpriseBusinessJson?.aptitudes ? res.enterpriseBusinessJson.aptitudes.split(',') : []; @@ -122,24 +68,24 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit { // // res.applyUserJson.imagelist.push(res.applyUserJson.handCertificate); // 法人身份证证件 - const imagelist = []; - imagelist.push(res?.certificatePhotoFront); - imagelist.push(res?.certificatePhotoBack); - res.certificatePhoto = imagelist; + // const imagelist = []; + // imagelist.push(res?.certificatePhotoFront); + // imagelist.push(res?.certificatePhotoBack); + // res.certificatePhoto = imagelist; - // 营业执照 - res.enterpriseQualificationCertificate = res.enterpriseQualificationCertificate - ? res.enterpriseQualificationCertificate.split(',') - : []; + // // 营业执照 + // res.enterpriseQualificationCertificate = res.enterpriseQualificationCertificate + // ? res.enterpriseQualificationCertificate.split(',') + // : []; - // 返回所在地 - res.enterpriseAddressCodeStr = await this.getRegionFullName(res.enterpriseAddressCode); + // // 返回所在地 + // res.enterpriseAddressCodeStr = await this.getRegionFullName(res.enterpriseAddressCode); - this.detailData = res; - this.suppliersData = { - suppliersType: res?.suppliersType, - externalSuppliersId: res?.externalSuppliersId, - }; + // this.detailData = res; + // this.suppliersData = { + // suppliersType: res?.suppliersType, + // externalSuppliersId: res?.externalSuppliersId + // }; } /** @@ -148,7 +94,7 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit { */ async getRegionFullName(code: any) { const params = { - regionCode: code, + regionCode: code }; const res = await this.service.asyncRequest(this.service.$api_get_one, params, 'POST', true); // if (res && res.regionFullName) { @@ -157,36 +103,57 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit { // } return res && res.regionFullName; } + + 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; + } + goBack() { window.history.go(-1); } - - - - handleCancel(name: any) { - if (name === 'suppliersTypeNo') { - this.isVisibleNo = false; - } else { - this.isVisible = false; - } - } - handleOK() { - const params: any = { - tenantId: this.route.snapshot.params.id, - // tenantId: this.route.snapshot.queryParams.tenantId, - }; - console.log(this.sf.value) - // this.service.http.post(this.service.$api_set_freezeOrResume, params).subscribe((res) => { - - // }); - } - auditPass() { - this.isVisible = true - } - auditNo() { - this.isVisibleNo = true - } - ratify() { - - } } diff --git a/src/app/routes/usercenter/components/freight/list/detail/detail.component.html b/src/app/routes/usercenter/components/freight/list/detail/detail.component.html index 454c31bb..eb43eca2 100644 --- a/src/app/routes/usercenter/components/freight/list/detail/detail.component.html +++ b/src/app/routes/usercenter/components/freight/list/detail/detail.component.html @@ -6,51 +6,53 @@ -