|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<el-dialog class="process-dialog" :visible.sync="cuDialogVisible" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body title="工作流选择"> |
|
|
|
<el-dialog class="process-dialog" :visible.sync="cuDialogVisible" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body title="工作流选择" :before-close="handleCloseDialog"> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<el-form ref="form" class="process-form" inline :model="form" :rules="rules" size="small" label-width="80px"> |
|
|
|
<div class="process-template"> |
|
|
@ -26,18 +26,18 @@ |
|
|
|
<div class="process-task"> |
|
|
|
<div class="task-tip">任务需指定执行岗位。当流程进行到该任务时,指定岗位下同一全宗的管理员可进入流程操作</div> |
|
|
|
<div class="task-list"> |
|
|
|
<div class="task-item"> |
|
|
|
<p>任务1:任务名称</p> |
|
|
|
<el-form-item label="执行岗位" prop="task01"> |
|
|
|
<el-select v-model="form.task01" @change="selectJob"> |
|
|
|
<el-option v-for="item in jobOptions" :key="item.value" :label="item.label" :value="item.label" /> |
|
|
|
<div v-for="(task,index) in taskList" :key="index" class="task-item"> |
|
|
|
<p>任务{{ index+1 }} :{{ task.nodeName }}</p> |
|
|
|
<el-form-item label="执行岗位" :prop="`task${index+1}`" :rules="dynamicRules(index)"> |
|
|
|
<el-select v-model="form[`task${index+1}`]" @change="selectJob($event,index)"> |
|
|
|
<el-option v-for="item in jobOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<div v-if="form.task01" class="detail-arrow" @click="isExpend = !isExpend"><i :class="['iconfont icon-xiala', isExpend ? 'arrow-up':'']" /></div> |
|
|
|
<div v-if="form[`task${index+1}`]" class="detail-arrow" @click="task.isExpend = !task.isExpend"><i :class="['iconfont icon-xiala', task.isExpend ? 'arrow-up':'']" /></div> |
|
|
|
<el-collapse-transition> |
|
|
|
<el-table v-if="isExpend" :data="userTableData" border style="width: 100%"> |
|
|
|
<el-table-column prop="fonds" label="全宗" align="center" /> |
|
|
|
<el-table-column prop="dept" label="部门" align="center" /> |
|
|
|
<el-table v-if="task.isExpend" :data="task.userTableData" border style="width: 100%"> |
|
|
|
<el-table-column prop="fondsName" label="全宗" align="center" /> |
|
|
|
<el-table-column prop="deptsName" label="部门" align="center" /> |
|
|
|
<el-table-column prop="username" label="用户名" align="center" /> |
|
|
|
</el-table> |
|
|
|
</el-collapse-transition> |
|
|
@ -46,7 +46,7 @@ |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="cuDialogVisible=false">取消</el-button> |
|
|
|
<el-button @click="handleCloseDialog">取消</el-button> |
|
|
|
<el-button type="primary" :loading="loading" @click="save">保存</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -54,8 +54,8 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { FetchInitFlowAll, FetchFindFolwImgByModelId } from '@/api/system/flowable' |
|
|
|
import { getAllJob } from '@/api/system/job' |
|
|
|
import { FetchInitFlowAll, FetchFindFolwImgByModelId, FetchUserTaskAllByDeployId } from '@/api/system/flowable' |
|
|
|
import { FetchPostAll, FetchFindUserByPost } from '@/api/system/job' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -63,9 +63,7 @@ export default { |
|
|
|
loading: false, |
|
|
|
loadingImg: false, |
|
|
|
form: { |
|
|
|
modelId: null, |
|
|
|
task01: null, |
|
|
|
task02: null |
|
|
|
modelId: null |
|
|
|
}, |
|
|
|
modelOptions: [], |
|
|
|
srcImg: '', |
|
|
@ -79,16 +77,21 @@ export default { |
|
|
|
rules: { |
|
|
|
modelId: [ |
|
|
|
{ required: true, message: '流程模板不可为空', trigger: 'change' } |
|
|
|
], |
|
|
|
task01: [ |
|
|
|
{ required: true, message: '执行岗位不可为空', trigger: 'change' } |
|
|
|
], |
|
|
|
task02: [ |
|
|
|
{ required: true, message: '执行岗位不可为空', trigger: 'change' } |
|
|
|
] |
|
|
|
}, |
|
|
|
isExpend: false, |
|
|
|
userTableData: [] |
|
|
|
userTableData: [], |
|
|
|
taskList: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
dynamicRules() { |
|
|
|
return (index) => { |
|
|
|
return [{ |
|
|
|
required: true, |
|
|
|
message: '执行岗位不可为空', |
|
|
|
trigger: 'change' |
|
|
|
}] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
@ -101,6 +104,7 @@ export default { |
|
|
|
this.modelOptions = res.map(item => { |
|
|
|
const json = {} |
|
|
|
json.procdefId = item.procdefId |
|
|
|
json.deployId = item.deployId |
|
|
|
json.value = item.modelKey |
|
|
|
json.label = item.deployName |
|
|
|
return json |
|
|
@ -117,10 +121,23 @@ export default { |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
console.log(val) |
|
|
|
FetchUserTaskAllByDeployId({ 'deployId': val.deployId }).then((res) => { |
|
|
|
this.taskList = res.map(item => { |
|
|
|
return { |
|
|
|
...item, |
|
|
|
isExpend: false, |
|
|
|
userTableData: [] |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(this.taskList) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
getAllJob() { |
|
|
|
getAllJob().then((res) => { |
|
|
|
this.jobOptions = res.content.map(item => { |
|
|
|
FetchPostAll().then((res) => { |
|
|
|
this.jobOptions = res.map(item => { |
|
|
|
const json = {} |
|
|
|
json.value = item.id |
|
|
|
json.label = item.postName |
|
|
@ -130,15 +147,32 @@ export default { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
selectJob(val, index) { |
|
|
|
FetchFindUserByPost({ 'postId': val }).then((res) => { |
|
|
|
this.taskList.forEach((item, i) => { |
|
|
|
if (index === i) { item.userTableData = res } |
|
|
|
}) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
save() { |
|
|
|
// this.loading = true |
|
|
|
this.$refs['form'].validate((valid) => { |
|
|
|
console.log(this.form) |
|
|
|
if (valid) { |
|
|
|
this.loading = true |
|
|
|
// this.loading = false |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleCloseDialog(done) { |
|
|
|
// 重置表单数据 |
|
|
|
this.$refs.form.resetFields() |
|
|
|
this.srcImg = '' |
|
|
|
this.taskList = [] |
|
|
|
this.cuDialogVisible = false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|