From 28087d6363e1f9453c24fe7da4af871834b0ad32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E6=99=93=E4=BA=91?= Date: Tue, 29 Mar 2022 16:51:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E9=87=91=E4=B8=8A=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datatable/datatable-routing.module.ts | 2 + src/app/routes/datatable/datatable.module.ts | 4 +- .../fund-reporting.component.html | 57 +++ .../fund-reporting.component.less | 5 + .../fund-reporting.component.spec.ts | 24 + .../fund-reporting.component.ts | 445 ++++++++++++++++++ 6 files changed, 536 insertions(+), 1 deletion(-) create mode 100644 src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html create mode 100644 src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.less create mode 100644 src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.spec.ts create mode 100644 src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts diff --git a/src/app/routes/datatable/datatable-routing.module.ts b/src/app/routes/datatable/datatable-routing.module.ts index ece4c610..ace2f993 100644 --- a/src/app/routes/datatable/datatable-routing.module.ts +++ b/src/app/routes/datatable/datatable-routing.module.ts @@ -7,6 +7,7 @@ import { DatatableDriverComponent } from './components/customtable/driver/driver import { DatatableOperationtableComponent } from './components/operationtable/operationtable.component'; import { DatatableOrderReportingComponent } from './reporting/components/order-reporting/order-reporting.component'; import { DatatableDataindexComponent } from './components/dataindex/dataindex.component'; +import { DatatableFundReportingComponent } from './reporting/components/fund-reporting/fund-reporting.component'; const routes: Routes = [ { path: 'dataindex', component: DatatableDataindexComponent }, @@ -16,6 +17,7 @@ const routes: Routes = [ { path: 'driver', component: DatatableDriverComponent }, { path: 'operationtable', component: DatatableOperationtableComponent }, { path: 'reporting/order', component: DatatableOrderReportingComponent }, + { path: 'reporting/fund', component: DatatableFundReportingComponent } ]; diff --git a/src/app/routes/datatable/datatable.module.ts b/src/app/routes/datatable/datatable.module.ts index c9b85c4a..d42018af 100644 --- a/src/app/routes/datatable/datatable.module.ts +++ b/src/app/routes/datatable/datatable.module.ts @@ -11,6 +11,7 @@ import { DatatableOrderReportingComponent } from './reporting/components/order-r import { DatatableDataindexComponent } from './components/dataindex/dataindex.component'; import { DatatableReportingUploadSettingComponent } from './reporting/components/upload-setting/upload-setting.component'; import { DatatableReportingVerifyResultComponent } from './reporting/components/verify-result/verify-result.component'; +import { DatatableFundReportingComponent } from './reporting/components/fund-reporting/fund-reporting.component'; const COMPONENTS: Type[] = [ DatatableDataindexComponent, @@ -22,7 +23,8 @@ const COMPONENTS: Type[] = [ OperationtablePieComponent, DatatableOrderReportingComponent, DatatableReportingUploadSettingComponent, - DatatableReportingVerifyResultComponent + DatatableReportingVerifyResultComponent, + DatatableFundReportingComponent ]; @NgModule({ diff --git a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html new file mode 100644 index 00000000..e55d1e52 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html @@ -0,0 +1,57 @@ + + + + +
+
+ +
+
+ + + + +
+
+
+ + + + + + + + + + {{item?.billStatusLabel}} + {{item?.billStatusLabel}} + + + + + {{item?.billStatusLabel}} + {{item?.billStatusLabel}} + + +
{{item?.amount | currency :' '}}
+
+
+
+ +
+
+ 已选择 + {{ selectedRows.length }} 条数据 +
+ + + +
+
diff --git a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.less b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.less new file mode 100644 index 00000000..6009fbbf --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.less @@ -0,0 +1,5 @@ +:host { + .text-black { + color: #000; + } +} diff --git a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.spec.ts b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.spec.ts new file mode 100644 index 00000000..fb500388 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableFundReportingComponent } from './fund-reporting.component'; + +describe('DatatableFundReportingComponent', () => { + let component: DatatableFundReportingComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [DatatableFundReportingComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableFundReportingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts new file mode 100644 index 00000000..e817b130 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts @@ -0,0 +1,445 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ReportingService } from '../../services/reporting.service'; +import { DatatableReportingUploadSettingComponent } from '../upload-setting/upload-setting.component'; +import { DatatableReportingVerifyResultComponent } from '../verify-result/verify-result.component'; + +@Component({ + selector: 'app-datatable-fund-reporting', + templateUrl: './fund-reporting.component.html', + styleUrls: ['./fund-reporting.component.less'] +}) +export class DatatableFundReportingComponent implements OnInit { + _$expand = false; + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + tabType!: string; + tabs: any[] = [ + { name: '待上传', value: '1' }, + { name: '上传中', value: '2' }, + { name: '已上传', value: '3' }, + { name: '异常', value: '4' }, + { name: '全部', value: '' } + ]; + selectedIndex = ''; //选择的项目 + serviceTel = ''; + constructor( + public service: ReportingService, + private router: Router, + private ar: ActivatedRoute, + private modal: NzModalService, + public shipperSrv: ShipperBaseService + ) { + } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}, { + representationsStatus: this.selectedIndex, + }); + delete params._$expand; + return { ...params }; + } + + /** + * 选中行 + */ + get selectedRows() { + return this.st?.list.filter((item: any) => item.checked) || []; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.initSF(); + this.initST(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billCode: { title: '订单号', type: 'string', ui: { placeholder: '请输入' } }, + resourceCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '请输入', + }, + }, + enterpriseInfoId: { + title: '网络货运人', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'select', + asyncData: () => this.shipperSrv.getNetworkFreightForwarder({}, false), + + allowClear: true + } + }, + externalResourceCode: { + title: '货主', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + driverName: { + title: '承运司机', + type: 'string', + ui: { + placeholder: '请输入司机姓名/手机号', visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + carNo: { + title: '车牌号', + type: 'string', + maxLength: 9, + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + serviceType: { + title: '上传状态', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + serviceType1: { + title: '本地校验', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + createTime: { + title: '上传时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + createTime1: { + title: '运单生成时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + createTime2: { + title: '发货时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + createTime3: { + title: '收货时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + + loadingPlace: { + title: '车辆轨迹', + type: 'string', + enum: [ + { label: '全部', value: '' }, + { label: '有', value: '1' }, + { label: '无', value: '0' } + ], + ui: { + placeholder: '请选择', + widget: 'select', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + loadingPlace1: { + title: '司机轨迹', + type: 'string', + enum: [ + { label: '全部', value: '' }, + { label: '有', value: '1' }, + { label: '无', value: '0' } + ], + ui: { + placeholder: '请选择', + widget: 'select', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + }, + }; + this.ui = { + '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 }, enter: () => this.search() }, + $time: { grid: { span: 24 } }, + }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', className: 'text-center', width: '60px', }, + { title: '订单状态', render: 'orderStatus', className: 'text-center', width: '120px', }, + { title: '司机状态', render: 'driverStatus', className: 'text-center', width: '120px', }, + { title: '车辆状态', render: 'carStatus', className: 'text-center', width: '120px', }, + { title: '本地校验', render: 'localValid', className: 'text-center', width: '120px', }, + { + title: '订单号', + render: 'billComplianceVOS', + className: 'text-center', + width: '150px', + }, + { title: '运单号', render: 'freightDetails', className: 'text-center', width: '150px', }, + + { + title: '网络货运人', + render: 'serviceType', + className: 'text-center', + width: '180px', + }, + { title: '统一社会信用代码', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '业务类型', index: 'dischargePlace', render: 'dischargePlace', className: 'text-center', width: '120px' }, + { title: '运单生成时间', render: 'goodsInfoVOList', className: 'text-center', width: '180px' }, + { title: '发货时间', render: 'driver', className: 'text-center', width: '180px' }, + { title: '收货时间', render: 'payeeName', className: 'text-center', width: '180px' }, + { title: '托运人名称', render: 'transportInfo', className: 'text-center', width: '250px' }, + { title: '托运人统一社会信用代码', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '装货地址', index: 'dischargePlace', render: 'dischargePlace', className: 'text-center', width: '200px' }, + { title: '收货方名称', render: 'driver', className: 'text-center', width: '150px' }, + { title: '收货地址', render: 'payeeName', className: 'text-center', width: '150px' }, + { title: '运费金额', render: 'amount', className: 'text-center', width: '250px' }, + { title: '车牌号', render: 'payeeName', className: 'text-center', width: '150px' }, + { title: '车牌颜色', render: 'transportInfo', className: 'text-center', width: '250px' }, + { title: '司机姓名', render: 'payeeName', className: 'text-center', width: '150px' }, + { title: '司机手机号码', render: 'transportInfo', className: 'text-center', width: '200px' }, + { title: '司机身份证号', render: 'payeeName', className: 'text-center', width: '150px' }, + { title: '货物信息', render: 'transportInfo', className: 'text-center', width: '180px' }, + { title: '实际承运人名称', render: 'payeeName', className: 'text-center', width: '150px' }, + { title: '实际承运人证件号码', render: 'transportInfo', className: 'text-center', width: '200px' }, + { title: '实际承运人道路运输许可证号', render: 'payeeName', className: 'text-center', width: '150px' }, + { title: '车辆轨迹', render: 'transportInfo', className: 'text-center', width: '250px' }, + { title: '司机轨迹', render: 'payeeName', className: 'text-center', width: '150px' }, + { title: '上传次数', render: 'transportInfo', className: 'text-center', width: '150px' }, + { title: '上传时间', render: 'transportInfo', className: 'text-center', width: '180px' }, + ]; + } + + + + /** + *撤销 + * @param record 记录实例 + */ + recall() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要撤回的数据'); + return; + } + + this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + if (res) { + this.search(); + } + }) + + } + + selectChange(item: any) { + this.selectedIndex = item?.representationsStatus || ''; + setTimeout(() => { + this.st.load(1); + }) + } + + /** + * 查看当行数据 + */ + view(record: STData) { + // this.router.navigate(['../view', record.uuid], { relativeTo: this.ar }); + this.router.navigate(['../detail'], { + queryParams: { + id: record.id, + }, + relativeTo: this.ar + }); + } + + // appeal(item: any) { + // const modalRef = this.modal.create({ + // nzTitle: '申诉', + // nzWidth: '40%', + // nzContent: CtcAppealComponent, + // nzComponentParams: { + // i: item, + // status: 'add' + // }, + // nzFooter: null + // }); + // modalRef.afterClose.subscribe(res => { + // if (res) { + // this.search({ representationsStatus: '' }); + // } + // }) + // } + + /** + * 上传 + */ + upload() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要上传的数据'); + return; + } + } + + + /** + * + * @param params 上传设置 + */ + uploadSetting() { + const modalRef = this.modal.create({ + nzTitle: '上传设置', + nzWidth: 600, + nzContent: DatatableReportingUploadSettingComponent, + nzComponentParams: {}, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + }) + } + + /** + * 查看校验结果 + */ + viewResult(item: any) { + const modalRef = this.modal.create({ + nzTitle: '校验结果', + nzWidth: 1200, + nzContent: DatatableReportingVerifyResultComponent, + nzComponentParams: { + record: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + }) + } + + /** + * 查看监管审核结果 + */ + viewAuditResult(record: any) { + if (record?.billStatus !== '2') { + return; + } + this.openWainingModal('监管审核结果', record?.result) + } + + + search() { + this.st.load(1); + } + + /** + * 异步导出 + */ + export() { + this.service.exportStart(this.sf?.value, this.service.$api_async_export_order_reporting_list); + } + + openWainingModal(content: string, title = '提示') { + this.modal.warning({ + nzMask: false, + nzTitle: title, + nzContent: content, + }) + } + + +}