Files
faw-report-library-web/src/views/userCenter/processCenter/monitorProcesses/monitorModal.vue
T

173 lines
4.9 KiB
Vue

<template>
<div>
<el-dialog title="调整处理人" :visible.sync="dialogVisible" width="500px">
<div class="label-input-form addModel">
<el-form ref="form" :model="form" label-width="120px" :rules="rules" class="formData">
<!-- <el-form-item label="选择人员" prop="assignee" class="el-form-item">-->
<!-- <el-select v-model="form.assignee" class="icon-auth" collapse-tags-->
<!-- placeholder="请选择">-->
<!-- <template v-for="item in userList">-->
<!-- <el-option :label="item.USNAME" :value="item.USID" :key="item.USID"></el-option>-->
<!-- </template>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="选择人员:" prop="assignee">
<el-input readonly :disabled="diasbleds" v-model="form.assigneeName"
@click.native="handleCheck('clr')"
placeholder="请选择人员"></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false" class="btn"> </el-button>
<el-button type="primary" @click="submit" class="btn"> </el-button>
</span>
</el-dialog>
<orgTable :visible.sync="visibleOrgTable" title="人员列表":config="{
value: orgTableVal,
valueName: orgTableValName
}" dialog-model :workNumFlag="true" :maxSelected="1" @confirm="isTreeOk"></orgTable>
</div>
</template>
<script>
import orgTable from '@/components/OrgTable'
export default {
name: 'modal',
components:{
orgTable
},
data() {
return {
orgTableVal:'',
orgTableValName:'',
diasbleds:false,
visibleOrgTable: false,
userList: [],
dialogVisible: false,
form: {
assignee: '',
assigneeName: ''
},
rules: {
assignee: [
{
required: 'true',
trigger: 'change',
message: '请选择人员'
}
]
},
taskId: '',
pId: '' ,
aid: '',
prcType: ''
};
},
mounted() {
this.sysUserList()
},
methods: {
isTreeOk(checkedList){
const parts = []
const partsName = []
console.log(checkedList, '0009999')
checkedList.map((item, index) => {
parts.push(item.userId || item.USID)
partsName.push(item.uname)
})
this.form.assignee= parts.toString()
this.form.assigneeName = partsName.toString()
},
handleCheck(name) {
this.orgTableValName = this.form.assigneeName
this.orgTableVal = this.form.assignee
this.visibleOrgTable = true
},
changeSelect(val) {
this.checked = (val.length || this.reportF.reportUserIdList.length) === this.userList.length;
// this.$emit('update:updateMultipleSelect',this.reportF.reportUserIdList);
},
// 获取所有用户
sysUserList() {
this.$api.user.sysUserList({pageNo: 1, pageSize: 999999}).then(({data}) => {
this.userList = data.records;
})
},
open(taskId, pId,assigneeId,aid,prcType) {
this.taskId = taskId
this.pId = pId
this.prcType = prcType
this.form.name = {
assignee: ''
}
this.assigneeId = assigneeId
this.aid = aid
this.dialogVisible = true
},
submit() {
this.$refs.form.validate((valid) => {
if (valid) {
let userId = this.form.assignee
let assignee = this.assigneeId
if (userId == assignee) {
this.$message.warning("当前任务受理人就是您选择的人员")
} else {
let params={
taskId: this.taskId,
assignee: userId ,
userId: assignee ,
prcId: this.pId
}
if(this.prcType == '1'){
if(this.aid=='oneApply'){
params.replaceMap="oneApprove:"+ this.form.assignee+','+"oneApproveName:"+ this.form.assigneeName
}else{
params.replaceMap="twoApprove:"+ this.form.assignee+','+"twoApproveName:"+ this.form.assigneeName
}
}
this.$api.process.changeAssignee(params)
.then(res => {
//转办完应该跳到哪个页面?
//转办完这个人还能看到这个监控流程吗
this.dialogVisible = false
this.$message.success(res.data.message)
this.$emit('uploadTable')
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.dialog-footer {
margin: 20px 20px;
.el-button {
width: 80px;
height: 36px;
padding: 0;
font-size: 14px;
}
}
::v-deep .el-dialog__footer {
padding-bottom: 20px;
}
.addModel {
padding: 20px;
}
.el-form-item {
::v-deep .el-select {
width: 300px;
vertical-align: center;
}
}
</style>