Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
Taric Xin
2022-02-09 17:55:40 +08:00
12 changed files with 169 additions and 90 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-18 09:51:21
* @LastEditors : Shiming
* @LastEditTime : 2022-01-26 16:26:27
* @LastEditTime : 2022-01-26 17:45:55
* @FilePath : \\tms-obc-web\\proxy.conf.js
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-25 16:03:45
* @LastEditors : Shiming
* @LastEditTime : 2022-01-25 19:12:23
* @LastEditTime : 2022-02-09 17:23:22
* @FilePath : \\tms-obc-web\\src\\app\\core\\guards\\auth.guard.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/

View File

@ -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,

View File

@ -1,3 +1,13 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-01-12 13:35:56
* @LastEditors : Shiming
* @LastEditTime : 2022-02-09 17:41:57
* @FilePath : \\tms-obc-web\\src\\app\\routes\\usercenter\\components\\driver\\driver.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<!-- 页头 -->
<page-header-wrapper [title]="'司机列表'"></page-header-wrapper>
<nz-card>
@ -26,7 +36,7 @@
</nz-tabset>
<!-- 数据列表 -->
<st #st [columns]="columns" [data]='service.$api_get_driver_list'
<st #st [columns]="columns" [scroll]="{x: '1200px'}" [data]='service.$api_get_driver_list'
[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] }"

View File

@ -248,9 +248,10 @@ export class UserCenterComponentsDriverComponent implements OnInit {
private initST(): STColumn[] {
return [
{ title: '司机姓名', className: 'text-center', index: 'name' },
{ title: '手机号', className: 'text-center', index: 'mobile' },
{ title: '当前车辆', className: 'text-center', index: 'carNo' },
{ title: '司机姓名', className: 'text-center', index: 'name' , width: 150},
{ title: '手机号', className: 'text-center', index: 'mobile',width: 150 },
{ title: '身份证号码', className: 'text-center', index: 'identityNo', width: 200 },
{ title: '当前车辆', className: 'text-center', index: 'carNo' , width: 200},
{
title: '实名认证状态',
className: 'text-center',
@ -262,6 +263,8 @@ export class UserCenterComponentsDriverComponent implements OnInit {
1: { text: '通过', color: 'success' },
2: { text: '驳回', color: 'warning' }
}
, width: 180
},
{
title: '驾驶证状态',
@ -275,6 +278,7 @@ export class UserCenterComponentsDriverComponent implements OnInit {
30: { text: '驳回', color: 'warning' },
40: { text: '证件过期', color: 'error' }
}
, width: 180
},
{
title: '从业资格证状态',
@ -288,10 +292,11 @@ export class UserCenterComponentsDriverComponent implements OnInit {
30: { text: '驳回', color: 'warning' },
40: { text: '证件过期', color: 'error' }
}
, width: 180
},
{ title: '推广业务员', className: 'text-center', render: 'promotersTelephone' },
{ title: '注册渠道', className: 'text-center', index: 'source', type: 'enum', enum: { 1: '用户注册', 2: '货主添加' } },
{ title: '注册时间', className: 'text-center', index: 'createTime' },
{ title: '推广业务员', className: 'text-center', render: 'promotersTelephone' , width: 180},
{ title: '注册渠道', className: 'text-center', index: 'source', type: 'enum', enum: { 1: '用户注册', 2: '货主添加' }, width: 150 },
{ title: '注册时间', className: 'text-center', index: 'createTime', width: 200 },
{
title: '操作',
width: '110px',

View File

@ -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>驳回&nbsp;驳回原因:{{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>

View File

@ -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>

View File

@ -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' },

View File

@ -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',

View File

@ -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;">
<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" *ngFor="let node of item.configValue">
<!-- <td nzWidth="130px" nzAlign="center">{{computeMode[item.computeMode] }}</td> -->
<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.baseInsuranceRate" [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">
</div>
</td>
<td nzWidth="220px" nzAlign="center" >
<div style="display: flex;align-items: center;justify-content: center;">
<nz-input-number [(ngModel)]="item.blanketInsuranceRate" [nzMin]="0" nzSize="small" style="width: 55px;"
class="ml-sm mr-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>

View File

@ -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) {
// 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}`);
}
}
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 ;
this.changeNextStartKm(event, i + 1);
}, 0);
this.changeNextStartKm(this.data[i].startKm + 1, i + 1);
return;
}
this.data[i].endKm = event;
this.changeNextStartKm(event, i + 1);
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();
// }
// });
}
/**

View File

@ -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({