|
|
|
@ -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<void>((resolve, reject) => { |
|
|
|
|
return new Promise<void>((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: '待处理' |
|
|
|
|
} |
|
|
|
|