From 23fdddcd348333f930cedc16a10a142a49e99b4e Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 6 Jan 2022 14:47:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../add-drivers/add-drivers.component.html | 39 ++--- .../add-drivers/add-drivers.component.ts | 142 +++++++----------- .../vehicle-detail.component.html | 16 +- 3 files changed, 81 insertions(+), 116 deletions(-) diff --git a/src/app/routes/supply-management/components/add-drivers/add-drivers.component.html b/src/app/routes/supply-management/components/add-drivers/add-drivers.component.html index bb71bd4f..1b645ddd 100644 --- a/src/app/routes/supply-management/components/add-drivers/add-drivers.component.html +++ b/src/app/routes/supply-management/components/add-drivers/add-drivers.component.html @@ -1,29 +1,14 @@ - -
-
-
-
- -
- -
- -
-
-
- +
+
+
+ + +
- - -
- -
-
- - -
-
\ No newline at end of file +
+ + +
+ +
diff --git a/src/app/routes/supply-management/components/add-drivers/add-drivers.component.ts b/src/app/routes/supply-management/components/add-drivers/add-drivers.component.ts index cef91e31..da816bfe 100644 --- a/src/app/routes/supply-management/components/add-drivers/add-drivers.component.ts +++ b/src/app/routes/supply-management/components/add-drivers/add-drivers.component.ts @@ -1,7 +1,8 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { STColumn, STColumnButton, STComponent, STData } from '@delon/abc/st'; -import { SFSchema, SFUISchema } from '@delon/form'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalRef } from 'ng-zorro-antd/modal'; import { SupplyManagementService } from '../../services/supply-management.service'; @Component({ @@ -11,41 +12,29 @@ import { SupplyManagementService } from '../../services/supply-management.servic export class SupplyManagementAddDriversComponent implements OnInit { url = `/user?_allow_anonymous=true`; i: any; - searchSchema: SFSchema = { - properties: { - no: { - type: 'string', - title: '编号' - } - } - }; + searchSchema: SFSchema = {}; @ViewChild('st') private readonly st!: STComponent; - @ViewChild('selectedST') private readonly selectedST!: STComponent; - ui: SFUISchema = { - - } + @ViewChild('sf') sf!: SFComponent; + ui: SFUISchema = {} columns: STColumn[] = []; - selectedColumn: STColumn[] = []; isVisible = false; - addCarSchema: SFUISchema = { - properties: { - mobile: { - type: 'string', - title: '司机手机号', - ui: { - placeholder: '请输入' - } - }, - } - }; - - constructor(public service: SupplyManagementService, private modal: ModalHelper) { } + diverList: object[] = []; + dirvierInfo: any = {}; + constructor(public service: SupplyManagementService, private modal: NzModalRef) { } ngOnInit(): void { this.initSF(); this.initST(); } + /** +* 查询参数 +*/ + get reqParams() { + return { + ...this.sf?.value + }; + } /** * 初始化查询表单 */ @@ -54,16 +43,9 @@ export class SupplyManagementAddDriversComponent implements OnInit { properties: { mobile: { type: 'string', - title: '', + title: '车队长手机号', ui: { - placeholder: '请输入司机姓名/手机号' - } - }, - no: { - type: 'string', - title: '', - ui: { - placeholder: '请输入车牌号' + placeholder: '请输入' } }, }, @@ -78,23 +60,14 @@ export class SupplyManagementAddDriversComponent implements OnInit { initST() { this.columns = [ { - title: '司机姓名', + title: '司机头像', width: '100px', className: 'text-center', - render: 'goodsId' + index: 'avatar', + type: 'img', }, - { title: '手机号', render: 'externalSn', width: '120px', className: 'text-center' }, - { title: '货源类型', index: 'linkUrl', width: '120px', className: 'text-center' }, - { - title: '车牌号', - className: 'text-center', - width: '120px', - }, { - title: '状态', - className: 'text-center', - width: '120px', - }, - + { title: '司机姓名', index: 'name', width: '120px', className: 'text-center' }, + { title: '实名认证状态', index: 'linkUrl', width: '120px', className: 'text-center' }, { title: '操作', fixed: 'right', @@ -102,51 +75,46 @@ export class SupplyManagementAddDriversComponent implements OnInit { className: 'text-center', buttons: [ { - text: '选择', - iif: (item: STData, btn: STColumnButton, column: STColumn) => item?.status > 0, - iifBehavior: 'disabled' - // click: (_record) => this.editOne(_record), - }, - ], - }, - ]; - this.selectedColumn = [ - { - title: '司机姓名', - width: '100px', - className: 'text-center', - render: 'goodsId' - }, - { title: '手机号', render: 'externalSn', width: '120px', className: 'text-center' }, - { title: '车牌号', index: 'linkUrl', width: '120px', className: 'text-center' }, - { - title: '操作', - fixed: 'right', - width: '200px', - className: 'text-center', - buttons: [ - { - text: '移除', - // click: (_record) => this.editOne(_record), + text: '设置', + click: (_record) => this.addCaptain(_record) + // iif: (item: STData, btn: STColumnButton, column: STColumn) => item?.status > 0, }, ], }, ]; } + + + search() { + this.getDriverList(); + } + + + getDriverList() { + this.service.request(this.service.$api_get_car_captain_by_mobile, { ...this.sf?.value }).subscribe((res: any) => { + this.diverList = []; + if (res.userId) { + this.diverList.push(res); + } + // this.st.reload(); + }) + } + + /** - * 添加熟车 + * */ - add(): void { - this.isVisible = true; - } - - handleCancel() { - this.isVisible = false; - } - - handleOk() { - + addCaptain(item: any) { + this.modal.close(item); // 虚设置车队长 + // const { appUserId: carCaptain } = item; + // const { appUserId } = this.dirvierInfo; + // this.service.request(this.service.$api_add_car_caption, { carCaptain, appUserId }).subscribe(res => { + // if (res) { + // this.service.msgSrv.success('设置成功'); + // this.modal.close(true); + // } + // }) } } diff --git a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html index 6c167589..fca39472 100644 --- a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html @@ -137,12 +137,24 @@
-
+
+
+

+ + + {{(i?.totalAmount) | currency: '¥'}} + + (运费{{i?.totalFreight | currency: '¥'}}含附加运费 {{i?.totalSurcharge| currency: '¥' }}) +

+
收款人:曹济发 / 18211579566 / 621483****6368
+
+
+ From c83c1e7a8e2eaa5356d0a47ec2af7ff5d5e2f076 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 6 Jan 2022 14:57:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assigned-car/assigned-car.component.html | 8 ++++++++ .../assigned-car/assigned-car.component.ts | 2 +- .../vehicle-detail/vehicle-detail.component.ts | 13 +++++-------- .../components/vehicle/vehicle.component.ts | 17 ++++++++++------- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html index ec9bc1ca..d7f2f471 100644 --- a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html +++ b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html @@ -1,3 +1,11 @@ +
diff --git a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts index adde5b77..da0b8757 100644 --- a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts +++ b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts @@ -117,7 +117,7 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit { if (this.selectedRows) { const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows; const params: any = { carId, driverId, carCaptainId }; - this.service.request(this.service.$api_save_assign_bulk, { ...params, ...this.params }).subscribe((res: any) => { + this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => { if (res) { this.modal.close(res); } diff --git a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts index da8237a1..a1529c26 100644 --- a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts +++ b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts @@ -143,21 +143,18 @@ export class SupplyManagementVehicleDetailComponent implements OnInit { /** * 重新指派 */ - assignedCar(item: any) { - const { resourceId } = item; + assignedCar(item: any) { const modalRef = this.modal.create({ nzTitle: '指派熟车', nzWidth: '1200px', - nzContent: SupplyManagementVehicleAssignedCarComponent, + nzContent: SupplyManagementVehicleAssignedCarComponent, nzComponentParams: { i: item, - status: 'anew', - url: this.service.$api_save_assign_vehicle, - params: { resourceId } }, - nzFooter: null + nzFooter: null, + }); - modalRef.afterClose.subscribe(result => { + modalRef.afterClose.subscribe((result) => { if (result) { this.getGoodsSourceDetail(); } 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 43fc8e88..bcbd8c05 100644 --- a/src/app/routes/supply-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts @@ -157,27 +157,30 @@ export class SupplyManagementVehicleComponent implements OnInit { /** * 重新指派 */ - assignedCar(item: any) { - const { resourceId } = item; + /** + * 重新指派 + */ + assignedCar(item: any) { + const { id } = item; const modalRef = this.modal.create({ nzTitle: '指派熟车', nzWidth: '1200px', - nzContent: SupplyManagementVehicleAssignedCarComponent, + nzContent: SupplyManagementVehicleAssignedCarComponent, nzComponentParams: { i: item, status: 'anew', + params: { id }, url: this.service.$api_save_assign_vehicle, - params: { resourceId } }, - nzFooter: null + nzFooter: null, + }); - modalRef.afterClose.subscribe(result => { + modalRef.afterClose.subscribe((result) => { if (result) { this.st.reload(); } }); } - /** * 审核 */ From bfcbe348b6dae2ee6eb5a9ab5642223c54b1f1e8 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 6 Jan 2022 16:14:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onecar-publish.component.html | 18 +- .../onecar-publish.component.ts | 84 ++++-- .../release-publish.component.html | 2 +- .../release-publish.component.ts | 266 +++++++++++------- .../tran-agreement.component.html | 7 + .../tran-agreement.component.less | 0 .../tran-agreement.component.ts | 21 ++ .../services/supply-management.service.ts | 8 +- .../supply-management.module.ts | 7 +- 9 files changed, 272 insertions(+), 141 deletions(-) create mode 100644 src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.html create mode 100644 src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.less create mode 100644 src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts 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 904c233e..76a66709 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 @@ -32,8 +32,8 @@ /> + > @@ -44,12 +44,12 @@ 联系人
- +
@@ -82,8 +82,8 @@ /> + >
@@ -92,12 +92,12 @@ 联系人
- +
@@ -282,7 +282,7 @@
- + 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 9ae84146..fb22998d 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 @@ -20,6 +20,8 @@ import { PublishAddressListComponent } from './address-list/address-list.compone import { PublishSuccessComponent } from './publish-success/publish-success.component'; import { map } from 'rxjs/operators'; import { of } from 'rxjs'; +import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component'; +import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component'; @Component({ selector: 'app-publish-goods-onecar-publish', templateUrl: './onecar-publish.component.html', @@ -694,29 +696,63 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.validateForm1.removeControl(`unloadPhone${index}`); } - //指派熟车 - chooseFamifiar() { - this.modalService.create({ + //指派熟车 + chooseFamifiar(item: any) { + console.log('999') + const modalRef = this.modalService.create({ nzTitle: '指派熟车', - nzContent: PublishGoodsChooseFamifiarComponent, - nzWidth: 1300 + nzContent: SupplyManagementVehicleAssignedCarComponent, + nzWidth: 1200, + nzComponentParams: { + status: 'new', + url: this.service.$api_save_assign_whole, + params: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.openFinishPage(result); + } }); } - submit(): void { + // 打开下单完成页面 + openFinishPage(resourceObj: any = null) { + this.modalService.create({ + nzTitle: '', + nzContent: PublishSuccessComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { type: 'onecar', resourceObj } + }); + } + // 提交前确认,委托运输协议弹窗 + submitConfirm(submitType?: any) { + const modalRef = this.modalService.create({ + nzTitle: '运输协议', + nzContent: TranAgreementComponent, + nzWidth: 900, + nzFooter: null + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.submit(submitType); + } + }); + } + submit(submitType?: string): void { console.log('进来了'); - console.log(this.startInfo); - // Object.keys(this.validateForm1.controls).forEach(key => { - // this.validateForm1.controls[key].markAsDirty(); - // this.validateForm1.controls[key].updateValueAndValidity(); - // }); - // this.sf1.validator({ emitError: true }); - // this.sf3.validator({ emitError: true }); - // this.sf4.validator({ emitError: true }); - // this.sf6.validator({ emitError: true }); - // if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) { - // return; - // } - console.log(this.validateForm1.value); + Object.keys(this.validateForm1.controls).forEach(key => { + this.validateForm1.controls[key].markAsDirty(); + this.validateForm1.controls[key].updateValueAndValidity(); + }); + this.sf3.validator({ emitError: true }); + this.sf4.validator({ emitError: true }); + this.sf6.validator({ emitError: true }); + this.sf7.validator({ emitError: true }); + if (this.validateForm1.invalid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) { + return; + } if (typeof this.validateForm1.value.unloadingTime !== 'string') { var c = new Date(this.validateForm1.value.unloadingTime); this.validateForm1.value.unloadingTime = @@ -747,10 +783,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { ':' + this.addPreZero(c.getSeconds()); } - // if (this.validateForm1.invalid) { - // return; - // } - console.log(this.sf7.value) const params: any = { ...this.sf1.value, ...this.sf5.value, @@ -773,6 +805,12 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { totalFees: this.totalFees }; console.log(params); + if(submitType) { + if (submitType == 'assign') { + this.chooseFamifiar(params); + return; + } + } if (this.PageStatus === '整车修改') { this.requests(this.service.$api_set_WholeModify, params); } else if (this.PageStatus === '整车下一单') { 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 8c11ff2d..e44f401a 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 @@ -313,7 +313,7 @@
- + +
\ No newline at end of file diff --git a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.less b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts new file mode 100644 index 00000000..624c3033 --- /dev/null +++ b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts @@ -0,0 +1,21 @@ +import { Component } from '@angular/core'; +import { NzModalRef } from 'ng-zorro-antd/modal'; + +@Component({ + selector: 'publish-goods-tran-agreement', + templateUrl: './tran-agreement.component.html', + styleUrls: ['./tran-agreement.component.less'] +}) +export class TranAgreementComponent { + + + constructor(private modal: NzModalRef) { + + } + + handleOk(){ + this.modal.close(true); + } + + +} 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 73791b95..c71e6fb9 100644 --- a/src/app/routes/supply-management/services/supply-management.service.ts +++ b/src/app/routes/supply-management/services/supply-management.service.ts @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-12-03 11:10:14 - * @LastEditTime: 2022-01-05 16:45:24 + * @LastEditTime: 2022-01-06 15:32:50 * @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\supply-management\services\supply-management.service.ts @@ -63,7 +63,13 @@ export class SupplyManagementService extends BaseService { $api_get_goods_resource_shipper = `/api/sdc/goodsResourceShipper/modifyPricePre`; // 修改单价页面根据货源ID获取货物表 $api_get_car_captain_by_mobile = `/api/mdc/userDriverExpand/getCarCaptainByMobile`; // 查询车队长或者司机列表 $api_save_assign_vehicle = `/api/sdc/goodsResourceShipper/reAssignWhole`;// 货主端大宗货源重新指派 + $api_save_assign_bulk = `/api/sdc/goodsResourceShipper/reAssignBulk`; // 货主端大宗货源指派熟车 + // 货主端大宗货源指派熟车 + $api_save_assign_whole = `/api/sdc/goodsResourceShipper/saveWholeAssign`; + // 货主端大宗货源指派熟车 + $api_save_bulk_assign = `/api/sdc/goodsResourceShipper/saveBulkAssign`; + $api_get_has_assigned_car_list = `/api/sdc/goodsResourceShipper/getCarDriverIdsByResourceId`;// 大宗货源根据货源id获取司机和车辆的id集合 // 根据手机号查询车队长/司机 diff --git a/src/app/routes/supply-management/supply-management.module.ts b/src/app/routes/supply-management/supply-management.module.ts index cbcc0a68..ea6c57b9 100644 --- a/src/app/routes/supply-management/supply-management.module.ts +++ b/src/app/routes/supply-management/supply-management.module.ts @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-12-03 11:10:14 - * @LastEditTime: 2021-12-28 20:31:23 + * @LastEditTime: 2022-01-06 15:01:57 * @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\supply-management\supply-management.module.ts @@ -31,6 +31,7 @@ import { CarAddmodalComponent } from './components/addmodal/addmodal.component'; import { SupplyManagementBulkDetailComponent } from './components/bulk-detail/bulk-detail.component'; import { SupplyManagementReleasePublishComponent } from './components/release-publish/release-publish.component'; import { SupplyManagementBulkReleasePublishComponent } from './components/bulk-release-publish/bulk-release-publish.component'; +import { TranAgreementComponent } from './components/tran-agreement/tran-agreement.component'; const COMPONENTS: Type[] = [ @@ -55,7 +56,9 @@ const COMPONENTS: Type[] = [ CarAddmodalComponent, SupplyManagementBulkDetailComponent, SupplyManagementReleasePublishComponent, - SupplyManagementBulkReleasePublishComponent + SupplyManagementBulkReleasePublishComponent, + TranAgreementComponent + ]; @NgModule({