From e6618f7ce15c6e54a9f8097a3e822e7e1c7e563b Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 17 Feb 2022 20:24:08 +0800 Subject: [PATCH 1/2] fix bug --- .../network-freight.component.html | 4 ++-- .../network-freight.component.ts | 22 +++++++++---------- 2 files changed, 13 insertions(+), 13 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 c0a207f8..e01a0b1d 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 @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-24 15:54:08 * @LastEditors : Shiming - * @LastEditTime : 2022-02-17 15:03:58 + * @LastEditTime : 2022-02-17 19:58:06 * @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\components\\network-freight\\network-freight.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -108,7 +108,7 @@ - +
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 4e3799b5..fec31a66 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 @@ -234,37 +234,37 @@ export class NetworkFreightComponent implements OnInit { title: '注册电话', ui: { placeholder: '请输入' } }, - registerPhone2: { + taxClassificationVersion: { type: 'string', title: '税收分类版本号', ui: { placeholder: '请输入' } }, - registerPhone3: { + taxClassificationCode: { type: 'string', title: '税收分类编码', ui: { placeholder: '请输入' } }, - registerPhone4: { + invoiceTaxRate: { type: 'string', title: '发票税率', ui: { placeholder: '请输入' } }, - registerPhone5: { + invoiceMaxAmount: { type: 'string', title: '发票面额上限', ui: { placeholder: '请输入' } }, - registerPhone6: { + payee: { type: 'string', title: '收款人', ui: { placeholder: '请输入' } }, - registerPhone7: { + reviewer: { type: 'string', title: '复核人', ui: { placeholder: '请输入' } }, - registerPhone8: { + drawer: { type: 'string', title: '开票人', ui: { placeholder: '请输入' } @@ -307,7 +307,7 @@ export class NetworkFreightComponent implements OnInit { ui: { placeholder: '请输入' } }, }, - required: ['enterpriseName', 'taxCode', 'bankName', 'bankAccount', 'registerAddress','registerPhone', 'senderName','senderRegionCode','senderPhone', 'senderAddress'] + 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 } } }; } @@ -418,7 +418,7 @@ export class NetworkFreightComponent implements OnInit { // 基础设置 settingAction(item?: any) { this.nzModalService.create({ - nzTitle: '基础设置', + nzTitle: '系统配置', nzContent: DynamicSettingModalComponent, nzWidth: 900, nzComponentParams: { @@ -431,7 +431,7 @@ export class NetworkFreightComponent implements OnInit { // 应用设置 settingApp(item?: any) { this.nzModalService.create({ - nzTitle: '基础设置', + nzTitle: '应用设置', nzContent: DynamicSettingModalComponent, nzWidth: 900, nzComponentParams: { @@ -445,7 +445,7 @@ export class NetworkFreightComponent implements OnInit { // 重置账户 settingPay(item?: any) { this.nzModalService.create({ - nzTitle: '基础设置', + nzTitle: '充值账户', nzContent: DynamicSettingModalComponent, nzWidth: 900, nzComponentParams: { From 2660fea880b74331c41e6e2044de756c279941db Mon Sep 17 00:00:00 2001 From: wangshiming Date: Fri, 18 Feb 2022 10:28:28 +0800 Subject: [PATCH 2/2] fix bug --- .../network-freight/new/new.component.html | 52 +-- .../network-freight/new/new.component.ts | 344 ++++-------------- .../sys-setting/services/system.service.ts | 9 +- 3 files changed, 95 insertions(+), 310 deletions(-) diff --git a/src/app/routes/sys-setting/components/network-freight/new/new.component.html b/src/app/routes/sys-setting/components/network-freight/new/new.component.html index 919fb92d..e80028b3 100644 --- a/src/app/routes/sys-setting/components/network-freight/new/new.component.html +++ b/src/app/routes/sys-setting/components/network-freight/new/new.component.html @@ -1,4 +1,14 @@ - + + @@ -44,46 +54,8 @@ - -
企业开票信息
-
-
企业管理员信息
-
- - -
-
请上传该企业授权您成为本系统企业管理员的文件的高清照片,需加盖公司印章
-
上传后系统会自动识别并填写
-
-
-
-
- -
-
请上传身份证原件的高清照片,若上传复印件,则需申请人签字;
-
上传后系统会自动识别并填写
-
-
- -
-
-
正面照(人像面)
-
示例
-
-
-
-
- -
-
-
背面照(国徽面)
-
示例
-
-
-
+
其他信息
diff --git a/src/app/routes/sys-setting/components/network-freight/new/new.component.ts b/src/app/routes/sys-setting/components/network-freight/new/new.component.ts index 26111e0e..4e9ca7a6 100644 --- a/src/app/routes/sys-setting/components/network-freight/new/new.component.ts +++ b/src/app/routes/sys-setting/components/network-freight/new/new.component.ts @@ -13,7 +13,8 @@ import { } from '@delon/form'; import { NzUploadFile } from 'ng-zorro-antd/upload'; import { of } from 'rxjs'; -import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; +import { SystemService } from '../../../services/system.service'; + const IMAGECONFIG = { previewFile: (file: NzUploadFile) => of(file.url), @@ -76,7 +77,7 @@ export class NetworkFreightNewComponent implements OnInit { } }; - constructor(private router: Router, public service: UsermanageService) {} + constructor(private router: Router, public service: SystemService) {} ngOnInit() {} submitForm() { @@ -99,42 +100,22 @@ export class NetworkFreightNewComponent implements OnInit { return; } } - const validStartTime = new Date(this.sf1.value.legalPersonIdentityDTO.validStartTime); - if (this.sf1.value.legalPersonIdentityDTO.validEndTime) { - const validEndTime = new Date(this.sf1.value.legalPersonIdentityDTO.validEndTime); - if (validStartTime.getTime() > validEndTime.getTime()) { - this.service.msgSrv.warning('法人证件有效截止日期小于开始日期'); - return; - } - } - const sfVlaue = this.sf.value; - const params = {}; + const sfVlaue = this.sf1.value; + const params: any = {}; Object.assign( params, - { ...this.sf1.value }, - { ...this.sf.value }, { - enterpriseAddressCode: this.sf1.value.enterpriseAddressCode[2], - oftenUsedServices: sfVlaue.oftenUsedServices, - registerAddress: sfVlaue.registerAddress, - registerPhone: sfVlaue.registerPhone, - creditPhoto: sfVlaue.creditPhoto, - creditPhotoWatermark: sfVlaue.creditPhotoWatermark, - promotersTelephone: sfVlaue.promotersTelephone, - networkTransporter: sfVlaue.networkTransporter, - adminUserInfo: { - certificateNumber: sfVlaue.certificateNumber, - certificatePhotoBack: sfVlaue.certificatePhotoBack, - certificatePhotoBackWatermark: sfVlaue.certificatePhotoBackWatermark, - certificatePhotoFront: sfVlaue.certificatePhotoFront, - certificatePhotoFrontWatermark: sfVlaue.certificatePhotoFrontWatermark, - name: sfVlaue.name - } + ...this.sf.value , + enterpriseInfoDTO: this.sf1.value } ); - this.service.request(this.service.$api_save_enterprise_admin, params).subscribe(res => { + console.log(params); + console.log(this.sf.value); + console.log(this.sf1.value); + params.enterpriseInfoDTO.enterpriseAddressCode = this.sf1.value?.enterpriseAddressCode?.[2]; + this.service.request(this.service.$api_networkTransporter_save, params).subscribe(res => { if (res) { - this.service.msgSrv.success('企业新增成功'); + this.service.msgSrv.success('网络货运人新增成功'); this.goBack(); } }); @@ -167,18 +148,6 @@ export class NetworkFreightNewComponent implements OnInit { this.sf1.setValue('/legalPersonIdentityDTO/certificateNumber', res.number); } } - if (isFront === 'back') { - // 背面 - if (res.validFrom) { - this.sf1.setValue('/legalPersonIdentityDTO/validStartTime', res.validFrom); - } - if (res.validTo) { - this.sf1.setValue('/legalPersonIdentityDTO/validEndTime', res.validTo); - this.sf1.setValue('/legalPersonIdentityDTO/isLoingDate', false); - } else { - this.sf1.setValue('/legalPersonIdentityDTO/isLoingDate', true); - } - } } // 企业管理员证件照 if (type === 0) { @@ -206,9 +175,6 @@ export class NetworkFreightNewComponent implements OnInit { if (res.name) { this.sf1.setValue('/enterpriseName', res.name); } - if (res.type) { - this.sf1.setValue('/enterpriseType', res.type); - } if (res.addressRegionCodes) { this.sf1.setValue('/enterpriseAddressCode', res.addressRegionCodes); } @@ -260,6 +226,19 @@ export class NetworkFreightNewComponent implements OnInit { } } as SFUploadWidgetSchema }, + enterpriseName: { + title: '公司名称', + type: 'string', + minLength: 1, + maxLength: 100, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入公司名称', + errors: { + required: '请输入公司名称' + } + } + }, unifiedSocialCreditCode: { title: '统一社会信用代码', type: 'string', @@ -275,30 +254,18 @@ export class NetworkFreightNewComponent implements OnInit { } } }, - enterpriseName: { - title: '公司名称', + certificateType2: { type: 'string', - minLength: 1, - maxLength: 100, + title: '行业', + enum: [ + { label: '大陆身份证', value: 0 }, + { label: '港澳居民通行证', value: 1 }, + { label: '香港居民通行证', value: 2 } + ], + default: 0, ui: { grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, - placeholder: '请输入公司名称', - errors: { - required: '请输入公司名称' - } - } - }, - enterpriseType: { - title: '公司类型', - type: 'string', - minLength: 1, - maxLength: 30, - ui: { - grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, - placeholder: '请输入公司类型', - errors: { - required: '请输入公司类型' - } + widget: 'select' } }, enterpriseAddressCode: { @@ -353,6 +320,20 @@ export class NetworkFreightNewComponent implements OnInit { precision: 0 } }, + staffNumber: { + title: '从业人数', + type: 'number', + minimum: 1, + maximum: 99999999999999999999, + ui: { + grid: { xxl: 13, xl: 18, lg: 22, md: 22 }, + placeholder: '请输入从业人数', + errors: { + required: '请输入从业人数' + }, + precision: 0 + } + }, enterpriseRegistrationTime: { title: '成立日期', type: 'string', @@ -364,11 +345,7 @@ export class NetworkFreightNewComponent implements OnInit { } } as SFDateWidgetSchema }, - blank1: { - type: 'string', - ui: { widget: 'text', grid: { xxl: 11, xl: 6, md: 0, sm: 0 }, class: 'input-back' }, - default: ' ' - }, + operatingStartTime: { title: '营业期限', type: 'string', @@ -434,6 +411,19 @@ export class NetworkFreightNewComponent implements OnInit { } } }, + taxStatus: { + title: '纳税状态', + type: 'string', + minLength: 1, + maxLength: 30, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入纳税状态', + errors: { + required: '请输入纳税状态' + } + } + }, legalPersonIdentityDTO: { type: 'object', @@ -505,62 +495,24 @@ export class NetworkFreightNewComponent implements OnInit { 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.sf1?.setValue('/legalPersonIdentityDTO/isLoingDate', false); - } - } as SFDateWidgetSchema - }, - isLoingDate: { - title: '长期', - type: 'boolean', - ui: { - spanLabelFixed: 100, - grid: { span: 6 }, - class: 'input-back', - widget: 'checkbox', - change: i => this.sf1?.setValue('/legalPersonIdentityDTO/validEndTime', null) - } as SFCheckboxWidgetSchema } }, - required: ['certificatePhotoFront', 'certificatePhotoBack', 'name', 'certificateType', 'certificateNumber', 'validStartTime'] + required: ['certificatePhotoFront', 'certificatePhotoBack', 'name', 'certificateType', 'certificateNumber',] } }, required: [ 'licensePhotoWatermark', 'unifiedSocialCreditCode', 'enterpriseName', - 'enterpriseType', 'enterpriseAddressCode', 'enterpriseAddress', 'registrationCapital', 'enterpriseRegistrationTime', 'operatingStartTime', - 'businessScope' + 'businessScope', + 'taxStatus', + 'staffNumber', + 'taxAuthority' ] }; } @@ -568,170 +520,26 @@ export class NetworkFreightNewComponent implements OnInit { private initOthersSF(): SFSchema { return { properties: { - title1: { title: '', type: 'string', ui: { widget: 'custom' } }, - createBank: { - title: '开户银行', - type: 'string', - ui: { grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, placeholder: '请输入银行账号' } - }, - bankAccount: { - title: '银行账号', - type: 'string', - ui: { grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, placeholder: '请输入银行账号' } - }, - registerAddress: { - title: ' 注册地址', - type: 'string', - ui: { grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, placeholder: '请输入注册地址' } - }, - registerPhone: { - title: ' 注册电话', - type: 'string', - format: 'mobile', - minLength: 1, - maxLength: 11, - ui: { - grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, - placeholder: '请输入注册电话', - errors: { required: '请输入注册电话', format: '手机号格式错误' } - } - }, - title99: { title: '', type: 'string', ui: { widget: 'custom' } }, - adminMobile: { - title: ' 企业管理员手机号', + website: { + title: '平台网址', type: 'string', - minLength: 1, - format: 'mobile', - maxLength: 11, + maxLength: 70, ui: { grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, - placeholder: '请输入企业管理员手机号', - errors: { required: '请输入企业管理员手机号', format: '手机号格式错误' } + placeholder: '请输入平台网址' } }, - tipsA: { - title: '企业管理员证件照', + costRate: { + title: '成本费率', type: 'string', - ui: { - widget: 'custom' - } - }, - 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('/certificatePhotoFront', args.fileList[0].response.data.fullFilePath); - this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 0); - } - } - } as SFUploadWidgetSchema - }, - tipsB: { - 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('/certificatePhotoBack', args.fileList[0].response.data.fullFilePath); - } - } - } as SFUploadWidgetSchema - }, - name: { - title: '企业管理员姓名', - type: 'string', - maxLength: 8, ui: { grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, - placeholder: '请输入企业管理员姓名' + placeholder: '请输入成本费率' } - }, - certificateNumber: { - title: '企业管理员身份证号', - type: 'string', - format: 'id-card', - minLength: 1, - maxLength: 18, - ui: { - grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, - placeholder: '请输入企业管理员身份证号' - } - }, - tipsD: { title: '企业授权函', type: 'string', ui: { widget: 'custom' }, default: 1 }, - creditPhoto: { title: '', type: 'string', ui: { hidden: true } }, - creditPhotoWatermark: { - type: 'string', - title: '', - ui: { - ...IMAGECONFIG, - descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', - change: args => { - if (args.type === 'success') { - this.sf.setValue('/creditPhoto', args.fileList[0].response.data.fullFilePath); - } - } - } as SFUploadWidgetSchema - }, - oftenUsedServices: { - type: 'string', - title: '常用服务', - enum: [ - { label: '整车发货', value: 10 }, - { label: '大宗发货', value: 20 } - ], - default: '', - ui: { - grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, - widget: 'select', - placeholder: '请选择', - visibleIf: { - expand: (value: boolean) => value - } - } - }, - promotersTelephone: { - title: '推广业务员手机号', - type: 'string', - minLength: 1, - format: 'mobile', - maxLength: 11, - ui: { - grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, - placeholder: '请输入推广业务员手机号', - errors: { required: '请输入推广业务员手机号', format: '手机号格式错误' } - } - }, - networkTransporter: { - type: 'string', - title: '网络货运人', - ui: { - grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, - widget: 'select', - placeholder: '请选择', - allowClear: true, - asyncData: () => this.service.getNetworkFreightForwarder() - }, - default: '' } }, - required: ['createBank', 'bankAccount', 'adminMobile', 'name', 'certificateNumber', 'tipsD', 'creditPhoto', 'networkTransporter'] + required: ['website', 'bankAccount'] }; } } diff --git a/src/app/routes/sys-setting/services/system.service.ts b/src/app/routes/sys-setting/services/system.service.ts index fd765088..0ee23f4c 100644 --- a/src/app/routes/sys-setting/services/system.service.ts +++ b/src/app/routes/sys-setting/services/system.service.ts @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-12-20 17:18:43 - * @LastEditTime : 2022-01-21 10:33:20 + * @LastEditTime : 2022-02-18 09:49:06 * @LastEditors : Shiming * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\services\\system.service.ts @@ -161,7 +161,12 @@ export class SystemService extends BaseService { // 批量保存保险配置 $api_getInsuranceRate_saveBatch = '/api/mdc/cuc/insuranceConfig/saveBatch'; - + // 营业执照识别 + $api_ocr_recognize_business_license = '/api/mdc/pbc/hwc/ocr/recognizeBusinessLicense'; + // 身份证识别 + $api_ocr_recognize_id_card = '/api/mdc/pbc/hwc/ocr/recognizeIdCard'; + // 获取字典 + $api_getDictValue = '/api/mdc/pbc/dictItems/getDictValue'; $api_getRoleTemplateInfo: string = ''; $api_getFunctionButtonInfo: string = '/api/mdc/cuc/functionButton/getFunctionButtonByFunctionId';