diff --git a/src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts b/src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts index c277793..cdcc811 100644 --- a/src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts +++ b/src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts @@ -90,13 +90,15 @@ export class DaOneselfPlanComponent implements OnInit { item.data = [] item.passed = 0 item.inspected = 0 + item.percentage = 0 }); let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let params = { Month: selectedTime, OrganizationId: this.OrganizationId, PageNumber: 1, - PageSize: 9999 + PageSize: 9999, + approvalStatuses: ['待处理', '通过', '驳回', '待检查', '已检查'] } return await new Promise((resolve, reject) => { this.http.get('/api/PlanTasks', { @@ -233,6 +235,7 @@ export class DaOneselfPlanComponent implements OnInit { }); const instance = modal.getContentComponent(); modal.afterClose.subscribe(result => { + this.getTasks() this.getTaskListOfStation(item) }); } diff --git a/src/app/home/task/da-oneself-plan/plan-adjustment/plan-adjustment.component.ts b/src/app/home/task/da-oneself-plan/plan-adjustment/plan-adjustment.component.ts index 431b430..301274a 100644 --- a/src/app/home/task/da-oneself-plan/plan-adjustment/plan-adjustment.component.ts +++ b/src/app/home/task/da-oneself-plan/plan-adjustment/plan-adjustment.component.ts @@ -17,8 +17,19 @@ export class PlanAdjustmentComponent implements OnInit { spin1 = false spin2 = false userId + organizationName + isSupervisor + OrganizationId ngOnInit(): void { this.userId = JSON.parse(sessionStorage.getItem('userData')).id + this.organizationName = JSON.parse(sessionStorage.getItem('userData')).organizationName + + this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId + let roles = JSON.parse(sessionStorage.getItem('userData')).roles + let isSupervisor = roles.find(item => { + return item.name.indexOf('检查') != -1 + }) + isSupervisor ? this.isSupervisor = true : this.isSupervisor = false this.getTaskListOfStation(this.data, '未接任务') } push(i, item, e) { @@ -129,7 +140,8 @@ export class PlanAdjustmentComponent implements OnInit { } else { params = { Month: this.time, - SupervisorId: this.userId, + SupervisorId: this.isSupervisor ? this.userId : null, + AssitantOrganizationId: this.isSupervisor ? null : this.OrganizationId, PageNumber: this.PageNumber, approvalStatuses: statuses, PageSize: this.PageSize diff --git a/src/app/home/task/station-weekly-plan/station-weekly-plan.component.html b/src/app/home/task/station-weekly-plan/station-weekly-plan.component.html index bc0a800..7560c8e 100644 --- a/src/app/home/task/station-weekly-plan/station-weekly-plan.component.html +++ b/src/app/home/task/station-weekly-plan/station-weekly-plan.component.html @@ -96,18 +96,20 @@

{{i.company.companyName}} - 接受 - 拒绝 - 已通过 - 已驳回 + 接受 + 拒绝 + {{i.approvalStatus}}

{{i.company.organization.name}}

- 接受 - 拒绝 - 已通过 - 已驳回 + 接受 + 拒绝 + {{i.approvalStatus}}

diff --git a/src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts b/src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts index db8cf37..e254528 100644 --- a/src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts +++ b/src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts @@ -178,8 +178,11 @@ export class StationWeeklyPlanComponent implements OnInit { PageNumber = 1 PageSize = 9999 async getTaskList() { - this.cardData.forEach(item => { - item.data = [] + this.cardData.forEach(element => { + element.data = [] + element.percentage = 0 + element.passed = 0 + element.inspected = 0 }) this.isLoading = true let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' @@ -188,7 +191,8 @@ export class StationWeeklyPlanComponent implements OnInit { SupervisorId: this.isSupervisor ? this.userId : null, AssitantOrganizationId: this.isSupervisor ? null : this.OrganizationId, PageNumber: this.PageNumber, - PageSize: this.PageSize + PageSize: this.PageSize, + approvalStatuses: ['待处理', '通过', '驳回', '待检查', '已检查'] } return await new Promise((resolve, reject) => { this.http.get('/api/PlanTasks', { @@ -603,6 +607,7 @@ export class StationWeeklyPlanComponent implements OnInit { }); const instance = modal.getContentComponent(); modal.afterClose.subscribe(result => { + this.getTaskList() this.getTaskListPass(this.stationData[0]) }); } diff --git a/src/app/home/task/station-weekly-plan/task-details/task-details.component.html b/src/app/home/task/station-weekly-plan/task-details/task-details.component.html index e44e517..046b271 100644 --- a/src/app/home/task/station-weekly-plan/task-details/task-details.component.html +++ b/src/app/home/task/station-weekly-plan/task-details/task-details.component.html @@ -18,11 +18,9 @@

- 接受 - 拒绝 - 待处理 - 已通过 - 已驳回 + 接受 + 拒绝 + {{item.approvalStatus}}
diff --git a/src/app/home/task/zhi-indicators/edit-or/edit-or.component.html b/src/app/home/task/zhi-indicators/edit-or/edit-or.component.html index f86ce3d..66999ed 100644 --- a/src/app/home/task/zhi-indicators/edit-or/edit-or.component.html +++ b/src/app/home/task/zhi-indicators/edit-or/edit-or.component.html @@ -3,13 +3,12 @@ 协助机构 - - 单位名称 - 配合机构 + 配合机构/人员 说明 操作 @@ -134,6 +134,9 @@ /{{i.name}} + + /{{i.name}} + 修改机构 @@ -268,7 +271,7 @@ 单位名称 - 配合机构 + 配合机构/人员 说明 操作 @@ -282,6 +285,9 @@ /{{i.name}} + + /{{i.name}} + 修改机构 diff --git a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts index bc66cdd..2d810de 100644 --- a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts +++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts @@ -298,6 +298,8 @@ export class ZhiIndicatorsComponent implements OnInit { element.title = element.name element.selectable = false element.disableCheckbox = true + element.datatype = '机构' + element.level == 'squadron' ? element.disableCheckbox = false : null }); this.allOrList = JSON.parse(JSON.stringify(data.items)) resolve(data) @@ -329,6 +331,8 @@ export class ZhiIndicatorsComponent implements OnInit { }) }) } + + editOr(incomingData, item) { const modal = this.modal.create({ nzTitle: '修改协助机构', @@ -337,15 +341,23 @@ export class ZhiIndicatorsComponent implements OnInit { nzWidth: 660, nzMaskClosable: false, nzComponentParams: { - selectedData: item.supervisorIds, + selectedData: [...item.supervisorIds, ...item.assitantOrganizationIds], organizationList: JSON.parse(JSON.stringify(this.allOrList)), - users: JSON.parse(JSON.stringify(this.users)), + // users: JSON.parse(JSON.stringify(this.users)), + supervisorList: [...JSON.parse(JSON.stringify(this.assitantsupervisorList)), ...JSON.parse(JSON.stringify(this.mainsupervisorList))] }, nzOnOk: async () => { if (instance.validateForm.valid) { await new Promise((resolve, reject) => { + console.log(instance.nzTreeComponent.getCheckedNodeList()) + let supervisorIds = [] + let assitantOrganizationIds = [] + instance.nzTreeComponent.getCheckedNodeList().forEach(item => { + item.origin.datatype == '机构' ? assitantOrganizationIds.push(item.key) : supervisorIds.push(item.key) + }) let body = { - supervisorIds: instance.validateForm.value.organization, + supervisorIds: supervisorIds, + assitantOrganizationIds: assitantOrganizationIds } this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({ next: async (data: any) => { @@ -370,6 +382,8 @@ export class ZhiIndicatorsComponent implements OnInit { modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); } + + orcheckbox(data, $event, node) { if ($event) { data.search2Value.push(node.origin.id) @@ -428,7 +442,9 @@ export class ZhiIndicatorsComponent implements OnInit { }) }); - this.getUsers() + // this.getUsers() + + Promise.all([this.getCompanies(), this.getAllOrganization()]) .then((results) => { let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))] @@ -596,7 +612,7 @@ export class ZhiIndicatorsComponent implements OnInit { } ngOnDestroy(): void { - console.log('毁灭了') + // console.log('毁灭了') // this.doubleRandom.isPopover = false } @@ -650,6 +666,14 @@ export class ZhiIndicatorsComponent implements OnInit { params: params }).subscribe((data: any) => { console.log('检查员列表', data) + data.forEach(element => { + element.parentId = element.organizationId + element.key = element.id + element.title = element.name + element.selectable = false + element.disableCheckbox = false + element.datatype = '人员' + }); if (type == 'main') { this.mainsupervisorList = data } else {