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

@ -100,35 +100,33 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
this.initSF4(); this.initSF4();
this.initSF6(); this.initSF6();
this.startInfo = [ this.startInfo = [
{ {
detailedAddress: '', detailedAddress: '',
appUserName: '', appUserName: '',
contractTelephone: '', contractTelephone: '',
latitude: '', latitude: '',
longitude: '', longitude: '',
province: '', province: '',
city: '', city: '',
area: '', area: '',
type: '1' type: '1'
} }
]; ];
this.endInfo = [ this.endInfo = [
{ {
detailedAddress: '', detailedAddress: '',
appUserName: '', appUserName: '',
contractTelephone: '', contractTelephone: '',
latitude: '', latitude: '',
longitude: '', longitude: '',
province: '', province: '',
city: '', city: '',
area: '', area: '',
type: '2' type: '2'
} }
] ];
} }
initSF1() { initSF1() {
this.schema1 = { this.schema1 = {
properties: { properties: {
@ -144,20 +142,20 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { if (!!q) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q}) .request(this.service.$api_enterpriceList, { enterpriseName: q })
.pipe(map((res: any[]) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any[]) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
return of([]); return of([]);
} }
}, },
change: (q: any) => { change: (q: any) => {
this.getRegionCode(q) this.getRegionCode(q);
}, },
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value, _$expand: (value: boolean) => value
}, }
} as SFSelectWidgetSchema, } as SFSelectWidgetSchema
}, },
enterpriseProjectId: { enterpriseProjectId: {
type: 'string', type: 'string',
@ -165,7 +163,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
ui: { ui: {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
allowClear: true, allowClear: true
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
// enterpriseInfoName: { // enterpriseInfoName: {
@ -183,11 +181,11 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value, _$expand: (value: boolean) => value
}, },
allowClear: true, allowClear: true,
asyncData: () => this.shipperSrv.getNetworkFreightForwarder(), asyncData: () => this.shipperSrv.getNetworkFreightForwarder()
}, }
}, },
deadlineTime: { deadlineTime: {
title: '截至日期', title: '截至日期',
@ -464,7 +462,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
submitParams: item, submitParams: item,
submitUrl: this.service.$api_save_bulk_assign submitUrl: this.service.$api_save_bulk_assign
}, },
nzWidth: 1300, nzWidth: 1300
}); });
modalRef.afterClose.subscribe(result => { modalRef.afterClose.subscribe(result => {
if (result) { if (result) {
@ -472,16 +470,16 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
} }
}); });
} }
// 打开下单完成页面 // 打开下单完成页面
openFinishPage(resourceObj: any = null) { openFinishPage(resourceObj: any = null) {
this.modalService.create({ this.modalService.create({
nzTitle: '', nzTitle: '',
nzContent: PublishSuccessComponent, nzContent: PublishSuccessComponent,
nzWidth: 900, nzWidth: 900,
nzFooter: null, nzFooter: null,
nzComponentParams: { type: 'bulk' } nzComponentParams: { type: 'bulk' }
}); });
} }
submit(submitType: string): void { submit(submitType: string): void {
// Object.keys(this.validateForm1.controls).forEach(key => { // Object.keys(this.validateForm1.controls).forEach(key => {
// this.validateForm1.controls[key].markAsDirty(); // this.validateForm1.controls[key].markAsDirty();
@ -533,26 +531,24 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
nzFooter: null, nzFooter: null,
nzComponentParams: { type: 'bulk' } nzComponentParams: { type: 'bulk' }
}); });
} else {
this.service.msgSrv.error(res.msg);
} }
}); });
} }
} }
// 获取城市列表 // 获取城市列表
getRegionCode(regionCode: any) { getRegionCode(regionCode: any) {
console.log(regionCode) console.log(regionCode);
return this.service return this.service
.request(this.service.$api_get_enterprise_project, { id: regionCode }) .request(this.service.$api_get_enterprise_project, { id: regionCode })
.pipe( .pipe(
map((res) => map(res =>
res.map((item: any) => ({ res.map((item: any) => ({
label: item.projectName, label: item.projectName,
value: item.id, value: item.id
})), }))
), )
) )
.subscribe((res) => { .subscribe(res => {
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res; this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res); this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
}); });
@ -661,15 +657,15 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
if (res) { if (res) {
this.sf3.getProperty('/goodsNameId')!.schema.enum = res; this.sf3.getProperty('/goodsNameId')!.schema.enum = res;
this.sf3.getProperty('/goodsNameId')!.widget.reset(res); this.sf3.getProperty('/goodsNameId')!.widget.reset(res);
if(this.sf3data?.goodsNameId){ if (this.sf3data?.goodsNameId) {
this.sf3.setValue('/goodsNameId',this.sf3data.goodsNameId); this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId);
} }
} else { } else {
this.service.msgSrv.error(res.msg); this.service.msgSrv.error(res.msg);
} }
}); });
} }
choose(){ choose() {
window.history.go(-1); window.history.go(-1);
} }
} }

View File

