From 3935efb5ab9ba2f80896257203579d59f1c69d6b Mon Sep 17 00:00:00 2001 From: wangshiming Date: Fri, 25 Mar 2022 14:22:47 +0800 Subject: [PATCH] fix bug --- .../compliance-audit.component.ts | 20 ++- .../modal/audit/appeal/appeal.component.html | 7 + .../modal/audit/appeal/appeal.component.ts | 131 ++++++++++++++++++ .../order-management.module.ts | 6 +- .../components/audit/audit.component.ts | 2 +- 5 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 src/app/routes/order-management/modal/audit/appeal/appeal.component.html create mode 100644 src/app/routes/order-management/modal/audit/appeal/appeal.component.ts diff --git a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts index f4477ef8..8adef7ef 100644 --- a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts +++ b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts @@ -10,6 +10,7 @@ import { ConfirReceiptComponent } from '../../modal/bulk/confir-receipt/confir-r import { of } from 'rxjs'; import { ShipperBaseService } from '@shared'; import { Router } from '@angular/router'; +import { OneCarOrderAppealComponent } from '../../modal/audit/appeal/appeal.component'; @Component({ selector: 'app-order-management-compliance-audit', @@ -397,7 +398,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit { buttons: [ { text: '查看申诉记录', - click: _record => console.log('1'), + click: _record => this.appeal(_record), // iif: item => item.billStatus == '5' }, { @@ -489,6 +490,23 @@ export class OrderManagementComplianceAuditComponent implements OnInit { get queryFieldCount(): number { return Object.keys(this.schema?.properties || {}).length; } + // 申诉记录 + appeal(item: any) { + const modalRef = this.modal.create({ + nzTitle: '申诉', + nzContent: OneCarOrderAppealComponent, + nzComponentParams: { + i: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res) => { + if(res){ + this.resetSF; + this.st.load(); + } + }); + } /** * 浮动费用查看 */ diff --git a/src/app/routes/order-management/modal/audit/appeal/appeal.component.html b/src/app/routes/order-management/modal/audit/appeal/appeal.component.html new file mode 100644 index 00000000..d3e53fd1 --- /dev/null +++ b/src/app/routes/order-management/modal/audit/appeal/appeal.component.html @@ -0,0 +1,7 @@ + + + + diff --git a/src/app/routes/order-management/modal/audit/appeal/appeal.component.ts b/src/app/routes/order-management/modal/audit/appeal/appeal.component.ts new file mode 100644 index 00000000..9a7eada4 --- /dev/null +++ b/src/app/routes/order-management/modal/audit/appeal/appeal.component.ts @@ -0,0 +1,131 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { + SFComponent, + SFCustomWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema, + SFUploadWidgetSchema +} from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { Observable, Observer } from 'rxjs'; +import { OrderManagementService } from '../../../services/order-management.service'; + +@Component({ + selector: 'app-order-management-appeal', + templateUrl: './appeal.component.html' +}) +export class OneCarOrderAppealComponent implements OnInit { + record: any = {}; + i: any; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + constructor( + private modalRef: NzModalRef, + private modal: NzModalService, + private msgSrv: NzMessageService, + public http: _HttpClient, + public service: OrderManagementService + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + abnormalCause: { + type: 'string', + title: '异常原因', + default: this.i.abnormalCause, + readOnly: true, + ui: { + widget: 'textarea', + autosize: { minRows: 4, maxRows: 6 } + } as SFTextareaWidgetSchema + }, + representationsCause: { + type: 'string', + title: '申诉原因', + ui: { + widget: 'dict-select', + params: { dictKey: 'bill:representation:reason' }, + containsAllLabel: false, + placeholder: '请选择', + errors: { required: '请选择' } + } + }, + representationsDescribe: { + type: 'string', + title: '申诉描述', + maxLength: 100, + ui: { + widget: 'textarea', + autosize: { minRows: 4, maxRows: 6 } + } as SFTextareaWidgetSchema + }, + fileArr: { + type: 'string', + title: '上传凭证', + ui: { + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg', + limit: 5, + limitFileCount: 5, + resReName: 'data.fullFilePath', + urlReName: 'data.fullFilePath', + widget: 'upload', + descriptionI18n: '不超过5张,单张大小不超过5M,支持.jpg、.jpeg和 .png格式', + name: 'multipartFile', + multiple: true, + listType: 'picture-card', + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } as SFUploadWidgetSchema + } + }, + required: ['representationsCause', 'representationsDescribe'] + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 20 } + } + }; + } + save(value: any): void { + // if (!this.sf.valid){ + // this.sf.validator({ emitError: true }); + // return; + // } + // this.service.request(this.service.$api_addCompleteVehicleRepresentations, { id: this.i?.id, ...this.sf.value }).subscribe(res => { + // if (res) { + // this.service.msgSrv.success('申诉成功!'); + // this.modalRef.close(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } + + close(): void { + this.modalRef.destroy(); + } +} diff --git a/src/app/routes/order-management/order-management.module.ts b/src/app/routes/order-management/order-management.module.ts index b71b0fda..87ceaafd 100644 --- a/src/app/routes/order-management/order-management.module.ts +++ b/src/app/routes/order-management/order-management.module.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-06 09:24:00 * @LastEditors : Shiming - * @LastEditTime : 2022-02-22 13:55:06 + * @LastEditTime : 2022-03-25 14:10:36 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\order-management.module.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -24,6 +24,7 @@ import { OrderManagementVehicleDetailChangeComponent } from './components/vehicl import { OrderManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component'; import { OrderManagementVehicleComponent } from './components/vehicle/vehicle.component'; +import { OneCarOrderAppealComponent } from './modal/audit/appeal/appeal.component'; import { orderManagementVoucherViewComponent } from './modal/audit/voucher-view/voucher-view.component'; import { ConfirReceiptComponent } from './modal/bulk/confir-receipt/confir-receipt.component'; import { UpdateFreightComponent } from './modal/bulk/update-freight/update-freight.component'; @@ -64,7 +65,8 @@ const COMPONENTS: Type[] = [ orderManagementVoucherViewComponent, OrderManagementComplianceAuditComponent, OneCarOrderCancelConfirmComponent, - OneCarOrderViewtrackComponent + OneCarOrderViewtrackComponent, + OneCarOrderAppealComponent ]; @NgModule({ diff --git a/src/app/routes/vehicle/components/audit/audit.component.ts b/src/app/routes/vehicle/components/audit/audit.component.ts index cc18a6f5..047604d4 100644 --- a/src/app/routes/vehicle/components/audit/audit.component.ts +++ b/src/app/routes/vehicle/components/audit/audit.component.ts @@ -14,7 +14,7 @@ import { CarSettleCarauthComponent } from '../list/carauth/carauth.component'; }) export class VehicleComponentsAuditComponent implements OnInit { _$expand = false; - resourceStatus: any; + resourceStatus: any = 1; defaultTabs = 1; ui!: SFUISchema; schema!: SFSchema;