|
|
|
@ -85,6 +85,9 @@ export class UnitComponent implements OnInit {
|
|
|
|
|
this.nzLoading = true |
|
|
|
|
let params = { |
|
|
|
|
CompanyName: this.searchValue.unit, |
|
|
|
|
BuildingTypeId: this.searchValue.uniytype, |
|
|
|
|
OrganizationId: this.searchValue.or, |
|
|
|
|
UseNature: this.searchValue.property, |
|
|
|
|
PageNumber: this.PageNumber, |
|
|
|
|
PageSize: this.PageSize |
|
|
|
|
} |
|
|
|
@ -133,6 +136,17 @@ export class UnitComponent implements OnInit {
|
|
|
|
|
nzOnOk: async () => { |
|
|
|
|
if (instance.validateForm.valid) { |
|
|
|
|
await new Promise((resolve, reject) => { |
|
|
|
|
let num = 0 |
|
|
|
|
for (const key in instance.validateForm.value) { |
|
|
|
|
if (Object.prototype.hasOwnProperty.call(instance.validateForm.value, key)) { |
|
|
|
|
const element = instance.validateForm.value[key]; |
|
|
|
|
if (element) { |
|
|
|
|
num += 1 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let integrity: number = num / 56 |
|
|
|
|
let body = { |
|
|
|
|
companyName: instance.validateForm.value.unitname, |
|
|
|
|
directorName: instance.validateForm.value.person, |
|
|
|
@ -142,7 +156,8 @@ export class UnitComponent implements OnInit {
|
|
|
|
|
relatedOrganizationId: instance.validateForm.value.orDa || null, |
|
|
|
|
buildingTypeId: instance.validateForm.value.unittype || null, |
|
|
|
|
useNature: instance.validateForm.value.nature, |
|
|
|
|
data: null |
|
|
|
|
data: null, |
|
|
|
|
integrity: integrity.toFixed(2) |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/Companies', body).subscribe({ |
|
|
|
|
next: async (data) => { |
|
|
|
@ -193,7 +208,7 @@ export class UnitComponent implements OnInit {
|
|
|
|
|
nzOkText: '确定', |
|
|
|
|
nzOkType: 'default', |
|
|
|
|
nzOnOk: () => { |
|
|
|
|
this.http.delete(`/api/Users/${item.id}`).subscribe(data => { |
|
|
|
|
this.http.delete(`/api/Companies/${item.id}`).subscribe(data => { |
|
|
|
|
this.message.create('success', '删除成功!'); |
|
|
|
|
this.getCompanies() |
|
|
|
|
}) |
|
|
|
|