Z 1 rok temu
rodzic
commit
9020db093f

+ 40 - 34
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -141,16 +141,14 @@
         v-if="active == 0"
         @click="() => (active = 1)"
       >下一步
-      </el-button
-      >
+      </el-button>
       <el-button
         type="primary"
         size="small"
         v-if="active == 1"
         @click="() => (active = 0)"
       >上一步
-      </el-button
-      >
+      </el-button>
       <el-button type="primary" size="small" @click="submit">完成</el-button>
       <el-button size="small" @click="cancel">关闭</el-button>
     </div>
@@ -166,11 +164,11 @@ import {
   listAllUserBind,
   listSimpleUserGroups
 } from './api';
-import {treeClassifyCodeEnum} from '@/enum/dict';
-import {listRoles} from '@/api/system/role';
-import {listOrganizations} from '@/api/system/organization';
+import { treeClassifyCodeEnum } from '@/enum/dict';
+import { listRoles } from '@/api/system/role';
+import { listOrganizations } from '@/api/system/organization';
 import dictMixins from '@/mixins/dictMixins';
-import {getByCode} from '@/api/system/dictionary-data';
+import { getByCode } from '@/api/system/dictionary-data';
 import {getProduceTreeByCode} from "@/api/main";
 
 export default {
@@ -180,7 +178,7 @@ export default {
     processSubmitDialogFlag: {
       type: Boolean,
       default: false
-    },
+    }
   },
   data() {
     return {
@@ -191,7 +189,8 @@ export default {
         name: '',
         businessId: '',
         noticeScope: [],
-        businessKey: ''
+        businessKey: '',
+        formCreateUserId: ''
       },
       active: 0,
       bpmnXML: null,
@@ -232,8 +231,8 @@ export default {
     // 获得岗位列表 暂无岗位概念
     this.postOptions = [];
     /*listSimplePosts().then(response => {
-    this.postOptions.push(...response.data);
-  });*/
+  this.postOptions.push(...response.data);
+});*/
     // 获得用户列表
     this.userOptions = [];
     listAllUserBind().then((data) => {
@@ -251,47 +250,54 @@ export default {
   },
   methods: {
     init(row = {}) {
-      this.form = Object.assign( this.form, row);
-      this.getDefaultInfo(row.businessKey)
+      this.form = { ...this.form, ...row };
+      // this.form.businessId = row.id;
+      // this.form.businessKey = row.businessKey;
+      // this.form.formCreateUserId = row.createUserId;
+      this.getDefaultInfo(row.businessKey);
     },
     async getDefaultInfo(businessKey) {
-      let info = await getProcessDefinitionInfo({code: businessKey})
-      this.form.LCFL = info?.category
-      this.form.FQLC = info?.modelId
-      this.form.name = info?.name
-      this.form.key = info?.key
-      this.form.processDefinitionId = info?.id
-      if (this.form.LCFL) await this.getProcessList(this.form.LCFL)
+      let info = await getProcessDefinitionInfo({code: businessKey});
+      this.form.LCFL = info?.category;
+      this.form.FQLC = info?.modelId;
+      this.form.name = info?.name;
+      this.form.key = info?.key;
+      this.form.processDefinitionId = info?.id;
+      if (this.form.LCFL) await this.getProcessList(this.form.LCFL);
       if (this.form.FQLC) {
-        await this.getProcessDefinitionBpmnXMLInfo(info.id)
-        await this.getTaskAssignRuleListInfo({modelId: info.modelId, processDefinitionId: info.id})
+        await this.getProcessDefinitionBpmnXMLInfo(info.id);
+        await this.getTaskAssignRuleListInfo({
+          modelId: info.modelId,
+          processDefinitionId: info.id
+        });
       }
     },
     async changeLCFL(val) {
       this.bpmnXML = null;
       this.form.processDefinitionId = null;
       this.form.FQLC = null;
-      await this.getProcessList(val)
+      await this.getProcessList(val);
     },
     async getProcessList(val) {
       let params = {
         pageNo: 1,
         pageSize: 999,
         processTypeId: val
-      }
+      };
       const {list} = await getModelPage(params);
-      this.processList = list.filter(
-        (item) => item.processDefinition
-      );
+      this.processList = list.filter((item) => item.processDefinition);
     },
     async changeFQLC(val) {
       if (!val) return;
       let find = this.processList.find((item) => item.id === val) || {};
       this.form.name = find.name;
       this.form.key = find.key;
-      this.form.processDefinitionId = find.processDefinition.id
-      await this.getProcessDefinitionBpmnXMLInfo(find.processDefinition.id)
-      await this.getTaskAssignRuleListInfo({modelId: find.id, processDefinitionId: find.processDefinition.id})
+      this.form.processDefinitionId = find.processDefinition.id;
+      await this.getProcessDefinitionBpmnXMLInfo(find.processDefinition.id);
+      await this.getTaskAssignRuleListInfo({
+        modelId: find.id,
+        processDefinitionId: find.processDefinition.id
+      });
     },
     async getProcessDefinitionBpmnXMLInfo(val) {
       // 加载流程图
@@ -393,9 +399,9 @@ export default {
     },
     async submit() {
       await processInstanceCreateAPI(this.form);
-      this.$message('提交审核成功')
-      this.$emit('reload')
-      this.cancel()
+      this.$message('提交审核成功');
+      this.$emit('reload');
+      this.cancel();
     },
     cancel() {
       this.$emit('update:processSubmitDialogFlag', false);

+ 18 - 8
src/components/AssetTree/index.vue

@@ -18,7 +18,8 @@
 </template>
 
 <script>
-import { getTreeByPid } from '@/api/custom';
+import {getProduceTreeByCode, getTreeByPid} from '@/api/custom';
+
 // let originId = '';
 // let originType = '';
 export default {
@@ -46,7 +47,7 @@ export default {
     },
     defaultExpandedKeys: {
       type: Array,
-      default:  ()=> {
+      default: () => {
         return [];
       }
     },
@@ -56,7 +57,7 @@ export default {
       default: true
     },
 
-    isFirstRefreshTable:{
+    isFirstRefreshTable: {
       type: Boolean,
       default: true
     },
@@ -64,6 +65,10 @@ export default {
       type: String,
       default: '0'
     },
+    code: {
+      type: String,
+      default: ''
+    },
     nodeKey: {
       type: String,
       default: 'id'
@@ -82,9 +87,14 @@ export default {
       currentKey: ''
     };
   },
-  mounted() {
+  async mounted() {
     if (this.init) {
-      this.getTreeData();
+      if (this.code) {
+        let typeObj = await getProduceTreeByCode(this.code);
+        await this.getTreeData(typeObj[0]?.id);
+      } else {
+        await this.getTreeData(this.id);
+      }
     }
   },
   methods: {
@@ -92,11 +102,11 @@ export default {
       return this.$refs.tree;
     },
     // 获取树结构数据
-    async getTreeData() {
+    async getTreeData(id) {
       try {
         this.treeLoading = true;
 
-        const res = await getTreeByPid(this.id);
+        const res = await getTreeByPid(id);
         this.treeLoading = false;
         if (res?.code === '0') {
           this.treeList = res.data;
@@ -106,7 +116,7 @@ export default {
           }
           this.$nextTick(() => {
             // 默认高亮第一级树节点
-            if (this.treeList[0]&&this.isFirstRefreshTable) {
+            if (this.treeList[0] && this.isFirstRefreshTable) {
               this.setCurrentKey(this.treeList[0].id);
               this.handleNodeClick(
                 this.treeList[0],

+ 19 - 18
src/store/modules/user.js

@@ -6,7 +6,8 @@ import { USER_MENUS } from '@/config/setting';
 import { getResourcesTree } from '@/api/layout';
 import { SYSTEM_NAME } from '@/config/setting';
 import Vue from 'vue';
-import {getCurrentUserAuthorityDeptAPI} from "@/api/login";
+import { getCurrentUserAuthorityDeptAPI } from '@/api/system/organization';
+
 const formatRouter = (list) => {
   let menuList = []; // menuType
   let authorities = [];
@@ -16,7 +17,7 @@ const formatRouter = (list) => {
     for (const p of list) {
       if (p.menuType === 2) {
         // p.children = [];
-        // authorities.push(p);
+        authorities.push(p);
         p.hide = true;
       }
       //  else {
@@ -56,6 +57,7 @@ export default {
   mutations: {
     // 设置登录用户的信息
     setUserInfo(state, info) {
+
       state.info = info;
     },
     // 设置登录用户的菜单
@@ -64,7 +66,7 @@ export default {
     },
     // 设置登录用户的权限
     setAuthorities(state, authorities) {
-      state.authorities = authorities;
+      state.authorities = authorities.map((item) => item.permissionCode);
     },
     // 设置登录用户的权限路由
     setAuthoritiesRouter(state, authoritiesRouter) {
@@ -117,11 +119,11 @@ export default {
     //   return { menus, homePath };
     // },
     //动态路由
-    async fetchUserInfo({ commit }) {
-      let currentUser=JSON.parse(sessionStorage['currentUser'])
-      const result = await getResourcesTree({groupId:currentUser.currentGroupId,roleId:currentUser.currentRoleId}).catch(() => {});
+    async fetchUserInfo({ commit, state }) {
+      let currentUser = JSON.parse(sessionStorage['currentUser'])
+      const result = await getResourcesTree({ groupId: currentUser.currentGroupId, roleId: currentUser.currentRoleId }).catch(() => { });
       const list = result.filter((i) => i.path === `/page-${SYSTEM_NAME}`);
-      if (!list.length) {
+      if (!list?.length) {
         return {};
       }
 
@@ -140,22 +142,21 @@ export default {
       // 用户菜单, 过滤掉按钮类型并转为 children 形式
       const { menus, homePath } = formatMenus(
         USER_MENUS ??
-          toTreeData({
-            data: menuList,
-            idField: 'id',
-            parentIdField: 'parentId'
-          })
+        toTreeData({
+          data: menuList,
+          idField: 'id',
+          parentIdField: 'parentId'
+        })
       );
       // 用户路由按钮
       const { menus: authoritiesRouter } = formatMenus(
         USER_MENUS ??
-          toTreeData({
-            data: authorities.filter((i) => i.path),
-            idField: 'id',
-            parentIdField: 'parentId'
-          })
+        toTreeData({
+          data: authorities.filter((i) => i.path),
+          idField: 'id',
+          parentIdField: 'parentId'
+        })
       );
-      console.log('menus--', menus);
       commit('setMenus', menus);
       commit('setAuthoritiesRouter', authoritiesRouter);
       // const menus = result;

+ 1 - 1
src/views/bpm/processInstance/detail.vue

@@ -21,7 +21,7 @@
                     v-if="item.assigneeUser"
                     style="font-weight: normal; margin-right: 30px"
                   >
-                    审批人:{{ item.assigneeUser.nickname }}
+                    {{index==0?' 审批人':'发起人' }}:{{ item.assigneeUser.nickname }}
                     <el-tag type="info" size="mini">{{
                       item.assigneeUser.deptName
                     }}</el-tag>

+ 1 - 0
src/views/project-manage/task-manage/components/submitDeliverablesDialog.vue

@@ -123,6 +123,7 @@ export default {
         let params = {
           businessId:row.id,
           businessKey : 'pro_task_files_approve',
+          formCreateUserId: row.createUserId,
         }
         this.$refs.processSubmitDialogRef.init(params)
       })