fix bug
This commit is contained in:
@ -16,10 +16,10 @@
|
||||
>
|
||||
<form nz-form [formGroup]="validateForm1" role="form">
|
||||
<div nz-row [nzGutter]="24">
|
||||
<div nz-col [nzSpan]="8">
|
||||
<div nz-col [nzSpan]="10">
|
||||
<div *ngFor="let data of startInfo; let idx = index">
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSpan]="4" nzRequired>装货地</nz-form-label>
|
||||
<nz-form-label [nzSpan]="3" nzRequired>装货地</nz-form-label>
|
||||
<nz-form-control [nzErrorTip]="'请输入装货地'">
|
||||
<div class="align-center">
|
||||
<nz-input-group [nzSuffix]="endInconTemp1">
|
||||
@ -31,18 +31,16 @@
|
||||
placeholder="请输入装货地"
|
||||
/>
|
||||
</nz-input-group>
|
||||
<!-- <span style="padding: 0 10px"
|
||||
><i nz-icon nzType="menu" nzTheme="outline" style="color: #1890ff" (click)="chooseAddress(idx, 'start')"></i
|
||||
></span> -->
|
||||
<span
|
||||
|
||||
<span style="padding: 0 10px"
|
||||
><i nz-icon nzType="minus-circle-o" nzTheme="fill" style="color: #d9001b" (click)="subStartInfo($event, idx, data.id)"></i
|
||||
></span>
|
||||
</div>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSpan]="4" nzRequired>联系人</nz-form-label>
|
||||
<div style="display: flex">
|
||||
<nz-form-label [nzSpan]="3" nzRequired>联系人</nz-form-label>
|
||||
<div style="display: flex; width: 80.7%">
|
||||
<nz-form-control [nzErrorTip]="'请输入联系人姓名'">
|
||||
<input
|
||||
nz-input
|
||||
@ -74,15 +72,16 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="8">
|
||||
<div nz-col [nzSpan]="4">
|
||||
<div style="display: flex; justify-content: center">
|
||||
<span style="padding: 24 px; font-size: 30px; color: #7d7d7d"><i nz-icon nzType="swap" nzTheme="outline"></i></span>
|
||||
<span class="swap-icon" (click)="swapAddress()"><i nz-icon nzType="swap"
|
||||
nzTheme="outline"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="8">
|
||||
<div nz-col [nzSpan]="10">
|
||||
<div *ngFor="let data of endInfo; let idx = index">
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSpan]="4" nzRequired>卸货地</nz-form-label>
|
||||
<nz-form-label [nzSpan]="3" nzRequired>卸货地</nz-form-label>
|
||||
<nz-form-control [nzErrorTip]="'请输入卸货地'">
|
||||
<div class="align-center">
|
||||
<nz-input-group [nzSuffix]="endInconTemp1">
|
||||
@ -94,16 +93,13 @@
|
||||
placeholder="请输入卸货地"
|
||||
/>
|
||||
</nz-input-group>
|
||||
<!-- <span style="padding: 0 10px"
|
||||
><i nz-icon nzType="menu" nzTheme="outline" style="color: #1890ff" (click)="chooseAddress(idx, 'end')"></i
|
||||
></span> -->
|
||||
<span><i nz-icon nzType="minus-circle-o" nzTheme="fill" style="color: #d9001b" (click)="subEndInfo($event, idx)"></i></span>
|
||||
<span style="padding: 0 10px"><i nz-icon nzType="minus-circle-o" nzTheme="fill" style="color: #d9001b" (click)="subEndInfo($event, idx)"></i></span>
|
||||
</div>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSpan]="4" nzRequired>联系人</nz-form-label>
|
||||
<div style="display: flex">
|
||||
<nz-form-label [nzSpan]="3" nzRequired>联系人</nz-form-label>
|
||||
<div style="display: flex; width: 80.7%">
|
||||
<nz-form-control [nzErrorTip]="'请输入联系人姓名'">
|
||||
<input
|
||||
nz-input
|
||||
@ -137,28 +133,31 @@
|
||||
</div>
|
||||
</div>
|
||||
<div nz-row [nzGutter]="24" style="margin-top: 24px">
|
||||
<div nz-col [nzSpan]="9">
|
||||
<div nz-col [nzSpan]="10">
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSpan]="4" nzRequired>装货时间</nz-form-label>
|
||||
<nz-form-label [nzSpan]="3" nzRequired>装货时间</nz-form-label>
|
||||
<nz-form-control [nzErrorTip]="'请输入装货时间'">
|
||||
<nz-date-picker
|
||||
nzShowTime
|
||||
nzFormat="yyyy-MM-dd HH:mm:ss"
|
||||
[ngModel]="loadingTime"
|
||||
(ngModelChange)="changeLO($event)"[ngModelOptions]="{standalone: true}"
|
||||
(ngModelChange)="changeLO($event)"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
></nz-date-picker>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="8">
|
||||
<div nz-col [nzSpan]="4"></div>
|
||||
<div nz-col [nzSpan]="10">
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSpan]="9" nzRequired>卸货时间</nz-form-label>
|
||||
<nz-form-label [nzSpan]="3" nzRequired>卸货时间</nz-form-label>
|
||||
<nz-form-control [nzErrorTip]="'请输入卸货时间'">
|
||||
<nz-date-picker
|
||||
nzShowTime
|
||||
nzFormat="yyyy-MM-dd HH:mm:ss"
|
||||
[ngModel]="unloadingTime"
|
||||
(ngModelChange)="changeUn($event)"[ngModelOptions]="{standalone: true}"
|
||||
(ngModelChange)="changeUn($event)"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
></nz-date-picker>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
@ -271,7 +270,7 @@
|
||||
<nz-card>
|
||||
<div class="card-title">补充信息</div>
|
||||
<div nz-row>
|
||||
<div nz-col nzSpan="12">
|
||||
<div nz-col nzSpan="9">
|
||||
<sf #sf6 [schema]="schema6" [formData]="sf6data" [button]="'none'" [ui]="ui6"> </sf>
|
||||
</div>
|
||||
</div>
|
||||
@ -279,7 +278,7 @@
|
||||
<nz-card>
|
||||
<div class="card-title">运费信息</div>
|
||||
<div nz-row>
|
||||
<div nz-col nzSpan="12">
|
||||
<div nz-col nzSpan="9">
|
||||
<sf #sf7 [schema]="schema7" [button]="'none'" [ui]="ui7" [formData]="sf7data">
|
||||
<ng-template sf-template="subtotal" let-i let-ui="ui">¥{{ i.value | number: '0.2-2' }}</ng-template>
|
||||
<ng-template sf-template="appendFee" let-i let-ui="ui"
|
||||
|
||||
@ -1,3 +1,17 @@
|
||||
:host {
|
||||
::ng-deep {
|
||||
nz-input-number {
|
||||
width: 100%;
|
||||
}
|
||||
nz-date-picker {
|
||||
width: 94.3%;
|
||||
}
|
||||
}
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.tip-font {
|
||||
margin-left: 16px;
|
||||
font-weight: 500;
|
||||
@ -16,14 +30,23 @@
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.swap-icon {
|
||||
padding: 24px;
|
||||
color: #7d7d7d;
|
||||
font-size: 30px;
|
||||
:hover{color: #52acff;}
|
||||
}
|
||||
|
||||
#container {
|
||||
width: 300px;
|
||||
height: 180px;
|
||||
}
|
||||
|
||||
|
||||
:host {
|
||||
::ng-deep {
|
||||
nz-input-number{width: 100%;}
|
||||
}
|
||||
}
|
||||
input[type='number'] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
input[type='number']::-webkit-inner-spin-button,
|
||||
input[type='number']::-webkit-outer-spin-button {
|
||||
margin: 0;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
@ -325,6 +325,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
params: { dictKey: 'car:model' },
|
||||
mode: 'multiple',
|
||||
placeholder: '请选择车型',
|
||||
maxMultipleCount:3,
|
||||
errors: { required: '请选择车型' }
|
||||
}
|
||||
},
|
||||
@ -336,6 +337,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
params: { dictKey: 'car:length' },
|
||||
mode: 'multiple',
|
||||
placeholder: '请选择车长',
|
||||
maxMultipleCount:3,
|
||||
errors: { required: '请选择车长' }
|
||||
}
|
||||
}
|
||||
@ -1223,4 +1225,42 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 装卸货地址互换
|
||||
swapAddress(){
|
||||
this.startInfo.forEach((element:any, index:any) => {
|
||||
this.validateForm1.removeControl(`loadAddress${index}`);
|
||||
this.validateForm1.removeControl(`loadName${index}`);
|
||||
this.validateForm1.removeControl(`loadPhone${index}`);
|
||||
});
|
||||
this.endInfo.forEach((element:any, index:any) => {
|
||||
this.validateForm1.removeControl(`unloadAddress${index}`);
|
||||
this.validateForm1.removeControl(`unloadName${index}`);
|
||||
this.validateForm1.removeControl(`unloadPhone${index}`);
|
||||
});
|
||||
|
||||
let item = this.startInfo;
|
||||
this.startInfo = this.endInfo;
|
||||
this.endInfo = item;
|
||||
|
||||
this.startInfo.forEach((element:any,index:any) => {
|
||||
element.type = '1';
|
||||
this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
|
||||
});
|
||||
this.endInfo.forEach((element:any,index:any) => {
|
||||
element.type = '2';
|
||||
this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
|
||||
});
|
||||
|
||||
// 计算里程,时间
|
||||
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
|
||||
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
|
||||
this.totalDistance = res.distance;
|
||||
this.totalTime = res.time;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user