This commit is contained in:
wangshiming
2022-03-21 14:19:10 +08:00
parent 150489598e
commit f14441f420
3 changed files with 45 additions and 83 deletions

View File

@ -12,26 +12,17 @@ import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
export class RebateTableComponent implements OnInit {
data: any[] = [];
headers: any[] = [];
sfdata: any; // 货源单设置回显
@ViewChild('sf', { static: false }) sf!: SFComponent;
schema: SFSchema = {};
ui!: SFUISchema;
formatterDollar = (value: number): string => `${value}`;
minrebatePrice: number = 0;
changeSub = new Subject<string>();
constructor(public service: BaseService, private cdr: ChangeDetectorRef) {}
ngOnInit(): void {
this.loadData();
this.initSF()
this.changeEndKmAction();
this.minrebatePrice = 1000
}
loadData() {
this.service.request('/api/mdc/cuc/rebateConfig/list').subscribe(res => {
this.service.request('/api/mdc/cuc/insuranceConfig/list').subscribe(res => {
if (res) {
console.log(res);
this.data = res;
@ -43,35 +34,10 @@ export class RebateTableComponent implements OnInit {
]).subscribe(res => {
if (res) {
console.log(res);
this.minrebatePrice = Number(res[0].itemValue)
}
});
}
initSF() {
this.schema = {
properties: {
freightPrice: {
type: 'string',
title: '单票投保最低保费',
ui: {
widget: 'custom',
placeholder: '请输入',
errors: { required: '请填写' }
}
},
},
required: ['freightPrice']
};
this.ui = {
'*': {
spanLabelFixed: 160,
grid: { span: 24 }
},
$freightPrice: {
grid: { span: 8 }
},
};
}
/**
* 修改结束车长
* @param event 车长
@ -145,12 +111,8 @@ export class RebateTableComponent implements OnInit {
}
save() {
if(!this.minrebatePrice) {
this.service.msgSrv.error('必填项为空!')
return
}
console.log(this.data)
let params= {
minrebatePrice: this.minrebatePrice,
rebateConfigDTOS: this.data
}
console.log(params);