edit
This commit is contained in:
@ -0,0 +1,2 @@
|
||||
<sf #sf [compact]="true" [ui]="ui" [schema]="schema" [button]="'none'">
|
||||
</sf>
|
||||
@ -0,0 +1,96 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { apiConf } from '@conf/api.conf';
|
||||
import { SFComponent, SFSchema, SFTextWidgetSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form';
|
||||
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||
import { FreightAccountService } from '../../../services/freight-account.service';
|
||||
|
||||
const IMAGECONFIG = {
|
||||
action: apiConf.waterFileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
fileSize: 5120,
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
urlReName: 'data.fullFileWatermarkPath',
|
||||
widget: 'upload',
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card'
|
||||
};
|
||||
|
||||
@Component({
|
||||
selector: 'app-clearing-modal',
|
||||
templateUrl: './clearing-modal.component.html',
|
||||
styleUrls: ['./clearing-modal.component.less']
|
||||
})
|
||||
export class ClearingModalComponent implements OnInit {
|
||||
@ViewChild('sf', { static: false })
|
||||
sf!: SFComponent;
|
||||
i: any;
|
||||
schema!: SFSchema;
|
||||
ui: SFUISchema = {
|
||||
'*': {
|
||||
spanLabelFixed: 120,
|
||||
grid: { span: 18 }
|
||||
}
|
||||
};
|
||||
|
||||
constructor(private modal: NzModalRef, public service: FreightAccountService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initSF(this.i);
|
||||
}
|
||||
initSF(staff: any) {
|
||||
this.schema = {
|
||||
properties: {
|
||||
name: {
|
||||
title: '入账金额',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
} as SFTextWidgetSchema,
|
||||
default: '10000.00'
|
||||
},
|
||||
name2: {
|
||||
title: '网络货运人',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
} as SFTextWidgetSchema,
|
||||
default: '天津怡亚通物流科技有限公司'
|
||||
},
|
||||
name3: {
|
||||
title: '银行类型',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
} as SFTextWidgetSchema,
|
||||
default: '平安银行'
|
||||
},
|
||||
receiveName: {
|
||||
type: 'string',
|
||||
title: '分配对象',
|
||||
enum: [{ label: '全部', value: '全部' }],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择'
|
||||
},
|
||||
default: ''
|
||||
},
|
||||
licensePhotoWatermark: {
|
||||
type: 'string',
|
||||
title: '上传凭证',
|
||||
ui: {
|
||||
...IMAGECONFIG,
|
||||
change: args => {
|
||||
if (args.type === 'success') {
|
||||
this.sf.setValue('/licensePhoto', args.fileList[0].response.data.fullFilePath);
|
||||
}
|
||||
}
|
||||
} as SFUploadWidgetSchema
|
||||
}
|
||||
},
|
||||
required: ['name', 'name2', 'name3', 'receiveName']
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user