From 650fe2cbdb1a63597c39ed019f432806e333962d Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 1 Mar 2022 13:42:48 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bulk-detail-change/bulk-detail-change.component.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html index 1ed70615..b7d92a6a 100644 --- a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html +++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-24 16:58:02 * @LastEditors : Shiming - * @LastEditTime : 2022-01-20 20:32:44 + * @LastEditTime : 2022-03-01 13:42:44 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -89,6 +89,7 @@ (click)="openMap('start', idx)" formControlName="loadAddress{{ idx }}" placeholder="请输入装货地" + readonly="true" /> @@ -141,6 +142,7 @@ formControlName="unloadAddress{{ idx }}" placeholder="请输入卸货地" name="unloadAddress{{ idx }}" + readonly="true" /> From c20220da1d1b63586ebd0a280ba22bbfbd679aef Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 1 Mar 2022 13:44:01 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/bulk-publish/bulk-publish.component.html | 2 ++ .../bulk-release-publish/bulk-release-publish.component.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html index 752660a8..20668692 100644 --- a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html @@ -30,6 +30,7 @@ (click)="openMap('start', idx)" formControlName="loadAddress{{ idx }}" placeholder="请输入装货地" + readonly="true" /> @@ -80,6 +81,7 @@ (click)="openMap('end', idx)" formControlName="unloadAddress{{ idx }}" placeholder="请输入卸货地" + readonly="true" /> diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html index bb960c37..167c671c 100644 --- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html @@ -37,6 +37,7 @@ name="startDetailedAddress{{ idx }}" placeholder="请输入装货地" required + readonly="true" /> @@ -90,6 +91,7 @@ name="endDetailedAddress{{ idx }}" placeholder="请输入卸货地" required + readonly="true" /> From c56013d9ea1038fb70c64538f901e47a5a7ec80e Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 1 Mar 2022 13:59:37 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onecar-publish/onecar-publish.component.ts | 12 +++++++----- .../release-publish/release-publish.component.ts | 11 +++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts index 589f790e..7328931c 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts @@ -147,10 +147,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { searchDebounceTime: 300, searchLoadingText: '搜索中...', onSearch: (q: any) => { - console.log(q) - if (q) { + console.log(q === ' ') + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { @@ -158,8 +159,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } }, change: (q: any) => { - if (q) { - this.getRegionCode(q); + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + this.getRegionCode(str); } } } as SFSelectWidgetSchema diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts index a1daafb0..cbc6cbf5 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts @@ -135,9 +135,11 @@ export class SupplyManagementReleasePublishComponent implements OnInit { searchDebounceTime: 300, searchLoadingText: '搜索中...', onSearch: (q: any) => { - if (q) { + console.log(q === ' ') + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { @@ -145,8 +147,9 @@ export class SupplyManagementReleasePublishComponent implements OnInit { } }, change: (q: any) => { - if (q) { - this.getRegionCode(q); + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + this.getRegionCode(str); } }, } as SFSelectWidgetSchema From b9f582e383699287563bea21552fc651cc9c8575 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 1 Mar 2022 14:00:53 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/bulk-publish/bulk-publish.component.ts | 10 +++++++--- .../bulk-release-publish.component.ts | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) 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 a614b852..d3744948 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 @@ -110,9 +110,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit { searchDebounceTime: 300, searchLoadingText: '搜索中...', onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { @@ -120,7 +121,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit { } }, change: (q: any) => { - this.getRegionCode(q); + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + this.getRegionCode(str); + } }, } as SFSelectWidgetSchema }, 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 d870e3df..119aa208 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 @@ -121,9 +121,10 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) .pipe(map((res: any[]) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { @@ -131,7 +132,10 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { } }, change: (q: any) => { - this.getRegionCode(q); + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + this.getRegionCode(str); + } } } as SFSelectWidgetSchema }, From adbe2a402f20df6b0c71a208c62aa459f5e5718e Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 1 Mar 2022 14:04:28 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cost-management/cost-management.component.ts | 10 ++++++---- .../components/list/list.component.ts | 5 +++-- .../order-management/components/bulk/bulk.component.ts | 5 +++-- .../compliance-audit/compliance-audit.component.ts | 5 +++-- .../receipts-audit/receipts-audit.component.ts | 5 +++-- .../components/vehicle/vehicle.component.ts | 5 +++-- .../components/bulk/bulk.component.ts | 6 +++--- .../components/vehicle/vehicle.component.ts | 6 +++--- .../close-account/close-account.component.ts | 6 +++--- .../abnormal-appear/abnormal-appear.component.ts | 6 +++--- .../components/bulk/bulk.component.ts | 5 +++-- .../components/vehicle/vehicle.component.ts | 6 +++--- 12 files changed, 39 insertions(+), 31 deletions(-) diff --git a/src/app/routes/financial-management/components/cost-management/cost-management.component.ts b/src/app/routes/financial-management/components/cost-management/cost-management.component.ts index 541d0dbe..66686124 100644 --- a/src/app/routes/financial-management/components/cost-management/cost-management.component.ts +++ b/src/app/routes/financial-management/components/cost-management/cost-management.component.ts @@ -188,9 +188,10 @@ export class CostManagementComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { @@ -212,9 +213,10 @@ export class CostManagementComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str}) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/insurance-management/components/list/list.component.ts b/src/app/routes/insurance-management/components/list/list.component.ts index 563e1306..4cecaf0d 100644 --- a/src/app/routes/insurance-management/components/list/list.component.ts +++ b/src/app/routes/insurance-management/components/list/list.component.ts @@ -213,9 +213,10 @@ export class insuranceManagementListComponent implements OnInit { _$expand: (value: boolean) => value }, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/order-management/components/bulk/bulk.component.ts b/src/app/routes/order-management/components/bulk/bulk.component.ts index f2ed3ef0..a28a46fd 100644 --- a/src/app/routes/order-management/components/bulk/bulk.component.ts +++ b/src/app/routes/order-management/components/bulk/bulk.component.ts @@ -197,9 +197,10 @@ export class OrderManagementBulkComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts index d6e0fa51..b896fed5 100644 --- a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts +++ b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts @@ -156,9 +156,10 @@ export class OrderManagementComplianceAuditComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts index 1a8cbc08..d8c37fba 100644 --- a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts @@ -131,9 +131,10 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.ts b/src/app/routes/order-management/components/vehicle/vehicle.component.ts index 7cad40fd..6a1f0494 100644 --- a/src/app/routes/order-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/order-management/components/vehicle/vehicle.component.ts @@ -207,9 +207,10 @@ resourceStatus: any; searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q}) + .request(this.service.$api_enterpriceList, { enterpriseName: str}) .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.ts b/src/app/routes/supply-management/components/bulk/bulk.component.ts index a7360ee6..0288c323 100644 --- a/src/app/routes/supply-management/components/bulk/bulk.component.ts +++ b/src/app/routes/supply-management/components/bulk/bulk.component.ts @@ -209,10 +209,10 @@ export class SupplyManagementBulkComponent implements OnInit { }, allowClear: true, onSearch: (q: any) => { - console.log(q) - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q}) + .request(this.service.$api_enterpriceList, { enterpriseName: str}) .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/supply-management/components/vehicle/vehicle.component.ts b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts index f972fdcb..88eb96d0 100644 --- a/src/app/routes/supply-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts @@ -388,10 +388,10 @@ export class SupplyManagementVehicleComponent implements OnInit { }, allowClear: true, onSearch: (q: any) => { - console.log(q); - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .request(this.service.$api_enterpriceList, { enterpriseName: str }) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/sys-setting/components/close-account/close-account.component.ts b/src/app/routes/sys-setting/components/close-account/close-account.component.ts index 8a61d047..427b1bf5 100644 --- a/src/app/routes/sys-setting/components/close-account/close-account.component.ts +++ b/src/app/routes/sys-setting/components/close-account/close-account.component.ts @@ -159,10 +159,10 @@ export class CloseAccountComponent implements OnInit { searchDebounceTime: 300, searchLoadingText: '搜索中...', onSearch: (q: any) => { - console.log(q) - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q}) + .request(this.service.$api_enterpriceList, { enterpriseName: str}) .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts b/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts index b22e712e..830ddd5f 100644 --- a/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts +++ b/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts @@ -124,10 +124,10 @@ export class WaybillManagementAbnormalAppearComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - console.log(q) - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q}) + .request(this.service.$api_enterpriceList, { enterpriseName: str}) .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/waybill-management/components/bulk/bulk.component.ts b/src/app/routes/waybill-management/components/bulk/bulk.component.ts index 26890393..53ebc4c6 100644 --- a/src/app/routes/waybill-management/components/bulk/bulk.component.ts +++ b/src/app/routes/waybill-management/components/bulk/bulk.component.ts @@ -96,9 +96,10 @@ tabs = { allowClear: true, onSearch: (q: any) => { console.log(q) - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q}) + .request(this.service.$api_enterpriceList, { enterpriseName: str}) .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { diff --git a/src/app/routes/waybill-management/components/vehicle/vehicle.component.ts b/src/app/routes/waybill-management/components/vehicle/vehicle.component.ts index bdd5d180..7dc824d8 100644 --- a/src/app/routes/waybill-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/waybill-management/components/vehicle/vehicle.component.ts @@ -93,10 +93,10 @@ export class WaybillManagementVehicleComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - console.log(q) - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { return this.service - .request(this.service.$api_enterpriceList, { enterpriseName: q}) + .request(this.service.$api_enterpriceList, { enterpriseName: str}) .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .toPromise(); } else { From 201b0eaa1aa0df165b25f4934144498358e0c1f5 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 1 Mar 2022 14:30:58 +0800 Subject: [PATCH 6/6] fix bug --- package-lock.json | 40 ++++++++++++ package.json | 1 + .../onecar-publish.component.html | 7 ++- .../onecar-publish.component.ts | 62 ++++++++++++++----- .../qrcode-page/qrcode-page.component.html | 16 +---- .../qrcode-page/qrcode-page.component.ts | 28 +++++++-- .../release-publish.component.html | 13 ++-- .../release-publish.component.ts | 55 +++++++++++++--- .../services/supply-management.service.ts | 14 +++-- 9 files changed, 181 insertions(+), 55 deletions(-) diff --git a/package-lock.json b/package-lock.json index ddf3948b..50a51aea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5172,6 +5172,14 @@ } } }, + "css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "requires": { + "utrie": "^1.0.2" + } + }, "css-loader": { "version": "6.2.0", "resolved": "https://registry.npmmirror.com/css-loader/download/css-loader-6.2.0.tgz?cache=0&sync_timestamp=1635967924209&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcss-loader%2Fdownload%2Fcss-loader-6.2.0.tgz", @@ -8113,6 +8121,15 @@ "integrity": "sha1-e15vfmZen7QfMAB+2eDUHpf7IUA=", "dev": true }, + "html2canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", + "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", + "requires": { + "css-line-break": "^2.1.0", + "text-segmentation": "^1.0.3" + } + }, "htmlparser2": { "version": "3.10.1", "resolved": "https://registry.npmmirror.com/htmlparser2/download/htmlparser2-3.10.1.tgz?cache=0&sync_timestamp=1636640940074&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fhtmlparser2%2Fdownload%2Fhtmlparser2-3.10.1.tgz", @@ -22662,6 +22679,14 @@ } } }, + "text-segmentation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", + "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", + "requires": { + "utrie": "^1.0.2" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz", @@ -23211,6 +23236,21 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "dev": true }, + "utrie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", + "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", + "requires": { + "base64-arraybuffer": "^1.0.2" + }, + "dependencies": { + "base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==" + } + } + }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmmirror.com/uuid/download/uuid-3.4.0.tgz", diff --git a/package.json b/package.json index 1d6e533e..2740f7e3 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "@swimlane/ngx-charts": "^18.0.1", "ajv": "^8.6.2", "file-saver": "^2.0.5", + "html2canvas": "^1.4.1", "js-base64": "^3.6.1", "masonry-layout": "^4.2.2", "ng-gallery": "^5.0.0", diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html index 39eae06f..d48a2dae 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html @@ -155,8 +155,8 @@ 装货时间 @@ -168,7 +168,8 @@ 卸货时间 - + diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts index 7328931c..cc4e7fff 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts @@ -38,8 +38,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { limitValues = { maxWeight: 99999, maxVolume: 99999, - maxPiece: 99999 - }; + maxPiece: 99999, + maxDays: 999, + intervalDays: 999, + maxTimes: 999, + } sf1data: any; // 货源单设置回显 sf3data: any; // 货源单设置回显 sf4data: any; // 货源单设置回显 @@ -110,14 +113,18 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { @ViewChild('sf7', { static: false }) sf7!: SFComponent; schema7: SFSchema = {}; ui7!: SFUISchema; + formatterRmb = (value: number): string => { - if (value) { + if (value === null || value === undefined) { + return ''; + }else{ let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); - return `¥ ${value2}`; + return `¥${value2}`; } - return `¥ 0.00`; + }; - parserRmb = (value: string): string => value.replace('¥ ', '').replace(',', ''); + parserRmb = (value: string): string => value.replace('¥', '').replace(',', ''); + // 页面初始化 ngOnInit(): void { if (this.route.snapshot?.queryParams?.sta === '1') { @@ -761,17 +768,30 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { getLimitvalue() { // 货物核载信息最大值 // 货物运输费(小计)最大值 - const getlimitvaluesParms = [this.service.limitKeys.weight, this.service.limitKeys.volume, this.service.limitKeys.piece]; - this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe(res => { + const getlimitvaluesParms = [ + this.service.limitKeys.weight, + this.service.limitKeys.volume, + this.service.limitKeys.piece, + this.service.limitKeys.maxDays, + this.service.limitKeys.intervalDays, + this.service.limitKeys.maxTimes, + ]; + this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe((res) => { const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys.weight)[0].itemValue; const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys.volume)[0].itemValue; const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys.piece)[0].itemValue; + const maxDays = res.filter((item: any) => item.itemKey === this.service.limitKeys.maxDays)[0].itemValue; + const intervalDays = res.filter((item: any) => item.itemKey === this.service.limitKeys.intervalDays)[0].itemValue; + const maxTimes = res.filter((item: any) => item.itemKey === this.service.limitKeys.maxTimes)[0].itemValue; this.limitValues = { maxWeight: Number(maxWeight), maxVolume: Number(maxVolume), - maxPiece: Number(maxPiece) - }; - }); + maxPiece: Number(maxPiece), + maxDays: Number(maxDays), + intervalDays: Number(intervalDays), + maxTimes: Number(maxTimes), + } + }) } subStartInfo(event: any, index: number) { this.startInfo.splice(index, 1); @@ -898,7 +918,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.service.msgSrv.warning('总费用不能为0!'); return; } - + const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime))/(24*60*60*1000); + if (num > this.limitValues.maxDays) { + this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues.maxDays}天】`); + return; + } if ( this.sf4.value.weight > this.limitValues.maxWeight || this.sf4.value.volume > this.limitValues.maxVolume || @@ -1328,10 +1352,16 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } }); } - // 不可选择的时间 - disabledDateStart = (current: Date): boolean => { - return differenceInCalendarDays(new Date(), current) > 0; - }; + // 不可选择的时间 + disabledDateStart = (current: Date): boolean => { + let d = new Date(); + let year = d.getFullYear(); + let month = d.getMonth(); + let date = d.getDate(); + let hours = d.getHours(); + let mydate = new Date(year, month, date + this.limitValues.maxDays,hours+1); + return differenceInCalendarDays(new Date(), current) > 0 || new Date(current) > mydate; + }; // 装卸货地址互换 swapAddress() { this.startInfo.forEach((element: any, index: any) => { diff --git a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html index 8515e77e..6709ad57 100644 --- a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html +++ b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html @@ -1,18 +1,8 @@ -
-
-
+
+

