diff --git a/src/app/routes/order-management/components/bulk/bulk.component.html b/src/app/routes/order-management/components/bulk/bulk.component.html index e7ff42e9..4c34c13c 100644 --- a/src/app/routes/order-management/components/bulk/bulk.component.html +++ b/src/app/routes/order-management/components/bulk/bulk.component.html @@ -1,7 +1,7 @@ - + - - - -
-
- - {{ i?.no }} - 待接单 - - - - + +
+

订单号: {{ i?.billCode }}

-
- - - +
+
+ + + + +
+
+
+ {{ i?.goodsInfoList[0].shipperAppUserName }} + {{i?.enterpriseProjectId}} + {{i?.createUserId}} + {{i?.dispatchName}} 18100000000 + {{i?.serviceTypeLabel}} +
+ + + +
+
+ + + +
- -
- {{ i?.owner }} - 32943898021309809423 - 3321944288191034921 - 18112345678 -
- -
-
-
-

装卸货信息

-

装货地:广东省深圳市龙岗区怡亚通大厦

-

联系人:奥利给/13680058545

-

卸货地:广东省深圳市福田区岗厦村9巷8号405(新村)

-

联系人:花花世界/13680058545

-

发货日期:广东省深圳市福田区岗厦村9巷8号405(新村)

-

卸货日期:花花世界/13680058545

-
-
-
-
-

货物信息

-

货物名称:广东省深圳市龙岗区怡亚通大厦

-

重量/体积:广东省深圳市福田区岗厦村9巷8号405(新村)

-

车型/车长:花花世界/13680058545

-
-
-
-
-

托运信息

-

公司名称:广东省深圳市龙岗区怡亚通大厦

-

联系人:广东省深圳市福田区岗厦村9巷8号405(新村)

-
-
-
-
-

承运信息

-

司机:广东省深圳市龙岗区怡亚通大厦

-

车牌号:广东省深圳市福田区岗厦村9巷8号405(新村)

-

车型/车长/承重:{{'拖车'}} | {{'4.5米'}} | {{'15吨'}}

-
-
-
-

补充信息

-

协议附件

-

装车附件

-

卸货附件

-

回单附件

-
-
- -
-
-

运费信息

-
-

{{400 | currency }}

-

{{400 | currency }}

-

{{400 | currency }}

-

{{400 | currency }}

-

{{400 | currency}}

-

{{400 | currency }}

-
-
- -
-
-

{{400 | currency }}

-

未支付

-
+ -
-
- -
-
-
- 司机运输费 - 1000.00 - 未支付 + +
+
+
+
+
+
+
+
+

