fix bug
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { BaseService } from '@shared';
|
||||
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
|
||||
@Component({
|
||||
selector: 'app-insurance-table',
|
||||
@ -11,15 +12,22 @@ import { BaseService } from '@shared';
|
||||
export class InsuranceTableComponent implements OnInit {
|
||||
data: any[] = [];
|
||||
headers: any[] = [];
|
||||
sfdata: any; // 货源单设置回显
|
||||
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
schema: SFSchema = {};
|
||||
ui!: SFUISchema;
|
||||
|
||||
formatterDollar = (value: number): string => `${value} (含)`;
|
||||
|
||||
price: number = 0;
|
||||
changeSub = new Subject<string>();
|
||||
constructor(public service: BaseService, private cdr: ChangeDetectorRef) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loadData();
|
||||
this.initSF()
|
||||
this.changeEndKmAction();
|
||||
this.price = 1000
|
||||
}
|
||||
|
||||
loadData() {
|
||||
@ -31,7 +39,31 @@ export class InsuranceTableComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initSF() {
|
||||
this.schema = {
|
||||
properties: {
|
||||
freightPrice: {
|
||||
type: 'string',
|
||||
title: '单票投保最低保费',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入',
|
||||
errors: { required: '请填写' }
|
||||
}
|
||||
},
|
||||
},
|
||||
required: ['freightPrice']
|
||||
};
|
||||
this.ui = {
|
||||
'*': {
|
||||
spanLabelFixed: 140,
|
||||
grid: { span: 24 }
|
||||
},
|
||||
$freightPrice: {
|
||||
grid: { span: 8 }
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* 修改结束车长
|
||||
* @param event 车长
|
||||
@ -111,6 +143,8 @@ export class InsuranceTableComponent implements OnInit {
|
||||
|
||||
save() {
|
||||
console.log(this.data);
|
||||
console.log(this.price);
|
||||
console.log(this.sf.value);
|
||||
// this.service.request('/api/mdc/cuc/freightConfig/saveBatch', this.data).subscribe(res => {
|
||||
// if (res) {
|
||||
// console.log(res);
|
||||
|
||||
Reference in New Issue
Block a user