车辆对接

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

@ -169,23 +169,12 @@ export class SupplyManagementOnecarPublishComponent 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
}
}
@ -221,37 +210,76 @@ export class SupplyManagementOnecarPublishComponent 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 }
}
};
}
@ -374,6 +402,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}
};
}
initSF6() {
this.schema6 = {
properties: {
@ -396,7 +425,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
ui: {
widget: 'dict-select',
params: { dictKey: 'receipt:type' },
containsAllLable: false,
containsAllLabel: false,
placeholder: '请选择',
errors: { required: '请选择' },
visibleIf: {
@ -600,6 +629,34 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.validateForm1.removeControl(`loadName${index}`);
this.validateForm1.removeControl(`loadPhone${index}`);
}
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);
}
});
}
addEndInfo(event: any) {
if (this.addEndInfo.length < 5) {
@ -689,6 +746,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
// if (this.validateForm1.invalid) {
// return;
// }
console.log(this.sf7.value)
const params: any = {
...this.sf1.value,
...this.sf5.value,
@ -888,8 +946,15 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
});
this.sf3data = {
goodsName: res?.goodsInfoVOList[0]?.goodsName
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 = {
weight: res?.goodsInfoVOList[0]?.weight,
volume: res?.goodsInfoVOList[0]?.volume,
@ -917,11 +982,21 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
goodsValue: res?.goodsValue
};
console.log(res?.stateReceipt);
// this.sf6data = {
// stateReceipt: res?.stateReceipt,
// receiptType: res?.receiptType,
// receiptUserId: res?.receiptUserId,
// remarks: res?.remarks
// };
this.sf6data = {
stateReceipt: res?.stateReceipt,
receiptType: res?.receiptType,
receiptUserId: res?.receiptUserId,
remarks: res?.remarks
receiptType: res?.receiptType || '',
receiptAddressId: res?.receiptAddressId || '',
receiptUserName: res?.receiptUserName || '',
area: res?.area || '',
phon: res?.phon || '',
address: res?.address || '',
remarks: res?.remarks || '',
};
this.sf7data = {
prePay: res?.shippingInformationVO?.prePay,
@ -944,11 +1019,15 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
nzOnOk: item => {
const data = item.seleteData;
if (JSON.stringify(data) === '{}') return;
this.sf6.setValue('/name4', data.contactName);
this.sf6.setValue('/name5', data.contactTelephone);
this.sf6.setValue('/name6', `${data.province}-${data.city}-${data.area}`);
this.sf6.setValue('/receiptAddress', data.detailedAddress);
this.sf6.setValue('/receiptAddressId', data.id);
this.sf6.setValue('/receiptUserName', data.contactName);
this.sf6.setValue('/phon', data.contactTelephone);
this.sf6.setValue('/area', `${data.province}-${data.city}-${data.area}`);
this.sf6.setValue('/address', data.detailedAddress);
}
});
}
choose(){
window.history.go(-1);
}
}