装货地:{{item?.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}

+

联系人:{{item.appUserName}}/{{item.contractTelephone}}

+
+
+
+

装货时间:{{i?.loadingTime}}

+
-
-
-
- 司机运输费 - 1000.00 - 未支付 -
-
- 附加费 - 1000.00 - 未支付 +
+
+
+
+
+
+

卸货地:{{item?.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}

+

联系人:{{item.appUserName}}/{{item.contractTelephone}}

+
+
+
+

卸货时间:{{i?.unloadingTime}}

+
- - + + + + + {{i?.goodsName}} + + + {{i?.weight}}顿,{{i?.volume}}方,{{i?.number}}件 + + + + + {{i?.goodsName}} + + + {{i?.weight}}顿,{{i?.volume}}方,{{i?.number}}件 + + + {{i?.weight}}顿,{{i?.volume}}方,{{i?.number}}件 + + + {{i?.weight}}顿,{{i?.volume}}方,{{i?.number}}件 + + + + + + + + + + + + +
总计:{{i?.total | currency: '¥'}}(运费¥3500.00,附加运费¥191.98,附加费率3.5%)
+
收款人:
+
+ + + + + {{i?.supplementaryInformationVO?.stateReceipt?'是':'否'}} + + + + + {{i?.supplementaryInformationVO?.remarks}} + + + {{i?.supplementaryInformationVO?.remarks}} + + + + + + + {{i?.supplementaryInformationVO?.stateReceipt?'是':'否'}} + + + {{i?.supplementaryInformationVO?.receiptTypeLabel}} + + + {{i?.supplementaryInformationVO?.receiptUserName}} / {{i?.supplementaryInformationVO?.phon}} + + + {{i?.supplementaryInformationVO?.area}} + + + {{i?.supplementaryInformationVO?.address}} + + + + + {{i?.supplementaryInformationVO?.remarks}} + + + + +
diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts index 6e0b70e7..3245c4e0 100644 --- a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-12-03 15:31:52 - * @LastEditTime: 2021-12-20 09:35:33 + * @LastEditTime: 2021-12-21 11:22:23 * @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\components\vehicle-detail\vehicle-detail.component.ts @@ -37,13 +37,18 @@ export class OrderManagementVehicleDetailComponent implements OnInit { } ngOnInit(): void { - this.service.http.get(`/user/${this.id}?_allow_anonymous=true&_allow_badcode=true`).subscribe(res => { - console.log(res); - this.i = res - }); + console.log(this.id) + this.initData() } - + initData() { + this.service.request(this.service.$api_get_getWholeBillDetail, {id: this.id}).subscribe(res => { + console.log(res) + if (res) { + this.i =res; + } + }) + } hand() { this.modalService.create({ diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.html b/src/app/routes/order-management/components/vehicle/vehicle.component.html index 5d18adc1..b81ab436 100644 --- a/src/app/routes/order-management/components/vehicle/vehicle.component.html +++ b/src/app/routes/order-management/components/vehicle/vehicle.component.html @@ -1,7 +1,7 @@ - - - -
- -
元/吨
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
+ - +
-

总运费:¥900.00

-

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

-
- - +

+ 总运费:¥{{ data.totalFreight }} +

+

运输费:¥{{ data.freight }},附加费:¥{{ data.surcharge }}

+
\ No newline at end of file diff --git a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts index afad8c66..8cfab1a7 100644 --- a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts +++ b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts @@ -1,4 +1,3 @@ -import { preloaderFinished } from '@delon/theme'; /* * @Author: your name * @Date: 2021-12-14 14:03:07 @@ -7,20 +6,12 @@ import { preloaderFinished } from '@delon/theme'; * @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 { Component, Input, OnInit, ViewChild } from '@angular/core'; import { - SFComponent, - SFCustomWidgetSchema, - SFNumberWidgetSchema, - SFRadioWidgetSchema, - SFSchema, + SFComponent, SFNumberWidgetSchema, SFSchema, SFSelectWidgetSchema, - SFTextareaWidgetSchema, - SFUISchema + SFStringWidgetSchema, SFTextWidgetSchema } 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', @@ -28,116 +19,154 @@ import { NzModalRef } from 'ng-zorro-antd/modal'; 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) {} + schema!: SFSchema; + + @Input() + data: any; + + constructor() {} 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); - }); + this.schema = this.initSF(this.data); } - close(): void { - this.modal.destroy(); - } /** - * 更新数字框 - * @param value - * @param type + * 初始化表单 */ - changeNumVal(value: any, type: number) {} + private initSF(data: any): SFSchema { + return { + properties: { + dto: { + type: 'object', + properties: { + freightPrice: { + type: 'string', + title: '运费单价', + ui: { + addOnAfter: data.freightTypeLabel, + placeholder: '请输入', + grid: { + span: 12 + } + } as SFStringWidgetSchema, + default: data.freightPrice + }, + rule: { + title: '', + type: 'string', + default: data.rule, + enum: [ + { label: '保留小数', value: '1' }, + { label: '抹除小数', value: '2' }, + { label: '抹除个数', value: '3' } + ], + ui: { + widget: 'select', + spanLabelFixed: 10, + grid: { + span: 10 + } + } as SFSelectWidgetSchema + }, + settlementBasis: { + title: '结算依据', + type: 'string', + default: data.settlementBasis, + enum: [ + { label: '以收货为准', value: '1' }, + { label: '以发货为准', value: '2' } + ], + ui: { + widget: 'select', + grid: { + span: 12 + } + } as SFSelectWidgetSchema + }, + blank1: { + title: '', + type: 'string', + ui: { widget: 'text', grid: { span: 12 }, class: 'input-back' }, + default: ' ' + }, + freightType: { + title: '', + type: 'string', + ui: { hidden: true }, + default: data.freightType + }, + acceptWeight: { + type: 'number', + title: '装货重量', + default: data.acceptWeight, + ui: { + unit: '吨', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true + } as SFNumberWidgetSchema + }, + acceptVolume: { + type: 'number', + title: '装货体积', + default: data.acceptVolume, + ui: { + unit: '吨', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true + } as SFNumberWidgetSchema + }, + settlementWeight: { + type: 'number', + title: '卸货重量', + default: data.settlementWeight, + ui: { + unit: '吨', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true + } as SFNumberWidgetSchema + }, + settlementVolume: { + type: 'number', + title: '卸货体积', + default: data.settlementVolume, + ui: { + unit: '吨', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true + } as SFNumberWidgetSchema + } + }, + required: ['freightPrice', 'settlementBasis'] + }, + changeCause: { + title: '审核备注', + type: 'string', + maxLength: 100, + default: data.changeCause, + ui: { + widget: 'textarea', + span: 24, + placeholder: '选填,最多不超过100字', + autosize: { + minRows: 3, + maxRows: 5 + } + } as SFTextWidgetSchema + } + } + }; + } } diff --git a/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.html b/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.html new file mode 100644 index 00000000..7681f210 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.html @@ -0,0 +1,7 @@ + + + + diff --git a/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.ts b/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.ts new file mode 100644 index 00000000..86250b1e --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.ts @@ -0,0 +1,93 @@ +/* + * @Author: your name + * @Date: 2021-12-21 10:14:52 + * @LastEditTime: 2021-12-21 10:17:02 + * @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\vehicle\cancel\cancel.component.ts + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { + SFComponent, + SFCustomWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFTextareaWidgetSchema, + SFUISchema +} from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from '../../../services/order-management.service'; + + +@Component({ + selector: 'app-order-management-cancel', + templateUrl: './cancel.component.html' +}) +export class OneCarOrderCancelComponent implements OnInit { + record: any = {}; + i: any; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + constructor(private modalRef: NzModalRef, private modal: NzModalService, public service: OrderManagementService) {} + + ngOnInit(): void { + this.initSF(); + console.log(this.i.billStatusLabel) + } + initSF() { + this.schema = { + properties: { + cancelReason: { + type: 'string', + title: '取消原因', + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + } as SFTextareaWidgetSchema + } + }, + required: ['reason'] + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 20 } + } + }; + } + save(value: any): void { + if (this.i?.billStatus === '1') { + // 待接单状态 + this.modal.confirm({ + nzTitle: '是否确定立即取消运单!', + nzOnOk: () => + this.service.request(this.service.$api_get_cancelAnOrder, { id: this.i?.id, ...this.sf.value }).subscribe(res => { + if (res) { + this.modalRef.close(true); + } else { + this.service.msgSrv.error(res.msg); + } + }), + nzOnCancel: () => this.modalRef.destroy() + }); + } else { + this.service.request(this.service.$api_get_cancelAnOrder, { id: this.i?.id, ...this.sf.value }).subscribe(res => { + if (res) { + this.modalRef.close(true); + } else { + this.service.msgSrv.error(res.msg); + } + }); + } + + this.modalRef.close(true); + } + + close(): void { + this.modalRef.destroy(); + } +} 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 index dc976583..72dbeece 100644 --- 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 @@ -1,67 +1,53 @@ - - - - 100元/吨 - 100元/方 - 100元/车 - - -
-
以发货为准 / 以收货为准
-
保留小数/抹除小数/抹除个数
-
-
-
- - -
xx吨
-
- -
xx吨
-
-
- - -
xx吨
-
- -
xx吨
-
-
- - -
1000元
+ + + -
张三 / 18888888888 / 粤GJ401
-
- -
李四 / 1888888888
-
+
{{driverList?.nickName}} / {{driverList?.telephone}}/ {{carList?.carNo}}
+
+ +
{{payeeList?.nickName}} / {{payeeList?.telephone}}
+
- + +
+ +
请上传图片
+
+
+ + + + +
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 index cf36f707..fba3d408 100644 --- 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 @@ -1,12 +1,12 @@ -import { preloaderFinished } from '@delon/theme'; /* * @Author: your name - * @Date: 2021-12-14 14:03:07 - * @LastEditTime: 2021-12-15 14:08:34 + * @Date: 2021-12-15 13:17:42 + * @LastEditTime: 2021-12-21 14:50:54 * @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 + * @FilePath: \tms-obc-web\src\app\routes\order-management\modal\vehicle\confir-receipt\confir-receipt.component.ts */ + import { Component, OnInit, ViewChild } from '@angular/core'; import { SFComponent, @@ -18,10 +18,21 @@ import { SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { NzUploadChangeParam, NzUploadFile } from 'ng-zorro-antd/upload'; import { _HttpClient } from '@delon/theme'; import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalRef } from 'ng-zorro-antd/modal'; - +import { OrderManagementService } from '../../../services/order-management.service'; +import { Observable, Observer } from 'rxjs'; +import { STColumn } from '@delon/abc/st'; +function getBase64(file: File): Promise { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); +} @Component({ selector: 'app-order-management-vehicle-confir-receipt', templateUrl: './confir-receipt.component.html', @@ -30,24 +41,155 @@ import { NzModalRef } from 'ng-zorro-antd/modal'; export class VehicleConfirReceiptComponent implements OnInit { record: any = {}; i:any; + Status: any + costDetail: any // 费用明细 + columns!: STColumn[]; + previewVisible1 = false; + dataInfo: any; + detailList: any data: any = {}; - constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient) {} + previewImage1 = ''; + listImagUrls: any[] = []; + payeeList: any; + driverList: any; + carList: any; + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient,public service: OrderManagementService) {} ngOnInit(): void { + this.initST() + this.initData() } save(): void { - // this.http.post(`/user/${this.record.id}`, value).subscribe(res => { - // this.msgSrv.success('保存成功'); - // this.modal.close(true); - // }); + this.service.request(this.service.$api_get_signWholeOrder, {id: this.i?.id}).subscribe((res: any) => { + console.log(res) + if(res) { + this.service.msgSrv.success('确认签收成功!') + } else { + this.service.msgSrv.error(res.msg) + } + }) } - + handlePreview1 = async (file: NzUploadFile) => { + if (!file.url && !file.preview) { + file.preview = await getBase64(file.originFileObj!); + } + this.previewImage1 = file.url || file.preview; + this.previewVisible1 = true; + }; close(): void { this.modal.destroy(); } - userAction() { + + beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]) => { + return new Observable((observer: Observer) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif' || file.type === 'image/bmp'; + if (!isJpgOrPng) { + this.service.msgSrv.warning('只能上传图片!'); + observer.complete(); + return; + } + // tslint:disable-next-line: no-non-null-assertion + const isLt2M = file.size! / 1024 / 1024 < 3; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过3兆!'); + observer.complete(); + return; + } + observer.next(isJpgOrPng && isLt2M); + observer.complete(); + }); + }; + initData() { + // if (this.i?.receiptCertificate?.length > 0) { + // this.i?.receiptCertificate.forEach((element: any) => { + // const image = { + // url: element, + // status: 'done', + // uid: '-1' + // }; + // this.listImagUrls.push(image); + // }); + // } + // 大宗 + this.service.request(this.service.$api_get_getWholeSignForDetail, {id: this.i?.id}).subscribe((res: any) => { + console.log(res) + this.dataInfo = res; + const cost: any = {} + res.mybidDetailInfo.forEach((element: any) => { + if(element.expenseName === "预付" || element.expenseCode === 'PRE') { + cost.PRE = element.price + } else if(element.expenseName === "到付" || element.expenseCode === 'RECE') { + cost.RECE = element.price + } else if(element.expenseName === "回单付" || element.expenseCode === 'BACK') { + cost.BACK = element.price + } else if(element.expenseName === "油卡" || element.expenseCode === 'OIL') { + cost.OIL = element.price + } else if(element.expenseName === "总费用") { + cost.traiPrice = element.price + } + }); + this.service.request(this.service.$api_getUserDetailByAppUserId, {id: this.dataInfo?.payeeId}).subscribe((res: any) => { + console.log(res) + this.payeeList = res; + }) + this.service.request(this.service.$api_getUserDetailByAppUserId, {id: this.dataInfo?.driverId}).subscribe((res: any) => { + console.log(res) + this.driverList = res; + }) + this.service.request(this.service.$api_getCarLicenseByIds, {id: this.dataInfo?.carId}).subscribe((res: any) => { + console.log(res) + this.carList = res; + }) + console.log(cost) + this.costDetail = [cost]; + }) + } + initST() { + this.columns = [ + { + title: '预付', + index: 'PRE' + }, + { + title: '到付', + index: 'RECE' + }, + { + title: '油卡', + index: 'OIL' + }, + { + title: '回单付', + index: 'BACK' + }, + { + title: '总运费', + index: 'traiPrice' + } + ]; + } + + handleChange1(info: NzUploadChangeParam): void { + switch (info.file.status) { + case 'uploading': + break; + case 'done': + const resData = info.file.response.data; + const arr = [ + { + url: resData.fullFilePath, + status: 'done', + uid: '-1' + } + ]; + this.listImagUrls = arr; + break; + case 'error': + this.service.msgSrv.error('网络错误'); + break; + } } } 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 index c3a17c73..f9b9654f 100644 --- 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 @@ -1,21 +1,21 @@ - - + +
- +
- +
- +
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 index 7cea770e..e18d8ba7 100644 --- 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 @@ -1,13 +1,6 @@ -import { preloaderFinished } from '@delon/theme'; -/* - * @Author: your name - * @Date: 2021-12-14 14:03:07 - * @LastEditTime: 2021-12-20 16:21:19 - * @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 { DatePipe } from '@angular/common'; import { SFComponent, SFCustomWidgetSchema, @@ -20,151 +13,127 @@ import { SFUISchema, SFUploadWidgetSchema } from '@delon/form'; +import { apiConf } from '@conf/api.conf'; 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 { WaybillManagementServe } from 'src/app/routes/waybill-management/services/waybill-management.service'; import { Observable, Observer } from 'rxjs'; +import { EAEnvironmentService } from '@shared'; @Component({ selector: 'app-order-management-vehicle-sure-arrive', templateUrl: './sure-arrive.component.html', - styleUrls: ['./sure-arrive.component.less'] + styleUrls: ['./sure-arrive.component.less'], + providers: [DatePipe] }) export class VehicleSureArriveComponent implements OnInit { record: any = {}; i: any; + formData: any; Status: any; data: any ={ - place1: '', - place2: '' + weight: 0, + volume: 0 }; @ViewChild('sf', { static: false }) sf!: SFComponent; schema: SFSchema = {}; ui: SFUISchema = {}; - constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, public service: SupplyManagementService ) {} + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, public service: WaybillManagementServe,private datePipe: DatePipe,private envSrv: EAEnvironmentService, ) {} ngOnInit(): void { + console.log(this.i) + this.initData() + this.i.time = this.i.loadingTime; this.initSF(); } initSF() { + if(this.Status === 1) { + this.schema = { properties: { - datetime: { + time: { type: 'string', title: '卸货时间', format: 'date-time', }, - no2: { - type: 'string', - title: '卸货重量', - ui: { - widget: 'custom', - } - }, - no3: { - type: 'string', - title: '卸货体积', - ui: { - widget: 'custom', - } - }, - - avatar: { + imgUrl3: { type: 'string', title: '装货凭证', + readOnly: true, ui: { - action: `/scm/cms/cms/upload/multipartFile/fileModel`, - fileType: 'image/png,image/jpeg,image/jpg', + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', limit: 1, limitFileCount: 1, - resReName: 'url', - urlReName: 'url', - widget: 'upload', - descriptionI18n: ' 提单号', + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', data: { - // appId: environment.appId, + appId: this.envSrv.env.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) => { + beforeUpload: (file: any, fileList: any) => { return new Observable((observer: Observer) => { - const isLt2M = file.size / 1024 / 1024 < 5; - if (!isLt2M) { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { this.service.msgSrv.warning('图片大小超过5M!'); observer.complete(); return; } - observer.next(isLt2M); + observer.next(isLt1M); observer.complete(); }); - } - } as SFUploadWidgetSchema + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, }, - avatar2: { + imgUrl4: { type: 'string', title: '', + readOnly: true, ui: { - action: `/scm/cms/cms/upload/multipartFile/fileModel`, - fileType: 'image/png,image/jpeg,image/jpg', + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', limit: 1, limitFileCount: 1, - resReName: 'url', - urlReName: 'url', - widget: 'upload', + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', descriptionI18n: '人车货照片', data: { - // appId: environment.appId, + appId: this.envSrv.env.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) => { + beforeUpload: (file: any, fileList: any) => { return new Observable((observer: Observer) => { - const isLt2M = file.size / 1024 / 1024 < 5; - if (!isLt2M) { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { this.service.msgSrv.warning('图片大小超过5M!'); observer.complete(); return; } - observer.next(isLt2M); + observer.next(isLt1M); observer.complete(); }); - } - } as SFUploadWidgetSchema + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, }, no4: { type: 'string', @@ -174,124 +143,365 @@ export class VehicleSureArriveComponent implements OnInit { }, default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式', }, - avatar3: { + imgUrl1: { type: 'string', title: '卸货凭证', ui: { - action: `/scm/cms/cms/upload/multipartFile/fileModel`, - fileType: 'image/png,image/jpeg,image/jpg', + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', limit: 1, limitFileCount: 1, - resReName: 'url', - urlReName: 'url', - widget: 'upload', - descriptionI18n: ' 提单号', + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', data: { - // appId: environment.appId, + appId: this.envSrv.env.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) => { + beforeUpload: (file: any, fileList: any) => { return new Observable((observer: Observer) => { - const isLt2M = file.size / 1024 / 1024 < 5; - if (!isLt2M) { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { this.service.msgSrv.warning('图片大小超过5M!'); observer.complete(); return; } - observer.next(isLt2M); + observer.next(isLt1M); observer.complete(); }); - } - } as SFUploadWidgetSchema + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, }, - avatar4: { + imgUrl2: { type: 'string', title: '', ui: { - action: `/scm/cms/cms/upload/multipartFile/fileModel`, - fileType: 'image/png,image/jpeg,image/jpg', + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', limit: 1, limitFileCount: 1, - resReName: 'url', - urlReName: 'url', - widget: 'upload', + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', descriptionI18n: '人车货照片', data: { - // appId: environment.appId, + appId: this.envSrv.env.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) => { + beforeUpload: (file: any, fileList: any) => { return new Observable((observer: Observer) => { - const isLt2M = file.size / 1024 / 1024 < 5; - if (!isLt2M) { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { this.service.msgSrv.warning('图片大小超过5M!'); observer.complete(); return; } - observer.next(isLt2M); + observer.next(isLt1M); observer.complete(); }); - } - } as SFUploadWidgetSchema + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, } }, - required: ['reason'] + required: ['time'] }; + }else { + this.schema = { + properties: { + time: { + type: 'string', + title: '卸货时间', + format: 'date-time', + }, + weight: { + type: 'string', + title: '卸货重量', + ui: { + widget: 'custom', + } + }, + volume: { + type: 'string', + title: '卸货体积', + ui: { + widget: 'custom', + } + }, + imgUrl3: { + type: 'string', + title: '装货凭证', + readOnly: true, + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + }, + imgUrl4: { + type: 'string', + title: '', + readOnly: true, + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + }, + no4: { + type: 'string', + title: '', + ui: { + widget: 'text', + }, + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式', + }, + imgUrl1: { + type: 'string', + title: '卸货凭证', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + }, + imgUrl2: { + type: 'string', + title: '', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + } + }, + required: ['time', 'weight' ] + }; + } this.ui = { '*': { spanLabelFixed: 100, grid: { span: 20 } }, - $avatar: { grid: { span: 12} }, - $avatar2: { grid: { span: 12} }, - $avatar3: { grid: { span: 12} }, - $avatar4: { grid: { span: 12} }, + $imgUrl1: { grid: { span: 12} }, + $imgUrl2: { grid: { span: 12} }, + $imgUrl3: { grid: { span: 12} }, + $imgUrl4: { 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); - // }); - } + if(this.Status === 1) { + if(!value.time) { + this.service.msgSrv.warning('必填项为空!') + return; + } + const params = { + id: this.i.id, + imgUrl1: value.imgUrl1.data.fullFilePath, + imgUrl2: value.imgUrl2.data.fullFilePath, + time: value.time, + } + params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss ') + this.service.request(this.service.$api_get_insertWholeUnloadCarInfo, params).subscribe((res) => { + if(res) { + this.service.msgSrv.success('确认到车成功!') + this.modal.destroy(); + } else{ + this.service.msgSrv.error(res.msg) + } + }) + } else { + if(!value.time || !this.data.weight) { + this.service.msgSrv.warning('必填项为空!') + return; + } + console.log(value) + console.log(this.i) + const params = { + id: this.i?.id, + imgUrl1: value.imgUrl1.data.fullFilePath, + imgUrl2: value.imgUrl2.data.fullFilePath, + time: value.time, + volume: this.data.volume, + weight: this.data.weight + } + params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss ') + console.log(params) + this.service.request(this.service.$api_get_insertBulkUnloadCarInfo, params).subscribe((res) => { + if(res) { + this.service.msgSrv.success('确认到车成功!') + this.modal.destroy(); + } else{ + this.service.msgSrv.error(res.msg) + } + }) + } + } + // 确认到车界面信息(两个只能看的图片) + initData() { + this.service.request(this.service.$api_get_getUnloadCarInfo, { id : this.i?.id}).subscribe((res) => { + console.log(res) + if (res.imgUrl1) { + this.formData = { + imgUrl3: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res.imgUrl1, + response: { + url: res.imgUrl1, + }, + }, + ], + imgUrl4: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res.imgUrl2, + response: { + url: res.imgUrl2, + }, + }, + ], + }; + } + }) + } 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 index ae1b3f58..44492a4f 100644 --- 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 @@ -1,7 +1,7 @@ - - +

总运费:¥{{ totalPrice }}总运费:¥{{ data.totalFreight }} - (运输费:¥{{ tranPrice }},附加费:¥{{ otherPrice }}) + (运输费:¥{{ data.freight }},附加费:¥{{ data.surcharge }})

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 index 2b203488..bf167aaa 100644 --- 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 @@ -2,12 +2,12 @@ import { preloaderFinished } from '@delon/theme'; /* * @Author: your name * @Date: 2021-12-14 14:03:07 - * @LastEditTime: 2021-12-20 15:57:37 + * @LastEditTime: 2021-12-21 14:56:26 * @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 { Component, Input, OnInit, ViewChild } from '@angular/core'; import { SFComponent, SFCustomWidgetSchema, @@ -29,47 +29,33 @@ import { OrderManagementService } from '../../../services/order-management.servi styleUrls: ['./update-freight.component.less'] }) export class VehicleUpdateFreightComponent implements OnInit { - record: any; - i: any; @ViewChild('sf', { static: false }) sf!: SFComponent; schema: SFSchema = {}; ui: SFUISchema = {}; - totalPrice = 0; - tranPrice = 0; - otherPrice = 0; - aggreechecked = false; + + @Input() + data: any; + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public service: OrderManagementService) {} ngOnInit(): void { - this.i = { - prePay: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'PRE')[0]?.price || 0, - toPay: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'RECE')[0]?.price || 0, - oilCardPay: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'OIL')[0]?.price || 0, - receiptPay: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'BACK')[0]?.price || 0, - prePayStatus: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'PRE')[0]?.paymentStatus, - toPayStatus: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'RECE')[0]?.paymentStatus, - oilCardPayStatus: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'OIL')[0]?.paymentStatus, - receiptPayStatus: this.record?.mybidDetailInfo?.filter((data: any) => data.expenseCode === 'BACK')[0]?.paymentStatus - }; - this.tranPrice = this.i.prePay + this.i.toPay + this.i.oilCardPay + this.i.receiptPay; - this.totalPrice = this.i.prePay + this.i.toPay + this.i.oilCardPay + this.i.receiptPay + this.otherPrice; - this.initSF(); - this.service.request(this.service.$api_get_getFreightChangeWholeDetail, { id: this.record.id}).subscribe((res) => { - console.log(res) - console.log(this.i) - console.log(this.tranPrice) - }) + this.initSF(this.data); } - initSF() { + initSF(data: any) { + const info = { + prePay: data.list?.filter((item: any) => item.costCode === 'PRE')[0], + toPay: data.list?.filter((item: any) => item.costCode === 'RECE')[0], + receiptPay: data.list?.filter((item: any) => item.costCode === 'BACK')[0] + }; this.schema = { properties: { prePay: { type: 'number', title: '预付', - default: 0.0, - readOnly: this.i.prePayStatus !== '3', + default: info.prePay?.price || 0, + readOnly: info.prePay?.paymentStatus === '2' || info.prePay?.paymentStatus === '4', ui: { prefix: '¥', widgetWidth: 200, @@ -80,8 +66,8 @@ export class VehicleUpdateFreightComponent implements OnInit { toPay: { type: 'number', title: '到付', - default: 0.0, - readOnly: this.i.toPayStatus !== '3', + default: info.toPay?.price || 0, + readOnly: info.toPay?.paymentStatus === '2' || info.toPay?.paymentStatus === '4', ui: { prefix: '¥', widgetWidth: 200, @@ -104,8 +90,8 @@ export class VehicleUpdateFreightComponent implements OnInit { receiptPay: { type: 'number', title: '回单付', - default: 0.0, - readOnly: this.i.receiptPayStatus !== '3', + default: info.receiptPay?.price || 0, + readOnly: info.receiptPay?.paymentStatus === '2' || info.receiptPay?.paymentStatus === '4', ui: { prefix: '¥', widgetWidth: 200, @@ -132,10 +118,11 @@ export class VehicleUpdateFreightComponent implements OnInit { } }; } + save(value: any): void { - const editItems = this.record?.mybidDetailInfo.filter((data: any) => data.receiptPayStatus === '3'); + const editItems = this.data.list?.filter((info: any) => info.toPay?.paymentStatus !== '2' && info.toPay?.paymentStatus !== '4'); editItems.forEach((item: any) => { - switch (item.expenseName) { + switch (item.costName) { case '预付': item.price = this.sf.value.prePay; break; @@ -151,18 +138,17 @@ export class VehicleUpdateFreightComponent implements OnInit { }); const params = { - id: this.record?.id, + billId: this.data.id, dtos: editItems, changeCause: this.sf.value.changeCause }; - // this.service.request(this.service.$api_insertFreightChangeWhole, params).subscribe((res: any) => { - // if (res) { - // this.modal.destroy(); - // } else { - // this.service.msgSrv.error(res.msg); - // } - // }); + this.service.request(this.service.$api_get_insertFreightChangeWhole, params).subscribe((res: any) => { + if (res) { + this.modal.destroy(); + this.service.msgSrv.success('变更运费成功'); + } + }); } close(): void { @@ -173,7 +159,7 @@ export class VehicleUpdateFreightComponent implements OnInit { * */ changeNumVal() { - this.tranPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay; - this.totalPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay + this.otherPrice; + // this.tranPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay; + // this.totalPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay + this.otherPrice; } } diff --git a/src/app/routes/order-management/order-management.module.ts b/src/app/routes/order-management/order-management.module.ts index 7bf70cc9..27ade041 100644 --- a/src/app/routes/order-management/order-management.module.ts +++ b/src/app/routes/order-management/order-management.module.ts @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-12-03 15:31:52 - * @LastEditTime: 2021-12-15 14:09:53 + * @LastEditTime: 2021-12-21 10:16:11 * @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\order-management.module.ts @@ -24,6 +24,7 @@ import { ConfirReceiptComponent } from './modal/bulk/confir-receipt/confir-recei import { SureArriveComponent } from './modal/bulk/sure-arrive/sure-arrive.component'; import { SureDepartComponent } from './modal/bulk/sure-depart/sure-depart.component'; import { UpdateFreightComponent } from './modal/bulk/update-freight/update-freight.component'; +import { OneCarOrderCancelComponent } from './modal/vehicle/cancel/cancel.component'; import { VehicleConfirReceiptComponent } from './modal/vehicle/confir-receipt/confir-receipt.component'; import { VehicleSureArriveComponent } from './modal/vehicle/sure-arrive/sure-arrive.component'; import { VehicleSureDepartComponent } from './modal/vehicle/sure-depart/sure-depart.component'; @@ -49,7 +50,8 @@ const COMPONENTS: Type[] = [ VehicleConfirReceiptComponent, VehicleSureDepartComponent, VehicleSureArriveComponent, - OrderManagementRiskDetailComponent + OrderManagementRiskDetailComponent, + OneCarOrderCancelComponent ]; @NgModule({ diff --git a/src/app/routes/order-management/services/order-management.service.ts b/src/app/routes/order-management/services/order-management.service.ts index a1a41c1e..a3279c53 100644 --- a/src/app/routes/order-management/services/order-management.service.ts +++ b/src/app/routes/order-management/services/order-management.service.ts @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-12-03 15:31:52 - * @LastEditTime: 2021-12-20 15:30:26 + * @LastEditTime: 2021-12-21 13:17:37 * @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\services\order-management.service.ts @@ -45,6 +45,36 @@ export class OrderManagementService extends BaseService { $api_get_getFreightChangeWholeDetail = `/api/sdc/billFreightChangeApplication/getFreightChangeWholeDetail`; // 订单申请撤销 $api_get_revokeChangeRecord = `/api/sdc/billFreightChangeApplication/revokeChangeRecord`; + // 运费变更申请-整车 + $api_get_insertFreightChangeWhole = `/api/sdc/billFreightChangeApplication/insertFreightChangeWhole`; + // 取消订单 + $api_get_cancelAnOrder = `/api/sdc/billOperate/cancelAnOrder`; + // 批量签收整车订单 + $api_get_batchSignWholeOrder = `/api/sdc/billOperate/batchSignWholeOrder`; + // 批量签收大宗订单 + $api_get_batchSignBulkOrder = `/api/sdc/billOperate/batchSignBulkOrder`; + // 大宗签收详情 + $api_get_getBulkSignForDetail = `/api/sdc/billOperate/getBulkSignForDetail`; + // 整车签收详情 + $api_get_getWholeSignForDetail = `/api/sdc/billOperate/getWholeSignForDetail`; + // 确认签收大宗订单 + $api_get_signBulkOrder = `/api/sdc/billOperate/signBulkOrder`; + // 确认签收整车订单 + $api_get_signWholeOrder = `/api/sdc/billOperate/signWholeOrder`; + // 上传图片 + public $api_upload_url = `/api/mdc/pbc/upload/multipartFile/file`; + // 根据用户id查用户信息(注意:nickName才是用户名称) + public $api_getUserDetailByAppUserId = `/api/mdc/cuc/userBasicInfo/get`; + // 根据车辆id查车辆信息 + public $api_getCarLicenseByIds = `/api/mdc/cuc/carLicense/getCarLicenseByIds`; + // 统计【整车】订单状态数量 + public $api_statisticalStatus = `/api/sdc/billOperate/getWholeStatistical`; + // 统计【大宗】订单状态数量 + public $api_getBulkStatistical = `/api/sdc/billOperate/getBulkStatistical`; + // 变更运费页面-大宗 + public $api_getFreightChangeBulkDetail = `/api/sdc/billFreightChangeApplication/getFreightChangeBulkDetail`; + // 变更运费页面-大宗 + public $api_insertFreightChangeBulk = `/api/sdc/billFreightChangeApplication/insertFreightChangeBulk`; constructor(public injector: Injector) { super(injector) } diff --git a/src/app/routes/supply-management/components/add-driver/add-driver.component.html b/src/app/routes/supply-management/components/add-driver/add-driver.component.html new file mode 100644 index 00000000..038319ff --- /dev/null +++ b/src/app/routes/supply-management/components/add-driver/add-driver.component.html @@ -0,0 +1,44 @@ +

+ +
+ + +
+
+
正面照
+
示例
+
+
+
+
+ +
+
+
背面照
+
示例
+
+
+
+
+
+ + + +
+ \ No newline at end of file diff --git a/src/app/routes/supply-management/components/add-driver/add-driver.component.less b/src/app/routes/supply-management/components/add-driver/add-driver.component.less new file mode 100644 index 00000000..54338ad9 --- /dev/null +++ b/src/app/routes/supply-management/components/add-driver/add-driver.component.less @@ -0,0 +1,25 @@ +.pr { + position: relative; + } + + .pa { + position: absolute; + top: 35px; + left: 150px; + } + + .tips { + display: flex; + margin-bottom: 0; + color: #333; + + dt { + width: 150px; + } + + dd { + width: 190px; + margin-bottom: 0; + text-align: center; + } + } diff --git a/src/app/routes/supply-management/components/add-driver/add-driver.component.spec.ts b/src/app/routes/supply-management/components/add-driver/add-driver.component.spec.ts new file mode 100644 index 00000000..92751ffa --- /dev/null +++ b/src/app/routes/supply-management/components/add-driver/add-driver.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { CarAddDriverComponent } from './add-driver.component'; + +describe('CarAddDriverComponent', () => { + let component: CarAddDriverComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ CarAddDriverComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CarAddDriverComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/add-driver/add-driver.component.ts b/src/app/routes/supply-management/components/add-driver/add-driver.component.ts new file mode 100644 index 00000000..703e2b54 --- /dev/null +++ b/src/app/routes/supply-management/components/add-driver/add-driver.component.ts @@ -0,0 +1,556 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { cacheConf } from '@conf/cache.conf'; +import { SFComponent, SFUISchema, SFSchema, SFUploadWidgetSchema, SFDateWidgetSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EACacheService, EAEnvironmentService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { Observable, Observer } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { SupplyManagementService } from '../../services/supply-management.service'; + +@Component({ + selector: 'app-car-add-driver', + templateUrl: './add-driver.component.html', + styleUrls: ['./add-driver.component.less'] +}) +export class CarAddDriverComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sf1', { static: false }) sf1!: SFComponent; + @ViewChild('sf2', { static: false }) sf2!: SFComponent; + record: any = {}; + i: any; + ui: SFUISchema = {}; + schema: SFSchema = {}; + schema1: SFSchema = {}; + schema2: SFSchema = {}; + showCardFlag = false; + showJopFlag = false; + detailData: any = { + identityInfoDTO: {}, + userDriverLicenseDTO: {}, + userPracticeSeniorityDTO: {} + }; + companyData: any = {}; + mobile = '' + constructor( + private modal: NzModalRef, + public service: SupplyManagementService, + private envSrv: EAEnvironmentService, + private eaCacheSrv: EACacheService, + ) { } + + ngOnInit(): void { + this.companyData = this.eaCacheSrv.get(cacheConf.env) + this.initSF() + } + initSF() { + this.schema = { + properties: { + titleA: { + title: '司机信息(必填)', + type: 'string', + ui: { + widget: 'text', + }, + default: '照片上传后会自动识别文字并填充下列内容栏' + }, + mobile: { + title: '手机号', + type: 'string', + format: 'email', + maxLength: 11, + ui: { + widget: 'text', + }, + default: this.mobile + }, + showName: { + title: '身份证照片', + type: 'string', + ui: { + widget: 'text', + showRequired: true, + }, + default: '请上传身份证原件的高清照片,若上传复印件,则需加盖公司印章及法人签字;上传后系统会自动识别并填写', + }, + tipsA: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6, + }, + }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + offsetControl: 6, + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args) => { + if (args.type === 'success') { + this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath + this.checkIdCard(args.file.response.data.fullFilePath, 'front', 0); + } + }, + beforeUpload: (file: any, _fileList) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + } as SFUploadWidgetSchema, + }, + tipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6, + }, + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + offsetControl: 6, + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args) => { + if (args.type === 'success') { + this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath + this.checkIdCard(args.file.response.data.fullFilePath, 'back', 0); + } + }, + beforeUpload: (file: any, _fileList) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + } as SFUploadWidgetSchema, + }, + name: { + title: '姓名', + type: 'string', + maxLength: 32, + ui: { + widget: '', + placeholder: '请输入姓名', + }, + }, + certificateNumber: { + title: '身份证号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + widget: '', + placeholder: '请输入法定代表人证件号', + errors: { + required: '请输入18位身份证号码', + }, + }, + }, + }, + required: [ + 'certificatePhotoFrontWatermark', + 'certificatePhotoBackWatermark', + 'name', + 'certificateNumber' + ], + }; + this.schema1 = { + properties: { + titleB: { + title: '驾驶证信息(必填)', + type: 'string', + ui: { + widget: 'text', + }, + default: '照片上传后会自动识别文字并填充下列内容栏' + }, + certificatePhotoWatermark: { + type: 'string', + title: '驾驶证照片', + ui: { + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '请上传驾驶证照片,支持JPG、PNG格式,文件小于5M。照片信息缺失、拼凑、过度PS、模糊不清,都不会通过审核。', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args) => { + if (args.type === 'success') { + this.detailData.userDriverLicenseDTO.certificatePhoto = args.file.response.data.fullFilePath + this.checkDriverCard(args.file.response.data.fullFilePath, 'front', 0); + } + }, + beforeUpload: (file: any, _fileList) => { + return new Observable((observer: Observer) => { + const isLt4M = file.size / 1024 / 1024 < 4; + if (!isLt4M) { + this.service.msgSrv.warning('图片大小超过4M!'); + observer.complete(); + return; + } + observer.next(isLt4M); + observer.complete(); + }); + }, + } as SFUploadWidgetSchema, + }, + licenseNo: { + title: '驾驶证号', + type: 'string', + ui: { + // widget: 'text', + placeholder: '请输入', + }, + // default: this.ar.snapshot.queryParams.licenseNo + }, + driverModel: { + title: '准驾车型', + type: 'string', + enum: [ + {label: 'A1', value: 0}, + {label: 'B1', value: 1}, + ], + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入', + }, + }, + validStartTime: { + title: '法人证件有效开始日期', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择起始日期', + }, + change: (i) => { }, + } as SFDateWidgetSchema, + }, + validEndTime: { + title: '法人证件有效开始日期', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择起始日期', + }, + change: (i) => { }, + } as SFDateWidgetSchema, + }, + signingOrganization: { + title: '签发机关', + type: 'string', + maxLength: 30, + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入', + }, + }, + }, + required: [ + 'certificatePhotoWatermark', + 'licenseNo', + 'driverModel', + 'validStartTime', + 'validEndTime', + ], + }; + this.schema2 = { + properties: { + titleC: { + title: '从业资格证(选填)', + type: 'string', + ui: { + widget: 'text', + }, + default: '照片上传后会自动识别文字并填充下列内容栏', + }, + certificatePhotoWatermark: { + type: 'string', + title: '', + ui: { + offsetControl: 6, + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args) => { + if (args.type === 'success') { + this.detailData.userPracticeSeniorityDTO.certificatePhoto = args.file.response.data.fullFilePath + //this.checkIdCard(args.file.response.data.fullFile, 0, 0); + } + }, + beforeUpload: (file: any, _fileList) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + } as SFUploadWidgetSchema, + }, + licenseNo: { + title: '从业资格证号', + type: 'string', + maxLength: 30, + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入', + }, + }, + regionCode: { + title: '签发省份', + type: 'string', + ui: { + widget: 'select', + placeholder: '请选择', + asyncData: () => this.getProvinceData(), + } as SFDateWidgetSchema, + }, + validStartTime: { + title: '发证日期', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择起始日期', + }, + change: (i) => { }, + } as SFDateWidgetSchema, + }, + validEndTime: { + title: '有效期止', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择起始日期', + }, + change: (i) => { }, + } as SFDateWidgetSchema, + }, + }, + required: [ + + ], + }; + this.ui = { + '*': { + spanLabelFixed: 180, + grid: { span: 24 }, + width: 700, + }, + $title1: { + spanLabelFixed: 0, + }, + $title2: { + spanLabelFixed: 0, + }, + $title3: { + spanLabelFixed: 0, + }, + $title4: { + spanLabelFixed: 0, + }, + $enterpriseRegistrationTime: { + width: 680, + }, + $operatingEndTime: { + grid: { span: 9 }, + }, + $dateType: { + grid: { span: 4 }, + }, + $validEndTime: { + grid: { span: 9 }, + }, + $dateType01: { + grid: { span: 4 }, + }, + $registrationCapital: { + grid: { span: 12 }, + }, + $unit: { + spanLabelFixed: 20, + grid: { span: 3 }, + }, + }; + } + getProvinceData() { + // return this.service.request(this.service.$api_getRegionByCode, { regionCode: '' }).pipe( + // map(res => { + // const result: any = [] + // if (res) { + // res.map((m: any) => { + // const item = { label: m.name, value: m.regionCode } + // result.push(item) + // }); + // } + // return result + // }) + // ); + } + checkIdCard(imgurl: any, side: any, type: any) { + // 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 + const params = { + idCardUrl: imgurl, + side, + }; + // this.service.request(this.service.$api_checkIdCard, params).subscribe((res) => { + // if (res) { + // if (type === 0) { + // // 法定代表人身份证 + // if (side === 'front') { + // // 正面 + // this.sf.setValue('/name', res.name); + // this.sf.setValue('/certificateNumber', res.number); + // } + // } + // } + // }); + } + checkDriverCard(imgurl: any, side: any, type: any) { + // 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 + const params = { + driverLicenseUrl: imgurl, + side, + }; + // this.service.request(this.service.$api_recognizeDriverLicense, params).subscribe((res) => { + // if (res) { + // if (type === 0) { + // // 法定代表人身份证 + // if (side === 'front') { + // // 正面 + // this.sf1.setValue('/licenseNo', res.number); + // this.sf1.setValue('/driverModel', res.number); + // this.sf1.setValue('/validStartTime', res.validFrom); + // this.sf1.setValue('/validEndTime', res.validTo); + // this.sf1.setValue('/signingOrganization', res.issuingAuthority); + // } + // } + // } + // }); + } + close(): void { + this.modal.destroy(); + } + showExample(){ + this.showCardFlag = !this.showCardFlag + } + showJopExample(){ + this.showJopFlag = !this.showJopFlag + } + submitForm(){ + const params:any = { + enterpriseId: this.companyData.enterpriseId, + enterpriseProjectId: this.companyData.projectId, + source: 1, + mobile: this.mobile, + identityInfoDTO:{ + ...this.sf.value, + certificatePhotoFront: this.detailData.certificatePhotoFront, + certificatePhotoBack: this.detailData.certificatePhotoBack, + }, + userDriverLicenseDTO: { + ...this.sf1.value, + certificatePhoto: this.detailData.userDriverLicenseDTO.certificatePhoto, + }, + userPracticeSeniorityDTO: { + ...this.sf2.value, + certificatePhoto: this.detailData.userPracticeSeniorityDTO.certificatePhoto, + }, + }; + params.identityInfoDTO.certificatePhotoFrontWatermark = this.sf?.value.certificatePhotoFrontWatermark + params.identityInfoDTO.certificatePhotoBackWatermark = this.sf?.value.certificatePhotoBackWatermark + params.userDriverLicenseDTO.certificatePhotoWatermark = this.sf1?.value.certificatePhotoWatermark + params.userPracticeSeniorityDTO.certificatePhotoWatermark = this.sf2?.value.certificatePhotoWatermark + delete params.identityInfoDTO.titleA; + delete params.identityInfoDTO.titleB; + delete params.identityInfoDTO.titleC; + delete params.userDriverLicenseDTO.tipsA; + delete params.userPracticeSeniorityDTO.tipsC; + delete params.showName + // this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe(res => { + // if(res){ + // this.service.msgSrv.success('添加成功') + // this.close() + // } + // }) + } +} diff --git a/src/app/routes/supply-management/components/addmodal/addmodal.component.html b/src/app/routes/supply-management/components/addmodal/addmodal.component.html new file mode 100644 index 00000000..a5b6c0c4 --- /dev/null +++ b/src/app/routes/supply-management/components/addmodal/addmodal.component.html @@ -0,0 +1,48 @@ + + +
+ +
+ +
+ +
+ + + +
+ +
+
+ + + +
+
+
+ + +
+ + + + {{item.carModel}};{{item.carLength}};{{item.carLoad}}; + + +
+ + + +
+ \ No newline at end of file diff --git a/src/app/routes/supply-management/components/addmodal/addmodal.component.less b/src/app/routes/supply-management/components/addmodal/addmodal.component.less new file mode 100644 index 00000000..700887cc --- /dev/null +++ b/src/app/routes/supply-management/components/addmodal/addmodal.component.less @@ -0,0 +1,38 @@ + +:host{ + ::ng-deep{ + .ant-card-meta-title{ + display: flex; + align-items: center; + justify-content: space-between; + } + .nameBox { + display: flex; + align-items: baseline; + .name{ + margin: 0 10px 0 0; + } + } + .ant-badge-status{ + color: #666 + } + + } + .title{ + clear: both; + margin: 10px 0; + font-weight: bold; + font-size: 14px; + } + .noContent{ + width: 100%; + min-height: 300px; + font-size: 16px; + line-height: 300px; + text-align: center; + span { + color: #1890ff; + cursor: pointer; + } + } +} \ No newline at end of file diff --git a/src/app/routes/supply-management/components/addmodal/addmodal.component.spec.ts b/src/app/routes/supply-management/components/addmodal/addmodal.component.spec.ts new file mode 100644 index 00000000..b15da72d --- /dev/null +++ b/src/app/routes/supply-management/components/addmodal/addmodal.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { CarAddmodalComponent } from './addmodal.component'; + +describe('CarAddmodalComponent', () => { + let component: CarAddmodalComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ CarAddmodalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CarAddmodalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/addmodal/addmodal.component.ts b/src/app/routes/supply-management/components/addmodal/addmodal.component.ts new file mode 100644 index 00000000..feaa1445 --- /dev/null +++ b/src/app/routes/supply-management/components/addmodal/addmodal.component.ts @@ -0,0 +1,179 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import { cacheConf } from '@conf/cache.conf'; +import { STColumn, STComponent, STChange, STData } from '@delon/abc/st'; +import { SFUISchema, SFSchema, SFComponent } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { EACacheService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { CarAddDriverComponent } from '../add-driver/add-driver.component'; + +@Component({ + selector: 'app-car-addmodal', + templateUrl: './addmodal.component.html', + styleUrls: ['./addmodal.component.less'] +}) +export class CarAddmodalComponent implements OnInit { + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + _$expand = false; + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + tableData: any = []; + companyData: any = {}; + flag = false + constructor( + private modal: NzModalRef, + private eaCacheSrv: EACacheService, + public service: SupplyManagementService, private router: Router, private ar: ActivatedRoute, + private modalHelper: ModalHelper + ) { } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { ...params }; + } + + /** + * 选中行 + */ + get selectedRows() { + return this.st?.list.filter((item: any) => item.checked) || []; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.companyData = this.eaCacheSrv.get(cacheConf.env) + this.initSF(); + this.initST() + this.initData() + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + mobile: { title: '司机手机号', type: 'string', maxLength: 11, ui: { showRequired: false, placeholder: '请输入司机手机号', } }, + }, + }; + this.ui = { + '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 }, enter: () => this.st?.load(1) }, + $time: { grid: { span: 24 } }, + }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '司机头像', type: 'img', index: 'avatar', className: 'text-center' }, + { title: '司机姓名', index: 'name', className: 'text-center' }, + { title: '当前车辆', index: 'carNo', className: 'text-center' }, + { title: '车辆信息', render: 'carModel', className: 'text-center' }, + { + title: '个人认证状态', + index: 'identityStatus', + className: 'text-center', + type: 'enum', + enum: { + 10: '待审核', + 20: '已成功', + 30: '已驳回', + 40: '证件过期', + } + }, + { title: '驾驶证类型', index: 'createTime', className: 'text-center' }, + { + title: '操作', + width: '180px', + className: 'text-center', + buttons: [ + { text: '添加', click: (_record: any) => this.add(_record) }, + ], + }, + ]; + } + initData(flag?: any) { + if (this.sf?.value.mobile) { + this.flag = flag + // this.service.request(this.service.$api_getCarCaptainByMobile, { mobile: this.sf?.value.mobile }).subscribe(res => { + // if (res.userId) { + // this.tableData = [res]; + // } else { + // this.tableData = [] + // } + // this.st.reload() + // }) + } + } + /** + * 数据列表状态变化事件 + */ + change(change: STChange) { + // console.log(change); + } + + /** + * 新增 + */ + add(item: any) { + const params: any = { + enterpriseId: this.companyData.enterpriseId, + enterpriseProjectId: this.companyData.projectId, + source: 1, + appUserId: item.appUserId ? item.appUserId : '', + mobile: item.mobile + } + // this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe(res => { + // if (res.data) { + // this.service.msgSrv.success('添加成功') + // } + // }) + } + addModal() { + this.modalHelper.create(CarAddDriverComponent, {mobile: this.sf?.value.mobile}, { size: 900 }).subscribe((res) => { + this.initData() + }); + //this.router.navigate(['/car/add']) + } + goBack() { + window.history.go(-1); + } + close(): void { + this.modal.destroy(); + } +} 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 f15c5a54..e9ef1f28 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,15 +1,59 @@
- -
- - +
+
+ +
+
+ +
-
\ No newline at end of file + +
+ + + + + + {{car.carNo}} - + {{car.carLength}}米,{{car.carLoad}}顿 - + 空闲 + 已被指派 + 未认证 + + + + + + {{item.name}} {{item.phone}} + 设置 + + + 空闲 + 已被指派 + 未认证 + + +
+ +
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 d7bed985..67b5319f 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 @@ -1,10 +1,19 @@ -import { Component, OnInit } from '@angular/core'; -import { STColumn } from '@delon/abc/st'; -import { SFSchema, SFUISchema } from '@delon/form'; -import { _HttpClient } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STChange, STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalRef } from 'ng-zorro-antd/modal'; import { SupplyManagementService } from '../../services/supply-management.service'; +import { SupplyManagementAddDriversComponent } from '../add-drivers/add-drivers.component'; + +import { CarAddmodalComponent } from '../addmodal/addmodal.component'; + +const BADGE: STColumnBadge = { + 1: { text: '空闲', color: 'success' }, + 2: { text: '未实名', color: 'error' }, + 3: { text: '在途', color: 'warning' }, +}; @Component({ selector: 'app-supply-management-assigned-car', @@ -16,15 +25,38 @@ export class SupplyManagementAssignedCarComponent implements OnInit { schema: SFSchema = {}; ui: SFUISchema = {}; columns: STColumn[] = []; + + @ViewChild('st') st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + status: string = 'anew'; + url = ''; // 请求的api地址 + params: any = {}; // 传进来的参数 + cardBADGE: STColumnBadge | any = { + 0: { text: '空闲', color: 'success' }, + 1: { text: '在途', color: 'warning' }, + 2: { text: '未认证', color: 'error' }, + }; + selectedRows: any = null; // 已选行 constructor( private modal: NzModalRef, private msgSrv: NzMessageService, - public service: SupplyManagementService + public service: SupplyManagementService, + private modalHelper: ModalHelper, ) { this.initSF(); this.initSt(); } + /** +* 查询参数 +*/ + get reqParams() { + return { + ...this.sf?.value, + }; + } + + /** * 初始化查询表单 */ @@ -32,24 +64,24 @@ export class SupplyManagementAssignedCarComponent implements OnInit { this.schema = { properties: { _$expand: { type: 'boolean', ui: { hidden: true } }, - no: { + nameOrPhone: { type: 'string', title: '', ui: { - placholder: '请输入司机姓名/手机号' + placeholder: '请输入司机姓名/手机号' } }, - no2: { + carNo: { type: 'string', title: '', ui: { - placholder: '请输入车牌号' + placeholder: '请输入车牌号' } }, }, type: 'object', }; - this.ui = { '*': { spanLabelFixed: 80, grid: { span: 12, gutter: 4 } } }; + this.ui = { '*': { spanLabelFixed: 10, grid: { span: 8, gutter: 1 } } }; } /** @@ -57,25 +89,79 @@ export class SupplyManagementAssignedCarComponent implements OnInit { */ initSt() { this.columns = [ - { width: 50, type: 'checkbox', className: 'text-center' }, - { title: '司机姓名', width: 80, index: 'owner', className: 'text-center' }, - { title: '手机号', index: 'goodsQuantity', width: 100, className: 'text-center' }, - { title: '车牌号', width: 100, index: 'carNo', className: 'text-center' }, - { title: '状态', index: 'status', width: 100, className: 'text-center' }, + { width: 50, type: 'radio', className: 'text-center' }, + { title: '司机姓名', width: 120, index: 'name', className: 'text-center' }, + { title: '手机号', index: 'telephone', width: 200, className: 'text-center' }, + { title: '车队长', render: 'carCaptain', className: 'text-center' }, + { title: '指定车辆', width: 300, render: 'carId', className: 'text-center' }, + { title: '状态', render: 'driverStatus', className: 'text-center', type: 'badge', badge: BADGE }, ]; } ngOnInit(): void { } - save(value: any): void { - this.service.request(`/user/${this.record.id}`, value).subscribe(res => { - this.msgSrv.success('保存成功'); - this.modal.close(true); + dataProcess(data: STData[]): STData[] { + return data.map((i, index) => { + i.carId = ''; + i.disabled = i.carStatus === '1'; + const defaultCar = i?.userCarLicenseDesensitizationVOList?.filter((item: any) => item.isDefault); + if (defaultCar.length > 0) { + i.carId = defaultCar[0].carId; + } + return i; + }); + } + + save(): void { + console.log(this.selectedRows); + if (this.selectedRows) { + const { carId, userId: driverId } = this.selectedRows; + const params: any = { carId, driverId }; + this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => { + if (res) { + this.modal.close(res); + } + }) + + } + } + + changeSt(e: STChange): void { + if (e?.type === 'loaded') this.selectedRows = null; + if (e?.type === 'radio') this.selectedRows = e?.radio; + console.log(this.selectedRows); + + } + /** + * 添加司机 + * @param item + */ + addDriver() { + this.modalHelper.create(CarAddmodalComponent, {}, { size: 900, modalOptions: { nzMaskClosable: false } }).subscribe((res) => { + if (res) this.st.reload(); + }); + } + + /** + * 设置车队长 + */ + setCarCaptain(item: any) { + this.modalHelper.create(SupplyManagementAddDriversComponent, { dirvierInfo: item }, { + size: 900, + modalOptions: { nzMaskClosable: false, nzTitle: '设置' } + } + ).subscribe((res) => { + if (res) this.st.reload(); }); } close(): void { this.modal.destroy(); } + + reset() { + this.sf.reset(); + this.st.load(1); + } } 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 dd1744ea..cd74cfd7 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 @@ -821,7 +821,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') , maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') , number: res?.goodsInfoVOList[0]?.number , - goodsType: res?.goodsInfoVOList[0]?.goodsType , + goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName , modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId , resourceId: res?.goodsInfoVOList[0]?.resourceId , rule: res?.goodsInfoVOList[0]?.rule , 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 1a7f44a1..78828e09 100644 --- a/src/app/routes/supply-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts @@ -288,7 +288,7 @@ export class SupplyManagementVehicleComponent implements OnInit { }, { text: '重新指派', - // click: (_record) => this.assignedCar(_record), + click: (_record) => this.assignedCar(_record), // iif: item => item.auditStatus === 2, }, ], @@ -377,17 +377,28 @@ export class SupplyManagementVehicleComponent implements OnInit { /** * 重新指派 */ - assignedCar(item: any) { + assignedCar(item: any) { + const { resourceId } = item; const modalRef = this.modal.create({ nzTitle: '指派熟车', - nzWidth: '800px', + nzWidth: '1200px', nzContent: SupplyManagementAssignedCarComponent, nzComponentParams: { i: item, + status: 'anew', + // url: this.service.$api_save_assign_vehicle, + params: { resourceId } }, nzFooter: null, + + }); + modalRef.afterClose.subscribe((result) => { + if (result) { + this.st.reload(); + } }); } + /** * 审核 */ diff --git a/src/app/routes/supply-management/supply-management.module.ts b/src/app/routes/supply-management/supply-management.module.ts index 5d72caf9..100b2898 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-20 13:38:26 + * @LastEditTime: 2021-12-21 11:04:45 * @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 @@ -26,6 +26,8 @@ import { PublishchooseFamifiarAddComponent } from './components/choose-famifiar/ import { SupplyManagementBulkPublishComponent } from './components/bulk-publish/bulk-publish.component'; import { PublishAddressListComponent } from './components/onecar-publish/address-list/address-list.component'; import { PublishSuccessComponent } from './components/onecar-publish/publish-success/publish-success.component'; +import { CarAddDriverComponent } from './components/add-driver/add-driver.component'; +import { CarAddmodalComponent } from './components/addmodal/addmodal.component'; const COMPONENTS: Type[] = [ @@ -45,8 +47,9 @@ const COMPONENTS: Type[] = [ PublishchooseFamifiarAddComponent, SupplyManagementBulkPublishComponent, PublishAddressListComponent, - PublishSuccessComponent - + PublishSuccessComponent, + CarAddDriverComponent, + CarAddmodalComponent ]; @NgModule({ 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 33c951b7..75b6f1ec 100644 --- a/src/app/routes/waybill-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/waybill-management/components/vehicle/vehicle.component.ts @@ -6,6 +6,8 @@ import { ShipperBaseService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; import { of } from 'rxjs'; import { map } from 'rxjs/operators'; +import { VehicleSureArriveComponent } from 'src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component'; +import { VehicleSureDepartComponent } from 'src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component'; import { WaybillManagementServe } from '../../services/waybill-management.service'; @@ -333,6 +335,14 @@ tabs = { text: '查看评价', click: (_record) => this.viewEvaluate(_record), }, + { + text: '确认发车', + click: (_record) => this.sureDepart(_record), + }, + { + text: '确认到车', + click: (_record) => this.sureArrive(_record), + }, ], }, ]; @@ -511,4 +521,31 @@ tabs = { } }) } + // *确认发车 + + sureDepart(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认发车', + nzWidth: '50%', + nzContent: VehicleSureDepartComponent, + nzComponentParams: { + i: item, + Status: 1 + }, + nzFooter: null + }); + } + // 确认到车 + sureArrive(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认到车', + nzWidth: '50%', + nzContent: VehicleSureArriveComponent, + nzComponentParams: { + i: item, + Status: 1 + }, + nzFooter: null + }); + } } diff --git a/src/app/routes/waybill-management/services/waybill-management.service.ts b/src/app/routes/waybill-management/services/waybill-management.service.ts index 894775db..f2886c03 100644 --- a/src/app/routes/waybill-management/services/waybill-management.service.ts +++ b/src/app/routes/waybill-management/services/waybill-management.service.ts @@ -2,7 +2,7 @@ import { WaybillManagementBulkComponent } from './../components/bulk/bulk.compon /* * @Author: your name * @Date: 2021-12-07 14:52:29 - * @LastEditTime: 2021-12-18 16:06:43 + * @LastEditTime: 2021-12-20 19:17:22 * @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\waybill-management\services\waybill-management.service.ts @@ -39,7 +39,14 @@ export class WaybillManagementServe extends BaseService { // 大宗确认发车 $api_get_insertBulkStartCarInfo= `/api/sdc/wayBillOperate/insertBulkStartCarInfo`; - + // 整车确认发车 + $api_get_insertWholeStartCarInfo= `/api/sdc/wayBillOperate/insertWholeStartCarInfo`; + // 整车确认到车 + $api_get_insertWholeUnloadCarInfo = `/api/sdc/wayBillOperate/insertWholeUnloadCarInfo`; + // 大宗确认到车 + $api_get_insertBulkUnloadCarInfo = `/api/sdc/wayBillOperate/insertBulkUnloadCarInfo`; + // 确认到车界面信息(两个只能看的图片) + $api_get_getUnloadCarInfo = `/api/sdc/wayBillOperate/getUnloadCarInfo`; constructor(public injector: Injector) { super(injector) }