+
-
- {{item2.tag}}
+
+ {{item.name}}
-
-
-
{{data.name}}
-
+
+
+
{{i.company.companyName}}
+
-
diff --git a/src/app/home/task/da-oneself-plan/plan-adjustment/plan-adjustment.component.scss b/src/app/home/task/da-oneself-plan/plan-adjustment/plan-adjustment.component.scss
index 53bf912..168eb3f 100644
--- a/src/app/home/task/da-oneself-plan/plan-adjustment/plan-adjustment.component.scss
+++ b/src/app/home/task/da-oneself-plan/plan-adjustment/plan-adjustment.component.scss
@@ -1,5 +1,7 @@
.box {
display: flex;
+ max-height: 800px;
+ overflow-y: auto;
}
.title{
span{
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 6d67bb6..431b430 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
@@ -1,4 +1,6 @@
+import { HttpClient } from '@angular/common/http';
import { Component, Input, OnInit } from '@angular/core';
+import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'app-plan-adjustment',
@@ -7,65 +9,189 @@ import { Component, Input, OnInit } from '@angular/core';
})
export class PlanAdjustmentComponent implements OnInit {
@Input() data?: any;
- constructor() { }
- list = [
- {
- tag: "行政许可",
- class: "#42B983",
- item: [
- {
- name: "想啥吃啥餐饮有限公司",
- checked: false
- },
- {
- name: "想啥吃啥餐饮有限公司",
- checked: false
- }
- ]
- },
- {
- tag: "双随机",
- class: "#1D9DFF",
- item: [
- {
- name: "想啥吃啥餐饮有限公司",
- checked: false
- }
- ]
- },
- ]
- list2 = [
+ @Input() time?: any;
+ @Input() level?: any;
+
+ constructor(private http: HttpClient, private message: NzMessageService) { }
- ]
- taskNumber = 0
- task = false
+ spin1 = false
+ spin2 = false
+ userId
ngOnInit(): void {
- console.log(this.data)
+ this.userId = JSON.parse(sessionStorage.getItem('userData')).id
+ this.getTaskListOfStation(this.data, '未接任务')
}
- aaa(data) {
- if (data.checked && !this.task) {
- this.list2.push({ meu: this.list2.length, data })
- console.log(this.list2);
- this.taskNumber = this.list2.length
- if (this.taskNumber == 8) {
- this.task = true
- }
- } else {
- this.bbb(data)
+ push(i, item, e) {
+ let body = {
+ approvalStatus: e ? '通过' : '待处理'
}
+ this.http.patch(`/api/PlanTasks/${i.id}`, body).subscribe({
+ next: (data) => {
+ this.message.create('success', '处理成功');
+ if (e) {
+ i.approvalStatus = '通过'
+ let isTrue = this.data.data.find((item) => {
+ return item.name == i.taskType
+ })
+ if (isTrue) {
+ this.data.data.forEach(item => {
+ if (item.name == i.taskType) {
+ item.data.push(i)
+ }
+ });
+ } else {
+ this.data.data.push({
+ name: item.name,
+ background: item.background,
+ data: [i]
+ })
+ }
+ } else {
+ this.data.data.forEach((item, key) => {
+ if (item.name == i.taskType) {
+ 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--
+ }
+ }
+ }
+ });
+ }
+ },
+ error: (err) => {
+ this.message.create('warning', '处理失败');
+
+ }
+ })
}
- bbb(e) {
- console.log(e);
- e.checked = false
- for (let index = 0; index < this.list2.length; index++) {
- if (e == this.list2[index].data) {
- this.list2.splice(this.list2[index].meu, 1)
- this.taskNumber = this.list2.length
- if (this.taskNumber != 8) {
- this.task = false
+ cancel(i, item) {
+ // console.log(i)
+ // console.log(item)
+ // console.log(this.allTasks)
+ let body = {
+ approvalStatus: '待处理'
+ }
+ this.http.patch(`/api/PlanTasks/${i.id}`, body).subscribe({
+ next: (data) => {
+ this.message.create('success', '处理成功');
+ this.allTasks.forEach(element => {
+ if (element.name == item.name) {
+ element.data.forEach(item => {
+ if (item.id == i.id) {
+ item.checked = false
+ item.approvalStatus = '待处理'
+ }
+ });
+ }
+ });
+
+ 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--
+ }
}
+ },
+ error: (err) => {
+ this.message.create('warning', '处理失败');
}
+ })
+
+ }
+
+ //获得消防站下的所有任务
+ PageNumber = 1
+ PageSize = 9999
+ allTasks
+ async getTaskListOfStation(item, type) {
+ let statuses = []
+ if (type == '未接任务') {
+ statuses = ['待处理', '通过', '驳回', '待检查', '已检查']
+ this.spin1 = true
+ }
+ if (type == '已接任务') {
+ statuses = ['通过', '待检查']
+ this.spin2 = true
+ }
+ let params
+ if (this.level == '大队') {
+ params = {
+ Month: this.time,
+ CompanyOrganizationId: item.id,
+ PageNumber: this.PageNumber,
+ approvalStatuses: statuses,
+ PageSize: this.PageSize
+ }
+ } else {
+ params = {
+ Month: this.time,
+ SupervisorId: this.userId,
+ PageNumber: this.PageNumber,
+ approvalStatuses: statuses,
+ PageSize: this.PageSize
+ }
}
+ return new Promise
((resolve, reject) => {
+ this.http.get('/api/PlanTasks', {
+ params: params
+ }).subscribe({
+ next: (data: any) => {
+ let checkedList = []
+ this.data.data.forEach(element => {
+ element.data.forEach(item => {
+ checkedList.push(item)
+ });
+ });
+ data.items.forEach(element => {
+ element.checked = false
+ checkedList.forEach(item => {
+ if (item.id == element.id) {
+ element.checked = true
+ }
+ });
+ });
+
+ let listData = [
+ { name: '双随机', background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '行政许可', background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '熟悉演练', background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '联络指导', background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '消防宣传', background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '投诉举报', background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '火灾调查', background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [], inspected: 0, finished: 0 }
+ ]
+ 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--
+ }
+ }
+ this.allTasks = listData
+ if (type == '未接任务') {
+ this.spin1 = false
+ }
+ if (type == '已接任务') {
+ this.spin2 = false
+ }
+ resolve(data)
+ },
+ error: (err) => {
+ reject(err)
+ }
+ })
+ })
+
}
+
+
}
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 339edf8..bb6846f 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
@@ -135,7 +135,7 @@