This commit is contained in:
wangshiming
2022-02-22 14:30:47 +08:00
parent c9be671576
commit c2ff30bb38
7 changed files with 187 additions and 7 deletions

View File

@ -0,0 +1,36 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-02-22 13:53:29
* @LastEditors : Shiming
* @LastEditTime : 2022-02-22 14:25:40
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\cancel-confirm\\cancel-confirm.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<sv-container col="1">
<sv label="货主">
<div>{{ i.shipperAppUserName }}</div>
</sv>
<sv label="司机">
<div>{{ i.driverName }} / {{ i.driverPhone }} / {{ i.carNo }}</div>
</sv>
<sv label="收款人">
<div>{{ i.payeeName }} / {{ i.payeePhone }}</div>
</sv>
<sv label="退款金额">
<p *ngFor="let data of i?.mybidDetailInfo; let index = index">
<label *ngIf="data?.paymentStatus == 3">
<span>{{data?.expenseName}}</span>
<span>{{ data.price | number: '0.2-2' }}</span>
</label>
</p>
</sv>
<sv label=""> 已选择 {{ index }} 项,运费:{{ List }},附加费:{{ ATTPrice }} </sv>
</sv-container>
<sf #sf mode="edit" [schema]="schema" [ui]="ui" button="none"></sf>
<div class="modal-footer">
<button nz-button type="button" (click)="close()">取消</button>
<button nz-button type="submit" nzType="primary" (click)="save(sf.value)">确认</button>
</div>

View File

@ -0,0 +1,113 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-02-22 13:53:29
* @LastEditors : Shiming
* @LastEditTime : 2022-02-22 14:25:39
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\cancel-confirm\\cancel-confirm.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
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-confirm',
templateUrl: './cancel-confirm.component.html'
})
export class OneCarOrderCancelConfirmComponent implements OnInit {
i: any;
index: any;
ATTPrice: any;
List: any;
@ViewChild('sf', { static: false }) sf!: SFComponent;
schema: SFSchema = {};
ui: SFUISchema = {};
constructor(
private modalRef: NzModalRef,
private modal: NzModalService,
private msgSrv: NzMessageService,
public service: OrderManagementService
) {}
ngOnInit(): void {
console.log(this.i);
this.initSF();
this.initData()
}
initSF() {
this.schema = {
properties: {
remarks: {
type: 'string',
title: '备注',
maxLength: 50,
ui: {
widget: 'textarea',
autosize: { minRows: 6, maxRows: 6 }
} as SFTextareaWidgetSchema
}
}
};
this.ui = {
'*': {
spanLabelFixed: 100,
grid: { span: 20 }
}
};
}
initData() {
let indexId = 0
let index = 0
this.i?.mybidDetailInfo.forEach((ele: any) => {
if (ele?.paymentStatus == 3) {
indexId += 1;
index += ele?.price;
}
if (ele.expenseCode === '"ATT"'){
if(ele?.paymentStatus == 3) {
this.ATTPrice = ele.price;
} else {
this.ATTPrice = 0;
}
}
});
this.index = indexId
this.List = index
console.log(this.index)
console.log(this.List)
}
save(value: any): void {
if (!this.sf.value.remarks) {
this.service.msgSrv.error('请填写备注信息!');
return;
}
const params = { id: this.i?.id, ...this.sf.value, agree: '1' };
// this.service.request(this.service.$api_cancelOrderConfirmed, params).subscribe(res => {
// if (res) {
// this.service.msgSrv.success('操作成功!');
// this.modalRef.close(true);
// } else {
// this.service.msgSrv.error(res.msg);
// }
// });
}
close(): void {
this.modalRef.close(true);
}
}