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 079024fc..d81b86d5 100644 --- a/src/app/routes/order-management/components/bulk/bulk.component.ts +++ b/src/app/routes/order-management/components/bulk/bulk.component.ts @@ -532,7 +532,6 @@ export class OrderManagementBulkComponent implements OnInit { - // 获取录单员 getCatalogueMember() { const params = { }; diff --git a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html new file mode 100644 index 00000000..dc976583 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html @@ -0,0 +1,67 @@ + + + + + + 100元/吨 + 100元/方 + 100元/车 + + +
+
以发货为准 / 以收货为准
+
保留小数/抹除小数/抹除个数
+
+
+ +
+ + +
xx吨
+
+ +
xx吨
+
+
+ + +
xx吨
+
+ +
xx吨
+
+
+ + +
1000元
+
+ +
张三 / 18888888888 / 粤GJ401
+
+ +
李四 / 1888888888
+
+ + + +
+ diff --git a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.less b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts new file mode 100644 index 00000000..381b694e --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts @@ -0,0 +1,53 @@ +import { preloaderFinished } from '@delon/theme'; +/* + * @Author: your name + * @Date: 2021-12-14 14:03:07 + * @LastEditTime: 2021-12-14 15:43:12 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\order-management\modal\bulk\update-freight\update-freight.component.ts + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { + SFComponent, + SFCustomWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema +} from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; + +@Component({ + selector: 'app-order-management-confir-receipt', + templateUrl: './confir-receipt.component.html', + styleUrls: ['./confir-receipt.component.less'] +}) +export class ConfirReceiptComponent implements OnInit { + record: any = {}; + i:any; + data: any = {}; + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient) {} + + ngOnInit(): void { + } + + save(): void { + // this.http.post(`/user/${this.record.id}`, value).subscribe(res => { + // this.msgSrv.success('保存成功'); + // this.modal.close(true); + // }); + } + + close(): void { + this.modal.destroy(); + } + userAction() { + + } + +} diff --git a/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.html b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.html new file mode 100644 index 00000000..c3a17c73 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.html @@ -0,0 +1,29 @@ + + + +
+ +
+
+
+ +
+ +
+
+
+
+ + diff --git a/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.less b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.ts b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.ts new file mode 100644 index 00000000..bd6c4f6e --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.ts @@ -0,0 +1,298 @@ +import { preloaderFinished } from '@delon/theme'; +/* + * @Author: your name + * @Date: 2021-12-14 14:03:07 + * @LastEditTime: 2021-12-14 17:38:20 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\order-management\modal\bulk\update-freight\update-freight.component.ts + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { + SFComponent, + SFCustomWidgetSchema, + SFDateWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema, + SFUploadWidgetSchema +} from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from 'src/app/routes/supply-management/services/supply-management.service'; +import { Observable, Observer } from 'rxjs'; + +@Component({ + selector: 'app-order-management-sure-arrive', + templateUrl: './sure-arrive.component.html', + styleUrls: ['./sure-arrive.component.less'] +}) +export class SureArriveComponent implements OnInit { + record: any = {}; + i: any; + data: any ={ + place1: '', + place2: '' + }; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, public service: SupplyManagementService ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + datetime: { + type: 'string', + title: '卸货时间', + format: 'date-time', + }, + no2: { + type: 'string', + title: '卸货重量', + ui: { + widget: 'custom', + } + }, + no3: { + type: 'string', + title: '卸货体积', + ui: { + widget: 'custom', + } + }, + + avatar: { + type: 'string', + title: '装货凭证', + ui: { + action: `/scm/cms/cms/upload/multipartFile/fileModel`, + fileType: 'image/png,image/jpeg,image/jpg', + limit: 1, + limitFileCount: 1, + resReName: 'url', + urlReName: 'url', + widget: 'upload', + descriptionI18n: ' 提单号', + data: { + // appId: environment.appId, + }, + name: 'multipartFile', + multiple: true, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.fileList[0].response.url, + response: { + url: args.fileList[0].response.url + } + } + ]; + this.sf?.setValue('/avatar', avatar); + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } as SFUploadWidgetSchema + }, + avatar2: { + type: 'string', + title: '', + ui: { + action: `/scm/cms/cms/upload/multipartFile/fileModel`, + fileType: 'image/png,image/jpeg,image/jpg', + limit: 1, + limitFileCount: 1, + resReName: 'url', + urlReName: 'url', + widget: 'upload', + descriptionI18n: '人车货照片', + data: { + // appId: environment.appId, + }, + name: 'multipartFile', + multiple: true, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.fileList[0].response.url, + response: { + url: args.fileList[0].response.url + } + } + ]; + this.sf?.setValue('/avatar', avatar); + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } as SFUploadWidgetSchema + }, + no4: { + type: 'string', + title: '', + ui: { + widget: 'text', + }, + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式', + }, + avatar3: { + type: 'string', + title: '卸货凭证', + ui: { + action: `/scm/cms/cms/upload/multipartFile/fileModel`, + fileType: 'image/png,image/jpeg,image/jpg', + limit: 1, + limitFileCount: 1, + resReName: 'url', + urlReName: 'url', + widget: 'upload', + descriptionI18n: ' 提单号', + data: { + // appId: environment.appId, + }, + name: 'multipartFile', + multiple: true, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.fileList[0].response.url, + response: { + url: args.fileList[0].response.url + } + } + ]; + this.sf?.setValue('/avatar', avatar); + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } as SFUploadWidgetSchema + }, + avatar4: { + type: 'string', + title: '', + ui: { + action: `/scm/cms/cms/upload/multipartFile/fileModel`, + fileType: 'image/png,image/jpeg,image/jpg', + limit: 1, + limitFileCount: 1, + resReName: 'url', + urlReName: 'url', + widget: 'upload', + descriptionI18n: '人车货照片', + data: { + // appId: environment.appId, + }, + name: 'multipartFile', + multiple: true, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.fileList[0].response.url, + response: { + url: args.fileList[0].response.url + } + } + ]; + this.sf?.setValue('/avatar', avatar); + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } as SFUploadWidgetSchema + } + }, + required: ['reason'] + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 20 } + }, + $avatar: { grid: { span: 12} }, + $avatar2: { grid: { span: 12} }, + $avatar3: { grid: { span: 12} }, + $avatar4: { grid: { span: 12} }, + }; + } + save(value: any): void { + console.log(value) + // this.http.post(`/user/${this.record.id}`, value).subscribe(res => { + // this.msgSrv.success('保存成功'); + // this.modal.close(true); + // }); + } + + close(): void { + this.modal.destroy(); + } + +} diff --git a/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.html b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.html new file mode 100644 index 00000000..d7d289c7 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.html @@ -0,0 +1,29 @@ + + + +
+ +
+
+
+ +
+ +
+
+
+
+ + diff --git a/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.less b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.ts b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.ts new file mode 100644 index 00000000..4701dc86 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.ts @@ -0,0 +1,199 @@ +import { preloaderFinished } from '@delon/theme'; +/* + * @Author: your name + * @Date: 2021-12-14 14:03:07 + * @LastEditTime: 2021-12-14 16:34:52 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\order-management\modal\bulk\update-freight\update-freight.component.ts + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { + SFComponent, + SFCustomWidgetSchema, + SFDateWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema, + SFUploadWidgetSchema +} from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from 'src/app/routes/supply-management/services/supply-management.service'; +import { Observable, Observer } from 'rxjs'; + +@Component({ + selector: 'app-order-management-sure-depart', + templateUrl: './sure-depart.component.html', + styleUrls: ['./sure-depart.component.less'] +}) +export class SureDepartComponent implements OnInit { + record: any = {}; + i: any; + data: any ={ + place1: '', + place2: '' + }; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, public service: SupplyManagementService ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + datetime: { + type: 'string', + title: '装货时间', + format: 'date-time', + }, + no2: { + type: 'string', + title: '装货重量', + ui: { + widget: 'custom', + } + }, + no3: { + type: 'string', + title: '装货体积', + ui: { + widget: 'custom', + } + }, + no4: { + type: 'string', + title: '', + ui: { + widget: 'text', + }, + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式', + }, + avatar: { + type: 'string', + title: '装货凭证', + ui: { + action: `/scm/cms/cms/upload/multipartFile/fileModel`, + fileType: 'image/png,image/jpeg,image/jpg', + limit: 1, + limitFileCount: 1, + resReName: 'url', + urlReName: 'url', + widget: 'upload', + descriptionI18n: ' 提单号', + data: { + // appId: environment.appId, + }, + name: 'multipartFile', + multiple: true, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.fileList[0].response.url, + response: { + url: args.fileList[0].response.url + } + } + ]; + this.sf?.setValue('/avatar', avatar); + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } as SFUploadWidgetSchema + }, + avatar2: { + type: 'string', + title: '', + ui: { + action: `/scm/cms/cms/upload/multipartFile/fileModel`, + fileType: 'image/png,image/jpeg,image/jpg', + limit: 1, + limitFileCount: 1, + resReName: 'url', + urlReName: 'url', + widget: 'upload', + descriptionI18n: '人车货照片', + data: { + // appId: environment.appId, + }, + name: 'multipartFile', + multiple: true, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.fileList[0].response.url, + response: { + url: args.fileList[0].response.url + } + } + ]; + this.sf?.setValue('/avatar', avatar); + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } as SFUploadWidgetSchema + } + }, + required: ['reason'] + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 20 } + }, + $avatar: { grid: { span: 12} }, + $avatar2: { grid: { span: 12} }, + }; + } + save(value: any): void { + console.log(value) + // this.http.post(`/user/${this.record.id}`, value).subscribe(res => { + // this.msgSrv.success('保存成功'); + // this.modal.close(true); + // }); + } + + close(): void { + this.modal.destroy(); + } + +} diff --git a/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.html b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.html new file mode 100644 index 00000000..b52bb931 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.html @@ -0,0 +1,53 @@ + + + + +
+ +
元/吨
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+

总运费:¥900.00

+

运输费:¥800.00,附加费:¥100.00

+
+ + diff --git a/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.less b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.ts b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.ts new file mode 100644 index 00000000..afad8c66 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.ts @@ -0,0 +1,143 @@ +import { preloaderFinished } from '@delon/theme'; +/* + * @Author: your name + * @Date: 2021-12-14 14:03:07 + * @LastEditTime: 2021-12-14 15:16:27 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\order-management\modal\bulk\update-freight\update-freight.component.ts + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { + SFComponent, + SFCustomWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema +} from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; + +@Component({ + selector: 'app-order-management-update-freight', + templateUrl: './update-freight.component.html', + styleUrls: ['./update-freight.component.less'] +}) +export class UpdateFreightComponent implements OnInit { + record: any = {}; + i: any; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + data: any = {}; + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient) {} + + ngOnInit(): void { + this.initSF(); + + if (this.record.id > 0) this.http.get(`/user/${this.record.id}`).subscribe(res => (this.i = res)); + } + initSF() { + this.schema= { + properties: { + no: { + type: 'string', + title: '运费单价', + ui: { + widget: 'custom', + } + }, + sex: { + title: '', + type: 'string', + enum: [ + { label: '保留小数', value: 0 }, + { label: '男', value: 1 }, + { label: '女', value: 2 }, + { label: '保密', value: 3 }, + ], + ui: { + widget: 'select', + } as SFSelectWidgetSchema, + }, + appId: { + type: 'string', + title: '结算依据', + ui: { + width: 300, + grid: { span: 24 }, + widget: 'select', + placeholder: '请选择', + allowClear: true, + // asyncData: () => this.getCatalogueMember(), + }, + }, + no2: { + type: 'string', + title: '装货重量', + ui: { + widget: 'custom', + } + }, + no3: { + type: 'string', + title: '装货体积', + ui: { + widget: 'custom', + } + }, + no4: { + type: 'string', + title: '卸货重量', + ui: { + widget: 'custom', + } + }, + no5: { + type: 'string', + title: '卸货体积', + ui: { + widget: 'custom', + } + }, + name3: { + type: 'string', + title: '变更原因', + maxLength: 100, + ui: { + width: 300, + placeholder:"选填,最多不超过100字", + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + } as SFTextareaWidgetSchema + }, + }, + required: ['no', 'appId'], + type: 'object', + }; + this.ui = { '*': { spanLabelFixed: 100, grid: { span: 12, gutter: 4 } } + }; + } + save(value: any): void { + console.log(value) + console.log(this.data) + this.http.post(`/user/${this.record.id}`, value).subscribe(res => { + this.msgSrv.success('保存成功'); + this.modal.close(true); + }); + } + + close(): void { + this.modal.destroy(); + } + /** + * 更新数字框 + * @param value + * @param type + */ + changeNumVal(value: any, type: number) {} +} 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 53c3788a..be2c7d89 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 @@ -11,7 +11,9 @@ -
装卸货信息预计公里数:-km,预计行程耗时:-小时
+
装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
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 b57eb0b4..82c211f8 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 @@ -10,11 +10,10 @@ import { SFUISchema } from '@delon/form'; import { _HttpClient } from '@delon/theme'; -import { AmapPoiPickerComponent } from '@shared'; +import { AmapPoiPickerComponent, AmapService, ShipperBaseService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component'; -import { SupplyManagementService } from '../../services/supply-management.service'; -import { debug } from 'console'; +import { SupplyManagementService} from '../../services/supply-management.service'; @Component({ selector: 'app-publish-goods-bulk-publish', templateUrl: './bulk-publish.component.html', @@ -31,6 +30,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit { creatTime: any; // 货源单设置回显 modifyTime: any; // 货源单设置回显 totalFees: any; // 总数信息 + totalDistance = 0.0; //总里程 + totalTime = 0.0; //路程总时间 id = this.route.snapshot.params.id; // // 单位 unit1 = '吨'; @@ -40,7 +41,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { endInfo: any = []; PageStatus = ''; dataList: any; - constructor(private http: _HttpClient, fb: FormBuilder, private router: Router, private route: ActivatedRoute, private modalService: NzModalService, public service: SupplyManagementService) { + constructor(private http: _HttpClient, fb: FormBuilder, private router: Router, private route: ActivatedRoute, private modalService: NzModalService, public service: SupplyManagementService, private amapService: AmapService, public service2: ShipperBaseService,) { this.validateForm1 = fb.group({ createTime: [null, []], modifyTime: [null, []], @@ -113,16 +114,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit { 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, + asyncData: () => this.service2.getEnterpriseProject(), } as SFSelectWidgetSchema }, enterpriseInfoName: { @@ -530,39 +523,47 @@ export class SupplyManagementBulkPublishComponent implements OnInit { console.log(res) }) } - // 打开地图 - openMap(type: string, index: number) { - const modalRef = this.modalService.create({ - nzTitle: '', - nzContent: AmapPoiPickerComponent, - nzWidth: 900, - nzOnOk: item => { - const poi = item.poi; - console.log(item.poi); - const locList = poi.location.toString().split(','); - switch (type) { - case 'start': - this.startInfo[index].detailedAddress = poi.district + poi.name; - this.startInfo[index].longitude = locList[0]; - this.startInfo[index].latitude = locList[1]; - this.startInfo[index].province = poi.cityInfo.province; - this.startInfo[index].city = poi.cityInfo.city; - this.startInfo[index].area = poi.cityInfo.district; - break; - case 'end': - this.endInfo[index].detailedAddress = poi.district + poi.name; - this.endInfo[index].longitude = locList[0]; - this.endInfo[index].latitude = locList[1]; - this.endInfo[index].province = poi.cityInfo.province; - this.endInfo[index].city = poi.cityInfo.city; - this.endInfo[index].area = poi.cityInfo.district; - break; - default: - break; - } + // 打开地图 + openMap(type: string, index: number) { + const modalRef = this.modalService.create({ + nzTitle: '', + nzContent: AmapPoiPickerComponent, + nzWidth: 900, + nzOnOk: item => { + const poi = item.poi; + const locList = poi.location.toString().split(','); + switch (type) { + case 'start': + this.startInfo[index].detailedAddress = poi.district + poi.name; + this.startInfo[index].longitude = locList[0]; + this.startInfo[index].latitude = locList[1]; + this.startInfo[index].province = poi.cityInfo.province; + this.startInfo[index].city = poi.cityInfo.city; + this.startInfo[index].area = poi.cityInfo.district; + this.startInfo[index].address = poi.name; + break; + case 'end': + this.endInfo[index].detailedAddress = poi.district + poi.name; + this.endInfo[index].longitude = locList[0]; + this.endInfo[index].latitude = locList[1]; + this.endInfo[index].province = poi.cityInfo.province; + this.endInfo[index].city = poi.cityInfo.city; + this.endInfo[index].area = poi.cityInfo.district; + this.endInfo[index].address = poi.name; + break; + default: + break; } - }); - } + + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => { + this.totalDistance = res.distance; + this.totalTime = res.time; + }); + } + } + }); +} goBack() { window.history.go(-1); } @@ -662,19 +663,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit { goodsName: res?.goodsInfoVOList[0]?.goodsName || '', } this.sf4data = { - // weight: res?.goodsInfoVOList[0]?.weight || '', - // volume: res?.goodsInfoVOList[0]?.volume || '', - // vehicleDemand: res?.goodsInfoVOList[0]?.vehicleDemand || '', - // maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') || '', - // maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') || '', - // number: res?.goodsInfoVOList[0]?.number || '', - // goodsType: res?.goodsInfoVOList[0]?.goodsType || '', - // modifyTime: res?.goodsInfoVOList[0]?.modifyTime || '', - // modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId || '', - // resourceId: res?.goodsInfoVOList[0]?.resourceId || '', - // rule: res?.goodsInfoVOList[0]?.rule || '', - // settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis || '', - freightPrice: res?.goodsInfoVOList[0]?.freightPrice || '', freightType: res?.goodsInfoVOList[0]?.freightType || '', rule: res?.goodsInfoVOList[0]?.rule || '', 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 e09c9514..e72a22af 100644 --- a/src/app/routes/supply-management/components/bulk/bulk.component.ts +++ b/src/app/routes/supply-management/components/bulk/bulk.component.ts @@ -3,6 +3,7 @@ import { Router } from '@angular/router'; import { STColumn, STComponent } from '@delon/abc/st'; import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; import { ModalHelper, _HttpClient } from '@delon/theme'; +import { ShipperBaseService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; import { map } from 'rxjs/operators'; import { SupplyManagementService } from '../../services/supply-management.service'; @@ -33,7 +34,7 @@ export class SupplyManagementBulkComponent implements OnInit { receivedQuantity: 0, stayQuantity: 0 }; - constructor(public service: SupplyManagementService, private modal: NzModalService, private router: Router) { } + constructor(public service: SupplyManagementService, private modal: NzModalService, private router: Router,public service2: ShipperBaseService) { } ngOnInit(): void { this.initSF(); @@ -134,7 +135,7 @@ export class SupplyManagementBulkComponent implements OnInit { _$expand: (value: boolean) => value, }, allowClear: true, - asyncData: () => this.getCatalogueMember(), + asyncData: () => this.service2.getEnterpriseProject(), }, }, no4: { 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 ae9b3949..b11b0eec 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 @@ -11,7 +11,9 @@ -
装卸货信息预计公里数:-km,预计行程耗时:-小时
+
装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
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 44843ba1..3ed4b0de 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 @@ -10,7 +10,7 @@ import { SFUISchema } from '@delon/form'; import { _HttpClient } from '@delon/theme'; -import { AmapPoiPickerComponent } from '@shared'; +import { AmapPoiPickerComponent,AmapService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component'; import { SupplyManagementService } from '../../services/supply-management.service'; @@ -35,6 +35,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { loadingTime: any; // 货源单设置回显 unloadingTime: any; // 货源单设置回显 totalFees: any; // 总数信息 + totalDistance = 0.0; //总里程 + totalTime = 0.0; //路程总时间 npp =false id = this.route.snapshot.params.id; // // 单位 @@ -45,7 +47,15 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { endInfo: any = []; PageStatus = ''; dataList: any; - constructor(private http: _HttpClient, fb: FormBuilder, private router: Router, private route: ActivatedRoute, private modalService: NzModalService, public service: SupplyManagementService) { + constructor( + private http: _HttpClient, + fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: SupplyManagementService, + private amapService: AmapService + ) { this.validateForm1 = fb.group({ loadingTime: [null, []], unloadingTime: [null, []], @@ -676,39 +686,47 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } }) } - // 打开地图 - openMap(type: string, index: number) { - const modalRef = this.modalService.create({ - nzTitle: '', - nzContent: AmapPoiPickerComponent, - nzWidth: 900, - nzOnOk: item => { - const poi = item.poi; - console.log(item.poi); - const locList = poi.location.toString().split(','); - switch (type) { - case 'start': - this.startInfo[index].detailedAddress = poi.district + poi.name; - this.startInfo[index].longitude = locList[0]; - this.startInfo[index].latitude = locList[1]; - this.startInfo[index].province = poi.cityInfo.province; - this.startInfo[index].city = poi.cityInfo.city; - this.startInfo[index].area = poi.cityInfo.district; - break; - case 'end': - this.endInfo[index].detailedAddress = poi.district + poi.name; - this.endInfo[index].longitude = locList[0]; - this.endInfo[index].latitude = locList[1]; - this.endInfo[index].province = poi.cityInfo.province; - this.endInfo[index].city = poi.cityInfo.city; - this.endInfo[index].area = poi.cityInfo.district; - break; - default: - break; - } + // 打开地图 + openMap(type: string, index: number) { + const modalRef = this.modalService.create({ + nzTitle: '', + nzContent: AmapPoiPickerComponent, + nzWidth: 900, + nzOnOk: item => { + const poi = item.poi; + const locList = poi.location.toString().split(','); + switch (type) { + case 'start': + this.startInfo[index].detailedAddress = poi.district + poi.name; + this.startInfo[index].longitude = locList[0]; + this.startInfo[index].latitude = locList[1]; + this.startInfo[index].province = poi.cityInfo.province; + this.startInfo[index].city = poi.cityInfo.city; + this.startInfo[index].area = poi.cityInfo.district; + this.startInfo[index].address = poi.name; + break; + case 'end': + this.endInfo[index].detailedAddress = poi.district + poi.name; + this.endInfo[index].longitude = locList[0]; + this.endInfo[index].latitude = locList[1]; + this.endInfo[index].province = poi.cityInfo.province; + this.endInfo[index].city = poi.cityInfo.city; + this.endInfo[index].area = poi.cityInfo.district; + this.endInfo[index].address = poi.name; + break; + default: + break; } - }); - } + + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => { + this.totalDistance = res.distance; + this.totalTime = res.time; + }); + } + } + }); +} goBack() { window.history.go(-1); } 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 66ece886..29ef0b96 100644 --- a/src/app/routes/supply-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts @@ -23,6 +23,7 @@ export class SupplyManagementVehicleComponent implements OnInit { auditMany = false; isVisible = false; _$expand = false; + @ViewChild('st') private readonly st!: STComponent; @ViewChild('sf', { static: false }) sf!: SFComponent; @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; diff --git a/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.ts b/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.ts index fa58df22..9e8c54da 100644 --- a/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.ts +++ b/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.ts @@ -46,7 +46,8 @@ export class AmapPoiPickerComponent implements OnInit { 'AMap.PoiPicker', 'AMap.Scale', 'AMap.InfoWindow', - 'AMap.Geolocation' + 'AMap.Geolocation', + 'AMap.Geocoder' ], AMapUI: { // 是否加载 AMapUI,缺省不加载 @@ -110,11 +111,18 @@ export class AmapPoiPickerComponent implements OnInit { infoWindow.setContent(`地址:
${poi.name}
`); infoWindow.open(map, marker.getPosition()); - map.setCenter(marker.getPosition()); - //获取行政区信息 - map.getCity(function (info: any) { - poi.cityInfo = info; + //获取地址所在的行政区 + AMap.plugin('AMap.Geocoder', () => { + var geocoder = new AMap.Geocoder({ + city: poi.adcode + }); + geocoder.getLocation(poi.name, (status: any, result: any) => { + if (status === 'complete' && result.info === 'OK') { + // result中对应详细地理坐标信息 + this.poi.cityInfo = result.geocodes[0].addressComponent; + } + }); }); }); diff --git a/src/app/shared/components/amap/amap.service.ts b/src/app/shared/components/amap/amap.service.ts index b65e03c6..0cc02256 100644 --- a/src/app/shared/components/amap/amap.service.ts +++ b/src/app/shared/components/amap/amap.service.ts @@ -1,9 +1,31 @@ import { Injectable } from '@angular/core'; - +import { Observable, Subject } from 'rxjs'; +declare var AMap: any; @Injectable({ providedIn: 'root' }) export class AmapService { + constructor() {} + public length = 0; + public time = 0; - constructor() { } + sub = new Subject(); + + //计算路径驾车最优路线的长度与所需时间 + drivingCompute(starts: any[], ends: any[]): Observable { + AMap.plugin('AMap.Driving', () => { + let driving = new AMap.Driving({ + // 驾车路线规划策略,AMap.DrivingPolicy.LEAST_TIME是最快捷模式 + policy: AMap.DrivingPolicy.LEAST_TIME + }); + const points = starts.concat(ends).map(item => { + return { keyword: item.address, city: item.city }; + }); + driving.search(points, (status: any, result: any) => { + const repData = { distance: (result.routes[0].distance / 1000).toFixed(2), time: (result.routes[0].time / 60 / 60).toFixed(2) }; + this.sub.next(repData); + }); + }); + return this.sub; + } } diff --git a/src/app/shared/services/business/shipper-base.service.ts b/src/app/shared/services/business/shipper-base.service.ts new file mode 100644 index 00000000..4817a318 --- /dev/null +++ b/src/app/shared/services/business/shipper-base.service.ts @@ -0,0 +1,105 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '../core/base.service'; +import { map } from 'rxjs/operators'; + +@Injectable({ + providedIn: 'root' +}) +export class ShipperBaseService extends BaseService { + $api_get_carless_carrier = ``; // 获取承运人 + $api_get_enterprise_project = `/api/mdc/cuc/enterpriseProject/getEnterpriseProjectList `; // 所属项目列表 + $api_get_staff_list = `/api/mdc/cuc/userApp/getStaffList`; //查询企业项目员工列表(录单员) + $api_get_network_freight_forwarder = ``; // 获取网络货运人 + + + constructor(public injector: Injector) { + super(injector); + } + + /** + * 获取无车承运人 + * @returns + */ + getCarlessCarrier() { + return + const params = { + }; + return this.request(this.$api_get_carless_carrier, params, 'POST').pipe( + map((res) => { + if (res) { + res.map((m: any) => { + return { label: m.platformName, value: m.operationId }; + }); + } + }), + ); + } + + + /** + * 获取所属项目 + * @returns + */ + getEnterpriseProject(params = {}) { + return this.request(this.$api_get_enterprise_project, params).pipe( + map((res: any) => { + if (!res) { + return []; + } + const list = res.map(((item: any) => { + return { + label: item.projectName, + value: item.enterpriseId + } + })) + const obj = [{ value: '', label: '全部' }]; + return [...obj, ...list]; + }) + ) + } + + /** + * 获取录单员 + * @returns + */ + getStaffList(params = {}) { + return this.request(this.$api_get_staff_list, params).pipe( + map((res: any) => { + if (!res) { + return []; + } + const list = res.map(((item: any) => { + return { + label: item.name, + value: item.userId + } + })) + const obj = [{ value: '', label: '全部' }]; + return [...obj, ...list]; + }) + ) + } + + /** + * 获取网络货运人 + * @returns + */ + getNetworkFreightForwarder(params = {}) { + return this.request(this.$api_get_network_freight_forwarder, params).pipe( + map((res: any) => { + if (!res) { + return []; + } + const list = res.map(((item: any) => { + return { + label: item.name, + value: item.userId + } + })) + const obj = [{ value: '', label: '全部' }]; + return [...obj, ...list]; + }) + ) + } + +} diff --git a/src/app/shared/services/index.ts b/src/app/shared/services/index.ts index a20ef675..292583f6 100644 --- a/src/app/shared/services/index.ts +++ b/src/app/shared/services/index.ts @@ -1,3 +1,11 @@ +/* + * @Author: your name + * @Date: 2021-12-07 16:27:52 + * @LastEditTime: 2021-12-14 21:09:21 + * @LastEditors: your name + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\shared\services\index.ts + */ // Core export * from './core/base.service'; export * from './core/cache.service'; @@ -12,4 +20,5 @@ export * from './business/user.service'; export * from './business/sl-platform.service'; export * from './business/user.service'; export * from './business/environment.service'; +export * from './business/shipper-base.service';