Commit a27b33aa by Nattana Chaiyamat

แก้ Datagrid ข้อมูลในตารางไม่เปลี่ยน

parent 31dc0ed4
......@@ -203,6 +203,23 @@ export class SupervisorEvaluationComponent {
this.getBossList()
}
getBossList() {
this.appraisalService.getBossList().subscribe({
next: response => {
this.subordinate.dataList = JSON.parse(JSON.stringify(response))
this.cdr.detectChanges()
if (this.subordinate.dataList.length) {
this.subordinate.select = JSON.parse(JSON.stringify(this.subordinate.dataList[0]))
this.setSyncfution()
this.setEcharts()
this.cdr.detectChanges()
}
this.searchDataGrid(this.search)
}, error: error => {
this.cdr.detectChanges()
}
})
}
setSyncfution() {
this.syncfution = {
dataList: [],
searchSettings: {
......@@ -219,82 +236,67 @@ export class SupervisorEvaluationComponent {
},
columns: []
}
this.dataSourceSearch = []
this.dataSourceFilter = [];
this.aggregatesSum = [];
this.aggregatesCount = [];
this.aggregatesAvg = [];
this.aggregatesMin = [];
this.aggregatesMax = [];
this.appraisalService.getBossList().subscribe({
next: response => {
this.subordinate.dataList = JSON.parse(JSON.stringify(response))
this.cdr.detectChanges()
if (this.subordinate.dataList.length) {
this.subordinate.select = JSON.parse(JSON.stringify(this.subordinate.dataList[0]))
if (this.subordinate.select?.showPms) {
this.syncfution.dataList = this.subordinate.select.masfromevaluationassessment.map(e => ({
employeeId: e.apsassessy.employeeId,
thFullName: e.apsassessy.thFullName,
position: e.apsassessy.position.tdesc,
statusType: this.statusCompetencyText(e.statusIdp.statusType),
statusIdp: e.statusIdp,
sumScore: e.sumScore,
grade: e.grade,
apsapproveType: e.apsapproveType.tdesc,
apsassessy: e.apsassessy,
masfromStatusType: e.masfromStatusType
}))
this.syncfution.columns =
[{
field: "employeeId",
headerText: "รหัสพนักงาน",
type: "string",
isPrimaryKey: true,
},
{
field: "thFullName",
headerText: "ชื่อพนักงาน",
type: "string"
},
{
field: "position",
headerText: "ตำเเหน่งงาน",
type: "string"
},
{
field: "statusType",
headerText: "ประเมิน",
type: "string"
},
{
field: "sumScore",
headerText: "ผลประเมิน",
type: "string"
},
{
field: "grade",
headerText: "เกรด",
type: "string"
},
{
field: "apsapproveType",
headerText: "สถานะผู้ประเมิน",
type: "string"
}]
}
this.setEcharts()
this.cdr.detectChanges()
}
this.searchDataGrid(this.search)
}, error: error => {
this.cdr.detectChanges()
}
})
if (this.subordinate.select?.showPms) {
this.setSyncfutionDataList()
this.syncfution.columns =
[{
field: "employeeId",
headerText: "รหัสพนักงาน",
type: "string",
isPrimaryKey: true,
},
{
field: "thFullName",
headerText: "ชื่อพนักงาน",
type: "string"
},
{
field: "position",
headerText: "ตำเเหน่งงาน",
type: "string"
},
{
field: "statusType",
headerText: "ประเมิน",
type: "string"
},
{
field: "sumScore",
headerText: "ผลประเมิน",
type: "string"
},
{
field: "grade",
headerText: "เกรด",
type: "string"
},
{
field: "apsapproveType",
headerText: "สถานะผู้ประเมิน",
type: "string"
}]
}
}
setSyncfutionDataList() {
if (this.subordinate.select?.showPms) {
this.syncfution.dataList = this.subordinate.select.masfromevaluationassessment.map(e => ({
employeeId: e.apsassessy.employeeId,
thFullName: e.apsassessy.thFullName,
position: e.apsassessy.position.tdesc,
statusType: this.statusCompetencyText(e.statusIdp.statusType),
statusIdp: e.statusIdp,
sumScore: e.sumScore,
grade: e.grade,
apsapproveType: e.apsapproveType.tdesc,
apsassessy: e.apsassessy,
masfromStatusType: e.masfromStatusType
}))
}
}
selectDataList(data?: AppraisalSubordinateModel) {
this.selectEmp.clear()
this.subordinate.select = JSON.parse(JSON.stringify(data))
this.setSyncfutionDataList()
this.setEcharts()
this.cdr.detectChanges()
this.searchDataGrid(this.search)
......@@ -592,7 +594,6 @@ export class SupervisorEvaluationComponent {
if (args.requestType === 'filtering') {
if (this.grid) {
this.dataSourceFilter = ((this.grid as GridComponent).getFilteredRecords() as any).length ? ((this.grid as GridComponent).getFilteredRecords() as any) : JSON.parse(JSON.stringify(this.dataSourceSearch || []));
console.log("🥷🏿 ~ this.dataSourceFilter:", this.dataSourceFilter)
}
}
}
......
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