((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()];
+ data.items.forEach(element => {
+ element.label = element.companyName
+ element.value = element.id
+ element.parentId = element.organizationId
+ element.key = element.id
+ element.title = element.companyName
+ element.level = 4
+ });
+ this.unitList = data.items
+
+ this.unitPopover.unitList = JSON.parse(JSON.stringify(this.unitList))
+
+
resolve(data)
})
})
}
+
+
+ selectedUnitData = {
+ name: '',
+ id: ''
+ }
+ selectedUnit(data, e?: any) {
+ e ? e.stopPropagation() : null
+ let arr = [...data.search1Value, ...data.search2Value]
+ let arrSet = [...new Set(arr)]
+
+ if (arrSet.length > 1) {
+ this.message.create('warning', '只能选择一个单位');
+ return
+ } else {
+ this.unitList.forEach(element => {
+ if (element.id == arrSet[0]) {
+ this.selectedUnitData.name = element.companyName
+ this.selectedUnitData.id = element.id
+ }
+ });
+ console.log(this.selectedUnitData)
+ console.log(this.unitPopover)
+ this.unitPopover.isPopover = false
+ }
+ }
+ //
+ unitPopover = {
+ allocated: 0,
+ isExpand: true,//卡片展开
+ isPopover: false,//选择单位气泡卡片
+ isLoading: false,
+ search1: '',//选择单位气泡卡片---单位选择列表
+ search1Value: [],
+ search2: '',//选择单位气泡卡片---组织选择列表
+ search2Value: [],
+ searchAll: [],
+ selectedMenu: 1,//选择单位气泡卡片
+ data: [
+ ],//表格数据
+ nodes: [],
+ unitList: []
+ }
+ isPopover(data, e?: any) {
+ e ? e.stopPropagation() : null
+ console.log(data)
+ data.isPopover = !data.isPopover
+ // data.unitList.forEach(element => {
+ // element.checked = false
+ // });
+
+ }
+ // 弹出 tab
+ popoverMenuSelect(data, type) {
+ data.selectedMenu = type
+ }
+ //搜索框提交
+ submitForm(data): void {
+ console.log(data)
+ data.unitList = []
+ this.getCompanies(data)
+ }
+ log(data) {
+ let arr = []
+ data.unitList.forEach(item => {
+ item.checked ? arr.push(item.id) : null
+ });
+ data.search1Value = arr
+ }
+ orcheckbox(data, $event, node) {
+ if ($event) {
+ data.search2Value.push(node.origin.id)
+ } else {
+ for (let index = 0; index < data.search2Value.length; index++) {
+ const element = data.search2Value[index];
+ if (element == node.origin.id) {
+ data.search2Value.splice(index, 1)
+ index--
+ }
+ }
+ }
+ console.log(data.search2Value)
+ }
}
diff --git a/src/app/home/task/station-task-apply/station-task-apply.component.html b/src/app/home/task/station-task-apply/station-task-apply.component.html
index 450c929..03cc44b 100644
--- a/src/app/home/task/station-task-apply/station-task-apply.component.html
+++ b/src/app/home/task/station-task-apply/station-task-apply.component.html
@@ -118,19 +118,19 @@
-
-
- 待处理
+
+
+
+
+
+ {{item.approvalStatus}}
+
结果
-
- 查看
+
+ 查看
+ 删除
操作
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 ef04c20..0e1d83b 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
@@ -278,7 +278,7 @@ export class StationTaskApplyComponent implements OnInit {
},
nzOnOk: async () => {
console.log(instance.validateForm.value)
- if (instance.validateForm.valid) {
+ if (instance.validateForm.valid && instance.selectedUnitData.id) {
await new Promise((resolve, reject) => {
let selectedMonth = this.selectedMonth < 10 ? "0" + this.selectedMonth : this.selectedMonth;
let selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01'
@@ -286,7 +286,7 @@ export class StationTaskApplyComponent implements OnInit {
month: selectedTime,
taskName: instance.validateForm.value.taskname,
taskType: instance.validateForm.value.taskname,
- companyId: instance.validateForm.value.unitname,
+ companyId: instance.selectedUnitData.id,
organizationId: this.OrganizationId,
supervisorIds: instance.validateForm.value.organization,
creationType: '申领任务',
@@ -334,7 +334,35 @@ export class StationTaskApplyComponent implements OnInit {
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
+ //删除任务
+ deleteTask(item, incomingData) {
+ console.log(item)
+ console.log(incomingData)
+ this.modal.confirm({
+ nzTitle: `确定要删除该任务吗?`,
+ nzOkText: '确定',
+ nzOkType: 'primary',
+ nzOnOk: () => {
+ this.http.delete(`/api/PlanTasks/${item.id}`).subscribe(data => {
+ for (let index = 0; index < incomingData.length; index++) {
+ const element = incomingData[index];
+ if (element.id == item.id) {
+ incomingData.splice(index, 1)
+ index--
+ }
+ }
+
+ this.message.create('success', '删除成功!');
+
+ })
+ },
+ nzCancelText: '取消',
+ nzOnCancel: () => {
+
+ }
+ });
+ }
}
export enum ApprovalStatus {
diff --git a/src/app/home/task/station-task-execution/station-task-execution.component.html b/src/app/home/task/station-task-execution/station-task-execution.component.html
index c2e570c..07e01e0 100644
--- a/src/app/home/task/station-task-execution/station-task-execution.component.html
+++ b/src/app/home/task/station-task-execution/station-task-execution.component.html
@@ -150,7 +150,7 @@
- 待检查
+ {{item.inspectionResult}}
检查结果
diff --git a/src/app/home/task/task.component.ts b/src/app/home/task/task.component.ts
index 3231841..f3be1dc 100644
--- a/src/app/home/task/task.component.ts
+++ b/src/app/home/task/task.component.ts
@@ -7,33 +7,33 @@ import { Router } from '@angular/router';
styleUrls: ['./task.component.scss']
})
export class TaskComponent implements OnInit {
- level=""
- user=false
+ level = ""
+ user = false
constructor(private router: Router) { }
ngOnInit(): void {
console.log(JSON.parse(sessionStorage.getItem('userData')));
-
- this.level=JSON.parse(sessionStorage.getItem('userData')).organizationLevel
- let user=JSON.parse(sessionStorage.getItem('userData')).roles
-
+
+ this.level = JSON.parse(sessionStorage.getItem('userData')).organizationLevel
+ let user = JSON.parse(sessionStorage.getItem('userData')).roles
+
for (let index = 0; index < user.length; index++) {
const element = user[index].name;
- if(element.indexOf('检查') != -1){
- this.user=true
+ if (element.indexOf('检查') != -1) {
+ this.user = true
}
}
- if(this.router.url=="/task"){
- if(this.level=="brigade"){
+ if (this.router.url == "/task") {
+ if (this.level == "brigade") {
this.router.navigate(['/task/indicators'])
- }else if(this.level=="battalion" && !this.user){
+ } else if (this.level == "battalion" && !this.user) {
this.router.navigate(['/task/monthlytaskoverview'])
- }else if(this.level=="squadron" || this.user){
+ } else if (this.level == "squadron" || this.user) {
this.router.navigate(['/task/taskexecution'])
}
}
-
-
-
+
+
+
}
}
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 a68e703..2090998 100644
--- a/src/app/home/task/zhi-indicators/zhi-indicators.component.html
+++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.html
@@ -144,13 +144,15 @@
placeholder="一段简短的说明文字..."
(ngModelChange)="taskDescChange(complaint,item)">
-
+ |
派发
已派发
+ 删除
|
@@ -290,13 +292,15 @@
placeholder="一段简短的说明文字..."
(ngModelChange)="taskDescChange(permission,item)">
-
+ |
派发
已派发
+ 删除
|
@@ -484,6 +488,7 @@
已派发
+ 删除
@@ -639,6 +644,7 @@
已派发
+ 删除