From c0dc0f1a85a63bccbee92c1ddf7fe80dab532e10 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Wed, 11 May 2022 17:57:00 +0800 Subject: [PATCH] fix bug --- .../components/edit/edit.component.ts | 89 +++++++++++++------ .../individual-collect.component.ts | 2 +- .../individual-declare.component.ts | 2 +- .../individual-income.component.ts | 2 +- .../invoice-reporting.component.ts | 2 +- .../order-reporting.component.ts | 2 +- 6 files changed, 65 insertions(+), 34 deletions(-) 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 index 3fc7e467..04847177 100644 --- a/src/app/routes/partner/channel-sales/components/edit/edit.component.ts +++ b/src/app/routes/partner/channel-sales/components/edit/edit.component.ts @@ -42,30 +42,59 @@ export class ParterChannelSalesEditComponent implements OnInit { ngOnInit(): void { this.initSF(); + console.log(this.sts); + if (!this.sts) { this.service.request(this.service.$api_getChannelSalesInfo, { id: this.i?.id }).subscribe(res => { const List: any = []; + const List2: any = []; + const List3: any = []; if (res) { let value1 = Object.assign({}, res); delete value1.employeeVO; let value = res.employeeVO; List.push({ label: value.empName + '/' + value.empNo, value: value.empNo }); - setTimeout(() => { - if (this.sf) { - console.log(this.sf.getProperty('/employeeVO')!.schema); + List2.push({ label: value.roleName, value: value.id }); + res.roleInfoVOList.forEach((element: any) => { + List2.push({ label: element.roleName, value: element.id }); + List3.push(element.id); + }); + setTimeout(() => { + if (this.sf) { + console.log(this.sf.getProperty('/employeeVO')!.schema); - this.sf.getProperty('/employeeVO')!.schema.enum = List; - this.sf.getProperty('/employeeVO')!.widget.reset(List); - } - if (value.empNo) { - this.sf.setValue('/employeeVO', value.empNo); - this.currentOAItem = value; - this.sf.setValue('/phoneNumber', res.telephone); - } - }) + this.sf.getProperty('/employeeVO')!.schema.enum = List; + this.sf.getProperty('/employeeVO')!.widget.reset(List); + + this.sf.getProperty('/roleIds')!.schema.enum = List2; + this.sf.getProperty('/roleIds')!.widget.reset(List2); + } + if (value.empNo) { + this.sf.setValue('/employeeVO', value.empNo); + this.sf.setValue('/roleIds', value.List3); + this.currentOAItem = value; + this.sf.setValue('/phoneNumber', res.telephone); + } + }); this.record = value1; } }); + } else { + this.service.request(this.service.$api_getAppRoleList).subscribe(res => { + if (res) { + let List: any = []; + res.forEach((element: any) => { + List.push({ label: element.roleName, value: element.id }); + }); + console.log(List); + setTimeout(() => { + if (this.sf) { + this.sf.getProperty('/roleIds')!.schema.enum = List; + this.sf.getProperty('/roleIds')!.widget.reset(List); + } + } + )} + }); } } initSF() { @@ -88,6 +117,7 @@ export class ParterChannelSalesEditComponent implements OnInit { title: '手机号', type: 'string', maxLength: 11, + readOnly: !this.sts, ui: { placeholder: '请输入' } @@ -114,6 +144,7 @@ export class ParterChannelSalesEditComponent implements OnInit { title: '关联OA员工', type: 'string', maxLength: 30, + readOnly: !this.sts, ui: { widget: 'select', // serverSearch: true, @@ -163,17 +194,17 @@ export class ParterChannelSalesEditComponent implements OnInit { 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 }; - }); - }) - ); - }, + // 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' } } }, @@ -203,14 +234,14 @@ export class ParterChannelSalesEditComponent implements OnInit { close() { this.modalRef.destroy(); } - save() { + save() { this.sf.validator({ emitError: true }); - + if (!this.sf.valid) return; - let params: any= { - ...this.sf?.value, - } - delete params.telephone + let params: any = { + ...this.sf?.value + }; + delete params.telephone; this.service.request(this.service.$api_save, { ...params, employeeVO: this.currentOAItem }).subscribe(res => { if (res) { this.service.msgSrv.success(res.msg); diff --git a/src/app/routes/tax-management/components/individual-collect/individual-collect.component.ts b/src/app/routes/tax-management/components/individual-collect/individual-collect.component.ts index 1541fe77..42f6e319 100644 --- a/src/app/routes/tax-management/components/individual-collect/individual-collect.component.ts +++ b/src/app/routes/tax-management/components/individual-collect/individual-collect.component.ts @@ -268,6 +268,6 @@ export class TaxManagementIndividualCollectComponent extends BasicTableComponent // 导出 exprot() { - this.service.exportStart({ ...this.sfValue, pageSize: -1 }, this.service.$api_taxSummary_export); + this.service.exportStart({ ...this.reqParams, pageSize: -1 }, this.service.$api_taxSummary_export); } } diff --git a/src/app/routes/tax-management/components/individual-declare/individual-declare.component.ts b/src/app/routes/tax-management/components/individual-declare/individual-declare.component.ts index 1a549383..b951ae68 100644 --- a/src/app/routes/tax-management/components/individual-declare/individual-declare.component.ts +++ b/src/app/routes/tax-management/components/individual-declare/individual-declare.component.ts @@ -431,7 +431,7 @@ export class TaxManagementIndividualDeclareComponent extends BasicTableComponent // 导出 exprot() { - this.service.exportStart({ ...this.sfValue, pageSize: -1 }, this.service.$api_taxDeclaration_export); + this.service.exportStart({ ...this.reqParams, pageSize: -1 }, this.service.$api_taxDeclaration_export); } openWainingModal(content: string, title = '提示') { diff --git a/src/app/routes/tax-management/components/individual-income/individual-income.component.ts b/src/app/routes/tax-management/components/individual-income/individual-income.component.ts index 7d1d3b89..fce3e7cb 100644 --- a/src/app/routes/tax-management/components/individual-income/individual-income.component.ts +++ b/src/app/routes/tax-management/components/individual-income/individual-income.component.ts @@ -349,7 +349,7 @@ export class TaxManagementIndividualIncomeComponent extends BasicTableComponent // 导出 exprot() { - this.service.exportStart({ ...this.sfValue, pageSize: -1 }, this.service.$api_taxIncome_export); + this.service.exportStart({ ...this.sfValue,declareStatus: this.selectedIndex, pageSize: -1 }, this.service.$api_taxIncome_export); } handleOK() {} diff --git a/src/app/routes/tax-management/components/invoice-reporting/invoice-reporting.component.ts b/src/app/routes/tax-management/components/invoice-reporting/invoice-reporting.component.ts index 8b2cf608..5c26cc75 100644 --- a/src/app/routes/tax-management/components/invoice-reporting/invoice-reporting.component.ts +++ b/src/app/routes/tax-management/components/invoice-reporting/invoice-reporting.component.ts @@ -312,7 +312,7 @@ export class TaxManagementInvoiceReportingComponent extends BasicTableComponent * 异步导出 */ export() { - this.service.exportStart(this.reqParams, this.service.$api_invoiceUpload_export); + this.service.exportStart({...this.reqParams, pageSize: -1 }, this.service.$api_invoiceUpload_export); } openWainingModal(content: string, title = '提示') { diff --git a/src/app/routes/tax-management/components/order-reporting/order-reporting.component.ts b/src/app/routes/tax-management/components/order-reporting/order-reporting.component.ts index 12237a9c..3b9ea67b 100644 --- a/src/app/routes/tax-management/components/order-reporting/order-reporting.component.ts +++ b/src/app/routes/tax-management/components/order-reporting/order-reporting.component.ts @@ -467,7 +467,7 @@ export class TaxManagementOrderReportingComponent extends BasicTableComponent im * 异步导出 */ export() { - this.service.exportStart(this.sf?.value, this.service.$api_async_export_order_reporting_list); + this.service.exportStart({...this.reqParams, pageSize: -1} ,this.service.$api_async_export_order_reporting_list); } openWainingModal(content: string, title = '提示') {