This commit is contained in:
Taric Xin
2022-01-06 17:09:14 +08:00
parent 55da844c79
commit 3261a3fc5a
3 changed files with 115 additions and 112 deletions

View File

@ -7,56 +7,53 @@
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\choose-famifiar\choose-famifiar.component.html
-->
<button nz-button nzType="primary" style="margin-bottom: 24px" (click)="add()"><i nz-icon
nzType="plus"></i>添加司机</button>
nzType="plus"></i>添加司机</button>
<!-- 搜索区 -->
<div nz-row nzGutter="8">
<div nz-col [nzSpan]="12">
<div nz-row nzGutter="8">
<div nz-col [nzSpan]="18">
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="6">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<div nz-col [nzSpan]="12">
<div nz-row nzGutter="8">
<div nz-col [nzSpan]="18">
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="6">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
</div>
</div>
</div>
</div>
</div>
<div nz-row nzGutter="8">
<div nz-col [nzSpan]="12">
<!-- 数据列表 -->
<st #st [bordered]="true" [data]="service.$api_getList_card" [columns]="columns" size="small"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } , process: reqProcess}"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loadingDelay]="500" [loading]="service.http.loading" [widthMode]="{ type: 'strict' }" [scroll]="{ x: '600px' }"
style="margin-top: 22px;">
<ng-template st-row="userCarLicenseDesensitizationVOList" let-item let-index="index">
<nz-select [(ngModel)]="item.default" (ngModelChange)="carChange($event, item)" style="width: 100%;">
<nz-option nzValue="" nzLabel="不限"></nz-option>
<nz-option [nzValue]="cart" [nzLabel]="cart.carNo"
*ngFor="let cart of item.userCarLicenseDesensitizationVOList">
</nz-option>
</nz-select>
</ng-template>
</st>
</div>
<div nz-col [nzSpan]="12">
<!-- 选中列表 -->
<div>已选择{{ st2Data.length }}位司机</div>
<st #st2 [bordered]="true" [data]="st2Data" [columns]="columns2" size="small"
[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] }"
[loadingDelay]="500" [loading]="service.http.loading" [widthMode]="{ type: 'strict' }" [scroll]="{ x: '600px' }">
<ng-template st-row="captain" let-item let-index="index">
<span>{{ item.captainName }}&nbsp;{{ item.captainPhone }}</span> &nbsp;
<a (click)="setCaptain(item,index)">设置</a>
</ng-template>
</st>
</div>
<div nz-col [nzSpan]="12">
<!-- 数据列表 -->
<st #st *ngIf="columns" [bordered]="true" [data]="service.$api_getList_card" [columns]="columns" size="small"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } , process: reqProcess}"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loadingDelay]="500" [loading]="service.http.loading" [widthMode]="{ type: 'strict' }" [scroll]="{ x: '600px' }"
style="margin-top: 22px;width: 100%;">
<ng-template st-row="userCarLicenseDesensitizationVOList" let-item let-index="index">
<nz-select [(ngModel)]="item.default" (ngModelChange)="carChange($event, item)" style="width: 100%;">
<nz-option nzValue="" nzLabel="不限"></nz-option>
<nz-option [nzValue]="cart" [nzLabel]="cart.carNo"
*ngFor="let cart of item.userCarLicenseDesensitizationVOList">
</nz-option>
</nz-select>
</ng-template>
</st>
</div>
<div nz-col [nzSpan]="12">
<!-- 选中列表 -->
<div>已选择{{ st2Data.length }}位司机</div>
<st #st2 *ngIf="columns2" [bordered]="true" [data]="st2Data" [columns]="columns2" size="small"
[page]="{ show: false }" [scroll]="{ x: '600px',y:'300px' }" style="width: 100%;">
<ng-template st-row="captain" let-item let-index="index">
<span>{{ item.captainName }}&nbsp;{{ item.captainPhone }}</span> &nbsp;
<a (click)="setCaptain(item,index)">设置</a>
</ng-template>
</st>
</div>
</div>
<div *nzModalFooter>
<button nz-button nzType="default" (click)="cancel()">取消</button>
<button nz-button nzType="primary" (click)="ok()">发布并指派给司机</button>
</div>
<button nz-button nzType="default" (click)="cancel()">取消</button>
<button nz-button nzType="primary" (click)="ok()">发布并指派给司机</button>
</div>

View File

@ -1,4 +1,4 @@
import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { ChangeDetectorRef, Component, Input, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
@ -46,7 +46,8 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
private drawerService: NzDrawerService,
public service: SupplyManagementService,
private modalService: NzModalService,
private modalHelper: ModalHelper
private modalHelper: ModalHelper,
private cdr: ChangeDetectorRef
) {}
/**
@ -60,8 +61,11 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
}
ngOnInit() {
this.initSF();
this.initST();
this.initST2();
setTimeout(() => {
this.initST();
this.initST2();
}, 200);
}
initSF() {
@ -94,11 +98,13 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
this.columns = [
{
title: '司机姓名',
index: 'name'
index: 'name',
width: 120
},
{
title: '手机号',
index: 'telephone'
index: 'telephone',
width: 120
},
{
title: '指定车辆',
@ -109,6 +115,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
title: '状态',
className: 'text-center',
index: 'certificationStatus',
width: 120,
type: 'badge',
badge: {
'-1': { text: '未提交', color: 'default' },
@ -120,6 +127,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
{
title: '操作',
className: 'text-center',
width: 80,
buttons: [
{
text: '选择',
@ -136,7 +144,8 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
this.columns2 = [
{
title: '司机姓名',
index: 'name'
index: 'name',
width: 120
},
{
title: '手机号',
@ -146,7 +155,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
{
title: '车队长',
render: 'captain',
width: '200px'
width: '100px'
},
{
title: '指定车辆',
@ -156,6 +165,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
{
title: '操作',
className: 'text-center',
width: 80,
buttons: [
{
text: '移除',