车辆对接

This commit is contained in:
wangshiming
2021-12-28 10:51:30 +08:00
parent 269355e7bc
commit ec51030da0
8 changed files with 111 additions and 135 deletions

View File

@ -135,23 +135,22 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
return of([]);
}
},
change: (q: any) => {
this.getRegionCode(q)
},
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
},
enterpriseProjectId: {
title: '项目',
type: 'string',
default: '',
title: '项目',
ui: {
widget: 'select',
visibleIf: {
_$expand: (value: boolean) => value,
},
asyncData: () =>
this.shipperSrv.getEnterpriseProject()
} as SFSelectWidgetSchema,
placeholder: '请选择',
allowClear: true,
} as SFSelectWidgetSchema
},
enterpriseInfoName: {
type: 'string',
@ -288,49 +287,24 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
maxWeight: {
type: 'string',
title: '车型/车长',
enum: [
{ label: '1', value: '1' },
{ label: '2', value: '2' }
],
ui: {
widget: 'select',
placeholder: '请选择车型',
widget: 'dict-select',
params: { dictKey: 'car:model' },
mode: 'multiple',
placeholder: '请选择车型',
errors: { required: '请选择车型' }
// asyncData: () =>
// this.categoryService.loadChildData2('0', '2').pipe(
// map((data: any) => {
// return data.map((m: any) => {
// return { label: m.name, value: m.id };
// });
// }),
// ),
// change: (i) => this.updateCategory(i, '/categoryId2'),
} as SFSelectWidgetSchema
}
},
maxCube: {
type: 'string',
title: '',
enum: [
{ label: '1', value: '1' },
{ label: '2', value: '2' }
],
ui: {
widget: 'select',
placeholder: '请选择车长',
widget: 'dict-select',
params: { dictKey: 'car:length' },
mode: 'multiple',
placeholder: '请选择车长',
errors: { required: '请选择车长' }
// asyncData: () =>
// this.categoryService.loadChildData2('0', '2').pipe(
// map((data: any) => {
// return data.map((m: any) => {
// return { label: m.name, value: m.id };
// });
// }),
// ),
// change: (i) => this.updateCategory(i, '/categoryId2'),
} as SFSelectWidgetSchema
}
}
},
required: ['weight', 'maxWeight', 'maxCube']
@ -357,7 +331,24 @@ export class SupplyManagementOnecarPublishComponent 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.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
});
}
initSF5() {
this.schema5 = {
properties: {
@ -835,7 +826,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
volume: res?.goodsInfoVOList[0]?.volume ,
vehicleDemand: res?.goodsInfoVOList[0]?.vehicleDemand ,
maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') ,
maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') ,
maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') || '',
number: res?.goodsInfoVOList[0]?.number ,
goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName ,
modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId ,