diff --git a/proxy.conf.js b/proxy.conf.js index 2e5e2a0e..4bbb04a9 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -20,7 +20,7 @@ module.exports = { // } '//api': { target: { - host: 'tms-api-test.eascs.com', + host: 'tms-api-dev.eascs.com', protocol: 'https:', port: 443 }, diff --git a/src/app/core/guards/auth.guard.ts b/src/app/core/guards/auth.guard.ts index 89c471f8..b5a30a58 100644 --- a/src/app/core/guards/auth.guard.ts +++ b/src/app/core/guards/auth.guard.ts @@ -30,7 +30,7 @@ export class AuthGuard extends ACLGuard { } canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { - if (childRoute.routeConfig?.loadChildren) { + if (childRoute.routeConfig?.loadChildren || childRoute.routeConfig?.children) { return super.canActivateChild(childRoute, state); } else { return this.handle(childRoute, state, 2, this.settingRoute(childRoute.params, state.url)); diff --git a/src/app/core/startup/startup.service.ts b/src/app/core/startup/startup.service.ts index 4b746335..09809bb4 100644 --- a/src/app/core/startup/startup.service.ts +++ b/src/app/core/startup/startup.service.ts @@ -137,12 +137,12 @@ export class StartupService { const userData = this.httpClient.post(this.userSrv.$api_get_user_by_token, {}).pipe(map((res: any) => res.data)); // 菜单数据 - const menuData = this.httpClient - .post(this.coreSrv.$api_get_current_user_menus, { - appId: this.coreSrv.envSrv.getEnvironment().appId - }) - .pipe(map((res: any) => res.data)); - // const menuData = this.httpClient.get('assets/mocks/menu-data.json').pipe(map((res: any) => res.data.menu)); + // const menuData = this.httpClient + // .post(this.coreSrv.$api_get_current_user_menus, { + // appId: this.coreSrv.envSrv.getEnvironment().appId + // }) + // .pipe(map((res: any) => res.data)); + const menuData = this.httpClient.get('assets/mocks/menu-data.json').pipe(map((res: any) => res.data.menu)); return zip(appData, userData, menuData); } diff --git a/src/app/global-config.module.ts b/src/app/global-config.module.ts index 48af1e9f..856aede2 100644 --- a/src/app/global-config.module.ts +++ b/src/app/global-config.module.ts @@ -17,10 +17,17 @@ const alainConfig: AlainConfig = { page: { show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000], toTop: false }, modal: { size: 'lg' } }, - sf: { button: { search: '查询' } }, + sf: { button: { search: '查询' }, ui: { placeholder: '请输入' } }, pageHeader: { homeI18n: 'home', recursiveBreadcrumb: true }, auth: { login_url: '/passport/login' }, - acl: { guard_url: '/exception/403' } + acl: { guard_url: '/exception/403' }, + chart: { + // 以下是默认配置,如果项目无法外网访问,可以根据 `angular.json` 配置将依赖包直接使用 `./assets***` 路径 + libs: [ + 'https://gw.alipayobjects.com/os/lib/antv/g2/4.1.4/dist/g2.min.js', + 'https://gw.alipayobjects.com/os/lib/antv/data-set/0.11.7/dist/data-set.js' + ] + } }; const alainModules = [AlainThemeModule.forRoot(), DelonACLModule.forRoot()]; diff --git a/src/app/routes/contract-management/components/contract-list/contract-list.component.ts b/src/app/routes/contract-management/components/contract-list/contract-list.component.ts index 69937f22..8e0fb1f9 100644 --- a/src/app/routes/contract-management/components/contract-list/contract-list.component.ts +++ b/src/app/routes/contract-management/components/contract-list/contract-list.component.ts @@ -28,17 +28,17 @@ export class ContractManagementContractListComponent implements OnInit { /** * 查询参数 */ - get reqParams() { + get reqParams() { const params = { ...this.sf?.value, } delete params.signTime; delete params._$expand; - if(this.datePipe.transform(this.sf?.value?.signTime?.[0], 'yyyy-MM-dd HH:mm:ss') && this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss')) { + if (this.datePipe.transform(this.sf?.value?.signTime?.[0], 'yyyy-MM-dd HH:mm:ss') && this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss')) { params.signTime = { start: this.datePipe.transform(this.sf?.value?.signTime?.[0], 'yyyy-MM-dd HH:mm:ss'), end: this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss'), - } + } } return { ...params @@ -51,7 +51,7 @@ export class ContractManagementContractListComponent implements OnInit { public shipperservice: ShipperBaseService, private router: Router, private datePipe: DatePipe, - ) {} + ) { } ngOnInit(): void { this.initST() @@ -60,7 +60,7 @@ export class ContractManagementContractListComponent implements OnInit { /** * 初始化数据列表 */ - initST() { + initST() { this.columns = [ { title: '合同编号', @@ -72,27 +72,13 @@ export class ContractManagementContractListComponent implements OnInit { title: '签约对象', width: '100px', className: 'text-center', - index:'signingObject' + index: 'documentType' }, { title: '合同类型', width: '100px', className: 'text-center', - index:'contractType' - }, - { - title: '货源类型', - width: '100px', - className: 'text-center', - index:'resourceType' - }, - { title: '合同名称', index: 'contractName', width: '120px', className: 'text-center' }, - { title: '网络货运人', index: 'enterpriseInfoName', width: '120px', className: 'text-center' }, - { - title: '合同对象', - className: 'text-center', - width: '120px', - index: 'contractObjectName' + index: 'contractName' }, { title: '业务单号', @@ -122,119 +108,69 @@ export class ContractManagementContractListComponent implements OnInit { '7': { text: '已拒签', color: 'warning' }, }, }, - + ]; } - /** - * 初始化查询表单 - */ - initSF() { - this.schema = { - properties: { - _$expand: { type: 'boolean', ui: { hidden: true } }, - contractCode: { - type: 'string', - title: '合同编号', - }, - businessCode: { - type: 'string', - title: '业务单号' - }, - signingObject: { - type: 'string', - title: '签约对象', - enum: [ - { label: '全部', value: '' }, - { label: '货主', value: 1 }, - { label: '司机', value: 2 }, - ], - ui: { - widget: 'select', - placeholder: '请选择', - } - }, - contractType: { - title: '合同类型', - type: 'string', - default: '', - ui: { - widget: 'dict-select', - containsAllLable: true, - params: { dictKey: 'contract:type' }, - containAllLable:true, - visibleIf: { - _$expand: (value: boolean) => value, - }, - } as SFSelectWidgetSchema, - }, - resourceType: { - title: '货源类型', - type: 'string', - default: '', - ui: { - widget: 'dict-select', - containsAllLable: true, - params: { dictKey: 'goodresource:type' }, - containAllLable:true, - visibleIf: { - _$expand: (value: boolean) => value, - }, - } as SFSelectWidgetSchema, - }, - enterpriseInfoId: { - type: 'string', - title: '网络货运人', - ui: { - widget: 'select', - placeholder: '请选择', - allowClear: true, - visibleIf: { - _$expand: (value: boolean) => value - }, - asyncData: () => this.shipperservice.getNetworkFreightForwarder() - } - }, - contractObjectName: { - type: 'string', - title: '合同对象', - ui: { - visibleIf: { - _$expand: (value: boolean) => value, - }, - } - }, - signTime: { - title: '签署日期', - type: 'string', - ui: { - widget: 'custom', - visibleIf: { - _$expand: (value: boolean) => value, - }, - } - }, - esignFlowStatus: { - title: '状态', - type: 'string', - default: '', - ui: { - widget: 'dict-select', - containsAllLable: true, - params: { dictKey: 'esign:flow:status' }, - containAllLable:true, - visibleIf: { - _$expand: (value: boolean) => value, - }, - } as SFSelectWidgetSchema, - }, + /** +* 初始化查询表单 +*/ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + contractCode: { + type: 'string', + title: '合同编号', }, - type: 'object', - }; - this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; - } - /** - * 查询字段个数 - */ + businessCode: { + type: 'string', + title: '业务单号' + }, + shipperName: { + type: 'string', + title: '托运人' + }, + carrierName: { + type: 'string', + title: '承运人', + ui: { + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + documentType: { + title: '单据类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'contract:document:type' }, + containAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFSelectWidgetSchema, + }, + signTime: { + title: '签署日期', + type: 'string', + ui: { + widget: 'custom', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + }, + type: 'object', + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + /** +* 查询字段个数 +*/ get queryFieldCount(): number { return Object.keys(this.schema?.properties || {}).length; } @@ -303,7 +239,7 @@ export class ContractManagementContractListComponent implements OnInit { /** * 伸缩查询条件 */ - expandToggle(): void { + expandToggle(): void { this._$expand = !this._$expand; this.sf?.setValue('/_$expand', this._$expand); } diff --git a/src/app/routes/contract-management/components/contract-template/contract-template.component.ts b/src/app/routes/contract-management/components/contract-template/contract-template.component.ts index 1da3c546..ae85bfd6 100644 --- a/src/app/routes/contract-management/components/contract-template/contract-template.component.ts +++ b/src/app/routes/contract-management/components/contract-template/contract-template.component.ts @@ -26,23 +26,23 @@ export class ContractManagementTemplateDetailComponent implements OnInit { columns: STColumn[] = []; datass: any = [ { - one: '1', - two: '1', - three: '1', - id: 1 - }, + one: '1', + two: '1', + three: '1', + id: 1 + }, { - one: '2', - two: '2', - three: '2', - id: 2 - }, -]; + one: '2', + two: '2', + three: '2', + id: 2 + }, + ]; constructor( public service: ContractManagementService, private modal: NzModalService, private router: Router - ) { } + ) { } /** * 查询参数 diff --git a/src/app/routes/financial-management/components/payment-order/payment-order.component.ts b/src/app/routes/financial-management/components/payment-order/payment-order.component.ts index b061cfc1..7287c7bb 100644 --- a/src/app/routes/financial-management/components/payment-order/payment-order.component.ts +++ b/src/app/routes/financial-management/components/payment-order/payment-order.component.ts @@ -23,26 +23,26 @@ export class PaymentOrderComponent implements OnInit { _$expand = false; selectedRows: any[] = []; - constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) { } - ngOnInit(): void {} + ngOnInit(): void { } beforeReq = (requestOptions: STRequestOptions) => { if (this.sf) { - let params = {...this.sf.value}; - if(params.payDate){ - const payDate = {start:this.sf?.value?.payDate?.[0],end:this.sf?.value?.payDate?.[1]} - params.payDate = payDate; + let params = { ...this.sf.value }; + if (params.payDate) { + const payDate = { start: this.sf?.value?.payDate?.[0], end: this.sf?.value?.payDate?.[1] } + params.payDate = payDate; } - if(params.payDate2){ - const payDate2 = {start:this.sf?.value?.payDate2?.[0],end:this.sf?.value?.payDate2?.[1]} - params.payDate2 = payDate2; + if (params.payDate2) { + const payDate2 = { start: this.sf?.value?.payDate2?.[0], end: this.sf?.value?.payDate2?.[1] } + params.payDate2 = payDate2; } - if(params.createTime){ - const createTime = {start:this.sf?.value?.createTime?.[0],end:this.sf?.value?.createTime?.[1]} - params.createTime = createTime; + if (params.createTime) { + const createTime = { start: this.sf?.value?.createTime?.[0], end: this.sf?.value?.createTime?.[1] } + params.createTime = createTime; } - Object.assign(requestOptions.body,params ); + Object.assign(requestOptions.body, params); } return requestOptions; }; @@ -123,7 +123,7 @@ export class PaymentOrderComponent implements OnInit { title: '付款类型', ui: { widget: 'dict-select', - containsAllLable: true, + containsAllLabel: true, params: { dictKey: 'pay:type' }, placeholder: '请选择', } @@ -133,7 +133,7 @@ export class PaymentOrderComponent implements OnInit { title: '付款方式', ui: { widget: 'dict-select', - containsAllLable: true, + containsAllLabel: true, params: { dictKey: 'pay:mode' }, placeholder: '请选择', visibleIf: { 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 7bd05ac5..8d994f80 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 @@ -28,8 +28,9 @@ export class WithdrawalsRecordComponent { refundStatus: any = ''; msg = ''; + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) { } - constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + ngOnInit(): void { } beforeReq = (requestOptions: STRequestOptions) => { if (this.sf) { @@ -42,6 +43,7 @@ export class WithdrawalsRecordComponent { refundStatus: this.refundStatus || null }); } + delete requestOptions?.body?.expand; return requestOptions; }; @@ -81,7 +83,7 @@ export class WithdrawalsRecordComponent { disabled: () => this.service.http.loading, type: 'default', onClick: () => { - if (!this.msg) { + if (!this.msg || this.msg.trim().length === 0) { this.service.msgSrv.warning('请填写拒绝原因 '); return false; } diff --git a/src/app/routes/financial-management/services/freight-account.service.ts b/src/app/routes/financial-management/services/freight-account.service.ts index 8003fe98..4cffd46f 100644 --- a/src/app/routes/financial-management/services/freight-account.service.ts +++ b/src/app/routes/financial-management/services/freight-account.service.ts @@ -128,8 +128,8 @@ export class FreightAccountService extends ShipperBaseService { // 根据预收款ID获取核销信息明细 $api_get_advance_collection_hrxiao = '/api/fcc/ficoAhxH/getAhxHByYskblaId'; - constructor(public injector: Injector, public eaCacheSrv: EACacheService) { - super(injector, eaCacheSrv); + constructor(public injector: Injector) { + super(injector); } getReceiptUrl(url: string, params: any) { diff --git a/src/app/routes/insurance-management/components/list/list.component.ts b/src/app/routes/insurance-management/components/list/list.component.ts index bff00485..c2d73dd7 100644 --- a/src/app/routes/insurance-management/components/list/list.component.ts +++ b/src/app/routes/insurance-management/components/list/list.component.ts @@ -64,7 +64,7 @@ export class insuranceManagementListComponent implements OnInit { public shipperservice: ShipperBaseService, private router: Router, private modale: ModalHelper, - ) {} + ) { } /** * 查询参数 @@ -176,7 +176,7 @@ export class insuranceManagementListComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'insure:type' }, - containsAllLable: true, + containsAllLabel: true, visibleIf: { _$expand: (value: boolean) => value } @@ -239,7 +239,7 @@ export class insuranceManagementListComponent implements OnInit { }, } as SFSelectWidgetSchema }, - + driverName: { title: '承运司机', type: 'string', @@ -264,7 +264,7 @@ export class insuranceManagementListComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'insure:status' }, - containsAllLable: true, + containsAllLabel: true, visibleIf: { _$expand: (value: boolean) => value } @@ -334,33 +334,33 @@ export class insuranceManagementListComponent implements OnInit { } } as SFDateWidgetSchema }, - + }, type: 'object' }; this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; } - // 获取城市列表 - getRegionCode(regionCode: any) { - console.log(regionCode); - return this.service - .request(this.service.$api_get_enterprise_project, { id: regionCode }) - .pipe( - map(res => - res.map((item: any) => ({ - label: item.projectName, - value: item.id - })) - ) + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) ) - .subscribe(res => { - this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; - this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); - // if (this.enterpriseProjectIds) { - // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); - // } - }); - } + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } /** * 初始化数据列表 */ @@ -517,7 +517,7 @@ export class insuranceManagementListComponent implements OnInit { this._$expand = !this._$expand; this.sf?.setValue('/_$expand', this._$expand); } - tabChange(item: any) {} + tabChange(item: any) { } /** * 重置表单 */ @@ -557,8 +557,8 @@ export class insuranceManagementListComponent implements OnInit { } }); } - // 保险配置 - changeOrder() { - this.router.navigate(['/insurance-management/list-set', 1]); - } + // 保险配置 + changeOrder() { + this.router.navigate(['/insurance-management/list-set', 1]); + } } diff --git a/src/app/routes/insurance-management/services/insurance-management.service.ts b/src/app/routes/insurance-management/services/insurance-management.service.ts index 4dece0b2..ee65b8e3 100644 --- a/src/app/routes/insurance-management/services/insurance-management.service.ts +++ b/src/app/routes/insurance-management/services/insurance-management.service.ts @@ -30,7 +30,7 @@ export class InsuranceManagementService extends ShipperBaseService { // 退保费 $api_get_addINPBillRefundApplication = `/billRefundApplication/addINPBillRefundApplication`; - constructor(public injector: Injector, public eaCacheSrv: EACacheService) { - super(injector, eaCacheSrv); + constructor(public injector: Injector) { + super(injector); } } diff --git a/src/app/routes/order-management/components/bulk/bulk.component.ts b/src/app/routes/order-management/components/bulk/bulk.component.ts index 822a88b5..cb92206a 100644 --- a/src/app/routes/order-management/components/bulk/bulk.component.ts +++ b/src/app/routes/order-management/components/bulk/bulk.component.ts @@ -277,7 +277,7 @@ export class OrderManagementBulkComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'overall:payment:status' }, - containsAllLable: true, + containsAllLabel: true, visibleIf: { _$expand: (value: boolean) => value } @@ -332,7 +332,7 @@ export class OrderManagementBulkComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'service:type' }, - containsAllLable: true, + containsAllLabel: true, visibleIf: { _$expand: (value: boolean) => value } @@ -343,7 +343,7 @@ export class OrderManagementBulkComponent implements OnInit { type: 'string', ui: { widget: 'dict-select', - containsAllLable: true, + containsAllLabel: true, params: { dictKey: 'goodresource:settlement:type' }, containAllLable: true, visibleIf: { @@ -392,27 +392,27 @@ export class OrderManagementBulkComponent implements OnInit { }; this.uiView = { '*': { spanLabelFixed: 80, grid: { span: 12, gutter: 4 } } }; } - // 获取城市列表 - getRegionCode(regionCode: any) { - console.log(regionCode); - return this.service - .request(this.service.$api_get_enterprise_project, { id: regionCode }) - .pipe( - map(res => - res.map((item: any) => ({ - label: item.projectName, - value: item.id - })) - ) + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) ) - .subscribe(res => { - this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; - this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); - // if (this.enterpriseProjectIds) { - // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); - // } - }); - } + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } /** * 初始化数据列表 */ @@ -553,8 +553,9 @@ export class OrderManagementBulkComponent implements OnInit { { text: '取消订单', click: _record => this.cancellation(_record), - iif: item => item.billStatus !== '1' && item.billStatus !== '6' && item.overallPaymentStatus != '2', - acl: { ability: ['ORDER-BULK-signBulkOrder'] }, + iif: item => + item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '1', + acl: { ability: ['ORDER-BULK-signBulkOrder'] }, }, { text: '申请退款', @@ -649,7 +650,7 @@ export class OrderManagementBulkComponent implements OnInit { this._$expand = !this._$expand; this.sf?.setValue('/_$expand', this._$expand); } - tabChange(item: any) {} + tabChange(item: any) { } /** * 重置表单 */ @@ -661,8 +662,8 @@ export class OrderManagementBulkComponent implements OnInit { /** * 导入货源 */ - importGoodsSource() {} - audit(item: any) {} + importGoodsSource() { } + audit(item: any) { } /* * 审核关闭弹窗 @@ -683,7 +684,7 @@ export class OrderManagementBulkComponent implements OnInit { /** * 审核通过按钮 */ - handleOK() {} + handleOK() { } OpenPrice(item: any) { this.changeId = item.id; this.isVisible = true; @@ -736,10 +737,10 @@ export class OrderManagementBulkComponent implements OnInit { nzFooter: null }); modal.afterClose.subscribe((res: any) => { - if(res) { - this.st.reload(1); - this.getGoodsSourceStatistical(); - } + if (res) { + this.st.reload(1); + this.getGoodsSourceStatistical(); + } }); } }); @@ -816,10 +817,10 @@ export class OrderManagementBulkComponent implements OnInit { changeOrder(value: any) { this.router.navigate(['order-management/bulk-detailChange', value.id]); } - /** - *申请退款 - */ - applyRefund(item: any) { + /** +*申请退款 +*/ + applyRefund(item: any) { const modalRef = this.modal.create({ nzTitle: '申请退款', nzContent: OneCarOrderCancelConfirmComponent, @@ -830,7 +831,7 @@ export class OrderManagementBulkComponent implements OnInit { nzFooter: null }); modalRef.afterClose.subscribe((res: boolean) => { - if(res) { + if (res) { this.resetSF; this.st.load(); } diff --git a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts index 607c7ad6..739ca164 100644 --- a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts +++ b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts @@ -51,7 +51,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit { private modal: NzModalService, public shipperservice: ShipperBaseService, private router: Router - ) {} + ) { } /** * 查询参数 @@ -236,7 +236,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'overall:payment:status' }, - containsAllLable: true, + containsAllLabel: true, visibleIf: { _$expand: (value: boolean) => value } @@ -262,7 +262,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'service:type' }, - containsAllLable: true, + containsAllLabel: true, visibleIf: { _$expand: (value: boolean) => value } @@ -286,27 +286,27 @@ export class OrderManagementComplianceAuditComponent implements OnInit { }; this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; } - // 获取城市列表 - getRegionCode(regionCode: any) { - console.log(regionCode); - return this.service - .request(this.service.$api_get_enterprise_project, { id: regionCode }) - .pipe( - map(res => - res.map((item: any) => ({ - label: item.projectName, - value: item.id - })) - ) + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) ) - .subscribe(res => { - this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; - this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); - // if (this.enterpriseProjectIds) { - // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); - // } - }); - } + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } /** * 初始化数据列表 */ @@ -432,7 +432,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit { className: 'text-center', index: 'applyUserName' }, - { title: '状态', index: 'handleStatusLabel', className: 'text-center' }, + { title: '状态', index: 'handleStatusLabel', className: 'text-center' }, { title: '操作', fixed: 'right', @@ -445,7 +445,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit { { text: '撤销', click: (_record) => this.revoke(_record), - iif: item => item.handleStatus === '1' || item.handleStatus === 1, + iif: item => item.handleStatus === '1' || item.handleStatus === 1, }, ], }, @@ -466,16 +466,20 @@ export class OrderManagementComplianceAuditComponent implements OnInit { index: 'amountAfterChange', render: 'amountAfterChange' }, - { title: '变更值', + { + title: '变更值', index: 'amountchangeValue', render: 'amountchangeValue', width: '120px', - className: 'text-center' }, - { title: '变更后', + className: 'text-center' + }, + { + title: '变更后', index: 'amountBeforeChange', render: 'amountBeforeChange', width: '120px', - className: 'text-center' } + className: 'text-center' + } ]; } /** @@ -484,30 +488,30 @@ export class OrderManagementComplianceAuditComponent implements OnInit { get queryFieldCount(): number { return Object.keys(this.schema?.properties || {}).length; } - /** - * 浮动费用查看 - */ - FloatView(item: any) { - console.log(item) - this.changeViewId = item.id; - this.service.request(this.service.$api_getChangeRecordWholeDetail, {id: this.changeViewId}).subscribe((res) => { - this.ViewCause = res; + /** +* 浮动费用查看 +*/ + FloatView(item: any) { + console.log(item) + this.changeViewId = item.id; + this.service.request(this.service.$api_getChangeRecordWholeDetail, { id: this.changeViewId }).subscribe((res) => { + this.ViewCause = res; + }) + this.isVisibleView = true + } + revoke(item: any) { + this.modal.confirm({ + nzTitle: '是否确定立即撤销费用变更!', + nzOnOk: () => + this.service.request(this.service.$api_get_revokeChangeRecord, { id: item.id }).subscribe((res) => { + console.log(res) + if (res) { + this.service.msgSrv.success('撤销成功!') + this.stFloat.reload() + } }) - this.isVisibleView = true - } - revoke(item: any) { - this.modal.confirm({ - nzTitle: '是否确定立即撤销费用变更!', - nzOnOk: () => - this.service.request(this.service.$api_get_revokeChangeRecord, { id: item.id}).subscribe((res) => { - console.log(res) - if(res) { - this.service.msgSrv.success('撤销成功!') - this.stFloat.reload() - } - }) - }); - } + }); + } /** * 伸缩查询条件 */ @@ -515,7 +519,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit { this._$expand = !this._$expand; this.sf?.setValue('/_$expand', this._$expand); } - tabChange(item: any) {} + tabChange(item: any) { } /** * 重置表单 */ @@ -527,7 +531,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit { /** * 导入货源 */ - importGoodsSource() {} + importGoodsSource() { } OpenPrice(item: any) { this.changeId = item.id; this.isVisible = true; @@ -584,24 +588,24 @@ export class OrderManagementComplianceAuditComponent implements OnInit { this.uiView = { '*': { spanLabelFixed: 110, grid: { span: 24 } } }; } - /* - * 审核关闭弹窗 - */ - handleCancel(value?: string) { - if(value === '0') { - this.isVisible = false; - } else if(value === '1') { - this.isVisibleRE = false; - } else if(value === '2') { - this.isVisibleView = false; - } + /* + * 审核关闭弹窗 + */ + handleCancel(value?: string) { + if (value === '0') { + this.isVisible = false; + } else if (value === '1') { + this.isVisibleRE = false; + } else if (value === '2') { + this.isVisibleView = false; } - /** - * 审核通过按钮 - */ + } + /** +* 审核通过按钮 +*/ handleOK() { let idList: any[] = []; - if(this.selectedRows.length > 0) { + if (this.selectedRows.length > 0) { this.selectedRows.forEach(item => { idList.push(item.id); }); @@ -618,55 +622,55 @@ export class OrderManagementComplianceAuditComponent implements OnInit { this.service.msgSrv.success('提交成功!'); this.isVisibleRE = false; this.st?.load(1); - this.getGoodsSourceStatistical() + this.getGoodsSourceStatistical() } }); } - /** - * 审核拒绝按钮 - */ - reject() { - if(!this.sfView.value.complianceRemark) { - this.service.msgSrv.error('备注不能为空!'); - return; - } - let idList: any[] = []; - if(this.selectedRows.length > 0) { - this.selectedRows.forEach(item => { - idList.push(item.id); - }); - } else { - idList.push(this.sfView.value.billCode) - } - const parms = { - ids: idList, - complianceRemark: this.sfView.value.complianceRemark, - complianceStatus: 2, - }; - this.service.request(this.service.$api_get_updateBillByCompliance, parms).subscribe(res => { - if (res) { - this.service.msgSrv.success('提交成功!'); - this.isVisibleRE = false; - this.st?.load(1); - this.getGoodsSourceStatistical() - } - }); + /** + * 审核拒绝按钮 + */ + reject() { + if (!this.sfView.value.complianceRemark) { + this.service.msgSrv.error('备注不能为空!'); + return; } - /** - *合规抽查 - */ + let idList: any[] = []; + if (this.selectedRows.length > 0) { + this.selectedRows.forEach(item => { + idList.push(item.id); + }); + } else { + idList.push(this.sfView.value.billCode) + } + const parms = { + ids: idList, + complianceRemark: this.sfView.value.complianceRemark, + complianceStatus: 2, + }; + this.service.request(this.service.$api_get_updateBillByCompliance, parms).subscribe(res => { + if (res) { + this.service.msgSrv.success('提交成功!'); + this.isVisibleRE = false; + this.st?.load(1); + this.getGoodsSourceStatistical() + } + }); + } + /** +*合规抽查 +*/ audit(item?: any) { if (item) { this.isVisibleRE = true; this.auditId = item.id; this.initSTAudit(1); } else { - if(this.selectedRows.length <= 0) { + if (this.selectedRows.length <= 0) { this.service.msgSrv.error('请选择订单!') return; } else { - this.isVisibleRE = true; - this.initSTAudit(2); + this.isVisibleRE = true; + this.initSTAudit(2); } } } diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts index d39ad298..bb688611 100644 --- a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts @@ -41,7 +41,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { private modal: NzModalService, public shipperservice: ShipperBaseService, private router: Router - ) {} + ) { } /** * 查询参数 @@ -211,7 +211,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'overall:payment:status' }, - containsAllLable: true, + containsAllLabel: true, visibleIf: { _$expand: (value: boolean) => value } @@ -237,7 +237,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'service:type' }, - containsAllLable: true, + containsAllLabel: true, visibleIf: { _$expand: (value: boolean) => value } @@ -248,7 +248,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { type: 'string', ui: { widget: 'dict-select', - containsAllLable: true, + containsAllLabel: true, params: { dictKey: 'goodresource:settlement:type' }, containAllLable: true, visibleIf: { @@ -351,7 +351,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { { text: '修改', click: _record => this.modification(_record), - iif: item => item.auditStatus == '1' , + iif: item => item.auditStatus == '1', acl: { ability: ['ORDER-RECEIPTS-updateBillExamine'] }, }, { @@ -377,7 +377,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { this._$expand = !this._$expand; this.sf?.setValue('/_$expand', this._$expand); } - tabChange(item: any) {} + tabChange(item: any) { } /** * 重置表单 */ @@ -389,13 +389,13 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { /** * 导入货源 */ - importGoodsSource() {} - audit(item: any) {} + importGoodsSource() { } + audit(item: any) { } /** * 审核通过按钮 */ - handleOK() {} + handleOK() { } OpenPrice(item: any) { this.isVisible = true; } @@ -414,12 +414,12 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { modalRef.afterClose.subscribe((result: any) => { this.st.load(1); this.getGoodsSourceStatistical() - }); + }); } // 生成电子单据 generate(item: any, sts?: number) { let text = '查看凭证'; - if(sts == 2) { + if (sts == 2) { text = '生成电子单据'; } const modalRef = this.modal.create({ @@ -435,23 +435,23 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { modalRef.afterClose.subscribe((result: any) => { this.st.load(1); this.getGoodsSourceStatistical() - }); + }); } // 通过 sign(item?: any) { let params: any = [] let text = ''; - if(item === '1') { - if(this.selectedRows.length <= 0) { + if (item === '1') { + if (this.selectedRows.length <= 0) { this.service.msgSrv.error('请选择订单!') return } this.selectedRows.forEach(ite => { params.push(ite.id); }); - text = `已选择${this.selectedRows.length}条订单,确认批量通过审核吗?` + text = `已选择${this.selectedRows.length}条订单,确认批量通过审核吗?` } else { - text = `确认通过审核吗?` + text = `确认通过审核吗?` params.push(item.id); } console.log(this.selectedRows) @@ -474,7 +474,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { } // 批量生成电子单据 sign1(item?: any) { - if(this.selectedRows.length <= 0) { + if (this.selectedRows.length <= 0) { this.service.msgSrv.error('请选择订单!') return } diff --git a/src/app/routes/order-management/components/risk/risk.component.ts b/src/app/routes/order-management/components/risk/risk.component.ts index 9cec98cf..bbbf4889 100644 --- a/src/app/routes/order-management/components/risk/risk.component.ts +++ b/src/app/routes/order-management/components/risk/risk.component.ts @@ -40,34 +40,34 @@ export class OrderManagementRiskComponent implements OnInit { public shipperservice: ShipperBaseService, private modal: NzModalService, public router: Router - ) {} + ) { } /** * 查询参数 */ - get reqParams() { + get reqParams() { // const a:any = {}; // if(this.resourceStatus) { - // a.representationsStatus = this.resourceStatus + // a.representationsStatus = this.resourceStatus // } // return { // ...a, // ...this.sf?.value, // }; - const a:any = {}; - if(this.resourceStatus) { - a.representationsStatus = this.resourceStatus + const a: any = {}; + if (this.resourceStatus) { + a.representationsStatus = this.resourceStatus } const params: any = Object.assign({}, this.sf?.value || {}); delete params._$expand; - return { + return { ...a, ...params, createTime: { start: this.sf?.value?.createTime?.[0] || '', end: this.sf?.value?.createTime?.[1] || '', }, - }; + }; } search() { this.st?.load(1); @@ -173,7 +173,7 @@ export class OrderManagementRiskComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'freight:type' }, - containsAllLable: true, + containsAllLabel: true, visibleIf: { _$expand: (value: boolean) => value } @@ -185,7 +185,7 @@ export class OrderManagementRiskComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'BulkFreightUnitPriceType' }, - containsAllLable: true, + containsAllLabel: true, visibleIf: { _$expand: (value: boolean) => value } @@ -312,7 +312,7 @@ export class OrderManagementRiskComponent implements OnInit { { text: '审核', click: _record => this.audit(_record), - iif: item => item.representationsStatus == '1' || item.representationsStatus == '2' , + iif: item => item.representationsStatus == '1' || item.representationsStatus == '2', acl: { ability: ['ORDER-RISK-audit'] }, }, { @@ -410,7 +410,7 @@ export class OrderManagementRiskComponent implements OnInit { /** * 导入货源 */ - importGoodsSource() {} + importGoodsSource() { } /* * 审核关闭弹窗 @@ -423,7 +423,7 @@ export class OrderManagementRiskComponent implements OnInit { */ handleOK() { let idList: any[] = []; - if(this.selectedRows.length > 0) { + if (this.selectedRows.length > 0) { this.selectedRows.forEach(item => { idList.push(item.id); }); @@ -440,7 +440,7 @@ export class OrderManagementRiskComponent implements OnInit { this.service.msgSrv.success('审核通过成功!'); this.isVisibleRE = false; this.st?.load(1); - this.getGoodsSourceStatistical() + this.getGoodsSourceStatistical() } }); } @@ -449,14 +449,14 @@ export class OrderManagementRiskComponent implements OnInit { */ reject() { let idList: any[] = []; - if(this.selectedRows.length > 0) { + if (this.selectedRows.length > 0) { this.selectedRows.forEach(item => { idList.push(item.id); }); } else { idList.push(this.sfView.value.billCode) } - if(!this.sfView.value.representationsCause) { + if (!this.sfView.value.representationsCause) { this.service.msgSrv.error('拒绝原因为空!'); return; } @@ -481,14 +481,14 @@ export class OrderManagementRiskComponent implements OnInit { if (item) { this.auditId = item.billCode; this.initSTAudit(1); - this.isVisibleRE = true; + this.isVisibleRE = true; } else { - if(this.selectedRows.length <= 0) { + if (this.selectedRows.length <= 0) { this.service.msgSrv.error('请选择订单!') return; } else { - this.initSTAudit(2); - this.isVisibleRE = true; + this.initSTAudit(2); + this.isVisibleRE = true; } } } diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.ts b/src/app/routes/order-management/components/vehicle/vehicle.component.ts index 234042cb..949afb99 100644 --- a/src/app/routes/order-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/order-management/components/vehicle/vehicle.component.ts @@ -55,7 +55,7 @@ export class OrderManagementVehicleComponent extends BasicTableComponent impleme two: '2', three: '2', id: 2 - } + }, ]; tabs = { cancelQuantity: 0, @@ -732,10 +732,6 @@ export class OrderManagementVehicleComponent extends BasicTableComponent impleme nzComponentParams: { data: { ids: params } }, nzFooter: null // nzOnOk: sin => { - // this.service.request(this.service.$api_change_bulk, { billId: item.id, ...sin.sf.value }).subscribe(res => { - // if (res) { - // this.service.msgSrv.success('变更运费成功'); - // modal.destroy(); // this.st.reload(); // } // }); diff --git a/src/app/routes/order-management/services/order-management.service.ts b/src/app/routes/order-management/services/order-management.service.ts index 6ce20270..68e977d5 100644 --- a/src/app/routes/order-management/services/order-management.service.ts +++ b/src/app/routes/order-management/services/order-management.service.ts @@ -211,7 +211,7 @@ export class OrderManagementService extends ShipperBaseService { }) ); } - constructor(public injector: Injector, public eaCacheSrv: EACacheService) { - super(injector, eaCacheSrv); + constructor(public injector: Injector) { + super(injector); } } diff --git a/src/app/routes/partner/account-management/components/account-detail/account-detail.component.html b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.html new file mode 100644 index 00000000..47e81e17 --- /dev/null +++ b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.html @@ -0,0 +1,65 @@ + + + + + + + + + {{headerTotalInfo?.ltdName}} + + + {{headerTotalInfo?.allAmount |currency}} + + + {{headerTotalInfo?.incomeAmount |currency}} + + + {{headerTotalInfo?.payAmount |currency}} + + + + {{headerTotalInfo?.name}}   {{headerTotalInfo?.phone}} + + + +
+
+ +
+
+ + + + +
+
+
+ + +
- {{item.amount | currency:' ' }}
+
+ {{item.amount | currency:' ' }}
+
+ +
{{item?.accountBalance |currency:' '}}
+
+ +
+ +
+
diff --git a/src/app/routes/partner/account-management/components/account-detail/account-detail.component.less b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.less new file mode 100644 index 00000000..a485bd4c --- /dev/null +++ b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.less @@ -0,0 +1,21 @@ +:host { + ::ng-deep { + .search-header { + nz-range-picker { + width: 100%; + } + } + } + + .table-content { + position: relative; + + .total-footer { + position: absolute; + bottom: 0; + height: 32px; + margin: 16px 0; + line-height: 32px; + } + } +} diff --git a/src/app/routes/partner/account-management/components/account-detail/account-detail.component.spec.ts b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.spec.ts new file mode 100644 index 00000000..1233feec --- /dev/null +++ b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerAccountManagementAccountDetailComponent } from './account-detail.component'; + +describe('PartnerAccountManagementAccountDetailComponent', () => { + let component: PartnerAccountManagementAccountDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [PartnerAccountManagementAccountDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerAccountManagementAccountDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/account-management/components/account-detail/account-detail.component.ts b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.ts new file mode 100644 index 00000000..4e595c8b --- /dev/null +++ b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.ts @@ -0,0 +1,204 @@ +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 { ModalHelper, _HttpClient } from '@delon/theme'; +import { AccountManagemantService } from '../../services/account-managemant.service'; + +@Component({ + selector: 'app-partner-account-management-account-detail', + templateUrl: './account-detail.component.html', + styleUrls: ['./account-detail.component.less'] +}) +export class PartnerAccountManagementAccountDetailComponent implements OnInit { + headerTotalInfo: any = { + allAmount: 0, + incomeAmount: 0, + payAmount: 0, + name: '', + ltdName: '', + phone: '' + }; + footerTotalInfo: any = { + incomeAmount: 0, + payAmount: 0, + total: 0 + }; + + + url = `/user`; + schema: SFSchema = {}; + ui!: SFUISchema; + _$expand = false; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + + + columns: STColumn[] = []; + roleId = ''; + bankType = ''; + channelSource = ''; + ltdId = ''; + constructor(public service: AccountManagemantService, public ar: ActivatedRoute) { + + this.roleId = this.ar.snapshot.params.id; + this.ar.queryParamMap.subscribe((res: any) => { + this.ltdId = res?.params?.ltdId; + this.channelSource = res?.params?.channelSource; + this.bankType = res?.params?.bankType; + }) + } + + + get reqParams() { + return { ...this.sf?.value, roleId: this.roleId, ltdId: this.ltdId, channelSource: this.channelSource, bankType: this.bankType }; + } + ngOnInit(): void { + this.getHeaderSummary(); + this.getFooterSummary(); + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { + type: 'boolean', ui: { hidden: true } + }, + createTime: { + type: 'string', + title: '交易时间', + ui: { + widget: 'sl-from-to', + type: 'date', + autoComplete: 'off', + format: 'yyyy-MM-dd', + } as SFDateWidgetSchema, + }, + transactionNumber: { + title: '流水号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + businessNumber: { + title: '交易单号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + tradeType: { + type: 'string', + title: '交易类型', + default: '', + ui: { + widget: 'dict-select', + params: { + dictKey: 'trade:type' + }, + placeholder: '请选择', + allowClear: true, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + }, + }, + incomeType: { + type: 'string', + title: '收支类型', + default: '', + ui: { + widget: 'dict-select', + params: { + dictKey: 'income:type' + }, + placeholder: '请选择', + allowClear: true, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + }, + }, + + } + } + this.ui = { '*': { spanLabelFixed: 100, grid: { span: 8, gutter: 4 } }, }; + } + + /** +* 初始化数据列表 +*/ + initST() { + this.columns = [ + { title: '交易时间', index: 'createTime', className: 'text-center', width: 200 }, + { title: '流水号', index: 'transactionNumber', className: 'text-center', width: 180 }, + { title: '交易类型', index: 'tradeTypeLabel', className: 'text-center', width: 150 }, + { title: '交易单号', index: 'businessNumber', className: 'text-center', width: 180 }, + { title: '备注', index: 'tradeContent', className: 'text-center', width: 180 }, + { title: '收支类型', index: 'incomeTypeLabel', className: 'text-center', width: 180 }, + { title: '交易金额', render: 'amount', className: 'text-center', width: 150 }, + { title: '账户余额', render: 'accountBalance', className: 'text-center', width: 150 }, + { title: '付款方', index: 'payName', className: 'text-center', width: 200 }, + { title: '收款方', index: 'payeeName', className: 'text-center', width: 200 }, + ]; + } + resetSF() { + this._$expand = false; + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + + /** +* 伸缩查询条件 +*/ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 头部汇总 + */ + getHeaderSummary() { + const params = { + roleId: this.roleId, + ltdId: this.ltdId, + channelSource: this.channelSource, + bankType: this.bankType + }; + this.service.request(this.service.$api_get_account_detail_header_summary, { ...params }).subscribe(res => { + if (res) { + this.headerTotalInfo = res; + console.log(res); + } + }) + } + /** + * 脚部汇总 + */ + getFooterSummary() { + this.service.request(this.service.$api_get_account_detail_footer_summary, this.reqParams).subscribe(res => { + if (res) { + this.footerTotalInfo = res; + } + }) + } + + + search() { + this.st.load(1); + } + export() { } + + goBack() { + window.history.go(-1); + } + + +} diff --git a/src/app/routes/partner/account-management/components/list/list.component.html b/src/app/routes/partner/account-management/components/list/list.component.html new file mode 100644 index 00000000..b811832d --- /dev/null +++ b/src/app/routes/partner/account-management/components/list/list.component.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + +
{{item.allBalance | currency:' '}}
+
+ + {{item.unEntryAmount | currency:' + '}} + + +
{{item.availableBalance | currency:' '}}
+
+ + +
+
diff --git a/src/app/routes/partner/account-management/components/list/list.component.spec.ts b/src/app/routes/partner/account-management/components/list/list.component.spec.ts new file mode 100644 index 00000000..da38a52c --- /dev/null +++ b/src/app/routes/partner/account-management/components/list/list.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerAccountManagementListComponent } from './list.component'; + +describe('PartnerAccountManagementListComponent', () => { + let component: PartnerAccountManagementListComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [PartnerAccountManagementListComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerAccountManagementListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/account-management/components/list/list.component.ts b/src/app/routes/partner/account-management/components/list/list.component.ts new file mode 100644 index 00000000..1a12dd8c --- /dev/null +++ b/src/app/routes/partner/account-management/components/list/list.component.ts @@ -0,0 +1,119 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { BussinessStatisticsService } from '../../../business-statistics/services/bussiness-statistics.service'; +import { AccountManagemantService } from '../../services/account-managemant.service'; +import { PartnerAccountManagementVirtualAccountDetailComponent } from '../virtual-account-detail/virtual-account-detail.component'; + +@Component({ + selector: 'app-partner-account-management-list', + templateUrl: './list.component.html', +}) +export class PartnerAccountManagementListComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + ui!: SFUISchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + + constructor(public service: AccountManagemantService, public modal: NzModalService) { } + /** + * 查询参数 + */ + get reqParams() { + const params = { ...this.sf?.value }; + return params + } + + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + userName: { + title: '合伙人名称', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + phone: { + title: '手机号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + } + } + this.ui = { '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 12 } }, }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '合伙人名称', index: 'userName', className: 'text-center', width: 250 }, + { title: '手机号', index: 'phone', className: 'text-center', width: 200 }, + { + title: '账户总额(元)', index: 'allBalance', className: 'text-right', sort: true, width: 150, type: 'currency', + }, + { + title: '待入账余额(元)', render: 'unEntryAmount', className: 'text-right', width: 150, + }, + { + title: '可用余额(元)', index: 'availableBalance', className: 'text-right', sort: true, width: 150, type: 'currency' + }, + { title: '虚拟账户', index: 'virtualAccount', className: 'text-center', width: 220 }, + { + title: '操作', + width: 150, + buttons: [ + { + text: '虚拟账户明细', + click: (_record) => this.viewVirtual(_record) + } + ] + } + ]; + } + + resetSF() { + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + + /** + * + * @param _record 当前行信息 + */ + viewVirtual(_record: any) { + const modalRef = this.modal.create({ + nzTitle: '虚拟账户明细', + nzContent: PartnerAccountManagementVirtualAccountDetailComponent, + nzComponentParams: { + roleId: _record?.roleId, + }, + nzWidth: '85%', + nzFooter: null + }); + // modalRef.afterClose.subscribe(result => { + // }); + } + + /** + * + */ + export() { + + } + +} diff --git a/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.html b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.html new file mode 100644 index 00000000..0dc738c1 --- /dev/null +++ b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.html @@ -0,0 +1,75 @@ + + + + + + + + + {{summaryObj?.company}} + + + {{summaryObj?.totalRebate |currency}} + + + {{summaryObj?.totalRebate |currency}} + + + {{summaryObj?.taxPersonalSum |currency}} + + + {{summaryObj?.waitRecordedAmount |currency}} + + + + {{summaryObj?.name}} + + + +
+ +
+
+ + +
- {{item.amount | currency }}
+
+ {{item.amount | currency }}
+
+
+ +
+
+ + +
+
+ {{detailRecord?.ltdName}} + {{detailRecord?.totalRebate |currency: ' '}} +
+ + +
+ {{item?.year }}年 + {{item?.month }}月 +
+
+ +
{{item?.profitAmountSum |currency :' '}}
+
+ +
+
+
diff --git a/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.spec.ts b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.spec.ts new file mode 100644 index 00000000..95af39f8 --- /dev/null +++ b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerAccountManagementRecordedDetailComponent } from './recorded-detail.component'; + +describe('PartnerAccountManagementRecordedDetailComponent', () => { + let component: PartnerAccountManagementRecordedDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [PartnerAccountManagementRecordedDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerAccountManagementRecordedDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.ts b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.ts new file mode 100644 index 00000000..f6bc1b47 --- /dev/null +++ b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.ts @@ -0,0 +1,179 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema, Widget } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { AccountManagemantService } from '../../services/account-managemant.service'; + +@Component({ + selector: 'app-partner-account-management-recorded-detail', + templateUrl: './recorded-detail.component.html', +}) +export class PartnerAccountManagementRecordedDetailComponent implements OnInit { + summaryObj: any = { + waitRecordedAmount: 0, + totalRebate: 0, + taxPersonalSum: 0, + recordedAmount: 0, + ltdName: '', + taxno: '' + }; + + detailRecord: any = {}; + + url = `/user`; + schema: SFSchema = {}; + ui!: SFUISchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + + + columns: STColumn[] = []; + billDetailColumns: STColumn[] = []; + showBillDetail = false; + billDetailList = []; + roleId = ''; + + constructor(public service: AccountManagemantService, public router: Router, public ar: ActivatedRoute) { + this.roleId = this.ar.snapshot.params.id; + + } + + + get reqParams() { + return { ...this.sf?.value, partnerId: this.roleId }; + } + + get billDetailReqParams() { + return {}; + } + ngOnInit(): void { + this.initSF(); + this.initST(); + this.getInvoiceSummary(); + } + + initSF() { + this.schema = { + properties: { + + abnormalCause: { + title: '网络货运人', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + + } + } + this.ui = { '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 } }, }; + } + + /** +* 初始化数据列表 +*/ + initST() { + this.columns = [ + { title: '网络货运人', index: 'ltdName', className: 'text-center', width: 200 }, + { title: '银行类型', render: 'bankTypeLabel', className: 'text-center', width: 150 }, + { title: '虚拟账户', render: 'fictitiousAccount', className: 'text-center', width: 200 }, + { title: '返佣总额(元)', index: 'totalRebate', className: 'text-center', width: 120, type: 'currency' }, + { title: '已入账金额(元)', index: 'recordedAmount', className: 'text-center', width: 180, type: 'currency' }, + { title: '代缴个税(元)', index: 'taxPersonalSum', className: 'text-center', width: 180, type: 'currency' }, + { title: '待入账金额(元)', index: 'waitRecordedAmount', className: 'text-right', width: 180, type: 'currency' }, + { + title: '操作', className: 'text-center', width: 300, + buttons: [ + { + text: '查看入账记录', + click: (_record) => this.viewBookedRecord(_record) + }, + { + text: '查看账单明细', + click: (_record) => this.viewAccountDetail(_record) + }, + ] + }, + ]; + } + + initBillDetailST() { + this.billDetailColumns = [ + { title: '账单月份', render: 'month', className: 'text-center', width: '40%' }, + { title: '返佣金额(元)', render: 'profitAmountSum', className: 'text-center', width: '40%' }, + { + title: '操作', className: 'text-center', width: '20%', buttons: [ + { + text: '订单明细', + click: (_record) => window.open(location.origin + `#/partner/rebate/record?ltdId=${_record?.ltdId}`) + } + ] + }, + ] + } + + + resetSF() { + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + + + + search() { + this.st.load(1); + } + + /** + * 获取账单明细 + */ + getBillDetail(ltdId: string) { + this.service.request(this.service.$api_get_bill_detail, { ltdId }).subscribe(res => { + if (res) { + this.billDetailList = res; + } + }) + } + + + export() { } + + /** + * 查看入账记录 + * @param record 当前行 + */ + viewBookedRecord(record: any) { + window.open(location.origin + `#/partner/recorded/record?ltdId=${record?.ltdId}&userId=${record?.userId}&userIdLabel=${record?.banktypeLabel}`); + } + + /** + * 查看账单明细 + * @param record 当前行 + */ + viewAccountDetail(record: any) { + this.billDetailColumns = []; + this.showBillDetail = true; + this.initBillDetailST(); + this.getBillDetail(record?.ltdId); + } + + getInvoiceSummary() { + this.service.request(this.service.$api_get_invoice_summary, { partnerId: this.roleId }).subscribe(res => { + if (res) { + this.summaryObj = res; + } + }) + } + + handleCancel() { + this.showBillDetail = false; + + } + goBack() { + window.history.go(-1); + } + +} diff --git a/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.html b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.html new file mode 100644 index 00000000..21bfeea2 --- /dev/null +++ b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.html @@ -0,0 +1,38 @@ + +
+
+ +
+
+ + + + +
+
+
+ + +
+ {{item.allBalance}} +
+
+ +
+ {{item.availableBalance}} +
+
+
+
+
+ diff --git a/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.spec.ts b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.spec.ts new file mode 100644 index 00000000..9a7da573 --- /dev/null +++ b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerAccountManagementVirtualAccountDetailComponent } from './virtual-account-detail.component'; + +describe('PartnerAccountManagementVirtualAccountDetailComponent', () => { + let component: PartnerAccountManagementVirtualAccountDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [PartnerAccountManagementVirtualAccountDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerAccountManagementVirtualAccountDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts new file mode 100644 index 00000000..6840cddd --- /dev/null +++ b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts @@ -0,0 +1,184 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { ShipperBaseService } from 'src/app/shared/services/business/shipper-base.service'; +import { AccountManagemantService } from '../../services/account-managemant.service'; + +@Component({ + selector: 'app-partner-account-management-virtual-account-detail', + templateUrl: './virtual-account-detail.component.html', +}) +export class PartnerAccountManagementVirtualAccountDetailComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + ui!: SFUISchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + roleId = ''; + _$expand = false; + record = {}; + + constructor(public shipperservice: ShipperBaseService, public service: AccountManagemantService, + private modalRef: NzModalRef, public router: Router) { + } + + get reqParams() { + return { ...this.sf?.value, roleId: this.roleId }; + } + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { + type: 'boolean', ui: { hidden: true } + }, + userName: { + title: '合伙人名称', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + phone: { + title: '手机号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + ltdId: { + title: '网络货运人', + type: 'string', + default: '', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder({}, true) + } + + }, + bankType: { + type: 'string', + title: '银行类型', + default: '', + ui: { + widget: 'dict-select', + params: { + dictKey: 'bankname:type' + }, + placeholder: '请选择', + allowClear: true, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + }, + }, + virtualAccount: { + title: '虚拟账户', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value + }, + }, + }, + createTime: { + type: 'string', + title: '创建时间', + ui: { + widget: 'sl-from-to', + type: 'date', + autoComplete: 'off', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + }, + } as SFDateWidgetSchema, + }, + } + } + this.ui = { '*': { spanLabelFixed: 100, grid: { span: 8, gutter: 4 } }, }; + } + + /** +* 初始化数据列表 +*/ + initST() { + this.columns = [ + { title: '合伙人', index: 'name', className: 'text-center', width: 200 }, + { title: '手机号', index: 'phone', className: 'text-center', width: 150 }, + { title: '网络货运人', index: 'ltdName', className: 'text-center', width: 200 }, + { title: '银行类型', index: 'bankTypeLabel', className: 'text-center', width: 120 }, + { title: '虚拟账户', index: 'virtualAccount', className: 'text-center', width: 180 }, + { title: '可用余额', render: 'availableBalance', className: 'text-center', width: 180 }, + { title: '账户总余额', render: 'allBalance', className: 'text-center', width: 180 }, + { title: '创建时间', index: 'createTime', className: 'text-center', width: 200 }, + { title: '状态', index: 'stateDeletedLabel', className: 'text-center', width: 120 }, + { + title: '操作', + width: 120, + buttons: [ + { + text: '查看明细', + click: (_record) => this.viewDetail(_record) + } + ] + } + ]; + } + + resetSF() { + this._$expand = false; + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + /** +* 伸缩查询条件 +*/ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + search() { + this.st.load(1); + } + export() { } + /** + * + * @param _record 当前行信息 + */ + viewDetail(_record: any) { + // this.router.navigate([`/partner/account-management/am/detail/${_record?.roleId}`], { + // queryParams: { + // channelSource: _record?.accountType, + // bankType: _record?.bankType, + // ltdId: _record?.ltdId + // } + // }); + window.open(location.origin + `/#/partner/account-management/am/detail/${_record?.roleId}?ltdId=${_record?.ltdId}&channelSource=${_record?.accountType}&bankType=${_record?.bankType}`); + } + + close() { + this.modalRef.destroy(); + } + +} diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html new file mode 100644 index 00000000..e2073979 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html @@ -0,0 +1,64 @@ + + + + + + + + + + +
+ + {{formData?.ltdName}} + + + {{formData?.bankType==='1'?'平安银行':'浦发银行'}} + + + {{formData?.refundApplyCode}} + + + {{formData?.bankAccountName}} + + + {{formData?.createTime}} + + + {{formData?.virtualAccount}} + + + {{formData?.refundStatusLabel}} + + + {{formData?.amount | currency}} + + + {{formData?.bankSerialNumber}} + + + {{formData?.bankCardNumber}} + + + {{formData?.refundStatus==='3'?'下载回单':'暂无回单'}} + +
+ + +
+
+ +
+
+
diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less new file mode 100644 index 00000000..e299b7d1 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less @@ -0,0 +1,17 @@ +:host::ng-deep { + + .ant-alert-info { + background-color: #f3f3f3; + border : 1px solid #dbdbdb; + + .ant-alert-message { + color: rgba(0, 0, 0, 0.85); + font-weight: 600; + font-size: 16px; + } + } + + .ant-form-item { + margin-bottom: 15px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts new file mode 100644 index 00000000..95657e1e --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts @@ -0,0 +1,87 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { FreightAccountService } from 'src/app/routes/financial-management/services/freight-account.service'; + + +@Component({ + selector: 'app-partner-account-management-withdrawals-detail', + templateUrl: './withdrawals-detail.component.html', + styleUrls: ['./withdrawals-detail.component.less'] +}) +export class PartnerAccountManagementWithdralDetailComponent implements OnInit { + formData: any = {}; + + timeLineData: any = []; + + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + const id = route.snapshot.params.id; + this.loadRefundDetail(id); + } + + ngOnInit(): void { } + + loadRefundDetail(id: string) { + this.service.request(this.service.$api_get_refund_detail, { id }).subscribe(res => { + if (res) { + this.formData = res; + // 处理流程节点数据 + // 流程是否结束 + let isEnd = false; + if (res.successTime) { + isEnd = true; + if (res.refundStatus === '3') { + this.timeLineData.push({ time: res.successTime, value: `到账成功`, color: 'green' }); + } else { + this.timeLineData.push({ time: res.successTime, value: `提现失败`, color: 'red' }); + } + } + if (res.agreeTime && res.refundStatus !== '4') { + this.timeLineData.push({ time: res.agreeTime, value: `银行处理中`, color: 'gray' }); + } + if (res.agreeTime) { + if (res.refundStatus === '4') { + isEnd = true; + this.timeLineData.push({ + time: res.agreeTime, + value: `拒绝提现
操作人员:${res.handlerUserIdLabel}`, + color: 'red' + }); + } else { + this.timeLineData.push({ + time: res.agreeTime, + value: `审核通过
操作人员:${res.handlerUserIdLabel}`, + color: 'gray' + }); + } + } + if (res.createTime) { + this.timeLineData.push({ + time: res.createTime, + value: `提交提现申请
提现${res.amount}元至${res.bankName}(${res.bankCardNumber})
操作人员:${res.userIdLabel}`, + color: 'gray' + }); + } + if (this.timeLineData?.length > 0 && !isEnd) { + this.timeLineData[0].color = 'green'; + } + } + }); + } + + downBack() { + if (this.formData?.refundStatus !== '3') { + return; + } + this.service.getReceiptUrl(this.formData.receiptUrl, { + bankType: this.formData.bankType, + rmYll: this.formData.userId, + snglFlgCd: this.formData.coreSerNo, + bussType: '06', + ltdId: this.formData.ltdId + }); + } + + goBack() { + history.go(-1); + } +} diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.html b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.html new file mode 100644 index 00000000..92dc20a4 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.html @@ -0,0 +1,63 @@ + + +
+
+ +
+
+ + + + +
+
+
+ + + + + + + + + + + + +
+
+ 已选择 + {{ selectedRows.length }} 条数据   累计提现 {{ + totalCallNo }} + +
+ +
+
+ + + + {{ item.bankName }}
{{ item.bankCardNumber }} +
+
+
+ + +
+
+ + + +
+
+
diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.ts b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.ts new file mode 100644 index 00000000..4bb0a0d9 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.ts @@ -0,0 +1,335 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from 'src/app/routes/financial-management/services/freight-account.service'; +import Big from 'src/app/shared/utils/deal-precision'; +import { AccountManagemantService } from '../../services/account-managemant.service'; + + +@Component({ + selector: 'app-partner-account-management-withdrawals-record', + templateUrl: './withdrawals-record.component.html', + styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/expend-but.less'] +}) +export class PartnerAccountManagementWithdrawalsRecordComponent implements OnInit { + @ViewChild('st', { static: true }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('auditModal', { static: false }) auditModal!: any; + @ViewChild('viewReasonModal', { static: false }) viewReasonModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + totalCallNo = 0; + refundStatus: any = ''; + + msg = ''; + constructor(public service: FreightAccountService, public amService: AccountManagemantService, private nzModalService: NzModalService, private router: Router, public ar: ActivatedRoute) { } + + ngOnInit(): void { } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + }, + refundStatus: this.refundStatus || null + }); + } + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + data = data.map(node => ({ ...node, disabled: node.refundStatus !== '1' })); + return data; + }; + + stChange(e: STChange): void { + if (e.type === 'checkbox') { + const checkRows = (e.checkbox as STData[]) || []; + //判断当前页是否有选中的行 + if (checkRows.length === 0) { + // 当前页没有存在已勾选的行,移除之前所记录的当前页的行 + const stList = this.st.list; + stList.forEach(item => { + this.selectedRows = this.selectedRows.filter((e: any) => e.id !== item.id); + }) + } else { + //添加新增的行 + checkRows.forEach((item: any) => { + const newSelectedList = this.selectedRows.filter((r: any) => r.id === item.id); + if (newSelectedList.length === 0) { + this.selectedRows.push(item); + + } + }) + // 移除取消选中的行 + const stList = this.st.list; + stList.forEach(item => { + if (!item.checked) { + const index = this.selectedRows.findIndex(_item => item.id === _item.id); + if (index !== -1) this.selectedRows.splice(index, 1); + } + }) + } + let totalCallNo = 0; + this.selectedRows.forEach((item => { + totalCallNo = new Big(this.totalCallNo).plus(item?.amount).parse(); + })); + this.totalCallNo = totalCallNo; + } else if (e.type === 'loaded') { + // 页面加载时勾选 + (e?.loaded || []).forEach((r) => { + this.selectedRows.forEach((x) => { + if (x.id === r.id) { + r.checked = true; + } + }); + }); + } + } + + changeRefundStatus(status?: string) { + this.refundStatus = status || null; + this.st.load(1); + } + + auditAction(item?: any) { + this.msg = ''; + let params: Array = []; + if (item) { + params = [item.id]; + } else { + params = this.selectedRows.map(node => node.id); + } + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + this.service + .request(this.service.$api_disagree_refund, { + refundApplicationId: params, + msg: this.msg + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核拒绝成功'); + modal.destroy(); + this.st.load(1); + } + }); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + this.service + .request(this.service.$api_agree_refund, { + refundApplicationId: params, + msg: this.msg + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核通过成功'); + modal.destroy(); + this.st.load(1); + } + }); + } + } + ] + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + showReason(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '查看原因', + nzContent: item?.rejectionCause || item?.failCause, + nzFooter: [ + { + label: '关闭', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + refundApplyCode: { + type: 'string', + title: '提现单号', + ui: { + placeholder: '请输入' + } + }, + refundStatus: { + type: 'string', + title: '提现状态', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择' + } + }, + createTime: { + title: '提现时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true + } as SFDateWidgetSchema + }, + bankAccountName: { + type: 'string', + title: '账户名称', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + accountType: { + type: 'string', + title: '账户类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'bank:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder(), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + bankType: { + type: 'string', + title: '银行类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'bankname:type' }, + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', className: 'text-center' }, + { title: '提现时间', index: 'createTime', width: 180, className: 'text-center' }, + { title: '提现单号', index: 'refundApplyCode', width: 180, className: 'text-center' }, + { title: '网络货运人', index: 'ltdName', width: 220, className: 'text-center' }, + { title: '银行类型', index: 'bankTypeLabel', width: 100, className: 'text-center' }, + { title: '账户类型', index: 'accountTypeLabel', width: 100, className: 'text-center' }, + { title: '账户名称', index: 'bankAccountName', width: 220, className: 'text-center' }, + { title: '虚拟账户', index: 'virtualAccount', width: 180, className: 'text-center' }, + { + title: '提现金额', + index: 'amount', + width: 200, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { title: '提现银行账户', render: 'bankCardNumber', width: 200, className: 'text-center' }, + { title: '提现状态', index: 'refundStatusLabel', width: 100, className: 'text-center' }, + { title: '银行流水号', index: 'bankSerialNumber', width: 160, className: 'text-center' }, + { title: '核心交易流水', index: 'coreSerNo', width: 180, className: 'text-center' }, + { title: '失败原因', index: 'rejectionCause', width: 200, format: item => item.failCause, className: 'text-center' }, + { + title: '操作', + fixed: 'right', + width: '110px', + buttons: [ + { + text: '查看回单', + iif: item => item.refundStatus === '3', + click: item => + this.service.getReceiptUrl(item.receiptUrl, { + bankType: item.bankType, + rmYll: item.userId, + snglFlgCd: item.coreSerNo, + bussType: '06', + ltdId: item.ltdId + }) + }, + { + text: '查看原因', + iif: item => item.refundStatus === '4', + click: item => this.showReason(item) + }, + { + text: '审核', + iif: item => item.refundStatus === '1', + click: item => this.auditAction(item) + }, + { + text: '详情', + click: item => this.router.navigate(['./../detail/' + item.id], { relativeTo: this.ar }) + } + ] + } + ]; + } +} diff --git a/src/app/routes/partner/account-management/services/account-managemant.service.ts b/src/app/routes/partner/account-management/services/account-managemant.service.ts new file mode 100644 index 00000000..f7fa89b0 --- /dev/null +++ b/src/app/routes/partner/account-management/services/account-managemant.service.ts @@ -0,0 +1,22 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class AccountManagemantService extends BaseService { + + $api_get_account_management_page = `/api/bpc/accountBalancePartner/getPartnerAccountBalanceByOperator`; // 账户管理 + $api_get_virtual_detail_page = `/api/bpc/accountBalancePartner/getPartnerAccountBalanceInfoByOperator`;//虚拟账户明细 + $api_get_withdraw_record_page = `/api/fcc/refundApplicationOBC/list/partnerPage`;// 提现记录 + $api_get_account_detail_page = `/api/bpc/accountBalancePartner/getAccountBalancePartnerByOperatorPage`;// 账户明细 + $api_get_account_detail_footer_summary = `/api/bpc/accountBalancePartner/getAccountBalancePartnerIncomeDetailByOperator`;// 账户明细脚部汇总 + $api_get_account_detail_header_summary = `/api/bpc/accountBalancePartner/getAccountBalancePartnerAmountByOperator`;// 账户明细头部汇总 + $api_get_bill_detail = `/api/bpc/partnerIncomeDetail/findPartnerWaitIncomeByOperator`; // 查看账单明细 + $api_get_invoice_summary = `/api/bpc/partnerInvoiceEntry/oprationEntrySummary`; // 入账明细汇总 + $api_get_invoice_detail_page = `/api/bpc/partnerInvoiceEntry/oprationEntryDetail`; // 待入账明细列表 + + constructor(public injector: Injector) { + super(injector) + } +} diff --git a/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.html b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.html new file mode 100644 index 00000000..a0469712 --- /dev/null +++ b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.html @@ -0,0 +1,46 @@ + + + + + + +
+
+ +
+
+
深圳市XXXXXXX有限公司
+
91440300357887492H
+ + + + + + +
+
+
待审核
+
+ + +
+
+
+
+
+ +
+
+ + + + + + +
+
+
+ + \ No newline at end of file diff --git a/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.less b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.less new file mode 100644 index 00000000..403e7692 --- /dev/null +++ b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.less @@ -0,0 +1,29 @@ +:host { + .head-box { + img { + width : 80px; + height : 80px; + padding: 8px; + } + + .right-h { + font-size: 16px; + } + + .right-s { + color: #7f7f7f; + } + + .left-rt { + font-weight: bold; + font-size : 16px; + text-align : right; + } + + .left-rb { + display : flex; + justify-content: flex-end; + padding-top : 16px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.ts b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.ts new file mode 100644 index 00000000..d7aa10db --- /dev/null +++ b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.ts @@ -0,0 +1,71 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ParterClaimAuditListChannelApproveComponent } from '../../../claim-audit/components/channel-approve/channel-approve.component'; +import { ParterClaimAuditListChannelRejectComponent } from '../../../claim-audit/components/channel-reject/channel-reject.component'; +import { AdviceFeedbackService } from '../../services/advice-feedback.service'; + +// import { ParterClaimAuditListChannelApproveComponent } from '../channel-approve/channel-approve.component'; +// import { ParterClaimAuditListChannelRejectComponent } from '../channel-reject/channel-reject.component'; + +@Component({ + selector: 'app-parter-feedback-detail-detail', + templateUrl: './feedback-detail.component.html', + styleUrls: ['./feedback-detail.component.less'] +}) +export class ParterAdviceFeedbackDetailComponent implements OnInit { + id = this.route.snapshot.queryParams.id; + i: any; + imges: any; + isVisible = false; + + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + public service: AdviceFeedbackService, + private modalService: NzModalService, + private router: Router + ) {} + + ngOnInit(): void { + this.initData(); + } + + initData() { + // this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { + // if (res) { + // this.i = res; + // + // } + // }); + } + + approve() { + const modalRef = this.modalService.create({ + nzTitle: '同意', + nzWidth: 700, + nzContent: ParterClaimAuditListChannelApproveComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + reject() { + const modalRef = this.modalService.create({ + nzTitle: '拒绝', + nzWidth: 700, + nzContent: ParterClaimAuditListChannelRejectComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + goBack() { + window.history.go(-1); + } +} diff --git a/src/app/routes/partner/advice-feedback/components/list/list.component.html b/src/app/routes/partner/advice-feedback/components/list/list.component.html new file mode 100644 index 00000000..ca389dea --- /dev/null +++ b/src/app/routes/partner/advice-feedback/components/list/list.component.html @@ -0,0 +1,47 @@ + + + +
+ +
+ +
+ + + +
+ +
+
+ + + +
+
+
+
+ + + + + diff --git a/src/app/routes/partner/advice-feedback/components/list/list.component.ts b/src/app/routes/partner/advice-feedback/components/list/list.component.ts new file mode 100644 index 00000000..80260b01 --- /dev/null +++ b/src/app/routes/partner/advice-feedback/components/list/list.component.ts @@ -0,0 +1,228 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AdviceFeedbackService } from '../../services/advice-feedback.service'; + +@Component({ + selector: 'app-parter-advice-feedback', + templateUrl: './list.component.html' +}) +export class ParterAdviceFeedbackListComponent implements OnInit { + schema: SFSchema = {}; + columns1!: STColumn[]; + columns2!: STColumn[]; + @ViewChild('st1', { static: false }) + st1!: STComponent; + ui!: SFUISchema; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + _$expand = false; + selectedIndex = 0; + + data=[{name1:1111}] + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: AdviceFeedbackService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { ...this.sf?.value }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + ngOnInit() { + this.initSF(); + this.initST1(); + this.initST2(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + name: { + type: 'string', + title: '提交人' + }, + name1: { + type: 'string', + title: '企业管理员' + }, + name2: { + type: 'string', + title: '角色' + }, + name3: { + type: 'string', + title: '问题类型', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + name4: { + type: 'string', + title: '状态', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + } + }; + this.ui = { + '*': { + grid: { span: 8, gutter: 4 } + } + }; + } + + initST1() { + this.columns1 = [ + { + title: '提交人', + index: 'name1' + }, + { + title: '企业管理员', + index: 'name1' + }, + { + title: '手机号', + index: 'name1' + }, + { + title: '角色', + index: 'name1' + }, + { + title: '问题类型', + index: 'name1' + }, + { + title: '描述或建议', + index: 'name1' + }, + { + title: '状态', + index: 'name1' + }, + { + title: '提交时间', + index: 'name1' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '详情', + click: (_record, _modal, _instance) => this.partnerView(_record), + }, + { + text: '处理', + click: (_record, _modal, _instance) => this.partnerView(_record), + }, + ] + } + ]; + } + + initST2() { + this.columns2 = [ + { + title: '提交人', + index: 'name1' + }, + { + title: '客户名称', + index: 'name1' + }, + { + title: '认领备注', + index: 'name1' + }, + { + title: 'CRM状态', + index: 'name1' + }, + { + title: '平台审核状态', + index: 'name1' + }, + { + title: '提交时间', + index: 'name1' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '详情', + click: (_record, _modal, _instance) => this.channelView(_record), + }, + { + text: '审核', + click: (_record, _modal, _instance) => this.channelView(_record), + }, + + ] + } + ]; + } + + partnerView(record: STData) { + this.router.navigate(['/partner/advice-feedback/detail'], { queryParams: {} }); + } + + channelView(record: STData) { + this.router.navigate(['/partner/advice-feedback/detail'], { queryParams: {} }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + search() { + // this.st1?.load(1); + } + + tabChange(index:any){ + console.log(index) + switch (index) { + case 0: + this.initST1(); + break; + case 1: + this.initST2(); + break; + default: + break; + } + } + +} diff --git a/src/app/routes/partner/advice-feedback/services/advice-feedback.service.ts b/src/app/routes/partner/advice-feedback/services/advice-feedback.service.ts new file mode 100644 index 00000000..1e94e786 --- /dev/null +++ b/src/app/routes/partner/advice-feedback/services/advice-feedback.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class AdviceFeedbackService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/article-management/components/edit/edit.component.html b/src/app/routes/partner/article-management/components/edit/edit.component.html new file mode 100644 index 00000000..e8e4a5fc --- /dev/null +++ b/src/app/routes/partner/article-management/components/edit/edit.component.html @@ -0,0 +1,17 @@ + + + + + +
+ + +
+
+ +
+ + +
+
+ diff --git a/src/app/routes/partner/article-management/components/edit/edit.component.ts b/src/app/routes/partner/article-management/components/edit/edit.component.ts new file mode 100644 index 00000000..f65dea8f --- /dev/null +++ b/src/app/routes/partner/article-management/components/edit/edit.component.ts @@ -0,0 +1,189 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { Observable, Observer } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ChannelSalesService } from '../../services/channel-sales.service'; + +@Component({ + selector: 'app-parter-article-management-edit', + templateUrl: './edit.component.html' +}) +export class ParterArticleManagementEditComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + public service: ChannelSalesService, + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name1: { + type: 'string', + title: '文章标题', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请输入50字符' + } as SFTextareaWidgetSchema, + }, + name2: { + type: 'string', + title: '文章简介', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请输入50字符' + } as SFTextareaWidgetSchema, + }, + name3: { + type: 'string', + title: '封面图', + ui: { + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFilePath', + urlReName: 'data.fullFilePath', + widget: 'upload', + descriptionI18n: '支持JPG、PNG格式,文件小于2M(建议尺寸 280px * 180 px)', + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } as SFUploadWidgetSchema + }, + name: { + title: '分类', + type: 'string', + enum: [ + { label: '管理员', value: '1'}, + ], + ui: { + widget: 'select', + } as SFSelectWidgetSchema, + }, + name4: { + type: 'number', + title: '排序', + minimum: 0, + maximum: 99, + ui: { + widgetWidth: 300 , + placeholder:'请输入0~99,数字越大,排序越靠前' + } + }, + name5: { + type: 'string', + title: '跳转路径', + enum: [ + { label: '图文', value: '1'}, + { label: '视频', value: '2'}, + ], + ui: { + widget: 'radio', + } as SFRadioWidgetSchema, + default: '1', + }, + content: { + type: 'string', + title: '正文', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 450 + }, + visibleIf: { name5: (value: string) => value === '1' } + }, + }, + name6: { + type: 'string', + title: '视频', + ui: { + action: apiConf.fileUpload, + accept: 'video/mp4,video/avi,video/mkv,video/vob', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFilePath', + urlReName: 'data.fullFilePath', + widget: 'upload', + descriptionI18n: '支持MP4、AVI、DAT、MKV、FLV、VOB格式,文件小于20M。', + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 20; + if (!isLt2M) { + this.service.msgSrv.warning('视频大小超过20M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + visibleIf: { name5: (value: string) => value === '2' } + } as SFUploadWidgetSchema + }, + }, + required: ['name1', 'name2'] + }; + this.ui = { + '*': { + spanLabelFixed: 150, + grid: { span: 20 } + }, + + }; + } + + close() { + + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + // this.service.request('', { ...this.sf.value }).subscribe(res => { + // if (res) { + // this.modalRef.destroy(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } +} diff --git a/src/app/routes/partner/article-management/components/list/list.component.html b/src/app/routes/partner/article-management/components/list/list.component.html new file mode 100644 index 00000000..721c85c0 --- /dev/null +++ b/src/app/routes/partner/article-management/components/list/list.component.html @@ -0,0 +1,49 @@ + + + +
+ +
+ +
+ + + +
+ +
+
+ + + +
+
+
+
+ + + + + + + diff --git a/src/app/routes/partner/article-management/components/list/list.component.ts b/src/app/routes/partner/article-management/components/list/list.component.ts new file mode 100644 index 00000000..89835f98 --- /dev/null +++ b/src/app/routes/partner/article-management/components/list/list.component.ts @@ -0,0 +1,200 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ChannelSalesService } from '../../services/channel-sales.service'; +import { ParterArticleManagementEditComponent } from '../edit/edit.component'; + +@Component({ + selector: 'app-parter-article-management-list', + templateUrl: './list.component.html' +}) +export class ParterArticleManagementListComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + _$expand = false; + + data=[{name1:1111}] + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: ChannelSalesService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { ...this.sf?.value }; + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } + + search() { + // this.st1?.load(1); + } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + name: { + type: 'string', + title: '文章标题' + }, + phone: { + type: 'string', + title: '分类' + }, + phone1: { + type: 'string', + title: '状态' + }, + phone2: { + type: 'string', + title: '推荐到首页', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + + } + }; + this.ui = { + '*': { + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '销售渠道姓名', + index: 'name1' + }, + { + title: '手机号', + index: 'name1' + }, + { + title: '所属组织', + index: 'name1' + }, + { + title: '职级', + index: 'name1' + }, + { + title: '等级', + index: 'name1' + }, + { + title: '省市', + index: 'name1' + }, + { + title: '邀请码', + index: 'name1' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '修改', + click: (_record, _modal, _instance) => this.edit(_record), + }, + { + text: '禁用', + click: (_record, _modal, _instance) => this.stop(_record), + }, + { + text: '启用', + click: (_record, _modal, _instance) => this.start(_record.id), + }, + { + text: '推荐到首页', + click: (_record, _modal, _instance) => this.recommend(_record.id), + } + ] + } + ]; + } + // 新增 + add() { + this.router.navigate(['/partner/knowledge/article-management-add'], { queryParams: {} }); + } + + // 编辑 + edit(record: STData) { + this.router.navigate(['/partner/knowledge/article-management-edit'], { queryParams: {} }); + } + + + stop(record: STData) { + this.modalService.confirm({ + nzTitle: '禁用确认', + nzContent: `确定禁用此文章吗?
`, + // nzOnOk: () => + // this.service.request('', '').subscribe(res => { + // if (res) { + // this.service.msgSrv.success('冻结成功!'); + // this.st.reload(); + // } + // }) + }); + } + start(record: STData) { + this.modalService.confirm({ + nzTitle: '启用确认', + nzContent: `确定启用此文章吗?
`, + // nzOnOk: () => + // this.service.request('', '').subscribe(res => { + // if (res) { + // this.service.msgSrv.success('冻结成功!'); + // this.st.reload(); + // } + // }) + }); + } + recommend(record: STData) { + + } + +} diff --git a/src/app/routes/partner/article-management/services/channel-sales.service.ts b/src/app/routes/partner/article-management/services/channel-sales.service.ts new file mode 100644 index 00000000..6e7cb18c --- /dev/null +++ b/src/app/routes/partner/article-management/services/channel-sales.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class ChannelSalesService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/business-statistics/components/index/index.component.html b/src/app/routes/partner/business-statistics/components/index/index.component.html new file mode 100644 index 00000000..5074b929 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/index/index.component.html @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/app/routes/partner/business-statistics/components/index/index.component.ts b/src/app/routes/partner/business-statistics/components/index/index.component.ts new file mode 100644 index 00000000..a39d1fa2 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/index/index.component.ts @@ -0,0 +1,37 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-partner-business-statistics-index', + templateUrl: './index.component.html', +}) +export class PartnerBusinessStatisticsIndexComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = []; + selectedIndex = 0; + tabs = [ + { + name: '合伙人统计', + value: '0' + }, + { + name: '渠道销售统计', + value: '1' + } + ] + + constructor() { } + + + ngOnInit(): void { } + + + + add(): void { + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.html b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.html new file mode 100644 index 00000000..b6cc6783 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.html @@ -0,0 +1,44 @@ + + + + + + + +
+
+ +
+
+ + + +
+
+
+ + + + diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.less b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.less new file mode 100644 index 00000000..06c7da1f --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.less @@ -0,0 +1,11 @@ +:host { + .user-logo { + width: 90px; + } + + .letf-box { + display: inline-block; + width: 250px; + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.spec.ts b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.spec.ts new file mode 100644 index 00000000..4fddfb5d --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerPartnerCustomDetailComponent } from './partner-custom-detail.component'; + +describe('PartnerPartnerCustomDetailComponent', () => { + let component: PartnerPartnerCustomDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerPartnerCustomDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerPartnerCustomDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.ts b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.ts new file mode 100644 index 00000000..f273d209 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.ts @@ -0,0 +1,163 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { BussinessStatisticsService } from '../../services/bussiness-statistics.service'; + +@Component({ + selector: 'app-partner-partner-custom-detail', + templateUrl: './partner-custom-detail.component.html', + styleUrls: ['./partner-custom-detail.component.less'] +}) +export class PartnerPartnerCustomDetailComponent implements OnInit { + schema: SFSchema = {}; + ui!: SFUISchema; + detailInfo: any = { + logo: './assets/images/user/logo.svg', + company: '张三', + code: '91440300357887492H', + proxy: '企业合伙人', + belongCity: '深圳、上海、北京', + createTime: '2021-09-23 14:43:31' + } + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + _$expand = false; + + constructor(public service: BussinessStatisticsService, public router: Router) { + + } + + get reqParams() { + return { ...this.sf?.value }; + } + + ngOnInit(): void { + this.initST(); + this.initSF(); + } + + resetSF() { + this._$expand = false; + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + /** +* 伸缩查询条件 +*/ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + search() { + this.st.load(1); + } + export() { + + } + + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '客户名称', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '客户状态', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + } + } + this.ui = { + '*': { spanLabelFixed: 100, grid: { span: 11, gutter: 4 } }, + }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '客户名称', index: 'carNo', className: 'text-center', width: 150 }, + { title: '客户状态', render: 'carModelLabel', className: 'text-center', width: 120 }, + { title: '结算时间段', index: 'carNo', className: 'text-center', width: 200 }, + { title: '本月交易数', render: 'approvalStatus0', className: 'text-center', sort: true, width: 150 }, + { title: '客户总数', render: 'approvalStatus', className: 'text-center', sort: true, width: 150 }, + { title: '累计交易数', render: 'approvalStatus1', className: 'text-center', sort: true, width: 120 }, + { title: '本月已结算订单', render: 'approvalStatus2', className: 'text-center', sort: true, width: 180 }, + { title: '累计已结算订单', render: 'approvalStatus3', className: 'text-center', sort: true, width: 180 }, + { title: '本月交易金额(元)', index: 'approvalStatus5', className: 'text-right', sort: true, type: 'currency', width: 180 }, + { title: '累计交易金额(元)', index: 'approvalStatus6', className: 'text-right', sort: true, type: 'currency', width: 180 }, + { title: '本月已结算金额(元)', index: 'approvalStatus7', className: 'text-right', sort: true, type: 'currency', width: 200 }, + { title: '累计已结算金额(元)', index: 'approvalStatus8', className: 'text-right', sort: true, type: 'currency', width: 200 }, + { title: '本月已开票金额(元)', index: 'approvalStatus9', className: 'text-right', sort: true, type: 'currency', width: 200 }, + { title: '累计已开票金额(元)', index: 'approvalStatus10', className: 'text-right', sort: true, type: 'currency', width: 200 }, + { title: '本月申请开票金额(元)', index: 'approvalStatus11', className: 'text-right', sort: true, type: 'currency', width: 200 }, + { + title: '操作', + width: 150, + buttons: [ + { + text: '查看订单明细', + click: (_record) => this.viewOrderDetail(_record) + } + ] + }, + ]; + } + + /** + * 查看订单明细 + * @param record 当前对象 + */ + viewOrderDetail(record: any) { + this.router.navigate([`/partner/business-statistics/partner/custom-order-detail/${record?.id}`]) + } + goBack() { + window.history.go(-1); + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.html b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.html new file mode 100644 index 00000000..227ab356 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.html @@ -0,0 +1,44 @@ + + + + + + + +
+
+ +
+
+ + + +
+
+
+ + + + diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.less b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.less new file mode 100644 index 00000000..06c7da1f --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.less @@ -0,0 +1,11 @@ +:host { + .user-logo { + width: 90px; + } + + .letf-box { + display: inline-block; + width: 250px; + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.spec.ts b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.spec.ts new file mode 100644 index 00000000..dc51f832 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerPartnerCustomOrderDetailComponent } from './partner-custom-order-detail.component'; + +describe('PartnerPartnerCustomOrderDetailComponent', () => { + let component: PartnerPartnerCustomOrderDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerPartnerCustomOrderDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerPartnerCustomOrderDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.ts b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.ts new file mode 100644 index 00000000..71a30096 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.ts @@ -0,0 +1,162 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { BussinessStatisticsService } from '../../services/bussiness-statistics.service'; + +@Component({ + selector: 'app-partner-partner-custom-order-detail', + templateUrl: './partner-custom-order-detail.component.html', + styleUrls: ['./partner-custom-order-detail.component.less'] +}) +export class PartnerPartnerCustomOrderDetailComponent implements OnInit { + schema: SFSchema = {}; + ui!: SFUISchema; + detailInfo: any = { + logo: './assets/images/user/logo.svg', + company: '张三', + code: '91440300357887492H', + proxy: '企业合伙人', + belongCity: '深圳、上海、北京', + createTime: '2021-09-23 14:43:31' + } + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + _$expand = false; + + constructor(public service: BussinessStatisticsService) { + + } + + get reqParams() { + return { ...this.sf?.value }; + } + + ngOnInit(): void { + this.initST(); + this.initSF(); + } + + resetSF() { + this._$expand = false; + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + /** +* 伸缩查询条件 +*/ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + search() { + this.st.load(1); + } + export() { + + } + + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '订单号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '订单状态', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + abnormalCause2: { + title: '开票状态', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + } + } + this.ui = { + '*': { spanLabelFixed: 100, grid: { span: 7, gutter: 4 } }, + }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '订单号', index: 'carNo', className: 'text-center', width: 150 }, + { title: '订单状态', render: 'carModelLabel', className: 'text-center', width: 120 }, + { title: '订单金额(元)', index: 'carNo', className: 'text-center', width: 200 }, + { title: '实际付款金额(元)', render: 'approvalStatus0', className: 'text-center', sort: true, width: 150 }, + { title: '客户附加费率', render: 'approvalStatus', className: 'text-center', sort: true, width: 150 }, + { title: '预估收益(元)', render: 'approvalStatus1', className: 'text-center', sort: true, width: 120 }, + { title: '开票状态', render: 'approvalStatus2', className: 'text-center', sort: true, width: 180 }, + { title: '开票金额(元)', render: 'approvalStatus3', className: 'text-center', sort: true, width: 180 }, + { title: '下单时间', index: 'approvalStatus5', className: 'text-right', sort: true, type: 'currency', width: 180 }, + { + title: '操作', + width: 150, + buttons: [ + { + text: '查看订单详情', + click: (_record) => this.viewOrderDetail(_record) + } + ] + }, + ]; + } + + viewOrderDetail(record: any) { + + } + goBack() { + window.history.go(-1); + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.html b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.html new file mode 100644 index 00000000..6700912c --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.html @@ -0,0 +1,49 @@ + + + + + + + +
+
+ +
+
+ + + + +
+
+
+ + + + diff --git a/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.less b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.less new file mode 100644 index 00000000..06c7da1f --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.less @@ -0,0 +1,11 @@ +:host { + .user-logo { + width: 90px; + } + + .letf-box { + display: inline-block; + width: 250px; + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.spec.ts b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.spec.ts new file mode 100644 index 00000000..a77b84eb --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerPartnerOrderDetailComponent } from './partner-order-detail.component'; + +describe('PartnerPartnerOrderDetailComponent', () => { + let component: PartnerPartnerOrderDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerPartnerOrderDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerPartnerOrderDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.ts b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.ts new file mode 100644 index 00000000..bfda06d7 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.ts @@ -0,0 +1,174 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { BussinessStatisticsService } from '../../services/bussiness-statistics.service'; + +@Component({ + selector: 'app-partner-partner-order-detail', + templateUrl: './partner-order-detail.component.html', + styleUrls: ['./partner-order-detail.component.less'] +}) +export class PartnerPartnerOrderDetailComponent implements OnInit { + schema: SFSchema = {}; + ui!: SFUISchema; + detailInfo: any = { + logo: './assets/images/user/logo.svg', + company: '张三', + code: '91440300357887492H', + proxy: '企业合伙人', + belongCity: '深圳、上海、北京', + createTime: '2021-09-23 14:43:31' + } + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + _$expand = false; + + constructor(public service: BussinessStatisticsService) { + + } + + get reqParams() { + return { ...this.sf?.value }; + } + + ngOnInit(): void { + this.initST(); + this.initSF(); + } + + resetSF() { + this._$expand = false; + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + /** +* 伸缩查询条件 +*/ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + search() { + this.st.load(1); + } + export() { + + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + abnormalCause: { + title: '订单号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '订单状态', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + abnormalCause2: { + title: '开票状态', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + abnormalCause3: { + title: '客户名称', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value, + }, + }, + }, + } + } + this.ui = { + '*': { spanLabelFixed: 100, grid: { span: 8, gutter: 4 } }, + }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '订单号', index: 'carNo', className: 'text-center', width: 150 }, + { title: '订单状态', render: 'carModelLabel', className: 'text-center', width: 120 }, + { title: '订单金额(元)', index: 'carNo', className: 'text-center', width: 200 }, + { title: '实际付款金额(元)', render: 'approvalStatus0', className: 'text-center', sort: true, width: 150 }, + { title: '客户附加费率', render: 'approvalStatus', className: 'text-center', sort: true, width: 150 }, + { title: '预估收益(元)', render: 'approvalStatus1', className: 'text-center', sort: true, width: 120 }, + { title: '开票状态', render: 'approvalStatus2', className: 'text-center', sort: true, width: 180 }, + { title: '开票金额(元)', render: 'approvalStatus3', className: 'text-center', sort: true, width: 180 }, + { title: '下单时间', index: 'approvalStatus5', className: 'text-right', sort: true, type: 'currency', width: 180 }, + { + title: '操作', + width: 150, + buttons: [ + { + text: '查看订单详情', + click: (_record) => this.viewOrderDetail(_record) + } + ] + }, + ]; + } + + viewOrderDetail(record: any) { + + } + goBack() { + window.history.go(-1); + } + + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.html b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.html new file mode 100644 index 00000000..eff67eb6 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + {{item.yskmoney}} + + +
{{item.approvalStatus1 | currency:' '}}
+
+ + {{item.yskmoney | currency:' + '}} + + + +
{{item.yskmoney | currency:' '}}
+
+ +
{{item.armoney | currency:' '}}
+
+
+
diff --git a/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.spec.ts b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.spec.ts new file mode 100644 index 00000000..5396aaf2 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerPartnerStatisticsComponent } from './partner-statistics.component'; + +describe('PartnerPartnerStatisticsComponent', () => { + let component: PartnerPartnerStatisticsComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerPartnerStatisticsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerPartnerStatisticsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.ts b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.ts new file mode 100644 index 00000000..11bca202 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.ts @@ -0,0 +1,99 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { BussinessStatisticsService } from '../../services/bussiness-statistics.service'; + +@Component({ + selector: 'app-partner-partner-statistics', + templateUrl: './partner-statistics.component.html', +}) +export class PartnerPartnerStatisticsComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + ui!: SFUISchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + + constructor(public service: BussinessStatisticsService) { } + /** + * 查询参数 + */ + get reqParams() { + const params = { ...this.sf?.value }; + return params + } + + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '合伙人名称', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '类型', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + } + } + this.ui = { '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 } } }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '合伙人名称', index: 'carNo', className: 'text-center', width: 150 }, + { title: '类型', render: 'carModelLabel', className: 'text-center', width: 150 }, + { title: '注册时间', index: 'carNo', className: 'text-center', width: 150 }, + { title: '本月新增客户', render: 'approvalStatus0', className: 'text-center', sort: true, width: 150 }, + { title: '客户总数', render: 'approvalStatus', className: 'text-center', sort: true, width: 150 }, + { title: '本月已结算金额(元)', render: 'approvalStatus1', className: 'text-right', sort: true, width: 180 }, + { title: '累计已结算金额(元)', render: 'approvalStatus2', className: 'text-right', sort: true, width: 180 }, + { title: '本月预估收益(元)', render: 'approvalStatus3', className: 'text-right', sort: true, width: 180 }, + { title: '累计收益(元)', render: 'approvalStatus4', className: 'text-right', sort: true, width: 180 }, + ]; + } + + resetSF() { + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + + export() { + + } + + + +} diff --git a/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.html b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.html new file mode 100644 index 00000000..b376f70a --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.spec.ts b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.spec.ts new file mode 100644 index 00000000..d88e4632 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerSaleCustomDetailComponent } from './sale-custom-detail.component'; + +describe('PartnerSaleCustomDetailComponent', () => { + let component: PartnerSaleCustomDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerSaleCustomDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerSaleCustomDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.ts b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.ts new file mode 100644 index 00000000..c3a63716 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.ts @@ -0,0 +1,53 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-partner-sale-custom-detail', + templateUrl: './sale-custom-detail.component.html', +}) +export class PartnerSaleCustomDetailComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + detailInfo: any = { + logo: './assets/images/user/logo.svg', + name: '张三', + phone: '1399999999', + proxy: '城市代理', + level: '二级', + createTime: '添加时间' + } + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.html b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.html new file mode 100644 index 00000000..482ccb06 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.spec.ts b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.spec.ts new file mode 100644 index 00000000..673661d9 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerSalePartnerDetailComponent } from './sale-partner-detail.component'; + +describe('PartnerSalePartnerDetailComponent', () => { + let component: PartnerSalePartnerDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerSalePartnerDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerSalePartnerDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.ts b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.ts new file mode 100644 index 00000000..229daf8d --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.ts @@ -0,0 +1,45 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-partner-sale-partner-detail', + templateUrl: './sale-partner-detail.component.html', +}) +export class PartnerSalePartnerDetailComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.html b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.html new file mode 100644 index 00000000..aa6f6c90 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + {{item.yskmoney | currency:' ':false:'1.0-2'}} + + +
{{item.approvalStatus1 | currency:' '}}
+
+ +
{{item.approvalStatus1 | currency:' '}}
+
+ + +
{{item.yskmoney | currency:' '}}
+
+
+
diff --git a/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.spec.ts b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.spec.ts new file mode 100644 index 00000000..bfa13cd2 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerSaleStatisticsComponent } from './sale-statistics.component'; + +describe('PartnerSaleStatisticsComponent', () => { + let component: PartnerSaleStatisticsComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerSaleStatisticsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerSaleStatisticsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.ts b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.ts new file mode 100644 index 00000000..d9279bd2 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.ts @@ -0,0 +1,79 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { BussinessStatisticsService } from '../../services/bussiness-statistics.service'; + +@Component({ + selector: 'app-partner-sale-statistics', + templateUrl: './sale-statistics.component.html', +}) +export class PartnerSaleStatisticsComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + ui!: SFUISchema; + + constructor(public service: BussinessStatisticsService) { } + + /** + * 查询参数 + */ + get reqParams() { + const params = { ...this.sf?.value }; + return params + } + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '渠道销售姓名', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '手机号', + type: 'string', + ui: { + placeholder: '请输入' + }, + }, + } + }; + this.ui = { '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 8 } } }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '联系人', index: 'carNo', className: 'text-center' }, + { title: '手机号', render: 'carModelLabel', className: 'text-center' }, + { title: '添加时间', index: 'carNo', className: 'text-center' }, + { title: '本月新增客户', render: 'approvalStatus', className: 'text-center', sort: true }, + { title: '客户总数', render: 'approvalStatus', className: 'text-center', sort: true }, + { title: '本月新增合伙人', render: 'approvalStatus1', className: 'text-center', sort: true }, + { title: '合伙人总数', render: 'approvalStatus1', className: 'text-center', sort: true }, + { title: '本月已结算金额(元)', render: 'approvalStatus2', className: 'text-right', sort: true }, + { title: '累计已结算金额(元)', render: 'approvalStatus3', className: 'text-right', sort: true }, + ]; + } + export() { + + } + resetSF() { + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } +} diff --git a/src/app/routes/partner/business-statistics/services/bussiness-statistics.service.ts b/src/app/routes/partner/business-statistics/services/bussiness-statistics.service.ts new file mode 100644 index 00000000..894da58b --- /dev/null +++ b/src/app/routes/partner/business-statistics/services/bussiness-statistics.service.ts @@ -0,0 +1,13 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class BussinessStatisticsService extends BaseService { + + $api_get_partner_statistics_page = `/api/fcc/ficoBrmH/list/page`; + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/channel-sales/components/edit/edit.component.html b/src/app/routes/partner/channel-sales/components/edit/edit.component.html new file mode 100644 index 00000000..ba3e7981 --- /dev/null +++ b/src/app/routes/partner/channel-sales/components/edit/edit.component.html @@ -0,0 +1,7 @@ + + + +
+ + +
diff --git a/src/app/routes/partner/channel-sales/components/edit/edit.component.ts b/src/app/routes/partner/channel-sales/components/edit/edit.component.ts new file mode 100644 index 00000000..891e45e3 --- /dev/null +++ b/src/app/routes/partner/channel-sales/components/edit/edit.component.ts @@ -0,0 +1,145 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFAutoCompleteWidgetSchema, SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ChannelSalesService } from '../../services/channel-sales.service'; + +@Component({ + selector: 'app-parter-channel-sales-edit', + templateUrl: './edit.component.html' +}) +export class ParterChannelSalesEditComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ChannelSalesService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name: { + title: '渠道销售姓名', + type: 'string', + maxLength: 12, + ui: { + placeholder:'请输入' + } + }, + phoneNumber: { + title: '手机号', + type: 'string', + maxLength: 11, + ui: { + placeholder:'请输入' + } + }, + employeeVO: { + title: '关联OA员工', + type: 'string', + ui: { + widget: 'autocomplete', + placeholder:'请选择', + asyncData: (input:string) => this.service.request(this.service.$api_fuzzyQuery,{name:input}).pipe( + map((res: any) => { + console.log('111',res) + return []; + }) + ) + } as SFAutoCompleteWidgetSchema, + }, + isAuthorization: { + type: 'string', + title: '授权登录运营后台', + enum: [ + { label: '否', value: '0' }, + { label: '是', value: '1' } + ], + ui: { + widget: 'radio', + } as SFRadioWidgetSchema, + default: '0', + }, + roleIds: { + title: '', + type: 'string', + ui: { + widget: 'select', + placeholder: '授权角色', + mode: 'multiple', + maxMultipleCount: 5, + asyncData: () => { + + return this.service.request(this.service.$api_getAppRoleList).pipe( + map((res: any) => { + return res + .filter((role: any) => role.roleCode !== 'Administrator') + .map((item: any) => { + return { label: item.roleName, value: item.id }; + }); + }) + ); + }, + visibleIf: { isAuthorization: (value: string) => value === '1' } + }, + }, + remark: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请输入50字符' + } as SFTextareaWidgetSchema, + }, + }, + required: ['name', 'phoneNumber', 'employeeVO', 'roleIds', 'remark'] + }; + this.ui = { + '*': { + spanLabelFixed: 150, + grid: { span: 24 } + }, + $isAuthorization:{ grid: { span: 12 }}, + $roleIds:{ spanLabelFixed: 10, grid: { span: 12 }}, + + + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + this.service.request(this.service.$api_save, { ...this.sf.value }).subscribe(res => { + if (res) { + this.modalRef.destroy(true); + } else { + this.service.msgSrv.error(res.msg); + } + }); + } +} diff --git a/src/app/routes/partner/channel-sales/components/list/list.component.html b/src/app/routes/partner/channel-sales/components/list/list.component.html new file mode 100644 index 00000000..589c32e9 --- /dev/null +++ b/src/app/routes/partner/channel-sales/components/list/list.component.html @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/src/app/routes/partner/channel-sales/components/list/list.component.ts b/src/app/routes/partner/channel-sales/components/list/list.component.ts new file mode 100644 index 00000000..25cb97c5 --- /dev/null +++ b/src/app/routes/partner/channel-sales/components/list/list.component.ts @@ -0,0 +1,175 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ChannelSalesService } from '../../services/channel-sales.service'; +import { ParterChannelSalesEditComponent } from '../edit/edit.component'; + +@Component({ + selector: 'app-parter-channel-sales-list', + templateUrl: './list.component.html' +}) +export class ParterChannelSalesListComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + + data=[{name1:1111}] + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: ChannelSalesService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { ...this.sf?.value }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + name: { + type: 'string', + title: '销售渠道姓名' + }, + telephone: { + type: 'string', + title: '手机号' + }, + } + }; + this.ui = { + '*': { + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '销售渠道姓名', + index: 'name' + }, + { + title: '手机号', + index: 'telephone' + }, + { + title: '所属组织', + index: 'organLable' + }, + { + title: '职级', + index: 'station' + }, + { + title: '等级', + index: 'postLevel' + }, + { + title: '省市', + index: 'residencePlace' + }, + { + title: '邀请码', + index: 'inviteCode' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: (_record, _modal, _instance) => this.edit(_record), + }, + { + text: '查看', + click: (_record, _modal, _instance) => this.view(_record), + }, + { + text: '冻结', + click: (_record, _modal, _instance) => this.stop(_record.id), + } + ] + } + ]; + } + + add() { + const modalRef = this.modalService.create({ + nzWidth:600, + nzTitle: '新增', + nzContent: ParterChannelSalesEditComponent, + nzComponentParams: { type: this.spuStatus } + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st.reload(); + } + }); + } + + // 编辑 + edit(record: STData) { + const modalRef = this.modalService.create({ + nzWidth:600, + nzTitle: '编辑', + nzContent: ParterChannelSalesEditComponent, + nzComponentParams: { i: record, type: this.spuStatus } + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st.reload(); + } + }); + } + + // 编辑 + view(record: STData) { + const modalRef = this.modalService.create({ + nzTitle: '查看', + nzContent: ParterChannelSalesEditComponent, + nzComponentParams: { i: record } + }); + } + + stop(id: any) { + this.modalService.confirm({ + nzTitle: '冻结确认', + nzContent: `确定冻结该账号吗?
`, + // nzOnOk: () => + // this.service.request('', '').subscribe(res => { + // if (res) { + // this.service.msgSrv.success('冻结成功!'); + // this.st.reload(); + // } + // }) + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } + + +} diff --git a/src/app/routes/partner/channel-sales/services/channel-sales.service.ts b/src/app/routes/partner/channel-sales/services/channel-sales.service.ts new file mode 100644 index 00000000..358ef4f2 --- /dev/null +++ b/src/app/routes/partner/channel-sales/services/channel-sales.service.ts @@ -0,0 +1,23 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class ChannelSalesService extends BaseService { + + // 保存渠道销售管理 + $api_save = '/api/mdc/channelSalesManagement/save'; + + // 查询渠道销售管理表 + $api_getPage = '/api/mdc/channelSalesManagement/list/page'; + // OA员工模糊查询 + $api_fuzzyQuery = '/api/mdc/channelSalesManagement/fuzzyQuery'; + // 获取角色列表 + $api_getAppRoleList = '/api/mdc/cuc/roleInfo/getRoleList'; + + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.html b/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.html new file mode 100644 index 00000000..dc134ee2 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.html @@ -0,0 +1,9 @@ + + +
+ 结算起算日:指给合伙人结算佣金的起算时间,更换合伙人,该日期是当前合伙人的结算起算日,原合伙人的结算结束时间则为此日期的前一天 +
+
+ + +
diff --git a/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.ts b/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.ts new file mode 100644 index 00000000..8856e337 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.ts @@ -0,0 +1,98 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ClaimAuditService } from '../../services/claim-audit.service'; + + +@Component({ + selector: 'app-parter-claim-audit-channel-approve', + templateUrl: './channel-approve.component.html' +}) +export class ParterClaimAuditListChannelApproveComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ClaimAuditService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name1: { + title: '合伙人(认领人)', + type: 'string', + ui: { + widget: 'text', + } , + }, + name2: { + title: '认领客户名称', + type: 'string', + ui: { + widget: 'text', + } , + }, + data: { + title: '结算起算日期', + type: 'string', + format: 'date', + }, + name3: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请不要超过50个字' + } as SFTextareaWidgetSchema, + }, + }, + required: ['name3'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + }, + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + // this.service.request('', { ...this.sf.value }).subscribe(res => { + // if (res) { + // this.modalRef.destroy(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } + + +} diff --git a/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.html b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.html new file mode 100644 index 00000000..08f52a77 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.html @@ -0,0 +1,62 @@ + + + + + + +
+
+ +
+
+
深圳市XXXXXXX有限公司
+
91440300357887492H
+ + + + + + +
+
+
待审核
+
+ + +
+
+
+
+
+ +
+
+ + 现渠道销售(提交人) + + + + + + +
+
+ +
+
+ + 原渠道销售 + + + + +
+
+
+ + + + + \ No newline at end of file diff --git a/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.less b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.less new file mode 100644 index 00000000..7d4ae911 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.less @@ -0,0 +1,27 @@ +:host { + .head-box { + img { + width: 80px; + height: 80px; + padding: 8px; + } + .right-h{ + font-size: 16px; + } + .right-s{ + color: #7f7f7f; + } + + .left-rt { + font-weight: bold; + font-size: 16px; + text-align: right; + } + + .left-rb { + display: flex; + justify-content: flex-end; + padding-top: 16px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.ts b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.ts new file mode 100644 index 00000000..c3eca870 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.ts @@ -0,0 +1,82 @@ + +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import format from 'date-fns/format'; + +import { ClaimAuditService } from '../../services/claim-audit.service'; +import { ParterClaimAuditListChannelApproveComponent } from '../channel-approve/channel-approve.component'; +import { ParterClaimAuditListChannelRejectComponent } from '../channel-reject/channel-reject.component'; + +@Component({ + selector: 'app-parter-claim-audit-channel-detail', + templateUrl: './channel-detail.component.html', + styleUrls: ['./channel-detail.component.less'] +}) +export class ParterClaimAuditListChannelDetailComponent implements OnInit { + id = this.route.snapshot.queryParams.id; + i: any; + imges: any; + isVisible = false; + columns: STColumn[] = [ + { title: '操作时间', index: 'id', width: 120 }, + { title: '操作人', type: 'img', width: 120, }, + { title: '操作人手机号', index: 'email', width: 120 }, + { title: '操作页面', index: 'phone' }, + { title: '操作内容', index: 'registered' } + ]; + + data=[{id:11111}] + + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + private service: ClaimAuditService, + private modalService: NzModalService, + private router: Router + ) {} + + ngOnInit(): void { + this.initData(); + } + + initData() { + // this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { + // if (res) { + // this.i = res; + // + // } + // }); + } + + approve() { + const modalRef = this.modalService.create({ + nzTitle: '同意', + nzWidth: 700, + nzContent: ParterClaimAuditListChannelApproveComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + reject() { + const modalRef = this.modalService.create({ + nzTitle: '拒绝', + nzWidth: 700, + nzContent: ParterClaimAuditListChannelRejectComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + goBack() { + window.history.go(-1); + } + +} diff --git a/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.html b/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.html new file mode 100644 index 00000000..dc134ee2 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.html @@ -0,0 +1,9 @@ + + +
+ 结算起算日:指给合伙人结算佣金的起算时间,更换合伙人,该日期是当前合伙人的结算起算日,原合伙人的结算结束时间则为此日期的前一天 +
+
+ + +
diff --git a/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.ts b/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.ts new file mode 100644 index 00000000..27566f45 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.ts @@ -0,0 +1,98 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ClaimAuditService } from '../../services/claim-audit.service'; + + +@Component({ + selector: 'app-parter-claim-audit-channel-reject', + templateUrl: './channel-reject.component.html' +}) +export class ParterClaimAuditListChannelRejectComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ClaimAuditService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name1: { + title: '合伙人(认领人)', + type: 'string', + ui: { + widget: 'text', + } , + }, + name2: { + title: '认领客户名称', + type: 'string', + ui: { + widget: 'text', + } , + }, + data: { + title: '结算起算日期', + type: 'string', + format: 'date', + }, + name3: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请不要超过50个字' + } as SFTextareaWidgetSchema, + }, + }, + required: ['name3'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + }, + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + // this.service.request('', { ...this.sf.value }).subscribe(res => { + // if (res) { + // this.modalRef.destroy(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } + + +} diff --git a/src/app/routes/partner/claim-audit/components/list/list.component.html b/src/app/routes/partner/claim-audit/components/list/list.component.html new file mode 100644 index 00000000..8e321e48 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/list/list.component.html @@ -0,0 +1,66 @@ + + + +
+ +
+ +
+ + + +
+ +
+
+ + + +
+
+
+
+ + + + + + + + + + + + + + + diff --git a/src/app/routes/partner/claim-audit/components/list/list.component.ts b/src/app/routes/partner/claim-audit/components/list/list.component.ts new file mode 100644 index 00000000..cf817568 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/list/list.component.ts @@ -0,0 +1,230 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ClaimAuditService } from '../../services/claim-audit.service'; + +@Component({ + selector: 'app-parter-claim-audit-list', + templateUrl: './list.component.html' +}) +export class ParterClaimAuditListComponent implements OnInit { + schema: SFSchema = {}; + columns1!: STColumn[]; + columns2!: STColumn[]; + @ViewChild('st1', { static: false }) + st1!: STComponent; + @ViewChild('st2', { static: false }) + st2!: STComponent; + ui!: SFUISchema; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + _$expand = false; + selectedIndex = 0; + + data=[{name1:1111}] + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: ClaimAuditService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { ...this.sf?.value }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + ngOnInit() { + this.initSF(); + this.initST1(); + this.initST2(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + name: { + type: 'string', + title: '认领人' + }, + name1: { + type: 'string', + title: '客户名称' + }, + name2: { + type: 'string', + title: '平台审核状态' + }, + name3: { + type: 'string', + title: '渠道销售状态', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + name4: { + type: 'string', + title: 'CRM状态', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + } + }; + this.ui = { + '*': { + grid: { span: 8, gutter: 4 } + } + }; + } + + initST1() { + this.columns1 = [ + { + title: '提交人', + index: 'name1' + }, + { + title: '客户名称', + index: 'name1' + }, + { + title: '认领备注', + index: 'name1' + }, + { + title: '渠道销售审核状态', + index: 'name1' + }, + { + title: 'CRM状态', + index: 'name1' + }, + { + title: '平台审核状态', + index: 'name1' + }, + { + title: 'CRM状态', + index: 'name1' + }, + { + title: '提交时间', + index: 'name1' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '详情', + click: (_record, _modal, _instance) => this.partnerView(_record), + }, + { + text: '审核', + click: (_record, _modal, _instance) => this.partnerView(_record), + }, + ] + } + ]; + } + + initST2() { + this.columns2 = [ + { + title: '提交人', + index: 'name1' + }, + { + title: '客户名称', + index: 'name1' + }, + { + title: '认领备注', + index: 'name1' + }, + { + title: 'CRM状态', + index: 'name1' + }, + { + title: '平台审核状态', + index: 'name1' + }, + { + title: '提交时间', + index: 'name1' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '详情', + click: (_record, _modal, _instance) => this.channelView(_record), + }, + { + text: '审核', + click: (_record, _modal, _instance) => this.channelView(_record), + }, + + ] + } + ]; + } + + partnerView(record: STData) { + this.router.navigate(['/partner/claim-audit/partner-detail'], { queryParams: {} }); + } + + channelView(record: STData) { + this.router.navigate(['/partner/claim-audit/channel-detail'], { queryParams: {} }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + search() { + // this.st1?.load(1); + } + + tabChange(index:any){ + console.log(index) + switch (index) { + case 0: + this.initST1(); + break; + case 1: + this.initST2(); + break; + default: + break; + } + } + +} diff --git a/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.html b/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.html new file mode 100644 index 00000000..dc134ee2 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.html @@ -0,0 +1,9 @@ + + +
+ 结算起算日:指给合伙人结算佣金的起算时间,更换合伙人,该日期是当前合伙人的结算起算日,原合伙人的结算结束时间则为此日期的前一天 +
+
+ + +
diff --git a/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.ts b/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.ts new file mode 100644 index 00000000..86f5e72d --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.ts @@ -0,0 +1,98 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ClaimAuditService } from '../../services/claim-audit.service'; + + +@Component({ + selector: 'app-parter-claim-audit-partner-approve', + templateUrl: './partner-approve.component.html' +}) +export class ParterClaimAuditListPartnerApproveComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ClaimAuditService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name1: { + title: '合伙人(认领人)', + type: 'string', + ui: { + widget: 'text', + } , + }, + name2: { + title: '认领客户名称', + type: 'string', + ui: { + widget: 'text', + } , + }, + data: { + title: '结算起算日期', + type: 'string', + format: 'date', + }, + name3: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请不要超过50个字' + } as SFTextareaWidgetSchema, + }, + }, + required: ['name3'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + }, + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + // this.service.request('', { ...this.sf.value }).subscribe(res => { + // if (res) { + // this.modalRef.destroy(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } + + +} diff --git a/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.html b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.html new file mode 100644 index 00000000..c6370656 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.html @@ -0,0 +1,79 @@ + + + + + + +
+
+ +
+
+
深圳市XXXXXXX有限公司
+
91440300357887492H
+ + + + + + +
+
+
待审核
+
+ + +
+
+
+
+
+ +
+
+ + 现合伙人(提交人) + + + + + + + +
+
+ + 现渠道销售 + + + + +
+
+ +
+
+ + 原合伙人 + + + + + +
+
+ + 原渠道销售 + + + + +
+
+
+ + + + diff --git a/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.less b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.less new file mode 100644 index 00000000..403e7692 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.less @@ -0,0 +1,29 @@ +:host { + .head-box { + img { + width : 80px; + height : 80px; + padding: 8px; + } + + .right-h { + font-size: 16px; + } + + .right-s { + color: #7f7f7f; + } + + .left-rt { + font-weight: bold; + font-size : 16px; + text-align : right; + } + + .left-rb { + display : flex; + justify-content: flex-end; + padding-top : 16px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.ts b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.ts new file mode 100644 index 00000000..41f5558f --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.ts @@ -0,0 +1,82 @@ + +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import format from 'date-fns/format'; +import { ClaimAuditService } from '../../services/claim-audit.service'; +import { ParterClaimAuditListPartnerRejectComponent } from '../partner-reject/partner-reject.component'; +import { ParterClaimAuditListPartnerApproveComponent } from '../partner-approve/partner-approve.component'; + +@Component({ + selector: 'app-parter-claim-audit-partner-detail', + templateUrl: './partner-detail.component.html', + styleUrls: ['./partner-detail.component.less'] +}) +export class ParterClaimAuditListPartnerDetailComponent implements OnInit { + id = this.route.snapshot.queryParams.id; + i: any; + imges: any; + isVisible = false; + columns: STColumn[] = [ + { title: '操作时间', index: 'id', width: 120 }, + { title: '操作人', type: 'img', width: 120, }, + { title: '操作人手机号', index: 'email', width: 120 }, + { title: '操作页面', index: 'phone' }, + { title: '操作内容', index: 'registered' } + ]; + + data=[{id:11111}] + + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + private service: ClaimAuditService, + private modalService: NzModalService, + private router: Router + ) {} + + ngOnInit(): void { + this.initData(); + } + + initData() { + // this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { + // if (res) { + // this.i = res; + // + // } + // }); + } + + approve() { + const modalRef = this.modalService.create({ + nzTitle: '同意', + nzWidth: 700, + nzContent: ParterClaimAuditListPartnerApproveComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + reject() { + const modalRef = this.modalService.create({ + nzTitle: '拒绝', + nzWidth: 700, + nzContent: ParterClaimAuditListPartnerRejectComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + goBack() { + window.history.go(-1); + } + + +} diff --git a/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.html b/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.html new file mode 100644 index 00000000..dc134ee2 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.html @@ -0,0 +1,9 @@ + + +
+ 结算起算日:指给合伙人结算佣金的起算时间,更换合伙人,该日期是当前合伙人的结算起算日,原合伙人的结算结束时间则为此日期的前一天 +
+
+ + +
diff --git a/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.ts b/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.ts new file mode 100644 index 00000000..09abe28f --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.ts @@ -0,0 +1,98 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ClaimAuditService } from '../../services/claim-audit.service'; + + +@Component({ + selector: 'app-parter-claim-audit-partner-reject', + templateUrl: './partner-reject.component.html' +}) +export class ParterClaimAuditListPartnerRejectComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ClaimAuditService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name1: { + title: '合伙人(认领人)', + type: 'string', + ui: { + widget: 'text', + } , + }, + name2: { + title: '认领客户名称', + type: 'string', + ui: { + widget: 'text', + } , + }, + data: { + title: '结算起算日期', + type: 'string', + format: 'date', + }, + name3: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请不要超过50个字' + } as SFTextareaWidgetSchema, + }, + }, + required: ['name3'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + }, + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + // this.service.request('', { ...this.sf.value }).subscribe(res => { + // if (res) { + // this.modalRef.destroy(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } + + +} diff --git a/src/app/routes/partner/claim-audit/services/claim-audit.service.ts b/src/app/routes/partner/claim-audit/services/claim-audit.service.ts new file mode 100644 index 00000000..a102b596 --- /dev/null +++ b/src/app/routes/partner/claim-audit/services/claim-audit.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class ClaimAuditService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/knowledge/banner/components/add/add.component.html b/src/app/routes/partner/knowledge/banner/components/add/add.component.html new file mode 100644 index 00000000..6760c1a0 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/add/add.component.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/partner/knowledge/banner/components/add/add.component.spec.ts b/src/app/routes/partner/knowledge/banner/components/add/add.component.spec.ts new file mode 100644 index 00000000..64562645 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/add/add.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { BannerComponentsAddComponent } from './add.component'; + +describe('BannerComponentsAddComponent', () => { + let component: BannerComponentsAddComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BannerComponentsAddComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BannerComponentsAddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/knowledge/banner/components/add/add.component.ts b/src/app/routes/partner/knowledge/banner/components/add/add.component.ts new file mode 100644 index 00000000..132e6bb2 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/add/add.component.ts @@ -0,0 +1,241 @@ +import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import format from 'date-fns/format'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { BannerService } from '../../services/banner.service'; +import { apiConf } from '@conf/api.conf'; + +@Component({ + selector: 'app-ad-components-add', + templateUrl: './add.component.html', + styleUrls: ['./add.less'] +}) +export class BannerComponentsAddComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + record: any = {}; + i: any; + schema: SFSchema = {}; + contentListData = []; + queryParams: any = {}; + oldTakeEffectTime = ''; + maxSort = 0; + isVisible = false; + validFalg = true; + detailData: any = { + advertisementContentDTOList: [] + }; + changeTimeFlag = false; + currentIndex = 0; + addFlag = true; + addId = 1; + inputPoint: any = { + lng: 0, + lat: 0 + }; + today = new Date(); + navData: any = []; + navigationName = ''; + ui: SFUISchema = { + '*': { + spanLabelFixed: 200, + grid: { span: 24 }, + }, + }; + constructor( + public msgSrv: NzMessageService, + public http: _HttpClient, + public service: BannerService, + private route: ActivatedRoute, + private router: Router, + private cdr: ChangeDetectorRef, + private envSrv: EAEnvironmentService, + ) { } + + + ngOnInit(): void { + this.queryParams = this.route.snapshot.queryParams; + if (this.queryParams.type !== 'add') { + this.initDetailData(); + } + this.initSF(); + } + initDetailData() { + + } + initSF() { + this.schema = { + properties: { + name: { + type: 'string', + title: 'banner名称', + maxLength: 10, + ui: { + showRequired: true, + placeholder: '请不要超过10个字', + } + }, + licensePhotoWatermark: { + type: 'string', + title: 'banner图', + ui: { + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '支持JPG、PNG格式,文件小于2M(建议尺寸 700px * 286px)。', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.enterpriseBaseDTO.licensePhoto = args.file.response.data.fullFilePath + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt4M = file.size / 1024 / 1024 < 2; + if (!isLt4M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt4M); + observer.complete(); + }); + }, + previewFile: (file: NzUploadFile) => of(file.url), + }, + }, + sortId: { + type: 'string', + title: '顺序', + ui: { + showRequired: true, + widget: '=', + placeholder: '请输入0~99,数字越大,排序越靠前', + serverSearch: true, + } as SFSelectWidgetSchema, + }, + linkType: { + type: 'string', + title: '跳转路径', + ui: { + widget: 'radio', + showRequired: true, + } as SFRadioWidgetSchema, + enum: [ + { label: '文章ID', value: 1 }, + { label: '分类ID', value: 2 }, + { label: '自编辑', value: 3 }, + ], + }, + content: { + type: 'string', + title: '内容', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 450 + }, + visibleIf: { name5: (value: string) => value === '1' } + }, + }, + }, + required: [], + }; + if (this.queryParams.type === 'add'){ + setTimeout(() => { + this.sf.setValue('/takeEffectType', 1); + this.sf.setValue('/style', 1); + }, 500); + } + } + get reqParams() { + return {}; + } + disabledDate = (current: Date): boolean => { + // Can not select days before today and today + return differenceInCalendarDays(current, this.today) < 0; + } + changeTime(){ + this.changeTimeFlag = true; + } + + + checkSort(){ + const params: any = { + navigationId: this.sf?.value.navigationId, + sortId: this.sf?.value.sortId, + takeEffectType: this.sf?.value.takeEffectType, + }; + if (this.queryParams.id !== '0'){ + params.advertisementId = this.queryParams.id; + } + if (this.sf.value.takeEffectType === 2){ + if (this.changeTimeFlag) { + params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm'); + } else { + params.takeEffectTime = this.detailData.takeEffectTime; + } + } + + } + save() { + const params: any = { + ...this.sf?.value, + latitude: this.inputPoint.lat, + longitude: this.inputPoint.lng, + id: this.queryParams.id + }; + this.detailData.advertisementContentDTOList.forEach((item: any) => { + delete item.addId; + }); + if (this.queryParams.type === 'add') { + delete params.id; + } + if (this.sf.value.takeEffectType === 2){ + if (this.changeTimeFlag) { + params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm'); + } else { + params.takeEffectTime = this.detailData.takeEffectTime; + } + } else { + delete params.takeEffectTime; + } + this.service.request(this.service.$api_add_one, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.router.navigate(['../list'], {relativeTo: this.route}); + } + }); + } + + goBack() { + window.history.go(-1); + } + gotoMap() { + this.isVisible = true; + } + + handleOk(): void { + this.isVisible = false; + } + + handleCancel(): void { + this.isVisible = false; + } +} diff --git a/src/app/routes/partner/knowledge/banner/components/add/add.less b/src/app/routes/partner/knowledge/banner/components/add/add.less new file mode 100644 index 00000000..0a6adacb --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/add/add.less @@ -0,0 +1,119 @@ +:host { + .styleBox { + display: flex; + align-items: flex-end; + margin: 10px 0 0 0; + } + .imgBox { + position: relative; + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + .leftBox, + .rightBox { + position: absolute; + top: 50%; + transform: translate(0, -50%); + } + img { + width: 170px; + height: 40px; + } + .leftBox { + left: 3px; + } + .rightBox { + right: 3px; + } + } + .imgBox_two { + width: 200px; + padding: 6px; + text-align: center; + border: solid 1px #eee; + img { + width: 100%; + height: 40px; + } + } + .imgBox_three { + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + img { + width: 25%; + height: 40px; + margin: 0 6% 0 0; + &:first-child { + margin: 0 6%; + } + } + } + .imgBox_four { + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + img { + width: 22%; + height: 40px; + margin: 0 2% 0 0; + &:first-child { + margin: 0 2%; + } + } + } + .imgBox_one { + width: 60px; + padding: 6px; + text-align: center; + border: solid 1px #eee; + img { + width: 100%; + height: 40px; + } + } + .imgBox_info { + width: 200px; + padding: 6px; + overflow: hidden; + border: solid 1px #eee; + .title { + width: 100%; + line-height: 30px; + text-align: center; + } + .infoBox { + .name { + line-height: 28px; + } + .map { + width: 100%; + text-align: center; + img { + width: 90%; + } + } + } + } + .hint { + margin: 0 0 0 10px; + color: #f00; + } + .addBtn { + margin: 0 0 10px 0; + } + } + .overflowText { + display: -webkit-box; + max-width: 200px; + overflow: hidden; + text-align: left; + text-overflow: -o-ellipsis-lastline; + text-overflow: ellipsis; + -webkit-line-clamp: 1; + line-clamp: 1; + -webkit-box-orient: vertical; + } \ No newline at end of file diff --git a/src/app/routes/partner/knowledge/banner/components/list/list.component.html b/src/app/routes/partner/knowledge/banner/components/list/list.component.html new file mode 100644 index 00000000..c8ac5ec4 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/list/list.component.html @@ -0,0 +1,62 @@ + + + + +
+ +
+ +
+ + + +
+ +
+
+ + + +
+
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + + +
diff --git a/src/app/routes/partner/knowledge/banner/components/list/list.component.less b/src/app/routes/partner/knowledge/banner/components/list/list.component.less new file mode 100644 index 00000000..0aae2779 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/list/list.component.less @@ -0,0 +1 @@ +@import '~@delon/theme/index'; diff --git a/src/app/routes/partner/knowledge/banner/components/list/list.component.spec.ts b/src/app/routes/partner/knowledge/banner/components/list/list.component.spec.ts new file mode 100644 index 00000000..3bd8060c --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/list/list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { BannerComponentsListComponent } from './list.component'; + +describe('BannerComponentsListComponent', () => { + let component: BannerComponentsListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BannerComponentsListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BannerComponentsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/knowledge/banner/components/list/list.component.ts b/src/app/routes/partner/knowledge/banner/components/list/list.component.ts new file mode 100644 index 00000000..e1b86f66 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/list/list.component.ts @@ -0,0 +1,237 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { BannerService } from '../../services/banner.service'; + +@Component({ + selector: 'app-banner-components-list', + templateUrl: './list.component.html', + styleUrls: ['./list.component.less'] +}) + +export class BannerComponentsListComponent implements OnInit { + schema: SFSchema = {}; + columns: STColumn[] = []; + ui: SFUISchema = {}; + appList: any[] = []; + _$expand = false; + selectApp = { + appName: '', + appId: '' + }; + + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + constructor(public service: BannerService, private modal: ModalHelper, private msg: NzMessageService, private router: Router, private modalSrv: NzModalService, private ar: ActivatedRoute) { } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + if (params.status === '') { + delete params.status; + } + if (params.style === '') { + delete params.style; + } + if (params.navigationId === '') { + delete params.navigationId; + } + return { ...params}; + } + + /** + * 选中行 + */ + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + selectAppFun(item: any) { + this.selectApp = item; + 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, + }, + }, + name: { + type: 'string', + title: 'banner名称', + maxLength: 10, + ui: { + widget: '', + placeholder: '请输入', + } + }, + status: { + type: 'string', + title: '状态', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + } as SFSelectWidgetSchema, + enum: [ + { label: '全部', value: 1 }, + { label: '正常', value: 2 }, + { label: '禁用', value: 3 } + ] + }, + }, + }; + this.ui = { + '*': { + spanLabelFixed: 110, + grid: { span: 8 }, + }, + }; + } + + initST() { + this.columns = [ + { + title: 'banner名称', // 位:px + index: 'name', + className: 'text-center' + }, + { + title: 'banner', + index: 'navigationName', + className: 'text-center' + }, + { + title: '排序', // 位 px + index: 'sortId', + className: 'text-center' + }, + { + title: '状态', // 位 px + index: 'style', + className: 'text-center', + type: 'enum', + enum: { + 1: '正常', + 2: '禁用', + } + }, + { + title: '最后修改时间', // 位 px + index: 'createTime', + className: 'text-center' + }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 280, + buttons: [ + { + text: '修改', + click: (item) => { + this.router.navigate(['../detail'], { queryParams: { id: item.id, type: 'edit' }, relativeTo: this.ar }); + } + }, + { + text: '禁用', + pop: { + title: `确定禁用此banner图吗??`, + okType: 'danger', + icon: 'alert', + }, + click: (item) => { + this.changeStatus(item.id); + }, + iif: (item) => item.status === 1 + }, + { + text: '启用', + pop: { + title: `确定启用此banner图吗?`, + okType: 'danger', + icon: 'success', + }, + click: (item) => { + this.changeStatus(item); + }, + iif: (item) => item.status === 2 + }, + ], + }, + ]; + } + changeStatus(item: any) { + const params = { + status, + idList: [item.id] + }; + // this.service.request(this.service.$api_openOrClose, params).subscribe(res => { + // if (res) { + // this.st.reload(); + // } + // }); + } + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 新增单个实例 + */ + add() { + this.router.navigate(['../banner/detail'], { queryParams: { id: 0, type: 'add' }, relativeTo: this.ar }); + } + + /** + * 删除单个实例 + */ + del(item: any) { + const ids = []; + ids.push(item.id); + this.service.request(this.service.$api_del_many, ids).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功'); + this.st.reload(); + } + }); + } +} diff --git a/src/app/routes/partner/knowledge/banner/components/list/list.less b/src/app/routes/partner/knowledge/banner/components/list/list.less new file mode 100644 index 00000000..d9b6c73f --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/list/list.less @@ -0,0 +1,9 @@ +.selectApp { + display: flex; + .appTitle { + font-size: 14px; + } + } + .redfont{ + color: #f00; + } \ No newline at end of file diff --git a/src/app/routes/partner/knowledge/banner/services/banner.service.ts b/src/app/routes/partner/knowledge/banner/services/banner.service.ts new file mode 100644 index 00000000..6710ef04 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/services/banner.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class BannerService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/knowledge/classification/components/edit/edit.component.html b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.html new file mode 100644 index 00000000..855ada53 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.html @@ -0,0 +1,8 @@ + + + + diff --git a/src/app/routes/partner/knowledge/classification/components/edit/edit.component.spec.ts b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.spec.ts new file mode 100644 index 00000000..e31fd9c9 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerEditComponent } from './edit.component'; + +describe('PartnerEditComponent', () => { + let component: PartnerEditComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerEditComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerEditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/knowledge/classification/components/edit/edit.component.ts b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.ts new file mode 100644 index 00000000..817ac254 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.ts @@ -0,0 +1,111 @@ +import { Component, OnInit } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { SFSchema, SFUISchema } from '@delon/form'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { Observable, Observer } from 'rxjs'; +import { ClassificationService } from '../../services/classification.service'; + +@Component({ + selector: 'app-partner-edit', + templateUrl: './edit.component.html', +}) +export class PartnerEditComponent implements OnInit { + record: any = {}; + i: any; + schema!: SFSchema; + ui!: SFUISchema; + status = 'add'; + + constructor( + private modal: NzModalRef, + public service: ClassificationService + ) { } + + ngOnInit(): void { + if (this.i) { + this.i.icon = [ + { + uid: -1, + name: 'xxx.png', + status: 'done', + url: this.i.url, + response: { + resource_id: 1, + }, + }, + ] + } + this.initSF(); + + } + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '分类名称', + type: 'string', + maxLength: 5, + ui: { + placeholder: '请输入', + }, + }, + icon: { + type: 'string', + title: '图标', + ui: { + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg', + limit: 1, + resReName: 'url', + urlReName: 'url', + widget: 'upload', + descriptionI18n: '支持JPG、PNG格式,文件小于2M(建议尺寸 88px * 88px)', + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } + }, + abnormalCause2: { + title: '排序', + type: 'number', + maximum: 99, + minimum: 0, + ui: { + placeholder: '请输入', + widgetWidth: 350 + } + }, + }, + required: ['abnormalCause', 'icon', 'abnormalCause2'] + + } + this.ui = { '*': { spanLabelFixed: 90, grid: { span: 20, gutter: 4 } }, }; + + } + + save(value: any): void { + this.service.request(`/user/${this.record.id}`, value).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.modal.close(true); + } + + }); + } + + close(): void { + this.modal.destroy(); + } +} diff --git a/src/app/routes/partner/knowledge/classification/components/list/list.component.html b/src/app/routes/partner/knowledge/classification/components/list/list.component.html new file mode 100644 index 00000000..2947e9a8 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/list/list.component.html @@ -0,0 +1,28 @@ + + + +
+
+ +
+
+ + +
+
+
+ + +
+ +
+ + + + + +
diff --git a/src/app/routes/partner/knowledge/classification/components/list/list.component.spec.ts b/src/app/routes/partner/knowledge/classification/components/list/list.component.spec.ts new file mode 100644 index 00000000..f63ab2ec --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/list/list.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerListComponent } from './list.component'; + +describe('PartnerListComponent', () => { + let component: PartnerListComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/knowledge/classification/components/list/list.component.ts b/src/app/routes/partner/knowledge/classification/components/list/list.component.ts new file mode 100644 index 00000000..db88bed4 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/list/list.component.ts @@ -0,0 +1,173 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { PartnerAccountManagementVirtualAccountDetailComponent } from 'src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component'; +import { AccountManagemantService } from 'src/app/routes/partner/account-management/services/account-managemant.service'; +import { PartnerEditComponent } from '../edit/edit.component'; + +@Component({ + selector: 'app-partner-list', + templateUrl: './list.component.html', +}) +export class PartnerKnowledgeClassificationListComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + ui!: SFUISchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + + constructor(public service: AccountManagemantService, public modal: NzModalService) { } + /** + * 查询参数 + */ + get reqParams() { + const params = { ...this.sf?.value }; + return params + } + + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '分类ID', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '分类名称', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause2: { + title: '状态', + type: 'string', + enum: [ + { label: '全部', value: '' }, + { label: '正常', value: '1' }, + { label: '禁用', value: '2' } + ], + default: '', + }, + } + } + this.ui = { '*': { spanLabelFixed: 90, grid: { span: 8, gutter: 4 } }, }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '分类ID', index: 'carNo', className: 'text-center', width: 150 }, + { title: '分类名称', render: 'carModelLabel', className: 'text-center', width: 200 }, + { title: '图标', render: 'icon', className: 'text-center', width: 200 }, + { title: '文章数', render: 'approvalStatus2', className: 'text-center', width: 120 }, + { title: '排序', render: 'approvalStatus3', className: 'text-center', width: 120 }, + { title: '状态', index: 'approvalStatus4', className: 'text-center', width: 120 }, + { title: '最后修改时间', index: 'approvalStatus4', className: 'text-center', width: 180 }, + { + title: '操作', + width: 150, + buttons: [ + { + text: '修改', + click: (_record) => this.edit(_record) + }, + { + text: '启用', + click: (_record) => this.operate(_record, 1) + }, + { + text: '禁用', + click: (_record) => this.operate(_record, 2) + } + ] + } + ]; + } + + resetSF() { + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + + /** + *新增 + * @param _record 当前行信息 + */ + add() { + const modalRef = this.modal.create({ + nzTitle: '新增分类', + nzContent: PartnerEditComponent, + nzWidth: 600, + nzComponentParams: { + i: null + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: any) => { + if (res) { + this.st.load(1); + } + }); + } + + /** + *编辑 + * @param _record 当前行信息 + */ + edit(record: any) { + const modalRef = this.modal.create({ + nzTitle: '修改分类', + nzContent: PartnerEditComponent, + nzWidth: 600, + nzComponentParams: { + i: record + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: any) => { + if (res) { + this.st.load(1); + } + }); + } + + /** + *禁用或者启动 + * @param _record 当前行信息 + */ + operate(record: any, type = 1) { + this.modal.confirm({ + nzTitle: `确定${type === 1 ? '启用' : '禁用'}此分类吗?`, + nzOnOk: () => + this.service.request(this.service.$api_edit_one, { id: record.id }).subscribe((res) => { + if (res) { + this.st.load(1); + this.service.msgSrv.success(`${type === 1 ? '启用' : '禁用'}成功!`); + } + }), + }); + } + + /** + * + */ + export() { + + } + +} diff --git a/src/app/routes/partner/knowledge/classification/services/classification.service.ts b/src/app/routes/partner/knowledge/classification/services/classification.service.ts new file mode 100644 index 00000000..034cdb74 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/services/classification.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class ClassificationService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/level-config/components/edit/edit.component.html b/src/app/routes/partner/level-config/components/edit/edit.component.html new file mode 100644 index 00000000..ba3e7981 --- /dev/null +++ b/src/app/routes/partner/level-config/components/edit/edit.component.html @@ -0,0 +1,7 @@ + + + +
+ + +
diff --git a/src/app/routes/partner/level-config/components/edit/edit.component.ts b/src/app/routes/partner/level-config/components/edit/edit.component.ts new file mode 100644 index 00000000..029381d5 --- /dev/null +++ b/src/app/routes/partner/level-config/components/edit/edit.component.ts @@ -0,0 +1,85 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ChannelSalesService } from '../../services/level-config.service'; + +@Component({ + selector: 'app-parter-LevelConfig-edit', + templateUrl: './edit.component.html' +}) +export class ParterLevelConfigEditComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ChannelSalesService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + gradeName: { + title: '等级名称', + type: 'string', + }, + sortId: { + title: '排序', + type: 'string', + }, + remark: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请输入50字符' + } as SFTextareaWidgetSchema, + }, + }, + required: ['gradeName', 'sortId', 'remark'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + }, + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + this.service.request(this.service.$api_save, { ...this.sf.value }).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功!') + this.modalRef.destroy(true); + } else { + this.service.msgSrv.error(res.msg); + } + }); + } +} diff --git a/src/app/routes/partner/level-config/components/list/list.component.html b/src/app/routes/partner/level-config/components/list/list.component.html new file mode 100644 index 00000000..e6f50f99 --- /dev/null +++ b/src/app/routes/partner/level-config/components/list/list.component.html @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/src/app/routes/partner/level-config/components/list/list.component.ts b/src/app/routes/partner/level-config/components/list/list.component.ts new file mode 100644 index 00000000..e079f0e7 --- /dev/null +++ b/src/app/routes/partner/level-config/components/list/list.component.ts @@ -0,0 +1,190 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ChannelSalesService } from '../../services/level-config.service'; +import { ParterLevelConfigEditComponent } from '../edit/edit.component'; + +@Component({ + selector: 'app-parter-LevelConfig-list', + templateUrl: './list.component.html' +}) +export class ParterLevelConfigListComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + + data=[{name1:1111}] + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: ChannelSalesService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { ...this.sf?.value }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + gradeName: { + type: 'string', + title: '等级姓名', + }, + stateLocked: { + type: 'string', + title: '状态', + enum:[{label:'启用',value:'1'},{label:'禁用',value:'0'}], + ui:{ + widget:'select', + } + }, + } + }; + this.ui = { + '*': { + width:300, + grid: { span: 12, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '等级姓名', + index: 'gradeName' + }, + { + title: '备注', + index: 'remark' + }, + { + title: '创建时间', + index: 'createTime' + }, + { + title: '启用时间', + index: 'enableTime' + }, + { + title: '状态', + index: 'stateLocked', + format: (item: any) => { + return item.stateLocked ? '禁用':'启用' + } + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: (_record, _modal, _instance) => this.edit(_record), + }, + { + text: '禁用', + click: (_record, _modal, _instance) => this.stop(_record), + iif:(item)=>!item.stateLocked + }, + { + text: '启用', + click: (_record, _modal, _instance) => this.restart(_record), + iif:(item)=>item.stateLocked + } + ] + } + ]; + } + + add() { + const modalRef = this.modalService.create({ + nzWidth:500, + nzTitle: '新增', + nzContent: ParterLevelConfigEditComponent, + nzComponentParams: { type: this.spuStatus } + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st.reload(); + } + }); + } + + // 编辑 + edit(record: STData) { + const modalRef = this.modalService.create({ + nzWidth:500, + nzTitle: '编辑', + nzContent: ParterLevelConfigEditComponent, + nzComponentParams: { i: record, type: this.spuStatus } + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st.reload(); + } + }); + } + + // 编辑 + view(record: STData) { + const modalRef = this.modalService.create({ + nzTitle: '查看', + nzContent: ParterLevelConfigEditComponent, + nzComponentParams: { i: record } + }); + } + + restart(item: any) { + this.modalService.confirm({ + nzTitle: '启用确认', + nzContent: `确定启用该账号吗?
`, + nzOnOk: () => + this.service.request(this.service.$api_updatePartnerGradeConfig, {id:item.id}).subscribe(res => { + if (res) { + this.service.msgSrv.success('启用成功!'); + this.st.reload(); + } + }) + }); + } + stop(item: any) { + this.modalService.confirm({ + nzTitle: '禁用确认', + nzContent: `确定禁用该账号吗?
`, + nzOnOk: () => + this.service.request(this.service.$api_updatePartnerGradeConfig, {id:item.id}).subscribe(res => { + if (res) { + this.service.msgSrv.success('禁用成功!'); + this.st.reload(); + } + }) + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } + + +} diff --git a/src/app/routes/partner/level-config/services/level-config.service.ts b/src/app/routes/partner/level-config/services/level-config.service.ts new file mode 100644 index 00000000..df8e18b3 --- /dev/null +++ b/src/app/routes/partner/level-config/services/level-config.service.ts @@ -0,0 +1,22 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class ChannelSalesService extends BaseService { + // 查询合伙人等级配置表 + $api_getList = '/api/mdc/partnerGradeConfig/list/page'; + // 获取合伙人等级配置表 + $api_getPartnerGradeConfig = '/api/mdc/partnerGradeConfig/get'; + // 保存合伙人等级配置表 + $api_save = '/api/mdc/partnerGradeConfig/save'; + // 删除合伙人等级配置表 + $api_del = '/api/mdc/partnerGradeConfig/deletebatch'; + // 启用/禁用等级配置 + $api_updatePartnerGradeConfig = '/api/mdc/partnerGradeConfig/updatePartnerGradeConfig'; + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.html b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.html new file mode 100644 index 00000000..4df4ab9b --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.html @@ -0,0 +1,85 @@ + + + + + +
企业基本信息
+
+ +
+ 请上传营业执照原件的高清照片,若上传复印件,则需加盖公司印章; +
上传后系统会自动识别并填写
+
+
+ +
万元
+
+ + + +
营业执照法人信息
+
+ +
+
请上传身份证原件的高清照片,若上传复印件,则需申请人签字;
+
上传后系统会自动识别并填写
+
+
+ +
+
+
正面照(人像面)
+
示例
+
+
+
+
+ +
+
+
背面照(国徽面)
+
示例
+
+
+
+
+ + + +
企业管理员信息
+
+ +
+
+
正面照(人像面)
+
示例
+
+
+
+
+ +
+
+
背面照(国徽面)
+
示例
+
+
+
+
+ + + +
所属城市
+
+ + + +
渠道销售
+
+
+ +
+ + +
+
diff --git a/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.less b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.less new file mode 100644 index 00000000..6b70e074 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.less @@ -0,0 +1,68 @@ +:host { + ::ng-deep { + nz-card { + + .pr { + position: relative; + } + + .pa { + position: absolute; + top : 50px; + left : 150px; + } + + .tips { + display : flex; + margin-bottom: 0; + color : #333; + + dt { + width: 150px; + } + + dd { + width : 190px; + margin-bottom: 0; + text-align : center; + } + } + + .form-title { + margin-bottom: 10px; + padding-left : 8px; + color : #333; + font-weight : 700; + font-size : 18px; + line-height : 20px; + border-left : solid 3px #1890ff; + } + + } + + .ant-form-item { + margin-left: 180px; + } + + nz-date-picker, + nz-input-number { + width: 100% !important; + } + + .input-back { + nz-form-item { + margin-left: 0px; + + .ant-form-item-label { + flex: 0 !important; + } + + .ant-form-item-control { + max-width : 100% !important; + margin-left: 20px !important; + } + } + } + + } + } \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.ts b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.ts new file mode 100644 index 00000000..8ad008d2 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.ts @@ -0,0 +1,592 @@ +import { Component, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { + SFUploadWidgetSchema, + SFComponent, + SFSchema, + SFUISchema, + SFDateWidgetSchema, + SFCheckboxWidgetSchema, + SFTreeSelectWidgetSchema +} from '@delon/form'; +import { NzTreeNode } from 'ng-zorro-antd/tree'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; + +import { PartnerListService } from '../../services/partner-list.service'; + +const IMAGECONFIG = { + previewFile: (file: NzUploadFile) => of(file.url), + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + fileSize: 5120, + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + name: 'multipartFile', + multiple: false, + listType: 'picture-card' +} as SFUploadWidgetSchema; + +const DATECONFIG = { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择' +}; + +@Component({ + selector: 'app-add-etp-partner', + templateUrl: './add-etp-partner.component.html', + styleUrls: ['./add-etp-partner.component.less'] +}) +export class AddEtpPartnerComponent { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + schema: SFSchema = this.initBasicInfoSF(); + ui: SFUISchema = { + '*': { + spanLabelFixed: 180, + grid: { span: 24 } + }, + $_basicInfoTitle: { + spanLabelFixed: 0 + }, + $_legalPersontitle: { + spanLabelFixed: 0 + }, + $_isLoingDate: { + spanLabelFixed: 100, + grid: { xxl: 6, xl: 6, lg: 4, md: 6 } + } + }; + + constructor(public service: PartnerListService) {} + + submitForm() { + if (!this.sf.valid) { + this.sf.validator({ emitError: true }); + this.service.msgSrv.warning('请修改填写错误信息'); + return; + } + if (this.sf.value.cityCodesList?.length > 3) { + this.sf.validator({ emitError: true }); + this.service.msgSrv.warning('所属城市不能超过3个'); + return; + } + // 校验企业营业期限 + const operatingStartTime = new Date(this.sf.value.operatingStartTime); + const operatingEndTime = new Date(this.sf.value.operatingEndTime); + if (operatingStartTime.getTime() > operatingEndTime.getTime()) { + this.service.msgSrv.warning('营业截止日期不能小于开始日期'); + return; + } + // 校验法人证件有效期限 + if (this.sf.value.legalPersonIdentity.validEndTime) { + const validStartTime = new Date(this.sf.value.legalPersonIdentity.validStartTime); + const validEndTime = new Date(this.sf.value.legalPersonIdentity.validEndTime); + if (validStartTime.getTime() > validEndTime.getTime()) { + this.service.msgSrv.warning('法人证件有效截止日期不能小于开始日期'); + return; + } + } + // 校验管理员证件有效期限 + if (this.sf.value.adminUserInfo.validEndTime) { + const validStartTime = new Date(this.sf.value.adminUserInfo.validStartTime); + const validEndTime = new Date(this.sf.value.adminUserInfo.validEndTime); + if (validStartTime.getTime() > validEndTime.getTime()) { + this.service.msgSrv.warning('管理员证件有效截止日期小于开始日期'); + return; + } + } + const params = {}; + Object.assign(params, { ...this.sf.value, source: 2 }); + // console.log(params); + + this.service.request(this.service.$api_save_entp_partner, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('新增企业合伙人成功'); + this.goBack(); + } + }); + } + + /* + * 根据地区code查询地区列表 + */ + getRegionDetailByCode(regionCode: any) { + return this.service.request(this.service.$api_get_region_by_code, { regionCode }); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string, type: number) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + if (type === 1) { + // 法定代表人证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.sf.setValue('/legalPersonIdentity/name', res.name); + } + if (res.number) { + this.sf.setValue('/legalPersonIdentity/certificateType', 0); + this.sf.setValue('/legalPersonIdentity/certificateNumber', res.number); + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.sf.setValue('/legalPersonIdentity/validStartTime', res.validFrom); + } + if (res.validTo) { + this.sf.setValue('/legalPersonIdentity/validEndTime', res.validTo); + this.sf.setValue('/legalPersonIdentity/_isLoingDate', false); + } else { + this.sf.setValue('/legalPersonIdentity/_isLoingDate', true); + } + } + } + // 企业管理员证件照 + if (type === 0) { + if (isFront === 'front') { + // 正面 + if (res.name) { + this.sf.setValue('/adminUserInfo/name', res.name); + } + if (res.number) { + this.sf.setValue('/adminUserInfo/certificateNumber', res.number); + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.sf.setValue('/adminUserInfo/validStartTime', res.validFrom); + } + if (res.validTo) { + this.sf.setValue('/adminUserInfo/validEndTime', res.validTo); + this.sf.setValue('/adminUserInfo/_isLoingDate', false); + } else { + this.sf.setValue('/adminUserInfo/_isLoingDate', true); + } + } + } + } + }); + } + + // 识别营业执照 + checkBusinessLicense(imgurl: any) { + this.service.request(this.service.$api_ocr_recognize_business_license, { businessLicenseUrl: imgurl }).subscribe(res => { + if (res) { + if (res.registrationNumber) { + this.sf.setValue('/unifiedSocialCreditCode', res.registrationNumber); + } + if (res.name) { + this.sf.setValue('/enterpriseName', res.name); + } + if (res.businessTermStartDate) { + this.sf.setValue('/operatingStartTime', res.businessTermStartDate); + } + if (res.businessTermEndDate) { + this.sf.setValue('/operatingEndTime', res.businessTermEndDate); + this.sf.setValue('/_isLoingDate', false); + } else { + this.sf.setValue('/_isLoingDate', true); + } + } + }); + } + + goBack() { + window.history.go(-1); + } + + private initBasicInfoSF(): SFSchema { + return { + properties: { + // 企业基本信息 + _basicInfoTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + _licenseTips: { title: '营业执照', type: 'string', ui: { widget: 'custom' }, default: true }, + licensePhoto: { title: '', type: 'string', ui: { hidden: true } }, + licensePhotoWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/licensePhoto', args.fileList[0].response.data.fullFilePath); + this.checkBusinessLicense(args.fileList[0].response.data.fullFilePath); + } + } + } as SFUploadWidgetSchema + }, + unifiedSocialCreditCode: { + title: '统一社会信用代码', + type: 'string', + minLength: 1, + maxLength: 30, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + optionalHelp: + '为了企业用户的使用体验,若公司代码即统一社会信用代码已在本应用其他关联平台注册,则此处填写的公司资料将同步更新至对应已注册的平台', + placeholder: '请输入营业执照上的统一社会信用代码', + errors: { + required: '请输入18位公司代码' + } + } + }, + enterpriseName: { + title: '公司名称', + type: 'string', + minLength: 1, + maxLength: 100, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入营业执照上的统一社会信用代码', + errors: { + required: '请输入公司名称' + } + } + }, + operatingStartTime: { + title: '营业期限', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + operatingEndTime: { + title: '', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 20, md: 18 }, + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf?.setValue('/_isLoingDate', false); + } + } as SFDateWidgetSchema + }, + _isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + class: 'input-back', + widget: 'checkbox', + change: i => this.sf?.setValue('/operatingEndTime', null) + } as SFCheckboxWidgetSchema + }, + + // 法人信息 + legalPersonIdentity: { + type: 'object', + properties: { + _legalPersontitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + _certificatePhototips: { title: '法定代表人证件照', type: 'string', ui: { widget: 'custom' }, default: true }, + _certificatePhotoExmplateA: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/legalPersonIdentity/certificatePhotoFront', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 1); + } + } + } as SFUploadWidgetSchema + }, + _certificatePhotoExmplateB: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/legalPersonIdentity/certificatePhotoBack', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back', 1); + } + } + } as SFUploadWidgetSchema + }, + name: { + title: '法人代表姓名', + type: 'string', + maxLength: 8, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入营业执照上的法人姓名' + } + }, + certificateType: { + type: 'string', + title: '法人证件类型', + enum: [ + { label: '大陆身份证', value: 0 }, + { label: '港澳居民通行证', value: 1 }, + { label: '香港居民通行证', value: 2 } + ], + default: 0, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'select' + } + }, + certificateNumber: { + title: ' 法定代表人证件号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入法定代表人证件号' + } + }, + validStartTime: { + title: '法人证件有效开始日期', + type: 'string', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + validEndTime: { + title: '法人证件有效截止日期', + type: 'string', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf?.setValue('/legalPersonIdentity/_isLoingDate', false); + } + } as SFDateWidgetSchema + }, + _isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + spanLabelFixed: 100, + grid: { span: 6 }, + class: 'input-back', + widget: 'checkbox', + change: i => this.sf?.setValue('/legalPersonIdentity/validEndTime', null) + } as SFCheckboxWidgetSchema + } + }, + required: [ + '_certificatePhototips', + 'certificatePhotoFront', + 'certificatePhotoBack', + 'name', + 'certificateType', + 'certificateNumber', + 'validStartTime' + ] + }, + _adminTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + adminMobile: { + title: ' 企业管理员手机号', + type: 'string', + minLength: 1, + format: 'mobile', + maxLength: 11, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入企业管理员手机号', + errors: { required: '请输入企业管理员手机号', format: '手机号格式错误' } + } + }, + // 企业管理员信息 + adminUserInfo: { + type: 'object', + properties: { + _adminCertificatePhotoTipsA: { + title: '企业管理员证件照', + type: 'string', + ui: { + widget: 'custom' + }, + default: true + }, + certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/adminUserInfo/certificatePhotoFront', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 0); + } + } + } as SFUploadWidgetSchema + }, + _adminCertificatePhotoTipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6 + } + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/adminUserInfo/certificatePhotoBack', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back', 0); + } + } + } as SFUploadWidgetSchema + }, + name: { + title: '企业管理员姓名', + type: 'string', + maxLength: 8, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入企业管理员姓名' + } + }, + certificateNumber: { + title: '企业管理员身份证号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入企业管理员身份证号' + } + }, + validStartTime: { + title: '身份证有效开始日期', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + validEndTime: { + title: '身份证有效截止日期', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 20, md: 18 }, + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf?.setValue('/adminUserInfo/_isLoingDate', false); + } + } as SFDateWidgetSchema + }, + _isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + spanLabelFixed: 100, + grid: { span: 6 }, + class: 'input-back', + widget: 'checkbox', + change: i => this.sf?.setValue('/adminUserInfo/validEndTime', null) + } as SFCheckboxWidgetSchema + } + }, + required: ['_adminCertificatePhotoTipsA', 'name', 'certificateNumber', 'operatingStartTime'] + }, + // 所属城市 + _addressTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + cityCodesList: { + type: 'string', + title: '所属城市', + ui: { + widget: 'tree-select', + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请选择城市(最多3个)', + checkable: true, + class: 'city-tree-select', + asyncData: () => + this.getRegionDetailByCode('').pipe( + map((res: any) => + res.map((item: any) => ({ ...item, title: item.name, key: item.regionCode, disabled: true, isDisableCheckbox: true })) + ) + ), + expandChange: ({ node }: { node: NzTreeNode }) => + this.getRegionDetailByCode(node.key).pipe( + map((res: any) => res.map((item: any) => ({ ...item, title: item.name, key: item.regionCode, isLeaf: true }))) + ) + } as SFTreeSelectWidgetSchema + }, + // 渠道销售 + _channelTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + invitationCode: { + title: '渠道销售邀请码', + type: 'string', + minLength: 1, + maxLength: 100, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入渠道销售邀请码', + errors: { + required: '请输入渠道销售邀请码' + } + } + } + }, + required: [ + '_licenseTips', + 'licensePhotoWatermark', + 'unifiedSocialCreditCode', + 'enterpriseName', + 'operatingStartTime', + 'cityCodesList', + 'adminMobile', + 'invitationCode' + ] + }; + } +} diff --git a/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.html b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.html new file mode 100644 index 00000000..cb94b51b --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.html @@ -0,0 +1,42 @@ + + + + + +
合伙人信息
+
+ +
+
+
正面照(人像面)
+
示例
+
+
+
+
+ +
+
+
背面照(国徽面)
+
示例
+
+
+
+
+ + + +
所属城市
+
+ + + +
渠道销售
+
+
+ +
+ + +
+
diff --git a/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.less b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.less new file mode 100644 index 00000000..6b70e074 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.less @@ -0,0 +1,68 @@ +:host { + ::ng-deep { + nz-card { + + .pr { + position: relative; + } + + .pa { + position: absolute; + top : 50px; + left : 150px; + } + + .tips { + display : flex; + margin-bottom: 0; + color : #333; + + dt { + width: 150px; + } + + dd { + width : 190px; + margin-bottom: 0; + text-align : center; + } + } + + .form-title { + margin-bottom: 10px; + padding-left : 8px; + color : #333; + font-weight : 700; + font-size : 18px; + line-height : 20px; + border-left : solid 3px #1890ff; + } + + } + + .ant-form-item { + margin-left: 180px; + } + + nz-date-picker, + nz-input-number { + width: 100% !important; + } + + .input-back { + nz-form-item { + margin-left: 0px; + + .ant-form-item-label { + flex: 0 !important; + } + + .ant-form-item-control { + max-width : 100% !important; + margin-left: 20px !important; + } + } + } + + } + } \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.ts b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.ts new file mode 100644 index 00000000..eca02366 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.ts @@ -0,0 +1,314 @@ +import { Component, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { + SFUploadWidgetSchema, + SFComponent, + SFSchema, + SFUISchema, + SFDateWidgetSchema, + SFCheckboxWidgetSchema, + SFTreeSelectWidgetSchema +} from '@delon/form'; +import { NzTreeNode } from 'ng-zorro-antd/tree'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; + +import { PartnerListService } from '../../services/partner-list.service'; + +const IMAGECONFIG = { + previewFile: (file: NzUploadFile) => of(file.url), + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + fileSize: 5120, + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + name: 'multipartFile', + multiple: false, + listType: 'picture-card' +} as SFUploadWidgetSchema; + +const DATECONFIG = { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择' +}; + +@Component({ + selector: 'app-add-personal-partner', + templateUrl: './add-personal-partner.component.html', + styleUrls: ['./add-personal-partner.component.less'] +}) +export class AddPersonalPartnerComponent { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + schema: SFSchema = this.initBasicInfoSF(); + ui: SFUISchema = { + '*': { + spanLabelFixed: 180, + grid: { span: 24 } + }, + $_basicInfoTitle: { + spanLabelFixed: 0 + }, + $_legalPersontitle: { + spanLabelFixed: 0 + }, + $_isLoingDate: { + spanLabelFixed: 100, + grid: { xxl: 6, xl: 6, lg: 4, md: 6 } + } + }; + + constructor(private router: Router, public service: PartnerListService) {} + + submitForm() { + if (!this.sf.valid) { + this.sf.validator({ emitError: true }); + this.service.msgSrv.warning('请修改填写错误信息'); + return; + } + if (this.sf.value.cityCodesList?.length > 3) { + this.sf.validator({ emitError: true }); + this.service.msgSrv.warning('所属城市不能超过3个'); + return; + } + if (this.sf.value.validEndTime) { + const validStartTime = new Date(this.sf.value.validStartTime); + const validEndTime = new Date(this.sf.value.validEndTime); + if (validStartTime.getTime() > validEndTime.getTime()) { + this.service.msgSrv.warning('身份证有效截止日期不能小于开始日期'); + return; + } + } + const params = {}; + Object.assign(params, { ...this.sf.value, source: 2 }); + + this.service.request(this.service.$api_save_personal_partner, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('新增个人合伙人成功'); + this.goBack(); + } + }); + } + + /* + * 根据地区code查询地区列表 + */ + getRegionDetailByCode(regionCode: any) { + return this.service.request(this.service.$api_get_region_by_code, { regionCode }); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + // 法定代表人证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.sf.setValue('/adminUserInfo/name', res.name); + } + if (res.number) { + this.sf.setValue('/adminUserInfo/certificateType', 0); + this.sf.setValue('/adminUserInfo/certificateNumber', res.number); + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.sf.setValue('/adminUserInfo/validStartTime', res.validFrom); + } + if (res.validTo) { + this.sf.setValue('/adminUserInfo/validEndTime', res.validTo); + this.sf.setValue('/adminUserInfo/_isLoingDate', false); + } else { + this.sf.setValue('/adminUserInfo/_isLoingDate', true); + } + } + } + }); + } + + goBack() { + window.history.go(-1); + } + + private initBasicInfoSF(): SFSchema { + return { + properties: { + _adminTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + mobile: { + title: ' 手机号', + type: 'string', + minLength: 1, + format: 'mobile', + maxLength: 11, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入手机号', + errors: { required: '请输入手机号', format: '手机号格式错误' } + } + }, + // 合伙人信息 + adminUserInfo: { + type: 'object', + properties: { + _adminCertificatePhotoTipsA: { + title: '证件照', + type: 'string', + ui: { + widget: 'custom' + }, + default: true + }, + certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, + certificateType: { title: '', type: 'string', ui: { hidden: true }, default: 0 }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/adminUserInfo/certificatePhotoFront', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front'); + } + } + } as SFUploadWidgetSchema + }, + _adminCertificatePhotoTipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6 + } + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/adminUserInfo/certificatePhotoBack', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back'); + } + } + } as SFUploadWidgetSchema + }, + name: { + title: '姓名', + type: 'string', + maxLength: 8, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入姓名' + } + }, + certificateNumber: { + title: '身份证号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入身份证号' + } + }, + validStartTime: { + title: '身份证有效开始日期', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + validEndTime: { + title: '身份证有效截止日期', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 20, md: 18 }, + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf?.setValue('/adminUserInfo/_isLoingDate', false); + } + } as SFDateWidgetSchema + }, + _isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + spanLabelFixed: 100, + grid: { span: 6 }, + class: 'input-back', + widget: 'checkbox', + change: i => this.sf?.setValue('/adminUserInfo/validEndTime', null) + } as SFCheckboxWidgetSchema + } + }, + required: ['_adminCertificatePhotoTipsA', 'adminMobile', 'name', 'certificateNumber', 'validStartTime'] + }, + // 所属城市 + _addressTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + cityCodesList: { + type: 'string', + title: '所属城市', + ui: { + widget: 'tree-select', + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请选择城市(最多3个)', + checkable: true, + class: 'city-tree-select', + asyncData: () => + this.getRegionDetailByCode('').pipe( + map((res: any) => + res.map((item: any) => ({ ...item, title: item.name, key: item.regionCode, disabled: true, isDisableCheckbox: true })) + ) + ), + expandChange: ({ node }: { node: NzTreeNode }) => + this.getRegionDetailByCode(node.key).pipe( + map((res: any) => res.map((item: any) => ({ ...item, title: item.name, key: item.regionCode, isLeaf: true }))) + ) + } as SFTreeSelectWidgetSchema + }, + // 渠道销售 + _channelTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + invitationCode: { + title: '渠道销售邀请码', + type: 'string', + minLength: 1, + maxLength: 100, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入渠道销售邀请码', + errors: { + required: '请输入渠道销售邀请码' + } + } + } + }, + required: ['cityCodesList', 'invitationCode'] + }; + } +} diff --git a/src/app/routes/partner/partner-list/components/index/partner-list.component.html b/src/app/routes/partner/partner-list/components/index/partner-list.component.html new file mode 100644 index 00000000..f2f058ee --- /dev/null +++ b/src/app/routes/partner/partner-list/components/index/partner-list.component.html @@ -0,0 +1,87 @@ + + + +
+
+ +
+
+ + + +
+
+
+ + +
+ + +
+ + + +
+ + +
+
+ {{selectItem?.enterpriseName}} + + + + + +
+
+

说明:修改模板后,当月开始返佣收益将会按新模板计算

+
+ + +
+
+ 深圳某某有限公司 + 张三/13999999999 + + + + + + + + + + +

已选(0)

+ + + + + 客户名称 + + + + + + {{ data.name }} + + + +
+ + + + + + +
+
+

客户转移:客户跟着上级合伙人转移一并到新渠道销售下,会同步发起CRM《客户转移》流程;不转移的,客户会与上级合伙人解绑,成为渠道销售的直客

+
\ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/index/partner-list.component.less b/src/app/routes/partner/partner-list/components/index/partner-list.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/partner/partner-list/components/index/partner-list.component.ts b/src/app/routes/partner/partner-list/components/index/partner-list.component.ts new file mode 100644 index 00000000..eaa21889 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/index/partner-list.component.ts @@ -0,0 +1,407 @@ +import { Component, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AddCollectionInvoiceModalComponent } from 'src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component'; + +import { PartnerListService } from '../../services/partner-list.service'; +import { PartnerAuditModalComponent } from '../partner-audit-modal/partner-audit-modal.component'; + +@Component({ + selector: 'app-partner-list', + templateUrl: './partner-list.component.html', + styleUrls: ['../../../../commom/less/box.less'] +}) +export class PartnerListComponent { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + _$expand = false; + + @ViewChild('editTemplate', { static: true }) + editTemplate: any; + templateId: any; + templates: any[] = []; + + @ViewChild('editCannel', { static: true }) + editCannel: any; + customers: any[] = []; + + selectItem: any = {}; + + constructor(public service: PartnerListService, private nzModalService: NzModalService, private router: Router) { + this.service.getRebateConfig().subscribe(res => { + if (res) { + this.customers = res; + } + }); + } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + let params = { ...this.sf.value }; + if (params.createTime) { + params.createTime = { start: this.sf?.value?.createTime?.[0], end: this.sf?.value?.createTime?.[1] }; + } + Object.assign(requestOptions.body, params); + } + return requestOptions; + }; + + auditPartner(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: PartnerAuditModalComponent, + nzComponentParams: { info: { ...item, enterpriseName: item.enterpriseName || item.contactName } }, + nzFooter: null + }); + } + + editTemplateAction(item: any) { + this.selectItem = item; + const modal = this.nzModalService.create({ + nzTitle: '修改返佣模板', + nzContent: this.editTemplate, + nzOnOk: () => { + if (!this.templateId) { + this.service.msgSrv.warning('请选择返佣模板'); + return false; + } + this.confirmEditTemplate(); + return false; + } + }); + } + + confirmEditTemplate() { + const modal = this.nzModalService.confirm({ + nzTitle: '确定要修改返佣模板吗?', + nzOnOk: () => { + this.service + .request(this.service.$api_update_partner_template, { + id: this.selectItem.id, + templateId: this.templateId + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.nzModalService.closeAll(); + } + }); + return false; + } + }); + } + + editCannelAction(item: any) { + this.selectItem = item; + const modal = this.nzModalService.create({ + nzTitle: '修改渠道销售', + nzWidth: 650, + nzContent: this.editCannel, + nzOnOk: () => { + this.confirmEditCannel(item); + return false; + } + }); + } + + confirmEditCannel(item: any) { + const modal = this.nzModalService.confirm({ + nzTitle: '确定提交吗?', + nzOnOk: () => { + this.nzModalService.closeAll(); + } + }); + } + + /** + * 重新发起crm + * @param item + */ + reSendCRM(item: any) { + const modal = this.nzModalService.confirm({ + nzTitle: '是否确定重新发起CRM?', + nzOnOk: () => { + this.service + .request(this.service.$api_resend_crm, { + id: item.id + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('发起成功'); + } else { + this.service.msgSrv.warning('发起失败'); + } + }); + } + }); + } + + routeTo(route: string) { + this.router.navigate([route]); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + enterpriseName: { + type: 'string', + title: '合伙人名称' + }, + contactName: { + type: 'string', + title: '企业管理员' + }, + contactMobile: { + type: 'string', + title: '手机号' + }, + channelId: { + type: 'string', + title: '渠道销售', + ui: { + placeholder: '请输入姓名或者手机号', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + partnerType: { + type: 'string', + title: '类型', + enum: [ + { value: '', label: '全部' }, + { value: 1, label: '企业' }, + { value: 2, label: '个人' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + approvalStatus: { + type: 'string', + title: '认证审核状态', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'pay:mode' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + signStatus: { + type: 'string', + title: '签约状态', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'pay:mode' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + crmStatus: { + type: 'string', + title: 'CRM状态', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'pay:mode' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + paymo11de: { + type: 'string', + title: '注册渠道', + enum: [ + { value: '', label: '全部' }, + { value: 1, label: '合伙人注册' }, + { value: 2, label: '平台添加' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + templateId: { + type: 'string', + title: '返佣模板', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + lockedStatus: { + type: 'string', + title: '合伙人状态', + enum: [ + { value: '', label: '全部' }, + { value: 0, label: '启用' }, + { value: 1, label: '冻结' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + createTime: { + title: '注册时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '合伙人名称', index: 'enterpriseName', width: 180, format: item => `${item.enterpriseName || item.contactName}` }, + { title: '付款编码', index: 'payCode', width: 160 }, + { title: '邀请码', index: 'invitationCode', className: 'text-center', width: 130 }, + { title: '企业管理员', index: 'contactName', width: 150 }, + { title: '手机号', index: 'contactMobile', className: 'text-center', width: 150 }, + { title: '类型', index: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } }, + { title: '注册渠道', index: 'source', type: 'enum', enum: { 1: '合伙人注册', 2: '平台添加' }, width: 130 }, + { title: '注册时间', index: 'createTime', className: 'text-center', width: 170 }, + { title: '渠道销售', index: 'channelId', width: 170 }, + { title: '返佣模板', index: 'templateName', width: 150 }, + { + title: '认证审核状态', + index: 'approvalStatus', + width: 150, + type: 'badge', + badge: { + 0: { text: '草稿', color: 'default' }, + 10: { text: '待审核', color: 'processing' }, + 20: { text: '审核通过', color: 'success' }, + 30: { text: '驳回', color: 'error' } + } + }, + { + title: '签约状态', + index: 'signStatus', + width: 150, + type: 'badge', + badge: { + 10: { text: '待合伙人签约', color: 'default' }, + 15: { text: '签约中', color: 'processing' }, + 20: { text: '平台签约完成', color: 'success' }, + 30: { text: '驳回', color: 'error' } + } + }, + { + title: 'CRM状态', + index: 'crmStatus', + width: 150, + type: 'badge', + badge: { + 0: { text: '未发起', color: 'default' }, + 10: { text: '待审核', color: 'processing' }, + 20: { text: '审核通过', color: 'success' }, + 30: { text: '驳回', color: 'error' } + } + }, + { + title: '合伙人状态', + index: 'lockedStatus', + className: 'text-center', + width: 140, + type: 'badge', + badge: { + 0: { text: '启用', color: 'success' }, + 1: { text: '冻结', color: 'error' } + } + }, + { + title: '操作', + fixed: 'right', + width: '140px', + buttons: [ + { type: 'divider' }, + { + text: '详情', + click: item => { + if (item.partnerType === 1) { + this.router.navigate([`/partner/partner-list/etp-detail/${item.id}`]); + } else { + this.router.navigate([`/partner/partner-list/personal-detail/${item.id}`]); + } + } + }, + { + text: '审核
', + click: item => this.auditPartner(item) + }, + { + text: '修改返佣模板', + click: item => this.editTemplateAction(item) + }, + { + text: '修改渠道销售', + click: item => this.editCannelAction(item) + }, + { + text: '重发CRM流程', + click: item => this.reSendCRM(item) + } + ] + } + ]; + } +} diff --git a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.html b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.html new file mode 100644 index 00000000..fc8043d6 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.html @@ -0,0 +1,7 @@ +
+ +
+ \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.less b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts new file mode 100644 index 00000000..8c2586a8 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts @@ -0,0 +1,131 @@ +import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFValue } from '@delon/form'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { PartnerListService } from '../../services/partner-list.service'; + +@Component({ + selector: 'app-partner-audit-modal', + templateUrl: './partner-audit-modal.component.html', + styleUrls: ['./partner-audit-modal.component.less'] +}) +export class PartnerAuditModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @Input() + info: any; + schema!: SFSchema; + constructor(private nzModalService: NzModalService, public service: PartnerListService) {} + + ngOnInit(): void { + this.initSF(this.info); + } + + initSF(user: any) { + this.schema = { + properties: { + isPass: { + type: 'boolean', + ui: { + hidden: true + }, + default: this.info.isPass + }, + staffName: { + title: '合伙人名称', + type: 'string', + ui: { widget: 'text' }, + default: user.enterpriseName + }, + status: { + title: '审核结果', + type: 'string', + maxLength: 11, + enum: [ + { value: true, label: '通过' }, + { value: false, label: '驳回' } + ], + ui: { + widget: 'radio', + hidden: this.info.isPass !== undefined + }, + default: true + }, + channelId: { + title: '渠道销售', + type: 'string', + enum: [ + { value: true, label: '通过' }, + { value: false, label: '驳回' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + hidden: this.info.isPass === false, + visibleIf: { + status: value => value + }, + errors: { + required: ' ' + } + }, + default: '' + }, + approvalOpinion: { + title: '备注', + type: 'string', + maxLength: 100, + ui: { + widget: 'textarea', + placeholder: '请不要超过100个字', + autosize: { minRows: 3 }, + hidden: this.info.isPass === true, + visibleIf: { + status: value => !value || this.info.isPass === false + }, + errors: { + required: ' ' + } + } + } + }, + required: ['channelId', 'approvalOpinion'] + }; + } + + sure() { + if (this.info.isPass || this.sf.value.status) { + this.nzModalService.confirm({ + nzTitle: `确定以“${this.info.channelIdLabel}”的名义重新发起CRM《付款对象合同管理》吗?`, + nzOnOk: () => { + this.audit(); + } + }); + } else { + this.audit(); + } + } + + audit() { + const params: any = { + ...this.sf.value, + id: this.info.id, + auditStatusEnum: this.info.isPass || this.sf.value.status ? '20' : '30' + }; + this.service + .request(this.service.$api_audit_partner, { + auditStatusEnum: params.auditStatusEnum, + id: params.id, + approvalOpinion: params.approvalOpinion + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核成功!'); + this.close(); + } + }); + } + + close() { + this.nzModalService.closeAll(); + } +} diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html new file mode 100644 index 00000000..777d019f --- /dev/null +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + 企业管理员信息 + + + + + + + + + + +
+ + + + +
+
+ + + + - + + + + + + + + + +
+ + + + + + + + +

+ 四要素验证: + + + +

+
+ + + {{detailData.enterpriseName}} + + + + {{detailData.unifiedSocialCreditCode}} + + + + + + + + + + - + + + + + + + + + +
+ + + 企业法人信息 + + + + + + + + + - + + + + + + + + + + +
+ + + + +
+
+ + + + + + + {{ enterpriseDefaultCityName || '-' }} + + +
+ + + + 渠道销售信息 + {{ detailData?.channelName }} + {{ detailData?.channelMobile }} + {{ detailData?.bindChannelTime }} + +
+ + + + 修改渠道销售记录 + + + + + + + + +
+ +
{{ title }} +
+
+ {{ content }} +
+
+
+ + + + + +
上传
+
+
+ + +
+
+
+ + +

转移客户数:10

+ + +

不转移客户数:10

+ + +

+ 客户转移:客户跟着上级合伙人转移一并到新渠道销售下,会同步发起CRM《客户转移》流程;不转移的,客户会与上级合伙人解绑,修改成功后,修改时间也是合伙人与客户的结算结束时间,成为原来渠道销售的直客。 +

+
\ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.less b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.less new file mode 100644 index 00000000..be442cbc --- /dev/null +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.less @@ -0,0 +1,37 @@ +@import '../../../../usercenter/less/edit.less'; + + +.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; + } +} + +:host::ng-deep { + .affix { + position: fixed !important; + top : 20px !important; + z-index : 999 !important; + width : 100% !important; + } + + .image-hover .delete-icon { + top : unset !important; + right : unset !important; + margin-top : -15px; + margin-left: -15px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts new file mode 100644 index 00000000..94b4c869 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts @@ -0,0 +1,403 @@ +import { DatePipe } from '@angular/common'; +import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { STColumn } from '@delon/abc/st'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; +import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select'; +import { Subscription, fromEvent } from 'rxjs'; + +import { PartnerListService } from '../../services/partner-list.service'; +import { PartnerAuditModalComponent } from '../partner-audit-modal/partner-audit-modal.component'; + +@Component({ + selector: 'app-partner-detail', + templateUrl: './partner-detail.component.html', + styleUrls: ['./partner-detail.component.less'], + providers: [DatePipe] +}) +export class PartnerDetailComponent implements OnInit, OnDestroy { + @ViewChild('logModal') + logModal: any; + @ViewChild('areaTreeSelect') + areaTreeSelect!: NzTreeSelectComponent; + + columns: { logsColumn: STColumn[]; changeColumn: STColumn[]; beChangeColumn: STColumn[] } = this.initST(); + + detailData: any = { adminUserInfo: { name: '' }, legalPersonIdentity: { name: '' } }; + tempalateData = { ...this.detailData }; + + isEdit = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + enterpriseAddressCode: string[] = []; + enterpriseDefaultAddressCode: string[] = []; + enterpriseDefaultCityName: string = ''; + areaList = []; + + esignCheckStatus: any = { + 0: '不通过', + 1: '通过', + 2: '未认证' + }; + + scrollTop = 0; + subscribeScoll!: Subscription; + constructor( + public service: PartnerListService, + private route: ActivatedRoute, + private nzModalService: NzModalService, + private datePipe: DatePipe + ) {} + ngOnDestroy(): void { + this.subscribeScoll.unsubscribe(); + } + + ngOnInit() { + this.initData(); + this.loadlAreaList(); + this.subscribeScoll = fromEvent(window, 'scroll').subscribe(event => { + this.scrollTop = document.documentElement.scrollTop; + }); + } + + loadlAreaList() { + this.service.request(this.service.$api_get_region_by_code, { regionCode: '' }).subscribe(res => { + if (res) { + this.areaList = res.map((item: any) => ({ + ...item, + isLeaf: false, + title: item.name, + key: item.regionCode.toString(), + disabled: true, + isDisableCheckbox: true + })); + } + }); + } + + initData() { + this.service + .request(this.service.$api_get_ent_partner_detail, { + id: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.detailData = res; + // 存储数据源 + this.tempalateData = { ...this.detailData }; + // 拼接所属城市 + if (this.detailData?.cityCodesList?.length > 0) { + this.enterpriseAddressCode = (this.detailData?.cityCodesList as any[]).map(city => city.cityCode); + this.enterpriseDefaultCityName = (this.detailData?.cityCodesList as any[]).map(city => city.cityName).join('、'); + this.enterpriseDefaultAddressCode = [ + ...new Set((this.detailData?.cityCodesList as any[]).map(city => city.provinceCode)) + ]; + } + // 拼接渠道销售信息 + if (this.detailData?.channelIdLabel) { + const channel = (this.detailData.channelIdLabel as string).split('/'); + Object.assign(this.detailData, { + channelName: channel[0], + channelMobile: channel[1] + }); + } + } + }); + } + + goBack() { + window.history.go(-1); + } + /** + * 冻结 + */ + freezeOrResume(type: number) { + this.service.http + .post(this.service.$api_lock_freight, { + id: this.route.snapshot.params.id, + statedLocked: !!type + }) + .subscribe(res => { + if (res.data === true) { + if (type === 0) { + this.service.msgSrv.success(`启用成功!`); + } else { + this.service.msgSrv.success(`冻结成功!`); + } + this.initData(); + } else { + this.service.msgSrv.error(res.msg || '操作失败!'); + } + }); + } + + auditPartner(isPass: boolean) { + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: PartnerAuditModalComponent, + nzComponentParams: { info: { ...this.detailData, isPass } }, + nzFooter: null + }); + } + + showChangeDetail() { + const modal = this.nzModalService.create({ + nzTitle: '详情', + nzContent: this.logModal, + nzNoAnimation: true, + nzWidth: 700, + nzFooter: null + }); + } + + ratify() { + this.isEdit = true; + // 搜索展开省份并选中节点 + setTimeout(() => { + if (this.enterpriseDefaultAddressCode?.length > 0 && this.areaTreeSelect) { + this.enterpriseDefaultAddressCode.forEach(code => { + const node = this.areaTreeSelect.getTreeNodeByKey(code); + if (node) { + node.setExpanded(true); + this.onExpandChange(node); + } + }); + } + }, 500); + } + + 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, id: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + if (id === 'legalFront' || id === 'legalBack') { + this.checkIdCard(file.response.data?.fullFilePath, id === 'legalFront' ? 'front' : 'back', 1); + } + if (id === 'certificateBackFront' || id === 'certificateBack') { + this.checkIdCard(file.response.data?.fullFilePath, id === 'certificateBackFront' ? 'front' : 'back', 0); + } + if (id === 'detailPhoto') { + this.checkBusinessLicense(file.response.data?.fullFilePath); + } + } + } + + onExpandChange(node: NzTreeNode | null | undefined): void { + if (node && node.getChildren().length === 0 && node.isExpanded) { + this.loadRegionData(node).then(data => { + node.addChildren(data); + // 更新选中数据 + this.areaTreeSelect.updateSelectedNodes(true); + // 修改子节点选中状态 + const children = node.getChildren(); + if (children?.length > 0) { + children.forEach(childNode => { + if (this.enterpriseAddressCode.find(area => area === childNode.key)) { + childNode.setChecked(true); + } + }); + } + }); + } + } + + /** + * 级联获取地区数据 + * + * @param node 节点 + * @param index 层级 + * @returns + */ + loadRegionData(node: NzTreeNode): Promise { + let rs: any[] = []; + return new Promise(resolve => { + this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.origin.regionCode || '' }).subscribe( + res => { + rs = res.map((item: any) => ({ + ...item, + isLeaf: true, + title: item.name, + key: item.regionCode.toString(), + isSelectable: true, + isSelected: true, + isChecked: true + })); + }, + _ => {}, + () => { + resolve(rs); + } + ); + }); + } + + reset() { + this.detailData = { ...this.tempalateData }; + this.isEdit = false; + } + + save() { + if (this.enterpriseAddressCode?.length > 3) { + this.service.msgSrv.warning('所属城市不能超过3个'); + return; + } + const dateil = { ...this.detailData }; + Object.assign(dateil.legalPersonIdentity, { + validStartTime: this.datePipe.transform(dateil.legalPersonIdentity.validStartTime, 'yyyy-MM-dd'), + validEndTime: this.datePipe.transform(dateil.legalPersonIdentity.validEndTime, 'yyyy-MM-dd') + }); + Object.assign(dateil.adminUserInfo, { + validStartTime: this.datePipe.transform(dateil.adminUserInfo.validStartTime, 'yyyy-MM-dd'), + validEndTime: this.datePipe.transform(dateil.adminUserInfo.validEndTime, 'yyyy-MM-dd') + }); + const params = {}; + Object.assign(params, { + ...dateil, + cityCodesList: this.enterpriseAddressCode, + enterpriseRegistrationTime: this.datePipe.transform(dateil.enterpriseRegistrationTime, 'yyyy-MM-dd'), + operatingEndTime: this.datePipe.transform(dateil.operatingEndTime, 'yyyy-MM-dd'), + operatingStartTime: this.datePipe.transform(dateil.operatingStartTime, 'yyyy-MM-dd') + }); + + this.service.request(this.service.$api_save_entp_partner, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('企业合伙人修改成功'); + this.initData(); + this.isEdit = false; + } + }); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string, type: number) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + if (type === 1) { + // 法定代表人证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.detailData.legalPersonIdentity.name = res.name; + } + if (res.number) { + this.detailData.legalPersonIdentity.certificateType = 0; + this.detailData.legalPersonIdentity.certificateNumber = res.number; + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.detailData.legalPersonIdentity.validStartTime = res.validFrom; + } + if (res.validTo) { + this.detailData.legalPersonIdentity.validEndTime = res.validTo; + } else { + this.detailData.legalPersonIdentity.validEndTime = null; + } + } + } + // 企业管理员证件照 + if (type === 0) { + if (isFront === 'front') { + // 正面 + if (res.name) { + this.detailData.adminUserInfo.name = res.name; + } + if (res.number) { + this.detailData.adminUserInfo.certificateNumber = res.number; + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.detailData.adminUserInfo.validStartTime = res.validFrom; + } + if (res.validTo) { + this.detailData.adminUserInfo.validEndTime = res.validTo; + } + } + } + } + }); + } + + // 识别营业执照 + checkBusinessLicense(imgurl: any) { + this.service.request(this.service.$api_ocr_recognize_business_license, { businessLicenseUrl: imgurl }).subscribe(res => { + if (res) { + // if (res.registrationNumber) { + // this.detailData.unifiedSocialCreditCode = res.registrationNumber; + // } + // if (res.name) { + // this.detailData.enterpriseName = res.name; + // } + if (res.businessTermStartDate) { + this.detailData.operatingStartTime = res.businessTermStartDate; + } + if (res.businessTermEndDate) { + this.detailData.operatingEndTime = res.businessTermEndDate; + } else { + this.detailData.operatingEndTime = null; + } + } + }); + } + + private initST(): { logsColumn: STColumn[]; changeColumn: STColumn[]; beChangeColumn: STColumn[] } { + return { + logsColumn: [ + { title: '修改后渠道销售', index: 'newChannelName', width: 180 }, + { title: '修改前渠道销售', index: 'originalChannelName', width: 160 }, + { title: '转移客户数', index: 'quantity', className: 'text-center', width: 130 }, + { title: '生效节点', index: 'effectiveNode', width: 150, type: 'enum', enum: { 1: '立即生效', 2: 'CRM审核后生效' } }, + { title: '备注', index: 'remark', className: 'text-center', width: 150 }, + { title: '修改时间', index: 'effectiveTime', className: 'text-center', width: 130, type: 'date' }, + { title: '操作人', index: 'modifyUserId', width: 130 }, + { + title: '操作', + fixed: 'right', + width: '140px', + buttons: [ + { + text: '详情', + click: () => this.showChangeDetail() + } + ] + } + ], + changeColumn: [ + { title: '客户名称', index: 'payCode', width: 180 }, + { title: '合伙人', index: 'ltdName', width: 160 }, + { title: '渠道销售', index: 'payDate', className: 'text-center', width: 130 }, + { title: 'CRM审核状态', index: 'payDate', width: 150 }, + { title: '生效时间', index: 'payDate', className: 'text-center', width: 130 } + ], + beChangeColumn: [ + { title: '客户名称', index: 'payCode', width: 180 }, + { title: '合伙人', index: 'ltdName', width: 160 }, + { title: '渠道销售', index: 'payDate', className: 'text-center', width: 130 }, + { title: '生效时间', index: 'payDate', className: 'text-center', width: 130 } + ] + }; + } +} diff --git a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html new file mode 100644 index 00000000..aa2b1e32 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + 合伙人信息 + + + + + + {{detailData.adminUserInfo.mobile}} + + + + + + + + - + + + + + + + + + + +
+ + + + +
+
+ + + + + + + {{ enterpriseDefaultCityName || '-' }} + + +
+
+ + +
+ +
{{ title }} +
+
+ {{ content }} +
+
+
+ + + + + +
上传
+
+
+ + +
+
+
\ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.less b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.less new file mode 100644 index 00000000..be442cbc --- /dev/null +++ b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.less @@ -0,0 +1,37 @@ +@import '../../../../usercenter/less/edit.less'; + + +.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; + } +} + +:host::ng-deep { + .affix { + position: fixed !important; + top : 20px !important; + z-index : 999 !important; + width : 100% !important; + } + + .image-hover .delete-icon { + top : unset !important; + right : unset !important; + margin-top : -15px; + margin-left: -15px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts new file mode 100644 index 00000000..c6da1adc --- /dev/null +++ b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts @@ -0,0 +1,264 @@ +import { DatePipe } from '@angular/common'; +import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { STColumn } from '@delon/abc/st'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; +import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select'; +import { Subscription, fromEvent } from 'rxjs'; + +import { PartnerListService } from '../../services/partner-list.service'; +import { PartnerAuditModalComponent } from '../partner-audit-modal/partner-audit-modal.component'; + +@Component({ + selector: 'app-personal-partner-detail', + templateUrl: './personal-partner-detail.component.html', + styleUrls: ['./personal-partner-detail.component.less'], + providers: [DatePipe] +}) +export class PersonalPartnerDetailComponent implements OnInit { + @ViewChild('areaTreeSelect') + areaTreeSelect!: NzTreeSelectComponent; + + detailData: any = { adminUserInfo: { name: '' }, legalPersonIdentity: { name: '' } }; + tempalateData = { ...this.detailData }; + + isEdit = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + enterpriseAddressCode: string[] = []; + enterpriseDefaultAddressCode: string[] = []; + enterpriseDefaultCityName: string = ''; + areaList = []; + + constructor( + public service: PartnerListService, + private route: ActivatedRoute, + private nzModalService: NzModalService, + private datePipe: DatePipe + ) {} + + ngOnInit() { + this.initData(); + this.loadlAreaList(); + } + + loadlAreaList() { + this.service.request(this.service.$api_get_region_by_code, { regionCode: '' }).subscribe(res => { + if (res) { + this.areaList = res.map((item: any) => ({ + ...item, + isLeaf: false, + title: item.name, + key: item.regionCode.toString(), + disabled: true, + isDisableCheckbox: true + })); + } + }); + } + + initData() { + this.service + .request(this.service.$api_get_personal_partner_detail, { + id: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.detailData = res; + console.log(this.detailData); + + this.tempalateData = { ...this.detailData }; + // 拼接所属城市 + if (this.detailData?.cityCodesList?.length > 0) { + this.enterpriseAddressCode = (this.detailData?.cityCodesList as any[]).map(city => city.cityCode); + this.enterpriseDefaultCityName = (this.detailData?.cityCodesList as any[]).map(city => city.cityName).join('、'); + this.enterpriseDefaultAddressCode = [ + ...new Set((this.detailData?.cityCodesList as any[]).map(city => city.provinceCode)) + ]; + } + } + }); + } + + goBack() { + window.history.go(-1); + } + /** + * 冻结 + */ + freezeOrResume(type: number) { + this.service.http + .post(this.service.$api_lock_freight, { + id: this.route.snapshot.params.id, + statedLocked: !!type + }) + .subscribe(res => { + if (res.data === true) { + if (type === 0) { + this.service.msgSrv.success(`启用成功!`); + } else { + this.service.msgSrv.success(`冻结成功!`); + } + this.initData(); + } else { + this.service.msgSrv.error(res.msg || '操作失败!'); + } + }); + } + + auditPartner(isPass: boolean) { + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: PartnerAuditModalComponent, + nzComponentParams: { info: { ...this.detailData, isPass, enterpriseName: this.detailData.adminUserInfo?.name } }, + nzFooter: null + }); + } + + ratify() { + this.isEdit = true; + // 搜索展开省份并选中节点 + setTimeout(() => { + if (this.enterpriseDefaultAddressCode?.length > 0 && this.areaTreeSelect) { + this.enterpriseDefaultAddressCode.forEach(code => { + const node = this.areaTreeSelect.getTreeNodeByKey(code); + if (node) { + node.setExpanded(true); + this.onExpandChange(node); + } + }); + } + }, 500); + } + + 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, id: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + if (id === 'legalFront' || id === 'legalBack') { + this.checkIdCard(file.response.data?.fullFilePath, id === 'legalFront' ? 'front' : 'back'); + } + } + } + + onExpandChange(node: NzTreeNode | null | undefined): void { + if (node && node.getChildren().length === 0 && node.isExpanded) { + this.loadRegionData(node).then(data => { + node.addChildren(data); + // 更新选中数据 + this.areaTreeSelect.updateSelectedNodes(true); + // 修改子节点选中状态 + const children = node.getChildren(); + if (children?.length > 0) { + children.forEach(childNode => { + if (this.enterpriseAddressCode.find(area => area === childNode.key)) { + childNode.setChecked(true); + } + }); + } + }); + } + } + + /** + * 级联获取地区数据 + * + * @param node 节点 + * @param index 层级 + * @returns + */ + loadRegionData(node: NzTreeNode): Promise { + let rs: any[] = []; + return new Promise(resolve => { + this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.origin.regionCode || '' }).subscribe( + res => { + rs = res.map((item: any) => ({ + ...item, + isLeaf: true, + title: item.name, + key: item.regionCode.toString(), + isSelectable: true, + isSelected: true, + isChecked: true + })); + }, + _ => {}, + () => { + resolve(rs); + } + ); + }); + } + + reset() { + this.detailData = { ...this.tempalateData }; + this.isEdit = false; + } + + save() { + if (this.enterpriseAddressCode?.length > 3) { + this.service.msgSrv.warning('所属城市不能超过3个'); + return; + } + const dateil = { ...this.detailData, cityCodesList: this.enterpriseAddressCode }; + Object.assign(dateil.adminUserInfo, { + validStartTime: this.datePipe.transform(dateil.adminUserInfo.validStartTime, 'yyyy-MM-dd'), + validEndTime: this.datePipe.transform(dateil.adminUserInfo.validEndTime, 'yyyy-MM-dd') + }); + + this.service.request(this.service.$api_save_personal_partner, dateil).subscribe(res => { + if (res) { + this.service.msgSrv.success('个人合伙人修改成功'); + this.initData(); + this.isEdit = false; + } + }); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + // 企业管理员证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.detailData.adminUserInfo.name = res.name; + } + if (res.number) { + this.detailData.adminUserInfo.certificateNumber = res.number; + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.detailData.adminUserInfo.validStartTime = res.validFrom; + } + if (res.validTo) { + this.detailData.adminUserInfo.validEndTime = res.validTo; + } + } + } + }); + } +} diff --git a/src/app/routes/partner/partner-list/services/partner-list.service.ts b/src/app/routes/partner/partner-list/services/partner-list.service.ts new file mode 100644 index 00000000..b8d83d54 --- /dev/null +++ b/src/app/routes/partner/partner-list/services/partner-list.service.ts @@ -0,0 +1,53 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService, EACacheService, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; + +@Injectable() +export class PartnerListService extends ShipperBaseService { + $mock_url = '/rule?_allow_anonymous=true'; + + // 查询合伙人信息-分页 + $api_get_partner_page = '/api/mdc/partner/list/page'; + // 新增/更新保存企业合伙人信息 + $api_save_entp_partner = '/api/mdc/partner/saveEnterprise'; + // 新增/更新个人合伙人信息 + $api_save_personal_partner = '/api/mdc/partner/savePersonally'; + // 获取企业合伙人信息 + $api_get_ent_partner_detail = '/api/mdc/partner/getEnterprise'; + // 获取合伙人信息 + $api_get_personal_partner_detail = '/api/mdc/partner/getPersonally'; + // 审核合伙人 + $api_audit_partner = '/api/mdc/partner/audit'; + // 修改返佣模板 + $api_update_partner_template = '/api/mdc/partner/updateTemplate'; + // 更新渠道销售 + $api_update_partner_channel = '/api/mdc/partner/updateChannelSale'; + // 重新发起CRM + $api_resend_crm = '/api/mdc/partner/reSendCrm'; + // 查询合伙人修改渠道渠道销售记录 + $api_get_personal_channel_list = '/api/mdc/partnerChannelRelLog/list/page'; + // 冻结/启用企业业 + $api_lock_freight = '/api/mdc/cuc/enterpriseInfo/operate/lock'; + + // 根据地区code查询列表 + $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode'; + // 根据地区code查询地区详情 + $api_get_region_detail_by_code = '/api/mdc/pbc/region/getRegionDetailByCode'; + // 营业执照识别 + $api_ocr_recognize_business_license = '/api/mdc/pbc/hwc/ocr/recognizeBusinessLicense'; + // 身份证识别 + $api_ocr_recognize_id_card = '/api/mdc/pbc/hwc/ocr/recognizeIdCard'; + + 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/partner/partner-routing.module.ts b/src/app/routes/partner/partner-routing.module.ts new file mode 100644 index 00000000..afcd8d41 --- /dev/null +++ b/src/app/routes/partner/partner-routing.module.ts @@ -0,0 +1,171 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-02-24 15:07:57 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-11 15:22:36 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\partner-routing.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +import { PartnerAccountManagementAccountDetailComponent } from './account-management/components/account-detail/account-detail.component'; +import { PartnerAccountManagementListComponent } from './account-management/components/list/list.component'; +import { PartnerAccountManagementRecordedDetailComponent } from './account-management/components/recorded-detail/recorded-detail.component'; +import { PartnerBusinessStatisticsIndexComponent } from './business-statistics/components/index/index.component'; +import { PartnerPartnerCustomDetailComponent } from './business-statistics/components/partner-custom-detail/partner-custom-detail.component'; +import { PartnerPartnerCustomOrderDetailComponent } from './business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component'; +import { PartnerPartnerOrderDetailComponent } from './business-statistics/components/partner-order-detail/partner-order-detail.component'; +import { PartnerSaleCustomDetailComponent } from './business-statistics/components/sale-custom-detail/sale-custom-detail.component'; +import { PartnerSalePartnerDetailComponent } from './business-statistics/components/sale-partner-detail/sale-partner-detail.component'; +import { ParterChannelSalesEditComponent } from './channel-sales/components/edit/edit.component'; +import { ParterChannelSalesListComponent } from './channel-sales/components/list/list.component'; +import { ParterClaimAuditListChannelDetailComponent } from './claim-audit/components/channel-detail/channel-detail.component'; +import { ParterClaimAuditListComponent } from './claim-audit/components/list/list.component'; +import { ParterClaimAuditListPartnerDetailComponent } from './claim-audit/components/partner-detail/partner-detail.component'; +import { ParterLevelConfigEditComponent } from './level-config/components/edit/edit.component'; +import { ParterLevelConfigListComponent } from './level-config/components/list/list.component'; +import { PartnerDetailComponent } from './partner-list/components/partner-detail/partner-detail.component'; +import { ParterRebateManageMentParticularsComponent } from './rebate-management/components/particulars/particulars.component'; +import { ParterRebateManageMentRecordComponent } from './rebate-management/components/rebate-record/rebate-record.component'; +import { PartnerAccountManagementWithdrawalsRecordComponent } from './account-management/components/withdrawals-record/withdrawals-record.component'; +import { PartnerAccountManagementWithdralDetailComponent } from './account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component'; +import { ParterRebateManageMentAddComponent } from './rebate-management/components/rebate-setting/add/add.component'; +import { ParterRebateManageMentSettingComponent } from './rebate-management/components/rebate-setting/rebate-setting.component'; +import { PartnerRecordedDetailComponent } from './recorded/components/detail/detail.component'; +import { PartnerRecordedRecordComponent } from './recorded/components/record/record.component'; +import { AddEtpPartnerComponent } from './partner-list/components/add-etp-partner/add-etp-partner.component'; +import { AddPersonalPartnerComponent } from './partner-list/components/add-personal-partner/add-personal-partner.component'; +import { PartnerListComponent } from './partner-list/components/index/partner-list.component'; +import { PartnerKnowledgeClassificationListComponent } from './knowledge/classification/components/list/list.component'; +import { ParterArticleManagementListComponent } from './article-management/components/list/list.component'; +import { ParterArticleManagementEditComponent } from './article-management/components/edit/edit.component'; +import { ScrollimgComponentsAddComponent } from './scrollimg/components/add/add.component'; +import { ScrollImgComponentsListComponent } from './scrollimg/components/list/list.component'; +import { BannerComponentsListComponent } from './knowledge/banner/components/list/list.component'; +import { BannerComponentsAddComponent } from './knowledge/banner/components/add/add.component'; +import { PersonalPartnerDetailComponent } from './partner-list/components/personal-partner-detail/personal-partner-detail.component'; +import { ParterAdviceFeedbackListComponent } from './advice-feedback/components/list/list.component'; +import { ParterAdviceFeedbackDetailComponent } from './advice-feedback/components/feedback-detail/feedback-detail.component'; + +const routes: Routes = [ + { + path: 'business-statistics', + children: [ + { path: '', redirectTo: 'index' }, + { path: 'index', component: PartnerBusinessStatisticsIndexComponent }, + { path: 'partner/order-detail/:id', component: PartnerPartnerOrderDetailComponent }, + { path: 'partner/custom-detail/:id', component: PartnerPartnerCustomDetailComponent }, + { path: 'partner/custom-order-detail/:id', component: PartnerPartnerCustomOrderDetailComponent }, + { path: 'sale/custom-detail/:id', component: PartnerSaleCustomDetailComponent }, + { path: 'sale/partner-detail/:id', component: PartnerSalePartnerDetailComponent } + ] + }, + { + path: 'channel-sales', + children: [ + { path: '', component: ParterChannelSalesListComponent }, + { path: 'list', component: ParterChannelSalesListComponent }, + { path: 'edit', component: ParterChannelSalesEditComponent } + ] + }, + { + path: 'level-config', + children: [ + { path: '', component: ParterLevelConfigListComponent }, + { path: 'list', component: ParterLevelConfigListComponent }, + { path: 'edit', component: ParterLevelConfigEditComponent } + ] + }, + { + path: 'rebate', + children: [ + { path: 'particulars', component: ParterRebateManageMentParticularsComponent }, + { path: 'record', component: ParterRebateManageMentRecordComponent }, + { path: 'setting', component: ParterRebateManageMentSettingComponent }, + { path: 'setting/add/:id', component: ParterRebateManageMentAddComponent } + ] + }, + { + path: 'account-management', + children: [ + { + path: 'am', + children: [ + { path: '', redirectTo: 'list' }, + { path: 'list', component: PartnerAccountManagementListComponent }, + { path: 'detail/:id', component: PartnerAccountManagementAccountDetailComponent }, + { path: 'recorded/detail/:id', component: PartnerAccountManagementRecordedDetailComponent } + ] + }, + { + path: 'withdraw-record', + children: [ + { path: '', redirectTo: 'list' }, + { path: 'list', component: PartnerAccountManagementWithdrawalsRecordComponent }, + { path: 'detail/:id', component: PartnerAccountManagementWithdralDetailComponent } + ] + } + ] + }, + { + path: 'partner-list', + children: [ + { path: '', component: PartnerListComponent }, + { path: 'etp-detail/:id', component: PartnerDetailComponent }, + { path: 'personal-detail/:id', component: PersonalPartnerDetailComponent }, + { path: 'add-etp-partner', component: AddEtpPartnerComponent }, + { path: 'add-personal-partner', component: AddPersonalPartnerComponent } + ] + }, + { + path: 'claim-audit', + children: [ + { path: '', component: ParterClaimAuditListComponent }, + { path: 'list', component: ParterClaimAuditListComponent }, + { path: 'channel-detail', component: ParterClaimAuditListChannelDetailComponent }, + { path: 'partner-detail', component: ParterClaimAuditListPartnerDetailComponent } + ] + }, + { + path: 'scroll-img', + children: [ + { path: '', component: ScrollImgComponentsListComponent }, + { path: 'list', component: ScrollImgComponentsListComponent }, + { path: 'detail', component: ScrollimgComponentsAddComponent } + ] + }, + { + path: 'advice-feedback', + children: [ + { path: '', component: ParterAdviceFeedbackListComponent }, + { path: 'list', component: ParterAdviceFeedbackListComponent }, + { path: 'detail', component: ParterAdviceFeedbackDetailComponent } + ] + }, + { + path: 'recorded', + children: [ + { path: 'record', component: PartnerRecordedRecordComponent }, + { path: 'record/detail/:id', component: PartnerRecordedDetailComponent } + ] + }, + { + path: 'knowledge', + children: [ + { path: 'classification', component: PartnerKnowledgeClassificationListComponent }, + { path: 'article-management-list', component: ParterArticleManagementListComponent }, + { path: 'article-management-add', component: ParterArticleManagementEditComponent }, + { path: 'article-management-edit', component: ParterArticleManagementEditComponent }, + { path: 'banner', component: BannerComponentsListComponent }, + { path: 'banner/detail', component: BannerComponentsAddComponent } + ] + } +]; +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PartnerRoutingModule {} diff --git a/src/app/routes/partner/partner.module.ts b/src/app/routes/partner/partner.module.ts new file mode 100644 index 00000000..986d5e59 --- /dev/null +++ b/src/app/routes/partner/partner.module.ts @@ -0,0 +1,122 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-09 14:34:55 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-11 15:28:01 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\partner.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { SharedModule } from '@shared'; +import { PartnerAccountManagementAccountDetailComponent } from './account-management/components/account-detail/account-detail.component'; +import { PartnerAccountManagementListComponent } from './account-management/components/list/list.component'; +import { PartnerAccountManagementRecordedDetailComponent } from './account-management/components/recorded-detail/recorded-detail.component'; +import { PartnerAccountManagementVirtualAccountDetailComponent } from './account-management/components/virtual-account-detail/virtual-account-detail.component'; +import { PartnerAccountManagementWithdralDetailComponent } from './account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component'; +import { PartnerAccountManagementWithdrawalsRecordComponent } from './account-management/components/withdrawals-record/withdrawals-record.component'; +import { PartnerBusinessStatisticsIndexComponent } from './business-statistics/components/index/index.component'; +import { PartnerPartnerCustomDetailComponent } from './business-statistics/components/partner-custom-detail/partner-custom-detail.component'; +import { PartnerPartnerCustomOrderDetailComponent } from './business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component'; +import { PartnerPartnerOrderDetailComponent } from './business-statistics/components/partner-order-detail/partner-order-detail.component'; +import { PartnerPartnerStatisticsComponent } from './business-statistics/components/partner-statistics/partner-statistics.component'; +import { PartnerSaleCustomDetailComponent } from './business-statistics/components/sale-custom-detail/sale-custom-detail.component'; +import { PartnerSalePartnerDetailComponent } from './business-statistics/components/sale-partner-detail/sale-partner-detail.component'; +import { PartnerSaleStatisticsComponent } from './business-statistics/components/sale-statistics/sale-statistics.component'; +import { ParterChannelSalesEditComponent } from './channel-sales/components/edit/edit.component'; +import { ParterChannelSalesListComponent } from './channel-sales/components/list/list.component'; +import { ParterClaimAuditListChannelApproveComponent } from './claim-audit/components/channel-approve/channel-approve.component'; +import { ParterClaimAuditListChannelDetailComponent } from './claim-audit/components/channel-detail/channel-detail.component'; +import { ParterClaimAuditListChannelRejectComponent } from './claim-audit/components/channel-reject/channel-reject.component'; +import { ParterClaimAuditListComponent } from './claim-audit/components/list/list.component'; +import { ParterClaimAuditListPartnerApproveComponent } from './claim-audit/components/partner-approve/partner-approve.component'; +import { ParterClaimAuditListPartnerDetailComponent } from './claim-audit/components/partner-detail/partner-detail.component'; +import { ParterClaimAuditListPartnerRejectComponent } from './claim-audit/components/partner-reject/partner-reject.component'; +import { ParterLevelConfigEditComponent } from './level-config/components/edit/edit.component'; +import { ParterLevelConfigListComponent } from './level-config/components/list/list.component'; +import { PartnerListComponent } from './partner-list/components/index/partner-list.component'; +import { PartnerAuditModalComponent } from './partner-list/components/partner-audit-modal/partner-audit-modal.component'; +import { PartnerDetailComponent } from './partner-list/components/partner-detail/partner-detail.component'; +import { PartnerListService } from './partner-list/services/partner-list.service'; +import { PartnerRoutingModule } from './partner-routing.module'; +import { ParterRebateManageMentParticularsComponent } from './rebate-management/components/particulars/particulars.component'; +import { ParterRebateManageMentRecordComponent } from './rebate-management/components/rebate-record/rebate-record.component'; +import { ParterRebateManageMentSettingComponent } from './rebate-management/components/rebate-setting/rebate-setting.component'; +import { AddEtpPartnerComponent } from './partner-list/components/add-etp-partner/add-etp-partner.component'; +import { AddPersonalPartnerComponent } from './partner-list/components/add-personal-partner/add-personal-partner.component'; +import { ParterRebateManageMenAbnormalFeedbackComponent } from './rebate-management/model/abnormal-feedback/abnormal-feedback.component'; +import { PartnerRecordedDetailComponent } from './recorded/components/detail/detail.component'; +import { PartnerRecordedRecordComponent } from './recorded/components/record/record.component'; +import { ParterRebateManageMentAddComponent } from './rebate-management/components/rebate-setting/add/add.component'; +import { ParterArticleManagementEditComponent } from './article-management/components/edit/edit.component'; +import { ParterArticleManagementListComponent } from './article-management/components/list/list.component'; +import { PartnerKnowledgeClassificationListComponent } from './knowledge/classification/components/list/list.component'; +import { PartnerEditComponent } from './knowledge/classification/components/edit/edit.component'; +import { ScrollimgComponentsAddComponent } from './scrollimg/components/add/add.component'; +import { ScrollImgComponentsListComponent } from './scrollimg/components/list/list.component'; +import { BannerComponentsListComponent } from './knowledge/banner/components/list/list.component'; +import { BannerComponentsAddComponent } from './knowledge/banner/components/add/add.component'; +import { PersonalPartnerDetailComponent } from './partner-list/components/personal-partner-detail/personal-partner-detail.component'; +import { ParterAdviceFeedbackListComponent } from './advice-feedback/components/list/list.component'; +import { ParterAdviceFeedbackDetailComponent } from './advice-feedback/components/feedback-detail/feedback-detail.component'; + +const COMPONENTS: any[] = [ + PartnerBusinessStatisticsIndexComponent, + ParterChannelSalesListComponent, + ParterChannelSalesEditComponent, + ParterLevelConfigListComponent, + ParterLevelConfigEditComponent, + PartnerPartnerStatisticsComponent, + PartnerSaleStatisticsComponent, + PartnerPartnerCustomDetailComponent, + PartnerPartnerCustomDetailComponent, + PartnerSaleCustomDetailComponent, + ParterRebateManageMentParticularsComponent, + ParterRebateManageMentRecordComponent, + PartnerSalePartnerDetailComponent, + PartnerPartnerCustomOrderDetailComponent, + PartnerPartnerOrderDetailComponent, + PartnerAccountManagementListComponent, + ParterClaimAuditListComponent, + ParterClaimAuditListChannelDetailComponent, + ParterClaimAuditListPartnerDetailComponent, + ParterClaimAuditListPartnerApproveComponent, + ParterClaimAuditListPartnerRejectComponent, + ParterClaimAuditListChannelApproveComponent, + ParterClaimAuditListChannelRejectComponent, + PartnerAccountManagementVirtualAccountDetailComponent, + PartnerAccountManagementAccountDetailComponent, + PartnerAccountManagementRecordedDetailComponent, + PartnerAccountManagementWithdrawalsRecordComponent, + PartnerAccountManagementWithdralDetailComponent, + PartnerRecordedRecordComponent, + PartnerRecordedDetailComponent, + PartnerListComponent, + PartnerDetailComponent, + ParterRebateManageMenAbnormalFeedbackComponent, + ParterRebateManageMentSettingComponent, + PartnerAuditModalComponent, + ParterRebateManageMentAddComponent, + AddEtpPartnerComponent, + AddPersonalPartnerComponent, + ScrollImgComponentsListComponent, + ScrollimgComponentsAddComponent, + ParterArticleManagementEditComponent, + ParterArticleManagementListComponent, + PartnerKnowledgeClassificationListComponent, + PartnerEditComponent, + BannerComponentsListComponent, + BannerComponentsAddComponent, + PersonalPartnerDetailComponent, + ParterAdviceFeedbackListComponent, + ParterAdviceFeedbackDetailComponent +]; + +@NgModule({ + declarations: [...COMPONENTS], + imports: [CommonModule, PartnerRoutingModule, SharedModule], + providers: [PartnerListService] +}) +export class PartnerModule {} diff --git a/src/app/routes/partner/rebate-management/components/particulars/particulars.component.html b/src/app/routes/partner/rebate-management/components/particulars/particulars.component.html new file mode 100644 index 00000000..0ebf82f0 --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/particulars/particulars.component.html @@ -0,0 +1,60 @@ + + + +
+ +
+ +
+ + + +
+ +
+
+ + + + +
+
+
+
+ + + + + + diff --git a/src/app/routes/partner/rebate-management/components/particulars/particulars.component.ts b/src/app/routes/partner/rebate-management/components/particulars/particulars.component.ts new file mode 100644 index 00000000..55ed5dd9 --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/particulars/particulars.component.ts @@ -0,0 +1,188 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../services/rebate-management.service'; + +@Component({ + selector: 'app-parter-channel-rebate-management-particulars', + templateUrl: './particulars.component.html' +}) +export class ParterRebateManageMentParticularsComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + _$expand = false; + data = [{ name1: 1111 }]; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modalService: NzModalService, + public shipperservice: ShipperBaseService + ) {} + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询参数 + */ + get reqParams() { + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...params, + deadlineTime: { + start: this.sf?.value?.deadlineTime?.[0] || '', + end: this.sf?.value?.deadlineTime?.[1] || '', + }, + }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + name: { + type: 'string', + title: '订单号' + }, + phone: { + type: 'string', + title: '付款单号' + }, + phone2: { + type: 'string', + title: '下单客户' + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + phone3: { + type: 'string', + title: '合伙人名称', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + }, + } + }, + deadlineTime: { + title: '时间范围', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true + } as SFDateWidgetSchema + } + } + }; + this.ui = { + '*': { + spanLabelFixed: 140, + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '订单号', + index: 'name1' + }, + { + title: '订单金额(元)', + index: 'name1' + }, + { + title: '付款金额(元)', + index: 'name1' + }, + { + title: '预估返佣金额(元)', + index: 'name1' + }, + { + title: '附加费率', + index: 'name1' + }, + { + title: '下单客户', + index: 'name1' + }, + { + title: '网络货运人', + index: 'name1' + }, + { + title: '销售渠道', + index: 'name1' + }, + { + title: '合伙人名称', + index: 'name1' + }, + { + title: '合伙人等级', + index: 'name1' + }, + { + title: '管理费比例', + index: 'name1' + }, + { + title: '固定结算费率', + index: 'name1' + }, + { + title: '返佣时间', + index: 'name1' + } + ]; + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } +} diff --git a/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.html b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.html new file mode 100644 index 00000000..50b366ea --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.html @@ -0,0 +1,48 @@ + + + +
+ + +
+ + + +
+
+
+ + + + + +
1223
+
+
+
diff --git a/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.ts b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.ts new file mode 100644 index 00000000..1f98579d --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.ts @@ -0,0 +1,172 @@ +import { ModalHelper } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../services/rebate-management.service'; +import { ParterRebateManageMenRecordDetailComponent } from '../../model/record-detail/record-detail.component'; +import { ParterRebateManageMenAbnormalFeedbackComponent } from '../../model/abnormal-feedback/abnormal-feedback.component'; + +@Component({ + selector: 'app-parter-channel-rebate-management-record', + templateUrl: './rebate-record.component.html' +}) +export class ParterRebateManageMentRecordComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + _$expand = false; + data = [{ name1: 1111 }]; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + ) {} + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询参数 + */ + get reqParams() { + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...params, + deadlineTime: { + start: this.sf?.value?.deadlineTime?.[0] || '', + end: this.sf?.value?.deadlineTime?.[1] || '', + }, + }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + month: { + type: 'string', + title: '时间月份', + format: 'month', + }, + phone: { + type: 'string', + title: '合伙人名称' + }, + } + }; + this.ui = { + '*': { + spanLabelFixed: 140, + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '月份', + index: 'name1' + }, + { + title: '返佣金额(元)', + index: 'name1' + }, + { + title: '合伙人名称', + index: 'name1' + }, + { + title: '实际等级', + index: 'name1' + }, + { + title: '管理费比例', + index: 'name1' + }, + { + title: '返佣时间', + index: 'name1' + }, + { + title: '异常反馈', + render: 'name44' + }, + { + title: '操作', + fixed: 'right', + width: '90px', + className: 'text-left', + buttons: [ + { + text: '明细', + click: _record => this.viewEvaluate(_record), + } + ] + } + ]; + } + /** + *查看明细 + */ + viewEvaluate(item: any) { + const modal = this.modal.create({ + nzTitle: '明细', + nzWidth: 1200, + nzContent: ParterRebateManageMenRecordDetailComponent, + nzComponentParams: { }, + nzFooter: null + }); + modal.afterClose.subscribe((res: any) => { + if (res) { + } + }); + } + /** + *异常反馈 + */ + feedback(item?: any) { + const modal = this.modal.create({ + nzTitle: '异常反馈', + nzWidth: 580, + nzContent: ParterRebateManageMenAbnormalFeedbackComponent, + nzComponentParams: { i: item }, + nzFooter: null + }); + modal.afterClose.subscribe((res: any) => { + if (res) { + } + }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } +} diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.html b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.html new file mode 100644 index 00000000..9dc5b6f9 --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.html @@ -0,0 +1,54 @@ + + + +
+ + + +    + 固定结算费率配置 +     % + 业务量和管理费比例配置 +    + + + + + + +    + + 关联合伙人配置 +    + + + + +   添加 + +    + + + + + +    + + +    + + + + +
+
diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.less b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.less new file mode 100644 index 00000000..0c812cac --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.less @@ -0,0 +1,10 @@ +:host { + ::ng-deep { + .sv__label { + color: #000; + } + .sv__title { + font-weight: 700; + } + } +} diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts new file mode 100644 index 00000000..3edd7ef2 --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts @@ -0,0 +1,60 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-21 09:26:45 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-21 13:44:34 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { ModalHelper } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../../services/rebate-management.service'; +@Component({ + selector: 'app-parter-channel-rebate-management-add', + styleUrls: ['./add.component.less'], + templateUrl: './add.component.html' +}) +export class ParterRebateManageMentAddComponent implements OnInit { + setValue: string = ''; + toFixedValue: Number = 2; + radioValue = 'A'; + precision = 2; + inputValue= ''; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema1!: SFSchema; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + ) {} + initSF(data?: any) { + this.schema1 = { + properties: { + content: { + type: 'string', + title: '', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 650 + } + }, + default: data?.agreementContent || '' + } + } + }; + } + ngOnInit() { + this.initSF() + } +} diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html new file mode 100644 index 00000000..efa2e94f --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html @@ -0,0 +1,54 @@ + + + +
+ + +
+ + + +
+
+
+ + + + +
+
+ +
+
+ + +
1223
+
+
+
diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts new file mode 100644 index 00000000..3c4cd8df --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts @@ -0,0 +1,178 @@ +import { ModalHelper } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../services/rebate-management.service'; +import { ParterRebateManageMenRecordDetailComponent } from '../../model/record-detail/record-detail.component'; +import { ParterRebateManageMenAbnormalFeedbackComponent } from '../../model/abnormal-feedback/abnormal-feedback.component'; + +@Component({ + selector: 'app-parter-channel-rebate-management-setting', + templateUrl: './rebate-setting.component.html' +}) +export class ParterRebateManageMentSettingComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + _$expand = false; + data = [{ name1: 1111 }]; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + ) {} + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询参数 + */ + get reqParams() { + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...params, + deadlineTime: { + start: this.sf?.value?.deadlineTime?.[0] || '', + end: this.sf?.value?.deadlineTime?.[1] || '', + }, + }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + month: { + type: 'string', + title: '时间月份', + format: 'month', + }, + partnerId: { + type: 'string', + title: '合伙人名称' + }, + } + }; + this.ui = { + '*': { + spanLabelFixed: 140, + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '月份', + index: '配置名称' + }, + { + title: '配置类型', + index: 'configType' + }, + { + title: '备注', + index: 'remark' + }, + { + title: '关联合伙人范围', + index: 'partnerType' + }, + { + title: '创建时间', + index: 'enableTime' + }, + { + title: '启用时间', + index: 'enableTime' + }, + { + title: '优先级', + index: 'priority' + }, + { + title: '状态', + index: 'stateLocked' + }, + { + title: '操作', + fixed: 'right', + width: '90px', + className: 'text-left', + buttons: [ + { + text: '查看', + click: _record => this.viewEvaluate(_record), + }, + { + text: '禁用', + click: _record => this.viewEvaluate(_record), + }, + ] + } + ]; + } + /** + *禁用 + */ + viewEvaluate(item: any) { + this.modal.confirm({ + nzTitle: '是否禁用该配置?', + nzOnOk: () => { + + } + }); + } + /** + *查看 + */ + feedback(item?: any) { + const modal = this.modal.create({ + nzTitle: '查看', + nzWidth: 580, + nzContent: ParterRebateManageMenAbnormalFeedbackComponent, + nzComponentParams: { i: item }, + nzFooter: null + }); + modal.afterClose.subscribe((res: any) => { + if (res) { + } + }); + } + configAction() { + this.router.navigate(['/partner/rebate/setting/add', '']) + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } +} diff --git a/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.html b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.html new file mode 100644 index 00000000..cef84c44 --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.html @@ -0,0 +1,38 @@ + + + +
有订单有异常请查看
+
2022-09-08 00:00:00
+
+ +
+
+ +
+ +
+ +
\ No newline at end of file diff --git a/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.less b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.less new file mode 100644 index 00000000..52b47a0e --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.less @@ -0,0 +1,6 @@ +:host { + [nz-button] { + margin-right: 8px; + margin-bottom: 12px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.ts b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.ts new file mode 100644 index 00000000..3d8c1fd4 --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.ts @@ -0,0 +1,72 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-10 14:50:45 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-10 15:09:51 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\model\\abnormal-feedback\\abnormal-feedback.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { ModalHelper } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService, NzModalRef } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../services/rebate-management.service'; +import { NzButtonSize } from 'ng-zorro-antd/button'; + +@Component({ + selector: 'app-parter-channel-rebate-management-abnormal-feedback', + templateUrl: './abnormal-feedback.component.html' +}) +export class ParterRebateManageMenAbnormalFeedbackComponent implements OnInit { + schema: SFSchema = {}; + ui!: SFUISchema; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i!: any; + data = [{ name1: 1111 }]; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modalService: NzModalService, + public shipperservice: ShipperBaseService, + public modalRef: NzModalRef, + ) {} + + + ngOnInit() { + this.initSF(); + } + + initSF() { + this.schema = { + properties: { + name3: { + type: 'string', + title: '回复', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请不要超过50个字' + } as SFTextareaWidgetSchema, + }, + } + }; + this.ui = { + '*': { + spanLabelFixed: 60, + grid: { span: 16 }, + } + }; + } + close() { + this.modalRef.destroy() + } +} + diff --git a/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.html b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.html new file mode 100644 index 00000000..63f8290c --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.html @@ -0,0 +1,38 @@ + +
+ +
+ + + +
合计:2999.00元
+
+ +
\ No newline at end of file diff --git a/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.less b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.less new file mode 100644 index 00000000..52b47a0e --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.less @@ -0,0 +1,6 @@ +:host { + [nz-button] { + margin-right: 8px; + margin-bottom: 12px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.ts b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.ts new file mode 100644 index 00000000..1efde6a2 --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.ts @@ -0,0 +1,171 @@ +import { ModalHelper } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService, NzModalRef } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../services/rebate-management.service'; +import { NzButtonSize } from 'ng-zorro-antd/button'; + +@Component({ + selector: 'app-parter-channel-rebate-management-record-detail', + templateUrl: './record-detail.component.html' +}) +export class ParterRebateManageMenRecordDetailComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + size: NzButtonSize = 'large'; + _$expand = false; + data = [{ name1: 1111 }]; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modalService: NzModalService, + public shipperservice: ShipperBaseService, + public modalRef: NzModalRef, + ) {} + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询参数 + */ + get reqParams() { + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...params, + }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder(), + change: (value: any) => { + console.log(value) + this.st.reload() + } + } + }, + paymentStatus: { + title: '银行类型', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'overall:payment:status' }, + containsAllLabel: true, + change: (value: any) => { + console.log(value) + this.st.reload() + } + } as SFSelectWidgetSchema + }, + } + }; + this.ui = { + '*': { + spanLabelFixed: 140, + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '订单号', + index: 'billCode' + }, + { + title: '订单金额(元)', + index: 'name1' + }, + { + title: '付款金额(元)', + index: 'name1' + }, + { + title: '预估返佣金额(元)', + index: 'name1' + }, + { + title: '附加费率', + index: 'name1' + }, + { + title: '下单客户', + index: 'name1' + }, + { + title: '网络货运人', + index: 'name1' + }, + { + title: '销售渠道', + index: 'name1' + }, + { + title: '合伙人名称', + index: 'name1' + }, + { + title: '合伙人等级', + index: 'name1' + }, + { + title: '管理费比例', + index: 'name1' + }, + { + title: '固定结算费率', + index: 'name1' + }, + { + title: '返佣时间', + index: 'name1' + } + ]; + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } + close() { + this.modalRef.destroy() + } +} + diff --git a/src/app/routes/partner/rebate-management/services/rebate-management.service.ts b/src/app/routes/partner/rebate-management/services/rebate-management.service.ts new file mode 100644 index 00000000..c7dd9b2e --- /dev/null +++ b/src/app/routes/partner/rebate-management/services/rebate-management.service.ts @@ -0,0 +1,25 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-10 11:19:00 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-10 13:51:05 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\services\\rebate-management.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class RebateManagementService extends BaseService { + // 查询规则抽查列表 + public $api_get_listCompliancePage = '/api/sdc/billRiskOperate/listRiskPage'; + // 查询返佣配置表 + public $api_get_rebateConfig = '/api/mdc/rebateConfig/list/page'; + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/recorded/components/detail/detail.component.html b/src/app/routes/partner/recorded/components/detail/detail.component.html new file mode 100644 index 00000000..8bfafd61 --- /dev/null +++ b/src/app/routes/partner/recorded/components/detail/detail.component.html @@ -0,0 +1,97 @@ + + + + + + +
+

{{formData?.stsLabel}}

+
+ +
+
+
+
+ + + + +
+ + {{formData?.accountName}} + + + {{formData?.ltdName}} + + + {{formData?.entryNumber}} + + + {{formData?.bankName}} + + + {{formData?.fictitiousAccount}} + + + {{formData?.submitTime}} + + + {{formData?.invoiceAmount | currency}} + + + {{formData?.taxPersonal | currency}} + + + {{formData?.recordedAmount | currency}} + + + {{formData?.stsLabel}} + + + + - + + + {{formData?.expressName}} + + + + - + + + {{formData?.bankFlow}} + +
+ + +
+
+ +
+
+
+ + +
+
+ + + +
+
+
diff --git a/src/app/routes/partner/recorded/components/detail/detail.component.less b/src/app/routes/partner/recorded/components/detail/detail.component.less new file mode 100644 index 00000000..e299b7d1 --- /dev/null +++ b/src/app/routes/partner/recorded/components/detail/detail.component.less @@ -0,0 +1,17 @@ +:host::ng-deep { + + .ant-alert-info { + background-color: #f3f3f3; + border : 1px solid #dbdbdb; + + .ant-alert-message { + color: rgba(0, 0, 0, 0.85); + font-weight: 600; + font-size: 16px; + } + } + + .ant-form-item { + margin-bottom: 15px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/recorded/components/detail/detail.component.ts b/src/app/routes/partner/recorded/components/detail/detail.component.ts new file mode 100644 index 00000000..bbfad88e --- /dev/null +++ b/src/app/routes/partner/recorded/components/detail/detail.component.ts @@ -0,0 +1,130 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from 'src/app/routes/financial-management/services/freight-account.service'; +import { RecordedService } from '../../services/recorded.service'; + + +@Component({ + selector: 'app-partner-recored-detail', + templateUrl: './detail.component.html', + styleUrls: ['./detail.component.less'] +}) +export class PartnerRecordedDetailComponent implements OnInit { + @ViewChild('auditModal', { static: false }) auditModal!: any; + formData: any = {}; + timeLineData: any = []; + msg = ''; + id = ''; + + constructor(public service: RecordedService, private route: ActivatedRoute, private nzModalService: NzModalService) { + this.id = route.snapshot.params.id; + this.getRecordedDetail(this.id); + } + + ngOnInit(): void { } + + getRecordedDetail(id: string) { + this.service.request(this.service.$api_get_recorded_record_detail, { id }).subscribe(res => { + if (res) { + this.formData = res; + // 处理流程节点数据 + // 流程是否结束 + // let isEnd = false; + // if (res.successTime) { + // isEnd = true; + // if (res.refundStatus === '3') { + // this.timeLineData.push({ time: res.successTime, value: `到账成功`, color: 'green' }); + // } else { + // this.timeLineData.push({ time: res.successTime, value: `提现失败`, color: 'red' }); + // } + // } + // if (res.agreeTime && res.refundStatus !== '4') { + // this.timeLineData.push({ time: res.agreeTime, value: `银行处理中`, color: 'gray' }); + // } + // if (res.agreeTime) { + // if (res.refundStatus === '4') { + // isEnd = true; + // this.timeLineData.push({ + // time: res.agreeTime, + // value: `拒绝提现
操作人员:${res.handlerUserIdLabel}`, + // color: 'red' + // }); + // } else { + // this.timeLineData.push({ + // time: res.agreeTime, + // value: `审核通过
操作人员:${res.handlerUserIdLabel}`, + // color: 'gray' + // }); + // } + // } + // if (res.createTime) { + // this.timeLineData.push({ + // time: res.createTime, + // value: `提交提现申请
提现${res.amount}元至${res.bankName}(${res.bankCardNumber})
操作人员:${res.userIdLabel}`, + // color: 'gray' + // }); + // } + // if (this.timeLineData?.length > 0 && !isEnd) { + // this.timeLineData[0].color = 'green'; + // } + } + }); + } + + auditAction(item?: any, type: string = '1') { + this.msg = ''; + let params: Array = []; + params = [item.id]; + const modal = this.nzModalService.create({ + nzTitle: type === '1' ? '审核' : '复审', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + if (!this.msg || this.msg.trim().length === 0) { + this.service.msgSrv.warning('请填写拒绝原因 '); + return; + } + this.audit({ ids: params, rejectReason: this.msg, sts: '3' }, () => { + modal.destroy(true); + }, '审核拒绝成功'); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + this.audit({ ids: params, rejectReason: this.msg, sts: this.formData?.sts === '0' ? 1 : 2 }, () => { + modal.destroy(true); + }, `${this.formData?.sts === '1' ? '审核' : '复审'}通过成功`); + } + } + ] + }); + modal.afterClose.subscribe((res: any) => { + if (res) { + this.getRecordedDetail(this.id); + } + }); + } + goBack() { + history.go(-1); + } + + /** + * 审核 + */ + audit(params: any, callback: Function, msg = '成功') { + this.service + .request(this.service.$api_audit_recored, ...params) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(msg); + callback(); + } + }); + } +} diff --git a/src/app/routes/partner/recorded/components/record/record.component.html b/src/app/routes/partner/recorded/components/record/record.component.html new file mode 100644 index 00000000..2de32d76 --- /dev/null +++ b/src/app/routes/partner/recorded/components/record/record.component.html @@ -0,0 +1,73 @@ + + +
+
+ +
+
+ + + + +
+
+
+ + + + + + + + + + + +
+
+ 已选择 + {{ selectedRows.length }} 条数据,累计入账 {{ + totalCallNo }} + +
+ +
+
+ +
+ + + {{ item.bankName }}
{{ item.bankCardNumber }} +
+
+
+ 合伙人数: + 入账笔数: + 开票金额: + 代缴个税: + 入账金额: +
+
+
+ + +
+
+ + + +
+
+
diff --git a/src/app/routes/partner/recorded/components/record/record.component.ts b/src/app/routes/partner/recorded/components/record/record.component.ts new file mode 100644 index 00000000..d4e0d8de --- /dev/null +++ b/src/app/routes/partner/recorded/components/record/record.component.ts @@ -0,0 +1,350 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from 'src/app/routes/financial-management/services/freight-account.service'; +import Big from 'src/app/shared/utils/deal-precision'; +import { RecordedService } from '../../services/recorded.service'; + + +@Component({ + selector: 'app-partner-recorded-record', + templateUrl: './record.component.html', + styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/expend-but.less'] +}) +export class PartnerRecordedRecordComponent implements OnInit { + @ViewChild('st', { static: true }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('auditModal', { static: false }) auditModal!: any; + @ViewChild('viewReasonModal', { static: false }) viewReasonModal!: any; + columns!: STColumn[]; + searchSchema!: SFSchema; + totalInfo: any = { + partnerNum: 34, + count: 98, + invoiceAmount: 978239.98, + tax: 9878.00, + recorededAmount: 728698.98 + } + + _$expand = false; + + selectedRows: any[] = []; + totalCallNo = 0; + refundStatus: any = ''; + + msg = ''; + + ltdId = ''; // 网络货运人 + accountName = ''; // 账户名称 + + + constructor(public service: RecordedService, private nzModalService: NzModalService, + private router: Router, public ar: ActivatedRoute, public shipperSrv: ShipperBaseService) { + + this.accountName = this.ar.snapshot.queryParams?.userIdLabel || ''; + this.ltdId = this.ar.snapshot.queryParams?.ltdId || ''; + + } + + ngOnInit(): void { + this.searchSchema = this.initSF(); + this.columns = this.initST(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + }, + refundStatus: this.refundStatus || null + }); + } + delete requestOptions?.body?.expand; + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + // data = data.map(node => ({ ...node, disabled: node.sts !== '0' })); + return data; + }; + + stChange(e: STChange): void { + if (e.type === 'checkbox') { + const checkRows = (e.checkbox as STData[]) || []; + //判断当前页是否有选中的行 + if (checkRows.length === 0) { + // 当前页没有存在已勾选的行,移除之前所记录的当前页的行 + const stList = this.st.list; + stList.forEach(item => { + this.selectedRows = this.selectedRows.filter((e: any) => e.id !== item.id); + }) + } else { + //添加新增的行 + checkRows.forEach((item: any) => { + const newSelectedList = this.selectedRows.filter((r: any) => r.id === item.id); + if (newSelectedList.length === 0) { + this.selectedRows.push(item); + + } + }) + // 移除取消选中的行 + const stList = this.st.list; + stList.forEach(item => { + if (!item.checked) { + const index = this.selectedRows.findIndex(_item => item.id === _item.id); + if (index !== -1) this.selectedRows.splice(index, 1); + } + }) + } + let totalCallNo = 0; + this.selectedRows.forEach((item => { + totalCallNo = new Big(this.totalCallNo).plus(item?.entryAmount).parse(); + })); + this.totalCallNo = totalCallNo; + } else if (e.type === 'loaded') { + // 页面加载时勾选 + (e?.loaded || []).forEach((r) => { + this.selectedRows.forEach((x) => { + if (x.id === r.id) { + r.checked = true; + } + }); + }); + } + } + + changeRefundStatus(status?: string) { + this.refundStatus = status || null; + this.st.load(1); + } + + auditAction(item?: any, type: string = '1') { + if (!item && this.selectedRows.length === 0) { + this.service.msgSrv.warning('请选择需要审核的记录'); + return; + } + this.msg = ''; + let params: Array = []; + if (item) { + params = [item.id]; + } else { + params = this.selectedRows.map(node => node.id); + } + const modal = this.nzModalService.create({ + nzTitle: type === '1' ? '审核' : '复审', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + if (!this.msg || this.msg.trim().length === 0) { + this.service.msgSrv.warning('请填写拒绝原因 '); + return; + } + this.audit({ ids: params, rejectReason: this.msg, sts: '3' }, () => { + modal.destroy(); + this.st.load(1); + }, '审核拒绝成功'); + // this.service + // .request(this.service.$api_disagree_recorded, { + // id: params, + // rejectReason: this.msg + // }) + // .subscribe(res => { + // if (res) { + // this.service.msgSrv.success('审核拒绝成功'); + // modal.destroy(); + // this.st.load(1); + // } + // }); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + this.audit({ ids: params, rejectReason: this.msg, sts: '1' }, () => { + modal.destroy(); + this.st.load(1); + }, '审核通过成功'); + } + } + ] + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + showReason(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '查看原因', + nzContent: item?.rejectionCause || item?.failCause, + nzFooter: [ + { + label: '关闭', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + accountName: { + type: 'string', + title: '账户名称', + default: this.accountName, + ui: { + placeholder: '请输入' + } + }, + sts: { + type: 'string', + title: '入账状态', + default: '', + enum: [ + { label: '全部', value: '' }, + { label: '待初审', value: '0' }, + { label: '待复核', value: '1' }, + { label: '已入账', value: '2' }, + { label: '已拒绝', value: '3' }, + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + default: this.ltdId, + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperSrv.getNetworkFreightForwarder({}, true), + } + }, + submitTime: { + title: '提交时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', className: 'text-center' }, + { title: '账户名称', index: 'accountName', width: 180, className: 'text-center' }, + { title: '虚拟账户', index: 'fictitiousAccount', width: 180, className: 'text-center' }, + { title: '入账单号', index: 'entryNumber', width: 190, className: 'text-center' }, + { title: '网络货运人', index: 'ltdName', width: 220, className: 'text-center' }, + { + title: '开票金额', + index: 'amount', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { + title: '代缴个税', + index: 'taxPersonal', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { + title: '入账金额', + index: 'entryAmount', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + + { title: '提交时间', index: 'submitTime', width: 160, className: 'text-center' }, + { title: '入账状态', index: 'stsLabel', width: 120, className: 'text-center' }, + { + title: '操作', + fixed: 'right', + width: '110px', + buttons: [ + { + text: '审核', + iif: item => item.sts === '0', + click: item => this.auditAction(item) + }, + { + text: '复审', + iif: item => item.sts === '1', + click: item => this.router.navigate(['./detail/' + item.id], { relativeTo: this.ar }) + }, + { + text: '详情', + click: item => this.router.navigate(['./detail/' + item.id], { relativeTo: this.ar }) + } + ] + } + ]; + } + + /** + * 审核 + */ + audit(params: any, callback: Function, msg = '成功') { + this.service + .request(this.service.$api_audit_recored, { ...params }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(msg); + callback(); + } + }); + } +} diff --git a/src/app/routes/partner/recorded/services/recorded.service.ts b/src/app/routes/partner/recorded/services/recorded.service.ts new file mode 100644 index 00000000..dcf5393f --- /dev/null +++ b/src/app/routes/partner/recorded/services/recorded.service.ts @@ -0,0 +1,17 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class RecordedService extends BaseService { + + $api_get_recorded_page = `/api/bpc/partnerInvoiceEntry/queryInvoiceEntrylist`; // 查询合伙人发票入账主表 + $api_get_recorded_record_detail = `/api/bpc/partnerInvoice/getDetailByOpration`; // 入账记录详情 + $api_disagree_recorded = ``; // 拒绝审核 + $api_agree_recorded = ``; // 同意审核 + $api_audit_recored = `/api/bpc/partnerInvoiceEntry/oprationAudit`; // 审核单据 + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/scrollimg/components/add/add.component.html b/src/app/routes/partner/scrollimg/components/add/add.component.html new file mode 100644 index 00000000..f6a39e94 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/add/add.component.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/partner/scrollimg/components/add/add.component.spec.ts b/src/app/routes/partner/scrollimg/components/add/add.component.spec.ts new file mode 100644 index 00000000..80b44d19 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/add/add.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { AdComponentsAddComponent } from './add.component'; + +describe('AdComponentsAddComponent', () => { + let component: AdComponentsAddComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AdComponentsAddComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AdComponentsAddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/scrollimg/components/add/add.component.ts b/src/app/routes/partner/scrollimg/components/add/add.component.ts new file mode 100644 index 00000000..e8345d9e --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/add/add.component.ts @@ -0,0 +1,243 @@ +import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import format from 'date-fns/format'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { apiConf } from '@conf/api.conf'; +import { ScrollImgService } from '../../services/scrollimg.service'; + +@Component({ + selector: 'app-ad-components-add', + templateUrl: './add.component.html', + styleUrls: ['./add.less'] +}) +export class ScrollimgComponentsAddComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + record: any = {}; + i: any; + schema: SFSchema = {}; + contentListData = []; + queryParams: any = {}; + oldTakeEffectTime = ''; + maxSort = 0; + isVisible = false; + validFalg = true; + detailData: any = { + advertisementContentDTOList: [] + }; + changeTimeFlag = false; + currentIndex = 0; + addFlag = true; + addId = 1; + inputPoint: any = { + lng: 0, + lat: 0 + }; + today = new Date(); + navData: any = []; + navigationName = ''; + ui: SFUISchema = { + '*': { + spanLabelFixed: 200, + grid: { span: 24 }, + }, + }; + constructor( + public msgSrv: NzMessageService, + public http: _HttpClient, + public service: ScrollImgService, + private route: ActivatedRoute, + private router: Router, + private envSrv: EAEnvironmentService, + ) { } + + + ngOnInit(): void { + this.queryParams = this.route.snapshot.queryParams; + if (this.queryParams.type !== 'add') { + this.initDetailData(); + } + this.initSF(); + } + initDetailData() { + + } + initSF() { + this.schema = { + properties: { + name: { + type: 'string', + title: '轮播图名称', + maxLength: 10, + ui: { + showRequired: true, + placeholder: '请不要超过10个字', + } + }, + licensePhotoWatermark: { + type: 'string', + title: '轮播图', + ui: { + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持JPG、PNG格式,文件小于2M(建议尺寸 702px * 280px)', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.enterpriseBaseDTO.licensePhoto = args.file.response.data.fullFilePath + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt4M = file.size / 1024 / 1024 < 2; + if (!isLt4M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt4M); + observer.complete(); + }); + }, + previewFile: (file: NzUploadFile) => of(file.url), + }, + }, + linkType: { + type: 'string', + title: '可见范围', + ui: { + widget: 'radio', + showRequired: true, + } as SFRadioWidgetSchema, + enum: [ + { label: '全部可见', value: 1 }, + { label: '合伙人可见', value: 2 }, + { label: '销售渠道可见', value: 3 }, + ], + }, + sortId: { + type: 'string', + title: '顺序', + ui: { + showRequired: true, + widget: '=', + placeholder: '请输入0~99,数字越大,排序越靠前', + serverSearch: true, + } as SFSelectWidgetSchema, + }, + content: { + type: 'string', + title: '内容', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 450 + }, + visibleIf: { name5: (value: string) => value === '1' } + }, + }, + }, + required: [], + }; + if (this.queryParams.type === 'add') { + setTimeout(() => { + this.sf.setValue('/takeEffectType', 1); + this.sf.setValue('/style', 1); + }, 500); + } + } + get reqParams() { + return {}; + } + disabledDate = (current: Date): boolean => { + // Can not select days before today and today + return differenceInCalendarDays(current, this.today) < 0; + } + changeTime() { + this.changeTimeFlag = true; + } + + + checkSort() { + const params: any = { + navigationId: this.sf?.value.navigationId, + sortId: this.sf?.value.sortId, + takeEffectType: this.sf?.value.takeEffectType, + }; + if (this.queryParams.id !== '0') { + params.advertisementId = this.queryParams.id; + } + if (this.sf.value.takeEffectType === 2) { + if (this.changeTimeFlag) { + params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm'); + } else { + params.takeEffectTime = this.detailData.takeEffectTime; + } + } + + } + save() { + const params: any = { + ...this.sf?.value, + latitude: this.inputPoint.lat, + longitude: this.inputPoint.lng, + id: this.queryParams.id + }; + this.detailData.advertisementContentDTOList.forEach((item: any) => { + delete item.addId; + }); + if (this.queryParams.type === 'add') { + delete params.id; + } + if (this.sf.value.takeEffectType === 2) { + if (this.changeTimeFlag) { + params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm'); + } else { + params.takeEffectTime = this.detailData.takeEffectTime; + } + } else { + delete params.takeEffectTime; + } + this.service.request(this.service.$api_add_one, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.router.navigate(['../list'], { relativeTo: this.route }); + } + }); + } + + goBack() { + window.history.go(-1); + } + gotoMap() { + this.isVisible = true; + } + + handleOk(): void { + this.isVisible = false; + } + + handleCancel(): void { + this.isVisible = false; + } + outputPointAddress(data: any) { + this.sf.setValue('/companyAddress', data.address); + this.inputPoint = data.inputPoint; + } +} diff --git a/src/app/routes/partner/scrollimg/components/add/add.less b/src/app/routes/partner/scrollimg/components/add/add.less new file mode 100644 index 00000000..0a6adacb --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/add/add.less @@ -0,0 +1,119 @@ +:host { + .styleBox { + display: flex; + align-items: flex-end; + margin: 10px 0 0 0; + } + .imgBox { + position: relative; + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + .leftBox, + .rightBox { + position: absolute; + top: 50%; + transform: translate(0, -50%); + } + img { + width: 170px; + height: 40px; + } + .leftBox { + left: 3px; + } + .rightBox { + right: 3px; + } + } + .imgBox_two { + width: 200px; + padding: 6px; + text-align: center; + border: solid 1px #eee; + img { + width: 100%; + height: 40px; + } + } + .imgBox_three { + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + img { + width: 25%; + height: 40px; + margin: 0 6% 0 0; + &:first-child { + margin: 0 6%; + } + } + } + .imgBox_four { + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + img { + width: 22%; + height: 40px; + margin: 0 2% 0 0; + &:first-child { + margin: 0 2%; + } + } + } + .imgBox_one { + width: 60px; + padding: 6px; + text-align: center; + border: solid 1px #eee; + img { + width: 100%; + height: 40px; + } + } + .imgBox_info { + width: 200px; + padding: 6px; + overflow: hidden; + border: solid 1px #eee; + .title { + width: 100%; + line-height: 30px; + text-align: center; + } + .infoBox { + .name { + line-height: 28px; + } + .map { + width: 100%; + text-align: center; + img { + width: 90%; + } + } + } + } + .hint { + margin: 0 0 0 10px; + color: #f00; + } + .addBtn { + margin: 0 0 10px 0; + } + } + .overflowText { + display: -webkit-box; + max-width: 200px; + overflow: hidden; + text-align: left; + text-overflow: -o-ellipsis-lastline; + text-overflow: ellipsis; + -webkit-line-clamp: 1; + line-clamp: 1; + -webkit-box-orient: vertical; + } \ No newline at end of file diff --git a/src/app/routes/partner/scrollimg/components/list/list.component.html b/src/app/routes/partner/scrollimg/components/list/list.component.html new file mode 100644 index 00000000..216788b4 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/list/list.component.html @@ -0,0 +1,62 @@ + + + + +
+ +
+ +
+ + + +
+ +
+
+ + + +
+
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + + +
diff --git a/src/app/routes/partner/scrollimg/components/list/list.component.less b/src/app/routes/partner/scrollimg/components/list/list.component.less new file mode 100644 index 00000000..0aae2779 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/list/list.component.less @@ -0,0 +1 @@ +@import '~@delon/theme/index'; diff --git a/src/app/routes/partner/scrollimg/components/list/list.component.spec.ts b/src/app/routes/partner/scrollimg/components/list/list.component.spec.ts new file mode 100644 index 00000000..c8ac7672 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/list/list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { AdComponentsListComponent } from './list.component'; + +describe('AdComponentsListComponent', () => { + let component: AdComponentsListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AdComponentsListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AdComponentsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/scrollimg/components/list/list.component.ts b/src/app/routes/partner/scrollimg/components/list/list.component.ts new file mode 100644 index 00000000..a1c34480 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/list/list.component.ts @@ -0,0 +1,281 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ScrollImgService } from '../../services/scrollimg.service'; + +@Component({ + selector: 'app-scrollimg-components-list', + templateUrl: './list.component.html', + styleUrls: ['./list.component.less'] +}) + +export class ScrollImgComponentsListComponent implements OnInit { + schema: SFSchema = {}; + columns: STColumn[] = []; + ui: SFUISchema = {}; + appList: any[] = []; + _$expand = false; + selectApp = { + appName: '', + appId: '' + }; + + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + constructor(public service: ScrollImgService, private modal: ModalHelper, private msg: NzMessageService, private router: Router, private modalSrv: NzModalService, private ar: ActivatedRoute) { } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + if (params.status === '') { + delete params.status; + } + if (params.style === '') { + delete params.style; + } + if (params.navigationId === '') { + delete params.navigationId; + } + return { ...params}; + } + + /** + * 选中行 + */ + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + selectAppFun(item: any) { + this.selectApp = item; + 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, + }, + }, + name: { + type: 'string', + title: '轮播图名称', + maxLength: 10, + ui: { + widget: '', + placeholder: '请输入', + } + }, + status1: { + type: 'string', + title: '可见范围', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + } as SFSelectWidgetSchema, + enum: [ + { label: '全部', value: 1 }, + { label: '全部可见', value: 2 }, + { label: '渠道销售可见', value: 3 }, + { label: '合伙人可见', value: 4 }, + ] + }, + status: { + type: 'string', + title: '状态', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + } as SFSelectWidgetSchema, + enum: [ + { label: '全部', value: 1 }, + { label: '正常', value: 2 }, + { label: '禁用', value: 3 } + ] + }, + }, + }; + this.ui = { + '*': { + spanLabelFixed: 110, + grid: { span: 8 }, + }, + }; + } + + initST() { + this.columns = [ + { + title: '轮播图名称', // 位:px + index: 'name', + className: 'text-center' + }, + { + title: '轮播图', + index: 'navigationName', + className: 'text-center' + }, + { + title: '可见范围', + index: 'navigationName', + className: 'text-center' + }, + { + title: '排序', // 位 px + index: 'sortId', + className: 'text-center' + }, + { + title: '状态', // 位 px + index: 'style', + className: 'text-center', + type: 'enum', + enum: { + 1: '正常', + 2: '禁用', + } + }, + { + title: '最后修改时间', // 位 px + index: 'createTime', + className: 'text-center' + }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 280, + buttons: [ + { + text: '修改', + click: (item) => { + this.router.navigate(['../detail'], { queryParams: { id: item.id, type: 'edit' }, relativeTo: this.ar }); + } + }, + { + text: '禁用', + pop: { + title: `是否确认禁用?`, + okType: 'danger', + icon: 'alert', + }, + click: (item) => { + this.changeStatus(item.id); + }, + iif: (item) => item.status === 1 + }, + { + text: '启用', + pop: { + title: `是否确认启用?`, + okType: 'danger', + icon: 'alert', + }, + click: (item) => { + this.changeStatus(item); + }, + iif: (item) => item.status === 2 + }, + { + text: '查看', + click: (item) => { + this.router.navigate(['../view'], { queryParams: { id: item.id, type: 'view' }, relativeTo: this.ar }); + } + }, + { + text: '删除', + pop: { + title: `确定删除吗?`, + okType: 'danger', + icon: 'alert', + }, + click: (item) => { + this.del(item); + }, + iif: (item) => item.status === 2 + }, + { + text: '操作记录', + click: (item) => { + this.router.navigate(['../operatordata'], { queryParams: { id: item.id }, relativeTo: this.ar }); + } + }, + ], + }, + ]; + } + changeStatus(item: any) { + const params = { + status, + idList: [item.id] + }; + // this.service.request(this.service.$api_openOrClose, params).subscribe(res => { + // if (res) { + // this.st.reload(); + // } + // }); + } + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 新增单个实例 + */ + add() { + this.router.navigate(['../detail'], { queryParams: { id: 0, type: 'add' }, relativeTo: this.ar }); + } + + /** + * 删除单个实例 + */ + del(item: any) { + const ids = []; + ids.push(item.id); + this.service.request(this.service.$api_del_many, ids).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功'); + this.st.reload(); + } + }); + } +} diff --git a/src/app/routes/partner/scrollimg/components/list/list.less b/src/app/routes/partner/scrollimg/components/list/list.less new file mode 100644 index 00000000..d9b6c73f --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/list/list.less @@ -0,0 +1,9 @@ +.selectApp { + display: flex; + .appTitle { + font-size: 14px; + } + } + .redfont{ + color: #f00; + } \ No newline at end of file diff --git a/src/app/routes/partner/scrollimg/services/scrollimg.service.ts b/src/app/routes/partner/scrollimg/services/scrollimg.service.ts new file mode 100644 index 00000000..0af4095c --- /dev/null +++ b/src/app/routes/partner/scrollimg/services/scrollimg.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class ScrollImgService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/regulatory-data/components/dashboard/dashboard.component.html b/src/app/routes/regulatory-data/components/dashboard/dashboard.component.html new file mode 100644 index 00000000..06139f88 --- /dev/null +++ b/src/app/routes/regulatory-data/components/dashboard/dashboard.component.html @@ -0,0 +1,13 @@ + + diff --git a/src/app/routes/regulatory-data/components/dashboard/dashboard.component.less b/src/app/routes/regulatory-data/components/dashboard/dashboard.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/regulatory-data/components/dashboard/dashboard.component.ts b/src/app/routes/regulatory-data/components/dashboard/dashboard.component.ts new file mode 100644 index 00000000..d895eedc --- /dev/null +++ b/src/app/routes/regulatory-data/components/dashboard/dashboard.component.ts @@ -0,0 +1,66 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie'; +import { NzMessageService } from 'ng-zorro-antd/message'; + +@Component({ + selector: 'app-dashboard', + templateUrl: './dashboard.component.html', + styleUrls: ['./dashboard.component.less'] +}) +export class DashboardComponent implements OnInit { + @ViewChild('pie', { static: false }) readonly pie!: G2PieComponent; + salesPieData: G2PieData[] = []; + total = ''; + + constructor(private msg: NzMessageService) { + this.refresh(); + } + ngOnInit(): void { + throw new Error('Method not implemented.'); + } + + refresh(): void { + const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min); + this.salesPieData = [ + { + x: '家用电器', + y: rv() + }, + { + x: '食用酒水', + y: rv() + }, + { + x: '个护健康', + y: rv() + }, + { + x: '服饰箱包', + y: rv() + }, + { + x: '母婴产品', + y: rv() + } + ]; + if (Math.random() > 0.5) { + this.salesPieData.push({ + x: '其他', + y: rv() + }); + } + this.total = `¥ ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`; + if (this.pie) { + // 等待组件渲染 + setTimeout(() => this.pie.changeData()); + } + } + + format(val: number): string { + return `¥ ${val.toFixed(2)}`; + } + + handleClick(data: G2PieClickItem): void { + this.msg.info(`${data.item.x} - ${data.item.y}`); + } +} diff --git a/src/app/routes/regulatory-data/regulatory-data-routing.module.ts b/src/app/routes/regulatory-data/regulatory-data-routing.module.ts new file mode 100644 index 00000000..bb68bd97 --- /dev/null +++ b/src/app/routes/regulatory-data/regulatory-data-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +import { DashboardComponent } from './components/dashboard/dashboard.component'; + +const routes: Routes = [{ path: 'dashboard', component: DashboardComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class RegulatoryDataRoutingModule {} diff --git a/src/app/routes/regulatory-data/regulatory-data.module.ts b/src/app/routes/regulatory-data/regulatory-data.module.ts new file mode 100644 index 00000000..c76d3521 --- /dev/null +++ b/src/app/routes/regulatory-data/regulatory-data.module.ts @@ -0,0 +1,14 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { SharedModule, SHARED_G2_MODULES } from '@shared'; + +import { DashboardComponent } from './components/dashboard/dashboard.component'; +import { RegulatoryDataRoutingModule } from './regulatory-data-routing.module'; + +const COMPONENTS: any = [DashboardComponent]; +const NOTROUTECOMPONENTS: any = []; +@NgModule({ + declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS], + imports: [CommonModule, RegulatoryDataRoutingModule, SharedModule, SHARED_G2_MODULES] +}) +export class RegulatoryDataModule {} diff --git a/src/app/routes/regulatory-data/services/regulatory-data.service.ts b/src/app/routes/regulatory-data/services/regulatory-data.service.ts new file mode 100644 index 00000000..7206840f --- /dev/null +++ b/src/app/routes/regulatory-data/services/regulatory-data.service.ts @@ -0,0 +1,9 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class RegulatoryDataService { + + constructor() { } +} diff --git a/src/app/routes/routes-routing.module.ts b/src/app/routes/routes-routing.module.ts index 162df5b9..1ec46449 100644 --- a/src/app/routes/routes-routing.module.ts +++ b/src/app/routes/routes-routing.module.ts @@ -15,6 +15,7 @@ import { RouterModule, Routes } from '@angular/router'; import { LayoutProComponent } from '@brand'; import { EATokenGuard } from '@core'; import { environment } from '@env/environment'; + import { AuthGuard } from '../core/guards/auth.guard'; // dashboard pages @@ -68,6 +69,8 @@ const routes: Routes = [ loadChildren: () => import('./contract-management/contract-management.module').then(m => m.ContractManagementManagementModule) }, { path: 'menu-management', loadChildren: () => import('./menu-manager/menu-manager.module').then(m => m.MenuManagerModule) }, + { path: 'partner', loadChildren: () => import('./partner/partner.module').then(m => m.PartnerModule) }, + { path: 'regulatory-data', loadChildren: () => import('./regulatory-data/regulatory-data.module').then(m => m.RegulatoryDataModule) }, { path: 'download', loadChildren: () => import('./download/download.module').then(m => m.DownloadModule) diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.ts b/src/app/routes/supply-management/components/bulk/bulk.component.ts index 716541ae..35bb9a3a 100644 --- a/src/app/routes/supply-management/components/bulk/bulk.component.ts +++ b/src/app/routes/supply-management/components/bulk/bulk.component.ts @@ -13,7 +13,7 @@ import { SupplyManagementUpdatePriceComponent } from '../update-price/update-pri @Component({ selector: 'app-supply-management-bulk', - templateUrl: './bulk.component.html', + templateUrl: './bulk.component.html' }) export class SupplyManagementBulkComponent implements OnInit { resourceStatus: any; @@ -31,10 +31,10 @@ export class SupplyManagementBulkComponent implements OnInit { @ViewChild('sf', { static: false }) sf!: SFComponent; @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; - tabs = { + tabs: any = { totalQuantity: 0, cancelQuantity: 0, - completedQuantity: 0, + receivedQuantity: 0, stayQuantity: 0 }; constructor( @@ -42,41 +42,41 @@ export class SupplyManagementBulkComponent implements OnInit { private modal: NzModalService, private router: Router, public shipperservice: ShipperBaseService - ) { } + ) {} ngOnInit(): void { this.initSF(); this.initST(); this.initSFFre(); - this.getGoodsSourceStatistical() + this.getGoodsSourceStatistical(); } /** - * 查询参数 - */ - get reqParams() { - const a:any = {}; - if(this.resourceStatus) { - a.resourceStatus = this.resourceStatus + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if (this.resourceStatus) { + a.resourceStatus = this.resourceStatus; } const params: any = Object.assign({}, this.sf?.value || {}); delete params._$expand; - return { + return { ...a, ...params, releaseTime: { start: this.sf?.value?.releaseTime?.[0] || '', - end: this.sf?.value?.releaseTime?.[1] || '', + end: this.sf?.value?.releaseTime?.[1] || '' }, deadlineTime: { start: this.sf?.value?.deadlineTime?.[0] || '', - end: this.sf?.value?.deadlineTime?.[1] || '', - }, - }; + end: this.sf?.value?.deadlineTime?.[1] || '' + } + }; } beforeReq = (requestOptions: STRequestOptions) => { - const a:any = {}; - if(this.resourceStatus) { - a.resourceStatus = this.resourceStatus + const a: any = {}; + if (this.resourceStatus) { + a.resourceStatus = this.resourceStatus; } const params: any = Object.assign({}, this.sf?.value || {}); delete params._$expand; @@ -86,12 +86,12 @@ export class SupplyManagementBulkComponent implements OnInit { ...params, releaseTime: { start: this.sf?.value?.releaseTime?.[0] || '', - end: this.sf?.value?.releaseTime?.[1] || '', + end: this.sf?.value?.releaseTime?.[1] || '' }, deadlineTime: { start: this.sf?.value?.deadlineTime?.[0] || '', - end: this.sf?.value?.deadlineTime?.[1] || '', - }, + end: this.sf?.value?.deadlineTime?.[1] || '' + } }); } this.loading = true; @@ -99,19 +99,19 @@ export class SupplyManagementBulkComponent implements OnInit { }; search() { this.st?.load(); - this.getGoodsSourceStatistical() + this.getGoodsSourceStatistical(); } afterRes = (data: any[], rawData?: any) => { - console.log(data) - this.loading = false + console.log(data); + this.loading = false; return data.map(item => ({ ...item, - disabled: item.auditStatus !== '1' + disabled: item.auditStatus !== '1' })); }; /** - * 初始化查询表单 - */ + * 初始化查询表单 + */ initSF() { this.schema = { properties: { @@ -134,26 +134,26 @@ export class SupplyManagementBulkComponent implements OnInit { default: '', ui: { widget: 'dict-select', - containsAllLable: true, + containsAllLabel: true, params: { dictKey: 'service:type' }, - containAllLable:true, + containAllLable: true, visibleIf: { - _$expand: (value: boolean) => value, - }, - } as SFSelectWidgetSchema, + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema }, settlementBasis: { title: '结算依据', type: 'string', ui: { widget: 'dict-select', - containsAllLable: true, + containsAllLabel: true, params: { dictKey: 'goodresource:settlement:type' }, - containAllLable:true, + containAllLable: true, visibleIf: { - _$expand: (value: boolean) => value, - }, - } as SFSelectWidgetSchema, + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema }, releaseTime: { title: '发布时间', @@ -163,10 +163,10 @@ export class SupplyManagementBulkComponent implements OnInit { mode: 'range', format: 'yyyy-MM-dd', visibleIf: { - _$expand: (value: boolean) => value, + _$expand: (value: boolean) => value }, - allowClear: true, - } as SFDateWidgetSchema, + allowClear: true + } as SFDateWidgetSchema }, deadlineTime: { title: '截止时间', @@ -176,10 +176,10 @@ export class SupplyManagementBulkComponent implements OnInit { mode: 'range', format: 'yyyy-MM-dd', visibleIf: { - _$expand: (value: boolean) => value, + _$expand: (value: boolean) => value }, - allowClear: true, - } as SFDateWidgetSchema, + allowClear: true + } as SFDateWidgetSchema }, enterpriseInfoId: { type: 'string', @@ -188,11 +188,11 @@ export class SupplyManagementBulkComponent implements OnInit { widget: 'select', placeholder: '请选择', visibleIf: { - _$expand: (value: boolean) => value, + _$expand: (value: boolean) => value }, allowClear: true, - asyncData: () => this.shipperservice.getNetworkFreightForwarder(), - }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } }, shipperAppUserId: { type: 'string', @@ -207,20 +207,20 @@ export class SupplyManagementBulkComponent implements OnInit { }, allowClear: true, onSearch: (q: any) => { - let str =q.replace(/^\s+|\s+$/g,""); + let str = q.replace(/^\s+|\s+$/g, ''); if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: str}) - .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { return of([]); } - }, - } as SFSelectWidgetSchema, - }, + } + } as SFSelectWidgetSchema + } }, - type: 'object', + type: 'object' }; this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; } @@ -228,24 +228,24 @@ export class SupplyManagementBulkComponent implements OnInit { this.freightSchema = { properties: { remarks: { - title: '备注', - type: 'string', - maxLength: 50, - ui: { - placeholder: '请输入备注', - widget: 'textarea', - }, - }, - } - }; - this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 16 } } }; + title: '备注', + type: 'string', + maxLength: 50, + ui: { + placeholder: '请输入备注', + widget: 'textarea' + } + } + } + }; + this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 16 } } }; } /** * 初始化数据列表 */ initST() { this.columns = [ - { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, + { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, { title: '货源编号', width: '200px', @@ -261,13 +261,14 @@ export class SupplyManagementBulkComponent implements OnInit { { title: '装货地', className: 'text-left', - index: 'loadingAddressArr', - width: '200px', - }, { + index: 'loadingAddressArr', + width: '200px' + }, + { title: '卸货地', className: 'text-left', - index: 'unloadingAddressArr', - width: '200px', + index: 'unloadingAddressArr', + width: '200px' }, { title: '用车需求', @@ -286,25 +287,25 @@ export class SupplyManagementBulkComponent implements OnInit { title: '结算依据', className: 'text-left', width: '200px', - index: 'settlementBasisLabel', + index: 'settlementBasisLabel' }, { title: '货源状态', className: 'text-left', index: 'resourceStatusLabel', - width: '120px', + width: '120px' }, { title: '截止时间', width: '170px', className: 'text-left', - index: 'deadlineTime', + index: 'deadlineTime' }, { title: '发布时间', width: '170px', className: 'text-left', - index: 'createTime', + index: 'createTime' }, { title: '审核状态', @@ -316,8 +317,8 @@ export class SupplyManagementBulkComponent implements OnInit { '1': { text: '待审核', color: 'warning' }, '2': { text: '审核通过', color: 'success' }, '3': { text: '不通过', color: 'default' }, - '4': { text: '已取消', color: 'default' }, - }, + '4': { text: '已取消', color: 'default' } + } }, { title: '操作', @@ -327,36 +328,35 @@ export class SupplyManagementBulkComponent implements OnInit { buttons: [ { text: '货源审核', - click: (_record) => this.audit(_record, 1), + click: _record => this.audit(_record, 1), iif: item => item.auditStatus === '1', - acl: { ability: ['SUPPLY-INDEX-bulkBatchAudit'] }, + acl: { ability: ['SUPPLY-INDEX-bulkBatchAudit'] } }, - { + { text: '二维码', - click: (_record) => this.assignedQrcode(_record), - iif: item => item.resourceStatus == 1, + click: _record => this.assignedQrcode(_record), + iif: item => item.resourceStatus == 1 }, { text: '修改单价', - click: (_record) => this.modification(_record), - iif: item => item.resourceStatus == 1 , - acl: { ability: ['SUPPLY-INDEX-modificationUnitPrice'] }, + click: _record => this.modification(_record), + iif: item => item.resourceStatus == 1, + acl: { ability: ['SUPPLY-INDEX-modificationUnitPrice'] } }, { text: '取消货源', - click: (_record) => this.delOne(_record), + click: _record => this.delOne(_record), iif: item => item.resourceStatus == 1, - acl: { ability: ['SUPPLY-INDEX-bulkCancelSupply'] }, + acl: { ability: ['SUPPLY-INDEX-bulkCancelSupply'] } }, { text: '再下一单', - click: (_record) => this.nextOrder(_record), - acl: { ability: ['SUPPLY-INDEX-bulkPlaceOrder'] }, + click: _record => this.nextOrder(_record), + acl: { ability: ['SUPPLY-INDEX-bulkPlaceOrder'] } }, - {type: 'divider'}, - - ], - }, + { type: 'divider' } + ] + } ]; } add(): void { @@ -371,8 +371,8 @@ export class SupplyManagementBulkComponent implements OnInit { return Object.keys(this.schema?.properties || {}).length; } /** - * 伸缩查询条件 - */ + * 伸缩查询条件 + */ expandToggle(): void { this._$expand = !this._$expand; this.sf?.setValue('/_$expand', this._$expand); @@ -386,15 +386,15 @@ export class SupplyManagementBulkComponent implements OnInit { this._$expand = false; } get selectedRows() { - return this.st?.list.filter((item) => item.checked) || []; + return this.st?.list.filter(item => item.checked) || []; } selectChange(e: number) { console.log(e); - if(e == 2) { - this.resourceStatus = 4; + if (e == 2) { + this.resourceStatus = 4; } else { - this.resourceStatus = e; + this.resourceStatus = e; } this.initST(); setTimeout(() => { @@ -402,104 +402,103 @@ export class SupplyManagementBulkComponent implements OnInit { }, 500); } - /** - * 二维码 - */ + * 二维码 + */ assignedQrcode(item: any) { const modalRef = this.modal.create({ nzTitle: '二维码', nzWidth: '468px', nzContent: SupplyManagementQrcodePageComponent, nzComponentParams: { - i: item, + i: item }, - nzFooter: null, + nzFooter: null }); } tabChange(item: any) { - console.log(item) + console.log(item); } - /** - * 审核 - * status : 1 单个 2:批量 - * value : 单个单条数据 - */ - audit(value: any, status?: any) { - console.log(value) - console.log(status) - if(status === 2) { - if(this.selectedRows.length <= 0) { - this.service.msgSrv.error('未选择货源单!'); - return - } - let list: any[] = []; - this.selectedRows.forEach(item => { - list.push(item.id); - }); - this.auditID = list; - this.auditMany = true; - } else { - this.auditID = value.id - this.auditMany = false; + /** + * 审核 + * status : 1 单个 2:批量 + * value : 单个单条数据 + */ + audit(value: any, status?: any) { + console.log(value); + console.log(status); + if (status === 2) { + if (this.selectedRows.length <= 0) { + this.service.msgSrv.error('未选择货源单!'); + return; } - this.isVisible = true; + let list: any[] = []; + this.selectedRows.forEach(item => { + list.push(item.id); + }); + this.auditID = list; + this.auditMany = true; + } else { + this.auditID = value.id; + this.auditMany = false; } - /** - * 审核关闭弹窗 - */ - handleCancel(type: any) { - this.isVisible = false + this.isVisible = true; } - /** + /** + * 审核关闭弹窗 + */ + handleCancel(type: any) { + this.isVisible = false; + } + /** * 代发货源 */ - releaseGoods() { - this.router.navigate(['/supply-management/bulk-release']); - } - /** - * 审核通过按钮 - */ - handleOK(value: any) { - if(this.auditMany === false) { - const params: any = { - id: this.auditID, - remarks: this.sfFre.value.remarks, - } - if(value == 1) { - params.auditStatus = 2 - } else { - params.auditStatus = 3 - } - console.log(params) - this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => { - if (res === true) { - this.service.msgSrv.success('审核成功!'); - this.isVisible = false; - this.st?.reload(); - this.getGoodsSourceStatistical(); - } - }) - } else { - const params: any = { - ids: this.auditID, - remarks: this.sfFre.value.remarks, - } - if(value == 1) { - params.auditStatus = 2 - } else { - params.auditStatus = 3 - } - console.log(params) - this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => { - if (res === true) { - this.service.msgSrv.success('审核成功!'); - this.isVisible = false; - this.st?.reload(); - this.getGoodsSourceStatistical(); - } - }) + releaseGoods() { + this.router.navigate(['/supply-management/bulk-release']); } + /** + * 审核通过按钮 + */ + handleOK(value: any) { + if (this.selectedRows.length <= 0) { + const params: any = { + id: this.auditID, + remarks: this.sfFre.value.remarks + }; + if (value == 1) { + params.auditStatus = 2; + } else { + params.auditStatus = 3; + } + console.log(params); + this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('审核成功!'); + this.isVisible = false; + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }); + } else { + const params: any = { + ids: this.auditID, + remarks: this.sfFre.value.remarks + }; + if (value == 1) { + params.auditStatus = 2; + } else { + params.auditStatus = 3; + } + console.log(params); + this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('审核成功!'); + this.isVisible = false; + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }); + } } // 修改单价 modification(item: any) { @@ -508,16 +507,16 @@ export class SupplyManagementBulkComponent implements OnInit { nzWidth: '600px', nzContent: SupplyManagementUpdatePriceComponent, nzComponentParams: { - record: item, + record: item }, - nzFooter: null, + nzFooter: null }); modalRef.afterClose.subscribe(res => { if (res) { this.st?.reload(); this.getGoodsSourceStatistical(); } - }) + }); } // getGoodsSourceDetail() { // this.service.request(this.service.$api_get_bulk_detail, { id: this.id }).subscribe(res => { @@ -531,8 +530,8 @@ export class SupplyManagementBulkComponent implements OnInit { this.router.navigate(['/supply-management/bulk-amend', item.id], { queryParams: { sta: 4 - }, - }) + } + }); } // 取消货源 delOne(item: any) { @@ -540,39 +539,39 @@ export class SupplyManagementBulkComponent implements OnInit { nzTitle: '确定取消货源吗?', nzContent: `取消后不可恢复,谨慎操作`, nzOnOk: () => - this.service.request(this.service.$api_cancelSource, {id: item.id}).subscribe((res) => { - if(res) { - this.service.msgSrv.success('已取消货源!') + this.service.request(this.service.$api_cancelSource, { id: item.id }).subscribe(res => { + if (res) { + this.service.msgSrv.success('已取消货源!'); this.st?.reload(); this.getGoodsSourceStatistical(); } }) - }) - + }); } - // 获取货源状态统计 - getGoodsSourceStatistical() { - this.tabs = { - totalQuantity: 0, - cancelQuantity: 0, - completedQuantity: 0, - stayQuantity: 0 - }; - const params: any = Object.assign({}, this.reqParams || {}); - delete params.resourceStatus - this.service.request(this.service.$api_get_goods_resource_statistical, { resourceType: 2, ...params }).subscribe(res => { - if (res) { - console.log(res) - this.tabs = res; - } - }) - } - // 导出 - exportFire() { - this.service.request(this.service.$api_asyncExportBulkList, this.reqParams ).subscribe((res: any) => { - if(res) { - this.service.msgSrv.success('导出成功,请去下载中心下载!') + // 获取货源状态统计 + getGoodsSourceStatistical() { + this.tabs = { + totalQuantity: 0, + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.resourceStatus; + this.service.request(this.service.$api_get_goods_resource_statistical, { resourceType: 2, ...params }).subscribe(res => { + if (res) { + console.log(res); + this.tabs = res; } - }) + }); + } + userAction() {} + // 导出 + exportFire() { + this.service.request(this.service.$api_asyncExportBulkList, this.reqParams).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('导出成功,请去下载中心下载!'); + } + }); } } diff --git a/src/app/routes/supply-management/components/vehicle/vehicle.component.ts b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts index 6236d83a..1b9be03d 100644 --- a/src/app/routes/supply-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts @@ -44,7 +44,7 @@ export class SupplyManagementVehicleComponent implements OnInit { private router: Router, private ar: ActivatedRoute, public shipperSrv: ShipperBaseService - ) {} + ) { } /** * 查询参数 @@ -151,7 +151,12 @@ export class SupplyManagementVehicleComponent implements OnInit { /** * 导入货源 */ - importGoodsSource() { + importGoodsSource() { } + + /** + * 修改运费 + */ + updateFreight(item: any) { const modalRef = this.modal.create({ nzTitle: '货源导入', nzWidth: 600, @@ -411,7 +416,7 @@ export class SupplyManagementVehicleComponent implements OnInit { // _$expand: (value: boolean) => value // }, // allowClear: true, - // containsAllLable: true, + // containsAllLabel: true, // asyncData: () => this.shipperSrv.getEnterpriseProject(this.sf.value?.shipperAppUserId) // } as SFSelectWidgetSchema // }, @@ -431,7 +436,7 @@ export class SupplyManagementVehicleComponent implements OnInit { type: 'string', ui: { widget: 'dict-select', - containsAllLable: true, + containsAllLabel: true, params: { dictKey: 'service:type' }, visibleIf: { _$expand: (value: boolean) => value @@ -445,7 +450,7 @@ export class SupplyManagementVehicleComponent implements OnInit { ui: { widget: 'dict-select', allowClear: true, - containsAllLable: true, + containsAllLabel: true, params: { dictKey: 'goodresource:audit:status' }, visibleIf: { _$expand: (value: boolean) => value diff --git a/src/app/routes/supply-management/supply-management.module.ts b/src/app/routes/supply-management/supply-management.module.ts index dee3e9f2..63ee9e26 100644 --- a/src/app/routes/supply-management/supply-management.module.ts +++ b/src/app/routes/supply-management/supply-management.module.ts @@ -11,6 +11,7 @@ import { NgModule, Type } from '@angular/core'; import { SharedModule } from '@shared'; +import { ParterRebateManageMenRecordDetailComponent } from '../partner/rebate-management/model/record-detail/record-detail.component'; import { CarAddDriverComponent } from './components/add-driver/add-driver.component'; import { SupplyManagementAddDriversComponent } from './components/add-drivers/add-drivers.component'; import { CarAddmodalComponent } from './components/addmodal/addmodal.component'; @@ -61,7 +62,8 @@ const COMPONENTS: Type[] = [ SupplyManagementReleasePublishComponent, SupplyManagementBulkReleasePublishComponent, TranAgreementComponent, - SupplyManagementImportSupplyComponent + SupplyManagementImportSupplyComponent, + ParterRebateManageMenRecordDetailComponent ]; @NgModule({ diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts index 67ba63fb..7bd939b9 100644 --- a/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts +++ b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts @@ -30,9 +30,9 @@ export class CancellationInvoiceComponent implements OnInit { totalCallNo = 0; openInfo: any = { invoicedate: null, invoiceno: null }; - constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) { } - ngOnInit(): void {} + ngOnInit(): void { } beforeReq = (requestOptions: STRequestOptions) => { if (this.sf) { @@ -154,7 +154,7 @@ export class CancellationInvoiceComponent implements OnInit { this.nzModalService.warning({ nzTitle: '确定将所选待确认开票申请撤回?', nzContent: '提交税控后发票信息不可修改,待税控开票完成后返回开票结果', - nzOnOk: () => {} + nzOnOk: () => { } }); } @@ -170,7 +170,7 @@ export class CancellationInvoiceComponent implements OnInit { this.nzModalService.warning({ nzTitle: '确定将所选待确认开票申请撤回?', nzContent: '提交税控后发票信息不可修改,待税控开票完成后返回开票结果', - nzOnOk: () => {} + nzOnOk: () => { } }); } @@ -277,7 +277,7 @@ export class CancellationInvoiceComponent implements OnInit { type: 'string', ui: { widget: 'dict-select', - containsAllLable: true, + containsAllLabel: true, params: { dictKey: 'vatinv:status' }, containAllLable: true, visibleIf: { diff --git a/src/app/routes/ticket-management/services/ticket.service.ts b/src/app/routes/ticket-management/services/ticket.service.ts index 759dd0aa..d2d66aa4 100644 --- a/src/app/routes/ticket-management/services/ticket.service.ts +++ b/src/app/routes/ticket-management/services/ticket.service.ts @@ -107,12 +107,11 @@ export class TicketService extends ShipperBaseService { // 查询快递轨迹 $api_get_express_routes = '/api/fcc/ficoExpressH/searchRoutes'; - // 下载对账单文件 $api_downloadPdf = '/api/fcc/ficoVatappBill/downloadPdf'; - - constructor(public injector: Injector, public eaCacheSrv: EACacheService) { - super(injector, eaCacheSrv); + + constructor(public injector: Injector) { + super(injector); } reviewPDF(url: string) { 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 16d21bdb..2a8d49e1 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 @@ -8,7 +8,7 @@