This commit is contained in:
wangshiming
2022-02-16 13:54:15 +08:00
parent 2b97ad5bb5
commit 5b49aeae04
12 changed files with 326 additions and 128 deletions

View File

@ -26,7 +26,7 @@
<div nz-col [nzSpan]="10">
<div *ngFor="let data1 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">
@ -38,18 +38,15 @@
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 *ngIf="idx !== 0"
<span style="padding: 0 10px"
><i nz-icon nzType="minus-circle-o" nzTheme="fill" style="color: #d9001b" (click)="subStartInfo($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
@ -76,17 +73,18 @@
</div>
<div nz-row>
<div nz-col [nzSpan]="4"></div>
<div style="display: flex; justify-content: center;">
<button nz-button nzType="primary" (click)="addStartInfo()">
<i nz-icon nzType="plus"></i>
添加装货地
</button>
</div>
<div style="display: flex; justify-content: center">
<button nz-button nzType="primary" (click)="addStartInfo()">
<i nz-icon nzType="plus"></i>
添加装货地
</button>
</div>
</div>
</div>
<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]="10">
@ -105,18 +103,15 @@
name="unloadAddress{{ idx }}"
/>
</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 *ngIf="idx !== 0"
<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
@ -143,19 +138,19 @@
</div>
<div nz-row>
<div nz-col [nzSpan]="4"></div>
<div style="display: flex; justify-content: center;">
<button nz-button nzType="primary" (click)="addEndInfo()">
<i nz-icon nzType="plus"></i>
添加卸货地
</button>
</div>
<div style="display: flex; justify-content: center">
<button nz-button nzType="primary" (click)="addEndInfo()">
<i nz-icon nzType="plus"></i>
添加卸货地
</button>
</div>
</div>
</div>
</div>
<div nz-row [nzGutter]="24" style="margin-top: 24px">
<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" formControlName="loadingTime" name="loadingTime"></nz-date-picker>
</nz-form-control>
@ -164,7 +159,7 @@
<div nz-col [nzSpan]="4"></div>
<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" formControlName="unloadingTime" name="unloadingTime"></nz-date-picker>
</nz-form-control>
@ -246,15 +241,22 @@
<sf #sf5 [schema]="schema5" [button]="'none'" [ui]="ui5" [formData]="sf5data">
<ng-template sf-template="goodsValue" let-i let-ui="ui">
<div class="align-center">
<nz-input-number [ngModel]="i.value" [nzMin]="50000" [nzMax]="3000000" [nzStep]="0.01"
(ngModelChange)="i.setValue($event)" nzPlaceHolder="请输入50000-3000000之间数值"></nz-input-number>
<nz-input-number
[ngModel]="i.value"
[nzMin]="50000"
[nzMax]="3000000"
[nzStep]="0.01"
(ngModelChange)="i.setValue($event)"
nzPlaceHolder="请输入50000-3000000之间数值"
></nz-input-number>
</div>
</ng-template>
<ng-template sf-template="insureInfo" let-i let-ui="ui">
<div class="align-center">
<input nz-input placeholder="保价费金额" [ngModel]="i.value" [disabled]="true" />
<span style="padding: 0 12px" nz-tooltip [nzTooltipTitle]="template2" nzTooltipPlacement="bottom"><i nz-icon
nzType="exclamation-circle" nzTheme="outline" style="color: #1890ff"></i></span>
<span style="padding: 0 12px" nz-tooltip [nzTooltipTitle]="template2" nzTooltipPlacement="bottom"
><i nz-icon nzType="exclamation-circle" nzTheme="outline" style="color: #1890ff"></i
></span>
<ng-template #template2>
<p>注意事项:</p>
<p>①请仔细阅读《投保告知》</p>
@ -292,7 +294,9 @@
<div nz-col nzSpan="12">
<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">¥{{ i.value| number: '0.2-2' }}(费率:{{ currentRate | number: '0.2-4' }}%</ng-template>
<ng-template sf-template="appendFee" let-i let-ui="ui"
>¥{{ i.value | number: '0.2-2' }}(费率:{{ currentRate | number: '0.2-4' }}%</ng-template
>
<ng-template sf-template="total" let-i let-ui="ui">¥{{ i.value | number: '0.2-2' }}</ng-template>
<ng-template sf-template="paymentDays" let-i let-ui="ui">
<div nz-row>
@ -307,7 +311,7 @@
nzPlaceHolder="请输入1-30"
></nz-input-number>
</div>
<div >
<div>
<span>&nbsp;&nbsp; 天内支付运费</span>
</div>
</div>
@ -319,7 +323,7 @@
</nz-card>
<nz-card>
<div class="align-center">
<button nz-button nzType="primary" (click)="submitConfirm('assign')" >指派熟车</button>
<button nz-button nzType="primary" (click)="submitConfirm('assign')">指派熟车</button>
<button nz-button nzType="primary" style="margin-left: 48px" (click)="submitConfirm('publish')" *ngIf="type === 'add'">司机抢单</button>
</div>
</nz-card>

View File

@ -1,6 +1,14 @@
:host {
::ng-deep {
nz-input-number{width: 100%;}
nz-input-number {
width: 100%;
}
nz-date-picker {
width: 94.3%;
}
}
i {
cursor: pointer;
}
}
@ -22,9 +30,23 @@
justify-content: center;
}
.swap-icon {
padding: 24px;
color: #7d7d7d;
font-size: 30px;
:hover{color: #52acff;}
}
#container {
width: 300px;
height: 180px;
}
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;
}

View File

@ -341,6 +341,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
params: { dictKey: 'car:model' },
mode: 'multiple',
placeholder: '请选择车型',
maxMultipleCount:3,
errors: { required: '请选择车型' }
}
},
@ -352,6 +353,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
params: { dictKey: 'car:length' },
mode: 'multiple',
placeholder: '请选择车长',
maxMultipleCount:3,
errors: { required: '请选择车长' }
}
}
@ -972,4 +974,42 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
goBack() {
window.history.go(-1);
}
// 装卸货地址互换
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;
});
}
}
}