diff --git a/src/app/layout/layout.module.ts b/src/app/layout/layout.module.ts index 3afd4206..a2961e91 100644 --- a/src/app/layout/layout.module.ts +++ b/src/app/layout/layout.module.ts @@ -27,6 +27,7 @@ import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; import { NzGridModule } from 'ng-zorro-antd/grid'; import { LayoutPassportComponent } from './passport/passport.component'; import { PRO_COMPONENTS } from './pro/index'; +import { SearchDrawerModule } from '../shared/components/search-drawer/search-drawer.module'; const COMPONENTS: Array> = [...PRO_COMPONENTS, LayoutPassportComponent]; @@ -57,7 +58,8 @@ const COMPONENTS: Array> = [...PRO_COMPONENTS, LayoutPassportComponent ThemeBtnModule, ScrollbarModule, NzGridModule, - NzMessageModule + NzMessageModule, + SearchDrawerModule ], declarations: COMPONENTS, exports: COMPONENTS diff --git a/src/app/layout/pro/pro.component.html b/src/app/layout/pro/pro.component.html index 94c8c60b..4193e6bc 100644 --- a/src/app/layout/pro/pro.component.html +++ b/src/app/layout/pro/pro.component.html @@ -37,4 +37,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/src/app/routes/commom/components/basic-table/basic-table.component.ts b/src/app/routes/commom/components/basic-table/basic-table.component.ts index 99def7f4..e5f964a7 100644 --- a/src/app/routes/commom/components/basic-table/basic-table.component.ts +++ b/src/app/routes/commom/components/basic-table/basic-table.component.ts @@ -1,14 +1,21 @@ -import { AfterViewInit, Component, OnInit } from '@angular/core'; -import { fromEvent } from 'rxjs'; +import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core'; +import { SFComponent, SFSchema } from '@delon/form'; +import { fromEvent, Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; +import { SearchDrawerService } from 'src/app/shared/components/search-drawer/search-drawer.service'; @Component({ template: '' }) -export class BasicTableComponent implements AfterViewInit { +export class BasicTableComponent implements AfterViewInit, OnDestroy { scrollY = '400px'; - constructor() {} + sf!: SFComponent; + sfValue: Record = {}; + drawer: Subscription[] = []; + schema: SFSchema = {}; + + constructor(public searchDrawerService: SearchDrawerService) {} ngAfterViewInit(): void { setTimeout(() => { @@ -21,6 +28,33 @@ export class BasicTableComponent implements AfterViewInit { }); } + ngOnDestroy(): void { + this.drawer.forEach(sub => sub.unsubscribe()); + } + + openDrawer() { + if (this.drawer?.length > 0) { + this.searchDrawerService.create(this.sfValue, this.schema); + } else { + const drawer = this.searchDrawerService.create(this.sfValue, this.schema); + this.drawer.push( + drawer.initEvent.subscribe(sf => { + if (sf) { + this.sf = sf; + } + }) + ); + this.drawer.push( + drawer.closeEvent.subscribe(res => { + this.sfValue = res; + if (res) { + this.search(); + } + }) + ); + } + } + getScrollY() { const windowHeight = window.innerHeight || Math.max(document.documentElement.clientHeight, document.body.clientHeight); const header = document.getElementsByTagName('layout-pro-header')?.[0]; @@ -37,4 +71,6 @@ export class BasicTableComponent implements AfterViewInit { this.scrollY = scrollY + 'px'; } } + + search() {} } diff --git a/src/app/routes/commom/less/commom-table.less b/src/app/routes/commom/less/commom-table.less index 1eb73d94..f3c6f14b 100644 --- a/src/app/routes/commom/less/commom-table.less +++ b/src/app/routes/commom/less/commom-table.less @@ -9,7 +9,7 @@ } .ant-tabs-tab { - margin: 0 0 0 16px; + margin : 0 0 0 16px; padding: 12px 0; } @@ -21,31 +21,51 @@ .ant-card-body { padding: 0; } + + .tab_header { + display : flex; + align-items: center; + + .page_title { + font-weight: bold; + font-size : 17px; + + .driver { + color : #ff4d4f; + margin-left : 17px; + margin-right: 6px; + } + } + + nz-tabset { + flex: 1; + } + } } .ant-table-pagination.ant-pagination { margin: 8px; } - .ant-table-thead > tr > th, - .ant-table-tbody > tr > td, - .ant-table tfoot > tr > th, - .ant-table tfoot > tr > td { + .ant-table-thead>tr>th, + .ant-table-tbody>tr>td, + .ant-table tfoot>tr>th, + .ant-table tfoot>tr>td { padding: 8px; } - .ant-table.ant-table-bordered > .ant-table-container { + .ant-table.ant-table-bordered>.ant-table-container { border-top: 0; } .ant-pagination-item { - min-width: 24px; - height: 24px; + min-width : 24px; + height : 24px; line-height: 21px; } .ant-pagination-total-text { - height: 24px; + height : 24px; line-height: 24px; } @@ -53,8 +73,8 @@ .ant-pagination-next, .ant-pagination-jump-prev, .ant-pagination-jump-next { - min-width: 24px; - height: 24px; + min-width : 24px; + height : 24px; line-height: 21px; } @@ -67,4 +87,4 @@ line-height: 21px; } } -} +} \ No newline at end of file diff --git a/src/app/routes/order-management/components/bulk/bulk.component.html b/src/app/routes/order-management/components/bulk/bulk.component.html index 1ea7f649..a2b6d182 100644 --- a/src/app/routes/order-management/components/bulk/bulk.component.html +++ b/src/app/routes/order-management/components/bulk/bulk.component.html @@ -9,32 +9,14 @@ * Copyright (C) 2022 huzhenhong. All rights reserved. --> - - + -
- -
- - -
- +
-
-
+ --> - - - - - - - - - - -
- +
+ + + + + + + + + + +
+ +
+ + [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loading]="false"> {{ item.freightPrice | currency }} @@ -76,16 +56,19 @@
卸 | {{ item?.unloadTime }}
-
{{ item?.driverName }}{{ item?.driverPhone ? "/" + item?.driverPhone : '' }}{{ item?.carNo ? "/" + item?.carNo : ''}}
+
{{ item?.driverName }}{{ item?.driverPhone ? "/" + item?.driverPhone : '' }}{{ item?.carNo ? "/" + + item?.carNo : ''}}
-
{{ item.settlementWeight ? item.settlementWeight + '吨/ ': ''}} {{ item.settlementVolume ? item.settlementVolume + '方 ': ''}}
+
{{ item.settlementWeight ? item.settlementWeight + '吨/ ': ''}} {{ item.settlementVolume ? + item.settlementVolume + '方 ': ''}}
-
{{ item?.payeeName }}{{ item?.payeePhone ? "/" + item?.payeePhone : '' }}
+
{{ item?.payeeName }}{{ item?.payeePhone ? "/" + + item?.payeePhone : '' }}
-
{{ item?.createUserName }}{{ item?.createUserPhone ? "/" + item?.createUserPhone : '' }}
+
{{ item?.createUserName }}{{ item?.createUserPhone ? "/" + item?.createUserPhone : '' }}
{{ item.billCode }} @@ -108,7 +91,8 @@

