Files
bbq/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts
2022-03-09 20:06:29 +08:00

175 lines
4.9 KiB
TypeScript

import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { ShipperBaseService } from 'src/app/shared/services/business/shipper-base.service';
import { AccountManagemantService } from '../../services/account-managemant.service';
@Component({
selector: 'app-partner-virtual-account-detail',
templateUrl: './virtual-account-detail.component.html',
})
export class PartnerAccountManagementVirtualAccountDetailComponent implements OnInit {
url = `/user`;
schema!: SFSchema;
ui!: SFUISchema;
@ViewChild('st') private readonly st!: STComponent;
@ViewChild('sf') private readonly sf!: SFComponent;
columns: STColumn[] = [];
id = '';
_$expand = false;
constructor(public shipperservice: ShipperBaseService, public amService: AccountManagemantService, private modalRef: NzModalRef) { }
get reqParams() {
return { ...this.sf?.value };
}
ngOnInit(): void {
this.initSF();
this.initST();
}
initSF() {
this.schema = {
properties: {
_$expand: {
type: 'boolean', ui: { hidden: true }
},
abnormalCause: {
title: '合伙人名称',
type: 'string',
ui: {
placeholder: '请输入',
},
},
abnormalCause1: {
title: '手机号',
type: 'string',
ui: {
placeholder: '请输入',
},
},
abnormalCause2: {
title: '网络货运人',
type: 'string',
default: '',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
asyncData: () => this.shipperservice.getNetworkFreightForwarder({}, true)
}
},
bankType: {
type: 'string',
title: '银行类型',
default: '',
ui: {
widget: 'dict-select',
params: {
dictKey: 'bankname:type'
},
placeholder: '请选择',
allowClear: true,
containsAllLabel: true,
visibleIf: {
_$expand: (value: boolean) => value,
},
},
},
abnormalCause3: {
title: '虚拟账户',
type: 'string',
ui: {
placeholder: '请输入',
visibleIf: {
_$expand: (value: boolean) => value
},
},
},
createTime: {
type: 'string',
title: '创建时间',
ui: {
widget: 'sl-from-to',
type: 'date',
autoComplete: 'off',
format: 'yyyy-MM-dd',
visibleIf: {
_$expand: (value: boolean) => value
},
} as SFDateWidgetSchema,
},
}
}
this.ui = { '*': { spanLabelFixed: 100, grid: { span: 8, gutter: 4 } }, };
}
/**
* 初始化数据列表
*/
initST() {
this.columns = [
{ title: '合伙人', index: 'carNo', className: 'text-center', width: 200 },
{ title: '手机号', render: 'carModelLabel', className: 'text-center', width: 150 },
{ title: '网络货运人', render: 'carModelLabel', className: 'text-center', width: 200 },
{ title: '银行类型', render: 'carModelLabel', className: 'text-center', width: 120 },
{ title: '虚拟账户', render: 'carModelLabel', className: 'text-center', width: 180 },
{ title: '可用余额', render: 'approvalStatus1', className: 'text-right', width: 180 },
{ title: '账户总余额', render: 'approvalStatus2', className: 'text-right', width: 180 },
{ title: '可用余额(元)', render: 'approvalStatus3', className: 'text-right', width: 180 },
{ title: '创建时间', index: 'approvalStatus4', className: 'text-center', width: 200 },
{ title: '状态', index: 'approvalStatus4', className: 'text-center', width: 120 },
{
title: '操作',
width: 120,
buttons: [
{
text: '查看明细',
click: (_record) => this.viewDetail(_record)
}
]
}
];
}
resetSF() {
this._$expand = false;
this.sf.reset();
setTimeout(() => {
this.st.reset();
})
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
add(): void {
// this.modal
// .createStatic(FormEditComponent, { i: { id: 0 } })
// .subscribe(() => this.st.reload());
}
search() {
this.st.load(1);
}
export() { }
/**
*
* @param _record 当前行信息
*/
viewDetail(_record: any) {
window.open(location.origin + '/#/partner/account-management/account-detail');
}
close() {
this.modalRef.destroy();
}
}