This commit is contained in:
wangshiming
2022-05-07 17:23:01 +08:00
parent 91bc1f23e7
commit 5206b4a0c2
7 changed files with 61 additions and 17 deletions

View File

@ -1,3 +1,13 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-04-28 20:27:07
* @LastEditors : Shiming
* @LastEditTime : 2022-05-07 16:22:32
* @FilePath : \\tms-obc-web\\src\\app\\routes\\financial-management\\components\\voucher-summary\\voucher-summary.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<!-- <page-header-wrapper [title]="'凭证汇总'"> <!-- <page-header-wrapper [title]="'凭证汇总'">
</page-header-wrapper> </page-header-wrapper>
@ -29,7 +39,8 @@
<div class="mr-sm"> <div class="mr-sm">
<button nz-button nzDanger [nzLoading]="service.http.loading" (click)="openDrawer()" acl <button nz-button nzDanger [nzLoading]="service.http.loading" (click)="openDrawer()" acl
[acl-ability]="['FINANCIAL-VOUCHER-list']">筛选</button> [acl-ability]="['FINANCIAL-VOUCHER-list']">筛选</button>
<button nz-button nzDanger (click)='exportList()'> 导出</button> <button nz-button nzDanger acl
[acl-ability]="['FINANCIAL-VOUCHER-SUMMARY-export']" (click)='exportList()'> 导出</button>
</div> </div>
</div> </div>
<st #st [data]="service.$api_get_fico_vch_page" [columns]="columns" [req]="{ process: beforeReq }" [page]="{}" <st #st [data]="service.$api_get_fico_vch_page" [columns]="columns" [req]="{ process: beforeReq }" [page]="{}"

View File

@ -39,7 +39,7 @@
name="loadName{{ idx }}" maxlength="30" placeholder="请输入联系人姓名" /> name="loadName{{ idx }}" maxlength="30" placeholder="请输入联系人姓名" />
</nz-form-control> </nz-form-control>
<nz-form-control [nzSpan]="12" [nzErrorTip]="'请输入联系人电话'"> <nz-form-control [nzSpan]="12" [nzErrorTip]="'请输入联系人电话'">
<input nz-input [(ngModel)]="data1.contractTelephone" maxlength="11" <input nz-input [(ngModel)]="data1.contractTelephone" maxlength="11" (ngModelChange)="onChangePhone(data1.contractTelephone)"
formControlName="loadPhone{{ idx }}" name="loadPhone{{ idx }}" placeholder="请输入联系人电话" /> formControlName="loadPhone{{ idx }}" name="loadPhone{{ idx }}" placeholder="请输入联系人电话" />
</nz-form-control> </nz-form-control>
</div> </div>
@ -74,7 +74,7 @@
name="unloadAddress{{ idx }}" placeholder="请输入联系人姓名" /> name="unloadAddress{{ idx }}" placeholder="请输入联系人姓名" />
</nz-form-control> </nz-form-control>
<nz-form-control [nzSpan]="12" [nzErrorTip]="'请输入联系人电话'"> <nz-form-control [nzSpan]="12" [nzErrorTip]="'请输入联系人电话'">
<input nz-input [(ngModel)]="data2.contractTelephone" <input nz-input [(ngModel)]="data2.contractTelephone" (ngModelChange)="onChangePhone(data2.contractTelephone)"
formControlName="unloadPhone{{ idx }}" name="unloadAddress{{ idx }}" maxlength="11" formControlName="unloadPhone{{ idx }}" name="unloadAddress{{ idx }}" maxlength="11"
placeholder="请输入联系人电话" /> placeholder="请输入联系人电话" />
</nz-form-control> </nz-form-control>

View File

