561224d0c6ea8767766a8114ce15c98e31b6a0d9..87acb007ca24a88652412d77b649199467b2a729
2025-07-09 李喆(开发组)
1
87acb0 对比 | 目录
2025-07-09 李喆(开发组)
1
5d33c3 对比 | 目录
2025-07-09 李喆(开发组)
1
f1134a 对比 | 目录
2025-07-09 李喆(开发组)
1
30fd6d 对比 | 目录
2025-07-09 李喆(开发组)
1
87f8f2 对比 | 目录
2025-07-09 李喆(开发组)
1
aea68e 对比 | 目录
2025-07-08 gaoshp
update
cf0f95 对比 | 目录
已修改3个文件
223 ■■■■ 文件已修改
src/api/flow/todolist.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flow/todolist.vue 124 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wel/index.vue 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/flow/todolist.js
@@ -1,7 +1,7 @@
/*
 * @Date: 2025-06-12 22:38:05
 * @LastEditors: gaoshp
 * @LastEditTime: 2025-07-01 23:38:48
 * @LastEditTime: 2025-07-08 23:52:49
 * @FilePath: /mdmweb/src/api/flow/todolist.js
 */
import request from '@/axios';
@@ -58,4 +58,12 @@
      id
    },
  })
}
export const reassgin = data => {
  return request({
    url: '/blade-mdm/flow/transferTask',
    method: 'post',
    params: data,
    data: {}
  })
}
src/views/flow/todolist.vue
@@ -2,7 +2,8 @@
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud"
            @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
            @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
            @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
            @selection-change="selectionTransferTask">
            <template #menu-left>
                <el-button type="primary" plain @click="reassign">重新指派
                </el-button>
@@ -13,21 +14,13 @@
                </el-button>
            </template>
        </avue-crud>
        <!-- <el-dialog title="审批" append-to-body v-model="approveBox" width="100%">
            <div class="approve-box">
                <div class="left">
                    <TodolistLeft :row="row"/>
                </div>
                <div class="right">
                    <TodolistRightTop :row="row" />
                    <avue-form ref="form" :option="optionApprove" v-model="formApprove" @submit="handleSubmit" />
                </div>
            </div>
        </el-dialog> -->
        <el-dialog title="指派" append-to-body v-model="reassignBox" width="30%">
            <avue-form ref="reassginform" :option="reassignOption" v-model="reassignForm" @submit="toPerson"></avue-form>
        </el-dialog>
        <el-drawer title="审批" append-to-body v-model="approveBox" size="100%" v-if="approveBox">
            <div class="approve-box">
                <div class="left">
                    <TodolistLeft :row="row" @selection-change="selectionChange"/>
                    <TodolistLeft :row="row" @selection-change="selectionChange" />
                </div>
                <div class="right">
                    <TodolistRightTop :row="row" />
@@ -39,7 +32,7 @@
</template>
<script>
import { getList, approve,getAssignee } from '@/api/flow/todolist';
import { getList, approve, getAssignee,reassgin } from '@/api/flow/todolist';
import { mapGetters } from 'vuex';
import dayjs from 'dayjs';
import TodolistLeft from './components/TodolistLeft.vue';
@@ -87,7 +80,7 @@
                        span: 24,
                        disabled: false,
                        dicData: [
                        ],
                        // rules: [{ required: true, message: '请选择下一审批用户', trigger: 'blur' }],
                    },
@@ -121,7 +114,7 @@
                // tree: true,
                border: true,
                index: true,
                // selection: true,
                selection: true,
                // viewBtn: true,
                menuWidth: 100,
                dialogClickModal: false,
