|
|
|
|
@ -2,8 +2,9 @@
|
|
|
|
|
<div>
|
|
|
|
|
<el-dialog
|
|
|
|
|
:title="title"
|
|
|
|
|
width="920px"
|
|
|
|
|
:visible.sync="visible"
|
|
|
|
|
fullscreen
|
|
|
|
|
:fullscreen="$store.getters.device === 'mobile'"
|
|
|
|
|
append-to-body
|
|
|
|
|
:show-close="false"
|
|
|
|
|
>
|
|
|
|
|
@ -29,7 +30,7 @@
|
|
|
|
|
<div class="next-nodes__label">下一节点</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<el-radio-group v-model="form.next_node_id">
|
|
|
|
|
<el-radio-group v-model="form.next_node_id" @change="pickUsers = node2Users.get(form.next_node_id)">
|
|
|
|
|
<el-radio v-for="node in node.nextNodes" :label="node.id">{{ node.name }}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</div>
|
|
|
|
|
@ -41,12 +42,17 @@
|
|
|
|
|
<div class="users__label">承办人员</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
<el-radio-group v-model="form.user_id">
|
|
|
|
|
<div v-for="group in pickUsers" :key="group.id">
|
|
|
|
|
<div class="group-name">{{ group.name }}</div>
|
|
|
|
|
<el-radio v-for="user in group.users" :label="user.id">{{ user.name }}</el-radio>
|
|
|
|
|
</div>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="$emit('update:visible',false)"
|
|
|
|
|
<el-button type="primary" @click="submit"
|
|
|
|
|
>确 定</el-button
|
|
|
|
|
>
|
|
|
|
|
</span>
|
|
|
|
|
@ -55,7 +61,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getNextNodeUsers } from "@/api/flow";
|
|
|
|
|
import { getNextNodeUsers, assign } from "@/api/flow";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
props: {
|
|
|
|
|
@ -78,21 +84,34 @@ export default {
|
|
|
|
|
next_node_id: "",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
node2Users: new Map()
|
|
|
|
|
node2Users: new Map(),
|
|
|
|
|
pickUsers: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getNextNodesUsers() {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
const res = await Promise.all(this.node?.nextNodes?.map(node => getNextNodeUsers({
|
|
|
|
|
const nodeIds = this.node?.nextNodes?.map(node => node.id);
|
|
|
|
|
const res = await Promise.all(nodeIds.map(nodeId => getNextNodeUsers({
|
|
|
|
|
id: this.result.id,
|
|
|
|
|
next_node_id: node.id,
|
|
|
|
|
next_node_id: nodeId,
|
|
|
|
|
},false)));
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
|
|
|
|
res.forEach((group, index) => {
|
|
|
|
|
this.node2Users.set(nodeIds[index], group.users)
|
|
|
|
|
})
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async submit() {
|
|
|
|
|
try {
|
|
|
|
|
await assign(this.result.id, this.form)
|
|
|
|
|
this.$router.push("/flow/list");
|
|
|
|
|
} catch(err) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
@ -104,14 +123,21 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
node: {
|
|
|
|
|
handler:function (newVal) {
|
|
|
|
|
if(newVal && newVal.nextNodes && newVal.nextNodes?.length > 0) {
|
|
|
|
|
// node: {
|
|
|
|
|
// handler:function (newVal) {
|
|
|
|
|
// if(newVal && newVal.nextNodes && newVal.nextNodes?.length > 0) {
|
|
|
|
|
// this.getNextNodesUsers()
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// immediate: true
|
|
|
|
|
// },
|
|
|
|
|
visible(newVal) {
|
|
|
|
|
if(newVal) {
|
|
|
|
|
if(this.node && this.node.nextNodes && this.node.nextNodes?.length > 0) {
|
|
|
|
|
this.getNextNodesUsers()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
immediate: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {}
|
|
|
|
|
};
|
|
|
|
|
@ -126,5 +152,15 @@ export default {
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #666;
|
|
|
|
|
}
|
|
|
|
|
.group-name {
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: #98a6ad;
|
|
|
|
|
line-height: 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.dialog-footer {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|