You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.3 KiB
52 lines
1.3 KiB
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'; |
|
@Component({ |
|
selector: 'app-disposeequipment', |
|
templateUrl: './disposeequipment.component.html', |
|
styleUrls: ['./disposeequipment.component.scss'] |
|
}) |
|
export class DisposeequipmentComponent implements OnInit { |
|
|
|
@Input() data?: any; |
|
|
|
validateForm!: FormGroup; |
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } |
|
|
|
radioValue = "A" |
|
data2 |
|
|
|
copydata2 |
|
ngOnInit(): void { |
|
|
|
this.copydata2 = JSON.parse(JSON.stringify(this.data)) |
|
|
|
|
|
this.validateForm = this.fb.group({ |
|
name: [null, [Validators.required]], |
|
specification: [null, [Validators.required]], |
|
buytime: [null, [Validators.required]], |
|
prodtime: [null, [Validators.required]], |
|
validitytime: [null, [Validators.required]] |
|
}); |
|
this.data2 = JSON.parse(JSON.stringify(this.data)) |
|
} |
|
|
|
destroyModal() { |
|
this.modal.destroy({ data: 'this the result data' }); |
|
} |
|
ok() { |
|
this.modal.triggerOk() |
|
} |
|
//是否报废 |
|
isScrap = false |
|
ngModelChange(e) { |
|
console.log(e) |
|
if (e == 'A') { |
|
this.isScrap = false |
|
} else { |
|
this.isScrap = true |
|
} |
|
} |
|
}
|
|
|