From 0147e0034d52e2c7e2323aec0ac69cd5edde574b Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 24 Feb 2022 10:33:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contract-frame.component.html | 7 +- .../contract-frame.component.ts | 205 ++++++++++++----- .../contract-list.component.html | 6 +- .../contract-list/contract-list.component.ts | 94 ++++++-- .../contract-partner.component.html | 11 +- .../contract-partner.component.ts | 207 +++++++++++++----- .../contract-template-detail.component.ts | 6 +- .../contract-template.component.html | 17 +- .../contract-template.component.spec.ts | 14 +- .../contract-template.component.ts | 63 ++++-- .../template/template.component.html | 26 +++ .../template/template.component.spec.ts | 24 ++ .../components/template/template.component.ts | 27 +++ .../contract-management-routing.module.ts | 8 +- .../contract-management.module.ts | 11 +- .../services/contract-management.service.ts | 4 +- 16 files changed, 565 insertions(+), 165 deletions(-) create mode 100644 src/app/routes/contract-management/components/template/template.component.html create mode 100644 src/app/routes/contract-management/components/template/template.component.spec.ts create mode 100644 src/app/routes/contract-management/components/template/template.component.ts diff --git a/src/app/routes/contract-management/components/contract-frame/contract-frame.component.html b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.html index 14be2c5c..32c3b243 100644 --- a/src/app/routes/contract-management/components/contract-frame/contract-frame.component.html +++ b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-07 13:29:57 * @LastEditors : Shiming - * @LastEditTime : 2022-02-23 16:04:18 + * @LastEditTime : 2022-02-24 10:08:53 * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-frame\\contract-frame.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -29,8 +29,9 @@
- + + + 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 3aea4685..626112ec 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 @@ -1,14 +1,17 @@ +import { DatePipe } from '@angular/common'; import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { STComponent, STColumn, STChange } from '@delon/abc/st'; -import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema } from '@delon/form'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema, SFSelectWidgetSchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; import { ContractManagementService } from '../../services/contract-management.service'; @Component({ selector: 'app-contract-management-contract-frame', templateUrl: './contract-frame.component.html', - styleUrls: ['./contract-frame.component.less'] + styleUrls: ['./contract-frame.component.less'], + providers: [DatePipe] }) export class ContractManagementFrameComponent implements OnInit { url = `/rule?_allow_anonymous=true`; @@ -22,19 +25,48 @@ export class ContractManagementFrameComponent implements OnInit { columns: STColumn[] = []; ui: SFUISchema = {}; _$expand = false; - - reqParams = {}; selectedRows: any[] = []; - constructor(public service: ContractManagementService, private nzModalService: NzModalService, private router: Router) {} + constructor( + public service: ContractManagementService, + private nzModalService: NzModalService, + private router: Router, + public shipperservice: ShipperBaseService, + private datePipe: DatePipe, + ) {} ngOnInit(): void { - this.initST() - this.initSF() + this.initST(); + this.initSF(); } + /** + * 查询参数 + */ + get reqParams() { + const params = { + ...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')) { + 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'), + } + } + 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'), + } + } + return { + ...params + }; + } /** * 初始化数据列表 */ - initST() { + initST() { this.columns = [ { title: '合同编号', @@ -42,14 +74,26 @@ export class ContractManagementFrameComponent implements OnInit { className: 'text-center', render: 'contractCode' }, + { + title: '签约对象', + width: '100px', + className: 'text-center', + index: 'signingObject' + }, + { + title: '合同类型', + width: '100px', + className: 'text-center', + index: 'contractType' + }, { title: '合同名称', width: '100px', className: 'text-center', - index:'contractName' + index: 'contractName' }, - { title: '托运人', index: 'shipperName', width: '120px', className: 'text-center' }, - { title: '承运人', index: 'carrierName', width: '120px', className: 'text-center' }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '120px', className: 'text-center' }, + { title: '合同对象', index: 'contractObjectName', width: '120px', className: 'text-center' }, { title: '有效期至', className: 'text-center', @@ -75,47 +119,108 @@ export class ContractManagementFrameComponent implements OnInit { '3': { text: '已撤销', color: 'warning' }, '4': { text: '已作废', color: 'warning' }, '5': { text: '已过期', color: 'warning' }, - '7': { text: '已拒签', color: 'warning' }, - }, - }, - + '7': { text: '已拒签', color: 'warning' } + } + } ]; } - /** - * 初始化查询表单 - */ - initSF() { - this.schema = { - properties: { - _$expand: { type: 'boolean', ui: { hidden: true } }, - contractCode: { - type: 'string', - title: '合同编号', - }, - shipperName: { - type: 'string', - title: '托运人' - }, - carrierName: { - type: 'string', - title: '承运人', - }, - signTime: { - title: '签署日期', - type: 'string', - ui: { - widget: 'custom', - visibleIf: { - _$expand: (value: boolean) => value, - }, - } - }, + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + contractCode: { + type: 'string', + title: '合同编号' }, - type: 'object', - }; - this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; - } - /** + signingObject: { + type: 'string', + title: '签约对象', + enum: [ + { label: '全部', value: '' }, + { label: '货主', value: 1 }, + { label: '司机', value: 2 }, + ], + ui: { + widget: 'select', + placeholder: '请选择', + } + }, + contractType: { + title: '合同类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'contract:type' }, + containAllLable:true, + } as SFSelectWidgetSchema, + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + contractObjectName: { + type: 'string', + title: '合同对象', + ui: { + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + signTime: { + title: '签署日期', + type: 'string', + ui: { + widget: 'custom', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + effectiveEndTime: { + title: '有效期', + type: 'string', + ui: { + widget: 'custom', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + esignFlowStatus: { + title: '状态', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'esign:flow:status' }, + containAllLable:true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFSelectWidgetSchema, + }, + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + /** * 查询字段个数 */ get queryFieldCount(): number { @@ -193,7 +298,7 @@ export class ContractManagementFrameComponent implements OnInit { /** * 伸缩查询条件 */ - expandToggle(): void { + expandToggle(): void { this._$expand = !this._$expand; this.sf?.setValue('/_$expand', this._$expand); } diff --git a/src/app/routes/contract-management/components/contract-list/contract-list.component.html b/src/app/routes/contract-management/components/contract-list/contract-list.component.html index 562182fc..16e1df80 100644 --- a/src/app/routes/contract-management/components/contract-list/contract-list.component.html +++ b/src/app/routes/contract-management/components/contract-list/contract-list.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-07 15:57:49 * @LastEditors : Shiming - * @LastEditTime : 2022-01-18 17:16:12 + * @LastEditTime : 2022-02-23 20:11:50 * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-list\\contract-list.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -53,6 +53,10 @@ {{ item?.contractCode }} + + + + 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 dd3947da..24e61caa 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 @@ -5,6 +5,7 @@ import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema, SFSelectWidgetSc import { NzModalService } from 'ng-zorro-antd/modal'; import { ContractManagementService } from '../../services/contract-management.service'; import { DatePipe } from '@angular/common'; +import { ShipperBaseService } from '@shared'; @Component({ selector: 'app-contract-management-contract-list', @@ -47,6 +48,7 @@ export class ContractManagementContractListComponent implements OnInit { constructor( public service: ContractManagementService, private nzModalService: NzModalService, + public shipperservice: ShipperBaseService, private router: Router, private datePipe: DatePipe, ) {} @@ -67,19 +69,31 @@ export class ContractManagementContractListComponent implements OnInit { render: 'contractCode' }, { - title: '单据类型', + title: '签约对象', width: '100px', className: 'text-center', - index:'documentType' + index:'signingObject' }, { - title: '合同名称', + title: '合同类型', width: '100px', className: 'text-center', - index:'contractName' + index:'contractType' + }, + { + title: '货源类型', + width: '100px', + className: 'text-center', + index:'resourceType' + }, + { title: '合同名称', index: 'contractName', width: '120px', className: 'text-center' }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '120px', className: 'text-center' }, + { + title: '合同对象', + className: 'text-center', + width: '120px', + index: 'contractObjectName' }, - { title: '托运人', index: 'shipperName', width: '120px', className: 'text-center' }, - { title: '承运人', index: 'carrierName', width: '120px', className: 'text-center' }, { title: '业务单号', className: 'text-center', @@ -126,21 +140,35 @@ export class ContractManagementContractListComponent implements OnInit { type: 'string', title: '业务单号' }, - shipperName: { + signingObject: { type: 'string', - title: '托运人' - }, - carrierName: { - type: 'string', - title: '承运人', + title: '签约对象', + enum: [ + { label: '全部', value: '' }, + { label: '货主', value: 1 }, + { label: '司机', value: 2 }, + ], ui: { + widget: 'select', + placeholder: '请选择', + } + }, + contractType: { + title: '合同类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'contract:type' }, + containAllLable:true, visibleIf: { _$expand: (value: boolean) => value, }, - } + } as SFSelectWidgetSchema, }, - documentType: { - title: '单据类型', + resourceType: { + title: '货源类型', type: 'string', default: '', ui: { @@ -153,6 +181,28 @@ export class ContractManagementContractListComponent implements OnInit { }, } as SFSelectWidgetSchema, }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + contractObjectName: { + type: 'string', + title: '合同对象', + ui: { + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, signTime: { title: '签署日期', type: 'string', @@ -163,6 +213,20 @@ export class ContractManagementContractListComponent implements OnInit { }, } }, + esignFlowStatus: { + title: '状态', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'esign:flow:status' }, + containAllLable:true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFSelectWidgetSchema, + }, }, type: 'object', }; diff --git a/src/app/routes/contract-management/components/contract-partner/contract-partner.component.html b/src/app/routes/contract-management/components/contract-partner/contract-partner.component.html index 14be2c5c..69819d38 100644 --- a/src/app/routes/contract-management/components/contract-partner/contract-partner.component.html +++ b/src/app/routes/contract-management/components/contract-partner/contract-partner.component.html @@ -4,8 +4,8 @@ * @Author : Shiming * @Date : 2022-01-07 13:29:57 * @LastEditors : Shiming - * @LastEditTime : 2022-02-23 16:04:18 - * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-frame\\contract-frame.component.html + * @LastEditTime : 2022-02-24 10:08:28 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-partner\\contract-partner.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -29,10 +29,11 @@
- + + +
@@ -69,7 +70,7 @@ value, - }, - } - }, + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + contractCode: { + type: 'string', + title: '合同编号' }, - type: 'object', - }; - this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; - } - /** + signingObject: { + type: 'string', + title: '签约对象', + enum: [ + { label: '全部', value: '' }, + { label: '货主', value: 1 }, + { label: '司机', value: 2 } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + contractType: { + title: '合同类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'contract:type' }, + containAllLable: true, + } as SFSelectWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + contractObjectName: { + type: 'string', + title: '合同对象', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + signTime: { + title: '签署日期', + type: 'string', + ui: { + widget: 'custom', + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + effectiveEndTime: { + title: '有效期', + type: 'string', + ui: { + widget: 'custom', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + esignFlowStatus: { + title: '状态', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'esign:flow:status' }, + containAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + /** * 查询字段个数 */ get queryFieldCount(): number { @@ -193,7 +298,7 @@ export class ContractManagementPartnerComponent implements OnInit { /** * 伸缩查询条件 */ - expandToggle(): void { + expandToggle(): void { this._$expand = !this._$expand; this.sf?.setValue('/_$expand', this._$expand); } diff --git a/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts index 8e25c3eb..ec18e998 100644 --- a/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts +++ b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-05 11:01:55 * @LastEditors : Shiming - * @LastEditTime : 2022-01-25 14:25:49 + * @LastEditTime : 2022-02-24 10:23:53 * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template-detail\\contract-template-detail.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -16,12 +16,12 @@ import { NzModalService } from 'ng-zorro-antd/modal'; import { ContractManagementService } from '../../services/contract-management.service'; @Component({ - selector: 'app-contract-management-template-detail-complaint', + selector: 'app-contract-management-template-text-complaint', templateUrl: './contract-template-detail.component.html', styleUrls: ['./contract-template-detail.component.less'], providers: [DatePipe] }) -export class ContractManagementTemplateDetailComponent implements OnInit { +export class ContractManagementTemplateTextComponent implements OnInit { constructor( private nzModalService: NzModalService, public service: ContractManagementService, diff --git a/src/app/routes/contract-management/components/contract-template/contract-template.component.html b/src/app/routes/contract-management/components/contract-template/contract-template.component.html index 7b8d13d9..8c173c07 100644 --- a/src/app/routes/contract-management/components/contract-template/contract-template.component.html +++ b/src/app/routes/contract-management/components/contract-template/contract-template.component.html @@ -4,13 +4,12 @@ * @Author : Shiming * @Date : 2022-01-12 10:52:50 * @LastEditors : Shiming - * @LastEditTime : 2022-01-18 17:16:18 + * @LastEditTime : 2022-02-24 10:31:05 * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template\\contract-template.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> -
@@ -28,9 +27,16 @@
- +
- + + + + + + + +
-