From 2e98f75e5ae67c68e81484520e80ef5c50596a0e Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Mon, 22 Aug 2022 14:21:50 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E6=8E=A5=E5=8F=97=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- angular.json | 4 +- .../station-task-apply.component.scss | 2 +- .../station-task-apply.component.ts | 2 - .../station-weekly-plan.component.html | 184 ++++++-------- .../station-weekly-plan.component.scss | 46 +++- .../station-weekly-plan.component.ts | 233 +++++++++++++++--- 6 files changed, 320 insertions(+), 151 deletions(-) diff --git a/angular.json b/angular.json index 2ede4bb..cc8df58 100644 --- a/angular.json +++ b/angular.json @@ -51,8 +51,8 @@ }, { "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" + "maximumWarning": "20kb", + "maximumError": "20kb" } ], "fileReplacements": [{ diff --git a/src/app/home/task/station-task-apply/station-task-apply.component.scss b/src/app/home/task/station-task-apply/station-task-apply.component.scss index 0a5ecdc..03693df 100644 --- a/src/app/home/task/station-task-apply/station-task-apply.component.scss +++ b/src/app/home/task/station-task-apply/station-task-apply.component.scss @@ -204,7 +204,7 @@ } .flexcolassistant { - flex: 2; + flex: 1.5; overflow: hidden; .assistant { 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 995d4f3..04520f6 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 @@ -48,12 +48,10 @@ export class StationTaskApplyComponent implements OnInit { selectedTime selectMonth(item) { this.selectedMonth = item.id - this.getTaskList() } selectYear(e) { this.selectedYear = e - console.log('年', e) this.getTaskList() } 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 86ff1f1..d419a0f 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 @@ -1,12 +1,12 @@ - -
+ +
- - - + + +
+ [ngClass]="{'selectedMonth': item.id == selectedMonth}"> {{item.name}}
@@ -24,6 +24,9 @@
+
+ +
@@ -37,7 +40,7 @@ style="vertical-align: text-top;cursor: pointer;" nz-icon nzType="right-circle" nzTheme="outline">

-

5/9

+

{{item.scale}}

@@ -54,18 +57,22 @@ nzTheme="outline">返回

-
+

- 济南历下森豪室内娱乐场 - - 接受 - 拒绝 + {{i.company.companyName}} + + 接受 + 拒绝 + 已通过 + 已驳回

-

A消防救援站

-

- 接受 - 拒绝 +

{{i.organization.name}}

+

+ 接受 + 拒绝 + 已通过 + 已驳回

@@ -76,48 +83,52 @@
-
+
+
+
+ +
- + - {{item.name}} + {{element.name}} 单位总数: 7/8 -
+
完成进度
- - - {{item.isExpand ? '收起' :'展开'}} - + + + {{element.isExpand ? '收起' :'展开'}} +
-
-
+
+
-
- - 重大活动 +
+ + {{item.name}}
已分配 - 1 + 0
已完成 - 1 + 0
-
+
- 尬粒酒店管理有限公司济南泺文路分公司 + {{i.company.companyName}} 单位名称 @@ -125,7 +136,7 @@
- 重点单位 + {{i.company.useNature}} 级别 @@ -133,102 +144,55 @@
- 历下区A消防救援站 + {{i.organization.name}} - 责任机构 + 主负责人
-
- - 历下区B消防救援站 - - - 协助机构 +
+ + + + + {{o.name}} + + + + + + + {{o.name}} + + + + 协助人员
- + 同步工作
-
- - - - - - 进度 - -
-
- - -
-
-
-
- - 尬粒酒店管理有限公司济南泺文路分公司 - - - 单位名称 - -
- 重点单位 + - 级别 + 检查时间
-
- - 历下区A消防救援站 - - - 责任机构 - -
-
- - 历下区B消防救援站 - - - 协助机构 - -
-
- - - - - 同步工作 - -
-
- - - - - - 进度 - -
-
- - -
+
-
diff --git a/src/app/home/task/station-weekly-plan/station-weekly-plan.component.scss b/src/app/home/task/station-weekly-plan/station-weekly-plan.component.scss index 5d7f503..dadb6e9 100644 --- a/src/app/home/task/station-weekly-plan/station-weekly-plan.component.scss +++ b/src/app/home/task/station-weekly-plan/station-weekly-plan.component.scss @@ -65,7 +65,7 @@ opacity: 1; border: 1px solid #E4E7EC; display: flex; - + position: relative; .itemone { width: 100%; @@ -193,6 +193,7 @@ height: 260px; margin-bottom: 18px; margin-right: 8px; + .itemone { .instrumentpanelitemleft { padding: 26px 0 26px 10%; @@ -205,6 +206,7 @@ height: 200px; margin-bottom: 0px; margin-right: 1%; + .itemone { .instrumentpanelitemleft { padding: 15px 0 15px 10%; @@ -228,7 +230,7 @@ border: 1px solid #E4E7EC; color: #303133; box-sizing: border-box; - padding: 0 18px; + position: relative; .header { width: 100%; @@ -265,6 +267,7 @@ border-radius: 4px 4px 4px 4px; border: 1px solid #42B983; display: flex; + margin: 10px 20px; } .maincontentitemleft { @@ -331,6 +334,9 @@ border-bottom: 1px dashed #C7CAD0; + div { + flex: 1; + } .flexcol { display: flex; @@ -340,7 +346,7 @@ span:nth-child(1) { color: #303133; - margin-bottom: 8px; + // margin-bottom: 8px; } span:nth-child(2) { @@ -348,8 +354,34 @@ } } + .flexcolassistant { + flex: 2; + overflow: hidden; + + .assistant { + + display: flex; + width: 100%; + + span { + color: #303133; + margin-right: 6px; + } + + img { + width: 16px; + height: 16px; + vertical-align: text-bottom; + } + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } + .namebox { - width: 28%; + flex: 2; } .progressbox { @@ -381,3 +413,9 @@ width: 100%; border-top: 1px dashed #C7CAD0; } + +.marginr5 { + span { + margin-right: 5px; + } +} 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 7d4356c..23e200c 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 @@ -12,27 +12,35 @@ import { TreeService } from 'src/app/service/tree.service'; }) export class StationWeeklyPlanComponent implements OnInit { - constructor() { } + constructor(private http: HttpClient, private modal: NzModalService, private message: NzMessageService) { } + OrganizationId + userId + isSupervisor - ngOnInit(): void { - } months = [ - { name: '1月', isable: true }, - { name: '2月', isable: true }, - { name: '3月', isable: true }, - { name: '4月', isable: true }, - { name: '5月', isable: true }, - { name: '6月', isable: true }, - { name: '7月', isable: true }, - { name: '8月', isable: true }, - { name: '9月', isable: true }, - { name: '10月', isable: true }, - { name: '11月', isable: true }, - { name: '12月', isable: true } + { id: 1, name: '1月', isable: true }, + { id: 2, name: '2月', isable: true }, + { id: 3, name: '3月', isable: true }, + { id: 4, name: '4月', isable: true }, + { id: 5, name: '5月', isable: true }, + { id: 6, name: '6月', isable: true }, + { id: 7, name: '7月', isable: true }, + { id: 8, name: '8月', isable: true }, + { id: 9, name: '9月', isable: true }, + { id: 10, name: '10月', isable: true }, + { id: 11, name: '11月', isable: true }, + { id: 12, name: '12月', isable: true } ] selectedMonth + selectedYear = 2022 + selectedTime selectMonth(item) { - this.selectedMonth = item.name + this.selectedMonth = item.id + // this.getTaskList() + } + selectYear(e) { + this.selectedYear = e + // this.getTaskList() } isExpand = true @@ -43,33 +51,194 @@ export class StationWeeklyPlanComponent implements OnInit { formatOne = (percent: number): string => `${percent}%\n完成率`; - cardData = [ - { name: '双随机', isDetails: false, background: '#1D9DFF', icon: 'suiji.png' }, - { name: '行政许可', isDetails: false, background: '#42B983', icon: 'xuke.png' }, - { name: '熟悉演练', isDetails: false, background: '#9D80FF', icon: 'yanlian.png' }, - { name: '联络指导', isDetails: false, background: '#5483EA', icon: 'zhidao.png' }, - { name: '消防宣传', isDetails: false, background: '#FF5D2A', icon: 'xuanchuan.png' }, - { name: '投诉举报', isDetails: false, background: '#5087FF', icon: 'tousu.png' }, - { name: '火灾调查', isDetails: false, background: '#FF404D', icon: 'huozai.png' } - ] + openDetails(data, type) { data.isDetails = type } - xxx = false - radioChange(e) { + radioChange(e) { setTimeout(() => { - this.xxx = !this.xxx }, 0); + } + stationData = [] + //获得辖区下所有救援站 + totalCount: string + allOrList: any + getAllStation() { + let params = { + ContainsChildren: true, + pageSize: 9999 + } + this.http.get('/api/Organizations', { + params: params + }).subscribe((data: any) => { + this.totalCount = data.totalCount + data.items = data.items.filter(element => { + return element.level == 'squadron' + }); + data.items.forEach(element => { + element.isExpand = false + element.isLoading = false + }); + this.stationData = data.items + }) } - stationData = [ - { name: '历下区A消防救援站', isExpand: true }, - { name: '历下区B消防救援站', isExpand: false }, - { name: '历下区C消防救援站', isExpand: false } + + cardData = [ + { name: '双随机', isDetails: true, isloading: false, background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [] }, + { name: '行政许可', isDetails: false, isloading: false, background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [] }, + { name: '熟悉演练', isDetails: false, isloading: false, background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [] }, + { name: '联络指导', isDetails: false, isloading: false, background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [] }, + { name: '消防宣传', isDetails: false, isloading: false, background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [] }, + { name: '投诉举报', isDetails: false, isloading: false, background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [] }, + { name: '火灾调查', isDetails: false, isloading: false, background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [] } ] + + + isloading = false + PageNumber = 1 + PageSize = 9999 + getTaskList() { + this.isloading = true + let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' + let params = { + Month: selectedTime, + // OrganizationId: this.isSupervisor ? this.OrganizationId : "", + SupervisorId: this.userId, + PageNumber: this.PageNumber, + PageSize: this.PageSize + } + this.http.get('/api/PlanTasks', { + params: params + }).subscribe((data: any) => { + this.isloading = false + // console.log('任务申请列表', data.items); + data.items.forEach(element => { + this.cardData.forEach((item, key) => { + element.taskType == item.name ? this.cardData[key].data.push(element) : null + }); + }); + // console.log('并入卡片数据', this.cardData) + }) + } + + //接受任务 + accept(i, item) { + this.modal.confirm({ + nzTitle: `确定要接受该任务吗?`, + nzOkText: '确定', + nzOkType: 'default', + nzOnOk: () => { + item.isloading = true + this.http.post(`/api/PlanTasks/Approval/${i.id}`, null, { + params: { + approvalStatus: '通过' + } + }).subscribe({ + next: (data) => { + this.message.create('success', '已接受'); + i.approvalStatus = '通过' + item.isloading = false + }, + error: (err) => { + this.message.create('warning', '接受失败'); + item.isloading = false + } + }) + }, + nzCancelText: '取消' + }); + } + //拒绝任务 + reject(i, item) { + this.modal.confirm({ + nzTitle: `确定要拒绝该任务吗?`, + nzOkText: '确定', + nzOkType: 'default', + nzOnOk: () => { + item.isloading = true + this.http.post(`/api/PlanTasks/Approval/${i.id}`, null, { + params: { + approvalStatus: '驳回' + } + }).subscribe({ + next: (data) => { + this.message.create('success', '已拒绝'); + i.approvalStatus = '驳回' + item.isloading = false + }, + error: (err) => { + this.message.create('warning', '拒绝失败'); + item.isloading = false + } + }) + }, + nzCancelText: '取消' + }); + } + ngOnInit(): void { + this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId + this.userId = JSON.parse(sessionStorage.getItem('userData')).id + 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.selectedMonth = new Date().getMonth() + 1 + + + this.getAllStation() + this.getTaskList() + } expandcarditem(item) { item.isExpand = !item.isExpand + console.log(item) + if (item.isExpand) { + let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' + let params = { + Month: selectedTime, + CompanyOrganizationId: item.id, + PageNumber: this.PageNumber, + approvalStatuses: '通过', + PageSize: this.PageSize + } + item.isLoading = true + this.http.get('/api/PlanTasks', { + params: params + }).subscribe({ + next: (data: any) => { + item.isLoading = false + let listData = [ + { name: '双随机', background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [] }, + { name: '行政许可', background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [] }, + { name: '熟悉演练', background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [] }, + { name: '联络指导', background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [] }, + { name: '消防宣传', background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [] }, + { name: '投诉举报', background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [] }, + { name: '火灾调查', background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [] } + ] + data.items.forEach(element => { + listData.forEach((item, key) => { + element.taskType == item.name ? listData[key].data.push(element) : null + }); + }); + for (let index = 0; index < listData.length; index++) { + const element = listData[index]; + if (element.data.length == 0) { + listData.splice(index, 1) + index-- + } + } + item.data = listData + console.log('点击的救援站通过数据', item) + }, + error: (err) => { + this.message.create('warning', '获取数据失败'); + item.isLoading = false + } + }) + } } }