diff --git a/src/app/routes/datatable/datatable-routing.module.ts b/src/app/routes/datatable/datatable-routing.module.ts index 76a62af8..6f84e112 100644 --- a/src/app/routes/datatable/datatable-routing.module.ts +++ b/src/app/routes/datatable/datatable-routing.module.ts @@ -1,10 +1,12 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { DatatableDataindexComponent } from './dataindex/dataindex.component'; +import { DatatableOrderReportingComponent } from './reporting/components/order-reporting/order-reporting.component'; const routes: Routes = [ - { path: 'dataindex', component: DatatableDataindexComponent }]; + { path: 'dataindex', component: DatatableDataindexComponent }, + { path: 'reporting/order', component: DatatableOrderReportingComponent }]; @NgModule({ imports: [RouterModule.forChild(routes)], diff --git a/src/app/routes/datatable/datatable.module.ts b/src/app/routes/datatable/datatable.module.ts index f996d3b5..e6b0e997 100644 --- a/src/app/routes/datatable/datatable.module.ts +++ b/src/app/routes/datatable/datatable.module.ts @@ -2,9 +2,11 @@ import { NgModule, Type } from '@angular/core'; import { SharedModule, SHARED_G2_MODULES } from '@shared'; import { DatatableRoutingModule } from './datatable-routing.module'; import { DatatableDataindexComponent } from './dataindex/dataindex.component'; +import { DatatableOrderReportingComponent } from './reporting/components/order-reporting/order-reporting.component'; const COMPONENTS: Type[] = [ - DatatableDataindexComponent]; + DatatableDataindexComponent, + DatatableOrderReportingComponent]; @NgModule({ imports: [ diff --git a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.html b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.html new file mode 100644 index 00000000..7724c122 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.html @@ -0,0 +1,85 @@ + + + + +
+
+ +
+
+ + + + +
+
+
+ + + + + + + + + + {{item.billCode}} + + +
+
{{item.expenseName}}:{{item.price | currency}}
+
+
+ +
{{ address }}
+
+ +
{{ address }}
+
+ +
+
货物名称 : {{item.goodsName}}
+
重量/体积 : {{item.weight}}/{{item.volume}}
+
车型/车长 :{{item.carModelLabel}}/{{item.carLengthLabel}}
+
+
+ +
{{item.driverName}}
+
{{item.driverPhone}}
+
{{item.carNo}}
+
+ +
{{item.payeeName}}
+
{{item.payeePhone}}
+
+ +
创建时间:{{item.createTime}}
+
装货时间:{{item.loadTime}}
+
卸货时间:{{item.unloadTime}}
+
+ +
{{item?.complianceName}}
+
+ +
{{item?.billTypeLabel}} ({{item?.serviceTypeLabel}})
+
+
+
+ +
+
+ 已选择 + {{ selectedRows.length }} 条数据 +
+ + + +
+
diff --git a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.spec.ts b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.spec.ts new file mode 100644 index 00000000..2c07610f --- /dev/null +++ b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableOrderReportingComponent } from './order-reporting.component'; + +describe('DatatableOrderReportingComponent', () => { + let component: DatatableOrderReportingComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableOrderReportingComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableOrderReportingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts new file mode 100644 index 00000000..28e93168 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts @@ -0,0 +1,416 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ReportingService } from '../../services/reporting.service'; + +@Component({ + selector: 'app-datatable-order-reporting', + templateUrl: './order-reporting.component.html', +}) +export class DatatableOrderReportingComponent 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: '请选择', + + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + loadingPlace1: { + title: '司机轨迹', + type: 'string', + enum: [ + { label: '全部', value: '' }, + { label: '有', value: '1' }, + { label: '无', value: '0' } + ], + ui: { + placeholder: '请选择', + + 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: '80px', }, + { title: '订单状态', index: 'name', className: 'text-center', width: '120px', }, + { title: '司机状态', index: 'name', className: 'text-center', width: '120px', }, + { title: '车辆状态', index: 'name', className: 'text-center', width: '120px', }, + { title: '本地校验', render: 'orderSn', className: 'text-center', width: '180px', }, + { + title: '订单号', + render: 'billComplianceVOS', + className: 'text-center', + width: '150px', + }, + { title: '运单号', render: 'freightDetails', className: 'text-center', width: '150px', }, + + { + title: '网络货运人', + render: 'serviceType', + className: 'text-center', + width: '120px', + }, + { title: '统一社会信用代码', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '300px' }, + { title: '业务类型', index: 'dischargePlace', render: 'dischargePlace', className: 'text-center', width: '300px' }, + { title: '运单生成时间', render: 'goodsInfoVOList', className: 'text-center', width: '200px' }, + { title: '发货时间', render: 'driver', className: 'text-center', width: '150px' }, + { title: '收货时间', render: 'payeeName', className: 'text-center', width: '150px' }, + { title: '托运人名称', render: 'transportInfo', className: 'text-center', width: '250px' }, + { title: '托运人统一社会信用代码', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '300px' }, + { title: '装货地址', index: 'dischargePlace', render: 'dischargePlace', className: 'text-center', width: '300px' }, + { title: '运单生成时间', render: 'goodsInfoVOList', className: 'text-center', width: '200px' }, + { title: '收货方名称', render: 'driver', className: 'text-center', width: '150px' }, + { 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: '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: '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: '250px' }, + { title: '司机轨迹', render: 'payeeName', className: 'text-center', width: '150px' }, + { title: '上传次数', render: 'transportInfo', className: 'text-center', width: '250px' }, + { title: '上传时间', render: 'transportInfo', className: 'text-center', width: '250px' }, + { + title: '操作', + width: '200px', + className: 'text-center', + buttons: [ + // { text: '编辑', click: (_record: any) => this.appeal(_record) }, + { + text: '申诉', + // click: (record) => this.appeal(record), + iif: (_record) => _record.representationsStatus === '1', + acl: { 'ability': ['RiskOrder-Appeal'] } + }, + { + text: '撤销申诉', + pop: { + title: '是否确定立即撤销申诉?', + okType: 'danger', + }, + click: (record) => this.recall(record), + iif: (_record) => _record.representationsStatus === '2', + acl: { 'ability': ['RiskOrder-CancleAppeal'] } + }, + { text: '详情', click: (_record: any) => this.view(_record), acl: { 'ability': ['RiskOrder-Detail'] } }, + ], + }, + ]; + } + + + + /** + * 删除单个实例 + * @param record 记录实例 + */ + recall(record: STData) { + this.service.request(this.service.$api_recall_reporting, { id: record?.id }).subscribe((res: any) => { + if (res) { + this.search({ representationsStatus: '' }); + } + }) + + } + + 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() { + + } + + + /** + * + * @param params 上传设置 + */ + uploadSetting() { + + } + + search(params = {}) { + this.st.load(1); + } + + /** + * 异步导出 + */ + export() { + this.service.exportStart(this.sf?.value, this.service.$api_async_export_order_reporting_list); + } + +} diff --git a/src/app/routes/datatable/reporting/services/reporting.service.ts b/src/app/routes/datatable/reporting/services/reporting.service.ts new file mode 100644 index 00000000..99a1cad7 --- /dev/null +++ b/src/app/routes/datatable/reporting/services/reporting.service.ts @@ -0,0 +1,15 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class ReportingService extends BaseService { + + $api_order_reporting_page = ``; // 订单上报列表 + $api_recall_reporting = ``; // 撤回 + $api_async_export_order_reporting_list = ``; // 导出订单上报 + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts index 1ae799ba..b4bedae1 100644 --- a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts +++ b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts @@ -154,13 +154,13 @@ export class InvoiceDetailComponent implements OnInit { { title: '卸货地', index: 'loadingto', width: 220 }, { title: '货物信息', index: 'goodsinfo', width: 140 }, { title: '承运司机', index: 'driverinfo', width: 280 }, - { - title: '税额', - index: 'billvatrate', - width: 120, - className: 'text-right', - format: item => `${item.billvatrate ? ((item.billvatrate as number) * 100).toFixed(2) : 0}%` - }, + // { + // title: '税额', + // index: 'billvatrate', + // width: 120, + // className: 'text-right', + // format: item => `${item.billvatrate ? ((item.billvatrate as number) * 100).toFixed(2) : 0}%` + // }, { title: '申请金额', index: 'billkpnotax', diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts index a21104a4..d3e34775 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts @@ -55,6 +55,8 @@ export class InvoiceRequestedComponent { }; afterRes = (data: any[], rawData?: any) => { + this.totalCallNo = 0; + this.selectedRows = []; return data.map(item => ({ ...item, disabled: item.expressHSts @@ -436,7 +438,10 @@ export class InvoiceRequestedComponent { width: 150, type: 'widget', className: 'text-right', - widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.invoicedMoney }) } + widget: { + type: 'currency-chy', + params: ({ record }) => ({ value: record.invoicedMoney }) + } }, { title: '开户行', index: 'bankName', width: 160 }, { title: '银行账户', index: 'bankAccount', width: 140 }, diff --git a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts index ed1d8ae9..4a536279 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts +++ b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts @@ -47,6 +47,8 @@ export class RequestedInvoiceModalComponent { if (res) { this.service.msgSrv.success('移除成功'); this.modal.destroy(true); + } else { + this.service.msgSrv.warning('移除失败'); } }); } diff --git a/src/app/shared/components/dict-select/dict-select.component.ts b/src/app/shared/components/dict-select/dict-select.component.ts index 4639fb0a..e1f1aef1 100644 --- a/src/app/shared/components/dict-select/dict-select.component.ts +++ b/src/app/shared/components/dict-select/dict-select.component.ts @@ -29,7 +29,7 @@ export class DictSelectComponent implements OnInit, ControlValueAccessor { @Input() containsAllLabel = true; // 是否包含全部这一选项 @Input() mode: 'multiple' | 'tags' | 'default' = 'default'; - constructor(public service: DictSelectService, public cdr: ChangeDetectorRef) {} + constructor(public service: DictSelectService, public cdr: ChangeDetectorRef) { } writeValue(geo: string): void { if (geo == null) { @@ -56,7 +56,6 @@ export class DictSelectComponent implements OnInit, ControlValueAccessor { if (this.dictList.length > 0 && this.containsAllLabel !== false) { const obj = { label: '全部', value: '' }; this.dictList.unshift(obj); - console.log(this.dictList); } this.cdr.markForCheck(); } diff --git a/src/assets/mocks/menu-data.json b/src/assets/mocks/menu-data.json index 25563c4a..824190d8 100644 --- a/src/assets/mocks/menu-data.json +++ b/src/assets/mocks/menu-data.json @@ -640,9 +640,14 @@ "icon": "iconfont icon-hetong-copy", "group": true, "children": [{ - "text": "数据报表", - "link": "/regulatory-data/dashboard" - }] + "text": "数据报表", + "link": "/regulatory-data/dashboard" + }, + { + "text": "订单上报", + "link": "/datatable/reporting/order" + } + ] } ] }]