armg 1 éve
szülő
commit
b3f5155edf

+ 10 - 0
ruoyi-ui/src/api/flowable/definition.js

@@ -138,3 +138,13 @@ export function exportDeployment(query) {
     params: query
   })
 }
+
+
+// 查询最新流程版本
+export function selectByFlowKey(flowKey) {
+  return request({
+    url: '/flowable/definition/selectByFlowKey',
+    method: 'get',
+    params: { flowKey: flowKey }
+  })
+}

+ 40 - 0
ruoyi-ui/src/api/invest/meeting.js

@@ -42,3 +42,43 @@ export function delMeeting(id) {
     method: 'delete'
   })
 }
+
+
+// 新增打分
+export function addScoring(data) {
+  return request({
+    url: '/invest/scoring',
+    method: 'post',
+    data: data
+  })
+}
+
+// 获取打分详细信息
+export function getScoring(id) {
+  return request({
+    url: '/invest/scoring/' + id,
+    method: 'get'
+  })
+}
+
+
+// 根据会议ID查询是否打分和打分数据
+export function getCanScoringMeetingId(id) {
+  return request({
+    url: '/invest/scoring/getCanScoringMeetingId',
+    method: 'get',
+    params: {meetingId:id}
+    
+  })
+}
+
+// 根据会议ID查询汇总分数和平均分数
+export function selectMeetingId(id) {
+  return request({
+    url: '/invest/scoring/selectMeetingId',
+    method: 'get',
+    params: {meetingId:id}
+    
+  })
+}
+

+ 10 - 0
ruoyi-ui/src/assets/styles/public.scss

@@ -452,4 +452,14 @@
   border-color: #E4E7ED !important;
   color: #C0C4CC !important;
   pointer-events: none !important;
+}
+
+.custom-blue-color {
+  color: #1890ff !important;
+}
+.custom-red-color {
+  color: #fd0e0e !important;
+}
+.custom-orange-color {
+  color: orange !important;
 }

+ 1 - 1
ruoyi-ui/src/components/flow/User/index.vue

@@ -21,7 +21,7 @@
             :filter-node-method="filterNode"
             ref="tree"
             node-key="id"
-            default-expand-all
+            :default-expand-all="false"
             highlight-current
             @node-click="handleNodeClick"
           />

+ 6 - 6
ruoyi-ui/src/layout/components/Navbar.vue

@@ -9,19 +9,19 @@
       <template v-if="device!=='mobile'">
         <search id="header-search" class="right-menu-item" />
         
-        <el-tooltip content="源码地址" effect="dark" placement="bottom">
+        <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
           <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
-        </el-tooltip>
+        </el-tooltip> -->
 
-        <el-tooltip content="文档地址" effect="dark" placement="bottom">
+        <!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">
           <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
-        </el-tooltip>
+        </el-tooltip> -->
 
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
 
-        <el-tooltip content="布局大小" effect="dark" placement="bottom">
+        <!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">
           <size-select id="size-select" class="right-menu-item hover-effect" />
-        </el-tooltip>
+        </el-tooltip> -->
 
       </template>
 

+ 6 - 0
ruoyi-ui/src/router/index.js

@@ -90,6 +90,12 @@ export const constantRoutes = [
         name: 'investPoolDetail',
         meta: { title: '项目详情' }
       },
+      {
+        path: "pool/surveyForm",
+        name: 'investPoolSurveyForm',
+        component: () => import('@/views/invest/pool/surveyForm'),
+        meta: { title: '调查数据' }
+      },
       // {
       //   path: "record/index",
       //   name: 'investRecordIndex',

+ 1 - 0
ruoyi-ui/src/store/getters.js

