diff --git a/app/view/component/createTaskDrawer.html b/app/view/component/createTaskDrawer.html
index 5d2e2bd..0ea6789 100644
--- a/app/view/component/createTaskDrawer.html
+++ b/app/view/component/createTaskDrawer.html
@@ -39,17 +39,25 @@
-
-
-
{{ constantObj.userList.find(u => u.userId == userId)?.username || userId }}
-
mdi-close
+
+
+ {{ user.username }}
+
+ mdi-close
+
-
mdi-arrow-right-thin
-
+
+
+ 审批人为空
+
+
+
mdi-plus
@@ -67,8 +75,8 @@
- 提交
- 取消
+ 提交
+ 取消
@@ -92,7 +100,7 @@
@@ -149,7 +157,9 @@ Vue.component("create-task-drawer", {
taskSubmitData: null,
isAddNodeUserDialogShown: false,
addNodeUserIndex: -1,
- addNodeUserId: null
+ addNodeUserId: null,
+ selectedUser: [],
+ isCreateWorkLoading: false
}
},
computed: {
@@ -158,6 +168,9 @@ Vue.component("create-task-drawer", {
},
curWorkflow(){
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: {
@@ -325,6 +338,7 @@ Vue.component("create-task-drawer", {
num = u == '直属上级' ? 1 : u[1]
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;
case '指定部门负责人':
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
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;
case '指定标签':
node.properties.user.forEach(u =>{
let userIdList = this.constantObj.labelList.find(l => l.labelId == u)?.user.split(',')
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;
case '指定人员':
userList = node.properties.user
+ userList = userList.map(id => { return { userId: id, username: this.constantObj.userList.find(u => u.userId == id)?.username || id + '(账号被禁用)'}})
break;
case '申请人自选':
@@ -514,12 +531,16 @@ Vue.component("create-task-drawer", {
startAddNodeUser(nodeIndex){
this.addNodeUserIndex = nodeIndex
+ this.selectedUser = this.curWorkflow[nodeIndex].properties.userIdList.map(u => u.userId)
this.isAddNodeUserDialogShown = true
},
addNodeUser(){
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('保存用户成功!')
},
@@ -544,8 +565,12 @@ Vue.component("create-task-drawer", {
if(!n.properties.userIdList.length){
window.vtoast.fail("存在节点没有设置人员!")
throw new Error("存在节点没有设置人员!")
+ }else{
+ if(_.some(n.properties.userIdList, (user) => user.username.includes('(账号被禁用)'))){
+ window.vtoast.fail("存在节点中账号被禁用,请联系管理员修改!")
+ throw new Error("存在节点中账号被禁用,请联系管理员修改!")
+ }
}
-
})
this.taskData.workflowForm.forEach(f => {
if(f.type == 'time' && !this.isValidDateTime(f.answer)){
@@ -569,20 +594,27 @@ Vue.component("create-task-drawer", {
},
prepareDoWorkItem() {
+ console.log();
const { workflowInfo, workflowForm, workflowConfig, workflowName, taskTemplateGroup, } = this.taskData
- var curNode = this.curWorkflow[0]
- var taskLineType = this.taskData.workflowConfig.lineList.filter(line => line.sourceNodeId == curNode.id)[0]?.properties.type
+ var startNode = this.curWorkflow[0]
+ 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), [] )
this.taskSubmitData = {
taskTitle: `<$ ctx.userInfo.username $>` + '的' + workflowName,
taskStatus: 'running',
+ taskInfo: JSON.stringify(workflowInfo),
taskFormInput: JSON.stringify(workflowForm),
taskDefaultForm: JSON.stringify(this.defaultWorkflowForm),
taskWorkflow: JSON.stringify(workflowConfig),
taskDefaultWorkflow: JSON.stringify(this.defaultWorkflowConfig),
- taskConfigId: curNode.id,
+ taskConfigId: startNode.id,
taskLineType: taskLineType,
- taskEditUserList: curNode.properties.userIdList.join(','),
+ taskEditUserList: startNode.properties.userIdList.join(','),
taskViewUserList: _.uniq(taskViewUserList).join(','),
taskCreateAt: dayjs().format('YYYY-MM-DD HH:mm:ss'),
taskInitUser: `<$ ctx.userInfo.userId $>`,
@@ -591,6 +623,7 @@ Vue.component("create-task-drawer", {
},
async doCreateWork() {
+ this.isCreateWorkLoading = true
await window.jhMask.show();
await window.jianghuAxios({
data: {
@@ -609,6 +642,7 @@ Vue.component("create-task-drawer", {
})
await window.jhMask.hide();
await window.vtoast.success("申请成功");
+ this.isCreateWorkLoading = false
},
// -- <<<<<<<<<<<<< 新建任务 --------------------
}
@@ -621,6 +655,7 @@ Vue.component("create-task-drawer", {
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
+ word-wrap: break-word;
}
.node-box {
@@ -643,13 +678,18 @@ Vue.component("create-task-drawer", {
}
.node-box .node-box-item .item-user-box {
- width: 84px;
+ min-width: 60px;
height: 40px;
line-height: 40px;
background-color: rgb(242 243 243);
border-radius: 2px;
}
+.item-user-box-error{
+ background-color: rgb(231, 75, 75) !important;
+ color: white;
+}
+
.node-box-item .abb-user {
height: 40px;
width: 40px;