diff --git a/src/app/core/startup/startup.service.ts b/src/app/core/startup/startup.service.ts index b6c0d1dc..9b95436e 100644 --- a/src/app/core/startup/startup.service.ts +++ b/src/app/core/startup/startup.service.ts @@ -95,7 +95,9 @@ export class StartupService { // ACL:设置权限为全量 this.aclService.setFull(false); // 初始化菜单 - this.menuService.add(menuData); + if(menuData){ + this.menuService.add(menuData); + } // 设置页面标题的后缀 this.titleService.default = ''; this.titleService.suffix = appData.name; diff --git a/src/app/routes/financial-management/components/withdrawals-record/withdrawals-record.component.ts b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-record.component.ts index aef18902..f4ed8074 100644 --- a/src/app/routes/financial-management/components/withdrawals-record/withdrawals-record.component.ts +++ b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-record.component.ts @@ -80,6 +80,10 @@ export class WithdrawalsRecordComponent implements OnInit { label: '拒绝', type: 'default', onClick: () => { + if (!this.msg) { + this.service.msgSrv.warning('请填写拒绝原因 '); + return false; + } this.service .request(this.service.$api_disagree_refund, { refundApplicationId: params, @@ -92,6 +96,7 @@ export class WithdrawalsRecordComponent implements OnInit { this.st.load(1); } }); + return false; } }, { @@ -110,6 +115,7 @@ export class WithdrawalsRecordComponent implements OnInit { this.st.load(1); } }); + return false; } } ] @@ -258,7 +264,7 @@ export class WithdrawalsRecordComponent implements OnInit { { title: '提现银行账户', render: 'bankCardNumber', width: 180 }, { title: '提现状态', index: 'refundStatusLabel', width: 100 }, { title: '银行流水号', index: 'bankSerialNumber', width: 120 }, - { title: '核心交易流水', index: 'coreSerNo', width: 120 }, + { title: '核心交易流水', index: 'coreSerNo', width: 130 }, { title: '失败原因', index: 'rejectionCause', width: 150, format: item => item.failCause || item.rejectionCause }, { title: '操作', diff --git a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html index 64a832c1..fdf3e863 100644 --- a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html +++ b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html @@ -11,40 +11,62 @@ -
-
- -
-
- - - - -
+
+
+
+
+ + + + +
+
- - - +
+ + +
+ 已选择 + {{ selectedRows.length }} 条数据 + 清空 +
+
+ + +
+ + +
+
+ + + + + +
+
+
+ + +
+
+ + + + + +
+
+
\ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts index 24a3af95..bc94a1e2 100644 --- a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts +++ b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; -import { STColumn, STComponent, STRequestOptions, STData } from '@delon/abc/st'; +import { STColumn, STComponent, STRequestOptions, STData, STChange } from '@delon/abc/st'; import { SFUISchema, SFSchema, SFComponent, SFDateWidgetSchema } from '@delon/form'; import { ShipperBaseService, DynamicSettingModalComponent } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; @@ -10,34 +10,60 @@ import { UsermanageService } from '../../../services/usercenter.service'; @Component({ selector: 'app-freight-config', templateUrl: './freight-config.component.html', - styleUrls: ['../../../../commom/less/box.less'] + styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/expend-but.less'] }) export class FreightConfigComponent implements OnInit { schema: SFSchema = this.initSF(); columns: STColumn[] = this.initST(); @ViewChild('st', { static: false }) st!: STComponent; @ViewChild('sf', { static: false }) sf!: SFComponent; + selectedRows: any[] = []; + + @ViewChild('IWModal', { static: false }) + IWModal!: any; + @ViewChild('roleModal', { static: false }) + roleModal!: any; + ltdId: any = []; + roles: any = []; + networkTransporter = null; + roleId = null; _$expand = false; constructor(public service: UsermanageService, private modal: NzModalService, public shipperservice: ShipperBaseService) {} ngOnInit() { this.initST(); + this.loadltdId(); + this.loadRoles(); } beforeReq = (requestOptions: STRequestOptions) => { Object.assign(requestOptions.body, { listSource: 1 }); - if (this.sf) { + console.log(1); + + if (this.sf?.value) { Object.assign(requestOptions.body, { - ...this.sf.value, - createTime: { - start: this.sf?.value.effectiveDate[0], - end: this.sf?.value.effectiveDate[1] - } + ...this.sf.value }); + if (this.sf?.value.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf?.value.createTime[0], + end: this.sf?.value.createTime[1] + } + }); + } } return requestOptions; }; + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + settingAction(item?: any) { const modal = this.modal.create({ nzTitle: '配置', @@ -48,20 +74,20 @@ export class FreightConfigComponent implements OnInit { businessId: item.id, formatTypeList: (item: any[]) => [ ...item, - // { - // name: '权限配置', - // items: [ - // { - // configType: 1, - // itemType: 999 - // } - // ] - // }, { - name: '费率变更记录', + name: '权限配置', + configType: 1, + items: [ + { + itemType: 999 + } + ] + }, + { + name: '费率变更记录', + configType: 2, items: [ { - configType: 2, itemType: 999 } ] @@ -77,6 +103,68 @@ export class FreightConfigComponent implements OnInit { }); } + editRoleBatch() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择企业'); + return; + } + this.roleId = null; + const modal = this.modal.create({ + nzTitle: '修改角色', + nzContent: this.roleModal, + nzOnOk: () => { + if (!this.roleId) { + return false; + } + this.service + .request(this.service.$api_update_enter_role_batch, { + enterpriseIdList: this.selectedRows.map(i => i.id), + roleId: this.roleId + }) + .subscribe((res: Array) => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.st.load(1); + modal.destroy(); + } + }); + return false; + } + }); + } + + editIWBatch() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择企业'); + return; + } + this.networkTransporter = null; + const modal = this.modal.create({ + nzTitle: '修改网络货运人', + nzContent: this.IWModal, + nzOnOk: () => { + if (!this.networkTransporter) { + return false; + } + this.service + .request(this.service.$api_update_enter_newowork_batch, { + enterpriseIdList: this.selectedRows.map(i => i.id), + networkTransporterId: this.networkTransporter + }) + .subscribe((res: Array) => { + if (res && res.length === 0) { + this.service.msgSrv.success('修改成功'); + this.st.load(1); + modal.destroy(); + } else { + this.service.msgSrv.error(`企业${res?.join(',')}修改失败`); + } + }); + return false; + } + }); + } + exportList() { const params = {}; if (this.sf) { @@ -86,10 +174,25 @@ export class FreightConfigComponent implements OnInit { } this.service.downloadFile(this.service.$api_export_enterprise, params); } + loadltdId() { + this.service.getNetworkFreightForwarder().subscribe(res => { + if (res) { + this.ltdId = res; + } + }); + } + loadRoles() { + this.service.getRoles({ enterpriseId: 0, projectId: 0 }).subscribe(res => { + if (res) { + this.roles = res; + } + }); + } + /** * 伸缩查询条件 */ - expandToggle(): void { + expandToggle(): void { this._$expand = !this._$expand; this.sf?.setValue('/_$expand', this._$expand); } @@ -139,28 +242,29 @@ export class FreightConfigComponent implements OnInit { showRequired: false, visibleIf: { _$expand: (value: boolean) => value - }, + } } }, - effectiveDate: { + createTime: { title: '注册时间', type: 'string', ui: { - widget: 'date', - mode: 'range', + widget: 'sl-from-to-search', format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, visibleIf: { - _$expand: (value: boolean) => value, - }, - allowClear: true, - } as SFDateWidgetSchema, - }, + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } } }; } initST(): STColumn[] { return [ + { title: '', index: 'key', type: 'checkbox' }, { title: '企业名称', className: 'text-center', index: 'enterpriseName', width: 350 }, { title: '网络货运人', className: 'text-center', index: 'netTranName', width: 160 }, { @@ -180,7 +284,7 @@ export class FreightConfigComponent implements OnInit { { title: '合同单业务量(元)', index: 'contractQuota', - width: 140, + width: 160, type: 'widget', className: 'text-right', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.contractQuota }) } @@ -188,7 +292,7 @@ export class FreightConfigComponent implements OnInit { { title: '货源单业务量(元)', index: 'goodsQuota', - width: 140, + width: 160, type: 'widget', className: 'text-right', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.goodsQuota }) } @@ -197,7 +301,7 @@ export class FreightConfigComponent implements OnInit { title: '注册时间', index: 'createTime', width: 180, - className: 'text-right', + className: 'text-right' }, { title: '操作', 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 bd30936e..3247d6c7 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 @@ -123,6 +123,9 @@ +

