车辆对接

This commit is contained in:
wangshiming
2022-01-04 16:05:44 +08:00
parent ba501195b9
commit 0c930be5fb
14 changed files with 396 additions and 20 deletions

View File

@ -17,6 +17,7 @@ import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-f
import { SupplyManagementService} from '../../services/supply-management.service';
import { map } from 'rxjs/operators';
import { of } from 'rxjs';
import { PublishSuccessComponent } from '../onecar-publish/publish-success/publish-success.component';
@Component({
selector: 'app-publish-goods-bulk-publish',
templateUrl: './bulk-publish.component.html',
@ -35,6 +36,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
totalFees: any; // 总数信息
totalDistance = 0.0; //总里程
totalTime = 0.0; //路程总时间
enterpriseProjectIds: any;
id = this.route.snapshot.params.id;
// // 单位
unit1 = '吨';
@ -132,7 +134,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
} as SFSelectWidgetSchema
},
enterpriseInfoName: {
@ -185,20 +186,26 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
// 获取城市列表
getRegionCode(regionCode: any) {
console.log(regionCode)
console.log(regionCode);
return this.service
.request(this.service.$api_get_enterprise_project, { id: regionCode })
.pipe(
map((res) =>
map(res =>
res.map((item: any) => ({
label: item.projectName,
value: item.id,
})),
),
value: item.id
}))
)
)
.subscribe((res) => {
.subscribe(res => {
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
console.log('12345645454545454=============')
console.log(this.enterpriseProjectIds)
console.log(res)
if(this.enterpriseProjectIds) {
this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
}
});
}
// initSF2() {
@ -527,10 +534,21 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
}
requests(url: any, params: any) {
this.service.request(url, params).subscribe((res: any) => {
console.log(res)
})
if (res) {
this.modalService.create({
nzTitle: '',
nzContent: PublishSuccessComponent,
nzWidth: 900,
nzFooter: null,
nzComponentParams: { type: 'onecar' }
});
} else {
this.service.msgSrv.error(res.msg);
}
});
}
// 打开地图
openMap(type: string, index: number) {
@ -588,6 +606,23 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
// 初始化信息
dataR (res: any) {
// this.dataList = res;
if (res?.shipperAppUserName) {
const List: any = [];
this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => {
rs?.forEach((element: any) => {
List.push({ label: element.enterpriseName, value: element.id });
});
this.sf1.getProperty('/shipperAppUserId')!.schema.enum = List;
this.sf1.getProperty('/shipperAppUserId')!.widget.reset(List);
if (res?.shipperAppUserId) {
this.sf1.setValue('/shipperAppUserId', res?.shipperAppUserId);
this.getRegionCode(res?.shipperAppUserId);
}
});
}
if(res?.enterpriseProjectId) {
this.enterpriseProjectIds = res.enterpriseProjectId
}
this.sf1data = {
// shipperAppUserName: res?.shipperAppUserName || '',
enterpriseProjectId: res?.enterpriseProjectId || '',