车辆对接

This commit is contained in:
wangshiming
2022-01-05 20:15:37 +08:00
parent c7f9874e43
commit cd0035940a
43 changed files with 906 additions and 642 deletions

View File

@ -206,8 +206,8 @@
</nz-card>
<nz-card>
<div class="align-center">
<button nz-button nzType="primary" (click)="chooseFamifiar()">生成二维码</button>
<button nz-button nzType="primary" style="margin-left: 48px" (click)="chooseFamifiar()">指派熟车</button>
<!-- <button nz-button nzType="primary" (click)="chooseFamifiar()">生成二维码</button>
<button nz-button nzType="primary" style="margin-left: 48px" (click)="chooseFamifiar()">指派熟车</button> -->
<button nz-button nzType="primary" style="margin-left: 48px" (click)="submit()">司机抢单</button>
</div>
</nz-card>

View File

@ -36,6 +36,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
totalFees: any; // 总数信息
totalDistance = 0.0; //总里程
totalTime = 0.0; //路程总时间
currentGoodsTypeName: any;
enterpriseProjectIds: any;
id = this.route.snapshot.params.id;
// // 单位
@ -46,7 +47,15 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
endInfo: any = [];
PageStatus = '';
dataList: any;
constructor(private http: _HttpClient, fb: FormBuilder, private router: Router, private route: ActivatedRoute, private modalService: NzModalService, public service: SupplyManagementService, private amapService: AmapService, public service2: ShipperBaseService,) {
constructor(
private http: _HttpClient,
fb: FormBuilder,
private router: Router,
private route: ActivatedRoute,
private modalService: NzModalService,
public service: SupplyManagementService,
private amapService: AmapService,
public shipperSrv: ShipperBaseService,) {
this.validateForm1 = fb.group({
createTime: [null, []],
modifyTime: [null, []],
@ -155,23 +164,12 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
dispatchId: {
type: 'string',
title: '调度员',
enum: [
{ label: '调度员1', value: '1' },
{ label: '调度员2', value: '2' }
],
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true
// asyncData: () =>
// this.service.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'),
allowClear: true,
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
asyncData: () => this.shipperSrv.getStaffList2()
} as SFSelectWidgetSchema
}
},
@ -231,37 +229,76 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
initSF3() {
this.schema3 = {
properties: {
goodsName: {
goodsTypeId: {
type: 'string',
title: '货物名称',
ui: {
widget: 'dict-select',
params: { dictKey: 'GoodsName' },
placeholder: '请选择'
}
widget: 'select',
placeholder: '请选择',
errors: { required: '请选择货物类型' },
asyncData: () =>
this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe(
map((data: any) => {
return data[0].children?.map((m: any) => {
return { label: m.name, value: m.id };
});
})
),
change: (value, data: any) => {
this.changeGoodsType(value, data);
this.sf3.setValue('/goodsTypeName', data.label);
}
} as SFSelectWidgetSchema
},
qita: {
goodsTypeName: {
type: 'string',
title: '',
ui: {
hidden: true
}
},
goodsNameId: {
type: 'string',
title: '',
ui: {
widget: 'select',
placeholder: '请选择',
errors: { required: '请填写货物名称' },
change: (value: any, data: any) => {
this.sf3.setValue('/goodsName', data.label);
},
visibleIf: {
goodsName: value => value === '3'
goodsTypeName: (value: any) => value && value !== '其它'
}
}
},
goodsName: {
type: 'string',
title: '',
ui: {
hidden: true,
visibleIf: {
goodsTypeName: (value: any) => value && value !== '其它'
}
}
},
goodsName1: {
type: 'string',
title: '',
ui: {
errors: { required: '请填写货物名称' },
visibleIf: {
goodsTypeName: (value: any) => value && value === '其它'
}
}
}
},
required: ['goodsName', ]
required: ['goodsTypeId', 'goodsName', 'goodsNameId']
};
this.ui3 = {
'*': {
spanLabelFixed: 90,
grid: { span: 12 }
},
$goodsName: {
grid: { span: 12 }
},
$qita: {
grid: { span: 12 }
}
};
}
@ -550,6 +587,35 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
});
}
changeGoodsType(value: string, data: any) {
if (data.label === '其它') return;
const params = {
pageIndex: 1,
pageSize: 100,
configId: value
};
this.service
.request(this.service.$api_get_config_item_page, params)
.pipe(
map(data => {
return data.records?.map((m: any) => {
return { label: m.name, value: m.id };
});
})
)
.subscribe(res => {
if (res) {
this.sf3.getProperty('/goodsNameId')!.schema.enum = res;
this.sf3.getProperty('/goodsNameId')!.widget.reset(res);
if(this.sf3data.goodsNameId){
this.sf3.setValue('/goodsNameId',this.sf3data.goodsNameId);
}
} else {
this.service.msgSrv.error(res.msg);
}
});
}
// 打开地图
openMap(type: string, index: number) {
const modalRef = this.modalService.create({
@ -704,8 +770,16 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
});
this.sf3data = {
goodsTypeId: res?.goodsInfoVOList[0]?.goodsTypeId || '',
goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName || '',
goodsNameId: res?.goodsInfoVOList[0]?.goodsNameId || '',
goodsName: res?.goodsInfoVOList[0]?.goodsName || '',
};
if (this.sf3data.goodsTypeName === '其它') {
this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || '';
}
this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId });
this.sf4data = {
freightPrice: res?.goodsInfoVOList[0]?.freightPrice || '',
freightType: res?.goodsInfoVOList[0]?.freightType || '',