diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts index 9eb12591..df0cc433 100644 --- a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts @@ -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都删除 diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts index 254cab4f..a0b0328c 100644 --- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts @@ -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;