车辆对接
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
<nz-spin *ngIf="!i" class="modal-spin"></nz-spin>
|
||||
<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)" [disabled]="!sf.valid">确定</button>
|
||||
</div>
|
||||
@ -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: '<i>是否确定立即取消运单!</i>',
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user