diff --git a/src/app/home/nav/nav.component.html b/src/app/home/nav/nav.component.html index 49c2ab9..37515db 100644 --- a/src/app/home/nav/nav.component.html +++ b/src/app/home/nav/nav.component.html @@ -14,7 +14,7 @@
  • 统计分析
  • -
  • +
  • 系统管理
  • diff --git a/src/app/home/nav/nav.component.ts b/src/app/home/nav/nav.component.ts index a812a6f..079c311 100644 --- a/src/app/home/nav/nav.component.ts +++ b/src/app/home/nav/nav.component.ts @@ -12,12 +12,20 @@ import { NzMessageService } from 'ng-zorro-antd/message'; }) export class NavComponent implements OnInit { - constructor( private modal: NzModalService,private http: HttpClient,private message: NzMessageService,private viewContainerRef: ViewContainerRef,private router: Router, public token: CacheTokenService) { } - user:"" + constructor(private modal: NzModalService, private http: HttpClient, private message: NzMessageService, private viewContainerRef: ViewContainerRef, private router: Router, public token: CacheTokenService) { } + user = null + + isSuperAdmin ngOnInit(): void { //调用服务中的function刷新token this.token.startUp() - this.user=JSON.parse(sessionStorage.getItem('userData')).name + this.user = JSON.parse(sessionStorage.getItem('userData')).name + + let roles = JSON.parse(sessionStorage.getItem('userData')).roles + let isTrue = roles.find(item => { + return item.name == '超级管理员' + }) + isTrue ? this.isSuperAdmin = true : this.isSuperAdmin = false } signOut() { this.router.navigate(['/login']) @@ -25,7 +33,7 @@ export class NavComponent implements OnInit { ngOnDestroy(): void { this.token.delete() } - + changePassword() { const modal: any = this.modal.create({ nzTitle: '修改密码', diff --git a/src/app/home/task/station-task-apply/apply/apply.component.html b/src/app/home/task/station-task-apply/apply/apply.component.html index d621d3a..7b568fa 100644 --- a/src/app/home/task/station-task-apply/apply/apply.component.html +++ b/src/app/home/task/station-task-apply/apply/apply.component.html @@ -1,4 +1,4 @@ -
    +
    任务名称 @@ -10,7 +10,7 @@ 单位名称 - + +
    + + {{selectedUnitData.name}} + + + 请点击选择单位 + + +
    +
    + 单位名称 + | + 组织机构 +
    +
    +
    + + + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    + + + + + + + +
    +
    +
    + + + +
    + + + {{ node.title }} + +
    +
    + + + + + + + + +
    +
    +
    + + +
    +
    +
    +
    协助机构 diff --git a/src/app/home/task/station-task-apply/apply/apply.component.scss b/src/app/home/task/station-task-apply/apply/apply.component.scss index e69de29..6ccbeba 100644 --- a/src/app/home/task/station-task-apply/apply/apply.component.scss +++ b/src/app/home/task/station-task-apply/apply/apply.component.scss @@ -0,0 +1,78 @@ +.selectUnit { + width: 85%; + position: relative; + background-color: #fff; + border: 1px solid #d9d9d9; + border-radius: 2px; + transition: all 0.3s; + height: 32px; + line-height: 30px; + cursor: pointer; + box-sizing: border-box; + padding-left: 10px; + + .gray { + color: #C7C8C7; + } + + .selectUnitPopover { + position: absolute; + left: -1px; + top: 35px; + width: 520px; + height: 438px; + z-index: 9999; + background-color: #fff; + border: 1px solid #d9d9d9; + box-sizing: border-box; + padding: 10px; + nz-form-item { + margin: 12px 0; + } + + display: flex; + flex-direction: column; + + .popoverTitle { + display: flex; + align-items: center; + + span { + color: #C7CAD0; + cursor: pointer; + } + + .selectedspan { + color: #2C4DC0; + } + } + + .popoverContent { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; + + .popoverContentitem { + flex: 1; + overflow-y: auto; + display: flex; + flex-direction: column; + + p { + text-align: center; + } + } + } + + .popoverBtn { + display: flex; + justify-content: flex-end; + margin-top: 16px; + + button { + margin-left: 18px; + } + } + } +} diff --git a/src/app/home/task/station-task-apply/apply/apply.component.ts b/src/app/home/task/station-task-apply/apply/apply.component.ts index c3c5730..81d11c7 100644 --- a/src/app/home/task/station-task-apply/apply/apply.component.ts +++ b/src/app/home/task/station-task-apply/apply/apply.component.ts @@ -5,6 +5,7 @@ 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'; +import { NzMessageService } from 'ng-zorro-antd/message'; @Component({ selector: 'app-apply', templateUrl: './apply.component.html', @@ -18,72 +19,169 @@ export class ApplyComponent implements OnInit { @Input() users?: any; validateForm!: FormGroup; - constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { } + constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private message: NzMessageService) { } newTree ngOnInit(): void { this.validateForm = this.fb.group({ taskname: [null, [Validators.required]], - unitname: [null, [Validators.required]], organization: [null, [Validators.required]] }); - // let arr = [...this.supervisorList, ...this.organizationList] - // this.newTree = this.toTree.toTree(arr) - this.newTree = this.nodes - } + this.newTree = this.nodes + + + Promise.all([this.getCompanies(), this.getAllOrganization()]) + .then((results) => { - destroyModal(): void { - this.modal.destroy({ data: 'this the result data' }); + let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))] + console.log(789456, this.allOrList) + console.log(789456, this.unitList) + let nodes = [...this.toTree.toTree(arr)] + this.unitPopover.nodes = JSON.parse(JSON.stringify(nodes)) + + }); } - optionList = []; - selectedUser = null; + + isLoading = false; - PageNumber = 0 - PageSize = 50 - totalCount - loadMore(): Promise { - 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) - } + allOrList: any - async getCompanies(CompanyName?: string) { + async getAllOrganization() { let params = { - CompanyName: CompanyName, + ContainsChildren: true, + pageSize: 9999 + } + return new Promise((resolve, reject) => { + this.http.get('/api/Organizations', { + params: params + }).subscribe((data: any) => { + data.items.forEach(element => { + element.key = element.id + element.title = element.name + element.selectable = false + element.disableCheckbox = true + }); + this.allOrList = JSON.parse(JSON.stringify(data.items)) + this.allOrList.length == 1 ? this.allOrList[0].parentId = null : null + resolve(data) + }) + }) + } + unitList + async getCompanies(incomingData?: any) { + let params = { + CompanyName: incomingData ? incomingData.search1 : '', OrganizationId: JSON.parse(sessionStorage.getItem('userData')).organizationId, - PageNumber: this.PageNumber, - PageSize: this.PageSize + PageNumber: 1, + PageSize: 9999 } - await new Promise((resolve, reject) => { + return new Promise((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 @@
    - - + + {{i.name}} - - + + {{i.name}} @@ -148,19 +148,25 @@
    - - - 待处理 + + + + + + {{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 @@ 已派发 + 删除
    diff --git a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts index 74e421f..bc66cdd 100644 --- a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts +++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts @@ -237,7 +237,7 @@ export class ZhiIndicatorsComponent implements OnInit { PageNumber: 1, PageSize: 99999 } - let p = new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { this.http.get('/api/Companies', { params: params }).subscribe((data: any) => { @@ -279,7 +279,6 @@ export class ZhiIndicatorsComponent implements OnInit { resolve(data) }) }) - return p } @@ -548,9 +547,6 @@ export class ZhiIndicatorsComponent implements OnInit { } - - - async getTaskList(TaskType, carddata?: any) { TaskType == '投诉举报' ? this.complaint.isLoading = true : this.permission.isLoading = true // carddata ? carddata.isLoading = true : null @@ -740,4 +736,32 @@ export class ZhiIndicatorsComponent implements OnInit { nzCancelText: '取消' }); } + + //删除任务 + 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 => { + let originaldata + if (item.taskType == '投诉举报' || item.taskType == '行政许可') { + this.getTaskList(item.taskType) + } + if (item.taskType == '双随机' || item.taskType == '熟悉演练') { + this.getTaskTarget(item.taskType) + } + this.message.create('success', '删除成功!'); + + }) + }, + nzCancelText: '取消', + nzOnCancel: () => { + + } + }); + } } diff --git a/src/app/pages/login/login.component.html b/src/app/pages/login/login.component.html index bdb26c0..a181ce7 100644 --- a/src/app/pages/login/login.component.html +++ b/src/app/pages/login/login.component.html @@ -1,9 +1,12 @@ \ No newline at end of file diff --git a/src/app/pages/login/login.component.scss b/src/app/pages/login/login.component.scss index 5d66571..03495bd 100644 --- a/src/app/pages/login/login.component.scss +++ b/src/app/pages/login/login.component.scss @@ -3,30 +3,31 @@ height: 100%; background: url('../../../assets/images/bgImg.png'); background-size: 100% 100%; - + display: flex; justify-content: center; align-items: center; + overflow: auto; } -.left{ + +.left { color: #feffff; padding: 50px; - margin-right: 200px; height: 504px; - p{ + margin-left: -58px; + p { color: #feffff; - font-size: 24px; + font-size: 26px; text-align: left; font-family: YouYuan; + box-sizing: border-box; + margin-top: 20px; } - .a2{ - font-size: 44px; - } - .a3{ - margin-top: -30px; - font-size: 14px; - color: rgb(254,255,255,.4); + img { + width: 850px; + height: auto; + margin-left: -76px; } } @@ -39,81 +40,61 @@ box-sizing: border-box; padding: 40px 45px 42px 45px; color: #3b3b3b; -} - -.cardheader { - width: 200px; - margin: 0 auto 10px auto; - text-align: center; - font-size: 22px; - color: #3b3b3b -} -.cardheader:nth-child(2) { - margin-bottom: 40px; -} -label { - color: #3b3b3b; -} - -.hint { - display: flex; - justify-content: space-between; - margin-bottom: 6px; - align-items: center; - .forget { - cursor: pointer; - color: #2399FF; + .cardheader { + width: 200px; + margin: 0 auto 10px auto; + text-align: center; + font-size: 22px; + color: #3b3b3b } -} -.autologin { - margin-bottom: 40px; -} + .cardheader:nth-child(2) { + margin-bottom: 40px; + } -button { - margin: 30px 0; - width: 100%; - height: 42px; - font-size: 16px; - // background: #2D4CC1; - border-radius: 4px; -} + label { + color: #3b3b3b; + } -p { - text-align: center; -} + .hint { + display: flex; + justify-content: space-between; + margin-bottom: 6px; + align-items: center; -.role { - color: #2399FF; - margin-top: 38px; - font-size: 15px; -} + .forget { + cursor: pointer; + color: #2399FF; + } + } -.company { - color: #666262; - margin-top: 10px; - font-size: 14px; -} + .autologin { + margin-bottom: 40px; + } -.name { - position: absolute; - left:40px; - top:40px; + button { + margin: 30px 0; + width: 100%; + height: 42px; + font-size: 16px; + // background: #2D4CC1; + border-radius: 4px; + } - img { - // margin-bottom: 32px; - width: 254px; - height: 56px; + p { + text-align: center; } - h1 { - font-size: 63px; - color: #3b3b3b; - font-weight: 600; + .role { + color: #2399FF; + margin-top: 38px; + font-size: 15px; + } - text-shadow: 0px 2px 8px #2399FF; - letter-spacing: 5px; - margin-bottom: 0px; + .company { + color: #666262; + margin-top: 10px; + font-size: 14px; } } diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index f7a121b..857684c 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -105,7 +105,7 @@ export class LoginComponent implements OnInit { this.isLoading = false; this.rememberInfo() this.autoLogin() - this.router.navigate(['/system']) + this.router.navigate(['/task']) this.message.create('success', `登录成功`); sessionStorage.setItem("userData", JSON.stringify(data)); await this.getLevel() diff --git a/src/assets/images/logo/loginlogo.png b/src/assets/images/logo/loginlogo.png new file mode 100644 index 0000000..049d6be Binary files /dev/null and b/src/assets/images/logo/loginlogo.png differ