From be0653a6f2f7801c7e3e6692bf392cf4a524cf55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E6=99=93=E4=BA=91?= Date: Sat, 2 Apr 2022 17:53:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=AE=BE=E7=BD=AE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../upload-setting.component.ts | 37 ++++++++++--------- .../reporting/services/reporting.service.ts | 4 +- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts b/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts index b9f2d909..0258f230 100644 --- a/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts +++ b/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts @@ -1,5 +1,5 @@ -import { Component, OnInit } from '@angular/core'; -import { SFSchema, SFUISchema } from '@delon/form'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; import { NzModalRef } from 'ng-zorro-antd/modal'; import { ReportingService } from '../../services/reporting.service'; @@ -8,8 +8,9 @@ import { ReportingService } from '../../services/reporting.service'; templateUrl: './upload-setting.component.html', }) export class DatatableReportingUploadSettingComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; record: any = {}; - i: any = {}; + i: any; schema!: SFSchema; ui!: SFUISchema; @@ -20,7 +21,7 @@ export class DatatableReportingUploadSettingComponent implements OnInit { ngOnInit(): void { this.initSF(); - // this.loadData(); + this.loadData(); } /** @@ -29,17 +30,17 @@ export class DatatableReportingUploadSettingComponent implements OnInit { initSF() { this.schema = { properties: { - no: { + orderPushType: { type: 'string', title: '订单数据', enum: [ { label: '手动上传', - value: '1' + value: 1 }, { label: '自动上传', - value: '2' + value: 2 } ], description: '开启自动上传后,订单将在支付完成且风险单校验通过后自动上传', @@ -48,17 +49,17 @@ export class DatatableReportingUploadSettingComponent implements OnInit { } }, - owner: { + capitalPushType: { type: 'string', title: '资金数据', enum: [ { label: '手动上传', - value: '1' + value: 1 }, { label: '自动上传', - value: '2' + value: 2 } ], description: '开启自动上传后,订单将在支付完成且风险单校验通过后自动上传', @@ -68,7 +69,7 @@ export class DatatableReportingUploadSettingComponent implements OnInit { } }, }, - required: ['owner', 'no'], + required: ['orderPushType', 'capitalPushType'], } this.ui = { '*': { @@ -85,7 +86,6 @@ export class DatatableReportingUploadSettingComponent implements OnInit { this.service.request(this.service.$api_get_upload_setting, {}).subscribe(res => { if (res) { this.i = res; - } }) } @@ -95,12 +95,13 @@ export class DatatableReportingUploadSettingComponent implements OnInit { * @param value */ save(value: any): void { - this.service.request(this.service.$api_upload_setting_save, { ...value }).subscribe(res => { - if (res) { - this.service.msgSrv.success('保存成功'); - this.modal.close(true); - } - }) + if (this.sf?.valid) + this.service.request(this.service.$api_upload_setting_save, { ...value }).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.modal.close(true); + } + }) } close(): void { diff --git a/src/app/routes/datatable/reporting/services/reporting.service.ts b/src/app/routes/datatable/reporting/services/reporting.service.ts index 4f0ebcd3..d01c6812 100644 --- a/src/app/routes/datatable/reporting/services/reporting.service.ts +++ b/src/app/routes/datatable/reporting/services/reporting.service.ts @@ -9,8 +9,8 @@ export class ReportingService extends BaseService { $api_get_order_reporting_page = `/api/sdc/regulation/list/page`; // 订单上报列表 $api_recall_reporting = ``; // 撤回 $api_async_export_order_reporting_list = ``; // 导出订单上报 - $api_get_upload_setting = ``; // 修改上传设置 - $api_upload_setting_save = ``; // 修改上传设置 + $api_get_upload_setting = `/api/sdc/regulation/getPushConfig`; // 获取上传设置 + $api_upload_setting_save = `/api/sdc/regulation/setPushConfig`; // 保存上传设置 $api_get_fund_reporting_page = `/api/fcc/fundUploadHead/list/page`; // 资金上报列表 $api_fund_reporting_upload = `/api/fcc/fundUploadHead/uploadFundNumber`; // 资金批量上传