From 50e19317ec473fa2b8452458c6a6941aa490f777 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Thu, 27 Oct 2022 14:48:38 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=8C=E5=96=84=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/home.component.html | 2 +- .../statistic-analysis/home/home.component.ts | 56 +++++++++++++++++-- .../checkagain/checkagain.component.ts | 2 +- .../station-task-apply.component.html | 9 ++- .../station-task-apply.component.ts | 28 +++++++++- .../station-task-execution.component.html | 9 ++- .../station-task-execution.component.ts | 24 ++++++++ .../station-weekly-plan.component.html | 19 +++++-- .../station-weekly-plan.component.ts | 31 ++++++++++ src/app/http-interceptors/base-interceptor.ts | 2 +- 10 files changed, 162 insertions(+), 20 deletions(-) diff --git a/src/app/home/statistic-analysis/home/home.component.html b/src/app/home/statistic-analysis/home/home.component.html index 036df76..2962d8f 100644 --- a/src/app/home/statistic-analysis/home/home.component.html +++ b/src/app/home/statistic-analysis/home/home.component.html @@ -162,7 +162,7 @@
-
+
diff --git a/src/app/home/statistic-analysis/home/home.component.ts b/src/app/home/statistic-analysis/home/home.component.ts index f6562bf..4f6202d 100644 --- a/src/app/home/statistic-analysis/home/home.component.ts +++ b/src/app/home/statistic-analysis/home/home.component.ts @@ -336,7 +336,13 @@ export class HomeComponent implements OnInit { this.completionOfTaskBar = echarts.init(document.getElementById('completionOfTask2'), null, { devicePixelRatio: 2 }); await this.getData() - this.echartsSetData() + + let orid = JSON.parse(sessionStorage.getItem('userData')).organizationId + Promise.all([this.getData(), this.getData_taskStatByOrg(orid)]).then(data => { + this.echartsSetData() + this.echartsSetData_taskStatByOrg() + }) + } assistTaskRankingData: any = [ @@ -400,6 +406,26 @@ export class HomeComponent implements OnInit { } + statisticalData_taskStatByOrg + isLoading2 = false + //按组织获取任务完成情况 + async getData_taskStatByOrg(orid) { + this.isLoading2 = true + return new Promise((resolve, reject) => { + this.http.get('/api/PlanTasks/Dashboard_TaskStatByOrg', { + params: { + organizaionId: orid + } + }).subscribe((data: any) => { + console.log('按组织获取任务完成情况', data) + this.statisticalData_taskStatByOrg = data + this.isLoading2 = false + resolve(data) + }) + }) + + } + top1_1_leftNum = 188 //任务总数 buhegedata = { @@ -476,8 +502,12 @@ export class HomeComponent implements OnInit { this.rankingList2.push(obj) }); + + } + + echartsSetData_taskStatByOrg() { //任务完成情况两个echarts - let task = this.statisticalData['任务完成情况'] + let task = this.statisticalData_taskStatByOrg this.completionOfTaskPieOption.title[0].text = `{val|${task['总数']}}\n{name|任务总数}` this.completionOfTaskPieOption.series[0].data = [ { value: task['已完成'], name: '已完成' }, @@ -498,9 +528,27 @@ export class HomeComponent implements OnInit { this.completionOfTaskBarOption.series[0].data = taskBary1 this.completionOfTaskBarOption.series[1].data = taskBary2 this.completionOfTaskBar && this.completionOfTaskBar.setOption(this.completionOfTaskBarOption); + // this.completionOfTaskBar.on('click', (params) => { + // console.log(6666,params) + // }); + this.completionOfTaskBar.getZr().on('click', (params) => { + let pointInPixel = [params.offsetX, params.offsetY]; + if (this.completionOfTaskBar.containPixel('grid', pointInPixel)) { + let pointInGrid = this.completionOfTaskBar.convertFromPixel({ + seriesIndex: 0 + }, pointInPixel); + let xIndex = pointInGrid[0]; //索引 + let handleIndex = Number(xIndex); + let seriesObj = this.completionOfTaskBar.getOption(); //图表object对象 + var op = this.completionOfTaskBar.getOption(); + //获得图表中点击的列 + var month = op.xAxis[0].data[handleIndex]; //获取点击的列名 + console.log(month); + // console.log(handleIndex, seriesObj); + console.log(taskBar[handleIndex].organization.id) + }; + }); } - - map mapInit() { //创建地图 diff --git a/src/app/home/task/da-oneself-plan/checkagain/checkagain.component.ts b/src/app/home/task/da-oneself-plan/checkagain/checkagain.component.ts index 5065cc0..c6a50b2 100644 --- a/src/app/home/task/da-oneself-plan/checkagain/checkagain.component.ts +++ b/src/app/home/task/da-oneself-plan/checkagain/checkagain.component.ts @@ -13,7 +13,7 @@ export class CheckagainComponent implements OnInit { taskAlldataOfform = [] ngOnInit(): void { this.data.form.forEach(element => { - if (element.data.shangbao != '否' && element.name != '实战演练' && element.name != '数字化预案') { + if (JSON.stringify(element.data) != "{}" && element.data.shangbao != '否' && element.name != '实战演练' && element.name != '数字化预案') { this.taskAlldataOfform.push(element) } }); diff --git a/src/app/home/task/station-task-apply/station-task-apply.component.html b/src/app/home/task/station-task-apply/station-task-apply.component.html index 84e9685..9b75283 100644 --- a/src/app/home/task/station-task-apply/station-task-apply.component.html +++ b/src/app/home/task/station-task-apply/station-task-apply.component.html @@ -101,8 +101,8 @@
- - {{item.company.useNature}} + + {{item.company.companyLevel}} 级别 @@ -189,7 +189,10 @@
查看 - 删除 + 删除 + 撤销 操作 diff --git a/src/app/home/task/station-task-apply/station-task-apply.component.ts b/src/app/home/task/station-task-apply/station-task-apply.component.ts index bf822a2..82b57f3 100644 --- a/src/app/home/task/station-task-apply/station-task-apply.component.ts +++ b/src/app/home/task/station-task-apply/station-task-apply.component.ts @@ -118,7 +118,7 @@ export class StationTaskApplyComponent implements OnInit { ContainsChildren: "true", PageNumber: 1, PageSize: 9999, - code:'0000' + code: '0000' } var p = new Promise((resolve, reject) => { this.http.get('/api/Organizations', { @@ -408,6 +408,32 @@ export class StationTaskApplyComponent implements OnInit { }); } + + + //待检查撤销 + revocationTask(item, taskLIst) { + this.modal.confirm({ + nzTitle: `确定要撤销该任务吗?`, + nzOkText: '确定', + nzOkType: 'default', + nzOnOk: () => { + this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, { + params: { + approvalStatus: '待处理' + } + }).subscribe({ + next: (data) => { + this.message.create('success', '已撤销'); + item.approvalStatus = '待处理' + }, + error: (err) => { + this.message.create('warning', '撤销失败'); + } + }) + }, + nzCancelText: '取消' + }); + } } export enum ApprovalStatus { diff --git a/src/app/home/task/station-task-execution/station-task-execution.component.html b/src/app/home/task/station-task-execution/station-task-execution.component.html index 87cfa53..5399918 100644 --- a/src/app/home/task/station-task-execution/station-task-execution.component.html +++ b/src/app/home/task/station-task-execution/station-task-execution.component.html @@ -107,8 +107,8 @@
- - {{item.company.useNature}} + + {{item.company.companyLevel}} 单位级别 @@ -189,7 +189,10 @@ 查看 完成 - 驳回 + 驳回 + 删除 操作 diff --git a/src/app/home/task/station-task-execution/station-task-execution.component.ts b/src/app/home/task/station-task-execution/station-task-execution.component.ts index 9e35966..ba571f2 100644 --- a/src/app/home/task/station-task-execution/station-task-execution.component.ts +++ b/src/app/home/task/station-task-execution/station-task-execution.component.ts @@ -79,7 +79,31 @@ export class StationTaskExecutionComponent implements OnInit { }); } delete(item) { + console.log(item) + this.modal.confirm({ + nzTitle: `确定要删除该任务吗?`, + nzOkText: '确定', + nzOkType: 'primary', + nzOnOk: () => { + this.http.delete(`/api/PlanTasks/${item.id}`).subscribe(data => { + + for (let index = 0; index < this.taskLIst.length; index++) { + const element = this.taskLIst[index]; + if (element.id == item.id) { + this.taskLIst.splice(index, 1) + index-- + } + } + this.message.create('success', '删除成功!'); + + }) + }, + nzCancelText: '取消', + nzOnCancel: () => { + + } + }); } isloading = false 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 81082c3..8699fbc 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 @@ -97,25 +97,32 @@

- {{i.company.companyName}} + {{i.company.companyName}}({{i.creationType}}) 接受 拒绝 + 删除 ({{i.approvalStatus}})

{{i.company.organization.name}}

接受 拒绝 + 删除 ({{i.approvalStatus}})

@@ -183,7 +190,7 @@
- {{i.company.useNature}} + {{i.company.companyLevel}} 级别 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 93927e2..2dd3bd2 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 @@ -403,6 +403,37 @@ export class StationWeeklyPlanComponent implements OnInit { }); } + //删除任务 + delete(i, item) { + console.log(i) + console.log(item) + this.modal.confirm({ + nzTitle: `确定要删除该任务吗?`, + nzOkText: '确定', + nzOkType: 'primary', + nzOnOk: () => { + this.http.delete(`/api/PlanTasks/${i.id}`).subscribe(data => { + + for (let index = 0; index < item.data.length; index++) { + const element = item.data[index]; + if (element.id == i.id) { + item.data.splice(index, 1) + index-- + } + } + + this.message.create('success', '删除成功!'); + + }) + }, + nzCancelText: '取消', + nzOnCancel: () => { + + } + }); + } + + userName organizationName ngOnInit(): void { diff --git a/src/app/http-interceptors/base-interceptor.ts b/src/app/http-interceptors/base-interceptor.ts index 5343659..3d7104a 100644 --- a/src/app/http-interceptors/base-interceptor.ts +++ b/src/app/http-interceptors/base-interceptor.ts @@ -80,7 +80,7 @@ export class BaseInterceptor implements HttpInterceptor { console.error( `状态码${error.status}, ` + `错误内容:${error.error}`); - this.message.create('error', error.error.detail); + this.message.create('error', error.error.detail || error.error || error); } // 返回带有面向用户的错误信息 return throwError(() => {