This commit is contained in:
wangshiming
2022-02-17 19:44:46 +08:00
parent 7e330ba2df
commit e3f19fb9ff
15 changed files with 502 additions and 67 deletions

View File

@ -1,5 +1,5 @@
import { ActivatedRoute, Router } from '@angular/router';
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnInit, ViewChild, OnChanges } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
@ -369,20 +369,34 @@ export class SupplyManagementVehicleComponent implements OnInit {
} else {
return of([]);
}
},
change: (q: any) => {
this.getRegionCode(q);
}
} as SFSelectWidgetSchema
},
// enterpriseProjectId: {
// type: 'string',
// title: '所属项目',
// ui: {
// widget: 'select',
// visibleIf: {
// _$expand: (value: boolean) => value
// },
// allowClear: true,
// containsAllLable: true,
// asyncData: () => this.shipperSrv.getEnterpriseProject(this.sf.value?.shipperAppUserId)
// } as SFSelectWidgetSchema
// },
enterpriseProjectId: {
type: 'string',
title: '所属项目',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
_$expand: (value: boolean) => value
},
allowClear: true,
containsAllLable: true,
asyncData: () => this.shipperSrv.getEnterpriseProject()
} as SFSelectWidgetSchema
},
serviceType: {
@ -428,7 +442,27 @@ export class SupplyManagementVehicleComponent implements OnInit {
}
};
}
// 获取城市列表
getRegionCode(regionCode: any) {
console.log(regionCode);
return this.service
.request(this.service.$api_get_enterprise_project, { id: regionCode })
.pipe(
map(res =>
res.map((item: any) => ({
label: item.projectName,
value: item.id
}))
)
)
.subscribe(res => {
this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res;
this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res);
// if (this.enterpriseProjectIds) {
// this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
// }
});
}
/**
* 初始化数据列表
*/