This commit is contained in:
Taric Xin
2022-04-25 11:32:16 +08:00
parent db6231925e
commit c3280283d6
9 changed files with 194 additions and 204 deletions

View File

@ -8,30 +8,15 @@
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\bulk\\bulk.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<nz-card>
<!-- 搜索表单 -->
<!-- <nz-card>
<div nz-row nzGutter="8">
<!-- 查询字段小于或等于3个时不显示伸缩按钮 -->
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
<sf
#sf
[schema]="schema"
[ui]="ui"
[mode]="'search'"
[disabled]="!sf?.valid"
[loading]="false"
(formSubmit)="st?.load(1)"
(formReset)="resetSF()"
></sf>
</div>
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<ng-container *ngIf="queryFieldCount > 4">
<div nz-col [nzSpan]="_$expand ? 24 : 18">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
<button nz-button nzType="primary" [nzLoading]="loading" (click)="search()" acl [acl-ability]="['SUPPLY-INDEX-bulkSearch']">查询</button>
<button nz-button nzType="primary" [nzLoading]="loading" (click)="search()" acl
[acl-ability]="['SUPPLY-INDEX-bulkSearch']">查询</button>
<button nz-button nzType="primary" [disabled]="loading" (click)="exportFire()">导出</button>
<button nz-button [disabled]="loading" (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
@ -41,43 +26,49 @@
</div>
</ng-container>
</div>
</nz-card>
</nz-card> -->
<ng-template #extraTemplate>
<div>
<button (click)="audit('', 2)" nz-button nzType="primary" acl [acl-ability]="['SUPPLY-INDEX-bulkBatchAudit']">审核</button>
<button (click)="releaseGoods()" nz-button nzType="primary" acl [acl-ability]="['SUPPLY-INDEX-bulkUndertakesToSupply']">代发货源</button>
<button nz-button nzDanger (click)="openDrawer()" class="mr-sm" [nzLoading]="loading" acl
[acl-ability]="['SUPPLY-INDEX-bulkSearch']">筛选</button>
<button nz-button nzDanger [disabled]="loading" (click)="exportFire()">导出</button>
<button nz-button nz-dropdown [nzDropdownMenu]="menu" nzPlacement="bottomLeft">
更多<i nz-icon nzType="down" nzTheme="outline"></i></button>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu>
<li nz-menu-item acl [acl-ability]="['SUPPLY-INDEX-bulkBatchAudit']" (click)="audit('', 2)">
审核
</li>
<li nz-menu-item acl [acl-ability]="['SUPPLY-INDEX-bulkUndertakesToSupply']" (click)="releaseGoods()">
代发货源
</li>
</ul>
</nz-dropdown-menu>
</div>
</ng-template>
<nz-card>
<nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzTabBarExtraContent]="extraTemplate">
<nz-tab [nzTitle]="'全部(' + tabs?.totalQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'进行中(' + tabs?.stayQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'已完结(' + tabs?.completedQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'取消(' + tabs?.cancelQuantity + ')'"></nz-tab>
</nz-tabset>
<div style="position: relative">
<nz-alert
nzType="info"
[nzMessage]="'当前共' + st?.total + '行记录已选择' + selectedRows.length + ''"
nzShowIcon
[ngStyle]="{ margin: '0 0 1rem 0' }"
>
</nz-alert>
<nz-card class="table-box" style="margin: 0;">
<div class="tab_header">
<nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzTabBarExtraContent]="extraTemplate">
<nz-tab [nzTitle]="'全部(' + tabs?.totalQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'进行中(' + tabs?.stayQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'完结(' + tabs?.completedQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'已取消(' + tabs?.cancelQuantity + ')'"></nz-tab>
</nz-tabset>
</div>
<div style="margin-top: 15px">
<st
#st
[scroll]="{ x: '2000px' }"
[data]="service.$api_get_bulkPage_list"
[columns]="columns"
<div>
<div style="position: relative;">
<nz-alert nzType="info" [nzMessage]="'当前共' + st?.total + '行记录已选择' + selectedRows.length + ''" nzShowIcon
style="margin: 0.5rem 16px;display: block;" class="header_box">
</nz-alert>
</div>
<st #st [scroll]="{ x: '2000px',y:scrollY }" [data]="service.$api_get_bulkPage_list" [columns]="columns"
[req]="{ process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } , process: afterRes}"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="false"
>
<ng-template st-row="createUserName" let-item let-index="index">
<div> {{ item?.createUserName }}{{ item?.createUserPhone ? '/' + item?.createUserPhone : ''}} </div>
</ng-template>
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loading]="false">
<ng-template st-row="createUserName" let-item let-index="index">
<div> {{ item?.createUserName }}{{ item?.createUserPhone ? '/' + item?.createUserPhone : ''}} </div>
</ng-template>
<!--运费单价 -->
<ng-template st-row="freightPrice" let-item let-index="index">
<div class="mr-xs">{{ item?.freightPrice | currency }} </div>
@ -97,8 +88,7 @@
<ng-template st-row="orderSn" let-item let-index="index">
<div *ngFor="let item of item?.wayBillClassifiedStatisticsVOList">
<label>{{ item?.wayBillStatusLabel }}</label>
(<span [ngStyle]="{ color: item?.count > 0 ? '#1890FF' : '' }">{{ item?.count }}</span
>)
(<span [ngStyle]="{ color: item?.count > 0 ? '#1890FF' : '' }">{{ item?.count }}</span>)
</div>
</ng-template>
<!-- 货物信息 -->
@ -115,10 +105,12 @@
</st>
</div>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" nzTitle="货源审核" (nzOnCancel)="handleCancel('suppliersType')">
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" nzTitle="货源审核"
(nzOnCancel)="handleCancel('suppliersType')">
<ng-container *nzModalContent>
<div style="position: relative" *ngIf="auditMany">
<nz-alert nzType="info" [nzMessage]="'已选择' + selectedRows?.length + ''" nzShowIcon [ngStyle]="{ margin: '0 0 1rem 0' }">
<nz-alert nzType="info" [nzMessage]="'已选择' + selectedRows?.length + ''" nzShowIcon
[ngStyle]="{ margin: '0 0 1rem 0' }">
</nz-alert>
</div>
<sf #sfFre [schema]="freightSchema" [ui]="ui2" [compact]="false" [button]="'none'"> </sf>
@ -133,4 +125,4 @@
<button (click)="audit('',2)" nz-button nzType="primary">批量审核</button>
<button (click)="audit('')" nz-button nzType="primary">发布货源</button>
</div>
</ng-template> -->
</ng-template> -->

