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

@ -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);