fix bug
This commit is contained in:
		
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -4,7 +4,6 @@ | ||||
|             <button nz-button nzType="primary" (click)="add()">新增公里数</button> | ||||
|             <button class="ml-md" nz-button nzType="primary" (click)="save()">保存</button> | ||||
|         </div> | ||||
|  | ||||
|         <nz-table #groupingTable [nzData]="data" nzBordered nzSize="small" [nzFrontPagination]="false" | ||||
|             [nzScroll]="{ x: '1200px' }" [nzShowPagination]="false" class="ml-xl" style="max-width: 1100px;"> | ||||
|             <thead> | ||||
|  | ||||
| @ -1,3 +1,13 @@ | ||||
| /* | ||||
|  * @Description  :  | ||||
|  * @Version      : 1.0 | ||||
|  * @Author       : Shiming | ||||
|  * @Date         : 2022-01-25 16:03:45 | ||||
|  * @LastEditors  : Shiming | ||||
|  * @LastEditTime : 2022-02-11 17:12:52 | ||||
|  * @FilePath     : \\tms-obc-web\\src\\app\\shared\\components\\dynamic-setting\\freight-table\\freight-table.component.ts | ||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||
|  */ | ||||
| import { Component, OnInit } from '@angular/core'; | ||||
| import { BaseService } from '@shared'; | ||||
|  | ||||
|  | ||||
| @ -4,7 +4,7 @@ | ||||
|  * @Author       : Shiming | ||||
|  * @Date         : 2022-01-25 20:18:52 | ||||
|  * @LastEditors  : Shiming | ||||
|  * @LastEditTime : 2022-02-09 14:57:23 | ||||
|  * @LastEditTime : 2022-02-14 09:49:45 | ||||
|  * @FilePath     : \\tms-obc-web\\src\\app\\shared\\components\\insurance-table\\insurance-table.component.html | ||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||
| --> | ||||
| @ -14,28 +14,28 @@ | ||||
|             <button nz-button nzType="primary" (click)="add()">新增公里数</button> | ||||
|             <button class="ml-md" nz-button nzType="primary" (click)="save()">保存</button> | ||||
|         </div> | ||||
|  | ||||
|         <div> | ||||
|             <sf #sf [schema]="schema" [formData]="sfdata" [button]="'none'" [ui]="ui"> | ||||
|                 <ng-template sf-template="freightPrice" let-i let-ui="ui"> | ||||
|                     <nz-input-group [nzAddOnAfter]="addOnAfterTemplate"> | ||||
|                         <nz-input-number [(ngModel)]="price"  [nzMin]="0" style="width: 100%"></nz-input-number> | ||||
|                       </nz-input-group> | ||||
|                       <ng-template #addOnAfterTemplate> | ||||
|                           <span >元</span> | ||||
|                       </ng-template> | ||||
|                 </ng-template> | ||||
|               </sf> | ||||
|             | ||||
|         </div> | ||||
|         <nz-table #groupingTable [nzData]="data" nzBordered nzSize="small" [nzFrontPagination]="false" | ||||
|             [nzScroll]="{ x: '1200px' }" [nzShowPagination]="false" class="ml-xl" style="max-width: 1100px;"> | ||||
|             <thead> | ||||
|                 <tr> | ||||
|                     <th rowspan="2" nzWidth="250px" nzAlign="center" nzLeft>险种</th> | ||||
|                     <!-- <th rowspan="2" nzWidth="130px" nzAlign="center">计算方式</th> --> | ||||
|                     <th nzWidth="220px" nzAlign="center" >普货-基本险</th> | ||||
|                     <th nzWidth="220px" nzAlign="center" >普货-综合险</th> | ||||
|                     <th rowspan="2" nzWidth="60px" nzAlign="center" nzRight>操作</th> | ||||
|                 </tr> | ||||
|                 <!-- <tr> | ||||
|                     <th nzWidth="220px" nzAlign="center" *ngFor="let item of headers;let i = index"> | ||||
|                         <div style="display: flex;align-items: center;justify-content: space-between;"> | ||||
|                             <label style="width: 65px;text-align: right;"> {{item.startLength}}</label> | ||||
|                             <label>-</label> | ||||
|                             <nz-input-number [ngModel]="item.endLength" (ngModelChange)="changeEndLength($event,i)" | ||||
|                                 [nzMin]="0" [nzFormatter]="formatterDollar" nzSize="small" class="mr-sm" disabled> | ||||
|                             </nz-input-number> | ||||
|                         </div> | ||||
|                     </th> | ||||
|                 </tr> --> | ||||
|             </thead> | ||||
|             <tbody> | ||||
|                 <tr *ngFor="let item of groupingTable.data;let i = index"> | ||||
| @ -55,7 +55,6 @@ | ||||
|                         </div> | ||||
|                    | ||||
|                     </td> | ||||
|                     <!-- <td nzWidth="130px" nzAlign="center">{{computeMode[item.computeMode] }}</td> --> | ||||
|                     <td nzWidth="220px" nzAlign="center" > | ||||
|                         <div style="display: flex;align-items: center;justify-content: center;" > | ||||
|                             <nz-input-number [(ngModel)]="item.baseInsuranceRate" [nzMin]="0" nzSize="small" style="width: 55px;" | ||||
|  | ||||
| @ -1,7 +1,8 @@ | ||||
| import { debounceTime } from 'rxjs/operators'; | ||||
| import { Subject } from 'rxjs'; | ||||
| import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core'; | ||||
| import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; | ||||
| import { BaseService } from '@shared'; | ||||
| import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'app-insurance-table', | ||||
| @ -11,15 +12,22 @@ import { BaseService } from '@shared'; | ||||
| export class InsuranceTableComponent implements OnInit { | ||||
|   data: any[] = []; | ||||
|   headers: any[] = []; | ||||
|   sfdata: any; // 货源单设置回显 | ||||
|  | ||||
|   @ViewChild('sf', { static: false }) sf!: SFComponent; | ||||
|   schema: SFSchema = {}; | ||||
|   ui!: SFUISchema; | ||||
|  | ||||
|   formatterDollar = (value: number): string => `${value} (含)`; | ||||
|  | ||||
|   price: number = 0; | ||||
|   changeSub = new Subject<string>(); | ||||
|   constructor(public service: BaseService, private cdr: ChangeDetectorRef) {} | ||||
|  | ||||
|   ngOnInit(): void { | ||||
|     this.loadData(); | ||||
|     this.initSF() | ||||
|     this.changeEndKmAction(); | ||||
|     this.price = 1000 | ||||
|   } | ||||
|  | ||||
|   loadData() { | ||||
| @ -31,7 +39,31 @@ export class InsuranceTableComponent implements OnInit { | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   initSF() { | ||||
|     this.schema = { | ||||
|       properties: { | ||||
|         freightPrice: { | ||||
|           type: 'string', | ||||
|           title: '单票投保最低保费', | ||||
|           ui: { | ||||
|             widget: 'custom', | ||||
|             placeholder: '请输入', | ||||
|             errors: { required: '请填写' } | ||||
|           } | ||||
|         }, | ||||
|       }, | ||||
|       required: ['freightPrice'] | ||||
|     }; | ||||
|     this.ui = { | ||||
|       '*': { | ||||
|         spanLabelFixed: 140, | ||||
|         grid: { span: 24 } | ||||
|       }, | ||||
|       $freightPrice: { | ||||
|         grid: { span: 8 } | ||||
|       }, | ||||
|     }; | ||||
|   } | ||||
|   /** | ||||
|    * 修改结束车长 | ||||
|    * @param event 车长 | ||||
| @ -111,6 +143,8 @@ export class InsuranceTableComponent implements OnInit { | ||||
|  | ||||
|   save() { | ||||
|     console.log(this.data); | ||||
|     console.log(this.price); | ||||
|     console.log(this.sf.value); | ||||
|     // this.service.request('/api/mdc/cuc/freightConfig/saveBatch', this.data).subscribe(res => { | ||||
|     //   if (res) { | ||||
|     //     console.log(res); | ||||
|  | ||||
| @ -4,7 +4,7 @@ | ||||
|  * @Author       : Shiming | ||||
|  * @Date         : 2022-01-25 20:23:54 | ||||
|  * @LastEditors  : Shiming | ||||
|  * @LastEditTime : 2022-02-09 14:57:05 | ||||
|  * @LastEditTime : 2022-02-11 17:20:49 | ||||
|  * @FilePath     : \\tms-obc-web\\src\\app\\shared\\components\\insurance-table\\insurance-table.module.ts | ||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||
|  */ | ||||
| @ -15,17 +15,18 @@ import { NzInputNumberModule } from 'ng-zorro-antd/input-number'; | ||||
| import { NzTableModule } from 'ng-zorro-antd/table'; | ||||
| import { InsuranceTableComponent } from './insurance-table.component'; | ||||
| import { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm'; | ||||
|  | ||||
| const COMPONENTS = [InsuranceTableComponent]; | ||||
| import { SHARED_ZORRO_MODULES } from '../../shared-zorro.module'; | ||||
| import { SHARED_DELON_MODULES } from '../../shared-delon.module'; | ||||
| const COMPONENTS = [InsuranceTableComponent,]; | ||||
| const COMPONENTSs = [   | ||||
|   NzTableModule, | ||||
|   NzInputNumberModule, | ||||
|   NzPopconfirmModule | ||||
|   NzPopconfirmModule, | ||||
| ]; | ||||
|  | ||||
| @NgModule({ | ||||
|   declarations: COMPONENTS, | ||||
|   imports: [CommonModule, FormsModule,COMPONENTSs], | ||||
|   imports: [CommonModule, FormsModule,COMPONENTSs,SHARED_ZORRO_MODULES, SHARED_DELON_MODULES], | ||||
|   exports: COMPONENTS | ||||
| }) | ||||
| export class InsuranceTableModule {} | ||||
|  | ||||
		Reference in New Issue
	
	Block a user