车辆对接
This commit is contained in:
@ -0,0 +1,59 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-24 15:38:08
|
||||
* @LastEditTime: 2022-01-05 21:02:17
|
||||
* @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\sys-setting\components\crm-management\crm-management.component.html
|
||||
-->
|
||||
<page-header-wrapper title="异常上报">
|
||||
</page-header-wrapper>
|
||||
|
||||
<nz-card >
|
||||
<div nz-row nzGutter="8">
|
||||
<!-- 查询字段小于或等于3个时,不显示伸缩按钮 -->
|
||||
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
|
||||
<sf #sf [schema]="schema" [ui]="ui" [mode]="'search'" [disabled]="!sf?.valid" [loading]="service.http.loading"
|
||||
(formSubmit)="st?.load(1)" (formReset)="resetSF()"></sf>
|
||||
</div>
|
||||
|
||||
<!-- 查询字段大于3个时,根据展开状态调整布局 -->
|
||||
<ng-container *ngIf="queryFieldCount > 4">
|
||||
<div nz-col [nzSpan]="_$expand ? 24 : 18">
|
||||
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
|
||||
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading"
|
||||
(click)="st?.load(1)">查询</button>
|
||||
<button nz-button nzType="primary"
|
||||
>导出</button>
|
||||
<button nz-button (click)="resetSF()">重置</button>
|
||||
<button nz-button nzType="link" (click)="expandToggle()">
|
||||
{{ !_$expand ? '展开' : '收起' }}
|
||||
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
|
||||
</button>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
</nz-card>
|
||||
|
||||
<nz-card class="content-box">
|
||||
|
||||
<div class="d-flex justify-content-end mb-sm">
|
||||
<div>
|
||||
<button nz-button nzType="primary" (click)="roleAction('',1)" >新增CRM客户</button>
|
||||
</div>
|
||||
</div>
|
||||
<st #st [data]="service.$api_get_crmCustomer_page" [columns]="columns"
|
||||
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
|
||||
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
|
||||
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
|
||||
[loading]="service.http.loading" [scroll]="{ y: '370px' }" (change)="stChange($event)">
|
||||
<ng-template st-row="customerType" let-item let-index="index">
|
||||
<div>
|
||||
<span *ngIf="item?.customerType == 1">客户</span>
|
||||
<span *ngIf="item?.customerType == 2">供应商</span>
|
||||
</div>
|
||||
</ng-template>
|
||||
</st>
|
||||
</nz-card>
|
||||
@ -0,0 +1,13 @@
|
||||
:host::ng-deep{
|
||||
.search-box{
|
||||
.ant-card-body{
|
||||
padding-bottom: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.content-box{
|
||||
.ant-card-body{
|
||||
padding-top: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,155 @@
|
||||
import { Component, OnInit, ViewChild, Type } from '@angular/core';
|
||||
import { STComponent, STColumn, STChange } from '@delon/abc/st';
|
||||
import { SFComponent, SFRadioWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { WaybillManagementServe } from '../../services/waybill-management.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-abnormal-appear',
|
||||
templateUrl: './abnormal-appear.component.html',
|
||||
styleUrls: ['./abnormal-appear.component.less']
|
||||
})
|
||||
export class WaybillManagementAbnormalAppearComponent implements OnInit {
|
||||
@ViewChild('st', { static: true })
|
||||
st!: STComponent;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
@ViewChild('sfFre', { static: false }) sfFre!: SFComponent;
|
||||
ui: SFUISchema = {};
|
||||
ui2: SFUISchema = {};
|
||||
schema: SFSchema = {};
|
||||
addSchema: SFSchema = {};
|
||||
_$expand = false;
|
||||
editText = '';
|
||||
formData :any;
|
||||
isVisible = false;
|
||||
edit = false;
|
||||
editId = false;
|
||||
|
||||
columns: STColumn[] = [
|
||||
{ title: '客户名称', index: 'customerName' },
|
||||
{ title: '客户简称', index: 'customerShortName' },
|
||||
{ title: '客户编码', index: 'customerCode' },
|
||||
{
|
||||
title: '操作',
|
||||
buttons: [
|
||||
{
|
||||
text: '编辑',
|
||||
click: item => this.roleAction(item, 2)
|
||||
},
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
selectedRows: any[] = [];
|
||||
|
||||
get reqParams (){
|
||||
return {
|
||||
...this.sf?.value,
|
||||
}};
|
||||
|
||||
constructor(public service: WaybillManagementServe, private nzModalService: NzModalService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initSF()
|
||||
this.initSFFre()
|
||||
}
|
||||
|
||||
stChange(e: STChange): void {
|
||||
switch (e.type) {
|
||||
case 'checkbox':
|
||||
this.selectedRows = e.checkbox!;
|
||||
break;
|
||||
case 'filter':
|
||||
this.st.load();
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 伸缩查询条件
|
||||
*/
|
||||
expandToggle(): void {
|
||||
this._$expand = !this._$expand;
|
||||
this.sf?.setValue('/_$expand', this._$expand);
|
||||
}
|
||||
/**
|
||||
* 查询字段个数
|
||||
*/
|
||||
get queryFieldCount(): number {
|
||||
return Object.keys(this.schema?.properties || {}).length;
|
||||
}
|
||||
initSF(){
|
||||
this.schema = {
|
||||
properties: {
|
||||
_$expand: { type: 'boolean', ui: { hidden: true } },
|
||||
customerName: {
|
||||
type: 'string',
|
||||
title: '客户名称',
|
||||
ui: { placeholder: '请输入' }
|
||||
},
|
||||
customerShortName: {
|
||||
type: 'string',
|
||||
title: '客户简称',
|
||||
ui: { placeholder: '请输入' }
|
||||
},
|
||||
customerCode: {
|
||||
type: 'string',
|
||||
title: '客户编码',
|
||||
ui: { placeholder: '请输入',
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
} }
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } };
|
||||
}
|
||||
initSFFre() {
|
||||
this.addSchema = {
|
||||
properties: {
|
||||
customerName: {
|
||||
type: 'string',
|
||||
title: '客户名称',
|
||||
ui: { placeholder: '请输入' }
|
||||
},
|
||||
customerShortName: {
|
||||
type: 'string',
|
||||
title: '客户简称',
|
||||
ui: { placeholder: '请输入' }
|
||||
},
|
||||
customerCode: {
|
||||
type: 'string',
|
||||
title: '客户编码',
|
||||
ui: { placeholder: '请输入' }
|
||||
},
|
||||
},
|
||||
required: ['customerName', 'customerShortName', 'customerCode']
|
||||
};
|
||||
this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
|
||||
}
|
||||
roleAction(value: any,item?: any) {
|
||||
|
||||
// this.service.request(this.service.$api_get_crmCustomer, {id: value.id}).subscribe((res: any) => {
|
||||
// console.log(res)
|
||||
// if(res) {
|
||||
// this.formData = res;
|
||||
// }
|
||||
// })
|
||||
}
|
||||
|
||||
deleteAction(item?: any) {
|
||||
this.nzModalService.error({
|
||||
nzTitle: '确认删除?',
|
||||
nzClosable: false,
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => {}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置表单
|
||||
*/
|
||||
resetSF() {
|
||||
this.sf.reset();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user