|
|
|
@ -47,6 +47,7 @@ export class UnitComponent implements OnInit {
|
|
|
|
|
this.listOfData = data.items |
|
|
|
|
this.listOfData = [...this.listOfData] |
|
|
|
|
console.log(this.listOfData); |
|
|
|
|
|
|
|
|
|
for (let index = 0; index < this.listOfData.length; index++) { |
|
|
|
|
this.listOfData[index].creationTime=this.listOfData[index].creationTime.substring(0,10) |
|
|
|
|
|
|
|
|
@ -60,7 +61,8 @@ export class UnitComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
addOr(node?: any) { |
|
|
|
|
|
|
|
|
|
console.log(node); |
|
|
|
|
|
|
|
|
|
const modal = this.modal.create({ |
|
|
|
|
nzTitle: "新增单位", |
|
|
|
|
nzContent: AddUnitComponent, |
|
|
|
@ -71,7 +73,7 @@ export class UnitComponent implements OnInit {
|
|
|
|
|
console.log(instance.validateForm); |
|
|
|
|
if (instance.validateForm.valid) { |
|
|
|
|
console.log(instance.validateForm); |
|
|
|
|
// return
|
|
|
|
|
return |
|
|
|
|
await new Promise(resolve => { |
|
|
|
|
let body = { |
|
|
|
|
companyName: instance.validateForm.value.unit, |
|
|
|
@ -86,12 +88,15 @@ export class UnitComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
this.http.post('/api/Companies', body).subscribe({ |
|
|
|
|
next: (data: any) => { |
|
|
|
|
console.log(data, 80808) |
|
|
|
|
|
|
|
|
|
this.message.create('success', '编辑成功!'); |
|
|
|
|
modal.destroy() |
|
|
|
|
this.getCompanies() |
|
|
|
|
return true |
|
|
|
|
}, |
|
|
|
|
error: (err) => { |
|
|
|
|
|
|
|
|
|
console.log(err) |
|
|
|
|
this.message.create('warning', '创建失败'); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|