Browse Source

[完善]完善救援站页面

非煤矿山灾害智能感知和预警系统
邵佳豪 3 years ago
parent
commit
670fb177f6
  1. 10
      src/app/home/home.module.ts
  2. 19
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
  3. 142
      src/app/home/task/da-oneself-plan/da-oneself-plan.component.html
  4. 46
      src/app/home/task/da-oneself-plan/da-oneself-plan.component.scss
  5. 135
      src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts
  6. 4
      src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html
  7. 6
      src/app/home/task/station-task-execution/station-task-execution.component.html
  8. 18
      src/app/home/task/station-task-execution/station-task-execution.component.ts
  9. 24
      src/app/home/task/station-weekly-plan/create-task/create-task.component.html
  10. 0
      src/app/home/task/station-weekly-plan/create-task/create-task.component.scss
  11. 83
      src/app/home/task/station-weekly-plan/create-task/create-task.component.ts
  12. 23
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.html
  13. 191
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts
  14. 130
      src/app/home/task/zhi-indicators/zhi-indicators.component.html
  15. 45
      src/app/home/task/zhi-indicators/zhi-indicators.component.scss
  16. 236
      src/app/home/task/zhi-indicators/zhi-indicators.component.ts

10
src/app/home/home.module.ts

@ -62,6 +62,8 @@ import { PlanAdjustmentComponent } from './task/da-oneself-plan/plan-adjustment/
import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
import { TaskDetailsComponent } from './task/station-weekly-plan/task-details/task-details.component'; import { TaskDetailsComponent } from './task/station-weekly-plan/task-details/task-details.component';
import { EditOrComponent } from './task/zhi-indicators/edit-or/edit-or.component'; import { EditOrComponent } from './task/zhi-indicators/edit-or/edit-or.component';
import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
import { CreateTaskComponent } from './task/station-weekly-plan/create-task/create-task.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
NavComponent, NavComponent,
@ -97,7 +99,8 @@ import { EditOrComponent } from './task/zhi-indicators/edit-or/edit-or.component
ChangePasswordComponent, ChangePasswordComponent,
PlanAdjustmentComponent, PlanAdjustmentComponent,
TaskDetailsComponent, TaskDetailsComponent,
EditOrComponent EditOrComponent,
CreateTaskComponent
], ],
imports: [ imports: [
CommonModule, CommonModule,
@ -129,8 +132,9 @@ import { EditOrComponent } from './task/zhi-indicators/edit-or/edit-or.component
NzSpinModule, NzSpinModule,
NzCardModule, NzCardModule,
NzUploadModule, NzUploadModule,
NzToolTipModule NzToolTipModule,
NzInputNumberModule
], ],
entryComponents: [AddroleComponent, EditroleComponent, AdduserComponent, EdituserComponent, AddorComponent, EditorComponent, ApplyComponent, ApplyLookComponent, LookTaskComponent, AllotPersonComponent, EditOrComponent] entryComponents: [AddroleComponent, EditroleComponent, AdduserComponent, EdituserComponent, AddorComponent, EditorComponent, ApplyComponent, ApplyLookComponent, LookTaskComponent, AllotPersonComponent, EditOrComponent, CreateTaskComponent]
}) })
export class HomeModule { } export class HomeModule { }

19
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts

@ -39,24 +39,19 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
{ id: 12, name: '12月', isable: true } { id: 12, name: '12月', isable: true }
] ]
//下级任务申请打开关闭
istaskauditExpanded = true istaskauditExpanded = true
istaskauditexpand() { istaskauditexpand() {
this.istaskauditExpanded = !this.istaskauditExpanded this.istaskauditExpanded = !this.istaskauditExpanded
} }
//本级部署打开关闭
isdeployboxExpanded = true isdeployboxExpanded = true
isdeployboxexpand() { isdeployboxexpand() {
this.isdeployboxExpanded = !this.isdeployboxExpanded this.isdeployboxExpanded = !this.isdeployboxExpanded
} }
shuxiTaskData = {
isExpand: true
}
zhidaoTaskData = {
isExpand: true
}
PageNumber = 1 PageNumber = 1
PageSize = 9999 PageSize = 9999
@ -204,14 +199,6 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
openDetails(data, type) { openDetails(data, type) {
data.isDetails = type data.isDetails = type
} }
xxx = false
radioChange(e) {
setTimeout(() => {
this.xxx = !this.xxx
}, 0);
}

142
src/app/home/task/da-oneself-plan/da-oneself-plan.component.html

@ -1,12 +1,12 @@
<!-- <p>本级计划</p> --> <!-- <p>本级计划</p> -->
<div class="box"> <div class="box">
<div class="timebox"> <div class="timebox">
<nz-select ngModel="2022"> <nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option nzValue="2021" nzLabel="2021年"></nz-option> <nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option nzValue="2022" nzLabel="2022年"></nz-option> <nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
</nz-select> </nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)" <div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.name == selectedMonth}"> [ngClass]="{'selectedMonth': item.id == selectedMonth}">
{{item.name}} {{item.name}}
</div> </div>
</div> </div>
@ -72,48 +72,51 @@
<!-- 救援站列表 --> <!-- 救援站列表 -->
<div class="stationcardlistbox"> <div class="stationcardlistbox">
<div class="stationcardlistitembox" *ngFor="let item of stationData"> <div class="stationcardlistitembox" *ngFor="let element of stationData">
<div class="stationcardlistitem"> <div class="stationcardlistitem">
<div class="spin" *ngIf="element.isLoading">
<nz-spin nzSimple></nz-spin>
</div>
<div class="header"> <div class="header">
<span style="width: 16%;"> <span style="width: 16%;">
<img src="../../../../assets//images/icon/station.png" alt=""> <img src="../../../../assets//images/icon/station.png" alt="">
{{item.name}} {{element.name}}
</span> </span>
<span style="width: 8%;">单位总数: 7/8</span> <span style="width: 8%;">单位总数: 7/8</span>
<div style="width: 66%;" class="progress progresssquare"> <div style="width: 66%;" class="progress progresssquare">
<span>完成进度</span> <span>完成进度</span>
<nz-progress nzStrokeLinecap="square" nzStrokeWidth="16" <nz-progress nzStrokeLinecap="square" nzStrokeWidth="16" nzStrokeColor="#42B983"
nzStrokeColor="#42B983" [nzPercent]="30"></nz-progress> [nzPercent]="30"></nz-progress>
</div> </div>
<button nz-button nzType="primary" (click)="adjustment()">任务调整</button> <!-- <button nz-button nzType="primary">任务下派</button> -->
<span (click)="expandcarditem(item)" class="expand blue"> <span (click)="expandcarditem(element)" class="expand blue">
{{item.isExpand ? '收起' :'展开'}} {{element.isExpand ? '收起' :'展开'}}
<i nz-icon [nzType]="item.isExpand ? 'down' : 'up'" nzTheme="outline"></i> <i nz-icon [nzType]="element.isExpand ? 'down' : 'up'" nzTheme="outline"></i>
</span> </span>
</div> </div>
<div class="maincontent" *ngIf="item.isExpand"> <div class="maincontent" *ngIf="element.isExpand">
<div class="maincontentitem"> <div class="maincontentitem" *ngFor="let item of element.data">
<div class="maincontentitemleft"> <div class="maincontentitemleft">
<div class="panelheadername panelheadernameor"> <div class="panelheadername" [style]="'background:'+ item.background">
<img src="'../../../../assets/images/icon/huodong.png" alt=""> <img [src]="'../../../../assets/images/icon/'+ item.icon" alt="">
重大活动 {{item.name}}
</div> </div>
<div class="num"> <div class="num">
<div class="round" style="background: #2C4DC0;"></div> <div class="round" style="background: #2C4DC0;"></div>
<span class="word">已分配</span> <span class="word">已分配</span>
<span class="boldspan">1</span> <span class="boldspan">0</span>
</div> </div>
<div class="num"> <div class="num">
<div class="round" style="background: #42B983;"></div> <div class="round" style="background: #42B983;"></div>
<span class="word">已完成</span> <span class="word">已完成</span>
<span class="boldspan">1</span> <span class="boldspan">0</span>
</div> </div>
</div> </div>
<div class="maincontentitemright"> <div class="maincontentitemright">
<div class="maincontentitemrightitem"> <div class="maincontentitemrightitem" *ngFor="let i of item.data">
<div class="flexcol namebox"> <div class="flexcol namebox">
<span> <span>
尬粒酒店管理有限公司济南泺文路分公司 {{i.company.companyName}}
</span> </span>
<span> <span>
单位名称 单位名称
@ -121,7 +124,7 @@
</div> </div>
<div class="flexcol"> <div class="flexcol">
<span> <span>
重点单位 {{i.company.useNature}}
</span> </span>
<span> <span>
级别 级别
@ -129,100 +132,52 @@
</div> </div>
<div class="flexcol"> <div class="flexcol">
<span> <span>
历下区A消防救援站 {{i.organization.name}}
</span> </span>
<span> <span>
责任机构 责任机构
</span> </span>
</div> </div>
<div class="flexcol"> <div class="flexcol flexcolassistant">
<span> <span class="assistant" nz-tooltip [nzTooltipTitle]="titleTemplate">
历下区B消防救援站 <span *ngFor="let o of i.supervisors">
</span> <img *ngIf="o.posts && o.posts[0] == '主查人员'"
<span> src="../../../../assets/images/icon/main.png" alt="">
协助机构 <img *ngIf="o.posts && o.posts[0] == '协查人员'"
</span> src="../../../../assets/images/icon/assist.png" alt="">
</div> {{o.name}}
<div class="flexcol">
<span>
<label nz-radio ngModel [ngModel]="xxx"
(click)="radioChange($event)">宣传</label>
</span> </span>
<span>
同步工作
</span> </span>
</div> <ng-template #titleTemplate let-thing>
<div class="flexcol progressbox progresssquare"> <span style="margin-right: 6px;" *ngFor="let o of i.supervisors">
<span> <img *ngIf="o.posts && o.posts[0] == '主查人员'"
<nz-progress style="width: 200px;" nzStrokeLinecap="square" src="../../../../assets/images/icon/main.png" alt="">
nzStrokeWidth="16" nzStrokeColor="#42B983" [nzPercent]="30"> <img *ngIf="o.posts && o.posts[0] == '协查人员'"
</nz-progress> src="../../../../assets/images/icon/assist.png" alt="">
{{o.name}}
</span> </span>
</ng-template>
<span> <span>
进度 协助人员
</span>
</div>
<div class="btnbox">
<button nz-button nzType="primary">提交审核</button>
<button style="margin-left: 12px;" nz-button nzType="primary">取消</button>
</div>
</div>
<div class="maincontentitemrightitem">
<div class="flexcol namebox">
<span>
尬粒酒店管理有限公司济南泺文路分公司
</span>
<span>
单位名称
</span> </span>
</div> </div>
<div class="flexcol"> <div class="flexcol">
<span> <span>
重点单位 宣传
</span>
<span>
级别
</span>
</div>
<div class="flexcol">
<span>
历下区A消防救援站
</span>
<span>
责任机构
</span>
</div>
<div class="flexcol">
<span>
历下区B消防救援站
</span>
<span>
协助机构
</span>
</div>
<div class="flexcol">
<span>
<label nz-radio ngModel [ngModel]="xxx"
(click)="radioChange($event)">宣传</label>
</span> </span>
<span> <span>
同步工作 同步工作
</span> </span>
</div> </div>
<div class="flexcol progressbox progresssquare">
<div class="flexcol">
<span> <span>
<nz-progress style="width: 200px;" nzStrokeLinecap="square" 未发现违法违规情况
nzStrokeWidth="16" nzStrokeColor="#42B983" [nzPercent]="30">
</nz-progress>
</span> </span>
<span> <span>
进度 检查结果
</span> </span>
</div> </div>
<div class="btnbox">
<button nz-button nzType="primary">提交审核</button>
<button style="margin-left: 12px;" nz-button nzType="primary">取消</button>
</div>
</div> </div>
</div> </div>
@ -231,7 +186,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- -->
<div class="cutoffrule"></div> <div class="cutoffrule"></div>
</div> </div>

46
src/app/home/task/da-oneself-plan/da-oneself-plan.component.scss

