Commit 446cb32c by Nattana Chaiyamat

ทะเบียนบริษัท

parent 6041af56
......@@ -322,7 +322,7 @@
</div>
<div class="flex justify-center mt-2rem mb-1rem space-x-4">
<button type="submit" class="ti-btn ti-btn-secondary"
data-hs-overlay="#position-unit-component-upload-modal" [class.ti-btn-disabled]="!selectedFile"
data-hs-overlay="#company-registration-page-upload-modal" [class.ti-btn-disabled]="!selectedFile"
(click)="uploadFile()" [disabled]="!selectedFile" [disabled]="!selectedFile">
อัปโหลด
</button>
......
......@@ -73,6 +73,7 @@ export class CompanyRegistrationPageComponent {
addCompany() {
const body = new MyCompanyModel({ companyId: this.dataSelect.code, tdesc: this.dataSelect.tdesc, edesc: this.dataSelect.edesc, addressText: this.dataSelect.address, contactText: this.dataSelect.contact })
this.dataLoading = true
this.companyService.post(body).subscribe({
next: response => {
if (response.success) {
......@@ -80,9 +81,13 @@ export class CompanyRegistrationPageComponent {
this.getCompanyList()
} else {
this.showAlert(response.message, 'error')
this.dataLoading = false
this.cdr.detectChanges()
}
}, error: error => {
this.showAlert(error.message, 'error')
this.cdr.detectChanges()
this.dataLoading = false
}
})
}
......@@ -93,6 +98,7 @@ export class CompanyRegistrationPageComponent {
} else {
body = this.dataList.filter(x => x.check && x.data.code != '100').map(x => new MyCompanyModel({ companyId: x.data.code, tdesc: x.data.tdesc, edesc: x.data.edesc, addressText: x.data.address, contactText: x.data.contact }))
}
this.dataLoading = true
this.companyService.delete(body).subscribe({
next: response => {
if (response.success) {
......@@ -100,9 +106,13 @@ export class CompanyRegistrationPageComponent {
this.getCompanyList()
} else {
this.showAlert(response.message, 'error')
this.dataLoading = false
this.cdr.detectChanges()
}
}, error: error => {
this.showAlert(error.message, 'error')
this.cdr.detectChanges()
this.dataLoading = false
}
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment