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 0e1d83b..19544f9 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
@@ -55,12 +55,6 @@ export class StationTaskApplyComponent implements OnInit {
this.getTaskList()
}
- cancel(item, type) {
-
- }
- delete(item) {
-
- }
isloading = false
totalCount
@@ -72,12 +66,13 @@ export class StationTaskApplyComponent implements OnInit {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
let params = {
Month: selectedTime,
- OrganizationId: this.OrganizationId,
TaskName: this.searchForm.taskname,
CompanyName: this.searchForm.unitname,
AssitantOrganizationId: this.searchForm.or,
+ CreatorId: this.isSupervisor ? this.userId : null,//如果是检查员需要传CreatorId只针对这个账户 如果是救援站就不需要
+ CreationTypes:['申领任务'],
+ OrganizationId: this.OrganizationId,
PageNumber: this.PageNumber,
- CreatorId: this.userId,
PageSize: this.PageSize
}
this.http.get('/api/PlanTasks', {
@@ -130,6 +125,7 @@ export class StationTaskApplyComponent implements OnInit {
element.title = element.name
element.disableCheckbox = true
element.selectable = false
+ element.level == 'squadron' ? element.disableCheckbox = false : null
});
this.organizationListAll = JSON.parse(JSON.stringify(data.items))
this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(item => {
@@ -202,7 +198,8 @@ export class StationTaskApplyComponent implements OnInit {
Promise.all([this.getAllOrganization(), this.getSupervisor(), this.getUsers()])
.then((results) => {
if (this.isSupervisor) {
- let arr = [...this.users, ...this.organizationListAll]
+ // let arr = [...this.users, ...this.organizationListAll]
+ let arr = [...this.organizationListAll]
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)))
} else {
let arr = [...this.supervisorList, ...this.organizationList]
@@ -242,13 +239,10 @@ export class StationTaskApplyComponent implements OnInit {
}
}
mouseEnter() {
- // console.log('进入了')
window.clearInterval(this.timer);
}
mouseleave() {
-
this.rollStart()
-
}
ngOnDestroy(): void {
console.log('退出了')
@@ -288,7 +282,8 @@ export class StationTaskApplyComponent implements OnInit {
taskType: instance.validateForm.value.taskname,
companyId: instance.selectedUnitData.id,
organizationId: this.OrganizationId,
- supervisorIds: instance.validateForm.value.organization,
+ supervisorIds: this.isSupervisor ? [] : instance.validateForm.value.organization,
+ assitantOrganizationIds: this.isSupervisor ? instance.validateForm.value.organization : [],
creationType: '申领任务',
approvalStatus: '待处理'
}
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 231be00..bc0a800 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
@@ -129,13 +129,14 @@
{{element.name}}
-
@@ -153,7 +154,7 @@
已分配
-
{{item.inspected}}
+
{{item.data.length}}
@@ -207,7 +208,7 @@
- 协助人员
+ 协助机构/人员
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 990088e..db8cf37 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
@@ -44,16 +44,30 @@ export class StationWeeklyPlanComponent implements OnInit {
selectMonth(item) {
this.selectedMonth = item.id
this.initializeData()
+ this.getTuesdayThursdayNum()
this.getTaskList()
this.getTaskListPass(this.stationData[0])
}
selectYear(e) {
this.selectedYear = e
this.initializeData()
+ this.getTuesdayThursdayNum()
this.getTaskList()
this.getTaskListPass(this.stationData[0])
}
+ //当月有几个周二周四
+ TuesdayThursdayNum = 0
+ getTuesdayThursdayNum() {
+ let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
+ this.http.get(`/api/TaskTargets/GetTargetCount/${selectedTime}`).subscribe((data: any) => {
+ console.log('最大日期', data)
+ this.TuesdayThursdayNum = data
+ })
+ }
+
+
+
isExpand = true
expand() {
this.isExpand = !this.isExpand
@@ -171,7 +185,8 @@ export class StationWeeklyPlanComponent implements OnInit {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
let params = {
Month: selectedTime,
- SupervisorId: this.userId,
+ SupervisorId: this.isSupervisor ? this.userId : null,
+ AssitantOrganizationId: this.isSupervisor ? null : this.OrganizationId,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
@@ -211,7 +226,8 @@ export class StationWeeklyPlanComponent implements OnInit {
let params = {
Month: selectedTime,
approvalStatuses: ['通过', '待检查', '已检查'],
- SupervisorId: this.userId,
+ SupervisorId: this.isSupervisor ? this.userId : null,
+ AssitantOrganizationId: this.isSupervisor ? null : this.OrganizationId,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
@@ -287,7 +303,6 @@ export class StationWeeklyPlanComponent implements OnInit {
item.isLoading = false
item.passed += 1
this.getTaskListPass(this.stationData[0])
-
},
error: (err) => {
this.message.create('warning', '接受失败');
@@ -329,23 +344,35 @@ export class StationWeeklyPlanComponent implements OnInit {
}
userName
-
+ organizationName
ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.userId = JSON.parse(sessionStorage.getItem('userData')).id
this.userName = JSON.parse(sessionStorage.getItem('userData')).name
- this.stationData[0].name = this.userName
+
+ this.organizationName = JSON.parse(sessionStorage.getItem('userData')).organizationName
+
+
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
+ if (isSupervisor) {
+ this.stationData[0].name = this.userName
+ } else {
+ this.stationData[0].name = this.organizationName
+ }
+
this.selectedMonth = new Date().getMonth() + 1
// this.getAllStation()
this.getTaskList()
this.getTaskListPass(this.stationData[0])
+
+
+ this.getTuesdayThursdayNum()
setTimeout(() => {
this.rollStart()
}, 0);
@@ -391,10 +418,6 @@ export class StationWeeklyPlanComponent implements OnInit {
expandcarditem(item) {
item.isExpand = !item.isExpand
- // console.log(item)
- // if (item.isExpand) {
- // this.getTaskListOfStation(item)
- // }
}
//获得消防站下的所有任务
@@ -414,13 +437,13 @@ export class StationWeeklyPlanComponent implements OnInit {
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: [] }
+ { 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) => {
@@ -435,7 +458,21 @@ export class StationWeeklyPlanComponent implements OnInit {
}
}
item.data = listData
- // console.log('点击的救援站通过数据', item)
+ console.log('当前登录用户所有通过的任务', item);
+ item.allUnitsNum = 0
+ item.awaitInspect = 0
+ item.inspected = 0
+ item.finished = 0
+ item.data.forEach(element => {
+ item.allUnitsNum += element.data.length
+ element.data.forEach(i => {
+ i.approvalStatus == '待检查' ? item.awaitInspect += 1 : null
+ i.approvalStatus == '已检查' ? item.inspected += 1 : null
+ i.approvalStatus == '待检查' ? element.inspected += 1 : null
+ i.approvalStatus == '已检查' ? element.finished += 1 : null
+ });
+ });
+ item.percentage = Math.round(item.inspected / item.allUnitsNum) * 100
},
error: (err) => {
this.message.create('warning', '获取数据失败');
@@ -443,6 +480,8 @@ export class StationWeeklyPlanComponent implements OnInit {
}
})
}
+
+
taskDetails(item) {
// console.log(item)
const modal = this.modal.create({
@@ -459,7 +498,11 @@ export class StationWeeklyPlanComponent implements OnInit {
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
- modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
+ modal.afterClose.subscribe(result => {
+ // item
+ // this.getTaskList()
+ this.getTaskListPass(this.stationData[0])
+ });
}
diff --git a/src/app/home/task/station-weekly-plan/task-details/task-details.component.ts b/src/app/home/task/station-weekly-plan/task-details/task-details.component.ts
index 744037c..39f9f83 100644
--- a/src/app/home/task/station-weekly-plan/task-details/task-details.component.ts
+++ b/src/app/home/task/station-weekly-plan/task-details/task-details.component.ts
@@ -39,6 +39,7 @@ export class TaskDetailsComponent implements OnInit {
}
}
});
+ this.data.passed += 1
},
error: (err) => {
this.message.create('warning', '接受失败');
@@ -68,8 +69,10 @@ export class TaskDetailsComponent implements OnInit {
if (element.isExpand) {
this.parent.getTaskListOfStation(element)
}
+
}
});
+ this.data.passed -= 1
},
error: (err) => {
this.message.create('warning', '拒绝失败');
diff --git a/src/app/home/task/zhi-indicators/zhi-indicators.component.html b/src/app/home/task/zhi-indicators/zhi-indicators.component.html
index 2090998..d8d99b4 100644
--- a/src/app/home/task/zhi-indicators/zhi-indicators.component.html
+++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.html
@@ -120,9 +120,9 @@
单位名称 |
- 配合机构 |
+ 配合机构 |
说明 |
- 操作 |
+ 操作 |
@@ -268,9 +268,9 @@
单位名称 |
- 配合机构 |
+ 配合机构 |
说明 |
- 操作 |
+ 操作 |
@@ -418,10 +418,10 @@
责任机构 |
任务额 |
- 单位名称 |
+ 单位名称 |
监督员 |
说明 |
- 操作 |
+ 操作 |
@@ -606,9 +606,9 @@
责任机构 |
任务额 |
- 单位名称 |
+ 单位名称 |
说明 |
- 操作 |
+ 操作 |
diff --git a/src/signalR.ts b/src/signalR.ts
new file mode 100644
index 0000000..191dba1
--- /dev/null
+++ b/src/signalR.ts
@@ -0,0 +1,54 @@
+import * as signalR from '@microsoft/signalr'
+export default {
+ SR: {},
+ // 初始化连接
+ initSR: function () {
+ const that = this
+ // // 连接 SignalR
+ const options: signalR.IHttpConnectionOptions = {
+ accessTokenFactory: async () => {
+ return sessionStorage.getItem('token')
+ }
+ }
+ // 1.获取系统中定义的baseURL
+ const url = '/hubs/notification'
+ // 2.初始化连接
+ that.SR = new signalR.HubConnectionBuilder()
+ .withUrl(url, options)
+ .configureLogging(signalR.LogLevel.Information)
+ .build();
+
+ // 3. 在停止signalR时,不让onclose内的 start执行
+ (that.SR as any).flag = true
+ // 4.启动连接的方法
+ async function start() {
+ try {
+ await (that.SR as any).start();
+ } catch (err) {
+ setTimeout(start, 5000);
+ }
+ }
+ // 5.关闭之后重连
+ (that.SR as any).onclose(async () => {
+ if ((that.SR as any).flag) {
+ await start();
+ }
+ });
+
+ // 6.启动连接
+ start();
+ },
+ // 停止连接,因为调用that.SR.stop(),同时会触发5操作,所以用了flag
+ stopSR: function () {
+ // const that = this
+ // (this.SR as any).flag = false
+ // async function stop() {
+ // try {
+ // await (this.SR as any).stop();
+ // } catch (err) {
+ // console.log(err)
+ // }
+ // }
+ this.signalR.stop();
+ }
+};
\ No newline at end of file