@@ -154,7 +147,7 @@
                        width: 100,
                        prop: 'categoryName',
                    },
                    {
                        label: '机床',
                        width: 100,
@@ -212,6 +205,39 @@
                ],
            },
            data: [],
            transferTaskSelection: [],
            reassignBox: false,
            reassignOption: {
                submitBtn: true,
                emptyBtn: false,
                column: [
                    {
                        label: '发送给',
                        prop: 'newAssigneeId',
                        type: 'select',
                        // dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
                        // dicFlag: true,
                        props: {
                            label: 'name',
                            value: 'id',
                        },
                        span: 24,
                        disabled: false,
                        dicData: [
                        ],
                        rules: [{ required: true, message: '请输入选择', trigger: 'blur' }],
                    },
                    {
                        label: '备注',
                        span: 24,
                        prop: 'comment',
                        type: 'textarea',
                        rules: [{ required: true, message: '请输入审批意见', trigger: 'blur' }],
                    },
                ],
            },
            reassignForm: {}
        };
    },
    watch: {
@@ -247,12 +273,50 @@
        // },
    },
    mounted() {
        getAssignee().then(res=> {
        getAssignee().then(res => {
            this.assigneeData = res.data.data;
            this.optionApprove.column[1].dicData = this.assigneeData;
            this.reassignOption.column[0].dicData = this.assigneeData;
        })
    },
    methods: {
        selectionTransferTask(list) {
            this.transferTaskSelection = list;
        },
        reassign() {// 重新指派
            if (this.transferTaskSelection.length === 0) {
                this.$message.warning('请选择需要重新指派的任务');
                return;
            }
            if (this.transferTaskSelection.length > 1) {
                this.$message.warning('请选择一条');
                return;
            }
            this.reassignBox = true;
        },
        toPerson(form, done) {
            this.$confirm('请确认是否指派', '', {
                confirmButtonText: this.$t('submitText'),
                cancelButtonText: this.$t('cancelText'),
                type: 'warning',
            }).then(() => {
                console.log('toPerson', form);
                reassgin({
                    ...form,
                    taskId: this.transferTaskSelection[0].taskId,
                    processInstanceId: this.transferTaskSelection[0].processInstanceId,
                }).then(res => {
                    this.$message.success('指派成功');
                    this.reassignBox = false;
                    this.$refs?.reassginform?.resetForm();
                    this.onLoad(this.page, this.query);
                }).catch(err => {
                    console.error(err);
                })
            });
            done();
        },
        handleAction(row, index) {
            this.formApprove = {
                comment: '',
@@ -260,15 +324,15 @@
            }
            this.approveBox = true;
            this.row = row
            if(row.taskDefinitionKey=="check") {
            if (row.taskDefinitionKey == "check") {
                this.formApprove.assignee = row.variables.senior;
            } else if(row.taskDefinitionKey=="programmingTask") {
            } else if (row.taskDefinitionKey == "programmingTask") {
                this.formApprove.assignee = row.variables.checker;
            } else if(row.taskDefinitionKey=="teamLeaderTask") {
            } else if (row.taskDefinitionKey == "teamLeaderTask") {
                this.formApprove.assignee = row.variables.programmer
            } else if(row.taskDefinitionKey=="confirmIsUseableTask") {
            } else if (row.taskDefinitionKey == "confirmIsUseableTask") {
                this.formApprove.assignee = row.variables.checker
            } else if(row.taskDefinitionKey=="approveTask") {
            } else if (row.taskDefinitionKey == "approveTask") {
            }
            console.log('handleAction', row, index);
@@ -287,9 +351,6 @@
            }).catch(err => {
                console.error(err);
            });
        },
        reassign() {// 重新指派
        },
        searchChange(params, done) {
            let data = {}
@@ -338,7 +399,7 @@
            } catch (error) {
                console.error('日期格式化错误', error);
            }
            this.loading = true;
            getList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => {
                const data = res.data.data;
@@ -347,7 +408,7 @@
                this.loading = false;
            });
        },
        selectionChange (applist) {
        selectionChange(applist) {
            this.applist = applist
        },
    },