View File

@ -3,32 +3,31 @@ import { Router } from '@angular/router';
import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { ShipperBaseService } from '@shared';
import { SearchDrawerService, ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import { BasicTableComponent } from 'src/app/routes/commom';
import { SupplyManagementService } from '../../services/supply-management.service';
import { SupplyManagementQrcodePageComponent } from '../qrcode-page/qrcode-page.component';
import { SupplyManagementUpdatePriceComponent } from '../update-price/update-price.component';
@Component({
selector: 'app-supply-management-bulk',
templateUrl: './bulk.component.html'
templateUrl: './bulk.component.html',
styleUrls: ['../../../commom/less/commom-table.less']
})
export class SupplyManagementBulkComponent implements OnInit {
export class SupplyManagementBulkComponent extends BasicTableComponent implements OnInit {
resourceStatus: any;
ui: SFUISchema = {};
ui2: SFUISchema = {};
schema: SFSchema = {};
auditMany = false;
isVisible = false;
loading: boolean = true;
auditID: any;
_$expand = false;
columns: STColumn[] = [];
freightSchema: SFSchema = {};
@ViewChild('st') private readonly st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
@ViewChild('sfFre', { static: false }) sfFre!: SFComponent;
tabs: any = {
@ -37,12 +36,16 @@ export class SupplyManagementBulkComponent implements OnInit {
receivedQuantity: 0,
stayQuantity: 0
};
deviationHeight = 10;
constructor(
public service: SupplyManagementService,
private modal: NzModalService,
private router: Router,
public shipperservice: ShipperBaseService
) { }
public shipperservice: ShipperBaseService,
public searchDrawerService: SearchDrawerService
) {
super(searchDrawerService);
}
ngOnInit(): void {
this.initSF();
@ -136,10 +139,7 @@ export class SupplyManagementBulkComponent implements OnInit {
widget: 'dict-select',
containsAllLabel: true,
params: { dictKey: 'service:type' },
containAllLable: true,
visibleIf: {
_$expand: (value: boolean) => value
}
containAllLable: true
} as SFSelectWidgetSchema
},
settlementBasis: {
@ -149,10 +149,7 @@ export class SupplyManagementBulkComponent implements OnInit {
widget: 'dict-select',
containsAllLabel: true,
params: { dictKey: 'goodresource:settlement:type' },
containAllLable: true,
visibleIf: {
_$expand: (value: boolean) => value
}
containAllLable: true
} as SFSelectWidgetSchema
},
releaseTime: {
@ -162,9 +159,6 @@ export class SupplyManagementBulkComponent implements OnInit {
widget: 'date',
mode: 'range',
format: 'yyyy-MM-dd',
visibleIf: {
_$expand: (value: boolean) => value
},
allowClear: true
} as SFDateWidgetSchema
},
@ -175,9 +169,6 @@ export class SupplyManagementBulkComponent implements OnInit {
widget: 'date',
mode: 'range',
format: 'yyyy-MM-dd',
visibleIf: {
_$expand: (value: boolean) => value
},
allowClear: true
} as SFDateWidgetSchema
},
@ -187,9 +178,6 @@ export class SupplyManagementBulkComponent implements OnInit {
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
_$expand: (value: boolean) => value
},
allowClear: true,
asyncData: () => this.shipperservice.getNetworkFreightForwarder()
}
@ -202,9 +190,6 @@ export class SupplyManagementBulkComponent implements OnInit {
serverSearch: true,
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
visibleIf: {
_$expand: (value: boolean) => value
},
allowClear: true,
onSearch: (q: any) => {
let str = q.replace(/^\s+|\s+$/g, '');
@ -364,27 +349,7 @@ export class SupplyManagementBulkComponent implements OnInit {
// .createStatic(FormEditComponent, { i: { id: 0 } })
// .subscribe(() => this.st.reload());
}
/**
* 查询字段个数
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 伸缩查询条件
*/
expandToggle(): void {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
/**
* 重置表单
*/
resetSF(): void {
this.sf.reset();
this._$expand = false;
}
get selectedRows() {
return this.st?.list.filter(item => item.checked) || [];
}
@ -565,7 +530,7 @@ export class SupplyManagementBulkComponent implements OnInit {
}
});
}
userAction() { }
userAction() {}
// 导出
exportFire() {
this.service.exportStart(this.reqParams, this.service.$api_asyncExportBulkList);