From e66779ecb3cb6c951139fd7d92fcb39bd003ec29 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Wed, 2 Mar 2022 14:29:37 +0800 Subject: [PATCH 01/11] fix bug --- .../choose-famifiar.component.html | 58 ++++------ .../choose-famifiar.component.ts | 108 ++++++++++++++---- .../set-captain/set-captain.component.ts | 19 ++- .../services/supply-management.service.ts | 4 +- 4 files changed, 121 insertions(+), 68 deletions(-) diff --git a/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.html b/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.html index df51267d..016d7031 100644 --- a/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.html +++ b/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.html @@ -4,48 +4,35 @@ * @Author : Shiming * @Date : 2022-01-12 10:52:50 * @LastEditors : Shiming - * @LastEditTime : 2022-01-18 17:27:53 + * @LastEditTime : 2022-03-02 14:27:20 * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\choose-famifiar\\choose-famifiar.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> - - +
-
-
-
- -
-
- - -
-
+
+ +
+
+ +
- + [loadingDelay]="500" [loading]="service.http.loading" [widthMode]="{ type: 'strict' }" [scroll]="{ x: '600px' }" + style="margin-top: 22px"> - + @@ -53,21 +40,18 @@
已选择{{ st2Data.length }}位司机
- + {{ item.captainName }} {{ item.captainPhone }}   设置 + + {{item.default?.carNo}} +
diff --git a/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts b/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts index f73d3461..d2f126d1 100644 --- a/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts +++ b/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts @@ -3,7 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; import { ModalHelper } from '@delon/theme'; -import { processSingleSort } from '@shared'; +import { EAEnvironmentService, processSingleSort } from '@shared'; import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer'; import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; import { SupplyManagementAddDriversComponent } from 'src/app/routes/supply-management/components/add-drivers/add-drivers.component'; @@ -37,7 +37,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { submitUrl = ''; @Input() - submitParams = {}; + submitParams:any; constructor( private modal: NzModalRef, @@ -47,8 +47,8 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { public service: SupplyManagementService, private modalService: NzModalService, private modalHelper: ModalHelper, - private cdr: ChangeDetectorRef - ) {} + private envSrv: EAEnvironmentService + ) { } /** * 查询参数 @@ -61,26 +61,23 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { } ngOnInit() { this.initSF(); - - setTimeout(() => { - this.initST(); - this.initST2(); - }, 200); + this.initST(); + this.initST2(); } initSF() { this.schema = { properties: { - name: { + nameOrPhone: { type: 'string', - title: '', + title: '承运司机', ui: { placeholder: '请输入司机姓名/手机号' } }, - name2: { + carNo: { type: 'string', - title: '', + title: '车牌号', ui: { placeholder: '请输入车牌号' } @@ -98,13 +95,11 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { this.columns = [ { title: '司机姓名', - index: 'name', - width: 120 + index: 'name' }, { title: '手机号', - index: 'telephone', - width: 120 + index: 'telephone' }, { title: '指定车辆', @@ -115,7 +110,6 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { title: '状态', className: 'text-center', index: 'certificationStatus', - width: 120, type: 'badge', badge: { '-1': { text: '未提交', color: 'default' }, @@ -127,12 +121,11 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { { title: '操作', className: 'text-center', - width: 80, buttons: [ { text: '选择', iif: item => item.showChoose != false, - click: (_record, _modal, _instance) => this.choose(_record), + click: (_record, _modal, _instance) => this.verifyVechicleStatus(_record), iifBehavior: 'disabled' } ] @@ -145,7 +138,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { { title: '司机姓名', index: 'name', - width: 120 + width: '90px' }, { title: '手机号', @@ -155,17 +148,17 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { { title: '车队长', render: 'captain', - width: '100px' + width: '200px' }, { title: '指定车辆', - index: 'carNo', + render: 'defaultCar', width: '130px' }, { title: '操作', className: 'text-center', - width: 80, + width: '90px', buttons: [ { text: '移除', @@ -198,6 +191,23 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { }); } + /** + * 校验司机是否能设置车队长 + * @param item 当前对象 + */ + verifyCanSetCarCaptain(item: any, index: any) { + this.service.request(this.service.$api_get_sys_config, [{ itemKey: 'sys.config.shipper.setCarCaptain', businessId: this.envSrv.env.enterpriseId }]).subscribe(res => { + if (res && res.length > 0) { + const { itemValue } = res[0]; + if (itemValue !== '1') { + this.service.msgSrv.error('不可设置车队长!'); + return; + } + this.setCaptain(item, index); + } + }) + } + //设置车队长 setCaptain(record: STData, index: any) { this.modalHelper @@ -260,5 +270,53 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { }); } - carChange(event: any, item: STData) {} + carChange(event: any, item: STData) { + + } + + /** + * 验证车辆的状态 + */ + verifyVechicleStatus(_record: STData) { + const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = _record; + const carInfo: any = { carId, driverId, carCaptainId }; + const goodsInfoList = this.submitParams?.goodsInfoList; + this.service.request(this.service.$api_verify_vehicle_status, { ...carInfo, goodsInfoList }).subscribe((res: any) => { + if (res) { + const { title, alert, subContent, content } = res; + switch (alert) { + case 'Error': + this.error(title, content, subContent); + break; + case 'Warn': + this.showConfirm(_record, title, content, subContent); + break; + case 'Success': + this.choose(_record); + break; + } + } + }); + + } + + error(title: string, content: string, subContent: string): void { + this.modalService.error({ + nzTitle: title, + nzContent: `${content ? content : ''}${subContent ? subContent : ''}`, + nzOkText: '知道了' + }); + } + + showConfirm(_record: STData, title: string, content: string, subContent: string): void { + this.modalService.confirm({ + nzTitle: title, + nzContent: `${content ? content : ''}${subContent ? subContent : ''}`, + nzOkText: '继续', + nzCancelText: '取消', + nzOnOk: () => { + this.choose(_record); + } + }); + } } diff --git a/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts b/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts index cf3b2b56..395a7514 100644 --- a/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts +++ b/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts @@ -1,3 +1,13 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-06 15:17:52 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-02 14:29:12 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\choose-famifiar\\set-captain\\set-captain.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { SFComponent, SFSchema, SFSchemaEnumType, SFUISchema } from '@delon/form'; @@ -16,7 +26,7 @@ export class PublishchooseFamifiarSetCaptainComponent implements OnInit { i: any; - constructor(public http: _HttpClient, private cdr: ChangeDetectorRef, private route: ActivatedRoute) {} + constructor(public http: _HttpClient, private cdr: ChangeDetectorRef, private route: ActivatedRoute, private modal: NzModalRef,) {} ngOnInit(): void { this.initSF(); @@ -24,12 +34,11 @@ export class PublishchooseFamifiarSetCaptainComponent implements OnInit { initSF() { this.schema = { properties: { - name: { + captainPhone: { type: 'string', title: '车队长手机号' } }, - required: ['name'] }; this.ui = { '*': { @@ -39,6 +48,6 @@ export class PublishchooseFamifiarSetCaptainComponent implements OnInit { }; } - close() {} - save() {} + close() {this.modal.close()} + save() {this.modal.close(this.sf.value.captainPhone)} } 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 78dd862e..303b6a46 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-03-02 10:10:18 + * @LastEditTime : 2022-03-02 14:27:18 * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\services\\supply-management.service.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -165,4 +165,6 @@ export class SupplyManagementService extends BaseService { public $api_getNetworkTransporter = '/api/mdc/cuc/enterpriseInfo/operate/getNetworkTransporter'; $api_verify_vehicle_status = `/api/sdc/goodsResourceShipper/saveVerify`;// 发布货源校验司机/车队长的状态 $api_get_sys_config = `/api/mdc/pbc/sysConfigItem/findConfigValues`; // 根据项key、业务id获取配置信息 + // 获取指派熟车列表 + $api_getListCars = '/api/mdc/cuc/enterpriseVehicle/getPracticeCarList'; } From ab6f1c68659063ed036577d898e4cfc7fe8ae608 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Wed, 2 Mar 2022 14:30:37 +0800 Subject: [PATCH 02/11] edit --- .../captain-detail.component.html | 111 ++++--------- .../captain-detail.component.ts | 7 +- .../driver/detail/detail.component.html | 2 +- .../driver/detail/detail.component.ts | 10 +- .../enterprise-audit/view/view.component.ts | 11 +- .../freight/user/detail/detail.component.ts | 11 +- .../usercenter/services/usercenter.service.ts | 11 +- .../audit/detail/detail.component.ts | 124 +++++++------- .../list/detail/detail.component.ts | 154 +++++++++--------- .../components/imagelist/image-list.module.ts | 5 +- .../imagelist/imagelist.component.html | 4 +- .../imagelist/imagelist.component.ts | 19 ++- src/app/shared/shared-zorro.module.ts | 6 +- 13 files changed, 232 insertions(+), 243 deletions(-) diff --git a/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html index c570f528..2e0189b6 100644 --- a/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html +++ b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html @@ -11,34 +11,17 @@
-