@@ -357,14 +418,17 @@
<style scoped="scoped" lang="scss">
.approve-box {
    display: flex;
    & > div {
    &>div {
        border: 1px solid #ccc;
    }
    .left {
        width: 400px;
    }
    .right {
        flex:1;
        flex: 1;
    }
}
</style>
src/views/wel/index.vue
@@ -27,8 +27,8 @@
        <el-button :size="size" text icon="el-icon-delete" type="primary" @click="showDel(row)" placeholder="删除" title="删除"></el-button>
        <el-button :size="size" text v-if="row.nodeType < 60" icon="el-icon-document-add" type="primary" @click="showAdd(row)" placeholder="新增子级" title="新增子级"></el-button>
        <el-button :size="size" text v-if="row.nodeType == 60" icon="el-icon-upload" type="primary" @click="showUpload(row)" placeholder="文件上传" title="文件上传"></el-button>
        <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="升级" title="升级"></el-button>
        <el-button :size="size" text v-if="row.nodeType == 60 && !isSM" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="下发" title="下发"></el-button>
        <el-button :size="size" text v-if="row.nodeType == 60" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="升级" title="升级"></el-button>
        <el-button :size="size" text v-if="row.nodeType == 70 && !isSM" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="下发" title="下发"></el-button>
      </template>
    </avue-crud>
    <!-- 新增节点 -->
@@ -36,7 +36,7 @@
      <avue-form :option="modalOption" v-model="modalForm" @submit="modalSubmit" @reset-change="modalCancel"/>
    </el-dialog>
    <el-dialog title="上传文件" append-to-body v-model="uploadmodalBox">
      <avue-form :option="uploadmodalOption" v-model="uploadmodalForm" @submit="uploadmodalSubmit" @reset-change="uploadmodalCancel" :upload-before="uploadBefore" :upload-after="uploadAfter"></avue-form>
      <avue-form :option="uploadmodalOption" v-model="uploadmodalForm" @submit="uploadmodalSubmit" @reset-change="uploadmodalCancel" :upload-before="uploadBefore" :upload-after="uploadAfter" ref="uploadRef"></avue-form>
    </el-dialog>
    <avue-tabs :option="tabsOption" @change="tabsHandleChange" style="margin-top: 30px;" v-if="isShowTabs"></avue-tabs>
      <avue-form v-if="tabsType == 'tab1'" :option="tabsFormOption" v-model="tabsForm"></avue-form>
@@ -56,6 +56,7 @@
export default {
  data() {
    return {
      file: null,
      fileContent: "",
      isSM: false,  //是否是涉密网 ,工控网5个,涉密网4个
      isShowTabs: true,
@@ -197,6 +198,11 @@
        total: 0,
      },
      option: {
        rowKey: "id",
        treeProps: {
          children: "children",
          hasChildren: 'hasChildren',
        },
        lazy: true,
        rowKey: 'id',
        addBtn: false,
@@ -224,7 +230,7 @@
          },
          {
            label: '类型',
            prop: 'nodeType'
            prop: 'nodeTypeName'
          },
          {
            label: '设备',
@@ -254,6 +260,7 @@
        ],
      },
      data: [],
      upData: []
    };
  },
  computed: {
@@ -317,6 +324,7 @@
            action: "",
            showFileList: false,
            span: 24,
            tip: "请上传文件,将在提交时统一处理",
            action: "/blade-mdm/program/ncfile/upload"
          },
          {
@@ -331,15 +339,21 @@
  },
  watch: {
    uploadmodalBox(old) {
      this.onLoad();
      //this.onLoad();
    }
  },
  methods: {
    downsend(row) {
    },
    uploadAfter() {
    downsend(row) {  //下发
      // this.loading = true;
      // axios({
      //   url: '/program/ncfile/send-to-machine-by-nodeid',
      //   method: 'get',
      //   params: {nodeId:id},
      // }).then(
      //   res => {
      //   }
      // );
    },
    upgrade(row) {  //升级
      this.loading = true;
@@ -369,8 +383,36 @@
      );
    },
    uploadBefore(file,done,loading,column) {
      done();
      //nodeId: this.tabsForm.id
      //done();
      this.file = file;
      return false;
    },
    uploadAfter() {
    },
    uploadmodalSubmit(row,done) {
      if(this.file == null) {
        this.$message.error('请上传文件');
        return;
      }
      var formData = new FormData();
      formData.append('file', this.file);
      formData.append('nodeId', this.id);
      Object.keys(this.uploadmodalForm).forEach(key => {
        formData.append(key, this.uploadmodalForm[key]);
      });
      this.loading = true;
      axios({
        url: '/blade-mdm/program/ncfile/upload',
        method: 'post',
        data: formData,
      }).then(
        res => {
          this.loading = false;
          this.uploadmodalBox = false;
          this.addLocalTreeNode(row.parentId);  //重新加载下一级
          done();
        }
      );
    },
    rowClick(row) {
      this.tabsForm = row;
@@ -412,11 +454,6 @@
          this.fileContent = res.data.data;
        }
      );
    },
    uploadmodalSubmit(row,done) {
      this.uploadmodalBox = false;
      this.addLocalTreeNode(row.parentId);  //重新加载下一级
      done();
    },
    rowDel(row, index, done) {
      done(row);
@@ -538,12 +575,19 @@
        return false;
      };
      updateTree(this.data);
      // this.upData = JSON.parse(JSON.stringify(this.data));
      // this.data = [];
      // 强制刷新
      this.$nextTick(() => {
        this.$refs.crud?.refreshTable();
        //this.$refs.crud.toggleRowExpansion('0', true);
        console.log(this.data,222)
        // this.data = this.upData;
        // this.option.defaultExpandAll = true;
      });
      // setTimeout(()=> {
      //   this.data = this.upData;
      //   this.option.defaultExpandAll = true;
      //   console.log(this.data,222)
      // },3000)
    },
    updateLocalTreeNode(nodeData) {   //修改的方法
      const updateNode = (nodes) => {
@@ -578,8 +622,8 @@
        params: obj,
      }).then(
        res => {
          resolve(res.data.data);
          this.loading = false;
          resolve(res.data.data);
        }
      );
    },
@@ -601,14 +645,17 @@
        params: obj,
      }).then(
        res => {
          this.loading = false;
          this.data = res.data.data;
          if(this.data.length == 0) {
            return;
          }
          this.tabsForm = res.data.data[0];  //节点信息
          this.nodeTypeList.forEach(item=> {
            if(item.dictKey == this.data[0].nodeType) {
              this.tabsForm.nodeTypeName = item.dictValue;
            }
          })
          this.loading = false;
        }
      );
    }