@ -45,18 +45,21 @@
box-sizing: border-box; box-sizing: border-box;
padding: 18px; padding: 18px;
color: #303133; color: #303133;
padding-bottom: 0;
padding-right: 0;
.instrumentpanelheader { .instrumentpanelheader {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 15px; margin-bottom: 15px;
box-sizing: border-box;
padding-right: 22px;
} }
.instrumentpanel { .instrumentpanel {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between;
} }
.instrumentpanelitem { .instrumentpanelitem {
@ -66,7 +69,7 @@
opacity: 1; opacity: 1;
border: 1px solid #E4E7EC; border: 1px solid #E4E7EC;
display: flex; display: flex;
position: relative;
.itemone { .itemone {
width: 100%; width: 100%;
@ -193,6 +196,7 @@
width: 24.3%; width: 24.3%;
height: 260px; height: 260px;
margin-bottom: 18px; margin-bottom: 18px;
margin-right: 8px;
.itemone { .itemone {
.instrumentpanelitemleft { .instrumentpanelitemleft {
@ -204,7 +208,8 @@
.instrumentpanelitemclose { .instrumentpanelitemclose {
width: 11.7%; width: 11.7%;
height: 200px; height: 200px;
margin-bottom: 0px; margin-bottom: 18px;
margin-right: 1%;
.itemone { .itemone {
.instrumentpanelitemleft { .instrumentpanelitemleft {
@ -230,6 +235,7 @@
color: #303133; color: #303133;
box-sizing: border-box; box-sizing: border-box;
padding: 0 18px; padding: 0 18px;
position: relative;
.header { .header {
width: 100%; width: 100%;
@ -331,7 +337,13 @@
padding: 12px 0px; padding: 12px 0px;
border-bottom: 1px dashed #C7CAD0; border-bottom: 1px dashed #C7CAD0;
div {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.flexcol { .flexcol {
display: flex; display: flex;
@ -350,21 +362,33 @@
} }
.namebox { .namebox {
width: 28%; flex: 2;
} }
.progressbox { .flexcolassistant {
width: 220px; flex: 2;
overflow: hidden;
span:nth-child(1) { .assistant {
width: 100%; width: 100%;
span {
color: #303133;
margin-right: 6px;
} }
img {
width: 16px;
height: 16px;
vertical-align: text-bottom;
} }
.btnbox { display: inline-block;
display: flex; text-align: left;
justify-content: flex-end; white-space: nowrap;
align-self: flex-start; overflow: hidden;
text-overflow: ellipsis;
}
} }
} }

135
src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts

@ -3,6 +3,7 @@ import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { PlanAdjustmentComponent } from './plan-adjustment/plan-adjustment.component' import { PlanAdjustmentComponent } from './plan-adjustment/plan-adjustment.component'
import { HttpClient } from '@angular/common/http';
@Component({ @Component({
selector: 'app-da-oneself-plan', selector: 'app-da-oneself-plan',
templateUrl: './da-oneself-plan.component.html', templateUrl: './da-oneself-plan.component.html',
@ -10,28 +11,40 @@ import {PlanAdjustmentComponent} from './plan-adjustment/plan-adjustment.compone
}) })
export class DaOneselfPlanComponent implements OnInit { export class DaOneselfPlanComponent implements OnInit {
constructor(private modal: NzModalService,private message: NzMessageService,private viewContainerRef: ViewContainerRef) { } constructor(private http: HttpClient, private modal: NzModalService, private message: NzMessageService, private viewContainerRef: ViewContainerRef) { }
validateForm!: FormGroup; validateForm!: FormGroup;
OrganizationId
ngOnInit(): void { ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.selectedMonth = new Date().getMonth() + 1
this.getAllStation()
} }
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 }
]
selectedMonth selectedMonth
selectedYear = 2022
selectedTime
selectMonth(item) { selectMonth(item) {
this.selectedMonth = item.name this.selectedMonth = item.id
// this.getTaskList()
}
selectYear(e) {
this.selectedYear = e
console.log('年', e)
// this.getTaskList()
} }
months = [
{ 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 }
]
isExpand = false isExpand = false
expand() { expand() {
@ -42,7 +55,6 @@ export class DaOneselfPlanComponent implements OnInit {
cardData = [ cardData = [
{ name: '重大活动', isDetails: false, background: '#FF9203', icon: 'huodong.png' },
{ name: '双随机', isDetails: false, background: '#1D9DFF', icon: 'suiji.png' }, { name: '双随机', isDetails: false, background: '#1D9DFF', icon: 'suiji.png' },
{ name: '行政许可', isDetails: false, background: '#42B983', icon: 'xuke.png' }, { name: '行政许可', isDetails: false, background: '#42B983', icon: 'xuke.png' },
{ name: '熟悉演练', isDetails: false, background: '#9D80FF', icon: 'yanlian.png' }, { name: '熟悉演练', isDetails: false, background: '#9D80FF', icon: 'yanlian.png' },
@ -63,14 +75,8 @@ export class DaOneselfPlanComponent implements OnInit {
}, 0); }, 0);
} }
stationData = [
{ name: '历下区A消防救援站', isExpand: true },
{ name: '历下区B消防救援站', isExpand: false },
{ name: '历下区C消防救援站', isExpand: false }
]
expandcarditem(item) {
item.isExpand = !item.isExpand
}
nodes: any = [] nodes: any = []
BuildingTypes BuildingTypes
adjustment() { adjustment() {
@ -89,4 +95,83 @@ export class DaOneselfPlanComponent implements OnInit {
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
} }
//获得辖区下所有救援站
stationData = []
getAllStation() {
let params = {
ContainsChildren: true,
pageSize: 9999
}
this.http.get('/api/Organizations', {
params: params
}).subscribe((data: any) => {
data.items = data.items.filter(element => {
return element.level == 'squadron'
});
data.items.forEach(element => {
element.isExpand = false
element.isLoading = false
});
this.stationData = data.items
})
}
expandcarditem(item) {
item.isExpand = !item.isExpand
console.log(item)
if (item.isExpand) {
this.getTaskListOfStation(item)
}
}
//获得消防站下的所有任务
PageNumber = 1
PageSize = 9999
getTaskListOfStation(item) {
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
}
})
}
} }

4
src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html

@ -3,7 +3,7 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="检查员(主)">检查员(主)</nz-form-label> <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="检查员(主)">检查员(主)</nz-form-label>
<nz-form-control> <nz-form-control>
<nz-select formControlName="main" nzPlaceHolder="请选择消防监督检查员(主)"> <nz-select nzMode="multiple" formControlName="main" nzPlaceHolder="请选择消防监督检查员(主)">
<nz-option *ngFor="let item of mainsupervisorList" [nzValue]="item.id" [nzLabel]="item.name"> <nz-option *ngFor="let item of mainsupervisorList" [nzValue]="item.id" [nzLabel]="item.name">
</nz-option> </nz-option>
</nz-select> </nz-select>
@ -12,7 +12,7 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="检查员(协)">检查员(协)</nz-form-label> <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="检查员(协)">检查员(协)</nz-form-label>
<nz-form-control> <nz-form-control>
<nz-select formControlName="assitant" nzPlaceHolder="请选择消防监督检查员(协)"> <nz-select nzMode="multiple" formControlName="assitant" nzPlaceHolder="请选择消防监督检查员(协)">
<nz-option *ngFor="let item of assitantsupervisorList" [nzValue]="item.id" [nzLabel]="item.name"> <nz-option *ngFor="let item of assitantsupervisorList" [nzValue]="item.id" [nzLabel]="item.name">
</nz-option> </nz-option>
</nz-select> </nz-select>

6
src/app/home/task/station-task-execution/station-task-execution.component.html

@ -39,7 +39,7 @@
</div> </div>
<div class="header"> <div class="header">
<span> <span>
任务申请 任务执行
</span> </span>
<span style="font-size: 14px; color: #42B983;"> <span style="font-size: 14px; color: #42B983;">
<i nz-icon nzType="info-circle" nzTheme="outline"></i> <i nz-icon nzType="info-circle" nzTheme="outline"></i>
@ -76,10 +76,10 @@
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<div class="applybtn"> <!-- <div class="applybtn">
<button (click)="apply()" nz-button nzType="primary"><i nz-icon nzType="form" <button (click)="apply()" nz-button nzType="primary"><i nz-icon nzType="form"
nzTheme="outline"></i>申请</button> nzTheme="outline"></i>申请</button>
</div> </div> -->
<div class="tablebox"> <div class="tablebox">
<div class="tableboxitem" *ngFor="let item of taskLIst" <div class="tableboxitem" *ngFor="let item of taskLIst"
[ngClass]="{'greenborder': item.approvalStatus == '通过','redborder': item.approvalStatus == '驳回'}"> [ngClass]="{'greenborder': item.approvalStatus == '通过','redborder': item.approvalStatus == '驳回'}">

18
src/app/home/task/station-task-execution/station-task-execution.component.ts

@ -64,7 +64,7 @@ export class StationTaskExecutionComponent implements OnInit {
PageSize = 10 PageSize = 10
taskLIst = [] taskLIst = []
getTaskList() { getTaskList() {
this.isloading = true // this.isloading = true
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
let params = { let params = {
Month: selectedTime, Month: selectedTime,
@ -76,14 +76,14 @@ export class StationTaskExecutionComponent implements OnInit {
CreatorId: this.userId, CreatorId: this.userId,
PageSize: this.PageSize PageSize: this.PageSize
} }
this.http.get('/api/PlanTasks', { // this.http.get('/api/PlanTasks', {
params: params // params: params
}).subscribe((data: any) => { // }).subscribe((data: any) => {
this.isloading = false // this.isloading = false
console.log('任务申请列表', data); // console.log('任务申请列表', data);
this.totalCount = data.totalCount // this.totalCount = data.totalCount
this.taskLIst = [...data.items] // this.taskLIst = [...data.items]
}) // })
} }
pageChange($event) { pageChange($event) {

24
src/app/home/task/station-weekly-plan/create-task/create-task.component.html

@ -0,0 +1,24 @@
<div class="box applymodel">
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="账号">任务名称</nz-form-label>
<nz-form-control>
<nz-radio-group formControlName="taskname">
<label nz-radio [nzValue]="title">{{title}}</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="单位名称">单位名称</nz-form-label>
<nz-form-control>
<nz-select formControlName="unitname" (nzScrollToBottom)="loadMore()" nzPlaceHolder="请选择单位" nzAllowClear
[nzDropdownRender]="renderTemplate" nzShowSearch nzServerSearch (nzOnSearch)="search($event)">
<nz-option *ngFor="let o of optionList" [nzValue]="o.id" [nzLabel]="o.companyName"></nz-option>
</nz-select>
<ng-template #renderTemplate>
<nz-spin *ngIf="isLoading"></nz-spin>
</ng-template>
</nz-form-control>
</nz-form-item>
</form>
</div>

0
src/app/home/task/station-weekly-plan/create-task/create-task.component.scss

83
src/app/home/task/station-weekly-plan/create-task/create-task.component.ts

@ -0,0 +1,83 @@
import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
import { Observable, of } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
@Component({
selector: 'app-create-task',
templateUrl: './create-task.component.html',
styleUrls: ['./create-task.component.scss']
})
export class CreateTaskComponent implements OnInit {
@Input() title?: any;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { }
newTree
ngOnInit(): void {
this.validateForm = this.fb.group({
taskname: [null, [Validators.required]],
unitname: [null, [Validators.required]]
});
}
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
}
optionList = [];
selectedUser = null;
isLoading = false;
PageNumber = 0
PageSize = 50
totalCount
loadMore(): Promise<void> {
if (this.optionList.length >= this.totalCount) {
return
}
this.PageNumber += 1
this.isLoading = true;
this.getCompanies()
}
search(value: string) {
this.optionList = []
this.PageNumber = 1
this.isLoading = true;
this.getCompanies(value)
}
async getCompanies(CompanyName?: string) {
let params = {
CompanyName: CompanyName,
OrganizationId: JSON.parse(sessionStorage.getItem('userData')).organizationId,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
await new Promise<void>((resolve, reject) => {
this.http.get('/api/Companies', {
params: params
}).subscribe((data: any) => {
this.totalCount = data.totalCount
this.isLoading = false;
this.optionList = [...this.optionList, ...data.items];
let map = new Map();
for (let item of this.optionList) {
if (!map.has(item.id)) {
map.set(item.id, item);
};
};
this.optionList = [...map.values()];
resolve(data)
})
})
}
}

23
src/app/home/task/station-weekly-plan/station-weekly-plan.component.html

@ -64,12 +64,13 @@
style="vertical-align: text-top;cursor: pointer;" nz-icon nzType="right-circle" style="vertical-align: text-top;cursor: pointer;" nz-icon nzType="right-circle"
nzTheme="outline"></i> nzTheme="outline"></i>
</p> </p>
<p style="font-weight: 900;font-size: 36px;text-align: left;">{{item.scale}}</p> <p style="font-weight: 900;font-size: 36px;text-align: left;">
{{item.passed}}/{{item.data.length}}</p>
</div> </div>
<button *ngIf="isExpand" nz-button class="btn">一键通过</button> <button *ngIf="isExpand" nz-button class="btn">一键通过</button>
</div> </div>
<div class="instrumentpanelitemright" *ngIf="isExpand"> <div class="instrumentpanelitemright" *ngIf="isExpand">
<nz-progress [nzPercent]="75" nzType="circle" [nzFormat]="formatOne" <nz-progress [nzPercent]="item.percentage" nzType="circle" [nzFormat]="formatOne"
nzStrokeColor="#42B983"> nzStrokeColor="#42B983">
</nz-progress> </nz-progress>
</div> </div>
@ -78,7 +79,12 @@
<p class="itemtwotitle"> <p class="itemtwotitle">
<span>{{item.name}}</span> <span>{{item.name}}</span>
<span class="back"> <span class="back">
<i nz-icon nzType="fullscreen" nzTheme="outline" (click)="taskDetails(item)" style="margin-right: 8px;"></i> <span class="green" *ngIf="item.name == '熟悉演练' && !isSupervisor"
(click)="apply(item)">新增</span>
<span class="green" *ngIf="(item.name == '双随机' || item.name == '联络指导') && isSupervisor"
(click)="apply(item)">新增</span>
<i nz-icon nzType="fullscreen" nzTheme="outline" (click)="taskDetails(item)"
style="margin:0 8px;"></i>
<span (click)="openDetails(item,false)"> <span (click)="openDetails(item,false)">
<i nz-icon nzType="rollback" nzTheme="outline"></i> <i nz-icon nzType="rollback" nzTheme="outline"></i>
返回 返回
@ -119,16 +125,17 @@
<nz-spin nzSimple></nz-spin> <nz-spin nzSimple></nz-spin>
</div> </div>
<div class="header"> <div class="header">
<span style="width: 16%;margin-left: 20px;"> <span style="width: 13%;margin-left: 20px;">
<img src="../../../../assets//images/icon/station.png" alt=""> <img src="../../../../assets//images/icon/station.png" alt="">
{{element.name}} {{element.name}}
</span> </span>
<span style="width: 8%;">单位总数: 7/8</span> <span style="width: 8%;">单位总数: {{element.awaitInspect}}/{{element.allUnitsNum}}</span>
<div style="width: 63%;" class="progress progresssquare"> <div style="width: 60%;" class="progress progresssquare">
<span>完成进度</span> <span>完成进度</span>
<nz-progress nzStrokeLinecap="square" nzStrokeWidth="16" nzStrokeColor="#42B983" <nz-progress nzStrokeLinecap="square" [nzStrokeWidth]="16" nzStrokeColor="#42B983"
[nzPercent]="30"></nz-progress> [nzPercent]="element.percentage"></nz-progress>
</div> </div>
<button nz-button nzType="primary" style="margin-right: 12px;">任务调整</button>
<button nz-button nzType="primary">{{isSupervisor ? '协同任务' : '生成周计划'}}</button> <button nz-button nzType="primary">{{isSupervisor ? '协同任务' : '生成周计划'}}</button>
<span (click)="expandcarditem(element)" class="expand blue"> <span (click)="expandcarditem(element)" class="expand blue">
{{element.isExpand ? '收起' :'展开'}} {{element.isExpand ? '收起' :'展开'}}

191
src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts

@ -7,6 +7,7 @@ import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service'; import { TreeService } from 'src/app/service/tree.service';
import * as moment from 'moment'; import * as moment from 'moment';
import { TaskDetailsComponent } from './task-details/task-details.component'; import { TaskDetailsComponent } from './task-details/task-details.component';
import { CreateTaskComponent } from './create-task/create-task.component';
@Component({ @Component({
selector: 'app-station-weekly-plan', selector: 'app-station-weekly-plan',
templateUrl: './station-weekly-plan.component.html', templateUrl: './station-weekly-plan.component.html',
@ -40,11 +41,13 @@ export class StationWeeklyPlanComponent implements OnInit {
this.selectedMonth = item.id this.selectedMonth = item.id
this.initializeData() this.initializeData()
this.getTaskList() this.getTaskList()
this.getTaskListPass(this.stationData[0])
} }
selectYear(e) { selectYear(e) {
this.selectedYear = e this.selectedYear = e
this.initializeData() this.initializeData()
this.getTaskList() this.getTaskList()
this.getTaskListPass(this.stationData[0])
} }
isExpand = true isExpand = true
@ -98,7 +101,7 @@ export class StationWeeklyPlanComponent implements OnInit {
} }
stationData = []
//获得辖区下所有救援站 //获得辖区下所有救援站
totalCount: string totalCount: string
@ -124,28 +127,28 @@ export class StationWeeklyPlanComponent implements OnInit {
} }
cardData = [ cardData = [
{ name: '双随机', isDetails: false, isloading: false, background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [] }, { name: '双随机', isDetails: false, isloading: false, background: '#1D9DFF', icon: 'suiji.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '行政许可', isDetails: false, isloading: false, background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [] }, { name: '行政许可', isDetails: false, isloading: false, background: '#42B983', icon: 'xuke.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '熟悉演练', isDetails: false, isloading: false, background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [] }, { name: '熟悉演练', isDetails: false, isloading: false, background: '#9D80FF', icon: 'yanlian.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '联络指导', isDetails: false, isloading: false, background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [] }, { name: '联络指导', isDetails: false, isloading: false, background: '#5483EA', icon: 'zhidao.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '消防宣传', isDetails: false, isloading: false, background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [] }, { name: '消防宣传', isDetails: false, isloading: false, background: '#FF5D2A', icon: 'xuanchuan.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '投诉举报', isDetails: false, isloading: false, background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [] }, { name: '投诉举报', isDetails: false, isloading: false, background: '#5087FF', icon: 'tousu.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '火灾调查', isDetails: false, isloading: false, background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [] } { name: '火灾调查', isDetails: false, isloading: false, background: '#FF404D', icon: 'huozai.png', passed: 0, inspected: 0, percentage: 0, data: [] }
] ]
//初始化数据 //初始化数据
initializeData() { initializeData() {
this.cardData = [ this.cardData = [
{ name: '双随机', isDetails: false, isloading: false, background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [] }, { name: '双随机', isDetails: false, isloading: false, background: '#1D9DFF', icon: 'suiji.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '行政许可', isDetails: false, isloading: false, background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [] }, { name: '行政许可', isDetails: false, isloading: false, background: '#42B983', icon: 'xuke.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '熟悉演练', isDetails: false, isloading: false, background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [] }, { name: '熟悉演练', isDetails: false, isloading: false, background: '#9D80FF', icon: 'yanlian.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '联络指导', isDetails: false, isloading: false, background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [] }, { name: '联络指导', isDetails: false, isloading: false, background: '#5483EA', icon: 'zhidao.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '消防宣传', isDetails: false, isloading: false, background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [] }, { name: '消防宣传', isDetails: false, isloading: false, background: '#FF5D2A', icon: 'xuanchuan.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '投诉举报', isDetails: false, isloading: false, background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [] }, { name: '投诉举报', isDetails: false, isloading: false, background: '#5087FF', icon: 'tousu.png', passed: 0, inspected: 0, percentage: 0, data: [] },
{ name: '火灾调查', isDetails: false, isloading: false, background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [] } { name: '火灾调查', isDetails: false, isloading: false, background: '#FF404D', icon: 'huozai.png', passed: 0, inspected: 0, percentage: 0, data: [] }
] ]
this.stationData.forEach(element => { this.stationData.forEach(element => {
element.isExpand = false element.isExpand = true
element.isLoading = false element.isLoading = false
element.data = [] element.data = []
}); });
@ -177,6 +180,18 @@ export class StationWeeklyPlanComponent implements OnInit {
element.taskType == item.name ? this.cardData[key].data.push(element) : null element.taskType == item.name ? this.cardData[key].data.push(element) : null
}); });
}); });
this.cardData.forEach(element => {
element.data.forEach(item => {
item.approvalStatus == '通过' ? element.passed += 1 : null
item.approvalStatus == '已检查 ' ? element.inspected += 1 : null
})
})
this.cardData.forEach(element => {
element.percentage = Math.round(element.inspected / element.data.length) * 100
})
resolve(data) resolve(data)
console.log('并入卡片数据', this.cardData) console.log('并入卡片数据', this.cardData)
}) })
@ -185,6 +200,65 @@ export class StationWeeklyPlanComponent implements OnInit {
} }
stationData = [
{ name: '', isExpand: true, isLoading: false, data: [], allUnitsNum: 0, awaitInspect: 0, inspected: 0, percentage: 0 }
]
async getTaskListPass(item) {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
let params = {
Month: selectedTime,
approvalStatuses: "通过",
SupervisorId: this.userId,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
item.isLoading = true
return await new Promise<void>((resolve, reject) => {
this.http.get('/api/PlanTasks', {
params: params
}).subscribe((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);
item.data.forEach(element => {
item.allUnitsNum += element.data.length
element.data.forEach(item => {
item.approvalStatus == '待检查' ? element.awaitInspect += 1 : null
item.approvalStatus == '已检查' ? element.inspected += 1 : null
});
});
item.percentage = Math.round(item.inspected / item.allUnitsNum) * 100
resolve(data)
})
})
}
//接受任务 //接受任务
accept(i, item) { accept(i, item) {
this.modal.confirm({ this.modal.confirm({
@ -202,13 +276,8 @@ export class StationWeeklyPlanComponent implements OnInit {
this.message.create('success', '已接受'); this.message.create('success', '已接受');
i.approvalStatus = '通过' i.approvalStatus = '通过'
item.isloading = false item.isloading = false
this.stationData.forEach(element => { item.passed += 1
if (element.id == i.company.organizationId) { this.getTaskListPass(this.stationData[0])
if (element.isExpand) {
this.getTaskListOfStation(element)
}
}
});
}, },
error: (err) => { error: (err) => {
@ -237,13 +306,8 @@ export class StationWeeklyPlanComponent implements OnInit {
this.message.create('success', '已拒绝'); this.message.create('success', '已拒绝');
i.approvalStatus = '驳回' i.approvalStatus = '驳回'
item.isloading = false item.isloading = false
this.stationData.forEach(element => { item.passed -= 1
if (element.id == i.company.organizationId) { this.getTaskListPass(this.stationData[0])
if (element.isExpand) {
this.getTaskListOfStation(element)
}
}
});
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '拒绝失败'); this.message.create('warning', '拒绝失败');
@ -254,9 +318,14 @@ export class StationWeeklyPlanComponent implements OnInit {
nzCancelText: '取消' nzCancelText: '取消'
}); });
} }
userName
ngOnInit(): void { ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.userId = JSON.parse(sessionStorage.getItem('userData')).id this.userId = JSON.parse(sessionStorage.getItem('userData')).id
this.userName = JSON.parse(sessionStorage.getItem('userData')).name
this.stationData[0].name = this.userName
let roles = JSON.parse(sessionStorage.getItem('userData')).roles let roles = JSON.parse(sessionStorage.getItem('userData')).roles
let isSupervisor = roles.find(item => { let isSupervisor = roles.find(item => {
return item.name.indexOf('检查') != -1 return item.name.indexOf('检查') != -1
@ -264,9 +333,9 @@ export class StationWeeklyPlanComponent implements OnInit {
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false isSupervisor ? this.isSupervisor = true : this.isSupervisor = false
this.selectedMonth = new Date().getMonth() + 1 this.selectedMonth = new Date().getMonth() + 1
this.getAllStation() // this.getAllStation()
this.getTaskList() this.getTaskList()
this.getTaskListPass(this.stationData[0])
setTimeout(() => { setTimeout(() => {
this.rollStart() this.rollStart()
@ -313,10 +382,10 @@ export class StationWeeklyPlanComponent implements OnInit {
expandcarditem(item) { expandcarditem(item) {
item.isExpand = !item.isExpand item.isExpand = !item.isExpand
console.log(item) // console.log(item)
if (item.isExpand) { // if (item.isExpand) {
this.getTaskListOfStation(item) // this.getTaskListOfStation(item)
} // }
} }
//获得消防站下的所有任务 //获得消防站下的所有任务
@ -383,4 +452,54 @@ export class StationWeeklyPlanComponent implements OnInit {
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
} }
apply(item) {
const modal = this.modal.create({
nzTitle: '新增' + item.name + '任务',
nzContent: CreateTaskComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 660,
nzMaskClosable: false,
nzComponentParams: {
title: item.name,
},
nzOnOk: async () => {
console.log(instance.validateForm.value)
if (instance.validateForm.valid) {
await new Promise((resolve, reject) => {
let body = {
taskName: instance.validateForm.value.taskname,
taskType: instance.validateForm.value.taskname,
companyId: instance.validateForm.value.unitname,
// organizationId: this.OrganizationId,
// supervisorIds: instance.validateForm.value.organization,
approvalStatus: '通过'
}
this.http.post('/api/PlanTasks', body).subscribe({
next: (data) => {
console.log(data)
// item.data.push(data)
this.getTaskListPass(this.stationData[0])
this.message.create('success', '创建成功');
resolve(data)
return true
},
error: (err) => {
this.message.create('warning', '创建失败');
reject(err)
return false
}
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
} }

130
src/app/home/task/zhi-indicators/zhi-indicators.component.html

@ -322,8 +322,8 @@
<div class="popoverContentitem"> <div class="popoverContentitem">
<nz-checkbox-group [(ngModel)]="doubleRandom.unitList" <nz-checkbox-group [(ngModel)]="doubleRandom.unitList"
(ngModelChange)="log(doubleRandom)"></nz-checkbox-group> (ngModelChange)="log(doubleRandom)"></nz-checkbox-group>
<p class="blue" *ngIf="doubleRandom.unitList.length < totalCount" <!-- <p class="blue" *ngIf="doubleRandom.unitList.length < totalCount"
(click)="moreData()">更多</p> (click)="moreData()">更多</p> -->
</div> </div>
</div> </div>
<div class="popoverContent" *ngIf="doubleRandom.selectedMenu == 2"> <div class="popoverContent" *ngIf="doubleRandom.selectedMenu == 2">
@ -342,12 +342,10 @@
<div class="popoverContentitem"> <div class="popoverContentitem">
<nz-tree [nzHideUnMatched]='true' [nzSearchValue]="doubleRandom.search2" <nz-tree [nzHideUnMatched]='true' [nzSearchValue]="doubleRandom.search2"
#nzTreeComponent [nzData]="doubleRandom.nodes" [nzTreeTemplate]="nzTreeTemplate" #nzTreeComponent [nzData]="doubleRandom.nodes" [nzTreeTemplate]="nzTreeTemplate"
nzBlockNode (nzClick)="nzEvent($event)" (nzExpandChange)="nzEvent($event)" nzBlockNode [nzExpandedIcon]="multiExpandedIconTpl">
[nzExpandedIcon]="multiExpandedIconTpl">
</nz-tree> </nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin"> <ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox"> <div class="nodebox">
<span class="name"> <span class="name">
<label *ngIf="node.origin.companyName" <label *ngIf="node.origin.companyName"
[(ngModel)]="node.origin.isChecked" nz-checkbox [(ngModel)]="node.origin.isChecked" nz-checkbox
@ -368,13 +366,15 @@
</div> </div>
</div> </div>
<div class="popoverBtn"> <div class="popoverBtn">
<button nz-button nzType="primary">确定</button> <button nz-button nzType="primary" [nzLoading]="doubleRandom.isLoading"
<button nz-button nzType="default" (click)="isPopover(doubleRandom)">取消</button> (click)="selectedUnit2(doubleRandom,'双随机')">确定</button>
<button nz-button nzType="default" [nzLoading]="doubleRandom.isLoading"
(click)="isPopover(doubleRandom)">取消</button>
</div> </div>
</div> </div>
</ng-template> </ng-template>
<span> <span>
已分配: <span class="blue">14/15</span> 家单位 已分配: <span class="blue">{{doubleRandom.allocated}}/{{doubleRandom.allPlanTasks}}</span> 家单位
</span> </span>
</div> </div>
<div class="panelheaderright"> <div class="panelheaderright">
@ -399,27 +399,58 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let item of colSpanTable.data; index as i"> <tr *ngFor="let item of colSpanTable.data; index as i">
<td>历下区大队</td> <td>{{item.organizatin.name}}</td>
<td>8</td> <td>{{item.targetCount}}</td>
<td> <td class="flextd">
<div>山东儒雅生活智慧城市服务有限公司(书苑广场)</div> <ng-container *ngIf="item.planTasks && item.planTasks.length != 0; else elseTemplate">
<div>山东儒雅生活智慧城市服务有限公司(书苑广场)</div> <div class="itembox" *ngFor="let i of item.planTasks">{{i.company.companyName}}
<div>山东儒雅生活智慧城市服务有限公司(书苑广场)</div> </div>
<div>山东儒雅生活智慧城市服务有限公司(书苑广场)</div> </ng-container>
<ng-template #elseTemplate>
/
</ng-template>
</td> </td>
<td> <td class="flextd">
<span>张三三</span> <div class="itembox" *ngFor="let i of item.planTasks">
<span class="blue" style="float: right;">更改</span> <ng-container *ngIf="i.supervisors.length != 0; else elseTemplate">
<div class="ellipsis">
<span class="assistant" nz-tooltip [nzTooltipTitle]="titleTemplate">
<span *ngFor="let o of i.supervisors">
<img *ngIf="o.posts && o.posts[0] == '主查人员'"
src="../../../../assets/images/icon/main.png" alt="">
<img *ngIf="o.posts && o.posts[0] == '协查人员'"
src="../../../../assets/images/icon/assist.png" alt="">
{{o.name}}
</span>
</span>
<ng-template #titleTemplate let-thing>
<span style="margin-right: 6px;" *ngFor="let o of i.supervisors">
<img *ngIf="o.posts && o.posts[0] == '主查人员'"
src="../../../../assets/images/icon/main.png" alt="">
<img *ngIf="o.posts && o.posts[0] == '协查人员'"
src="../../../../assets/images/icon/assist.png" alt="">
{{o.name}}
</span>
</ng-template>
</div>
<div>
<span class="blue" (click)="allot(i,'双随机')">更改</span>
</div>
</ng-container>
<ng-template #elseTemplate>
<div class="select" (click)="allot(i,'双随机')">
检查员
</div>
</ng-template>
</div>
</td> </td>
<td style="padding:0 2px!important;"> <td style="padding:0 2px!important;" class="flextd">
<textarea ngModel nzAutosize style="border: 0;" rows="1" nz-input <div class="itembox" *ngFor="let i of item.planTasks">
placeholder="一段简短的说明文字..." (ngModelChange)="saveItem()"></textarea> <textarea [(ngModel)]="i.description" nzAutosize style="border: 0;" rows="1"
<textarea ngModel nzAutosize style="border: 0;" rows="1" nz-input nz-input placeholder="一段简短的说明文字..."
placeholder="一段简短的说明文字..." (ngModelChange)="saveItem()"></textarea> (ngModelChange)="taskDescChange(doubleRandom,i)"></textarea>
<textarea ngModel nzAutosize style="border: 0;" rows="1" nz-input </div>
placeholder="一段简短的说明文字..." (ngModelChange)="saveItem()"></textarea>
<textarea ngModel nzAutosize style="border: 0;" rows="1" nz-input
placeholder="一段简短的说明文字..." (ngModelChange)="saveItem()"></textarea>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -452,7 +483,7 @@
</div> </div>
<div class="popoverContent" *ngIf="rehearsal.selectedMenu == 1"> <div class="popoverContent" *ngIf="rehearsal.selectedMenu == 1">
<div> <div>
<form nz-form (ngSubmit)="submitForm(rehearsal.search1)"> <form nz-form (ngSubmit)="submitForm(rehearsal)">
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-input-group nzPrefixIcon="search"> <nz-input-group nzPrefixIcon="search">
@ -465,6 +496,10 @@
</form> </form>
</div> </div>
<div class="popoverContentitem"> <div class="popoverContentitem">
<nz-checkbox-group [(ngModel)]="rehearsal.unitList"
(ngModelChange)="log(rehearsal)"></nz-checkbox-group>
<!-- <p class="blue" *ngIf="rehearsal.unitList.length < totalCount"
(click)="moreData()">更多</p> -->
</div> </div>
</div> </div>
<div class="popoverContent" *ngIf="rehearsal.selectedMenu == 2"> <div class="popoverContent" *ngIf="rehearsal.selectedMenu == 2">
@ -487,9 +522,8 @@
</nz-tree> </nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin"> <ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox"> <div class="nodebox">
<span class="name"> <span class="name">
<label *ngIf="node.origin.isGasStation" <label *ngIf="node.origin.companyName"
[(ngModel)]="node.origin.isChecked" nz-checkbox [(ngModel)]="node.origin.isChecked" nz-checkbox
(ngModelChange)="orcheckbox(rehearsal,$event,node)"></label> (ngModelChange)="orcheckbox(rehearsal,$event,node)"></label>
{{ node.title }} {{ node.title }}
@ -497,7 +531,7 @@
</div> </div>
</ng-template> </ng-template>
<ng-template #multiExpandedIconTpl let-node let-origin="origin"> <ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate"> <ng-container *ngIf="node.origin.companyName; else elseTemplate">
</ng-container> </ng-container>
<ng-template #elseTemplate> <ng-template #elseTemplate>
@ -508,13 +542,15 @@
</div> </div>
</div> </div>
<div class="popoverBtn"> <div class="popoverBtn">
<button nz-button nzType="primary">确定</button> <button nz-button nzType="primary" [nzLoading]="rehearsal.isLoading"
<button nz-button nzType="default" (click)="isPopover(rehearsal)">取消</button> (click)="selectedUnit2(rehearsal,'熟悉演练')">确定</button>
<button nz-button nzType="default" [nzLoading]="rehearsal.isLoading"
(click)="isPopover(rehearsal)">取消</button>
</div> </div>
</div> </div>
</ng-template> </ng-template>
<span> <span>
已分配: <span class="blue">14/15</span> 家单位 已分配: <span class="blue">{{rehearsal.allocated}}/{{rehearsal.allPlanTasks}}</span> 家单位
</span> </span>
</div> </div>
<div class="panelheaderright"> <div class="panelheaderright">
@ -537,14 +573,28 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let item of colSpanTable.data; index as i"> <tr *ngFor="let item of colSpanTable.data; index as i">
<td>历下区大队</td> <td>{{item.organizatin.name}}</td>
<td> <input nz-input ngModel /></td>
<td> <td>
山东儒雅生活智慧城市服务有限公司(书苑广场) <nz-input-number [(ngModel)]="item.targetCount" [nzMin]="1" [nzMax]="9" [nzStep]="1"
(nzBlur)="targetCountChange(rehearsal,item,$event)">
</nz-input-number>
</td> </td>
<td style="padding:0 2px!important;"> <td class="flextd">
<textarea ngModel style="border: 0;" rows="1" nzAutosize nz-input <ng-container *ngIf="item.planTasks && item.planTasks.length != 0; else elseTemplate">
placeholder="一段简短的说明文字..." (ngModelChange)="saveItem()"></textarea> <div class="itembox" *ngFor="let i of item.planTasks">{{i.company.companyName}}
</div>
</ng-container>
<ng-template #elseTemplate>
/
</ng-template>
</td>
<td style="padding:0 2px!important;" class="flextd">
<div class="itembox" *ngFor="let i of item.planTasks">
<textarea [(ngModel)]="i.description" nzAutosize nzBorderless rows="1" nz-input
placeholder="一段简短的说明文字..."
(ngModelChange)="taskDescChange(rehearsal,i)"></textarea>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

45
src/app/home/task/zhi-indicators/zhi-indicators.component.scss

@ -95,18 +95,49 @@
.editOr { .editOr {
overflow: hidden; overflow: hidden;
// display: flex;
// align-items: center;
// justify-content: space-between;
.blue { .blue {
// display: inline-block;
// white-space: nowrap;
// overflow: hidden;
// text-overflow: ellipsis;
float: right; float: right;
} }
} }
.flextd {
.itembox {
height: 32px;
line-height: 32px;
margin: 2px 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
position: relative;
display: flex;
justify-content: space-between;
.ellipsis {
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.select {
width: 80px;
height: 26px;
line-height: 26px;
background: #42B983;
border-radius: 4px 4px 4px 4px;
color: #fff;
opacity: 1;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
cursor: pointer;
text-align: center;
}
}
} }
} }
} }

236
src/app/home/task/zhi-indicators/zhi-indicators.component.ts

@ -1,13 +1,14 @@
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Component, OnInit, ViewChild, ViewContainerRef } from '@angular/core'; import { Component, OnInit, ViewChild, ViewContainerRef, NgZone } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms'; import { FormBuilder, FormGroup } from '@angular/forms';
import { TreeService } from 'src/app/service/tree.service'; import { TreeService } from 'src/app/service/tree.service';
import { fromEvent, Subject } from 'rxjs'; import { fromEvent, Subject } from 'rxjs';
import { debounceTime } from 'rxjs/operators'; // 引入debounceTime、Subject import { debounceTime, elementAt } from 'rxjs/operators'; // 引入debounceTime、Subject
import { NzFormatEmitEvent, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; import { NzFormatEmitEvent, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { EditOrComponent } from './edit-or/edit-or.component'; import { EditOrComponent } from './edit-or/edit-or.component';
import { AllotPersonComponent } from '../da-subordinate-audit/allot-person/allot-person.component';
@Component({ @Component({
selector: 'app-zhi-indicators', selector: 'app-zhi-indicators',
templateUrl: './zhi-indicators.component.html', templateUrl: './zhi-indicators.component.html',
@ -16,8 +17,9 @@ import { EditOrComponent } from './edit-or/edit-or.component';
export class ZhiIndicatorsComponent implements OnInit { export class ZhiIndicatorsComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private message: NzMessageService, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { } constructor(private ngZone: NgZone, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private message: NzMessageService, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { }
private valueChange = new Subject<string>(); private valueChange = new Subject<string>();
private targetCount = new Subject<string>();
saveItem() { saveItem() {
@ -41,16 +43,22 @@ export class ZhiIndicatorsComponent implements OnInit {
selectedYear = 2022 selectedYear = 2022
selectedTime selectedTime
selectMonth(item) { selectMonth(item) {
console.log('选择月份')
this.selectedMonth = item.id this.selectedMonth = item.id
this.initializeData() this.initializeData()
this.getTaskList('投诉举报') this.getTaskList('投诉举报')
this.getTaskList('行政许可') this.getTaskList('行政许可')
this.getTaskTarget('双随机')
this.getTaskTarget('熟悉演练')
} }
selectYear(e) { selectYear(e) {
console.log('选择年份')
this.selectedYear = e this.selectedYear = e
this.initializeData() this.initializeData()
this.getTaskList('投诉举报') this.getTaskList('投诉举报')
this.getTaskList('行政许可') this.getTaskList('行政许可')
this.getTaskTarget('双随机')
this.getTaskTarget('熟悉演练')
} }
initializeData() { initializeData() {
this.complaint.isExpand = true this.complaint.isExpand = true
@ -74,6 +82,26 @@ export class ZhiIndicatorsComponent implements OnInit {
this.permission.selectedMenu = 1 this.permission.selectedMenu = 1
this.permission.data = [] this.permission.data = []
this.doubleRandom.isExpand = true
this.doubleRandom.isPopover = false
this.doubleRandom.isLoading = false
this.doubleRandom.search1 = ''
this.doubleRandom.search1Value = []
this.doubleRandom.search2 = ''
this.doubleRandom.search2Value = []
this.doubleRandom.selectedMenu = 1
this.doubleRandom.data = []
this.rehearsal.isExpand = true
this.rehearsal.isPopover = false
this.rehearsal.isLoading = false
this.rehearsal.search1 = ''
this.rehearsal.search1Value = []
this.rehearsal.search2 = ''
this.rehearsal.search2Value = []
this.rehearsal.selectedMenu = 1
this.rehearsal.data = []
} }
//投诉举报 //投诉举报
complaint = { complaint = {
@ -116,6 +144,7 @@ export class ZhiIndicatorsComponent implements OnInit {
doubleRandom = { doubleRandom = {
name: '双随机', name: '双随机',
allocated: 0, allocated: 0,
allPlanTasks: 0,
isExpand: true,//卡片展开 isExpand: true,//卡片展开
isPopover: false,//选择单位气泡卡片 isPopover: false,//选择单位气泡卡片
isLoading: false, isLoading: false,
@ -125,9 +154,7 @@ export class ZhiIndicatorsComponent implements OnInit {
search2Value: [], search2Value: [],
searchAll: [], searchAll: [],
selectedMenu: 1,//选择单位气泡卡片 selectedMenu: 1,//选择单位气泡卡片
data: [ data: [],//表格数据
{ explain: '' }
],//表格数据
nodes: [], nodes: [],
unitList: [] unitList: []
} }
@ -136,6 +163,7 @@ export class ZhiIndicatorsComponent implements OnInit {
rehearsal = { rehearsal = {
name: '熟悉演练', name: '熟悉演练',
allocated: 0, allocated: 0,
allPlanTasks: 0,
isExpand: true,//卡片展开 isExpand: true,//卡片展开
isPopover: false,//选择单位气泡卡片 isPopover: false,//选择单位气泡卡片
isLoading: false, isLoading: false,
@ -145,7 +173,7 @@ export class ZhiIndicatorsComponent implements OnInit {
search2Value: [], search2Value: [],
searchAll: [], searchAll: [],
selectedMenu: 1,//选择单位气泡卡片 selectedMenu: 1,//选择单位气泡卡片
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],//表格数据 data: [],//表格数据
nodes: [], nodes: [],
unitList: [] unitList: []
} }
@ -266,7 +294,6 @@ export class ZhiIndicatorsComponent implements OnInit {
this.http.get('/api/Organizations', { this.http.get('/api/Organizations', {
params: params params: params
}).subscribe((data: any) => { }).subscribe((data: any) => {
console.log(9999999)
data.items.forEach(element => { data.items.forEach(element => {
element.key = element.id element.key = element.id
element.title = element.name element.title = element.name
@ -363,7 +390,7 @@ export class ZhiIndicatorsComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.selectedMonth = new Date().getMonth() + 1 this.selectedMonth = new Date().getMonth() + 1
//保存防抖 //说明保存防抖
this.valueChange.pipe(debounceTime(1000)).subscribe((item: any) => { this.valueChange.pipe(debounceTime(1000)).subscribe((item: any) => {
let body = { let body = {
description: item.description, description: item.description,
@ -381,6 +408,27 @@ export class ZhiIndicatorsComponent implements OnInit {
}) })
}) })
}); });
//任务额保存防抖
this.targetCount.pipe(debounceTime(1000)).subscribe((item: any) => {
console.log(item)
let body = {
targetCount: item.targetCount,
}
return new Promise<void>((resolve, reject) => {
this.http.patch(`/api/TaskTarget/${item.id}`, body).subscribe({
next: async (data: any) => {
this.message.create('success', '修改任务额成功');
resolve(data)
},
error: (err) => {
this.message.create('warning', '修改任务额失败');
reject(err)
}
})
})
});
this.getUsers() this.getUsers()
Promise.all([this.getCompanies(), this.getAllOrganization()]) Promise.all([this.getCompanies(), this.getAllOrganization()])
.then((results) => { .then((results) => {
@ -395,8 +443,14 @@ export class ZhiIndicatorsComponent implements OnInit {
this.getTaskList('投诉举报') this.getTaskList('投诉举报')
this.getTaskList('行政许可') this.getTaskList('行政许可')
this.getTaskTarget('双随机')
this.getTaskTarget('熟悉演练')
//获得主协调查人员
this.getSupervisor('main')
this.getSupervisor('assisted')
} }
//选择单位 确认按钮 //投诉举报/行政许可 选择单位 确认按钮
selectedUnit(data, type) { selectedUnit(data, type) {
let arr = [...data.search1Value, ...data.search2Value] let arr = [...data.search1Value, ...data.search2Value]
let arrSet = [...new Set(arr)] let arrSet = [...new Set(arr)]
@ -420,9 +474,81 @@ export class ZhiIndicatorsComponent implements OnInit {
}) })
} }
async getTaskList(TaskType, carddata?: any) { //双随机/熟悉演练 选择单位 确认按钮
selectedUnit2(data, type) {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
let arr = [...data.search1Value, ...data.search2Value]
let body = [...new Set(arr)]
data.isLoading = true
this.http.post(`/api/TaskTarget/${selectedTime}`, body, {
params: {
taskType: type
}
}).subscribe({
next: (item) => {
data.isLoading = false
data.isPopover = false
this.message.create('success', '派发成功');
type == '双随机' ? this.getTaskTarget('双随机', data) : null
type == '熟悉演练' ? this.getTaskTarget('熟悉演练', data) : null
},
error: (err) => {
this.message.create('warning', '派发失败');
}
})
}
async getTaskTarget(TaskType, carddata?: any) {
TaskType == '双随机' ? this.doubleRandom.isLoading = true : this.rehearsal.isLoading = true
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
let params = {
taskType: TaskType
}
return await new Promise<void>((resolve, reject) => {
this.http.get(`/api/TaskTarget/${selectedTime}`, {
params: params
}).subscribe((data: any) => {
this.ngZone.run(() => {
//这里写需要立即渲染的代码
TaskType == '双随机' ? this.doubleRandom.isLoading = false : this.rehearsal.isLoading = false
console.log(TaskType + '任务指标列表', data);
TaskType == '双随机' ? this.doubleRandom.allocated = 0 : null
TaskType == '熟悉演练' ? this.rehearsal.allocated = 0 : null
TaskType == '双随机' ? this.doubleRandom.allPlanTasks = 0 : null
TaskType == '熟悉演练' ? this.rehearsal.allPlanTasks = 0 : null
TaskType == '双随机' ? this.doubleRandom.data = data : null
TaskType == '熟悉演练' ? this.rehearsal.data = data : null
data.forEach(element => {
if (element.planTasks) {
if (TaskType == '双随机') {
this.doubleRandom.allPlanTasks += element.planTasks.length
}
if (TaskType == '熟悉演练') {
this.rehearsal.allPlanTasks += element.planTasks.length
}
element.planTasks.forEach(item => {
if (item.supervisorIds.length != 0) {
TaskType == '双随机' ? this.doubleRandom.allocated += 1 : null
TaskType == '熟悉演练' ? this.rehearsal.allocated += 1 : null
}
});
}
});
});
carddata ? carddata.isLoading = true : null resolve(data)
})
})
}
async getTaskList(TaskType, carddata?: any) {
TaskType == '投诉举报' ? this.complaint.isLoading = true : this.permission.isLoading = true
// carddata ? carddata.isLoading = true : null
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
let params = { let params = {
Month: selectedTime, Month: selectedTime,
@ -431,14 +557,17 @@ export class ZhiIndicatorsComponent implements OnInit {
PageNumber: 1, PageNumber: 1,
PageSize: 99999 PageSize: 99999
} }
var p = await new Promise<void>((resolve, reject) => { return await new Promise<void>((resolve, reject) => {
this.http.get('/api/PlanTasks', { this.http.get('/api/PlanTasks', {
params: params params: params
}).subscribe((data: any) => { }).subscribe((data: any) => {
this.ngZone.run(() => {
//这里写需要立即渲染的代码
console.log(TaskType + '任务列表', data.items);
TaskType == '投诉举报' ? this.complaint.isLoading = false : this.permission.isLoading = false
TaskType == '投诉举报' ? this.complaint.allocated = 0 : null TaskType == '投诉举报' ? this.complaint.allocated = 0 : null
TaskType == '行政许可' ? this.permission.allocated = 0 : null TaskType == '行政许可' ? this.permission.allocated = 0 : null
carddata ? carddata.isLoading = false : null
console.log(TaskType + '任务列表', data.items);
TaskType == '投诉举报' ? this.complaint.data = data.items : null TaskType == '投诉举报' ? this.complaint.data = data.items : null
TaskType == '行政许可' ? this.permission.data = data.items : null TaskType == '行政许可' ? this.permission.data = data.items : null
@ -449,21 +578,25 @@ export class ZhiIndicatorsComponent implements OnInit {
} }
}); });
});
resolve(data) resolve(data)
}) })
}) })
return p
} }
// this.valueChange.next('xxxx');
//修改任务描述 //修改任务描述
async taskDescChange(incomingData, item) { taskDescChange(incomingData, item) {
this.valueChange.next(item); this.valueChange.next(item);
} }
//修改任务额
targetCountChange(incomingData, item, e) {
this.targetCount.next(item);
}
ngOnDestroy(): void { ngOnDestroy(): void {
this.doubleRandom.isPopover = false console.log('毁灭了')
// this.doubleRandom.isPopover = false
} }
nzEvent(event: NzFormatEmitEvent): any { nzEvent(event: NzFormatEmitEvent): any {
@ -506,4 +639,67 @@ export class ZhiIndicatorsComponent implements OnInit {
} }
assitantsupervisorList
mainsupervisorList
getSupervisor(type) {
let params = {
inspectorType: type
}
this.http.get('/api/Users/Inspectors', {
params: params
}).subscribe((data: any) => {
console.log('检查员列表', data)
if (type == 'main') {
this.mainsupervisorList = data
} else {
this.assitantsupervisorList = data
}
})
}
allot(item, type) {
console.log(item)
if (this.mainsupervisorList.length == 0 || this.assitantsupervisorList.length == 0) {
this.message.create('warning', '请从用户管理添加检查人员');
return
}
const modal = this.modal.create({
nzTitle: '分配监督检查员',
nzContent: AllotPersonComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 485,
nzMaskClosable: false,
nzComponentParams: {
mainsupervisorList: this.mainsupervisorList,
assitantsupervisorList: this.assitantsupervisorList
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise((resolve, reject) => {
let body = {
supervisorIds: [...instance.validateForm.value.main, ...instance.validateForm.value.assitant]
}
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: async (data) => {
this.message.create('success', '分配成功');
this.getTaskTarget(type)
resolve(data)
return true
},
error: (err) => {
this.message.create('warning', '分配失败');
reject(err)
return false
}
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
} }

Loading…
Cancel
Save