{{ userDetail?.name }} +

{{ userDetail?.name }}

- -
@@ -56,13 +39,12 @@
- 个人信息 -
@@ -118,27 +157,25 @@ - {{i?.insuranceTypeLabel}} + {{ i?.insuranceTypeLabel }} - {{i?.goodsValue |currency}} - - - {{i?.insurancePremium |currency}} 元 + {{ i?.goodsValue | currency }} + {{ i?.insurancePremium | currency }} 元 - - + +
- {{item?.totalAmount | currency}} + {{ item?.totalAmount | currency }} (含附加费)
- {{item?.price | currency}} + {{ item?.price | currency }}
@@ -147,9 +184,9 @@

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

收款人:{{ i?.payeeName }}/{{ i?.payeePhone }}/{{ i?.payeeCardNo }}
@@ -158,24 +195,23 @@ - {{i?.supplementaryInformationVO?.stateReceipt?'是':'否'}} + {{ i?.supplementaryInformationVO?.stateReceipt ? '是' : '否' }} {{ i?.supplementaryInformationVO?.receiptType === '1' ? '电子回单' : '纸质回单' }} - {{i?.supplementaryInformationVO?.area}} + {{ i?.supplementaryInformationVO?.area }} - {{i?.supplementaryInformationVO?.address}} + {{ i?.supplementaryInformationVO?.address }} - {{i?.supplementaryInformationVO?.remarks}} + {{ i?.supplementaryInformationVO?.remarks }} - - +
From 82c3801cc6ea10d8f6b895d85fe5553850672cea Mon Sep 17 00:00:00 2001 From: wangshiming Date: Wed, 2 Mar 2022 15:43:25 +0800 Subject: [PATCH 11/11] fix bug --- .../components/vehicle-detail/vehicle-detail.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f819e340..8d79823d 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 @@ -75,7 +75,7 @@ [nzStatus]="i?.resourceStatus === '1' ? 'wait' : 'finish'" nzIcon="file-done" [nzTitle]="'接单'" - [nzSubtitle]="i?.endTime" + [nzSubtitle]="i?.orderReceivingTime" >