提示审批人账号禁用
This commit is contained in:
1 parent
c06d8f1fff
commit
8f918fcdaa
1 file changed
+57
-17
@@ -39,17 +39,25 @@
|
|||||||
</v-chip>
|
</v-chip>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex align-center">
|
<div class="d-flex align-center">
|
||||||
<template v-for="(userId, userIndex) in node.properties.userIdList">
|
<template v-for="(user, userIndex) in node.properties.userIdList">
|
||||||
<div class="item-user-box d-flex justify-space-between px-2 mr-2">
|
<div :class="`item-user-box d-flex justify-space-between px-2 mr-2 ${ user.username.includes('(账号被禁用)') && 'item-user-box-error'} `">
|
||||||
<span class="omit">{{ constantObj.userList.find(u => u.userId == userId)?.username || userId }}</span>
|
<span class="omit">{{ user.username }}</span>
|
||||||
<v-icon class="ml-1" color="#a4a7aa" @click="doUiAction('deleteNodeUser', {nodeIndex ,userIndex})">mdi-close</v-icon>
|
<v-icon v-if="( node.properties?.approverType == '申请人自选' || node.properties?.noticerType == '申请人自选' ) || taskData.workflowInfo.modifyAuthority == false"
|
||||||
|
class="ml-1" color="#a4a7aa" @click="doUiAction('deleteNodeUser', {nodeIndex ,userIndex})">
|
||||||
|
mdi-close
|
||||||
|
</v-icon>
|
||||||
</div>
|
</div>
|
||||||
<v-icon v-if="userIndex != node.properties.userIdList.length && node.properties.approvalType == '依次审批'"
|
<v-icon v-if="userIndex < node.properties.userIdList.length - 1 && node.properties.approvalType == '依次审批'"
|
||||||
class="mr-2" color="#afb1b4" small>
|
class="mr-2" color="#afb1b4" small>
|
||||||
mdi-arrow-right-thin
|
mdi-arrow-right-thin
|
||||||
</v-icon>
|
</v-icon>
|
||||||
</template>
|
</template>
|
||||||
<template>
|
<template v-if=" node.properties.userIdList <= 0 && ( node.properties?.approverType != '申请人自选' && node.properties?.noticerType != '申请人自选' )">
|
||||||
|
<div class="item-user-box d-flex justify-space-between px-2 mr-2">
|
||||||
|
<span class="red--text">审批人为空</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="( node.properties?.approverType == '申请人自选' || node.properties?.noticerType == '申请人自选' ) || taskData.workflowInfo.modifyAuthority == false">
|
||||||
<div class="abb-user d-flex justify-center align-center" @click="doUiAction('startAddNodeUser', nodeIndex)">
|
<div class="abb-user d-flex justify-center align-center" @click="doUiAction('startAddNodeUser', nodeIndex)">
|
||||||
<v-icon color="#4caf50">mdi-plus</v-icon>
|
<v-icon color="#4caf50">mdi-plus</v-icon>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,8 +75,8 @@
|
|||||||
<v-row class="justify-end mx-0 my-8 px-4">
|
<v-row class="justify-end mx-0 my-8 px-4">
|
||||||
<!-- 抽屉操作按钮 -->
|
<!-- 抽屉操作按钮 -->
|
||||||
<div class="d-flex justify-end pr-4">
|
<div class="d-flex justify-end pr-4">
|
||||||
<v-btn color="success" @click="doUiAction('createTask')" small>提交</v-btn>
|
<v-btn color="success" @click="doUiAction('createTask')" small :loading="isCreateWorkLoading">提交</v-btn>
|
||||||
<v-btn class="elevation-0 ml-2" @click="isDrawerShown = false" small>取消</v-btn>
|
<v-btn class="elevation-0 ml-2" @click="isDrawerShown = false" small :loading="isCreateWorkLoading">取消</v-btn>
|
||||||
</div>
|
</div>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
@@ -92,7 +100,7 @@
|
|||||||
<v-autocomplete
|
<v-autocomplete
|
||||||
class="jh-v-input mr-2"
|
class="jh-v-input mr-2"
|
||||||
dense filled single-line clearable
|
dense filled single-line clearable
|
||||||
:items="constantObj.userList"
|
:items="curUserList"
|
||||||
item-text="username"
|
item-text="username"
|
||||||
item-value="userId"
|
item-value="userId"
|
||||||
v-model="addNodeUserId">
|
v-model="addNodeUserId">
|
||||||
@@ -149,7 +157,9 @@ Vue.component("create-task-drawer", {
|
|||||||
taskSubmitData: null,
|
taskSubmitData: null,
|
||||||
isAddNodeUserDialogShown: false,
|
isAddNodeUserDialogShown: false,
|
||||||
addNodeUserIndex: -1,
|
addNodeUserIndex: -1,
|
||||||
addNodeUserId: null
|
addNodeUserId: null,
|
||||||
|
selectedUser: [],
|
||||||
|
isCreateWorkLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -158,6 +168,9 @@ Vue.component("create-task-drawer", {
|
|||||||
},
|
},
|
||||||
curWorkflow(){
|
curWorkflow(){
|
||||||
return this.taskData.workflowConfig.nodeList.filter(node => !['start', 'end', 'conditionTask'].includes(node.properties.type))
|
return this.taskData.workflowConfig.nodeList.filter(node => !['start', 'end', 'conditionTask'].includes(node.properties.type))
|
||||||
|
},
|
||||||
|
curUserList(){
|
||||||
|
return this.constantObj.userList.filter(u => !this.selectedUser.includes(u.userId))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -325,6 +338,7 @@ Vue.component("create-task-drawer", {
|
|||||||
num = u == '直属上级' ? 1 : u[1]
|
num = u == '直属上级' ? 1 : u[1]
|
||||||
userList = userList.concat(this.getDirectSupervisor([`<$ ctx.userInfo.userId $>`], num))
|
userList = userList.concat(this.getDirectSupervisor([`<$ ctx.userInfo.userId $>`], num))
|
||||||
})
|
})
|
||||||
|
userList = userList.map(id => { return { userId: id, username: this.constantObj.userList.find(u => u.userId == id)?.username || id + '(账号被禁用)'}})
|
||||||
break;
|
break;
|
||||||
case '指定部门负责人':
|
case '指定部门负责人':
|
||||||
var num = 0
|
var num = 0
|
||||||
@@ -333,15 +347,18 @@ Vue.component("create-task-drawer", {
|
|||||||
var groupId = this.constantObj.userList.find(u => u.userId == `<$ ctx.userInfo.userId $>`)?.group.find(g => g.isMainGroup == '是')?.groupId
|
var groupId = this.constantObj.userList.find(u => u.userId == `<$ ctx.userInfo.userId $>`)?.group.find(g => g.isMainGroup == '是')?.groupId
|
||||||
userList = userList.concat(this.getHeadId(groupId, num))
|
userList = userList.concat(this.getHeadId(groupId, num))
|
||||||
})
|
})
|
||||||
|
userList = userList.map(id => { return { userId: id, username: this.constantObj.userList.find(u => u.userId == id)?.username || id + '(账号被禁用)'}})
|
||||||
break;
|
break;
|
||||||
case '指定标签':
|
case '指定标签':
|
||||||
node.properties.user.forEach(u =>{
|
node.properties.user.forEach(u =>{
|
||||||
let userIdList = this.constantObj.labelList.find(l => l.labelId == u)?.user.split(',')
|
let userIdList = this.constantObj.labelList.find(l => l.labelId == u)?.user.split(',')
|
||||||
if(userIdList && userIdList.length > 0) userList = userList.concat(userIdList)
|
if(userIdList && userIdList.length > 0) userList = userList.concat(userIdList)
|
||||||
})
|
})
|
||||||
|
userList = userList.map(id => { return { userId: id, username: this.constantObj.userList.find(u => u.userId == id)?.username || id + '(账号被禁用)'}})
|
||||||
break;
|
break;
|
||||||
case '指定人员':
|
case '指定人员':
|
||||||
userList = node.properties.user
|
userList = node.properties.user
|
||||||
|
userList = userList.map(id => { return { userId: id, username: this.constantObj.userList.find(u => u.userId == id)?.username || id + '(账号被禁用)'}})
|
||||||
break;
|
break;
|
||||||
case '申请人自选':
|
case '申请人自选':
|
||||||
|
|
||||||
@@ -514,12 +531,16 @@ Vue.component("create-task-drawer", {
|
|||||||
|
|
||||||
startAddNodeUser(nodeIndex){
|
startAddNodeUser(nodeIndex){
|
||||||
this.addNodeUserIndex = nodeIndex
|
this.addNodeUserIndex = nodeIndex
|
||||||
|
this.selectedUser = this.curWorkflow[nodeIndex].properties.userIdList.map(u => u.userId)
|
||||||
this.isAddNodeUserDialogShown = true
|
this.isAddNodeUserDialogShown = true
|
||||||
},
|
},
|
||||||
|
|
||||||
addNodeUser(){
|
addNodeUser(){
|
||||||
if(!this.addNodeUserId) return window.vtoast.fail('保存用户失败!')
|
if(!this.addNodeUserId) return window.vtoast.fail('保存用户失败!')
|
||||||
this.curWorkflow[this.addNodeUserIndex].properties.userIdList.push(this.addNodeUserId)
|
this.curWorkflow[this.addNodeUserIndex].properties.userIdList.push({
|
||||||
|
userId: this.addNodeUserId,
|
||||||
|
username: this.constantObj.userList.find(u => u.userId == this.addNodeUserId)?.username || id + '(账号被禁用)'
|
||||||
|
})
|
||||||
window.vtoast.success('保存用户成功!')
|
window.vtoast.success('保存用户成功!')
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -544,8 +565,12 @@ Vue.component("create-task-drawer", {
|
|||||||
if(!n.properties.userIdList.length){
|
if(!n.properties.userIdList.length){
|
||||||
window.vtoast.fail("存在节点没有设置人员!")
|
window.vtoast.fail("存在节点没有设置人员!")
|
||||||
throw new Error("存在节点没有设置人员!")
|
throw new Error("存在节点没有设置人员!")
|
||||||
|
}else{
|
||||||
|
if(_.some(n.properties.userIdList, (user) => user.username.includes('(账号被禁用)'))){
|
||||||
|
window.vtoast.fail("存在节点中账号被禁用,请联系管理员修改!")
|
||||||
|
throw new Error("存在节点中账号被禁用,请联系管理员修改!")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
this.taskData.workflowForm.forEach(f => {
|
this.taskData.workflowForm.forEach(f => {
|
||||||
if(f.type == 'time' && !this.isValidDateTime(f.answer)){
|
if(f.type == 'time' && !this.isValidDateTime(f.answer)){
|
||||||
@@ -569,20 +594,27 @@ Vue.component("create-task-drawer", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
prepareDoWorkItem() {
|
prepareDoWorkItem() {
|
||||||
|
console.log();
|
||||||
const { workflowInfo, workflowForm, workflowConfig, workflowName, taskTemplateGroup, } = this.taskData
|
const { workflowInfo, workflowForm, workflowConfig, workflowName, taskTemplateGroup, } = this.taskData
|
||||||
var curNode = this.curWorkflow[0]
|
var startNode = this.curWorkflow[0]
|
||||||
var taskLineType = this.taskData.workflowConfig.lineList.filter(line => line.sourceNodeId == curNode.id)[0]?.properties.type
|
workflowConfig.nodeList.forEach(node => {
|
||||||
|
if(node.properties.userIdList){
|
||||||
|
node.properties.userIdList = node.properties.userIdList.map(u => u.userId)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var taskLineType = workflowConfig.lineList.filter(line => line.sourceNodeId == startNode.id)[0]?.properties.type
|
||||||
var taskViewUserList = this.curWorkflow.reduce((acc, cur) => acc.concat(cur.properties.userIdList), [] )
|
var taskViewUserList = this.curWorkflow.reduce((acc, cur) => acc.concat(cur.properties.userIdList), [] )
|
||||||
this.taskSubmitData = {
|
this.taskSubmitData = {
|
||||||
taskTitle: `<$ ctx.userInfo.username $>` + '的' + workflowName,
|
taskTitle: `<$ ctx.userInfo.username $>` + '的' + workflowName,
|
||||||
taskStatus: 'running',
|
taskStatus: 'running',
|
||||||
|
taskInfo: JSON.stringify(workflowInfo),
|
||||||
taskFormInput: JSON.stringify(workflowForm),
|
taskFormInput: JSON.stringify(workflowForm),
|
||||||
taskDefaultForm: JSON.stringify(this.defaultWorkflowForm),
|
taskDefaultForm: JSON.stringify(this.defaultWorkflowForm),
|
||||||
taskWorkflow: JSON.stringify(workflowConfig),
|
taskWorkflow: JSON.stringify(workflowConfig),
|
||||||
taskDefaultWorkflow: JSON.stringify(this.defaultWorkflowConfig),
|
taskDefaultWorkflow: JSON.stringify(this.defaultWorkflowConfig),
|
||||||
taskConfigId: curNode.id,
|
taskConfigId: startNode.id,
|
||||||
taskLineType: taskLineType,
|
taskLineType: taskLineType,
|
||||||
taskEditUserList: curNode.properties.userIdList.join(','),
|
taskEditUserList: startNode.properties.userIdList.join(','),
|
||||||
taskViewUserList: _.uniq(taskViewUserList).join(','),
|
taskViewUserList: _.uniq(taskViewUserList).join(','),
|
||||||
taskCreateAt: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
taskCreateAt: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
taskInitUser: `<$ ctx.userInfo.userId $>`,
|
taskInitUser: `<$ ctx.userInfo.userId $>`,
|
||||||
@@ -591,6 +623,7 @@ Vue.component("create-task-drawer", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async doCreateWork() {
|
async doCreateWork() {
|
||||||
|
this.isCreateWorkLoading = true
|
||||||
await window.jhMask.show();
|
await window.jhMask.show();
|
||||||
await window.jianghuAxios({
|
await window.jianghuAxios({
|
||||||
data: {
|
data: {
|
||||||
@@ -609,6 +642,7 @@ Vue.component("create-task-drawer", {
|
|||||||
})
|
})
|
||||||
await window.jhMask.hide();
|
await window.jhMask.hide();
|
||||||
await window.vtoast.success("申请成功");
|
await window.vtoast.success("申请成功");
|
||||||
|
this.isCreateWorkLoading = false
|
||||||
},
|
},
|
||||||
// -- <<<<<<<<<<<<< 新建任务 --------------------
|
// -- <<<<<<<<<<<<< 新建任务 --------------------
|
||||||
}
|
}
|
||||||
@@ -621,6 +655,7 @@ Vue.component("create-task-drawer", {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.node-box {
|
.node-box {
|
||||||
@@ -643,13 +678,18 @@ Vue.component("create-task-drawer", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.node-box .node-box-item .item-user-box {
|
.node-box .node-box-item .item-user-box {
|
||||||
width: 84px;
|
min-width: 60px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
background-color: rgb(242 243 243);
|
background-color: rgb(242 243 243);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item-user-box-error{
|
||||||
|
background-color: rgb(231, 75, 75) !important;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
.node-box-item .abb-user {
|
.node-box-item .abb-user {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
|
|||||||
Reference in new issue
Block a user