货源修改

This commit is contained in:
wangshiming
2021-12-03 15:22:55 +08:00
parent a9ef21e333
commit db95de90fb
42 changed files with 2466 additions and 7 deletions

View File

@ -0,0 +1,29 @@
<nz-card>
<div nz-row nzGutter="20">
<div nz-col nzSpan="13">
<div style="height: 120px;">
<div class="mb-md" nz-row>
<button nzType="primary" (click)="add()" nz-button>
<i nz-icon nzType="plus"></i>
添加熟车
</button>
</div>
<sf mode="search" [schema]="searchSchema" (formSubmit)="st.reset($event)" (formReset)="st.reset($event)"></sf>
</div>
<st #st [data]="url" [columns]="columns"></st>
</div>
<div nz-col nzSpan="11">
<div style="height: 120px;"></div>
<st #selectedST [data]="url" [columns]="selectedColumn"></st>
</div>
</div>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" nzTitle="添加司机" (nzOnCancel)="handleCancel()" nzMaskClosable="false">
<div *nzModalContent>
<sf [schema]="addCarSchema" [button]="'none'"></sf>
</div>
<div *nzModalFooter>
<button nz-button nzType="default" (click)="handleCancel()">取消</button>
<button nz-button nzType="primary" (click)="handleOk()" [nzLoading]="service.http.loading">确定</button>
</div>
</nz-modal>

View File

@ -0,0 +1,24 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { SupplyManagementAddDriversComponent } from './add-drivers.component';
describe('SupplyManagementAddDriversComponent', () => {
let component: SupplyManagementAddDriversComponent;
let fixture: ComponentFixture<SupplyManagementAddDriversComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ SupplyManagementAddDriversComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SupplyManagementAddDriversComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,152 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STColumnButton, STComponent, STData } from '@delon/abc/st';
import { SFSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { SupplyManagementService } from '../../services/supply-management.service';
@Component({
selector: 'app-supply-management-add-drivers',
templateUrl: './add-drivers.component.html',
})
export class SupplyManagementAddDriversComponent implements OnInit {
url = `/user?_allow_anonymous=true`;
i: any;
searchSchema: SFSchema = {
properties: {
no: {
type: 'string',
title: '编号'
}
}
};
@ViewChild('st') private readonly st!: STComponent;
@ViewChild('selectedST') private readonly selectedST!: STComponent;
ui: SFUISchema = {
}
columns: STColumn[] = [];
selectedColumn: STColumn[] = [];
isVisible = false;
addCarSchema: SFUISchema = {
properties: {
mobile: {
type: 'string',
title: '司机手机号',
ui: {
placeholder: '请输入'
}
},
}
};
constructor(public service: SupplyManagementService, private modal: ModalHelper) { }
ngOnInit(): void {
this.initSF();
this.initST();
}
/**
* 初始化查询表单
*/
initSF() {
this.searchSchema = {
properties: {
mobile: {
type: 'string',
title: '',
ui: {
placeholder: '请输入司机姓名/手机号'
}
},
no: {
type: 'string',
title: '',
ui: {
placeholder: '请输入车牌号'
}
},
},
type: 'object',
};
this.ui = { '*': { spanLabelFixed: 80, grid: { span: 8, gutter: 4 } } };
}
/**
* 初始化数据列表
*/
initST() {
this.columns = [
{
title: '司机姓名',
width: '100px',
className: 'text-center',
render: 'goodsId'
},
{ title: '手机号', render: 'externalSn', width: '120px', className: 'text-center' },
{ title: '货源类型', index: 'linkUrl', width: '120px', className: 'text-center' },
{
title: '车牌号',
className: 'text-center',
width: '120px',
}, {
title: '状态',
className: 'text-center',
width: '120px',
},
{
title: '操作',
fixed: 'right',
width: '200px',
className: 'text-center',
buttons: [
{
text: '选择',
iif: (item: STData, btn: STColumnButton, column: STColumn) => item?.status > 0,
iifBehavior: 'disabled'
// click: (_record) => this.editOne(_record),
},
],
},
];
this.selectedColumn = [
{
title: '司机姓名',
width: '100px',
className: 'text-center',
render: 'goodsId'
},
{ title: '手机号', render: 'externalSn', width: '120px', className: 'text-center' },
{ title: '车牌号', index: 'linkUrl', width: '120px', className: 'text-center' },
{
title: '操作',
fixed: 'right',
width: '200px',
className: 'text-center',
buttons: [
{
text: '移除',
// click: (_record) => this.editOne(_record),
},
],
},
];
}
/**
* 添加熟车
*/
add(): void {
this.isVisible = true;
}
handleCancel() {
this.isVisible = false;
}
handleOk() {
}
}