四要素验证:

+
+ + + + + +
+
+
+
+ +
+
\ No newline at end of file diff --git a/src/app/shared/components/dynamic-setting/enter-auth/enter-auth.component.ts b/src/app/shared/components/dynamic-setting/enter-auth/enter-auth.component.ts new file mode 100644 index 00000000..3abd1598 --- /dev/null +++ b/src/app/shared/components/dynamic-setting/enter-auth/enter-auth.component.ts @@ -0,0 +1,52 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { ShipperBaseService } from 'src/app/shared/services/business/shipper-base.service'; + +@Component({ + selector: 'app-enter-auth', + templateUrl: './enter-auth.component.html' +}) +export class EnterAuthComponent implements OnInit { + @Input() + enterpriseId = ''; + @Input() + roleId = ''; + + roles: any[] = []; + + constructor(private service: ShipperBaseService, private modalHelp: NzModalRef) { + this.loadRoles(); + } + + ngOnInit(): void { + console.log(this.enterpriseId); + + this.loadEnterRole(); + } + + loadEnterRole() { + this.service.request('/api/mdc/cuc/enterpriseInfo/operate/getRole', { enterpriseId: this.enterpriseId }).subscribe(res => { + if (res) { + this.roleId = res.roleId; + } + }); + } + loadRoles() { + this.service.getRoles({ enterpriseId: 0, projectId: 0 }).subscribe(res => { + if (res) { + this.roles = res; + } + }); + } + + saveAction() { + this.service + .request('/api/mdc/cuc/enterpriseInfo/operate/updateRole', { enterpriseIdList: [this.enterpriseId], roleId: this.roleId }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.modalHelp.destroy(true); + } + }); + } +}