车辆对接
This commit is contained in:
@ -12,6 +12,7 @@ import {
|
||||
SFUISchema
|
||||
} from '@delon/form';
|
||||
import { SettingsService, _HttpClient } from '@delon/theme';
|
||||
import { ShipperBaseService } from '@shared';
|
||||
import format from 'date-fns/format';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { of } from 'rxjs';
|
||||
@ -64,7 +65,8 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
private service: SupplyManagementService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private amapService: AmapService
|
||||
private amapService: AmapService,
|
||||
public shipperSrv: ShipperBaseService
|
||||
) {
|
||||
this.validateForm1 = fb.group({
|
||||
loadAddress0: [null, [Validators.required]],
|
||||
@ -166,13 +168,26 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
allowClear: true,
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
// enterpriseInfoName: {
|
||||
// type: 'string',
|
||||
// title: '网络货运人',
|
||||
// ui: {
|
||||
// widget: 'custom'
|
||||
// },
|
||||
// default: '天津市怡亚通XXXX有限公司'
|
||||
// },
|
||||
enterpriseInfoName: {
|
||||
type: 'string',
|
||||
title: '网络货运人',
|
||||
ui: {
|
||||
widget: 'custom'
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value,
|
||||
},
|
||||
allowClear: true,
|
||||
asyncData: () => this.shipperSrv.getNetworkFreightForwarder(),
|
||||
},
|
||||
default: '天津市怡亚通XXXX有限公司'
|
||||
},
|
||||
deadlineTime: {
|
||||
title: '截至日期',
|
||||
@ -186,24 +201,12 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
dispatchId: {
|
||||
type: 'string',
|
||||
title: '调度员',
|
||||
enum: [
|
||||
{ label: '周涛', value: 1 },
|
||||
{ label: '李诞', value: 2 }
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您'
|
||||
// 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'),
|
||||
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
|
||||
asyncData: () => this.shipperSrv.getStaffList2()
|
||||
} as SFSelectWidgetSchema
|
||||
}
|
||||
},
|
||||
@ -226,42 +229,68 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
goodsTypeId: {
|
||||
type: 'string',
|
||||
title: '货物名称',
|
||||
enum: [
|
||||
{ label: '服装', value: '1' },
|
||||
{ label: '电子产品', value: '2' },
|
||||
{ label: '其他', value: '3' }
|
||||
],
|
||||
ui: {
|
||||
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
|
||||
},
|
||||
goodsTypeName: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
hidden: true
|
||||
}
|
||||
},
|
||||
goodsNameId: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
errors: { required: '请填写货物名称' },
|
||||
change: (value, data) => {
|
||||
this.currentGoodsTypeName = data;
|
||||
change: (value: any, data: any) => {
|
||||
this.sf3.setValue('/goodsName', data.label);
|
||||
},
|
||||
visibleIf: {
|
||||
goodsTypeName: (value: any) => value && value !== '其它'
|
||||
}
|
||||
// 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
|
||||
}
|
||||
},
|
||||
goodsName: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
maxLength: 20,
|
||||
ui: {
|
||||
hidden: true,
|
||||
visibleIf: {
|
||||
goodsTypeName: (value: any) => value && value !== '其它'
|
||||
}
|
||||
}
|
||||
},
|
||||
goodsName1: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
errors: { required: '请填写货物名称' },
|
||||
visibleIf: {
|
||||
goodsType: value => value === '其他'
|
||||
goodsTypeName: (value: any) => value && value === '其它'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
required: ['goodsTypeId', 'goodsName']
|
||||
required: ['goodsTypeId', 'goodsName', 'goodsNameId']
|
||||
};
|
||||
this.ui3 = {
|
||||
'*': {
|
||||
@ -453,13 +482,15 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
|
||||
// //装卸货信息
|
||||
const LoadingList = this.startInfo.concat(this.endInfo);
|
||||
// // 货物信息
|
||||
// 货物信息
|
||||
const sf3Values = { ...this.sf3.value };
|
||||
if (sf3Values.goodsTypeName === '其它') {
|
||||
sf3Values.goodsName = sf3Values.goodsName1;
|
||||
delete sf3Values.goodsName1;
|
||||
}
|
||||
const goodsInfoList = [
|
||||
{
|
||||
...this.sf3.value,
|
||||
goodsTypeName: this.currentGoodsTypeName.label,
|
||||
goodsName: '电子',
|
||||
goodsNameId: '1',
|
||||
...sf3Values,
|
||||
...this.sf4.value,
|
||||
maxWeight: this.sf4.value.maxWeight.join(','),
|
||||
maxCube: this.sf4.value.maxCube.join(',')
|
||||
@ -592,4 +623,35 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user