This commit is contained in:
Taric Xin
2022-01-06 20:52:37 +08:00
parent 3a39ad53fb
commit 9d3a02a671
13 changed files with 379 additions and 31 deletions

View File

@ -0,0 +1,7 @@
<div>
<sf #sf [ui]="{ '*': { spanLabelFixed: 120, grid: { span: 22 } } }" [schema]="schema" [button]="'none'"></sf>
</div>
<div class="modal-footer">
<button nz-button type="button" (click)="close()">取消</button>
<button nz-button type="button" nzType="primary" (click)="sure()" [disabled]="!sf.valid">保存</button>
</div>

View File

@ -0,0 +1,5 @@
:host::ng-deep {
nz-date-picker {
width: 100%;
}
}

View File

@ -0,0 +1,102 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { map } from 'rxjs/operators';
import { SystemService } from 'src/app/routes/sys-setting/services/system.service';
import { TicketService } from '../../../services/ticket.service';
@Component({
selector: 'app-add-collection-invoice-modal',
templateUrl: './add-collection-invoice-modal.component.html',
styleUrls: ['./add-collection-invoice-modal.component.less']
})
export class AddCollectionInvoiceModalComponent implements OnInit {
@ViewChild('sf', { static: false })
sf!: SFComponent;
i: any;
schema!: SFSchema;
constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public service: TicketService) {}
ngOnInit(): void {
this.initSF();
}
initSF() {
this.schema = {
properties: {
ltdId: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
asyncData: () => this.service.getNetworkFreightForwarder()
},
default: ''
},
ltd2Id: {
type: 'string',
title: '销售方',
enum: [{ label: '全部', value: '全部' }],
ui: {
widget: 'select',
placeholder: '请选择'
},
default: ''
},
ltd2I1d: {
type: 'string',
title: '收票类型',
enum: [{ label: '全部', value: '全部' }],
ui: {
widget: 'select',
placeholder: '请选择'
},
default: ''
},
createTime: {
title: '发票日期',
type: 'string',
ui: {
widget: 'date',
format: 'yyyy-MM-dd',
placeholder: '请选择',
nzShowTime: true
} as SFDateWidgetSchema
},
vatinvcode: {
type: 'string',
title: '发票号',
ui: {
placeholder: '请输入'
}
},
vatinvc2ode: {
type: 'string',
title: '收票备注',
ui: {
placeholder: '请输入'
}
}
},
required: ['ltdId', 'ltd2Id', 'createTime', 'ltd2I1d', 'vatinvcode']
};
}
sure() {
const params: any = {
...this.sf.value
};
// this.service.request(this.service.$api_add_staff, params).subscribe(res => {
// if (res) {
// this.service.msgSrv.success('保存成功!');
// this.modal.close(true);
// }
// });
}
close() {
this.modal.destroy();
}
}