车辆接口更新
This commit is contained in:
		| @ -4,7 +4,7 @@ | ||||
|  * @Author       : Shiming | ||||
|  * @Date         : 2022-01-25 16:03:45 | ||||
|  * @LastEditors  : Shiming | ||||
|  * @LastEditTime : 2022-01-25 19:12:23 | ||||
|  * @LastEditTime : 2022-01-26 18:04:46 | ||||
|  * @FilePath     : \\tms-obc-web\\src\\app\\core\\guards\\auth.guard.ts | ||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||
|  */ | ||||
| @ -56,10 +56,17 @@ export class AuthGuard implements CanActivate, CanActivateChild { | ||||
|     return this.baseService.request('/api/mdc/cuc/functionButton/getUserFunctionButton', { link: route }).pipe( | ||||
|       switchMap(res => { | ||||
|         if (res) { | ||||
|           this.srv.setAbility(res.permissionsCodeList || []); | ||||
|           this.menuService.resume(); | ||||
|           console.log('666') | ||||
|           console.log(res) | ||||
|           // this.srv.setAbility(res.abilities || []); | ||||
|           // this.menuService.resume(); | ||||
|           this.baseService.request('/api/mdc/cuc/enterpriseProject/getUserDefaultEnterpriseProject').subscribe((res: any) => { | ||||
|             if(!res.enterpriseIdentity){ | ||||
|               this.srv.setAbility(res.abilities || []); | ||||
|               this.menuService.resume(); | ||||
|             } | ||||
|           }) | ||||
|         } | ||||
|  | ||||
|         return of(true); | ||||
|       }) | ||||
|     ); | ||||
|  | ||||
| @ -1,3 +1,13 @@ | ||||
| /* | ||||
|  * @Description  :  | ||||
|  * @Version      : 1.0 | ||||
|  * @Author       : Shiming | ||||
|  * @Date         : 2022-01-25 13:10:49 | ||||
|  * @LastEditors  : Shiming | ||||
|  * @LastEditTime : 2022-01-26 17:45:11 | ||||
|  * @FilePath     : \\tms-obc-web\\src\\app\\routes\\sys-setting\\components\\basic-setting\\basic-setting.component.ts | ||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||
|  */ | ||||
| import { Component, OnInit, ViewChild } from '@angular/core'; | ||||
| import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; | ||||
| import { dateTimePickerUtil } from '@delon/util'; | ||||
| @ -24,8 +34,8 @@ export class BasicSettingComponent implements OnInit { | ||||
|       if (res?.length > 0) { | ||||
|         const typeData = res.find(config => config.configFullKey === 'sys.config'); | ||||
|         if (typeData) { | ||||
|           this.tabs = typeData.children; | ||||
|           this.selectedTab = typeData.children[0]; | ||||
|           this.tabs = typeData?.children; | ||||
|           this.selectedTab = typeData?.children?.[0]; | ||||
|           this.getConfigList(this.selectedTab); | ||||
|         } | ||||
|       } | ||||
| @ -34,7 +44,7 @@ export class BasicSettingComponent implements OnInit { | ||||
|  | ||||
|   getConfigList(selectedTab: any) { | ||||
|     this.selectedTab = selectedTab; | ||||
|     this.service.request(this.service.$api_get_config_by_parent_id, { id: selectedTab.id }).subscribe((res: Array<any>) => { | ||||
|     this.service.request(this.service.$api_get_config_by_parent_id, { id: selectedTab?.id }).subscribe((res: Array<any>) => { | ||||
|       if (res?.length > 0) { | ||||
|         res = res.map(item => ({ | ||||
|           ...item, | ||||
|  | ||||
| @ -1,5 +1,5 @@ | ||||
| <!-- 页头 --> | ||||
| <page-header-wrapper [logo]="logo" [content]="content" [title]="'企业详情'"> | ||||
| <page-header-wrapper [logo]="logo" [content]="content" [title]="'企业详情'" > | ||||
|   <ng-template #logo> | ||||
|     <button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()"> | ||||
|       <i nz-icon nzType="left" nzTheme="outline"></i> | ||||
| @ -143,7 +143,7 @@ | ||||
|           nzTheme="fill" class="mr-xs"></i>审核通过 | ||||
|       </label> | ||||
|       <label *ngIf="detailData?.approvalStatus===30" style="color: #ff4d4f;"><i nz-icon nzType="close-circle" | ||||
|           nzTheme="fill" class="mr-xs"></i>驳回 | ||||
|           nzTheme="fill" class="mr-xs"></i>驳回 驳回原因:{{detailData?.approvalOpinion}} | ||||
|       </label> | ||||
|     </sv-title> | ||||
|     <sv label="公司名称"> | ||||
| @ -172,7 +172,8 @@ | ||||
|       <nz-date-picker [(ngModel)]="detailData.enterpriseRegistrationTime" [nzDisabled]="!isEdit" | ||||
|         [nzPlaceHolder]="isEdit?'':'-'" [nzBorderless]="!isEdit" [nzSuffixIcon]="isEdit?'calendar':''"></nz-date-picker> | ||||
|     </sv> | ||||
|     <sv label="营业期限"> | ||||
|      | ||||
|     <sv label="营业期限" col="1"> | ||||
|       <nz-date-picker [(ngModel)]="detailData.operatingStartTime" [nzDisabled]="!isEdit" nzPlaceHolder=" " | ||||
|         [nzBorderless]="!isEdit" [nzSuffixIcon]="isEdit?'calendar':''" style="width: 100px;" class="calendar"> | ||||
|       </nz-date-picker> | ||||
| @ -228,7 +229,7 @@ | ||||
|       <input nz-input type="text" [(ngModel)]="detailData.legalPersonIdentityVO.certificateNumber" [readonly]="!isEdit" | ||||
|         [nzBorderless]="!isEdit" [placeholder]="isEdit?'':'-'"> | ||||
|     </sv> | ||||
|     <sv label="身份证有效期"> | ||||
|     <sv label="身份证有效期"  col="1"> | ||||
|       <nz-date-picker [(ngModel)]="detailData.legalPersonIdentityVO.validStartTime" [nzDisabled]="!isEdit" | ||||
|         nzPlaceHolder=" " [nzBorderless]="!isEdit" [nzSuffixIcon]="isEdit?'calendar':''" style="width: 100px;" | ||||
|         class="calendar"></nz-date-picker> | ||||
|  | ||||
| @ -1,3 +1,13 @@ | ||||
| <!-- | ||||
|  * @Description  :  | ||||
|  * @Version      : 1.0 | ||||
|  * @Author       : Shiming | ||||
|  * @Date         : 2022-01-12 10:52:50 | ||||
|  * @LastEditors  : Shiming | ||||
|  * @LastEditTime : 2022-02-09 15:28:00 | ||||
|  * @FilePath     : \\tms-obc-web\\src\\app\\routes\\usercenter\\components\\freight\\list\\list.component.html | ||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||
| --> | ||||
| <!-- 页头 --> | ||||
| <page-header-wrapper [title]="'企业列表'"></page-header-wrapper> | ||||
| <nz-card> | ||||
| @ -36,6 +46,9 @@ | ||||
|         </div> | ||||
|       </div> | ||||
|     </ng-template> | ||||
|     <ng-template st-row="contacter" let-item let-index="index"> | ||||
|       {{ item.contacter }}/{{item.mobile}} | ||||
|     </ng-template> | ||||
|     <ng-template st-row="promotersTelephone" let-item let-index="index"> | ||||
|       <a (click)="addPromoter(item)">{{ item.promotersTelephone || '添加' }}</a> | ||||
|     </ng-template> | ||||
|  | ||||
| @ -106,34 +106,35 @@ export class FreightComponentsListComponent implements OnInit { | ||||
|           } | ||||
|         }, | ||||
|         contactName: { | ||||
|           title: '联系人', | ||||
|           title: '管理员', | ||||
|           type: 'string', | ||||
|           ui: { | ||||
|             placeholder: '请输入', | ||||
|             showRequired: false | ||||
|           } | ||||
|         }, | ||||
|         // networkTransporter: { | ||||
|         //   title: '网络货运人', | ||||
|         //   type: 'string', | ||||
|         //   ui: { | ||||
|         //     placeholder: '请输入', | ||||
|         //     showRequired: false | ||||
|         //   } | ||||
|         // }, | ||||
|         | ||||
|         networkTransporter: { | ||||
|           type: 'string', | ||||
|           title: '网络货运人', | ||||
|           ui: { | ||||
|             widget: 'select', | ||||
|             placeholder: '请选择', | ||||
|             visibleIf: { | ||||
|               _$expand: (value: boolean) => value, | ||||
|             }, | ||||
|             allowClear: true, | ||||
|             asyncData: () => this.shipperservice.getNetworkFreightForwarder(), | ||||
|           }, | ||||
|         }, | ||||
|         promotersTelephone: { | ||||
|           title: '业务员', | ||||
|           type: 'string', | ||||
|           ui: { | ||||
|             placeholder: '请输入', | ||||
|             showRequired: false, | ||||
|             visibleIf: { | ||||
|               expand: (value: boolean) => value | ||||
|             } | ||||
|           } | ||||
|         }, | ||||
|         source: { | ||||
|           type: 'string', | ||||
|           title: '注册渠道', | ||||
| @ -175,7 +176,7 @@ export class FreightComponentsListComponent implements OnInit { | ||||
|     this.columns = [ | ||||
|       // { title: '', type: 'checkbox', className: 'text-center' }, | ||||
|       { title: '企业名称', className: 'text-center', index: 'enterpriseName' }, | ||||
|       { title: '联系人', className: 'text-center', index: 'contacter' }, | ||||
|       { title: '管理员', className: 'text-center', render: 'contacter' }, | ||||
|       { title: '网络货运人', className: 'text-center', index: 'netTranName' }, | ||||
|       { title: '常用服务', className: 'text-center', index: 'oftenUsedServices', type: 'enum', enum: { 10: '整车发货', 20: '大宗发货' } }, | ||||
|       { title: '推广业务员', className: 'text-center', render: 'promotersTelephone' }, | ||||
|  | ||||
| @ -390,7 +390,7 @@ export class FreightComponentsListNewComponent implements OnInit { | ||||
|           title: '经营范围', | ||||
|           type: 'string', | ||||
|           minLength: 1, | ||||
|           maxLength: 240, | ||||
|           maxLength: 500, | ||||
|           ui: { | ||||
|             grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, | ||||
|             widget: 'textarea', | ||||
|  | ||||
| @ -1,3 +1,13 @@ | ||||
| <!-- | ||||
|  * @Description  :  | ||||
|  * @Version      : 1.0 | ||||
|  * @Author       : Shiming | ||||
|  * @Date         : 2022-01-25 20:18:52 | ||||
|  * @LastEditors  : Shiming | ||||
|  * @LastEditTime : 2022-02-09 14:57:23 | ||||
|  * @FilePath     : \\tms-obc-web\\src\\app\\shared\\components\\insurance-table\\insurance-table.component.html | ||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||
| --> | ||||
| <div nz-row> | ||||
|     <div nz-col nzSpan="24"> | ||||
|         <div class="mb-md ml-xl" style="text-align: right;"> | ||||
| @ -9,12 +19,13 @@ | ||||
|             [nzScroll]="{ x: '1200px' }" [nzShowPagination]="false" class="ml-xl" style="max-width: 1100px;"> | ||||
|             <thead> | ||||
|                 <tr> | ||||
|                     <th rowspan="2" nzWidth="200px" nzAlign="center" nzLeft>公里数</th> | ||||
|                     <th rowspan="2" nzWidth="130px" nzAlign="center">计算方式</th> | ||||
|                     <th nzWidth="220px" nzAlign="center" *ngFor="let item of headers">车长(米)</th> | ||||
|                     <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> | ||||
|                 <!-- <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> | ||||
| @ -24,35 +35,46 @@ | ||||
|                             </nz-input-number> | ||||
|                         </div> | ||||
|                     </th> | ||||
|                 </tr> | ||||
|                 </tr> --> | ||||
|             </thead> | ||||
|             <tbody> | ||||
|                 <tr *ngFor="let item of groupingTable.data;let i = index"> | ||||
|                     <td nzWidth="200px" nzAlign="center" nzLeft> | ||||
|                     <td nzWidth="250px" nzAlign="center" nzLeft> | ||||
|                         <div style="display: flex;align-items: center;justify-content: space-between;"> | ||||
|                             <label style="width: 65px;text-align: right;"> {{item.startKm}}</label> | ||||
|                             <label>-</label> | ||||
|                             <nz-input-number [ngModel]="item.endKm" (ngModelChange)="changeEndKm($event,i)" [nzMin]="0" | ||||
|                                 [nzFormatter]="formatterDollar" nzSize="small"> | ||||
|                             <div  > | ||||
|                                 公里数(km) | ||||
|                             </div> | ||||
|                             <div style="color:#f0f0f0;">|</div> | ||||
|                             <div > | ||||
|                                     <label style="width: 65px;text-align: right;"> {{item.startKm}}</label> | ||||
|                                     <label>-</label> | ||||
|                                     <nz-input-number [ngModel]="item.endKm" (ngModelChange)="changeEndKm($event,i)" [nzMin]="0" | ||||
|                                         [nzFormatter]="formatterDollar" nzSize="small"> | ||||
|                                     </nz-input-number> | ||||
|                             </div> | ||||
|                         </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;" | ||||
|                                 class="ml-sm mr-sm"> | ||||
|                             </nz-input-number> | ||||
|                         </div> | ||||
|                     </td> | ||||
|                     <td nzWidth="130px" nzAlign="center">{{computeMode[item.computeMode] }}</td> | ||||
|                     <td nzWidth="220px" nzAlign="center" *ngFor="let node of item.configValue"> | ||||
|                     <td nzWidth="220px" nzAlign="center" > | ||||
|                         <div style="display: flex;align-items: center;justify-content: center;"> | ||||
|                             <label>最高</label> | ||||
|                             <nz-input-number [(ngModel)]="node.maxPrice" [nzMin]="0" nzSize="small" style="width: 55px;" | ||||
|                             <nz-input-number [(ngModel)]="item.blanketInsuranceRate" [nzMin]="0" nzSize="small" style="width: 55px;" | ||||
|                                 class="ml-sm mr-sm"> | ||||
|                             </nz-input-number> | ||||
|                             <label>预警</label> | ||||
|                             <nz-input-number [(ngModel)]="node.ewPrice" [nzMin]="0" nzSize="small" style="width: 55px;" | ||||
|                                 class="ml-sm"> | ||||
|                             </nz-input-number> | ||||
|                         </div> | ||||
|                     </td> | ||||
|                     <td nzWidth="60px" nzAlign="center" nzRight> | ||||
|                         <a *ngIf="i === groupingTable.data.length-1 && groupingTable.data.length>2" nz-popconfirm | ||||
|                             nzPopconfirmTitle="是否确认删除?" (nzOnConfirm)="deleteRow(i)">删除</a> | ||||
|                         <a *ngIf="i === groupingTable.data.length-1 && groupingTable.data.length>2" | ||||
|                              nz-popconfirm | ||||
|                             nzPopconfirmTitle="是否确认删除?" (nzOnConfirm)="deleteRow(i)" | ||||
|                             >删除</a> | ||||
|                     </td> | ||||
|                 </tr> | ||||
|             </tbody> | ||||
|  | ||||
| @ -1,4 +1,6 @@ | ||||
| import { Component, OnInit } from '@angular/core'; | ||||
| import { debounceTime } from 'rxjs/operators'; | ||||
| import { Subject } from 'rxjs'; | ||||
| import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core'; | ||||
| import { BaseService } from '@shared'; | ||||
|  | ||||
| @Component({ | ||||
| @ -11,29 +13,21 @@ export class InsuranceTableComponent implements OnInit { | ||||
|   headers: any[] = []; | ||||
|  | ||||
|   formatterDollar = (value: number): string => `${value} (含)`; | ||||
|   computeMode: any = { | ||||
|     0: '总运价', | ||||
|     1: '单公里运价' | ||||
|   }; | ||||
|   constructor(public service: BaseService) {} | ||||
|  | ||||
|   changeSub = new Subject<string>(); | ||||
|   constructor(public service: BaseService, private cdr: ChangeDetectorRef) {} | ||||
|  | ||||
|   ngOnInit(): void { | ||||
|     this.loadHeaders(); | ||||
|     this.loadData(); | ||||
|   } | ||||
|  | ||||
|   loadHeaders() { | ||||
|     this.service.request('/api/mdc/cuc/freightConfigItem/list').subscribe(res => { | ||||
|       if (res) { | ||||
|         this.headers = res; | ||||
|       } | ||||
|     }); | ||||
|     this.changeEndKmAction(); | ||||
|   } | ||||
|  | ||||
|   loadData() { | ||||
|     this.service.request('/api/mdc/cuc/freightConfig/list').subscribe(res => { | ||||
|     this.service.request('/api/mdc/cuc/insuranceConfig/list').subscribe(res => { | ||||
|       if (res) { | ||||
|         console.log(res); | ||||
|         this.data = res; | ||||
|         this.cdr.detectChanges(); | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
| @ -59,13 +53,35 @@ export class InsuranceTableComponent implements OnInit { | ||||
|    * @param i 下标 | ||||
|    */ | ||||
|   changeEndKm(event: any, i: number) { | ||||
|     if (event <= this.data[i].startKm) { | ||||
|       this.data[i].endKm = this.data[i].startKm + 1; | ||||
|       this.changeNextStartKm(event, i + 1); | ||||
|       return; | ||||
|     // console.log(this.debounce4(event, i)); | ||||
|     // console.log(this.data[i].startKm); | ||||
|     // console.log(event); | ||||
|     // console.log(i); | ||||
|     if (event) { | ||||
|       console.log(event); | ||||
|  | ||||
|       this.changeSub.next(`${event},${i}`); | ||||
|     } | ||||
|     this.data[i].endKm = event; | ||||
|     this.changeNextStartKm(event, i + 1); | ||||
|   } | ||||
|   changeEndKmAction() { | ||||
|     this.changeSub.pipe(debounceTime(500)).subscribe((res: string) => { | ||||
|       if (res) { | ||||
|         const paras = res.split(','); | ||||
|         const num = Number(paras[0]); | ||||
|         const i = Number(paras[1]); | ||||
|  | ||||
|         if (num <= this.data[i].startKm) { | ||||
|           this.data[i].endKm = null; | ||||
|           setTimeout(() => { | ||||
|             this.data[i].endKm = this.data[i].startKm + 1 ; | ||||
|           }, 0); | ||||
|           this.changeNextStartKm(this.data[i].startKm + 1, i + 1); | ||||
|           return; | ||||
|         } | ||||
|         this.data[i].endKm = num; | ||||
|         this.changeNextStartKm(num, i + 1); | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   add() { | ||||
| @ -73,14 +89,7 @@ export class InsuranceTableComponent implements OnInit { | ||||
|  | ||||
|     const tem = this.data[this.data?.length - 1]; | ||||
|     if (tem && tem.endKm) { | ||||
|       const list = this.headers.map(item => ({ | ||||
|         ewPrice: null, | ||||
|         itemId: item.id, | ||||
|         maxPrice: null | ||||
|       })); | ||||
|       this.data.push({ | ||||
|         computeMode: 1, | ||||
|         configValue: list, | ||||
|         endKm: '', | ||||
|         startKm: tem.endKm | ||||
|       }); | ||||
| @ -91,17 +100,24 @@ export class InsuranceTableComponent implements OnInit { | ||||
|   } | ||||
|  | ||||
|   deleteRow(index: number) { | ||||
|     this.data = this.data.filter((d, i) => index !== i); | ||||
|     console.log(index); | ||||
|     this.data = this.data.filter((d, i) => { | ||||
|       console.log(d); | ||||
|       console.log(i); | ||||
|       index !== i; | ||||
|     }); | ||||
|     console.log(this.data); | ||||
|   } | ||||
|  | ||||
|   save() { | ||||
|     this.service.request('/api/mdc/cuc/freightConfig/saveBatch', this.data).subscribe(res => { | ||||
|       if (res) { | ||||
|         console.log(res); | ||||
|         this.service.msgSrv.success('修改成功'); | ||||
|         this.loadData(); | ||||
|       } | ||||
|     }); | ||||
|     console.log(this.data); | ||||
|     // this.service.request('/api/mdc/cuc/freightConfig/saveBatch', this.data).subscribe(res => { | ||||
|     //   if (res) { | ||||
|     //     console.log(res); | ||||
|     //     this.service.msgSrv.success('修改成功'); | ||||
|     //     this.loadData(); | ||||
|     //   } | ||||
|     // }); | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|  | ||||
| @ -4,7 +4,7 @@ | ||||
|  * @Author       : Shiming | ||||
|  * @Date         : 2022-01-25 20:23:54 | ||||
|  * @LastEditors  : Shiming | ||||
|  * @LastEditTime : 2022-01-25 20:35:32 | ||||
|  * @LastEditTime : 2022-02-09 14:57:05 | ||||
|  * @FilePath     : \\tms-obc-web\\src\\app\\shared\\components\\insurance-table\\insurance-table.module.ts | ||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||
|  */ | ||||
| @ -14,12 +14,13 @@ import { FormsModule } from '@angular/forms'; | ||||
| 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]; | ||||
| const COMPONENTSs = [   | ||||
|   NzTableModule, | ||||
|   NzInputNumberModule | ||||
|   NzInputNumberModule, | ||||
|   NzPopconfirmModule | ||||
| ]; | ||||
|  | ||||
| @NgModule({ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user