diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.html b/src/app/routes/usercenter/components/driver/captain/captain.component.html new file mode 100644 index 00000000..76715051 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain.component.html @@ -0,0 +1,83 @@ + + + + + + +
+ +
+ + +
+ + + + +
+ +
+
+ + + + +
+
+
+
+ + + + + + +
+
+ {{ item.enterpriseName }} +
+
+
+ +
+ {{ item.contactsPhone }} +
+
+ + 冻结 + 正常 + +
+
diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.spec.ts b/src/app/routes/usercenter/components/driver/captain/captain.component.spec.ts new file mode 100644 index 00000000..8ca6e88c --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain.component.spec.ts @@ -0,0 +1,31 @@ +/* + * @Author: your name + * @Date: 2021-11-30 16:56:15 + * @LastEditTime: 2021-11-30 20:36:30 + * @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\components\driver\driver.component.spec.ts + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { UserCenterComponentsDriverCaptainComponent } from './captain.component'; + +describe('UserCenterComponentsDriverCaptainComponent', () => { + let component: UserCenterComponentsDriverCaptainComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [UserCenterComponentsDriverCaptainComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UserCenterComponentsDriverCaptainComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.ts b/src/app/routes/usercenter/components/driver/captain/captain.component.ts new file mode 100644 index 00000000..b1fc9c7a --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain.component.ts @@ -0,0 +1,247 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { UsermanageService } from '../../../services/usercenter.service'; +@Component({ + selector: 'app-usercenter-components-driver-captain', + templateUrl: './captain.component.html', +}) +export class UserCenterComponentsDriverCaptainComponent implements OnInit { + _$expand = false; + url = `/rule?_allow_anonymous=true`; + + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + datalist = [ + { + storeName: '企业名称', + contactsName: '152746565', + enterpriseName: '湖南', + unifiedSocialCreditCode: '45454', + contactsPhone: '*97889461561', + effectiveDateStr: '废弃eww', + enStatusStr2: '正常', + enStatusStr3: '正常', + unifiedSocialCreditCode3: '常用服务', + unifiedSocialCreditCode2: '正常', + tenantId: 1 + }, + { + storeName: '企业名称', + contactsName: '152746565', + enterpriseName: '湖南', + unifiedSocialCreditCode: '45454', + contactsPhone: '*97889461561', + effectiveDateStr: '废弃eww', + enStatusStr2: '正常', + enStatusStr3: '正常', + unifiedSocialCreditCode3: '常用服务', + unifiedSocialCreditCode2: '正常', + tenantId: 2 + }, + ] + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + + constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {} + /** + * 查询字段个数navigate + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params: any = { + ...(this.sf && this.sf.value), + }; + if (this.sf?.value.effectiveDate) { + params.effectiveDateStart = this.sf?.value.effectiveDate[0]; + params.effectiveDateEnd = this.sf?.value.effectiveDate[1]; + } + delete params.effectiveDate; + delete params.expand; + return params; + } + + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + + ngOnInit() { + this.initSF(); + this.initST(); + this.ar.url.subscribe((params) => { + this.st?.load(1); + }); + } + dataProcess(data: STData[]): STData[] { + return data.map((i, index) => { + i.showSortFlag = false; + return i; + }); + } + initSF() { + this.schema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true, + }, + }, + storeName: { title: '司机姓名', type: 'string', ui: { showRequired: false } }, + phone: { + title: '手机号', + type: 'string', + format: 'mobile', + maxLength: 11, + ui: { + placeholder: '请输入手机号', + }, + }, + enStatus: { + type: 'string', + title: '实名状态', + enum: [ + { label: '全部', value: '' }, + { label: '正常', value: 0 }, + { label: '冻结', value: 1 }, + { label: '废弃', value: 2 }, + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value, + }, + }, + }, + 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, + }, + }, + }, + enStatus23: { + type: 'string', + title: '从业资格证状态', + enum: [ + { label: '全部', value: '' }, + { label: '正常', value: 0 }, + { label: '冻结', value: 1 }, + { label: '废弃', value: 2 }, + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value, + }, + }, + }, + phone2: { + title: '业务员手机号', + type: 'string', + format: 'mobile', + maxLength: 11, + ui: { + placeholder: '请输入手机号', + }, + }, + + }, + }; + this.ui = { '*': { spanLabelFixed: 180, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } }; + } + + initST() { + this.columns = [ + // { title: '', type: 'checkbox', className: 'text-center' }, + { 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: 'effectiveDateStr', + type: 'badge', + badge: { + 正常: { text: '正常', color: 'success' }, + 冻结: { text: '冻结', color: 'warning' }, + 废弃: { text: '废弃', color: 'default' }, + }, + }, + { + title: '驾驶证状态', + className: 'text-center', + index: 'enStatusStr2', + type: 'badge', + badge: { + 正常: { text: '正常', color: 'success' }, + 冻结: { text: '冻结', color: 'warning' }, + 废弃: { text: '废弃', color: 'default' }, + }, + }, + { + title: '从业资格证状态', + className: 'text-center', + index: 'enStatusStr3', + type: 'badge', + badge: { + 正常: { text: '正常', color: 'success' }, + 冻结: { text: '冻结', color: 'warning' }, + 废弃: { text: '废弃', color: 'default' }, + }, + }, + { title: '推广业务员', className: 'text-center', index: 'unifiedSocialCreditCode2' }, + { title: '注册时间', className: 'text-center', index: 'unifiedSocialCreditCode3' }, + { + title: '操作', + width: '170px', + className: 'text-center', + buttons: [ + { + text: '查看', + click: (item) => { + this.router.navigate(['./detail', item.tenantId], { relativeTo: this.ar }); + // this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } }); + }, + }, + ], + }, + ]; + } + daoyun(item: any) { + this.router.navigate(['./view', item.tenantId], { relativeTo: this.ar }); + } + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + creat() { + this.router.navigate(['./new',], { relativeTo: this.ar }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } +} diff --git a/src/app/routes/usercenter/components/driver/detail/detail.component.html b/src/app/routes/usercenter/components/driver/detail/detail.component.html index 4aafe892..89cc77e7 100644 --- a/src/app/routes/usercenter/components/driver/detail/detail.component.html +++ b/src/app/routes/usercenter/components/driver/detail/detail.component.html @@ -1,6 +1,6 @@ - + - - @@ -124,166 +102,173 @@ - -
- - - -
确定关闭该企业支付权限吗?
-
- 停用后,该企业将被限制使用支付功能,请谨慎操作 -
-
-
- -
- - - -
确定开通该企业支付权限吗?
-
- 启用后,该企业将恢复正常支付功能,请再次确认 -
-
-
- - 联系信息人 - + + 实名认证信息 + {{ detailData?.contactsName }} - - {{ detailData?.contactsPhone }} - - + {{ detailData?.contactsPhone }} + + +
+
+ + +
+
+ - 公司基本信息 - + 驾驶证信息 + {{ detailData?.enterpriseName }} - + {{ detailData?.unifiedSocialCreditCode }} - + {{ detailData?.enterpriseType }} - - {{ detailData?.registrationCapital }} - 万元 - - - {{ detailData?.enterpriseRegistrationTime }} - - -
- {{ detailData?.operatingStartTime }} 至 {{ detailData?.operatingEndTime }} -
-
长期
-
{{ detailData?.operatingStartTime }} 至 长期
-
+ - - {{ detailData?.enterpriseAddressCodeStr }} - - - {{ detailData?.enterpriseAddress }} - - - - - {{ detailData?.enterpriseAddressCodeStr }} - - - {{ detailData?.enterpriseAddress }} - - - - - {{ detailData?.enterpriseAddressCodeStr }} - - - {{ detailData?.enterpriseAddress }} - - - - + + {{ detailData?.registrationCapital }} + 万元 + + + {{ detailData?.enterpriseRegistrationTime }} + + + + + + + + 从业资格证信息 + {{ detailData?.businessScope }} - - + + {{ detailData?.businessScope }} + + + {{ detailData?.businessScope }} + + + + +
+
+ + + +
+
+
+
+ - 法人信息 - + 载具信息 + {{ detailData?.name }} - + {{ detailData?.certificateNumber }} - - {{ detailData?.validStartTime }} - - {{ detailData?.validEndTime ? detailData?.validEndTime : '长期' }} + + {{ detailData?.validStartTime }} - + + {{ detailData?.validStartTime }} + + + {{ detailData?.validStartTime }} + + + {{ detailData?.validStartTime }} + + + + + + + + 银行结算信息 - + {{ detailData?.name }} - + {{ detailData?.certificateNumber }} - - {{ detailData?.validStartTime }} - + + + 服务评级 + + + + + + + + + + + + + + + + + + + + +
+ +
+
- - -
+ + + + + + - -
+ + +
+ + + + + + + + + diff --git a/src/app/routes/usercenter/components/driver/detail/detail.component.spec.ts b/src/app/routes/usercenter/components/driver/detail/detail.component.spec.ts index 00666a0b..c2215295 100644 --- a/src/app/routes/usercenter/components/driver/detail/detail.component.spec.ts +++ b/src/app/routes/usercenter/components/driver/detail/detail.component.spec.ts @@ -7,20 +7,20 @@ * @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\list\detail\detail.component.spec.ts */ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { FreightComponentsListDetailComponent } from './detail.component'; +import { UserCenterComponentsDriverDetailComponent } from './detail.component'; -describe('FreightComponentsListDetailComponent', () => { - let component: FreightComponentsListDetailComponent; - let fixture: ComponentFixture; +describe('UserCenterComponentsDriverDetailComponent', () => { + let component: UserCenterComponentsDriverDetailComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [FreightComponentsListDetailComponent], + declarations: [UserCenterComponentsDriverDetailComponent], }).compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(FreightComponentsListDetailComponent); + fixture = TestBed.createComponent(UserCenterComponentsDriverDetailComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/routes/usercenter/components/driver/detail/detail.component.ts b/src/app/routes/usercenter/components/driver/detail/detail.component.ts index 809f567f..400db1e1 100644 --- a/src/app/routes/usercenter/components/driver/detail/detail.component.ts +++ b/src/app/routes/usercenter/components/driver/detail/detail.component.ts @@ -1,30 +1,33 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { STColumn, STComponent } from '@delon/abc/st'; -import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFTagWidgetSchema, SFTextWidgetSchema, SFUISchema } from '@delon/form'; import { ModalHelper, _HttpClient } from '@delon/theme'; import { NzMessageService } from 'ng-zorro-antd/message'; -import { UsermanageService } from '../../../../services/usercenter.service'; +import { UsermanageService } from '../../../services/usercenter.service'; @Component({ - selector: 'app-supplier-components-list-view', + selector: 'app-usercenter-components-driver-detail', templateUrl: './detail.component.html', styleUrls: ['./detail.component.less'], }) -export class FreightComponentsListDetailComponent implements OnInit { +export class UserCenterComponentsDriverDetailComponent implements OnInit { i: any; url = `/rule?_allow_anonymous=true`; @ViewChild('st', { static: false }) st!: STComponent; detailData: any; isShow = false; isVisible = false; + isVisibleNo = false; modalTitle = '有效期'; modalName = ''; ui!: SFUISchema; schema!: SFSchema; + ui2!: SFUISchema; + schema2!: SFSchema; @ViewChild('sf', { static: false }) sf!: SFComponent; schema1!: SFSchema; - @ViewChild('sf1', { static: false }) sf1!: SFComponent; + @ViewChild('sf2', { static: false }) sf2!: SFComponent; validData: any = ['suppliersType']; suppliersData: any = {}; @@ -41,7 +44,7 @@ export class FreightComponentsListDetailComponent implements OnInit { console.log(this.route.snapshot); // this.initData(); this.initSF(); - this.initSF1(); + this.initSFNo(); // this.launchSign(); } /** @@ -65,44 +68,36 @@ export class FreightComponentsListDetailComponent implements OnInit { }; this.ui = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; } - initSF1() { - this.schema1 = { + initSFNo() { + this.schema2 = { properties: { - _$expand: { type: 'boolean', ui: { hidden: true } }, - suppliersType: { + '姓名': { type: 'number', ui: { widget: 'text', defaultText: '深圳市星链供应链云科技有限公' } as SFTextWidgetSchema }, + roleDescription: { + title: '备注', type: 'string', - title: '类型', - enum: [ - { label: '非外部供应商', value: 0 }, - { label: '外部供应商', value: 1 }, - ], - default: '', + maxLength: 30, ui: { - widget: 'select', - change: (args: any) => { - console.log(args, 'args'); - this.suppliersData.suppliersType = args; - if (args === 1) { - this.validData = ['suppliersType', 'externalSuppliersId']; - } else { - this.validData = ['suppliersType']; - this.suppliersData.externalSuppliersId = ''; - } - this.initSF1(); - }, + placeholder: '请输入地址', + widget: 'textarea', }, }, - externalSuppliersId: { - title: '外部供应商id', - type: 'string', - default: '', + like: { + type: 'number', + title: '可选理由', + enum: [ + { value: 1, label: '电影' }, + { value: 2, label: '书' }, + { value: 3, label: '旅行' }, + ], ui: { - visibleIf: { suppliersType: (value: any) => value === 1 }, - }, + widget: 'tag', + } as SFTagWidgetSchema, + default: [1, 2], }, }, - required: this.validData, + required: ['roleDescription'], }; + this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; } showModal(name: any) { this.modalName = name; @@ -221,35 +216,45 @@ export class FreightComponentsListDetailComponent implements OnInit { } handleCancel(name: any) { - if (name === 'effectiveDate') { - this.isShow = false; + if (name === 'suppliersTypeNo') { + this.isVisibleNo = false; } else { this.isVisible = false; } } - handleOK(name: any) { + handleOK() { const params: any = { tenantId: this.route.snapshot.params.id, // tenantId: this.route.snapshot.queryParams.tenantId, }; - if (name === 'effectiveDate') { - params.effectiveDate = this.sf?.value?.effectiveDate; - } else { - Object.assign(params, this.sf1?.value); - } - this.service.http.post(this.service.$api_set_freezeOrResume, params).subscribe((res) => { - if (res.data === true) { - this.service.msgSrv.success(`编辑成功!`); - this.ngOnInit(); - } else { - this.service.msgSrv.error(res.msg || '编辑失败!'); - } - if (name === 'effectiveDate') { - this.isShow = false; - } else { - this.isVisible = false; - } - }); + // if (name === 'effectiveDate') { + // params.effectiveDate = this.sf?.value?.effectiveDate; + // } else { + // Object.assign(params, this.sf1?.value); + // } + // this.service.http.post(this.service.$api_set_freezeOrResume, params).subscribe((res) => { + // if (res.data === true) { + // this.service.msgSrv.success(`编辑成功!`); + // this.ngOnInit(); + // } else { + // this.service.msgSrv.error(res.msg || '编辑失败!'); + // } + // if (name === 'effectiveDate') { + // this.isShow = false; + // } else { + // this.isVisible = false; + // } + // }); } + auditPass() { + this.isVisible = true + } + auditNo() { + this.isVisibleNo = true + } + ratify() { + + } + } diff --git a/src/app/routes/usercenter/components/driver/driver.component.html b/src/app/routes/usercenter/components/driver/driver.component.html index fcb84ee1..76715051 100644 --- a/src/app/routes/usercenter/components/driver/driver.component.html +++ b/src/app/routes/usercenter/components/driver/driver.component.html @@ -1,7 +1,7 @@ - - - - - - - - - - - -

道路运输经营许可证

- -
- - -
-
-
- - diff --git a/src/app/routes/usercenter/components/driver/view/view.component.less b/src/app/routes/usercenter/components/driver/view/view.component.less deleted file mode 100644 index 48f605d9..00000000 --- a/src/app/routes/usercenter/components/driver/view/view.component.less +++ /dev/null @@ -1,46 +0,0 @@ -@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; - } - - .warning { - color: @warning-color; - } - - .error { - color: @error-color; - } - } - .mt16 { - margin-top: 16px; - } - .user-info { - display: flex; - 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; - } - } -} diff --git a/src/app/routes/usercenter/components/driver/view/view.component.spec.ts b/src/app/routes/usercenter/components/driver/view/view.component.spec.ts deleted file mode 100644 index 6e2a7782..00000000 --- a/src/app/routes/usercenter/components/driver/view/view.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { FreightComponentsListViewComponent } from './view.component'; - -describe('FreightComponentsListViewComponent', () => { - let component: FreightComponentsListViewComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [FreightComponentsListViewComponent], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(FreightComponentsListViewComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/routes/usercenter/components/driver/view/view.component.ts b/src/app/routes/usercenter/components/driver/view/view.component.ts deleted file mode 100644 index f72bb40a..00000000 --- a/src/app/routes/usercenter/components/driver/view/view.component.ts +++ /dev/null @@ -1,257 +0,0 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -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 } from '@delon/form'; -import { Observable, Observer } from 'rxjs'; -@Component({ - selector: 'app-Freight-components-list-view', - templateUrl: './view.component.html', - styleUrls: ['./view.component.less'], -}) -export class FreightComponentsListViewComponent implements OnInit { - i: any; - url = `/rule?_allow_anonymous=true`; - - @ViewChild('st', { static: false }) st!: STComponent; - detailData: any = { - status: 0 - }; - isShow = false; - isVisible = false; - modalTitle = '有效期'; - modalName = ''; - ui!: SFUISchema; - schema!: SFSchema; - @ViewChild('sf', { static: false }) sf!: SFComponent; - @ViewChild('sf1', { static: false }) sf1!: SFComponent; - validData: any = ['FreightsType']; - FreightsData: any = {}; - - constructor( - private http: _HttpClient, - private modal: ModalHelper, - public service: UsermanageService, - private route: ActivatedRoute, - private modalHelper: ModalHelper, - private msgSrv: NzMessageService, - ) {} - - ngOnInit() { - console.log(this.route.snapshot); - this.initData(); - this.initSF(); - // this.launchSign(); - } - /** - * 初始化查询表单 - */ - initSF() { - this.schema = { - properties: { - name: { - title: '许可证号', - type: 'string', - maxLength: 20, - ui: { - placeholder: '请输入角色名称', - }, - }, - phone: { - title: '业户名称', - type: 'string', - maxLength: 20, - ui: { - placeholder: '请输入业户名称', - }, - }, - roleDescription: { - title: '地址', - type: 'string', - maxLength: 30, - ui: { - placeholder: '请输入地址', - widget: 'textarea', - }, - }, - effectiveDate: { - title: '发证日期', - type: 'string', - ui: { - widget: 'date', - format: 'yyyy-MM-dd 00:00:00', - // hidden: this.modalName === 'effectiveDate' ? false : true, - } as SFDateWidgetSchema, - }, - phone3: { - title: '有效期', - type: 'string', - ui: { - placeholder: '请输入业户名称', - }, - }, - phone4: { - title: '有效期截止', - type: 'string', - ui: { - placeholder: '请输入业户名称', - }, - }, - phone5: { - title: '经营范围', - type: 'string', - ui: { - placeholder: '请输入业户名称', - }, - }, - avatar: { - type: 'string', - title: '证照', - ui: { - // action: environment.UPLOAD_URL, - fileType: 'image/png,image/jpeg,image/jpg,image/png,image/gif,image/bmp', - limit: 1, - limitFileCount: 1, - resReName: 'url', - urlReName: 'url', - widget: 'upload', - descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', - data: { - // appId: environment.appId, - }, - name: 'multipartFile', - multiple: false, - listType: 'picture-card', - change: (args) => { - if (args.type === 'success') { - const avatar = [ - { - uid: -1, - name: 'LOGO', - status: 'done', - url: args.fileList[0].response.url, - response: { - url: args.fileList[0].response.url, - }, - }, - ]; - this.sf?.setValue('/avatar', avatar); - } - }, - beforeUpload: (file: any, _fileList) => { - return new Observable((observer: Observer) => { - const isLt2M = file.size / 1024 / 1024 < 5; - if (!isLt2M) { - this.service.msgSrv.warning('图片大小超过5M!'); - observer.complete(); - return; - } - observer.next(isLt2M); - observer.complete(); - }); - }, - } as SFUploadWidgetSchema, - }, - }, - required: ['name', 'phone'], - }; - this.ui = { '*': { spanLabelFixed: 200, grid: {offset:4, span: 12 } } }; - } - showModal(name: any) { - this.modalName = name; - if (name === 'effectiveDate') { - this.isShow = true; - } else { - this.isVisible = true; - } - } - async initData() { - console.log(this.route.snapshot, 'this.route.snapshot'); - - const params = { - tenantId: this.route.snapshot.params.id, - }; - } - - /** - * 根据地区code查询地区详情 - * @param code 地区代码 - */ - async getRegionFullName(code: any) { - const params = { - regionCode: code, - }; - const res = await this.service.asyncRequest(this.service.$api_get_region_detailByCode, params, 'POST', true); - // if (res && res.regionFullName) { - // const arr = res.regionFullName.split(','); - // res.regionFullName = arr.reverse().join('-'); - // } - return res && res.regionFullName; - } - add() { - // this.modal - // .createStatic(FormEditComponent, { i: { id: 0 } }) - // .subscribe(() => this.st.reload()); - } - goBack() { - window.history.go(-1); - } - /** - * 冻结 - */ - freezeOrResume(type: number) { - this.service.http - .post(this.service.$api_set_freezeOrResume, { - tenantId: this.route.snapshot.params.id, - // tenantId: this.route.snapshot.queryParams.tenantId, - status: type, - }) - .subscribe((res) => { - if (res.data === true) { - if (type === 0) { - this.service.msgSrv.success(`启用成功!`); - } else if (type === 1) { - this.service.msgSrv.success(`冻结成功!`); - } - this.ngOnInit(); - } else { - this.service.msgSrv.error(res.msg || '操作失败!'); - } - }); - } - - handleCancel(name: any) { - if (name === 'effectiveDate') { - this.isShow = false; - } else { - this.isVisible = false; - } - } - handleOK(name: any) { - const params: any = { - tenantId: this.route.snapshot.params.id, - // tenantId: this.route.snapshot.queryParams.tenantId, - }; - - if (name === 'effectiveDate') { - params.effectiveDate = this.sf?.value?.effectiveDate; - } else { - Object.assign(params, this.sf1?.value); - } - this.service.http.post(this.service.$api_set_freezeOrResume, params).subscribe((res) => { - if (res.data === true) { - this.service.msgSrv.success(`编辑成功!`); - this.ngOnInit(); - } else { - this.service.msgSrv.error(res.msg || '编辑失败!'); - } - if (name === 'effectiveDate') { - this.isShow = false; - } else { - this.isVisible = false; - } - }); - } -} diff --git a/src/app/routes/usercenter/usercenter-routing.module.ts b/src/app/routes/usercenter/usercenter-routing.module.ts index 6fc28071..0b4a70fb 100644 --- a/src/app/routes/usercenter/usercenter-routing.module.ts +++ b/src/app/routes/usercenter/usercenter-routing.module.ts @@ -1,13 +1,15 @@ /* * @Author: your name * @Date: 2021-11-29 15:22:34 - * @LastEditTime: 2021-11-30 17:00:50 + * @LastEditTime: 2021-11-30 20:36:06 * @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\usercenter-routing.module.ts */ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +import { UserCenterComponentsDriverCaptainComponent } from './components/driver/captain/captain.component'; +import { UserCenterComponentsDriverDetailComponent } from './components/driver/detail/detail.component'; import { UserCenterComponentsDriverComponent } from './components/driver/driver.component'; import { FreightComponentsEnterpriseAuditComponent } from './components/freight/enterprise-audit/enterprise-audit.component'; import { FreightComponentsEnterpriseAuditViewComponent } from './components/freight/enterprise-audit/view/view.component'; @@ -31,6 +33,8 @@ const routes: Routes = [ { path: 'freight/user', component: FreightComponentsUserComponent }, { path: 'freight/user/view/:id', component: FreightComponentsUserDetailComponent }, { path: 'driver', component: UserCenterComponentsDriverComponent }, + { path: 'driver/detail/:id', component: UserCenterComponentsDriverDetailComponent }, + { path: 'driver/captain', component: UserCenterComponentsDriverCaptainComponent }, ]; @NgModule({ diff --git a/src/app/routes/usercenter/usercenter.module.ts b/src/app/routes/usercenter/usercenter.module.ts index 197f6ff1..294a49c2 100644 --- a/src/app/routes/usercenter/usercenter.module.ts +++ b/src/app/routes/usercenter/usercenter.module.ts @@ -1,13 +1,15 @@ /* * @Author: your name * @Date: 2021-11-29 15:22:34 - * @LastEditTime: 2021-11-30 17:00:19 + * @LastEditTime: 2021-11-30 20:35:42 * @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\usercenter.module.ts */ import { NgModule } from '@angular/core'; import { SharedModule } from '@shared'; +import { UserCenterComponentsDriverCaptainComponent } from './components/driver/captain/captain.component'; +import { UserCenterComponentsDriverDetailComponent } from './components/driver/detail/detail.component'; import { UserCenterComponentsDriverComponent } from './components/driver/driver.component'; import { FreightComponentsEnterpriseAuditComponent } from './components/freight/enterprise-audit/enterprise-audit.component'; import { FreightComponentsEnterpriseAuditViewComponent } from './components/freight/enterprise-audit/view/view.component'; @@ -28,7 +30,9 @@ const COMPONENTS = [ FreightComponentsEnterpriseAuditViewComponent, FreightComponentsUserComponent, FreightComponentsUserDetailComponent, - UserCenterComponentsDriverComponent + UserCenterComponentsDriverComponent, + UserCenterComponentsDriverDetailComponent, + UserCenterComponentsDriverCaptainComponent ]; @NgModule({ diff --git a/src/assets/mocks/menu-data.json b/src/assets/mocks/menu-data.json index d7efcf70..e556252b 100644 --- a/src/assets/mocks/menu-data.json +++ b/src/assets/mocks/menu-data.json @@ -86,6 +86,17 @@ "text": "司机列表", "icon": "anticon anticon-dashboard", "link": "/usercenter/driver" + }, + { + "text": "司机详情", + "hide": true, + "icon": "anticon anticon-dashboard", + "link": "/usercenter/driver/detail/:id" + }, + { + "text": "车队长列表", + "icon": "anticon anticon-dashboard", + "link": "/usercenter/driver/captain" } ] }]