This commit is contained in:
wangshiming
2022-03-09 10:27:21 +08:00
parent a11bb90f20
commit cf2e3c6351
2 changed files with 12 additions and 11 deletions

View File

@ -116,10 +116,11 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
ui: {
widget: 'select',
serverSearch: true,
allowClear: true,
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
onSearch: (q: any) => {
let str = q.replace(/^\s+|\s+$/g, '');
let str = q?.replace(/^\s+|\s+$/g, '');
if (str) {
return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: str })
@ -130,7 +131,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
},
change: (q: any, qs: any) => {
let str = q.replace(/^\s+|\s+$/g, '');
let str = q?.replace(/^\s+|\s+$/g, '');
if (str) {
this.getRegionCode(str);
this.shipperName = qs?.label;
@ -649,17 +650,17 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
// 校验各个输入限定值
if (
this.sf4.value.weight > this.limitValues.maxWeight ||
this.sf4.value.volume > this.limitValues.maxVolume ||
this.sf4.value.number > this.limitValues.maxTrainNumber
this.sf4.value?.weight > this.limitValues?.maxWeight ||
this.sf4.value?.volume > this.limitValues?.maxVolume ||
this.sf4.value?.number > this.limitValues?.maxTrainNumber
) {
this.service.msgSrv.error(
`当前货物核载信息已超出限定值【${this.limitValues.maxWeight}吨、${this.limitValues.maxVolume}方、${this.limitValues.maxTrainNumber}车】`
`当前货物核载信息已超出限定值【${this.limitValues?.maxWeight}吨、${this.limitValues?.maxVolume}方、${this.limitValues?.maxTrainNumber}车】`
);
return;
}
if (this.sf4.value.freightPrice > this.limitValues.maxFreight) {
if (this.sf4.value?.freightPrice > this.limitValues?.maxFreight) {
this.service.msgSrv.error(`当前运费单价已超出限定值【${this.limitValues.maxFreight}元】`);
return;
}
@ -682,8 +683,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
{
...this.sf4.value,
...this.sf3.value,
carModel: this.sf4.value.carModel.join(','),
carLength: this.sf4.value.carLength.join(',')
carModel: this.sf4.value?.carModel.join(','),
carLength: this.sf4.value?.carLength.join(',')
}
];
// 从“再下一单”过来将所有的子参数内的id都删除

View File

@ -130,7 +130,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
searchLoadingText: '搜索中...',
allowClear: true,
onSearch: (q: any) => {
let str =q.replace(/^\s+|\s+$/g,"");
let str =q?.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: str })
@ -141,7 +141,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
}
},
change: (q: any, qs: any) => {
let str =q.replace(/^\s+|\s+$/g,"");
let str =q?.replace(/^\s+|\s+$/g,"");
if (str) {
this.getRegionCode(str);
this.shipperName = qs?.label;