{{i?.enterpriseInfoName}}

@@ -23,6 +13,6 @@
diff --git a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts index 275b522b..f1681253 100644 --- a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts +++ b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-03 11:10:14 * @LastEditors : Shiming - * @LastEditTime : 2022-02-28 20:00:06 + * @LastEditTime : 2022-03-01 14:19:47 * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\qrcode-page\\qrcode-page.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -13,6 +13,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { QRComponent } from '@delon/abc/qr'; import { SFSchema, SFUISchema } from '@delon/form'; import { NzModalRef } from 'ng-zorro-antd/modal'; +import html2canvas from 'html2canvas'; @Component({ selector: 'app-supply-management-qrcode-page', @@ -50,16 +51,22 @@ export class SupplyManagementQrcodePageComponent implements OnInit { } - downLoadQrcode(downloadName: any): void { + /** + * 下载二维码 + * @param downloadName 文件名 + * @param contents 内容 + */ + downLoadQrcode(downloadName: any, contents: any): void { let aLink = document.createElement('a'); - const content = this.qr.dataURL; + const content = contents; let blob = this.base64ToBlob(content); //new Blob([content]); let evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true);//initEvent 不加后两个参数在IE下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为 aLink.download = downloadName; aLink.href = URL.createObjectURL(blob); // aLink.dispatchEvent(evt); - aLink.click() + aLink.click(); + } @@ -80,4 +87,17 @@ export class SupplyManagementQrcodePageComponent implements OnInit { this.modal.destroy(); } + /** + * 把页面装成canvas + */ + toCanvasPhoto() { + let aLink = document.createElement('a'); + html2canvas(document.getElementById('qr_page')!, { height: 340 }).then((canvas:any) => { + let url = canvas.toDataURL("image/jpeg"); + this.downLoadQrcode('二维码', url); + + }) + } + + } diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.html b/src/app/routes/supply-management/components/release-publish/release-publish.component.html index aa0a881f..7d8445ec 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.html +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.html @@ -161,11 +161,11 @@ 装货时间 + [nzShowTime]="{ nzFormat: 'HH' }" + nzFormat="yyyy-MM-dd HH:00前" + formControlName="loadingTime" + [nzDisabledDate]="disabledDateStart" + >
@@ -174,7 +174,8 @@ 卸货时间 - +
diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts index cbc6cbf5..2f514508 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts @@ -102,15 +102,25 @@ export class SupplyManagementReleasePublishComponent implements OnInit { @ViewChild('sf7', { static: false }) sf7!: SFComponent; schema7: SFSchema = {}; ui7!: SFUISchema; - formatterRmb = (value: number): string =>{ - if(value){ - let value2 = Number(value).toLocaleString(undefined,{'minimumFractionDigits':2,'maximumFractionDigits':2}); - return `¥ ${value2}`; + limitValues = { + maxWeight: 99999, + maxVolume: 99999, + maxPiece: 99999, + maxDays: 999, + intervalDays: 999, + maxTimes: 999, + } + + formatterRmb = (value: number): string => { + if (value === null || value === undefined) { + return ''; + }else{ + let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); + return `¥${value2}`; } - return `¥ 0.00` - - } ; - parserRmb = (value: string): string => value.replace('¥ ', '').replace(',',''); + + }; + parserRmb = (value: string): string => value.replace('¥', '').replace(',', ''); // 页面初始化 ngOnInit(): void { this.initSF1(); @@ -121,6 +131,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { this.initSF7(); this.addStartInfo(); this.addEndInfo(); + this.getLimitvalue(); } initSF1() { this.schema1 = { @@ -658,6 +669,34 @@ export class SupplyManagementReleasePublishComponent implements OnInit { grid: { span: 24 } } }; + } + getLimitvalue() { + // 货物核载信息最大值 + // 货物运输费(小计)最大值 + const getlimitvaluesParms = [ + this.service.limitKeys.weight, + this.service.limitKeys.volume, + this.service.limitKeys.piece, + this.service.limitKeys.maxDays, + this.service.limitKeys.intervalDays, + this.service.limitKeys.maxTimes, + ]; + this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe((res) => { + const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys.weight)[0].itemValue; + const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys.volume)[0].itemValue; + const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys.piece)[0].itemValue; + const maxDays = res.filter((item: any) => item.itemKey === this.service.limitKeys.maxDays)[0].itemValue; + const intervalDays = res.filter((item: any) => item.itemKey === this.service.limitKeys.intervalDays)[0].itemValue; + const maxTimes = res.filter((item: any) => item.itemKey === this.service.limitKeys.maxTimes)[0].itemValue; + this.limitValues = { + maxWeight: Number(maxWeight), + maxVolume: Number(maxVolume), + maxPiece: Number(maxPiece), + maxDays: Number(maxDays), + intervalDays: Number(intervalDays), + maxTimes: Number(maxTimes), + } + }) } // 不可选择的时间 disabledDateStart = (current: Date): boolean => { diff --git a/src/app/routes/supply-management/services/supply-management.service.ts b/src/app/routes/supply-management/services/supply-management.service.ts index b1238bec..aafd8601 100644 --- a/src/app/routes/supply-management/services/supply-management.service.ts +++ b/src/app/routes/supply-management/services/supply-management.service.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-03 11:10:14 * @LastEditors : Shiming - * @LastEditTime : 2022-02-28 19:34:22 + * @LastEditTime : 2022-03-01 14:08:30 * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\services\\supply-management.service.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -139,10 +139,14 @@ export class SupplyManagementService extends BaseService { super(injector); } public limitKeys = { - weight: 'sys.config.goods.approvalCarMaxWeight', //整车-核载重量上限 - volume: 'sys.config.goods.approvalCarMaxVolume', //整车-核载体积上限 - piece: 'sys.config.goods.approvalCarMaxPiece' //整车-核载件数上限 - }; + weight:'sys.config.goods.approvalCarMaxWeight', //整车-核载重量上限 + volume:'sys.config.goods.approvalCarMaxVolume', //整车-核载体积上限 + piece:'sys.config.goods.approvalCarMaxPiece', //整车-核载件数上限 + maxDays:'sys.config.goods.wholeLoadingMaxDays', //整车-计划装货时间上限 + intervalDays:'sys.config.goods.wholeUnloadingIntervalDays', //计划装、卸货时间间隔 + maxTimes:'sys.config.goods.wholeLoadingMaxTimes', //整车-多装多卸地点上限 + } + // 根据ItemKey获取项值 public $api_findItemValueByItemKeys = '/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys'; // 获取保价费信息