@@ -16,6 +16,7 @@ const getters = {
   dept: state => state.user.dept,
   dhrmCompany: state => state.user.dhrmCompany,
   projectItemMessage:state => state.user.projectItemMessage,
+  tProjectScoring:state => state.user.tProjectScoring,
   permission_routes: state => state.permission.routes,
   topbarRouters:state => state.permission.topbarRouters,
   defaultRoutes:state => state.permission.defaultRoutes,

+ 5 - 1
ruoyi-ui/src/store/modules/user.js

@@ -11,7 +11,8 @@ const user = {
     user: {},
     dept: {},
     dhrmCompany: {},
-    projectItemMessage:{}
+    projectItemMessage: {},
+    tProjectScoring: {}
   },
 
   mutations: {
@@ -42,6 +43,9 @@ const user = {
     SET_PROJECTITEMMESSAGE: (state, projectItemMessage) => {
       state.projectItemMessage = projectItemMessage
     },
+    SET_TPROJECTSCORING: (state, tProjectScoring) => {
+      state.tProjectScoring = tProjectScoring
+    },
   },
 
   actions: {

+ 1 - 0
ruoyi-ui/src/views/invest/channel/index.vue

@@ -171,6 +171,7 @@
             >修改</el-button
           >
           <el-button
+            class="custom-red-color"
             size="mini"
             type="text"
             icon="el-icon-delete"

+ 1 - 0
ruoyi-ui/src/views/invest/company/index.vue

@@ -119,6 +119,7 @@
             v-hasPermi="['invest:company:edit']"
           >修改</el-button>
           <el-button
+            class="custom-red-color"
             size="mini"
             type="text"
             icon="el-icon-delete"

+ 1 - 0
ruoyi-ui/src/views/invest/components/contractList.vue

@@ -152,6 +152,7 @@
             >修改</el-button
           >
           <el-button
+            class="custom-red-color"
             size="mini"
             type="text"
             icon="el-icon-delete"

+ 1 - 0
ruoyi-ui/src/views/invest/components/fileList.vue

@@ -143,6 +143,7 @@
             >修改</el-button
           >
           <el-button
+            class="custom-red-color"
             size="mini"
             type="text"
             icon="el-icon-delete"

+ 1 - 0
ruoyi-ui/src/views/invest/components/followList.vue

@@ -169,6 +169,7 @@
             >修改</el-button
           >
           <el-button
+            class="custom-red-color"
             size="mini"
             type="text"
             icon="el-icon-delete"

+ 200 - 24
ruoyi-ui/src/views/invest/components/meetingList.vue

@@ -163,28 +163,16 @@
       </el-table-column>
       <el-table-column label="会议地点" align="center" prop="place" />
       <el-table-column label="会议发起人" align="center" prop="promoter" />
+      <el-table-column label="会议参与人" align="center" prop="participants" />
       <el-table-column label="创建人" align="center" prop="createBy" />
       <el-table-column label="创建时间" align="center" prop="createTime" />
       <el-table-column
         label="操作"
         align="center"
         class-name="small-padding fixed-width"
+        width="120"
       >
         <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-document-remove"
-            @click="handleMark(scope.row, '1')"
-            >去打分</el-button
-          >
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-search"
-            @click="handleLookMark(scope.row, '2')"
-            >查看打分表</el-button
-          >
           <el-button
             size="mini"
             type="text"
@@ -194,6 +182,7 @@
             >修改</el-button
           >
           <el-button
+            class="custom-red-color"
             size="mini"
             type="text"
             icon="el-icon-delete"
@@ -201,6 +190,61 @@
             v-hasPermi="['invest:meeting:remove']"
             >删除</el-button
           >
+
+          <el-dropdown
+            trigger="click"
+            @command="handleCommand($event, scope.row)"
+          >
+            <span class="el-dropdown-link" @click="getButtonItem(scope.row)">
+              <el-button size="mini" type="text" icon="el-icon-d-arrow-right"
+                >更多</el-button
+              >
+            </span>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item
+                v-if="!showLookMark && showMarkBtn"
+                command="1"
+                icon="el-icon-document-remove"
+                @click="handleMark(scope.row, '1', false)"
+                >去打分</el-dropdown-item
+              >
+              <el-dropdown-item
+                v-if="showLookMark && showMarkBtn"
+                icon="el-icon-search"
+                command="2"
+                @click="handleMark(scope.row, '1', true)"
+                >查看打分表</el-dropdown-item
+              >
+              <el-dropdown-item
+                v-if="isInitiator"
+                icon="el-icon-search"
+                command="3"
+                @click="handleLookMark(scope.row, '2', true)"
+                >查看打分汇总表</el-dropdown-item
+              >
+            </el-dropdown-menu>
+          </el-dropdown>
+          <!-- <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-document-remove"
+            @click="handleMark(scope.row, '1',false)"
+            >去打分</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-search"
+            @click="handleMark(scope.row, '1',true)"
+            >查看打分表</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-search"
+            @click="handleLookMark(scope.row, '2',true)"
+            >查看打分汇总表</el-button
+          > -->
         </template>
       </el-table-column>
     </el-table>
@@ -290,23 +334,35 @@
         </el-form-item> -->
         <el-form-item label="会议开始时间" prop="startTime">
           <el-date-picker
+            v-model="form.startTime"
+            type="datetime"
+            placeholder="请选择会议开始时间"
+          >
+          </el-date-picker>
+          <!-- <el-date-picker
             clearable
             v-model="form.startTime"
             type="date"
             value-format="yyyy-MM-dd"
             placeholder="请选择会议开始时间"
           >
-          </el-date-picker>
+          </el-date-picker> -->
         </el-form-item>
         <el-form-item label="会议结束时间" prop="endTime">
           <el-date-picker
+            v-model="form.endTime"
+            type="datetime"
+            placeholder="请选择会议结束时间"
+          >
+          </el-date-picker>
+          <!-- <el-date-picker
             clearable
             v-model="form.endTime"
             type="date"
             value-format="yyyy-MM-dd"
             placeholder="请选择会议结束时间"
           >
-          </el-date-picker>
+          </el-date-picker> -->
         </el-form-item>
         <el-form-item label="会议地点" prop="place">
           <el-input v-model="form.place" placeholder="请输入会议地点" />
@@ -327,16 +383,17 @@
         <el-form-item label="会议参与人" prop="participants">
           <div
             class="el-input__inner inputSimulation"
-            @click="openSelectDept(2)"
+            @click="userVisible = true"
           >
+            <!-- @click="openSelectDept(2)" -->
             {{ form.participants ? form.participants : "请选择会议参与人" }}
           </div>
-          <selecDept
+          <!-- <selecDept
             ref="selecDepts1"
             @getDeptMoreUserInfo="getDeptMoreUserInfo"
             :deptId="deptId"
             :isSolo="false"
-          ></selecDept>
+          ></selecDept> -->
         </el-form-item>
         <el-form-item label="附件" prop="file">
           <fileItem
@@ -351,6 +408,23 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <!--选择人员-->
+    <el-dialog
+      title="选择人员"
+      :visible.sync="userVisible"
+      width="60%"
+      :show-close="false"
+    >
+      <flow-user
+        :checkType="checkType"
+        :selectValues="selectValues"
+        @handleUserSelect="handleUserSelect"
+      ></flow-user>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="userVisible = false">取 消</el-button>
+        <el-button type="primary" @click="checkUserComplete">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -361,10 +435,12 @@ import {
   delMeeting,
   addMeeting,
   updateMeeting,
+  getCanScoringMeetingId,
 } from "@/api/invest/meeting";
 import projectItem from "./projectItem";
 import fileItem from "./fileItem";
 import selecDept from "./selecDept";
+import FlowUser from "@/components/flow/User";
 
 export default {
   props: {
@@ -377,7 +453,7 @@ export default {
     },
   },
   dicts: ["meeting_type", "project_stage", "project_group"],
-  components: { projectItem, selecDept, fileItem },
+  components: { projectItem, selecDept, fileItem, FlowUser },
   watch: {
     "form.meetingType": function (newValue, oldValue) {
       // console.log(newValue,"this.form.meetingType", this.form.meetingType);
@@ -397,6 +473,11 @@ export default {
   },
   data() {
     return {
+      // 人员选择器
+      checkType: "multiple",
+      // 数据回显
+      selectValues: null,
+      userVisible: false,
       pageType: null,
       meetingType: null,
       verifyProjectName: false,
@@ -445,7 +526,9 @@ export default {
         endTime: null,
         place: null,
         promoter: null,
+        promoterId: null,
         participants: null,
+        participantsId: null,
         delFlag: null,
         createBy: null,
         createTime: null,
@@ -465,9 +548,18 @@ export default {
         promoter: [{ required: true, trigger: "blur", message: "请选择" }],
         participants: [{ required: true, trigger: "blur", message: "请选择" }],
       },
+      user: {
+        userId: null,
+        nickName: null,
+      },
+      isInitiator: false, //是否是发起人
+      showLookMark: false, //是否查看打分表
+      showMarkBtn: false,
     };
   },
   created() {
+    this.user = this.$store.getters.user;
+    this.user.userId = this.user.userId.toString();
     // 查询该id下的列表信息
     if (this.$route.query.id) {
       this.queryParams.projectPoolId = this.$route.query.id;
@@ -487,11 +579,75 @@ export default {
     this.getList();
   },
   methods: {
+    /*用户选中赋值*/
+    checkUserComplete() {
+      this.userVisible = false;
+      this.checkType = "";
+    },
+    // 用户选中数据
+    handleUserSelect(selection) {
+      const that = this;
+      if (selection) {
+        if (selection instanceof Array) {
+          const userIds = selection.map((item) => item.userId);
+          const nickName = selection.map((item) => item.nickName);
+          this.form.participants = nickName.join(",");
+          this.form.participantsId = userIds.join(",");
+        } else {
+          this.form.participants = selection.nickName;
+          this.form.participantsId = selection.userId;
+        }
+      }
+    },
+    getButtonItem(row) {
+      this.showMarkBtn = false;
+      // 是否是发起人
+      this.isInitiator = row.promoterId == this.user.userId;
+      // 参与人数组
+      let participantsIdList = row.participantsId.split(",");
+      // console.log("是否是发起人",this.isInitiator)
+      // console.log("参与人数组",participantsIdList,"this.user.userId=",this.user.userId,participantsIdList.indexOf(this.user.userId) > -1)
+      if (this.isInitiator) {
+        // 参与人里面包含发起人
+        if (participantsIdList.indexOf(this.user.userId) > -1) {
+          this.showMarkBtn = true;
+        }
+      } else {
+        this.showMarkBtn = true;
+      }
+      // console.log("this.showMarkBtn=",this.showMarkBtn)
+      getCanScoringMeetingId(row.id).then((response) => {
+        // 查看打分
+        if (response.tProjectScoring) {
+          this.showLookMark = true;
+          this.$store.commit("SET_TPROJECTSCORING", response.tProjectScoring);
+        } else {
+          // 去打分
+          this.showLookMark = false;
+        }
+      });
+    },
+    // getCanScoringMeetingId
+    handleCommand(command, row) {
+      // console.log("handleCommand", command);
+      // console.log("row", row);
+      let type = "1",
+        readonly = true;
+      if (command === "1") {
+        readonly = false;
+      }
+      if (command === "3") {
+        type = "2";
+      }
+      this.handleMark(row, type, readonly);
+    },
     // 去打分
-    handleMark(row, type) {
+    handleMark(row, type, readonly) {
+      console.log("000000000");
+
       this.$router.push({
         path: "/invest/meeting/mark",
-        query: { id: row.id, formType: type },
+        query: { id: row.id, formType: type, readonly: readonly },
       });
     },
     // 查看打分表
@@ -504,22 +660,27 @@ export default {
     // 选择部门人
     openSelectDept(type) {
       if (type == 2) {
-        this.$refs.selecDepts1.show(type);
+        // this.$refs.selecDepts1.show(type);
       } else {
         this.$refs.selecDepts.show(type);
       }
     },
     getDeptUserInfo(info) {
       this.form.promoter = info[0].nickName;
+      this.form.promoterId = info[0].userId.toString();
     },
     // 多选人
     getDeptMoreUserInfo(info) {
-      let peoList = [];
+      let peoList = [],
+        peoIdList = [];
       for (let i in info) {
         peoList.push(info[i].nickName);
+        peoIdList.push(info[i].userId.toString());
       }
       let peopleStr = peoList.join(",");
+      let peopleIdStr = peoIdList.join(",");
       this.form.participants = peopleStr;
+      this.form.participantsId = peopleIdStr;
     },
     // 获取fileList
     getFileList(fileList) {
@@ -566,7 +727,9 @@ export default {
         endTime: null,
         place: null,
         promoter: null,
+        promoterId: null,
         participants: null,
+        participantsId: null,
         delFlag: null,
         createBy: null,
         createTime: null,
@@ -633,6 +796,19 @@ export default {
     submitForm() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          if (
+            new Date(this.form.endTime).getTime() <
+            new Date(this.form.startTime).getTime()
+          ) {
+            this.$confirm("会议结束时间不能小于开始时间,请重新选择!", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
+            })
+              .then(() => {})
+              .catch(() => {});
+            return false;
+          }
           this.form.listFile = this.fileList;
           if (this.form.id != null) {
             updateMeeting(this.form).then((response) => {

+ 39 - 10
ruoyi-ui/src/views/invest/components/projectList.vue

@@ -371,6 +371,7 @@
         <template slot-scope="scope">
           <!-- stage//0=全部 1=项目报备  2=评估考察 3=项目立项 4=尽职背调 5=项目投决 -->
           <el-button
+            class="custom-orange-color"
             v-if="stage == '1'"
             size="mini"
             type="text"
@@ -379,6 +380,7 @@
             >上传跟进记录</el-button
           >
           <el-button
+            class="custom-orange-color"
             v-if="stage == '3'"
             size="mini"
             type="text"
@@ -386,8 +388,9 @@
             @click="handleMeeting(scope.row, 'LX')"
             >发起立项会议</el-button
           >
-         
+
           <el-button
+            class="custom-orange-color"
             v-if="stage == '4'"
             size="mini"
             type="text"
@@ -396,6 +399,7 @@
             >发起尽调申请</el-button
           >
           <el-button
+            class="custom-orange-color"
             v-if="stage == '5'"
             size="mini"
             type="text"
@@ -406,11 +410,11 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-search"
-            @click="handleDetail(scope.row)"
-            v-hasPermi="['invest:pool:query']"
-            >查看</el-button
+            icon="el-icon-setting"
+            @click="handleBusinessUpdate(scope.row)"
+            >设置项目阶段</el-button
           >
+
           <el-button
             size="mini"
             type="text"
@@ -420,14 +424,17 @@
             >修改</el-button
           >
           <el-button
+            class="custom-blue-color"
             size="mini"
             type="text"
-            icon="el-icon-setting"
-            @click="handleBusinessUpdate(scope.row)"
-            >设置项目阶段</el-button
+            icon="el-icon-search"
+            @click="handleDetail(scope.row)"
+            v-hasPermi="['invest:pool:query']"
+            >详情</el-button
           >
 
           <el-button
+            class="custom-red-color"
             size="mini"
             type="text"
             icon="el-icon-switch-button"
@@ -488,7 +495,7 @@ import {
   updatePool,
   editStage,
 } from "@/api/invest/pool";
-
+import { selectByFlowKey } from "@/api/flowable/definition";
 import { listChannel } from "@/api/invest/channel";
 export default {
   props: {
@@ -641,6 +648,11 @@ export default {
         stageName: "",
       },
       channelList: [],
+      // 尽职调查表单
+      surveyForm: {
+        deploymentId: null,
+        id: null,
+      },
     };
   },
   mounted() {
@@ -648,6 +660,12 @@ export default {
     if (this.stage != "0") {
       this.queryParams.projectStage = this.stage;
     }
+    // 背调
+    if (this.stage == "4") {
+      selectByFlowKey("flow_4aimqsfe").then((response) => {
+        this.surveyForm = response.data;
+      });
+    }
     if (this.projectId) {
       this.queryParams.id = this.projectId;
     }
@@ -734,7 +752,15 @@ export default {
       });
     },
     // 发起尽调申请
-    handleSurvey(row) {},
+    handleSurvey(row) {
+      this.$router.push({
+        path: "/invest/pool/surveyForm",
+        query: {
+          deployId: this.surveyForm.deploymentId,
+          procDefId: this.surveyForm.id,
+        },
+      });
+    },
 
     // 上传跟进记录
     handlefollowRecord(row) {
@@ -799,3 +825,6 @@ export default {
   },
 };
 </script>
+<style lang="scss" scoped>
+
+</style>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1189 - 210
ruoyi-ui/src/views/invest/components/tableForm.vue


+ 9 - 5
ruoyi-ui/src/views/invest/meeting/mark.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <tableForm  :formType="formType" :id="id"></tableForm>
+    <tableForm :formType="formType" :id="id" :readonly="readonly"></tableForm>
   </div>
 </template>
 <script>
@@ -9,13 +9,17 @@ export default {
   components: { tableForm },
   data() {
     return {
-      id:"",
-      formType:null
+      id: "",
+      formType: null,
+      readonly: false,
     };
   },
-  created(){
+  created() {
     this.id = this.$route.query.id;
     this.formType = parseInt(this.$route.query.formType);
-  }
+    let readonly = this.$route.query.readonly;
+    this.readonly = readonly === "true" ? true : false;
+    console.log("this.readonly=", this.readonly);
+  },
 };
 </script>

+ 260 - 0
ruoyi-ui/src/views/invest/pool/surveyForm.vue

@@ -0,0 +1,260 @@
+<template>
+  <div class="app-container">
+    
+  </div>
+</template>
+
+<script>
+import Parser from '@/components/parser/Parser'
+import {definitionStart, flowXmlAndNode} from "@/api/flowable/definition";
+import flow from '../../flowable/task/myProcess/send/flow'
+import {flowFormData} from "@/api/flowable/process";
+import {getNextFlowNodeByStart} from "@/api/flowable/todo";
+import FlowUser from '@/components/flow/User'
+import FlowRole from '@/components/flow/Role'
+
+export default {
+  name: "investPoolSurveyForm",
+  components: {
+    Parser,
+    flow,
+    FlowUser,
+    FlowRole,
+  },
+  props: {},
+  data() {
+    return {
+      // 模型xml数据
+      flowData: {},
+      activeName: '1', // 切换tab标签
+      defaultProps: {
+        children: "children",
+        label: "label"
+      },
+      // 查询参数
+      queryParams: {
+        deptId: undefined
+      },
+      // 遮罩层
+      loading: true,
+      deployId: "",  // 流程定义编号
+      procDefId: "",  // 流程实例编号
+      formConf: {}, // 默认表单数据
+      variables: [], // 流程变量数据
+      taskTitle: null,
+      taskOpen: false,
+      checkSendUser: false, // 是否展示人员选择模块
+      checkSendRole: false,// 是否展示角色选择模块
+      checkType: '', // 选择类型
+      checkValues: null, // 选中任务接收人员数据
+      formData: {}, // 填写的表单数据,
+      multiInstanceVars: '' // 会签节点
+    };
+  },
+  created() {
+    this.deployId = this.$route.query && this.$route.query.deployId;
+    // 初始化表单
+    this.procDefId  = this.$route.query && this.$route.query.procDefId;
+    // this.getNextFlowNodeByStart(this.deployId);
+    this.getFlowFormData(this.deployId);
+  },
+  methods: {
+    handleClick(tab, event) {
+      if (tab.name === '2'){
+        flowXmlAndNode({deployId:this.deployId}).then(res => {
+          this.flowData = res.data;
+        })
+      }
+    },
+    /** 流程表单数据 */
+    getFlowFormData(deployId) {
+      const that = this
+      const params = {deployId: deployId}
+      flowFormData(params).then(res => {
+        // 流程过程中不存在初始化表单 直接读取的流程变量中存储的表单值
+          that.formConf = res.data;
+      }).catch(res => {
+        this.goBack();
+      })
+    },
+    /** 返回页面 */
+    goBack() {
+      // 关闭当前标签页并返回上个页面
+      const obj = { path: "/task/process", query: { t: Date.now()} };
+      this.$tab.closeOpenPage(obj);
+    },
+    /** 接收子组件传的值 */
+    getData(data) {
+      if (data) {
+        const variables = [];
+        data.fields.forEach(item => {
+          let variableData = {};
+          variableData.label = item.__config__.label
+          // 表单值为多个选项时
+          if (item.__config__.defaultValue instanceof Array) {
+            const array = [];
+            item.__config__.defaultValue.forEach(val => {
+              array.push(val)
+            })
+            variableData.val = array;
+          } else {
+            variableData.val = item.__config__.defaultValue
+          }
+          variables.push(variableData)
+        })
+        this.variables = variables;
+      }
+    },
+    /** 申请流程表单数据提交 */
+    submitForm(formData) {
+      // 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况
+      getNextFlowNodeByStart({deploymentId: this.deployId,variables:formData.valData}).then(res => {
+        const data = res.data;
+        if (data) {
+          this.formData = formData;
+          if (data.dataType === 'dynamic') {
+            if (data.type === 'assignee') { // 指定人员
+              this.checkSendUser = true;
+              this.checkType = "single";
+            } else if (data.type === 'candidateUsers') {  // 候选人员(多个)
+              this.checkSendUser = true;
+              this.checkType = "multiple";
+            } else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
+              this.checkSendRole = true;
+            } else { // 会签
+              // 流程设计指定的 elementVariable 作为会签人员列表
+              this.multiInstanceVars = data.vars;
+              this.checkSendUser = true;
+              this.checkType = "multiple";
+            }
+            this.taskOpen = true;
+            this.taskTitle = "选择任务接收";
+          } else {
+            const variables = this.formData.valData;
+            const formData = this.formData.formData;
+            formData.disabled = true;
+            formData.formBtns = false;
+            if (this.procDefId) {
+              variables.variables = formData;
+              // 启动流程并将表单数据加入流程变量
+              definitionStart(this.procDefId, JSON.stringify(variables)).then(res => {
+                this.$modal.msgSuccess(res.msg);
+                this.goBack();
+              })
+            }
+          }
+        }
+      })
+    },
+    /** 提交流程 */
+    submitTask() {
+      if (!this.checkValues && this.checkSendUser){
+        this.$modal.msgError("请选择任务接收!");
+        return;
+      }
+      if (!this.checkValues && this.checkSendRole){
+        this.$modal.msgError("请选择流程接收角色组!");
+        return;
+      }
+      if (this.formData) {
+        const variables = this.formData.valData;
+        const formData = this.formData.formData;
+        // 表单是否禁用
+        formData.disabled = true;
+        // 是否显示按钮
+        formData.formBtns = false;
+        variables.variables = formData;
+        if (this.multiInstanceVars) {
+          this.$set(variables, this.multiInstanceVars, this.checkValues);
+        } else {
+          this.$set(variables, "approval", this.checkValues);
+        }
+        console.log(variables,"流程发起提交表单数据")
+        // 启动流程并将表单数据加入流程变量
+        definitionStart(this.procDefId, JSON.stringify(variables)).then(res => {
+          this.$modal.msgSuccess(res.msg);
+          this.goBack();
+        })
+      }
+    },
+    /** 根据当前任务获取流程设计配置的下一步节点 */
+    getNextFlowNodeByStart(deploymentId,variables) {
+      // 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况
+      getNextFlowNodeByStart({deploymentId: deploymentId,variables:variables}).then(res => {
+        const data = res.data;
+        if (data) {
+          if (data.type === 'assignee') { // 指定人员
+            this.checkSendUser = true;
+            this.checkType = "single";
+          } else if (data.type === 'candidateUsers') {  // 候选人员(多个)
+            this.checkSendUser = true;
+            this.checkType = "multiple";
+          } else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
+            this.checkSendRole = true;
+          } else if (data.type === 'multiInstance') { // 会签?
+            // 流程设计指定的 elementVariable 作为会签人员列表
+            this.multiInstanceVars = data.vars;
+            this.checkSendUser = true;
+            this.checkType = "multiple";
+          }
+        }
+      })
+    },
+    // 用户信息选中数据
+    handleUserSelect(selection) {
+      if (selection) {
+        if (selection instanceof Array) {
+          const selectVal = selection.map(item => item.userId);
+          if (this.multiInstanceVars) {
+            this.checkValues = selectVal;
+          } else {
+            this.checkValues = selectVal.join(',');
+          }
+        } else {
+          this.checkValues = selection.userId;
+        }
+      }
+    },
+    // 角色信息选中数据
+    handleRoleSelect(selection) {
+      if (selection) {
+        if (selection instanceof Array) {
+          const selectVal = selection.map(item => item.roleId);
+          this.checkValues = selectVal.join(',')
+        } else {
+          this.checkValues = selection;
+        }
+      }
+    },
+  }
+};
+</script>
+<style lang="scss" scoped>
+.test-form {
+  margin: 15px auto;
+  width: 800px;
+  padding: 15px;
+}
+
+.clearfix:before,
+.clearfix:after {
+  display: table;
+  content: "";
+}
+.clearfix:after {
+  clear: both
+}
+
+.box-card {
+  width: 100%;
+  margin-bottom: 20px;
+}
+
+.el-tag + .el-tag {
+  margin-left: 10px;
+}
+
+.my-label {
+  background: #E1F3D8;
+}
+</style>

+ 1 - 0
ruoyi-ui/src/views/study/gen/index.vue

@@ -137,6 +137,7 @@
             >修改</el-button
           >
           <el-button
+            class="custom-red-color"
             size="mini"
             type="text"
             icon="el-icon-delete"