@ -7,56 +7,53 @@
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\choose-famifiar\choose-famifiar.component.html * @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 <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-row nzGutter="8">
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<div nz-row nzGutter="8"> <div nz-row nzGutter="8">
<div nz-col [nzSpan]="18"> <div nz-col [nzSpan]="18">
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'"></sf> <sf #sf [ui]="ui" [schema]="schema" [button]="'none'"></sf>
</div> </div>
<div nz-col [nzSpan]="6"> <div nz-col [nzSpan]="6">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st.load(1)">查询</button> <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button> <button nz-button (click)="resetSF()">重置</button>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<div nz-row nzGutter="8"> <div nz-row nzGutter="8">
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<!-- 数据列表 --> <!-- 数据列表 -->
<st #st [bordered]="true" [data]="service.$api_getList_card" [columns]="columns" size="small" <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 }" [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } , process: reqProcess}" [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] }" [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' }" [loadingDelay]="500" [loading]="service.http.loading" [widthMode]="{ type: 'strict' }" [scroll]="{ x: '600px' }"
style="margin-top: 22px;"> style="margin-top: 22px;width: 100%;">
<ng-template st-row="userCarLicenseDesensitizationVOList" let-item let-index="index"> <ng-template st-row="userCarLicenseDesensitizationVOList" let-item let-index="index">
<nz-select [(ngModel)]="item.default" (ngModelChange)="carChange($event, item)" style="width: 100%;"> <nz-select [(ngModel)]="item.default" (ngModelChange)="carChange($event, item)" style="width: 100%;">
<nz-option nzValue="" nzLabel="不限"></nz-option> <nz-option nzValue="" nzLabel="不限"></nz-option>
<nz-option [nzValue]="cart" [nzLabel]="cart.carNo" <nz-option [nzValue]="cart" [nzLabel]="cart.carNo"
*ngFor="let cart of item.userCarLicenseDesensitizationVOList"> *ngFor="let cart of item.userCarLicenseDesensitizationVOList">
</nz-option> </nz-option>
</nz-select> </nz-select>
</ng-template> </ng-template>
</st> </st>
</div> </div>
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<!-- 选中列表 --> <!-- 选中列表 -->
<div>已选择{{ st2Data.length }}位司机</div> <div>已选择{{ st2Data.length }}位司机</div>
<st #st2 [bordered]="true" [data]="st2Data" [columns]="columns2" size="small" <st #st2 *ngIf="columns2" [bordered]="true" [data]="st2Data" [columns]="columns2" size="small"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }" [page]="{ show: false }" [scroll]="{ x: '600px',y:'300px' }" style="width: 100%;">
[res]="{ reName: { list: 'data.records', total: 'data.total' } }" <ng-template st-row="captain" let-item let-index="index">
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" <span>{{ item.captainName }}&nbsp;{{ item.captainPhone }}</span> &nbsp;
[loadingDelay]="500" [loading]="service.http.loading" [widthMode]="{ type: 'strict' }" [scroll]="{ x: '600px' }"> <a (click)="setCaptain(item,index)">设置</a>
<ng-template st-row="captain" let-item let-index="index"> </ng-template>
<span>{{ item.captainName }}&nbsp;{{ item.captainPhone }}</span> &nbsp; </st>
<a (click)="setCaptain(item,index)">设置</a> </div>
</ng-template>
</st>
</div>
</div> </div>
<div *nzModalFooter> <div *nzModalFooter>
<button nz-button nzType="default" (click)="cancel()">取消</button> <button nz-button nzType="default" (click)="cancel()">取消</button>
<button nz-button nzType="primary" (click)="ok()">发布并指派给司机</button> <button nz-button nzType="primary" (click)="ok()">发布并指派给司机</button>
</div> </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 { ActivatedRoute, Router } from '@angular/router';
import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
@ -46,7 +46,8 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
private drawerService: NzDrawerService, private drawerService: NzDrawerService,
public service: SupplyManagementService, public service: SupplyManagementService,
private modalService: NzModalService, private modalService: NzModalService,
private modalHelper: ModalHelper private modalHelper: ModalHelper,
private cdr: ChangeDetectorRef
) {} ) {}
/** /**
@ -60,8 +61,11 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.initSF(); this.initSF();
this.initST();
this.initST2(); setTimeout(() => {
this.initST();
this.initST2();
}, 200);
} }
initSF() { initSF() {
@ -94,11 +98,13 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
this.columns = [ this.columns = [
{ {
title: '司机姓名', title: '司机姓名',
index: 'name' index: 'name',
width: 120
}, },
{ {
title: '手机号', title: '手机号',
index: 'telephone' index: 'telephone',
width: 120
}, },
{ {
title: '指定车辆', title: '指定车辆',
@ -109,6 +115,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
title: '状态', title: '状态',
className: 'text-center', className: 'text-center',
index: 'certificationStatus', index: 'certificationStatus',
width: 120,
type: 'badge', type: 'badge',
badge: { badge: {
'-1': { text: '未提交', color: 'default' }, '-1': { text: '未提交', color: 'default' },
@ -120,6 +127,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
{ {
title: '操作', title: '操作',
className: 'text-center', className: 'text-center',
width: 80,
buttons: [ buttons: [
{ {
text: '选择', text: '选择',
@ -136,7 +144,8 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
this.columns2 = [ this.columns2 = [
{ {
title: '司机姓名', title: '司机姓名',
index: 'name' index: 'name',
width: 120
}, },
{ {
title: '手机号', title: '手机号',
@ -146,7 +155,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
{ {
title: '车队长', title: '车队长',
render: 'captain', render: 'captain',
width: '200px' width: '100px'
}, },
{ {
title: '指定车辆', title: '指定车辆',
@ -156,6 +165,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
{ {
title: '操作', title: '操作',
className: 'text-center', className: 'text-center',
width: 80,
buttons: [ buttons: [
{ {
text: '移除', text: '移除',