diff --git a/src/app/routes/order-management/components/bulk/bulk.component.ts b/src/app/routes/order-management/components/bulk/bulk.component.ts index 89150fee..9ece5560 100644 --- a/src/app/routes/order-management/components/bulk/bulk.component.ts +++ b/src/app/routes/order-management/components/bulk/bulk.component.ts @@ -260,6 +260,7 @@ export class OrderManagementBulkComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'goodresource:settlement:type' }, + containAllLable:true, placeholder: '请选择', visibleIf: { _$expand: (value: boolean) => value, @@ -286,6 +287,7 @@ export class OrderManagementBulkComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'service:type' }, + containAllLable:true, visibleIf: { _$expand: (value: boolean) => value, }, diff --git a/src/app/routes/order-management/components/risk/risk.component.ts b/src/app/routes/order-management/components/risk/risk.component.ts index 3f2d1083..f9b60842 100644 --- a/src/app/routes/order-management/components/risk/risk.component.ts +++ b/src/app/routes/order-management/components/risk/risk.component.ts @@ -182,6 +182,7 @@ export class OrderManagementRiskComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'goodresourceType' }, + containAllLable:true, visibleIf: { _$expand: (value: boolean) => value, }, @@ -193,6 +194,7 @@ export class OrderManagementRiskComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'BulkFreightUnitPriceType' }, + containAllLable:true, visibleIf: { _$expand: (value: boolean) => value, }, diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.ts b/src/app/routes/order-management/components/vehicle/vehicle.component.ts index 0772ae4c..ba8deba3 100644 --- a/src/app/routes/order-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/order-management/components/vehicle/vehicle.component.ts @@ -278,6 +278,7 @@ export class OrderManagementVehicleComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'ServiceType' }, + containAllLable:true, visibleIf: { _$expand: (value: boolean) => value, }, diff --git a/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html index 787862b6..f3073e98 100644 --- a/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html +++ b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html @@ -42,14 +42,14 @@
-
+

装卸货信息

-
+

装货地:{{item?.detailedAddress}}

联系人:{{item?.appUserName}}/{{item?.contractTelephone}}

发货日期:{{item?.createTime}}

-
+

卸货地:{{item?.detailedAddress}}

联系人:{{item?.appUserName}}/{{item?.contractTelephone}}

卸货日期:{{item?.modifyTime}}

@@ -60,7 +60,7 @@

货物信息

-
+

货物名称:{{item?.goodsName}}

货物数量:{{item?.weight}}吨/{{item?.volume}}立方

剩余:{{item?.weight}}吨/{{item?.volume}}立方

diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html index be2c7d89..ac6a6cfa 100644 --- a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html @@ -206,7 +206,8 @@
- + +
diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.ts b/src/app/routes/supply-management/components/bulk/bulk.component.ts index 47ff760f..a8092a16 100644 --- a/src/app/routes/supply-management/components/bulk/bulk.component.ts +++ b/src/app/routes/supply-management/components/bulk/bulk.component.ts @@ -82,6 +82,7 @@ export class SupplyManagementBulkComponent implements OnInit { widget: 'dict-select', containsAllLable: true, params: { dictKey: 'service:type' }, + containAllLable:true, visibleIf: { _$expand: (value: boolean) => value, }, @@ -94,6 +95,7 @@ export class SupplyManagementBulkComponent implements OnInit { widget: 'dict-select', containsAllLable: true, params: { dictKey: 'goodresource:settlement:type' }, + containAllLable:true, visibleIf: { _$expand: (value: boolean) => value, }, diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts index 4c3b0b71..dd1744ea 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts @@ -10,7 +10,7 @@ import { SFUISchema } from '@delon/form'; import { _HttpClient } from '@delon/theme'; -import { AmapPoiPickerComponent,AmapService } from '@shared'; +import { AmapPoiPickerComponent,AmapService, ShipperBaseService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component'; import { SupplyManagementService } from '../../services/supply-management.service'; @@ -54,7 +54,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { private route: ActivatedRoute, private modalService: NzModalService, public service: SupplyManagementService, - private amapService: AmapService + private amapService: AmapService, + public shipperSrv: ShipperBaseService ) { this.validateForm1 = fb.group({ loadingTime: [null, []], @@ -121,26 +122,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } }, enterpriseProjectId: { - type: 'string', title: '项目', - enum: [ - { label: '项目1', value: '1' }, - { label: '项目2', value: '2' } - ], + type: 'string', + default: '', ui: { widget: 'select', - placeholder: '请选择', - allowClear: true - // asyncData: () => - // this.service.loadChildData2('0', '2').pipe( - // map((data: any) => { - // return data.map((m: any) => { - // return { label: m.name, value: m.id }; - // }); - // }), - // ), - // change: (i) => this.updateCategory(i, '/categoryId2'), - } as SFSelectWidgetSchema + visibleIf: { + _$expand: (value: boolean) => value, + }, + asyncData: () => + this.shipperSrv.getEnterpriseProject() + } as SFSelectWidgetSchema, }, enterpriseInfoName: { type: 'string', @@ -216,8 +208,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { type: 'string', title: '货物名称', ui: { - widget: 'dict-select', - params: { dictKey: 'GoodsName' }, + // widget: 'dict-select', + // params: { dictKey: 'GoodsName' }, placeholder: '请选择' } }, diff --git a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html index 4e128293..0accc6a0 100644 --- a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html @@ -42,15 +42,15 @@
-
+

装卸货信息

-
+

装货地:{{item?.detailedAddress}}

联系人:{{item?.appUserName}}/{{item?.contractTelephone}}

发货日期:{{item?.createTime}}

-
+

卸货地:{{item?.detailedAddress}}

联系人:{{item?.appUserName}}/{{item?.contractTelephone}}

卸货日期:{{item?.modifyTime}}

@@ -60,7 +60,7 @@
-
+

货物信息

货物名称:{{item?.goodsName}}

货物数量:{{item?.weight}}吨/{{item?.volume}}立方

diff --git a/src/app/routes/vehicle/components/list/list.component.ts b/src/app/routes/vehicle/components/list/list.component.ts index 33df455b..9d0cb449 100644 --- a/src/app/routes/vehicle/components/list/list.component.ts +++ b/src/app/routes/vehicle/components/list/list.component.ts @@ -75,6 +75,7 @@ export class VehicleComponentsListComponent implements OnInit { title: '车牌颜色', ui: { widget: 'dict-select', + containAllLable:true, params: { dictKey: 'CarColor' }, }, }, @@ -98,6 +99,7 @@ export class VehicleComponentsListComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'CarModel' }, + containAllLable:true, visibleIf: { expand: (value: boolean) => value, }, @@ -109,6 +111,7 @@ export class VehicleComponentsListComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'CarLength' }, + containAllLable:true, visibleIf: { expand: (value: boolean) => value, }, diff --git a/src/app/shared/components/dict-select/dict-select.component.html b/src/app/shared/components/dict-select/dict-select.component.html index af04c543..b77d29c5 100644 --- a/src/app/shared/components/dict-select/dict-select.component.html +++ b/src/app/shared/components/dict-select/dict-select.component.html @@ -1,3 +1,3 @@ - + diff --git a/src/app/shared/components/dict-select/dict-select.component.spec.ts b/src/app/shared/components/dict-select/dict-select.component.spec.ts new file mode 100644 index 00000000..d5aa71e4 --- /dev/null +++ b/src/app/shared/components/dict-select/dict-select.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DictSelectComponent } from './dict-select.component'; + +describe('DictSelectComponent', () => { + let component: DictSelectComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DictSelectComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DictSelectComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/components/dict-select/dict-select.component.ts b/src/app/shared/components/dict-select/dict-select.component.ts index 232b95e0..a1936ea9 100644 --- a/src/app/shared/components/dict-select/dict-select.component.ts +++ b/src/app/shared/components/dict-select/dict-select.component.ts @@ -22,17 +22,24 @@ export class DictSelectComponent implements OnInit, ControlValueAccessor { private onTouchedFn?: () => void; defaultUrl = `/api/mdc/pbc/dictItems/getDictValue`; - @Input() value: string = ''; // 默认选中值 + @Input() value: any = '' || []; // 默认选中值 @Input() url: string = ''; // 获取字典数据的地址 @Input() params = {};// 请求参数 dictList: any[] = []; + @Input() containsAllLable = true; // 是否包含全部这一选项 + @Input() mode: 'multiple' | 'tags' | 'default' = 'default'; + constructor(public service: DictSelectService, public cdr: ChangeDetectorRef) { } writeValue(geo: string): void { if (geo == null) { - this.value = ''; + if (this.mode === 'multiple' || this.mode === 'tags') { + this.value = []; + } else { + this.value = ''; + } return; } this.value = geo; @@ -45,11 +52,10 @@ export class DictSelectComponent implements OnInit, ControlValueAccessor { } ngOnInit(): void { - this.service.getDictList(this.url || this.defaultUrl, this.params).subscribe(res => { if (res) { this.dictList = res || []; - if (this.dictList.length > 0) { + if (this.dictList.length > 0 && this.containsAllLable) { const obj = { label: '全部', value: '' }; this.dictList.unshift(obj); } diff --git a/src/app/shared/components/dict-select/index.ts b/src/app/shared/components/dict-select/index.ts index e217fb6b..000c5c95 100644 --- a/src/app/shared/components/dict-select/index.ts +++ b/src/app/shared/components/dict-select/index.ts @@ -1,7 +1,7 @@ /* * @Author: your name - * @Date: 2021-12-13 10:41:19 - * @LastEditTime: 2021-12-13 10:41:57 + * @Date: 2021-12-16 20:41:23 + * @LastEditTime: 2021-12-16 20:41:42 * @LastEditors: your name * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: \tms-obc-web\src\app\shared\components\dict-select\index.ts diff --git a/src/app/shared/widget/dict-select/dict-select.widget.html b/src/app/shared/widget/dict-select/dict-select.widget.html index 76e719cd..b54a3e88 100644 --- a/src/app/shared/widget/dict-select/dict-select.widget.html +++ b/src/app/shared/widget/dict-select/dict-select.widget.html @@ -1,6 +1,14 @@ + + [containsAllLable]="ui?.containsAllLable" [mode]="ui?.mode" name="sf.dict.select">