@ -56,6 +56,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
maxTrainNumber: 99999, maxTrainNumber: 99999,
maxFreight: 9999999 maxFreight: 9999999
}; };
patternStr = `^((13[0-9])|(14[0-1,4-9])|(15([0-3,5-9]))|(17[0-8])|(18[0-9])|(19[0-3,5-9])|(16[2,5,6,7]))\\d{8}$`;
constructor( constructor(
private http: _HttpClient, private http: _HttpClient,
fb: FormBuilder, fb: FormBuilder,
@ -69,10 +70,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
this.validateForm1 = fb.group({ this.validateForm1 = fb.group({
loadAddress0: [null, [Validators.required]], loadAddress0: [null, [Validators.required]],
loadName0: [null, [Validators.required]], loadName0: [null, [Validators.required]],
loadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]], loadPhone0: [null, [Validators.required, Validators.pattern(this.patternStr)]],
unloadAddress0: [null, [Validators.required]], unloadAddress0: [null, [Validators.required]],
unloadName0: [null, [Validators.required]], unloadName0: [null, [Validators.required]],
unloadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]] unloadPhone0: [null, [Validators.required, Validators.pattern(this.patternStr)]]
}); });
} }
@ViewChild('sf1', { static: false }) sf1!: SFComponent; @ViewChild('sf1', { static: false }) sf1!: SFComponent;
@ -1170,4 +1171,17 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
} }
}); });
} }
onChangePhone(value: string): void {
console.log(value);
this.updateValue(value);
}
updateValue(value: string): void {
const reg = /^-?(0|[1-9][0-9]*)(\.[0-9]*)?$/;
// if ((!isNaN(+value) && reg.test(value)) || value === '' || value === '-') {
// this.value = value;
// }
// this.inputElement!.nativeElement.value = this.value;
// this.updateTitle();
}
} }

View File

@ -17,7 +17,7 @@
<div class="card-title">装卸货信息<span class="tip-font">预计公里数:<em>{{ totalDistance }}km</em>,预计行程耗时:<em>{{ totalTime }}小时</em></span> <div class="card-title">装卸货信息<span class="tip-font">预计公里数:<em>{{ totalDistance }}km</em>,预计行程耗时:<em>{{ totalTime }}小时</em></span>
</div> </div>
<form #ngForm="ngForm" nz-form role="form"> <form #ngForm="ngForm" [formGroup]="validateForm1" nz-form role="form">
<div nz-row [nzGutter]="24"> <div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<div *ngFor="let data1 of startInfo; let idx = index"> <div *ngFor="let data1 of startInfo; let idx = index">

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { NgForm } from '@angular/forms'; import { FormBuilder, FormGroup, Validators, FormControl, NgForm } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { import {
SFComponent, SFComponent,
@ -28,7 +28,7 @@ import { SupplyManagementQrcodePageComponent } from '../qrcode-page/qrcode-page.
styleUrls: ['./bulk-release-publish.component.less'] styleUrls: ['./bulk-release-publish.component.less']
}) })
export class SupplyManagementBulkReleasePublishComponent implements OnInit { export class SupplyManagementBulkReleasePublishComponent implements OnInit {
@ViewChild('ngForm') validateForm1: FormGroup;
ngForm!: NgForm; ngForm!: NgForm;
sf1data: any; // 货源单设置回显 sf1data: any; // 货源单设置回显
sf3data: any; // 货源单设置回显 sf3data: any; // 货源单设置回显
@ -50,6 +50,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
maxFreight: 9999999 maxFreight: 9999999
} }
shipperName = ''; shipperName = '';
patternStr = `^((13[0-9])|(14[0-1,4-9])|(15([0-3,5-9]))|(17[0-8])|(18[0-9])|(19[0-3,5-9])|(16[2,5,6,7]))\\d{8}$`;
// // 单位 // // 单位
startInfo: any[] = []; startInfo: any[] = [];
endInfo: any[] = []; endInfo: any[] = [];
@ -58,6 +59,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
freightTypeOptions: any; freightTypeOptions: any;
constructor( constructor(
private http: _HttpClient, private http: _HttpClient,
fb: FormBuilder,
private modalService: NzModalService, private modalService: NzModalService,
private settingSrv: SettingsService, private settingSrv: SettingsService,
private service: SupplyManagementService, private service: SupplyManagementService,
@ -66,7 +68,14 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
private amapService: AmapService, private amapService: AmapService,
public shipperSrv: ShipperBaseService public shipperSrv: ShipperBaseService
) { ) {
this.validateForm1 = fb.group({
loadAddress0: [null, [Validators.required]],
loadName0: [null, [Validators.required]],
loadPhone0: [null, [Validators.required, Validators.pattern(this.patternStr)]],
unloadAddress0: [null, [Validators.required]],
unloadName0: [null, [Validators.required]],
unloadPhone0: [null, [Validators.required, Validators.pattern(this.patternStr)]]
});
} }
@ViewChild('sf1', { static: false }) sf1!: SFComponent; @ViewChild('sf1', { static: false }) sf1!: SFComponent;
schema1: SFSchema = {}; schema1: SFSchema = {};

