|
|
|
@ -1,20 +1,19 @@ |
|
|
|
<template> |
|
|
|
<div style="position:relative;"> |
|
|
|
<el-form v-if="showType=='adjust'||showType=='adjust1'" ref="form" label-position="left" :model="formData" label-width="150px" |
|
|
|
style="margin-left: 3%; margin-top: 10px;"> |
|
|
|
<el-form v-if="showType == 'adjust' || showType == 'adjust1'" ref="form" label-position="left" :model="formData" |
|
|
|
label-width="150px" style="margin-left: 3%; margin-top: 10px;"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="选择接受人员"> |
|
|
|
<el-cascader class="u-item-width-normal" size="small" ref="myCascader" v-model="cascaderAgencyId" |
|
|
|
@change="handleChangeAgency" :options="orgOptions" :props="orgOptionProps" |
|
|
|
:show-all-levels="false" clearable></el-cascader> |
|
|
|
<el-cascader class="u-item-width-normal" size="small" ref="myCascader" |
|
|
|
v-model="cascaderAgencyId" @change="handleChangeAgency" :options="orgOptions" |
|
|
|
:props="orgOptionProps" :show-all-levels="false" clearable></el-cascader> |
|
|
|
<el-select v-model.trim="formData.receiverIds" placeholder="请选择" size="small" clearable |
|
|
|
class="cell-width-1" collapse-tags style="margin-left: 10px;" |
|
|
|
@change="changeTag" > |
|
|
|
<el-option v-for="item in workPersonnelList" :key="item.value" :label="item.name" |
|
|
|
:value="item.staffId"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
class="cell-width-1" collapse-tags style="margin-left: 10px;" @change="changeTag"> |
|
|
|
<el-option v-for="item in workPersonnelList" :key="item.value" :label="item.name" |
|
|
|
:value="item.staffId"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
@ -30,14 +29,14 @@ |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<el-table v-if="showType=='info'" :data="tableData" border class="m-table-item" style="width: 80%;" > |
|
|
|
<el-table-column label="序号" fixed="left" type="index" align="center" width="80" /> |
|
|
|
<el-table-column prop="userName" align="center" :show-overflow-tooltip="true" label="第一接收人"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="renwu" align="center" :show-overflow-tooltip="true" label="转派给"> |
|
|
|
</el-table-column> |
|
|
|
<el-table v-if="showType == 'info'" :data="tableData" border class="m-table-item" style="width: 80%;"> |
|
|
|
<el-table-column label="序号" fixed="left" type="index" align="center" width="80" /> |
|
|
|
<el-table-column prop="userName" align="center" :show-overflow-tooltip="true" label="第一接收人"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="renwu" align="center" :show-overflow-tooltip="true" label="转派给"> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-form v-if="showType=='edit'" ref="formData " label-position="left" :model="formData" label-width="150px" |
|
|
|
<el-form v-if="showType == 'edit'" ref="formData " label-position="left" :model="formData" label-width="150px" |
|
|
|
style="margin-left: 3%; margin-top: 10px;"> |
|
|
|
<el-row> |
|
|
|
<!-- <el-form-item prop="taskTitle" label="任务主题"> |
|
|
|
@ -50,7 +49,8 @@ |
|
|
|
|
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<span v-if="showType=='adjust'||showType=='edit'||showType=='adjust1'" slot="footer" class="dialog-footer" style="margin-left: 40%;"> |
|
|
|
<span v-if="showType == 'adjust' || showType == 'edit' || showType == 'adjust1'" slot="footer" class="dialog-footer" |
|
|
|
style="margin-left: 40%;"> |
|
|
|
<el-button @click="handleCancel">取 消</el-button> |
|
|
|
<el-button type="primary" @click="handleConfirm">确 定</el-button> |
|
|
|
</span> |
|
|
|
@ -63,8 +63,8 @@ import { requestPost, requestGet } from "@/js/dai/request"; |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tableData:[], |
|
|
|
formData:{ |
|
|
|
tableData: [], |
|
|
|
formData: { |
|
|
|
taskTitle: '',//任务主题 |
|
|
|
taskType: '1',//任务类型 |
|
|
|
taskPeriod: 'once',//任务周期 |
|
|
|
@ -73,10 +73,10 @@ export default { |
|
|
|
receiverIds: '',//分发人员 |
|
|
|
moduleUrl: '',//上传模板 |
|
|
|
taskIntroduction: '',//任务要求 |
|
|
|
wordBookId:''//工作簿id |
|
|
|
wordBookId: ''//工作簿id |
|
|
|
}, |
|
|
|
workPersonnelList: [], |
|
|
|
cascaderAgencyId:"", |
|
|
|
cascaderAgencyId: "", |
|
|
|
orgOptions: [], |
|
|
|
orgOptionProps: { |
|
|
|
multiple: false, |
|
|
|
@ -86,68 +86,86 @@ export default { |
|
|
|
checkStrictly: true |
|
|
|
}, |
|
|
|
selfTag: [], |
|
|
|
sarr:[], |
|
|
|
sarr: [], |
|
|
|
agencyId: '', |
|
|
|
agencylevel: '', |
|
|
|
showType:"", |
|
|
|
pageNo:1, |
|
|
|
pageSize:10 |
|
|
|
showType: "", |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 10 |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { }, |
|
|
|
methods: { |
|
|
|
handleConfirm(){ |
|
|
|
let userIdList=this.selfTag.map(item=>{ |
|
|
|
console.log(item.staffId,"dsdl;fjdfs"); |
|
|
|
handleConfirm() { |
|
|
|
let userIdList = this.selfTag.map(item => { |
|
|
|
return item.staffId |
|
|
|
}) |
|
|
|
console.log(userIdList,"sjkdfl;sd"); |
|
|
|
if (this.showType=="adjust") { |
|
|
|
let parms={ |
|
|
|
userIdList:userIdList, |
|
|
|
taskId:this.taskId, |
|
|
|
|
|
|
|
} |
|
|
|
requestPost('/actual/base/communityOneTablePeriodPublish/changeAssignWorker', parms).then(res => { |
|
|
|
return this.$emit('handelPersonel') |
|
|
|
|
|
|
|
}); |
|
|
|
} else if(this.showType=="adjust1"){ |
|
|
|
let parms={ |
|
|
|
userId:userIdList.toString(), |
|
|
|
id:this.taskId, |
|
|
|
reassignedReason:"" |
|
|
|
|
|
|
|
} |
|
|
|
requestPost('/actual/base/communityOneTablePeriodPublish/reAssignWorker', parms).then(res => { |
|
|
|
return this.$emit('handelPersonel') |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
else{ |
|
|
|
let parms={ |
|
|
|
userIdList:userIdList, |
|
|
|
id:this.taskId, |
|
|
|
taskIntroduction:this.formData.taskIntroduction |
|
|
|
|
|
|
|
if (this.showType == "adjust") { |
|
|
|
let parms = { |
|
|
|
userIdList: userIdList, |
|
|
|
taskId: this.taskId, |
|
|
|
} |
|
|
|
this.updateState() |
|
|
|
requestPost('/actual/base/communityOneTablePeriodPublish/changeAssignWorker', parms).then(res => { |
|
|
|
if (res.code === 0) { |
|
|
|
this.$message.success('转派成功') |
|
|
|
return this.$emit('handelPersonel') |
|
|
|
} else { |
|
|
|
this.$message.error(res.internalMsg) |
|
|
|
} |
|
|
|
}); |
|
|
|
} else if (this.showType == "adjust1") { |
|
|
|
let parms = { |
|
|
|
userId: userIdList.toString(), |
|
|
|
id: this.taskId, |
|
|
|
reassignedReason: "" |
|
|
|
} |
|
|
|
this.updateState() |
|
|
|
requestPost('/actual/base/communityOneTablePeriodPublish/reAssignWorker', parms).then(res => { |
|
|
|
if (res.code === 0) { |
|
|
|
this.$message.success('转派成功') |
|
|
|
return this.$emit('handelPersonel') |
|
|
|
} else { |
|
|
|
this.$message.error(res.internalMsg) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
requestPost('/actual/base/communityOneTablePublish/update', parms).then(res => { |
|
|
|
return this.$emit('handelPersonel') |
|
|
|
}); |
|
|
|
else { |
|
|
|
let parms = { |
|
|
|
userIdList: userIdList, |
|
|
|
id: this.taskId, |
|
|
|
taskIntroduction: this.formData.taskIntroduction |
|
|
|
|
|
|
|
} |
|
|
|
requestPost('/actual/base/communityOneTablePublish/update', parms).then(res => { |
|
|
|
return this.$emit('handelPersonel') |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
async updateState() { |
|
|
|
const url = '/actual/base/communityOneTablePeriodPublish/update' |
|
|
|
console.log(this.formDatas); |
|
|
|
const { id, taskId, taskTitle, taskPeriod, taskType, taskIntroduction } = this.formDatas; |
|
|
|
const parm = { id, taskId, taskTitle, taskPeriod, taskType, taskIntroduction } |
|
|
|
parm.taskState = 'reassigned'; |
|
|
|
const { code, msg } = await requestPost(url, parm) |
|
|
|
if (code === 0) { |
|
|
|
// this.$message.success('转派成功') |
|
|
|
} else { |
|
|
|
console.log(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
getPeriodPublish() { |
|
|
|
let parms={ |
|
|
|
pageNo:this.pageNo, |
|
|
|
pageSize:this.pageSize, |
|
|
|
taskId:this.taskId, |
|
|
|
taskNum:0 |
|
|
|
let parms = { |
|
|
|
pageNo: this.pageNo, |
|
|
|
pageSize: this.pageSize, |
|
|
|
taskId: this.taskId, |
|
|
|
taskNum: 0 |
|
|
|
} |
|
|
|
requestGet('/actual/base/communityOneTablePeriodPublish/page', parms).then(res => { |
|
|
|
this.tableData=res.data.list |
|
|
|
this.tableData = res.data.list |
|
|
|
}); |
|
|
|
}, |
|
|
|
getLastItem(list, vals, key) { |
|
|
|
@ -163,15 +181,15 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
removeTag(val) { |
|
|
|
this.selfTag = this.selfTag.filter(item => item.staffId!=val.staffId); |
|
|
|
this.selfTag = this.selfTag.filter(item => item.staffId != val.staffId); |
|
|
|
}, |
|
|
|
changeTag(val) { |
|
|
|
let obj = this.workPersonnelList.find(item => item.staffId === val); |
|
|
|
obj.agencyId = this.agencyId |
|
|
|
if (obj) { |
|
|
|
let exists = this.selfTag.some(tag => tag.agencyId === obj.agencyId); |
|
|
|
this.selfTag.push(obj); |
|
|
|
|
|
|
|
this.selfTag.push(obj); |
|
|
|
|
|
|
|
} else { |
|
|
|
console.error('未找到对应的人员信息'); |
|
|
|
} |
|
|
|
@ -214,14 +232,14 @@ export default { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
handleCancel(){ |
|
|
|
|
|
|
|
handleCancel() { |
|
|
|
this.$emit('handelPersonel') |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
console.log(this.showType,this.taskId,"sdlfkl;sdf"); |
|
|
|
console.log(this.showType, this.taskId, "sdlfkl;sdf"); |
|
|
|
this.getOrgTreeList() |
|
|
|
this.getPeriodPublish() |
|
|
|
}, |
|
|
|
@ -230,22 +248,24 @@ export default { |
|
|
|
type: String, |
|
|
|
default: '' |
|
|
|
}, |
|
|
|
showType:{ |
|
|
|
showType: { |
|
|
|
type: String, |
|
|
|
default: '' |
|
|
|
default: '' |
|
|
|
}, |
|
|
|
formDatas: { |
|
|
|
type: Object, |
|
|
|
default: () => { } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
computed: { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
watch: {}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang='scss' scoped> |
|
|
|
.dialog-footer{ |
|
|
|
|
|
|
|
} |
|
|
|
.dialog-footer {} |
|
|
|
</style> |