{{ data.expenseName }}:{{ data.price | currency }} - {{ data.expenseName }}:{{ (data.price * 100).toFixed(2) + '%' }} + {{ data.expenseName }}:{{ (data.price * 100).toFixed(2) + '%' + }} {{ data.paymentStatusLabel }}

@@ -117,25 +101,13 @@
- + - + [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"> {{ index + 1 }} @@ -155,14 +127,8 @@ - + @@ -172,30 +138,21 @@
- + [res]="{ reName: { list: 'data.list', total: 'data.total' } }"> {{ item.amountBeforeChange | currency }} - ¥{{ item.amountchangeValue | number: '0.2-2' }} + ¥{{ item.amountchangeValue | number: '0.2-2' + }} {{ item.amountAfterChange | currency }} -
变更原因:{{ ViewCause?.changeCause }}
-
拒绝原因:{{ ViewCause?.refuseCause }}
+
变更原因:{{ ViewCause?.changeCause }}
+
拒绝原因:{{ ViewCause?.refuseCause }}
注:附加费依据调整后的运输费用重新计算
@@ -204,13 +161,8 @@ - + @@ -239,26 +191,21 @@
-
已选择{{ selectedRows?.length || 0 }}条订单,确认批量签收吗? +
已选择{{ + selectedRows?.length || 0 }}条订单,确认批量签收吗?
签收后不可再修改运费,请确保运费等信息准确无误后,再进行签收。
-
- + +
-
+ \ No newline at end of file diff --git a/src/app/routes/order-management/components/bulk/bulk.component.ts b/src/app/routes/order-management/components/bulk/bulk.component.ts index 688a6796..aeccbc6d 100644 --- a/src/app/routes/order-management/components/bulk/bulk.component.ts +++ b/src/app/routes/order-management/components/bulk/bulk.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; +import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; import { ModalHelper, _HttpClient } from '@delon/theme'; @@ -7,20 +7,20 @@ import { map } from 'rxjs/operators'; import { OrderManagementService } from '../../services/order-management.service'; import { UpdateFreightComponent } from '../../modal/bulk/update-freight/update-freight.component'; import { ConfirReceiptComponent } from '../../modal/bulk/confir-receipt/confir-receipt.component'; -import { of } from 'rxjs'; +import { of, Subscription } from 'rxjs'; import { ShipperBaseService } from '@shared'; import { Router, ActivatedRoute } from '@angular/router'; import { OneCarOrderCancelConfirmComponent } from '../../modal/vehicle/cancel-confirm/cancel-confirm.component'; +import { SearchDrawerService } from 'src/app/shared/components/search-drawer/search-drawer.service'; +import { BasicTableComponent } from 'src/app/routes/commom/components/basic-table/basic-table.component'; @Component({ selector: 'app-supply-management-bulk', templateUrl: './bulk.component.html', - styleUrls: ['./bulk.component.less'] + styleUrls: ['../../../commom/less/commom-table.less','./bulk.component.less'] }) -export class OrderManagementBulkComponent implements OnInit { - ui: SFUISchema = {}; +export class OrderManagementBulkComponent extends BasicTableComponent implements OnInit { uiView: SFUISchema = {}; - schema: SFSchema = {}; schemaView: SFSchema = {}; auditMany = false; isVisibleView = false; @@ -54,13 +54,17 @@ export class OrderManagementBulkComponent implements OnInit { GoingQuantity: 0, totalCount: 0 }; + constructor( public service: OrderManagementService, private modal: NzModalService, public shipperservice: ShipperBaseService, private router: Router, private ar: ActivatedRoute, - ) { } + public searchDrawerService: SearchDrawerService + ) { + super(searchDrawerService); + } /** * 查询参数 @@ -70,14 +74,14 @@ export class OrderManagementBulkComponent implements OnInit { if (this.resourceStatus) { a.billStatus = this.resourceStatus; } - const params: any = Object.assign({}, this.sf?.value || {}); + const params: any = Object.assign({}, this.sfValue || {}); delete params._$expand; return { ...a, ...params, createTime: { - start: this.sf?.value?.createTime?.[0] || '', - end: this.sf?.value?.createTime?.[1] || '' + start: this.sfValue?.createTime?.[0] || '', + end: this.sfValue?.createTime?.[1] || '' } }; } @@ -86,17 +90,17 @@ export class OrderManagementBulkComponent implements OnInit { if (this.resourceStatus) { a.billStatus = this.resourceStatus; } - const params: any = Object.assign({}, this.sf?.value || {}); + const params: any = Object.assign({}, this.sfValue || {}); delete params._$expand; console.log(params); - if (this.sf) { + if (this.sfValue) { Object.assign(requestOptions.body, { ...a, ...params, createTime: { - start: this.sf?.value?.createTime?.[0] || '', - end: this.sf?.value?.createTime?.[1] || '' + start: this.sfValue?.createTime?.[0] || '', + end: this.sfValue?.createTime?.[1] || '' } }); } @@ -104,8 +108,8 @@ export class OrderManagementBulkComponent implements OnInit { return requestOptions; }; afterRes = (data: any[], rawData?: any) => { - console.log(data) - this.loading = false + console.log(data); + this.loading = false; return data.map(item => ({ ...item, disabled: item.billStatus !== '4' @@ -119,6 +123,7 @@ export class OrderManagementBulkComponent implements OnInit { id: this.changeId }; } + search() { this.st?.load(); this.getGoodsSourceStatistical(); @@ -185,14 +190,14 @@ export class OrderManagementBulkComponent implements OnInit { type: 'string', title: '订单号', ui: { - placeholder: '最多100个单号,空号隔开', + placeholder: '最多100个单号,空号隔开' } }, wayBillCode: { type: 'string', title: '运单号', ui: { - placeholder: '最多100个单号,空号隔开', + placeholder: '最多100个单号,空号隔开' } }, resourceCode: { @@ -208,11 +213,8 @@ export class OrderManagementBulkComponent implements OnInit { searchDebounceTime: 300, searchLoadingText: '搜索中...', allowClear: true, - visibleIf: { - _$expand: (value: boolean) => value - }, onSearch: (q: any) => { - let str = q.replace(/^\s+|\s+$/g, ""); + let str = q.replace(/^\s+|\s+$/g, ''); if (str) { return this.service .request(this.service.$api_enterpriceList, { enterpriseName: str }) @@ -233,55 +235,27 @@ export class OrderManagementBulkComponent implements OnInit { ui: { widget: 'select', placeholder: '请先选择货主', - visibleIf: { - _$expand: (value: boolean) => value - }, } as SFSelectWidgetSchema }, loadingPlace: { type: 'string', title: '装货地', - ui: { - visibleIf: { - _$expand: (value: boolean) => value - } - } }, dischargePlace: { type: 'string', title: '卸货地', - ui: { - visibleIf: { - _$expand: (value: boolean) => value - } - } }, driverName: { title: '承运司机', type: 'string', - ui: { - visibleIf: { - _$expand: (value: boolean) => value - } - } }, carNo: { title: '车牌号', type: 'string', - ui: { - visibleIf: { - _$expand: (value: boolean) => value - } - } }, carCaptainName: { title: '车队长', type: 'string', - ui: { - visibleIf: { - _$expand: (value: boolean) => value - } - } }, paymentStatus: { title: '支付状态', @@ -290,9 +264,6 @@ export class OrderManagementBulkComponent implements OnInit { widget: 'dict-select', params: { dictKey: 'overall:payment:status' }, containsAllLabel: true, - visibleIf: { - _$expand: (value: boolean) => value - } } as SFSelectWidgetSchema }, createTime: { @@ -303,9 +274,6 @@ export class OrderManagementBulkComponent implements OnInit { mode: 'range', format: 'yyyy-MM-dd', allowClear: true, - visibleIf: { - _$expand: (value: boolean) => value - } } as SFDateWidgetSchema }, riskStatus: { @@ -319,9 +287,6 @@ export class OrderManagementBulkComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - visibleIf: { - _$expand: (value: boolean) => value - } } }, enterpriseInfoName: { @@ -331,9 +296,6 @@ export class OrderManagementBulkComponent implements OnInit { widget: 'select', placeholder: '请选择', allowClear: true, - visibleIf: { - _$expand: (value: boolean) => value - }, asyncData: () => this.shipperservice.getNetworkEnterpriseName() } }, @@ -345,9 +307,6 @@ export class OrderManagementBulkComponent implements OnInit { widget: 'dict-select', params: { dictKey: 'service:type' }, containsAllLabel: true, - visibleIf: { - _$expand: (value: boolean) => value - } } as SFSelectWidgetSchema }, settlementBasis: { @@ -358,15 +317,11 @@ export class OrderManagementBulkComponent implements OnInit { containsAllLabel: true, params: { dictKey: 'goodresource:settlement:type' }, containAllLable: true, - visibleIf: { - _$expand: (value: boolean) => value - } } as SFSelectWidgetSchema } }, type: 'object' }; - this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; } /** * 初始化查询表单 @@ -493,7 +448,7 @@ export class OrderManagementBulkComponent implements OnInit { title: '结算数量', render: 'settlementWeight', width: '170px', - className: 'text-left', + className: 'text-left' // format: (item: any) => // `${item.settlementWeight || '0'}吨/ // ${item.settlementVolume || '0'}方` @@ -509,7 +464,7 @@ export class OrderManagementBulkComponent implements OnInit { title: '车队长', className: 'text-left', width: '180px', - render: 'payeeName', + render: 'payeeName' }, { title: '装卸货时间', @@ -533,27 +488,31 @@ export class OrderManagementBulkComponent implements OnInit { title: '操作', fixed: 'right', width: '130px', - className: 'text-left block-td', + className: 'text-center block-td', buttons: [ { text: '运费变更记录', click: _record => this.OpenPrice(_record), iif: item => - item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '6', - acl: { ability: ['ORDER-BULK-listChangeApply'] }, + item.billStatus == '4' || + item.billStatus == '5' || + item.billStatus == '2' || + item.billStatus == '3' || + item.billStatus == '6', + acl: { ability: ['ORDER-BULK-listChangeApply'] } }, { text: '查看评价', click: _record => this.viewEvaluate(_record), iif: item => item.billStatus == '5', - acl: { ability: ['ORDER-BULK-evaluation'] }, + acl: { ability: ['ORDER-BULK-evaluation'] } }, { text: '查看详情', click: (item: any) => { this.router.navigate(['./bulk-detail', item.id], { relativeTo: this.ar }); }, - acl: { ability: ['USERCENTER-FREIGHT-USER-view'] }, + acl: { ability: ['USERCENTER-FREIGHT-USER-view'] } }, { text: '变更运费', @@ -562,32 +521,36 @@ export class OrderManagementBulkComponent implements OnInit { const flag = _record.mybidDetailInfo.find((item: any) => item?.expenseCode === 'TRA' && item?.paymentStatus === '4'); return _record.billStatus !== '1' && _record.billStatus !== '6' && !flag; }, - acl: { ability: ['ORDER-BULK-FreightChangeBulkDetail'] }, + acl: { ability: ['ORDER-BULK-FreightChangeBulkDetail'] } }, { text: '确认签收', click: _record => this.confirmReceipt(_record), iif: item => item.billStatus == '4', - acl: { ability: ['VEHICLE-LIST-view'] }, + acl: { ability: ['VEHICLE-LIST-view'] } }, { text: '取消订单', click: _record => this.cancellation(_record), iif: item => - item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '1', - acl: { ability: ['ORDER-BULK-signBulkOrder'] }, + item.billStatus == '4' || + item.billStatus == '5' || + item.billStatus == '2' || + item.billStatus == '3' || + item.billStatus == '1', + acl: { ability: ['ORDER-BULK-signBulkOrder'] } }, { text: '申请退款', - click: (_record) => this.applyRefund(_record), + click: _record => this.applyRefund(_record), iif: item => item.isApplyForRefund, - acl: { ability: ['ORDER-VEHICLE-modificationOrder'] }, + acl: { ability: ['ORDER-VEHICLE-modificationOrder'] } }, { text: '修改订单', click: _record => this.changeOrder(_record), iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3', - acl: { ability: ['ORDER-BULK-BulkBillDetail'] }, + acl: { ability: ['ORDER-BULK-BulkBillDetail'] } } ] } @@ -663,27 +626,13 @@ export class OrderManagementBulkComponent implements OnInit { id: this.changeViewId }; } - /** - * 伸缩查询条件 - */ - expandToggle(): void { - this._$expand = !this._$expand; - this.sf?.setValue('/_$expand', this._$expand); - } - tabChange(item: any) { } - /** - * 重置表单 - */ - resetSF(): void { - this.sf.reset(); - this._$expand = false; - } + tabChange(item: any) {} /** * 导入货源 */ - importGoodsSource() { } - audit(item: any) { } + importGoodsSource() {} + audit(item: any) {} /* * 审核关闭弹窗 @@ -704,7 +653,7 @@ export class OrderManagementBulkComponent implements OnInit { /** * 审核通过按钮 */ - handleOK() { } + handleOK() {} OpenPrice(item: any) { this.changeId = item.id; this.isVisible = true; @@ -838,8 +787,8 @@ export class OrderManagementBulkComponent implements OnInit { this.router.navigate(['order-management/bulk-detailChange', value.id]); } /** -*申请退款 -*/ + *申请退款 + */ applyRefund(item: any) { const modalRef = this.modal.create({ nzTitle: '申请退款', @@ -852,7 +801,6 @@ export class OrderManagementBulkComponent implements OnInit { }); modalRef.afterClose.subscribe((res: boolean) => { if (res) { - this.resetSF; this.st.load(); } }); diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.html b/src/app/routes/order-management/components/vehicle/vehicle.component.html index 4780db3c..542019b6 100644 --- a/src/app/routes/order-management/components/vehicle/vehicle.component.html +++ b/src/app/routes/order-management/components/vehicle/vehicle.component.html @@ -31,11 +31,11 @@ --> -
-