diff --git a/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html b/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html index f43ee10..cb169d0 100644 --- a/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html +++ b/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html @@ -3,7 +3,8 @@ 检查员(主) - + @@ -12,7 +13,8 @@ 检查员(协) - + diff --git a/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.ts b/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.ts index 5b6b9f3..801017a 100644 --- a/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.ts +++ b/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.ts @@ -21,7 +21,8 @@ export class AllotPersonComponent implements OnInit { assitant: [null, [Validators.required]] }); - + // console.log(this.mainsupervisorList) + // console.log(this.assitantsupervisorList) } destroyModal(): void { this.modal.destroy({ data: 'this the result data' }); 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 7b568fa..226607b 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 @@ -3,7 +3,7 @@ 任务名称 - + @@ -122,5 +122,20 @@ + + 检查人员 + + + + + + + + + + + + + \ No newline at end of file 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 6ccbeba..36b1abf 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 @@ -26,6 +26,7 @@ border: 1px solid #d9d9d9; box-sizing: border-box; padding: 10px; + nz-form-item { margin: 12px 0; } @@ -76,3 +77,17 @@ } } } + + +.itembox { + .img1 { + margin-right: 8px; + } + + .img2 { + margin: 0 8px; + } + .select{ + width: 44.6%; + } +} 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 33d9f4a..4cf7a98 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 @@ -17,16 +17,23 @@ export class ApplyComponent implements OnInit { @Input() supervisorList?: any; @Input() organizationList?: any; @Input() users?: any; + @Input() mainsupervisorList?: any; + @Input() assitantsupervisorList?: any; validateForm!: FormGroup; constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private message: NzMessageService) { } - + taskType newTree ngOnInit(): void { + + console.log('mainsupervisorList', this.mainsupervisorList) + console.log('assitantsupervisorList', this.assitantsupervisorList) this.validateForm = this.fb.group({ taskname: [null, [Validators.required]], - organization: [null, [Validators.required]] + organization: [null, [Validators.required]], + main: [null], + assist: [null] }); this.newTree = this.nodes @@ -35,7 +42,6 @@ export class ApplyComponent implements OnInit { .then((results) => { let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))] let nodes = [...this.toTree.toTree(arr)] - console.log('6666',nodes) this.unitPopover.nodes = JSON.parse(JSON.stringify(nodes)) }); } @@ -63,9 +69,9 @@ export class ApplyComponent implements OnInit { element.disableCheckbox = true }); this.allOrList = JSON.parse(JSON.stringify(data.items)) - console.log(111,this.allOrList) + console.log(111, this.allOrList) this.allOrList.forEach(element => { - if(element.id == JSON.parse(sessionStorage.getItem('userData')).organizationId){ + if (element.id == JSON.parse(sessionStorage.getItem('userData')).organizationId) { element.parentId = null } }); @@ -147,12 +153,7 @@ export class ApplyComponent implements OnInit { } 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) { @@ -183,7 +184,6 @@ export class ApplyComponent implements OnInit { } } } - 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 9dd6671..d9b3566 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 @@ -121,13 +121,14 @@ {{i.name}} + + + + {{i.name}} + - - {{i.name}} @@ -137,21 +138,21 @@ {{i.name}} + + + + {{i.name}} + - - {{i.name}} - - {{isSupervisor ? '协助机构' : '协助人员'}} + {{isSupervisor ? '协助机构/人员' : '协助人员'}}
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 19544f9..9e562a9 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 @@ -70,7 +70,7 @@ export class StationTaskApplyComponent implements OnInit { CompanyName: this.searchForm.unitname, AssitantOrganizationId: this.searchForm.or, CreatorId: this.isSupervisor ? this.userId : null,//如果是检查员需要传CreatorId只针对这个账户 如果是救援站就不需要 - CreationTypes:['申领任务'], + CreationTypes: ['申领任务'], OrganizationId: this.OrganizationId, PageNumber: this.PageNumber, PageSize: this.PageSize @@ -139,10 +139,9 @@ export class StationTaskApplyComponent implements OnInit { //获得所有检查员 supervisorList = [] - mainsupervisorList = [] - assitantsupervisorList = [] + async getSupervisor() { - var p = new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { this.http.get('/api/Users/Inspectors').subscribe((data: any) => { console.log('检查员列表', data) data.forEach(element => { @@ -154,7 +153,23 @@ export class StationTaskApplyComponent implements OnInit { resolve(data) }) }) - return p + } + + mainsupervisorList = [] + assitantsupervisorList = [] + getSupervisortype(type) { + let params = { + inspectorType: type + } + this.http.get('/api/Users/Inspectors', { + params: params + }).subscribe((data: any) => { + if (type == 'main') { + this.mainsupervisorList = data + } else { + this.assitantsupervisorList = data + } + }) } //获得除了检查员的其他用户 @@ -210,6 +225,10 @@ export class StationTaskApplyComponent implements OnInit { setTimeout(() => { this.rollStart() }, 0); + + //获得主协调查人员 + this.getSupervisortype('main') + this.getSupervisortype('assisted') } messageList = [1, 1, 1, 1, 1] @@ -268,22 +287,45 @@ export class StationTaskApplyComponent implements OnInit { supervisorList: JSON.parse(JSON.stringify(this.supervisorList)), organizationList: JSON.parse(JSON.stringify(this.organizationList)), users: JSON.parse(JSON.stringify(this.users)), - nodes: JSON.parse(JSON.stringify(this.nodes)) + nodes: JSON.parse(JSON.stringify(this.nodes)), + mainsupervisorList: JSON.parse(JSON.stringify(this.mainsupervisorList)), + assitantsupervisorList: JSON.parse(JSON.stringify(this.assitantsupervisorList)) }, nzOnOk: async () => { console.log(instance.validateForm.value) if (instance.validateForm.valid && instance.selectedUnitData.id) { + if (instance.taskType == '双随机') { + if (!instance.validateForm.value.main || !instance.validateForm.value.assist) { + this.message.create('warning', '请填写检查人员!'); + return false + } + } + await new Promise((resolve, reject) => { let selectedMonth = this.selectedMonth < 10 ? "0" + this.selectedMonth : this.selectedMonth; let selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01' + let supervisorIds + let assitantOrganizationIds + if (this.isSupervisor) { + if (instance.taskType == '双随机') { + supervisorIds = [instance.validateForm.value.main, instance.validateForm.value.assist] + } else { + supervisorIds = [] + } + assitantOrganizationIds = instance.validateForm.value.organization + } else { + supervisorIds = instance.validateForm.value.organization + assitantOrganizationIds = [] + } + let body = { month: selectedTime, taskName: instance.validateForm.value.taskname, taskType: instance.validateForm.value.taskname, companyId: instance.selectedUnitData.id, organizationId: this.OrganizationId, - supervisorIds: this.isSupervisor ? [] : instance.validateForm.value.organization, - assitantOrganizationIds: this.isSupervisor ? instance.validateForm.value.organization : [], + supervisorIds: supervisorIds, + assitantOrganizationIds: assitantOrganizationIds, creationType: '申领任务', approvalStatus: '待处理' } diff --git a/src/theme.less b/src/theme.less index 2f5141a..cbc3dad 100644 --- a/src/theme.less +++ b/src/theme.less @@ -90,4 +90,4 @@ label{ margin-bottom: 6px; } -} \ No newline at end of file +}