• ruoyi-nbcio-plus基于vue3的flowable修正加签与跳转的前端问题


    更多ruoyi-nbcio功能请看演示系统

    gitee源代码地址

    前后端代码: https://gitee.com/nbacheng/ruoyi-nbcio

    演示地址:RuoYi-Nbcio后台管理系统 http://122.227.135.243:9666/

    更多nbcio-boot功能请看演示系统 

    gitee源代码地址

    后端代码: https://gitee.com/nbacheng/nbcio-boot

    前端代码:https://gitee.com/nbacheng/nbcio-vue.git

    在线演示(包括H5) : http://122.227.135.243:9888

    1、后端增加一个接口

    1. /**
    2. * 查询用户列表,用于用户选择场景
    3. */
    4. @SaCheckLogin
    5. @GetMapping("/selectUser")
    6. public TableDataInfo selectUser(SysUserBo user, PageQuery pageQuery) {
    7. return userService.selectPageUserList(user, pageQuery);
    8. }

    2、WfIdentityMapper.xml最后增加一个d,否则多租户情况下会报错

    1. "1.0" encoding="UTF-8" ?>
    2. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
    3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
    4. "com.nbcio.workflow.mapper.WfIdentityMapper">

    3、跳转前端对话框代码修改如下

    1. <el-dialog :z-index="100" :title="jumpTitle" @cancel="jumpOpen = false"
    2. v-model="jumpOpen" :width="'40%'" append-to-body>
    3. <template #header>
    4. <span>跳转节点span>
    5. template>
    6. <el-form ref="jumpForm" :model="jumpForm" label-width="160px">
    7. <el-form-item label="跳转节点" prop="jumpType" :rules="[{ required: true, message: '请选择跳转节点', trigger: 'blur' }]">
    8. <a-table
    9. size="middle"
    10. :columns="jumpNodeColumns"
    11. :loading="jumpNodeLoading"
    12. :pagination="false"
    13. :dataSource="jumpNodeData"
    14. :rowKey="(record) => record.id"
    15. :rowSelection="rowSelection"
    16. />
    17. el-form-item>
    18. el-form>
    19. <template #footer>
    20. <span class="dialog-footer">
    21. <a-button type="primary" @click="jumpOpen = false">取 消a-button>
    22. <a-button type="primary" @click="jumpComplete(true)">确 定a-button>
    23. span>
    24. template>
    25. el-dialog>

    实际上就是变量重新命名了,其它也没什么变selectedJumpRows,同时//selectedRowKeys: selectedRowKeys,这个部分注释掉

    1. const jumpComplete = () => {
    2. if ( selectedJumpRows.value.length < 1 ) {
    3. proxy?.$modal.msgWarning('请选择跳转节点')
    4. return
    5. }
    6. // 流程信息
    7. jumpForm.taskId = route.query && route.query.taskId as string;;
    8. jumpForm.procInsId = route.params && route.params.procInsId as string;;
    9. //对formdesigner后续加签审批的时候需要用到
    10. jumpForm.comment = taskForm.comment;
    11. //目标选择的节点信息
    12. jumpForm.targetActId = selectedJumpRows.value[0].id;
    13. jumpForm.targetActName = selectedJumpRows.value[0].name;
    14. console.log("jumpForm=",jumpForm);
    15. jumpTask(jumpForm).then(res => {
    16. console.log(" jumpTask",res);
    17. if (res.code == 200) {
    18. proxy?.$modal.msgSuccess('跳转成功')
    19. jumpOpen.value = false;
    20. goBack();
    21. } else {
    22. proxy?.$modal.msgError('跳转失败:' + res.msg)
    23. }
    24. });

    4、加签前端对话框

    1. <el-dialog :z-index="100" title="addSignTitle" @cancel="addSignOpen = false"
    2. v-model="addSignOpen" :width="'40%'" append-to-body>
    3. <template #header>
    4. <span>{{ addSignTitle }}span>
    5. template>
    6. <el-form ref="addSignForm" :model="addSignForm" label-width="160px">
    7. <el-form-item label="加签类型" prop="addSignType" :rules="[{ required: true, message: '请选择加签类型', trigger: 'blur' }]">
    8. <el-radio-group v-model="addSignType" @change="changeAddSignType">
    9. <el-radio :value = "0" >前加签el-radio>
    10. <el-radio :value = "1" >后加签el-radio>
    11. <el-radio :value = "2" >多实例加签el-radio>
    12. el-radio-group>
    13. el-form-item>
    14. <el-form-item label="用户选择" prop="copyUserIds" :rules="[{ required: true, message: '请选择用户', trigger: 'blur' }]">
    15. <el-tag
    16. :key="index"
    17. v-for="(item, index) in addSignUser"
    18. closable
    19. :disable-transitions="false"
    20. @close="handleClose('next', item)">
    21. {{ item.nickName }}
    22. el-tag>
    23. <el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="small" circle @click="onSelectAddSignUsers" />
    24. el-form-item>
    25. el-form>
    26. <template #footer>
    27. <span class="dialog-footer">
    28. <el-button type="primary" @click="addSignOpen = false">取 消el-button>
    29. <el-button type="primary" @click="addSignComplete(true)">确 定el-button>
    30. span>
    31. template>
    32. el-dialog>

    主要问题也是  const addSignType = ref(0) //加签类型 不单独出来好像vue3操作有问题(vue2版本是放在addSignForm里),其它逻辑也没多大变化

    1. /** 加签 */
    2. const handleAddSign = () => {
    3. taskFormRef.value.validate(valid => {
    4. if (valid) {
    5. addSignType.value = 0;
    6. addSignTitle.value = "前加签流程";
    7. addSignOpen.value = true;
    8. console.log("handleAddSign addSignForm",addSignForm)
    9. }
    10. });
    11. }
    12. const changeAddSignType = (val) => {
    13. addSignType.value = val;
    14. if(addSignType.value === 0) {
    15. addSignTitle.value = "前加签流程";
    16. }
    17. if(addSignType.value === 1) {
    18. addSignTitle.value = "后加签流程";
    19. }
    20. if(addSignType.value === 2) {
    21. addSignTitle.value = "多实例加签流程";
    22. }
    23. }
    24. /** 加签任务 */
    25. const addSignComplete = () => {
    26. addSignForm.value.addSignUsers = taskForm.addSignUsers;
    27. addSignForm.value.addSignType = addSignType.value
    28. if (!addSignForm.value.addSignUsers ) {
    29. proxy?.$modal.msgError("请选择用户");
    30. return;
    31. }
    32. // 流程信息
    33. addSignForm.value.taskId = route.query && route.query.taskId as string;;
    34. addSignForm.value.procInsId = route.params && route.params.procInsId as string;;
    35. //对VForm3后续加签审批的时候需要用到
    36. addSignForm.value.comment = taskForm.comment;
    37. console.log("addSignForm=",addSignForm);
    38. if(addSignForm.value.addSignType === 2) {
    39. multiInstanceAddSignTask(addSignForm).then(response => {
    40. proxy?.$modal.msgSuccess(response.msg);
    41. addSignOpen.value = false;
    42. goBack();
    43. });
    44. }
    45. else {
    46. addSignTask(addSignForm.value).then(response => {
    47. proxy?.$modal.msgSuccess(response.msg);
    48. addSignOpen.value = false;
    49. goBack();
    50. });
    51. }
    52. }

    5、效果图如下:

  • 相关阅读:
    【星海随笔】数据结构知识总结
    ModStart : 宝塔配置MySQL队列调度
    UI设计软件有哪些好用和免费的吗?
    jupyter 基本用法
    OpenFOAM类库介绍(四)对流项
    强烈 推荐 13 个 Web前端在线代码IDE
    HDFS命令行示例
    VOL_常用记录!!-----后端
    Java之—hutool工具类二维码生成跟背景图合并输出
    13 结构性模式-装饰器模式
  • 原文地址:https://blog.csdn.net/qq_40032778/article/details/138190449