From 7c8e15a1cf6830ed67229c4788e025e75e8090c0 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Fri, 18 Feb 2022 14:18:50 +0800 Subject: [PATCH] edit --- .../network-freight.component.html | 8 +- .../network-freight.component.less | 54 ++--- .../network-freight.component.ts | 199 +++++++++++------- .../components/freight/list/list.component.ts | 2 +- .../account-detail.component.ts | 6 +- 5 files changed, 157 insertions(+), 112 deletions(-) diff --git a/src/app/routes/sys-setting/components/network-freight/network-freight.component.html b/src/app/routes/sys-setting/components/network-freight/network-freight.component.html index e01a0b1d..0fd711da 100644 --- a/src/app/routes/sys-setting/components/network-freight/network-freight.component.html +++ b/src/app/routes/sys-setting/components/network-freight/network-freight.component.html @@ -76,15 +76,13 @@
{{ item?.pinganEnable ? '已开启' : '未开启' }}
-
{{ item?.pufaEnable ? '已开启' : '未开启' }}
+
{{ item?.pufaEnable ? '已开启' : '未开启' }}
-
{{ item?.pinganAccountEnable ? '已开启' : '未开启' }}
-
{{ item?.pinganAccountEnable ? item?.pinganAccount : '' }}
+ {{ item?.pinganAccount || '开通子账户' }}
-
{{ item?.pufaAccountEnable ? '已开启' : '未开启' }}
-
{{ item?.pufaAccountEnable ? item?.pufaAccount : '' }}
+ {{ item?.pufaAccount || '开通子账户' }}
{{ item?.invoiceEnable ? '已开启' : '未开启' }}
diff --git a/src/app/routes/sys-setting/components/network-freight/network-freight.component.less b/src/app/routes/sys-setting/components/network-freight/network-freight.component.less index 4b87d5c1..55ba55e0 100644 --- a/src/app/routes/sys-setting/components/network-freight/network-freight.component.less +++ b/src/app/routes/sys-setting/components/network-freight/network-freight.component.less @@ -1,27 +1,31 @@ :host { - ::ng-deep { - .card-height { - min-height: 600px; - } - - .save-btn { - width : 100%; - text-align: right; - } - - .block-radio { - display : flex; - min-height: 32px; - } - - input { - width : 100px; - margin-left: 10px; - } - - .ant-form-item-control-input-content { - display: flex; - } + ::ng-deep { + .card-height { + min-height: 600px; } - - } \ No newline at end of file + + .save-btn { + width : 100%; + text-align: right; + } + + .block-radio { + display : flex; + min-height: 32px; + } + + input { + width : 100px; + margin-left: 10px; + } + + .ant-form-item-control-input-content { + display: flex; + } + + .text-truncate { + white-space: normal; + } + } + +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts b/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts index fec31a66..57e0e208 100644 --- a/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts +++ b/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts @@ -5,6 +5,7 @@ import { SFCascaderWidgetSchema, SFComponent, SFRadioWidgetSchema, SFSchema, SFU import { DynamicSettingModalComponent, SinglepageSettingModalComponent } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; import { takeLast } from 'rxjs/operators'; +import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component'; import { SystemService } from '../../services/system.service'; @Component({ @@ -32,77 +33,76 @@ export class NetworkFreightComponent implements OnInit { formData: any; ticketId: any; ticketItem: any; - formDataTicket: any - formDataTax: any + formDataTicket: any; + formDataTax: any; isVisible = false; isVisibleTicket = false; edit = false; editId = false; - tabs: any[] = [ - {name: '开票设置'}, - {name: '税务设置'}, - ]; + tabs: any[] = [{ name: '开票设置' }, { name: '税务设置' }]; columns: STColumn[] = [ - { - title: '公司名称', - width: '180px', - index: 'enterpriseName' - }, - { + { + title: '公司名称', + width: '180px', + index: 'enterpriseName' + }, + { title: '纳税人识别号', width: '180px', - index: 'taxCode' }, - { + index: 'taxCode' + }, + { title: '成立日期', width: '150px', index: 'enterpriseRegistrationTime' }, - { + { title: '成本费率', width: '150px', render: 'costRate' - }, - { + }, + { title: '附加费率', width: '150px', render: 'goodsSurchargeRatio' - }, - { + }, + { title: '云开票', width: '150px', - render: 'ticketEnable' + render: 'ticketEnable' }, - { + { title: '保险', width: '150px', - render: 'insuranceEnable' + render: 'insuranceEnable' }, - { + { title: '平安银行', width: '150px', - render: 'pinganEnable' }, - { + render: 'pinganEnable' + }, + { title: '浦发银行', width: '150px', render: 'pufaEnable' - }, - { + }, + { title: '平安电子账户', - width: '150px', + width: '170px', render: 'pinganAccountEnable' - }, - { + }, + { title: '浦发电子账户', - width: '150px', + width: '170px', render: 'pufaAccountEnable' - }, - { + }, + { title: '开票开关', width: '150px', render: 'invoiceEnable' - }, + }, { title: '操作', width: '110px', @@ -128,12 +128,11 @@ export class NetworkFreightComponent implements OnInit { { text: '系统配置', click: item => this.settingAction(item) - }, + } // { // text: '合同设置', // click: item => this.roleAction(item, 2) // }, - ] } ]; @@ -146,7 +145,7 @@ export class NetworkFreightComponent implements OnInit { }; } - constructor(public service: SystemService, private nzModalService: NzModalService,private router: Router,private ar: ActivatedRoute,) {} + constructor(public service: SystemService, private nzModalService: NzModalService, private router: Router, private ar: ActivatedRoute) {} ngOnInit(): void { this.initSF(); @@ -202,17 +201,17 @@ export class NetworkFreightComponent implements OnInit { type: 'string', title: '公司名称', ui: { - widget: 'text', - }, - default: this.ticketItem?.enterpriseName, + widget: 'text' + }, + default: this.ticketItem?.enterpriseName }, taxCode2: { type: 'string', title: '纳税人识别号', ui: { - widget: 'text', - }, - default: this.ticketItem?.taxCode, + widget: 'text' + }, + default: this.ticketItem?.taxCode }, bankName: { type: 'string', @@ -305,9 +304,27 @@ export class NetworkFreightComponent implements OnInit { type: 'string', title: '详细地址', ui: { placeholder: '请输入' } - }, + } }, - required: ['enterpriseName', 'taxCode', 'bankName', 'bankAccount', 'registerAddress','registerPhone', 'senderName','senderRegionCode','senderPhone', 'senderAddress','taxClassificationVersion','taxClassificationCode','invoiceTaxRate','invoiceMaxAmount','payee','reviewer','drawer'] + required: [ + 'enterpriseName', + 'taxCode', + 'bankName', + 'bankAccount', + 'registerAddress', + 'registerPhone', + 'senderName', + 'senderRegionCode', + 'senderPhone', + 'senderAddress', + 'taxClassificationVersion', + 'taxClassificationCode', + 'invoiceTaxRate', + 'invoiceMaxAmount', + 'payee', + 'reviewer', + 'drawer' + ] }; this.ui3 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; } @@ -318,14 +335,14 @@ export class NetworkFreightComponent implements OnInit { type: 'string', title: '公司名称', ui: { - widget: 'text', - }, - default: this.ticketItem?.enterpriseName, - }, + widget: 'text' + }, + default: this.ticketItem?.enterpriseName + } }, required: ['enterpriseName'] }; - this.ui4= { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; + this.ui4 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; } initSFFre() { this.addSchema = { @@ -375,9 +392,9 @@ export class NetworkFreightComponent implements OnInit { ticket(value: any) { this.formDataTicket = []; this.formDataTax = []; - this.ticketItem = value; - this.initSFTax(); - this.initSFTicket(); + this.ticketItem = value; + this.initSFTax(); + this.initSFTicket(); this.service.request(this.service.$api_getTicketByNetworkTransporterId, { id: value.id }).subscribe((res: any) => { console.log(res); if (res) { @@ -385,26 +402,25 @@ export class NetworkFreightComponent implements OnInit { ...res }; delete List.senderRegionCode; - List.senderRegionCode = this.getProvinceData(res?.senderRegionCode), - this.formDataTicket = List; - this.ticketId = res.id; + (List.senderRegionCode = this.getProvinceData(res?.senderRegionCode)), (this.formDataTicket = List); + this.ticketId = res.id; } }); this.isVisibleTicket = true; } getProvinceData(value: any) { - this.service.http.post(this.service.$api_getRegionDetailByCode, { regionCode: value}).subscribe(res => { - console.log(res.data) - console.log(this.formDataTicket) - let enterpriseAddressCode : any= []; + this.service.http.post(this.service.$api_getRegionDetailByCode, { regionCode: value }).subscribe(res => { + console.log(res.data); + console.log(this.formDataTicket); + let enterpriseAddressCode: any = []; let regioin = res?.data?.regionFullCodes.split(','); - console.log(regioin) + console.log(regioin); regioin?.forEach((element: any) => { - enterpriseAddressCode.push(Number(element)) + enterpriseAddressCode.push(Number(element)); }); - console.log(enterpriseAddressCode) + console.log(enterpriseAddressCode); this.sfTicket.setValue('/senderRegionCode', enterpriseAddressCode); - return enterpriseAddressCode; + return enterpriseAddressCode; }); } deleteAction(item?: any) { @@ -415,7 +431,7 @@ export class NetworkFreightComponent implements OnInit { nzOnOk: () => {} }); } -// 基础设置 + // 基础设置 settingAction(item?: any) { this.nzModalService.create({ nzTitle: '系统配置', @@ -423,7 +439,7 @@ export class NetworkFreightComponent implements OnInit { nzWidth: 900, nzComponentParams: { extendType: '1', - businessId: item.id, + businessId: item.id }, nzFooter: null }); @@ -457,6 +473,31 @@ export class NetworkFreightComponent implements OnInit { }); } + createAccount(item: any, bankType: string, key: string) { + if (item[key]) { + return; + } + const params = { + accountType: 3, + bankType, + clientName: item.enterpriseName, + ctfId: item.taxCode, + ltdId: item.id, + roleId: item.id, + roleName: item.enterpriseName + }; + this.service + .request('/api/fcc/accountBalance/saveByLtd', { + ...params + }) + .subscribe(res => { + if (res) { + this.st.load(1); + this.service.msgSrv.success('开户成功'); + } + }); + } + /** * 重置表单 */ @@ -470,8 +511,8 @@ export class NetworkFreightComponent implements OnInit { this.isVisibleTicket = false; } handleOKTicket() { - console.log(this.sfTicket.valid) - console.log(this.sfTicket.value) + console.log(this.sfTicket.valid); + console.log(this.sfTicket.value); if (!this.sfTicket.valid) { this.service.msgSrv.warning('请正确填写完整!'); return; @@ -482,8 +523,8 @@ export class NetworkFreightComponent implements OnInit { if (this.ticketId) { params.id = this.ticketId; } - params.senderRegionCode = this.sfTicket.value.senderRegionCode[2] - console.log(params) + params.senderRegionCode = this.sfTicket.value.senderRegionCode[2]; + console.log(params); this.service.request(this.service.$api_networkTransporterTicket_save, params).subscribe((res: any) => { if (res) { this.service.msgSrv.success('保存成功!'); @@ -516,9 +557,7 @@ export class NetworkFreightComponent implements OnInit { }); } // 云开票 - setMakeInvoice() { - - } + setMakeInvoice() {} /* * 根据地区code查询地区列表 */ @@ -526,13 +565,13 @@ export class NetworkFreightComponent implements OnInit { return this.service.request(this.service.$api_get_region_by_code, { regionCode }); } changeType(value: any) { - console.log(value); - if(value.name === '税务设置') { - this.taxStatus = true - } else { - this.taxStatus = false - } - } + console.log(value); + if (value.name === '税务设置') { + this.taxStatus = true; + } else { + this.taxStatus = false; + } + } // 新增 creat() { this.router.navigate(['./new'], { relativeTo: this.ar }); diff --git a/src/app/routes/usercenter/components/freight/list/list.component.ts b/src/app/routes/usercenter/components/freight/list/list.component.ts index 37d4efd3..f1d58782 100644 --- a/src/app/routes/usercenter/components/freight/list/list.component.ts +++ b/src/app/routes/usercenter/components/freight/list/list.component.ts @@ -78,7 +78,7 @@ export class FreightComponentsListComponent implements OnInit { nzComponentParams: { isCanCreate: true, url: '/api/fcc/accountBalance/getShipperAccountBalanceDetailByOperator', - params: { accountType: 1, roleId: item.adminAppUserId, ctfId: item.unifiedSocialCreditCode, clientName: item.enterpriseName } + params: { accountType: 1, roleId: item.id, ctfId: item.unifiedSocialCreditCode, clientName: item.enterpriseName } }, nzFooter: null }); diff --git a/src/app/shared/components/account-detail/account-detail.component.ts b/src/app/shared/components/account-detail/account-detail.component.ts index 40087f03..b5b3c87c 100644 --- a/src/app/shared/components/account-detail/account-detail.component.ts +++ b/src/app/shared/components/account-detail/account-detail.component.ts @@ -24,13 +24,17 @@ export class AccountDetailComponent implements OnInit { ngOnInit(): void {} createAccount(item: any, type: '1' | '2') { + if (item.pfAccount) { + return; + } const params = { ltdId: item.ltdId, roleId: item.roleId, projectId: item.projectId, enterpriseId: item.enterpriseId, ctfId: this.params.ctfId, - clientName: this.params.clientName + clientName: this.params.clientName, + roleName: this.params.clientName }; if (this.params.accountType === 1) { this.service