View File

@ -43,6 +43,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
intervalDays: 999, intervalDays: 999,
maxTimes: 5 maxTimes: 5
}; };
patternStr = `^((13[0-9])|(14[0-1,4-9])|(15([0-3,5-9]))|(17[0-8])|(18[0-9])|(19[0-3,5-9])|(16[2,5,6,7]))\\d{8}$`;
sf1data: any; // 货源单设置回显 sf1data: any; // 货源单设置回显
sf3data: any; // 货源单设置回显 sf3data: any; // 货源单设置回显
sf4data: any; // 货源单设置回显 sf4data: any; // 货源单设置回显
@ -78,7 +79,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
) { ) {
this.validateForm1 = fb.group({ this.validateForm1 = fb.group({
loadingTime: [null, [Validators.required]], loadingTime: [null, [Validators.required]],
unloadingTime: [null, [Validators.required]] unloadingTime: [null, [Validators.required]],
}); });
this.envCache = this.eaCacheSrv.get(cacheConf.env); this.envCache = this.eaCacheSrv.get(cacheConf.env);
} }
@ -806,7 +807,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}); });
this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, [Validators.required, Validators.pattern(this.patternStr)]));
} }
} }
@ -862,7 +863,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl( this.validateForm1.addControl(
`unloadPhone${controlId}`, `unloadPhone${controlId}`,
new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]) new FormControl(null, [Validators.required, Validators.pattern(this.patternStr)])
); );
} }
} }
@ -1370,6 +1371,15 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.sf7.setValue('/toPay', this.sf7data.toPay); this.sf7.setValue('/toPay', this.sf7data.toPay);
this.sf7.setValue('/receiptPay', this.sf7data.receiptPay); this.sf7.setValue('/receiptPay', this.sf7data.receiptPay);
this.payChange(); this.payChange();
// console.log('88888');
// this.validateForm1.reset();
// for (const key in this.validateForm1.controls) {
// if (this.validateForm1.controls.hasOwnProperty(key)) {
// this.validateForm1.controls[key].markAsPristine();
// this.validateForm1.controls[key].updateValueAndValidity();
// }
// }
} }
// 选择地址 // 选择地址

View File

@ -52,6 +52,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
totalTime = 0.0; //路程总时间 totalTime = 0.0; //路程总时间
currentRate = 0; //实时计算的费率 currentRate = 0; //实时计算的费率
shipperName = ''; shipperName = '';
patternStr = `^((13[0-9])|(14[0-1,4-9])|(15([0-3,5-9]))|(17[0-8])|(18[0-9])|(19[0-3,5-9])|(16[2,5,6,7]))\\d{8}$`;
constructor( constructor(
private http: _HttpClient, private http: _HttpClient,
fb: FormBuilder, fb: FormBuilder,
@ -67,10 +68,10 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
this.validateForm1 = fb.group({ this.validateForm1 = fb.group({
loadAddress0: [null, [Validators.required]], loadAddress0: [null, [Validators.required]],
loadName0: [null, [Validators.required]], loadName0: [null, [Validators.required]],
loadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]], loadPhone0: [null, [Validators.required, Validators.pattern(this.patternStr)]],
unloadAddress0: [null, [Validators.required]], unloadAddress0: [null, [Validators.required]],
unloadName0: [null, [Validators.required]], unloadName0: [null, [Validators.required]],
unloadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]], unloadPhone0: [null, [Validators.required, Validators.pattern(this.patternStr)]],
loadingTime: [null, [Validators.required]], loadingTime: [null, [Validators.required]],
unloadingTime: [null, [Validators.required]] unloadingTime: [null, [Validators.required]]
}); });
@ -609,7 +610,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
receiptUserPhone: { receiptUserPhone: {
type: 'string', type: 'string',
title: '联系电话', title: '联系电话',
format: 'mobile',
maxLength: 11, maxLength: 11,
ui: { ui: {
errors: { errors: {
@ -836,7 +836,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
}); });
this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, [Validators.required, Validators.pattern(this.patternStr)]));
} }
} }
// 添加 删除发货卸货地址 // 添加 删除发货卸货地址
@ -865,7 +865,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl( this.validateForm1.addControl(
`unloadPhone${controlId}`, `unloadPhone${controlId}`,
new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]) new FormControl(null, [Validators.required, Validators.pattern(this.patternStr)])
); );
} }
} }