From 8b262bd0287e776bb14b3823c05fa06296c9d09a Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Wed, 20 Apr 2022 16:12:55 +0800 Subject: [PATCH] edit --- .../contract-frame.component.ts | 77 +++++++++++------- .../contract-list/contract-list.component.ts | 81 +++++++++++-------- .../contract-partner.component.ts | 15 +++- .../services/contract-management.service.ts | 11 +++ 4 files changed, 121 insertions(+), 63 deletions(-) diff --git a/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts index 0a13f444..bf35684b 100644 --- a/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts +++ b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts @@ -32,33 +32,39 @@ export class ContractManagementFrameComponent implements OnInit { private nzModalService: NzModalService, private router: Router, public shipperservice: ShipperBaseService, - private datePipe: DatePipe, - ) { } + private datePipe: DatePipe + ) {} ngOnInit(): void { this.initST(); this.initSF(); } /** -* 查询参数 -*/ + * 查询参数 + */ get reqParams() { const params = { - ...this.sf?.value, - } + ...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'), - } + end: this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss') + }; } - if (this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[0], 'yyyy-MM-dd HH:mm:ss') && this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[1], 'yyyy-MM-dd HH:mm:ss')) { + if ( + this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[0], 'yyyy-MM-dd HH:mm:ss') && + this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[1], 'yyyy-MM-dd HH:mm:ss') + ) { params.effectiveEndTime = { start: this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[0], 'yyyy-MM-dd HH:mm:ss'), - end: this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[1], 'yyyy-MM-dd HH:mm:ss'), - } + end: this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[1], 'yyyy-MM-dd HH:mm:ss') + }; } return { ...params @@ -71,7 +77,7 @@ export class ContractManagementFrameComponent implements OnInit { this.columns = [ { title: '合同编号', - width: '100px', + width: '130px', className: 'text-center', render: 'contractCode' }, @@ -122,6 +128,19 @@ export class ContractManagementFrameComponent implements OnInit { '5': { text: '已过期', color: 'warning' }, '7': { text: '已拒签', color: 'warning' } } + }, + { + title: '操作', + className: 'text-center', + fixed: 'right', + width: '80px', + buttons: [ + { + text: '签署', + iif: item => item.esignFlowStatus === '0' || item.esignFlowStatus === '1' || item.esignFlowStatus === '13', + click: item => this.service.StartTheProcessToESignById(item.id, () => this.st.load(1)) + } + ] } ]; } @@ -142,11 +161,11 @@ export class ContractManagementFrameComponent implements OnInit { enum: [ { label: '全部', value: '' }, { label: '货主', value: 1 }, - { label: '司机', value: 2 }, + { label: '司机', value: 2 } ], ui: { widget: 'select', - placeholder: '请选择', + placeholder: '请选择' } }, contractType: { @@ -157,8 +176,8 @@ export class ContractManagementFrameComponent implements OnInit { widget: 'dict-select', containsAllLable: true, params: { dictKey: 'contract:type' }, - containAllLable: true, - } as SFSelectWidgetSchema, + containAllLable: true + } as SFSelectWidgetSchema }, enterpriseInfoId: { type: 'string', @@ -178,8 +197,8 @@ export class ContractManagementFrameComponent implements OnInit { title: '合同对象', ui: { visibleIf: { - _$expand: (value: boolean) => value, - }, + _$expand: (value: boolean) => value + } } }, signTime: { @@ -188,8 +207,8 @@ export class ContractManagementFrameComponent implements OnInit { ui: { widget: 'custom', visibleIf: { - _$expand: (value: boolean) => value, - }, + _$expand: (value: boolean) => value + } } }, effectiveEndTime: { @@ -198,8 +217,8 @@ export class ContractManagementFrameComponent implements OnInit { ui: { widget: 'custom', visibleIf: { - _$expand: (value: boolean) => value, - }, + _$expand: (value: boolean) => value + } } }, esignFlowStatus: { @@ -212,10 +231,10 @@ export class ContractManagementFrameComponent implements OnInit { params: { dictKey: 'esign:flow:status' }, containAllLable: true, visibleIf: { - _$expand: (value: boolean) => value, - }, - } as SFSelectWidgetSchema, - }, + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + } }, type: 'object' }; @@ -238,9 +257,9 @@ export class ContractManagementFrameComponent implements OnInit { } } - approval(): void { } + approval(): void {} - add(): void { } + add(): void {} routeTo(item: any) { this.router.navigate(['/ticket/invoice-requested-detail/1']); 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 f2b2d049..e811104e 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 @@ -27,19 +27,22 @@ export class ContractManagementContractListComponent implements OnInit { _$expand = false; isLoading: boolean = false; /** - * 查询参数 - */ + * 查询参数 + */ get reqParams() { const params = { - ...this.sf?.value, - } + ...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'), - } + end: this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss') + }; } return { ...params @@ -51,12 +54,12 @@ export class ContractManagementContractListComponent implements OnInit { private nzModalService: NzModalService, public shipperservice: ShipperBaseService, private router: Router, - private datePipe: DatePipe, - ) { } + private datePipe: DatePipe + ) {} ngOnInit(): void { - this.initST() - this.initSF() + this.initST(); + this.initSF(); } /** * 初始化数据列表 @@ -65,7 +68,7 @@ export class ContractManagementContractListComponent implements OnInit { this.columns = [ { title: '合同编号', - width: '100px', + width: '130px', className: 'text-center', render: 'contractCode' }, @@ -106,22 +109,34 @@ export class ContractManagementContractListComponent implements OnInit { '3': { text: '已撤销', color: 'warning' }, '4': { text: '已作废', color: 'warning' }, '5': { text: '已过期', color: 'warning' }, - '7': { text: '已拒签', color: 'warning' }, - }, + '7': { text: '已拒签', color: 'warning' } + } }, - + { + title: '操作', + className: 'text-center', + fixed: 'right', + width: '80px', + buttons: [ + { + text: '签署', + iif: item => item.esignFlowStatus === '0' || item.esignFlowStatus === '1' || item.esignFlowStatus === '13', + click: item => this.service.StartTheProcessToESignById(item.id, () => this.st.load(1)) + } + ] + } ]; } /** -* 初始化查询表单 -*/ + * 初始化查询表单 + */ initSF() { this.schema = { properties: { _$expand: { type: 'boolean', ui: { hidden: true } }, contractCode: { type: 'string', - title: '合同编号', + title: '合同编号' }, businessCode: { type: 'string', @@ -151,7 +166,7 @@ export class ContractManagementContractListComponent implements OnInit { visibleIf: { _$expand: (value: boolean) => value }, - containAllLable: true, + containAllLable: true } as SFSelectWidgetSchema }, resourceType: { @@ -164,8 +179,8 @@ export class ContractManagementContractListComponent implements OnInit { containsAllLable: true, visibleIf: { _$expand: (value: boolean) => value - }, - } as SFSelectWidgetSchema, + } + } as SFSelectWidgetSchema }, enterpriseInfoId: { type: 'string', @@ -185,8 +200,8 @@ export class ContractManagementContractListComponent implements OnInit { title: '合同对象', ui: { visibleIf: { - _$expand: (value: boolean) => value, - }, + _$expand: (value: boolean) => value + } } }, signTime: { @@ -196,9 +211,9 @@ export class ContractManagementContractListComponent implements OnInit { widget: 'sl-from-to-search', format: 'yyyy-MM-dd', visibleIf: { - _$expand: (value: boolean) => value, - }, - } as SFDateWidgetSchema, + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema }, esignFlowStatus: { title: '状态', @@ -210,17 +225,17 @@ export class ContractManagementContractListComponent implements OnInit { containsAllLable: true, visibleIf: { _$expand: (value: boolean) => value - }, - } as SFSelectWidgetSchema, - }, + } + } as SFSelectWidgetSchema + } }, - type: 'object', + type: 'object' }; this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; } /** -* 查询字段个数 -*/ + * 查询字段个数 + */ get queryFieldCount(): number { return Object.keys(this.schema?.properties || {}).length; } @@ -285,7 +300,7 @@ export class ContractManagementContractListComponent implements OnInit { resetSF() { this.sf.reset(); this._$expand = false; - this.isLoading = true + this.isLoading = true; } /** * 伸缩查询条件 diff --git a/src/app/routes/contract-management/components/contract-partner/contract-partner.component.ts b/src/app/routes/contract-management/components/contract-partner/contract-partner.component.ts index 5517e3f9..e1e84d62 100644 --- a/src/app/routes/contract-management/components/contract-partner/contract-partner.component.ts +++ b/src/app/routes/contract-management/components/contract-partner/contract-partner.component.ts @@ -70,7 +70,7 @@ export class ContractManagementPartnerComponent implements OnInit { this.columns = [ { title: '合同编号', - width: '100px', + width: '130px', className: 'text-center', render: 'contractCode' }, @@ -121,6 +121,19 @@ export class ContractManagementPartnerComponent implements OnInit { '5': { text: '已过期', color: 'warning' }, '7': { text: '已拒签', color: 'warning' } } + }, + { + title: '操作', + className: 'text-center', + fixed: 'right', + width: '80px', + buttons: [ + { + text: '签署', + iif: item => item.esignFlowStatus === '0' || item.esignFlowStatus === '1' || item.esignFlowStatus === '13', + click: item => this.service.StartTheProcessToESignById(item.id, () => this.st.load(1)) + } + ] } ]; } diff --git a/src/app/routes/contract-management/services/contract-management.service.ts b/src/app/routes/contract-management/services/contract-management.service.ts index 17cc75ca..219dc75e 100644 --- a/src/app/routes/contract-management/services/contract-management.service.ts +++ b/src/app/routes/contract-management/services/contract-management.service.ts @@ -35,7 +35,18 @@ export class ContractManagementService extends BaseService { $api_listPartner_page = `/api/sdc/contract/listPartner/page`; // 获取订单合同表 $api_contract_get = `/api/sdc/contract/get`; + + // 发起E签宝跟据合同ID + $api_startTheProcessToESignById = `/api/sdc/contract/startTheProcessToESignById`; constructor(public injector: Injector) { super(injector); } + + StartTheProcessToESignById(id: string, callback: () => void) { + this.request(this.$api_startTheProcessToESignById, { id }).subscribe(res => { + if (res) { + callback(); + } + }); + } }