邵佳豪 2 years ago
parent
commit
bb3be8e196
  1. 11
      src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.html
  2. 38
      src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.ts
  3. 10
      src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.html
  4. 8
      src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.ts
  5. 2
      src/app/system-management/update-of-license/update-of-license.component.html
  6. 7
      src/app/system-management/update-of-license/update-of-license.component.ts

11
src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.html

@ -35,6 +35,16 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="重要等级">重要等级</nz-form-label>
<nz-form-control>
<nz-select formControlName="importantLevel" nzPlaceHolder="请选择组织等级">
<nz-option [nzValue]="item.value" [nzLabel]="item.name" *ngFor="let item of importantLevelList">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="是否上传副本">是否上传副本</nz-form-label>
<nz-form-control>
@ -48,5 +58,6 @@
<label nz-checkbox formControlName="isYearlyCheck"></label>
</nz-form-control>
</nz-form-item>
</form>
</div>

38
src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.ts

@ -1,20 +1,28 @@
import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { handleType,handleTypeList } from 'src/app/pages/license/inform/inform.component';
import { Component, OnInit, Input } from "@angular/core";
import { NzModalRef } from "ng-zorro-antd/modal";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { HttpClient } from "@angular/common/http";
import {
handleType,
handleTypeList,
} from "src/app/pages/license/inform/inform.component";
@Component({
selector: 'app-add-update-of-license',
templateUrl: './add-update-of-license.component.html',
styleUrls: ['./add-update-of-license.component.scss']
selector: "app-add-update-of-license",
templateUrl: "./add-update-of-license.component.html",
styleUrls: ["./add-update-of-license.component.scss"],
})
export class AddUpdateOfLicenseComponent implements OnInit {
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
constructor(
private modal: NzModalRef,
private fb: FormBuilder,
private http: HttpClient
) {}
importantLevelList= [
{ name: "普通", value: 0 },
{ name: "重要", value: 1 }
];
ngOnInit(): void {
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
@ -22,13 +30,13 @@ export class AddUpdateOfLicenseComponent implements OnInit {
closingRemindDays: [30, [Validators.required]],
handleType: [[], [Validators.required]],
isEctype: [false, [Validators.required]],
isYearlyCheck: [true, [Validators.required]]
isYearlyCheck: [true, [Validators.required]],
importantLevel: [0, [Validators.required]],
});
}
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
this.modal.destroy({ data: "this the result data" });
}
handleTypeList: handleTypeList[] = new handleType().list; //办理类型list
}

10
src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.html

@ -34,6 +34,16 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="重要等级">重要等级</nz-form-label>
<nz-form-control>
<nz-select formControlName="importantLevel" nzPlaceHolder="请选择组织等级">
<nz-option [nzValue]="item.value" [nzLabel]="item.name" *ngFor="let item of importantLevelList">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="是否上传副本">是否上传副本</nz-form-label>
<nz-form-control>

8
src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.ts

@ -14,7 +14,10 @@ export class EditUpdateOfLicenseComponent implements OnInit {
@Input() data?: any;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
importantLevelList= [
{ name: "普通", value: 0 },
{ name: "重要", value: 1 }
];
ngOnInit(): void {
this.validateForm = this.fb.group({
name: [this.data.licenseName, [Validators.required]],
@ -22,7 +25,8 @@ export class EditUpdateOfLicenseComponent implements OnInit {
closingRemindDays: [this.data.closingRemindDays, [Validators.required]],
handleType: [this.data.handleTypes, [Validators.required]],
isEctype: [this.data.hasAttachment, [Validators.required]],
isYearlyCheck: [this.data.isYearlyCheck, [Validators.required]]
isYearlyCheck: [this.data.isYearlyCheck, [Validators.required]],
importantLevel: [this.data.importantLevel, [Validators.required]]
});
}
destroyModal(): void {

2
src/app/system-management/update-of-license/update-of-license.component.html

@ -19,6 +19,7 @@
<th>办理类型</th>
<th>是否上传副本</th>
<th>是否年检</th>
<th>重要等级</th>
<th>操作</th>
</tr>
</thead>
@ -30,6 +31,7 @@
<td>{{getHandleTypes(data.handleTypes)}}</td>
<td>{{data.hasAttachment ? '是' : '否'}}</td>
<td>{{data.isYearlyCheck ? '是' : '否'}}</td>
<td>{{data.importantLevel ? '重要':'普通'}}</td>
<td class="operation">
<a (click)="edit(data)">编辑</a>
<a (click)="delete(data)">删除</a>

7
src/app/system-management/update-of-license/update-of-license.component.ts

@ -49,6 +49,7 @@ export class UpdateOfLicenseComponent implements OnInit {
nzWidth: 588,
nzComponentParams: {},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
let body = {
@ -57,7 +58,8 @@ export class UpdateOfLicenseComponent implements OnInit {
closingRemindDays: instance.validateForm.value.closingRemindDays,
hasAttachment: instance.validateForm.value.isEctype,
handleTypes: instance.validateForm.value.handleType,
isYearlyCheck: instance.validateForm.value.isYearlyCheck
isYearlyCheck: instance.validateForm.value.isYearlyCheck,
importantLevel: instance.validateForm.value.importantLevel,
}
this.http.post('/api/services/app/ValidityLicenseType/Create', body).subscribe(data => {
resolve(data)
@ -99,7 +101,8 @@ export class UpdateOfLicenseComponent implements OnInit {
closingRemindDays: instance.validateForm.value.closingRemindDays,
hasAttachment: instance.validateForm.value.isEctype,
handleTypes: instance.validateForm.value.handleType,
isYearlyCheck: instance.validateForm.value.isYearlyCheck
isYearlyCheck: instance.validateForm.value.isYearlyCheck,
importantLevel: instance.validateForm.value.importantLevel,
}
this.http.put('/api/services/app/ValidityLicenseType/Update', body).subscribe(data => {
resolve(data)

Loading…
Cancel
Save