Browse Source

多选等

Zhang Li, BBF-411-2(Neusoft) 1 year ago
parent
commit
91d6d1b526

+ 3 - 0
src/api/portal/core/menuPortal.js

@@ -88,6 +88,9 @@ export default {
             actions.setGlobalState(state);
         },
         handMenuClick(item, index, typename) {
+            if(item.path == 'auditManageList') {
+                localStorage.setItem('auditFirst',true)
+            }
             if(item.showType == 'NEW_PAGE'){//新窗口(固定路由)
                 this.openNewPage(item);
                 return ;

+ 9 - 1
src/layouts/MainLayout.vue

@@ -116,7 +116,7 @@
           <div id="appPortalHome" ref="appPortalHome" v-show="openFront"></div>
           <div v-show="!openFront" style="height: 100%; height: 100%">
             <template v-if="showType == 'window'">
-              <keep-alive 
+              <!-- <keep-alive 
                 :exclude="['bannerList',
                   'newsList',
                   'auditManageList',
@@ -128,6 +128,14 @@
                   'albumAuditList',
                   'commentAuditList',
                   'checkInfo']
+                "> -->
+                  <keep-alive 
+                  :exclude="[
+                    'knowledgeAddUpdate',
+                    'auditProcessMaintain',
+                    'albumInfo',
+                    'checkInfo'
+                  ]
                 ">
                 <router-view :key="$route.fullPath" />
               </keep-alive>

+ 7 - 0
src/views/modules/knowledge/album/albumAuditList.vue

@@ -306,6 +306,13 @@ export default {
       }
     }
   },
+  activated() {
+    if(localStorage.getItem('cancle')=='true'){
+      localStorage.setItem('cancle',false)
+    }else{
+      this.reloadTable()
+    }
+  },
   created() {
     if(this.$route.query.showOnlyUser) {
       this.queryParam.type = 2

+ 6 - 2
src/views/modules/knowledge/album/albumInfo.vue

@@ -85,7 +85,7 @@
                   </a-radio-group>
                   <a-input v-model="auditForm.remark" type="textarea" :autosize="{minRows: 3, maxRows: 6}" :maxLength="200" placeholder="请输入审批意见" />
                   <a-row :gutter="24" type="flex" justify="end" style="margin-top: 20px;padding-right:12px;">
-                    <a-button style="margin-right: 20px;" @click="$router.back()">取消</a-button>
+                    <a-button style="margin-right: 20px;" @click="goBack">取消</a-button>
                     <a-button type="primary" :loading="saveLoading" @click="handleCheckClick">保存</a-button>
                   </a-row>
                 </div>
@@ -153,7 +153,7 @@
               <div>无内容</div>
             </template>
             <a-row :gutter="24" type="flex" justify="end" style="margin-top: 20px; padding-right:12px;">
-              <a-button style="margin-right: 20px;" @click="$router.back()">取消</a-button>
+              <a-button style="margin-right: 20px;" @click="goBack">取消</a-button>
               <a-button v-if="actionFlag.indexOf('edit') > -1" type="primary" :loading="saveLoading" @click="handleSaveClick">保存</a-button>
             </a-row>
           </div>
@@ -294,6 +294,10 @@ export default {
     }
   },
   methods: {
+    goBack(){
+      localStorage.setItem("cancle",true)
+      this.$router.back()
+    },
     async init() {
       let detailData = await api.detail({pkId: this.pkId})
       let detailInfo = detailData.data

+ 6 - 2
src/views/modules/knowledge/album/checkInfo.vue

@@ -56,7 +56,7 @@
                 </a-radio-group>
                 <a-input v-model="auditForm.remark" type="textarea" :autosize="{minRows: 3, maxRows: 6}" :maxLength="200" placeholder="请输入审批意见" />
                 <a-row :gutter="24" type="flex" justify="end" style="margin-top: 20px;padding-right:12px;">
-                  <a-button style="margin-right: 20px;" @click="$router.back()">取消</a-button>
+                  <a-button style="margin-right: 20px;" @click="goBack">取消</a-button>
                   <a-button type="primary" :loading="saveLoading" @click="handleSaveClick">保存</a-button>
                 </a-row>
               </div>
@@ -96,7 +96,7 @@
             </div>
             <template v-if="!showCheck">
               <a-row :gutter="24" type="flex" justify="end" style="margin-top: 20px;padding-right:12px;">
-                <a-button style="margin-right: 20px;" @click="$router.back()">取消</a-button>
+                <a-button style="margin-right: 20px;" @click="goBack">取消</a-button>
               </a-row>
             </template>
           </div>
@@ -182,6 +182,10 @@ export default {
     this.init()
   },
   methods: {
+    goBack(){
+      localStorage.setItem("cancle",true)
+      this.$router.back()
+    },
     async init() {
       let detailData = await api.info({pkId: this.pkId})
       let detailInfo = detailData.data

+ 7 - 0
src/views/modules/knowledge/album/commentAuditList.vue

@@ -312,6 +312,13 @@ export default {
       }
     }
   },
+  activated() {
+    if(localStorage.getItem('cancle')=='true'){
+      localStorage.setItem('cancle',false)
+    }else{
+      this.reloadTable()
+    }
+  },
   created() {
     if(this.$route.query.showOnlyUser) {
       this.queryParam.type = 2

+ 5 - 1
src/views/modules/knowledge/config/bannerAddEdit.vue

@@ -94,7 +94,7 @@
                 </a-col>
               </a-row>
               <a-row :gutter="24" type="flex" justify="end">
-                <a-button @click="$router.back()">取消</a-button>
+                <a-button @click="goBack">取消</a-button>
                 <a-button style="margin: 0 20px;" type="primary" @click="handleSaveClick" :loading="saveLoading">保存</a-button>
               </a-row>
             </a-form-model>
@@ -189,6 +189,10 @@ export default {
     this.$refs.bannerRef.clearValidate()
   },
   methods: {
+    goBack(){
+      localStorage.setItem("cancle",true)
+      this.$router.back()
+    },
     openPreview(src){
       this.$refs.previewVisible.openBig(src)
     },

+ 7 - 0
src/views/modules/knowledge/config/bannerList.vue

@@ -281,6 +281,13 @@ export default {
       ]
     }
   },
+  activated() {
+    if(localStorage.getItem('cancle')=='true'){
+      localStorage.setItem('cancle',false)
+    }else{
+      this.reloadTable()
+    }
+  },
   methods: {
     openPreview(src){
       this.$refs.previewVisible.openBig(src)

+ 5 - 1
src/views/modules/knowledge/map/addUpdateMap.vue

@@ -11,7 +11,7 @@
                   <span class="titleBox">基础信息</span>
                 </a-col>
                 <a-col :span="12">
-                  <a-button class="totBtn"  @click="$router.back()">取消</a-button>
+                  <a-button class="totBtn"  @click="goBack">取消</a-button>
                   <a-button class="totBtn" style="margin-right: 20px;" type="primary" @click="handleSaveClick" :loading="saveLoading">保存</a-button>
                 </a-col>
               </a-row>
@@ -379,6 +379,10 @@ export default {
     }
   },
   methods: {
+    goBack(){
+      localStorage.setItem("cancle",true)
+      this.$router.back()
+    },
     load(pkId = false) {
       // 获取所属组织
       OsGroupApi.getAllOsGroupList({dimId:1}).then(res => {

+ 7 - 0
src/views/modules/knowledge/map/mapList.vue

@@ -244,6 +244,13 @@ export default {
       ]
     }
   },
+  activated() {
+    if(localStorage.getItem('cancle')=='true'){
+      localStorage.setItem('cancle',false)
+    }else{
+      this.reloadTable()
+    }
+  },
   created() {
     this.init()
   },

+ 5 - 1
src/views/modules/knowledge/news/newsAddEdit.vue

@@ -73,7 +73,7 @@
                 </a-col>
               </a-row>
               <a-row :gutter="24" type="flex" justify="end">
-                <a-button @click="$router.back()">取消</a-button>
+                <a-button @click="goBack">取消</a-button>
                 <a-button style="margin: 0 20px;" type="primary" @click="handleSaveClick" :loading="saveLoading">保存</a-button>
               </a-row>
             </a-form-model>
@@ -141,6 +141,10 @@ export default {
     this.$refs.newsRef.clearValidate()
   },
   methods: {
+    goBack(){
+      localStorage.setItem("cancle",true)
+      this.$router.back()
+    },
     openPreview(src){
       this.$refs.previewVisible.openBig(src)
     },

+ 7 - 0
src/views/modules/knowledge/news/newsList.vue

@@ -232,6 +232,13 @@ export default {
       ]
     }
   },
+  activated() {
+    if(localStorage.getItem('cancle')=='true'){
+      localStorage.setItem('cancle',false)
+    }else{
+      this.reloadTable()
+    }
+  },
   methods: {
     openPreview(src){
       this.$refs.previewVisible.openBig(src)

+ 119 - 45
src/views/modules/knowledge/warehouse/auditManageList.vue

@@ -155,7 +155,8 @@
           @ok="handleSaveOk">
         <org-people style="width:800px;height:65vh;" 
                     :isOnlyOrg="false"  
-                    @transCheckedTarget="transCheckedTarget"
+                    :organizationIdsInfo="organizationIdsInfo"
+                    @transCheckedTargets="transCheckedTargets"
                     @returnSequencesInfo="handleSequencesChange"
                     @returnGradeInfo="handleGradeChange" ></org-people>
       </a-modal>  
@@ -306,22 +307,37 @@ export default {
         remark:'',
         actualApprover: '',
         actualApproverName: '',
-        organizationId: ''
+        organizationIds: {}
       },
       authName: undefined,
       isShowOrg: false,
       classifyList: [],
       // 组织架构
-      checkedTarget: {},
+      checkedTargets: {},
       // 职系
       sequencesInfo: {},
       // 职等
       gradesInfo: {},
       // 维基知识不能选择权限
       isDocument: false,
-      widthVar: 800
+      widthVar: 800,
+      organizationIdsInfo: {}
     }
   },
+  activated() {
+    if(localStorage.getItem('auditFirst')=='true'){
+      this.queryParam.categoryId = 9999
+      localStorage.setItem('auditFirst',false)
+    }
+    if(localStorage.getItem('cancle')=='true'){
+      localStorage.setItem('cancle',false)
+    }else{
+      this.reloadTable()
+    }
+    setTimeout(() => {
+      this.queryParam.categoryId = ''
+    },1000)
+  },
   created() {
     // 从知识管理页跳转
     if(this.$route.query.showUnchecked) {
@@ -332,7 +348,6 @@ export default {
       ]
     } else {
       this.urls = api.findAllKnowledgeApprove
-      this.queryParam.categoryId = 9999
       this.approvalStatusList = [
         {value: '1', label: '待节点审核'},
         {value: '2', label: '节点驳回'},
@@ -350,7 +365,6 @@ export default {
     setTimeout(() => {
       let offsetWidth = document.querySelector('.scroll-ckunk').getBoundingClientRect().left
       this.widthVar = innerWidth - offsetWidth - 40
-      this.queryParam.categoryId = ''
     }, 1000);
     document.onclick=function(element){
       if(element.target.className.indexOf('ant-cascader-menu-item')>-1){
@@ -486,19 +500,36 @@ export default {
       if(title == 'fast') {
         this.isDocument = arg.type == 1 ? true : false
         this.isShowOrg = arg.approvalStatus == 3 ? true : false
-        this.auditForm.organizationId = arg.organizationId
-        if(arg.organizationId) {
-          let organizationInfo = JSON.parse(arg.organizationId)
+        this.auditForm.organizationIds = arg.organizationIds
+        this.organizationIdsInfo = arg.organizationIds
+        if(arg.organizationIds) {
+          let organizationInfo = arg.organizationIds
           let info = []
-          for(let i of organizationInfo) {
-            if(i.organizationId) {
-              info.push(`${i.organizationTree.join('-')}`)
-            } else if(i.gradeId) {
-              info.push(`职系-${i.gradeName}`)
-            } else {
-              info.push(`职等-${i.gradeLevelName}`)
-            }
+          // for(let i of organizationInfo) {
+          //   if(i.organizationIds) {
+          //     info.push(`${i.organizationTree.join('-')}`)
+          //   } else if(i.gradeId) {
+          //     info.push(`职系-${i.gradeName}`)
+          //   } else {
+          //     info.push(`职等-${i.gradeLevelName}`)
+          //   }
+          // }
+          if(organizationInfo.organizationId) {
+            info.push(`组织:[${organizationInfo.organizationTree}]`)
+          }
+          if(organizationInfo.gradeId) {
+            info.push(`职系:[${organizationInfo.gradeName}]`)
           }
+          if(organizationInfo.gradeLevelId) {
+            info.push(`职等:[${organizationInfo.gradeLevelName}]`)
+          }
+          this.checkedTargets.organizationId = organizationInfo.organizationId
+          this.checkedTargets.organizationName = organizationInfo.organizationName
+          this.checkedTargets.organizationTree = organizationInfo.organizationTree
+          this.sequencesInfo.gradeId = organizationInfo.gradeId
+          this.sequencesInfo.gradeName = organizationInfo.gradeName
+          this.gradesInfo.gradeLevelId = organizationInfo.gradeLevelId
+          this.gradesInfo.gradeLevelName = organizationInfo.gradeLevelName
           this.authName = info.join('/')
         }
         this.willAuditData.push(arg)
@@ -520,22 +551,38 @@ export default {
         let approvalStatusData = this.willAuditData.filter(item => item.approvalStatus == 3)
         if(approvalStatusData.length == 1) {
             let approvalStatusInfo = approvalStatusData[0]
-            console.log(approvalStatusInfo)
             this.isShowOrg = true
             this.isDocument = approvalStatusInfo.type == 1 ? true : false
-            this.auditForm.organizationId = approvalStatusInfo.organizationId
-            if(approvalStatusInfo.organizationId) {
-              let organizationInfo = JSON.parse(approvalStatusInfo.organizationId)
+            this.auditForm.organizationIds = approvalStatusInfo.organizationIds
+            this.organizationIdsInfo = approvalStatusInfo.organizationIds
+            if(approvalStatusInfo.organizationIds) {
+              let organizationInfo = approvalStatusInfo.organizationIds
               let info = []
-              for(let i of organizationInfo) {
-                if(i.organizationId) {
-                  info.push(`${i.organizationTree.join('-')}`)
-                } else if(i.gradeId) {
-                  info.push(`职系-${i.gradeName}`)
-                } else {
-                  info.push(`职等-${i.gradeLevelName}`)
-                }
+              if(organizationInfo.organizationId) {
+                info.push(`组织:[${organizationInfo.organizationTree}]`)
+              }
+              if(organizationInfo.gradeId) {
+                info.push(`职系:[${organizationInfo.gradeName}]`)
+              }
+              if(organizationInfo.gradeLevelId) {
+                info.push(`职等:[${organizationInfo.gradeLevelName}]`)
               }
+              this.checkedTargets.organizationId = organizationInfo.organizationId
+              this.checkedTargets.organizationName = organizationInfo.organizationName
+              this.checkedTargets.organizationTree = organizationInfo.organizationTree
+              this.sequencesInfo.gradeId = organizationInfo.gradeId
+              this.sequencesInfo.gradeName = organizationInfo.gradeName
+              this.gradesInfo.gradeLevelId = organizationInfo.gradeLevelId
+              this.gradesInfo.gradeLevelName = organizationInfo.gradeLevelName
+              // for(let i of organizationInfo) {
+              //   if(i.organizationIds) {
+              //     info.push(`${i.organizationTree.join('-')}`)
+              //   } else if(i.gradeId) {
+              //     info.push(`职系-${i.gradeName}`)
+              //   } else {
+              //     info.push(`职等-${i.gradeLevelName}`)
+              //   }
+              // }
               this.authName = info.join('/')
             }
         } else {
@@ -546,8 +593,8 @@ export default {
       if(!this.willAuditData.length) return
       this.auditShow = true
     },
-    transCheckedTarget(arg) {
-      this.checkedTarget = arg
+    transCheckedTargets(arg) {
+      this.checkedTargets = arg
     },
     handleSequencesChange(arg) {
       this.sequencesInfo = arg
@@ -557,27 +604,54 @@ export default {
     },
     handleSaveOk() {
       if(this.isShowOrg) {
+        // let info = []
+        // let res = []
+        // if(this.checkedTarget.organizationId) {
+        //   info.push(`${this.checkedTarget.organizationTree.join('-')}`)
+        //   res.push(this.checkedTarget)
+        // }
+        // if(this.sequencesInfo.gradeId) {
+        //   info.push(`职系-${this.sequencesInfo.gradeName}`)
+        //   res.push(this.sequencesInfo)
+        // }
+        // if(this.gradesInfo.gradeLevelId) {
+        //   info.push(`职等-${this.gradesInfo.gradeLevelName}`)
+        //   res.push(this.gradesInfo)
+        // }
+        //  if(info.length) {
+        //   this.authName = info.join('/')
+        // }
+        // if(res.length) {
+        //   this.auditForm.organizationIds = res
+        // } else {
+        //   this.auditForm.organizationIds = ""
+        // }
         let info = []
-        let res = []
-        if(this.checkedTarget.organizationId) {
-          info.push(`${this.checkedTarget.organizationTree.join('-')}`)
-          res.push(this.checkedTarget)
+        let res = {}
+        console.log(this.checkedTargets)
+        if(this.checkedTargets && this.checkedTargets.organizationId) {
+          info.push(`组织:[${this.checkedTargets.organizationTree}]`)
+          res['organizationId'] = this.checkedTargets.organizationId
+          res['organizationName'] = this.checkedTargets.organizationName
+          res['organizationTree'] = this.checkedTargets.organizationTree
         }
-        if(this.sequencesInfo.gradeId) {
-          info.push(`职系-${this.sequencesInfo.gradeName}`)
-          res.push(this.sequencesInfo)
+        if(this.sequencesInfo && this.sequencesInfo.gradeId) {
+          info.push(`职系:[${this.sequencesInfo.gradeName}]`)
+          res['gradeId'] = this.sequencesInfo.gradeId
+          res['gradeName'] = this.sequencesInfo.gradeName
         }
-        if(this.gradesInfo.gradeLevelId) {
-          info.push(`职等-${this.gradesInfo.gradeLevelName}`)
-          res.push(this.gradesInfo)
+        if(this.gradesInfo && this.gradesInfo.gradeLevelId) {
+          info.push(`职等:[${this.gradesInfo.gradeLevelName}]`)
+          res['gradeLevelId'] = this.gradesInfo.gradeLevelId
+          res['gradeLevelName'] = this.gradesInfo.gradeLevelName
         }
-         if(info.length) {
+        if(info.length) {
           this.authName = info.join('/')
         }
-        if(res.length) {
-          this.auditForm.organizationId = JSON.stringify([...res])
+        if(Object.keys(res).length) {
+          this.auditForm.organizationIds = res
         } else {
-          this.auditForm.organizationId = ""
+          this.auditForm.organizationIds = {}
         }
       }
       this.showAuditFlag = false

+ 83 - 28
src/views/modules/knowledge/warehouse/components/orgPeople.vue

@@ -4,10 +4,12 @@
           <rx-tree
             :treeData="orgData"
             :async="true"
+            v-model="checkedKeys"
             :loadByParent="onLoadGroupTree"
-            :multiSelect="false"
+            :multiSelect="!isOnlyOrg"
             :showTreeIcon="true"
             @select="selectGroupNode"
+            @check="check"
             :expandOnLoad="0"
             autoExpandParent="true"
             id-field="key"
@@ -22,14 +24,14 @@
             </a-select>
         </a-card> -->
         <a-card  v-if="!isOnlyOrg" title="职系" style="padding:20px;border:none;border-right: 1px solid #e8e8e8;overflow-y:auto;" :style="{width: isOnlyOrg ? '35%' : '100%'}">
-            <a-select v-model="sequencesInfo.gradeId" placeholder="请选择职系" allowClear style="width:100%;" @change="handleSequencesChange">
+            <a-select mode="multiple" v-model="gradeId" placeholder="请选择职系" style="width:100%;" @change="dropdownSequencesChange">
                 <a-select-option v-for="(item,index) in sequencesList" :key="index" :value="item.value" >
                     {{ item.label }}
                 </a-select-option>
             </a-select>
         </a-card>
         <a-card  v-if="!isOnlyOrg" title="职等" style="padding:20px;border:none;" :style="{width: isOnlyOrg ? '35%' : '100%'}">
-            <a-select v-model="gradesInfo.gradeLevelId" placeholder="请选择职等" allowClear style="width:100%;" @change="handleGradeChange">
+            <a-select mode="multiple" v-model="gradeLevelId" placeholder="请选择职等" style="width:100%;" @change="dropdownGradesChange">
                 <a-select-option v-for="(item,index) in gradesList" :key="index" :value="item">
                     {{ item }}
                 </a-select-option>
@@ -97,6 +99,10 @@
         isOnlyOrg: {
             type: Boolean,
             default: true
+        },
+        organizationIdsInfo: {
+            type: Object,
+            default: () => {}
         }
     },
     data() {
@@ -170,16 +176,25 @@
             // }
             ],
             // 组织架构
+            checkedKeys:{checked:[]},
             checkedTarget: {},
+            // 组织架构(多选)
+            checkedTargets: {
+                organizationId: [],
+                organizationName: [],
+                organizationTree: []
+            },
             // 职系
+            gradeId: [],
             sequencesInfo: {
-                gradeId: undefined,
-                gradeName: ''
+                gradeId: [],
+                gradeName: []
             },
+            gradeLevelId: [],
             // 职等
             gradesInfo: {
-                gradeLevelId: undefined,
-                gradeLevelName: ''
+                gradeLevelId: [],
+                gradeLevelName: []
             }
         }
     },
@@ -198,7 +213,6 @@
                 this.gradesList = res.data
             })
         }
-        // this.getAllUserTypeList();
     },
     methods: {
         reset() {
@@ -235,6 +249,18 @@
                 }
 
                 this.orgData = [...temp];
+                // this.getAllUserTypeList();
+                let info = this.organizationIdsInfo
+                this.checkedKeys.checked = info.organizationId || []
+                this.checkedTargets.organizationId = info.organizationId || []
+                this.checkedTargets.organizationName = info.organizationName || []
+                this.checkedTargets.organizationTree = info.organizationTree || []
+                this.gradeId = info.gradeId || []
+                this.sequencesInfo.gradeId = info.gradeId || []
+                this.sequencesInfo.gradeName = info.gradeName || []
+                this.gradeLevelId = info.gradeLevelId || []
+                this.gradesInfo.gradeLevelId = info.gradeLevelId || []
+                this.gradesInfo.gradeLevelName = info.gradeLevelName || []
             })
         },
         //加载左树下的子节点
@@ -242,7 +268,7 @@
             if (treeNode.dataRef.children) {
                 return;
             }
-            console.log(treeNode)
+            // console.log(treeNode)
             return OsGroupApi.getParentGroup(treeNode.dataRef.groupId).then(data => {
                 let treeData = []
                 for (let i = 0; i < data.length; i++) {
@@ -253,8 +279,8 @@
                 var orgData = this.getGroupTree(this.orgData, treeNode.dataRef.groupId, treeData);
 
                 this.orgData = [...orgData];
-                console.info("onLoadGroupTree")
-                console.info(this.orgData)
+                // console.info("onLoadGroupTree")
+                // console.info(this.orgData)
             })
         },
         getGroupTree(orgData, groupId, treeData) {
@@ -278,13 +304,14 @@
                 this.checkedTarget['approverId'] = node.groupId
                 this.checkedTarget['approverName'] = node.title
                 this.$emit('transCheckedTarget',this.checkedTarget)
-            } else {
-                let organizationTree = getParentNode(e.node)
-                this.checkedTarget['organizationId'] = node.groupId
-                this.checkedTarget['organizationName'] = node.title
-                this.checkedTarget['organizationTree'] = organizationTree
-                this.$emit('transCheckedTarget',this.checkedTarget)
-            }   
+            } 
+            // else {
+            //     let organizationTree = getParentNode(e.node)
+            //     this.checkedTarget['organizationId'] = node.groupId
+            //     this.checkedTarget['organizationName'] = node.title
+            //     this.checkedTarget['organizationTree'] = organizationTree
+            //     this.$emit('transCheckedTarget',this.checkedTarget)
+            // }   
             if(this.isOnlyOrg) {
                 //this.selectGroupId=node.groupId;
                 //查询左树用户
@@ -296,10 +323,22 @@
                 this.$refs.table.loadData()
             }
         },
+        // 多选节点
+        check(selKeys, e) {
+            //  organizationId: [],
+            //     organizationName: [],
+            //     organizationTree: []
+            this.checkedTargets = Object.assign({},this.$options.data().checkedTargets)
+            this.checkedTargets.organizationId = selKeys
+            for(let i of e.checkedNodes) {
+                 this.checkedTargets.organizationName.push(i.data.props.title)
+                 this.checkedTargets.organizationTree.push(i.data.props.title)
+            }
+            this.$emit('transCheckedTargets',this.checkedTargets)
+        },
         onSelectChange(keys,rows) {
             this.checkedTarget['approverId'] = rows[0].userNo
             this.checkedTarget['approverName'] = rows[0].fullName
-            console.log(this.checkedTarget)
             this.$emit('transCheckedTarget',this.checkedTarget)
         },
         // 选择职系
@@ -311,6 +350,18 @@
             }
             this.$emit('returnSequencesInfo',this.sequencesInfo)
         },
+        // 选择职系(多选)
+        dropdownSequencesChange(open) {
+            // if(open == false) {
+                this.sequencesInfo = Object.assign({},this.$options.data().sequencesInfo)
+                let that = this
+                this.gradeId.forEach(function(item){
+                    that.sequencesInfo.gradeId.push(item)
+                    that.sequencesInfo.gradeName.push(that.sequencesList.find(item0 => item0.value == item).label)
+                })
+                this.$emit('returnSequencesInfo',this.sequencesInfo)
+            // }
+        },
         // 选择职级
         handleGradeChange(arg) {
             if(arg) {
@@ -319,22 +370,26 @@
                 this.gradesInfo = {}
             }
             this.$emit('returnGradeInfo',this.gradesInfo)
+        },
+        // 选择职级(多选)
+        dropdownGradesChange(open) {
+            // if(open == false) {
+                this.gradesInfo = Object.assign({},this.$options.data().gradesInfo)
+                let that = this
+                this.gradeLevelId.forEach(function(item){
+                    that.gradesInfo.gradeLevelId.push(item)
+                    that.gradesInfo.gradeLevelName.push(item)
+                })
+                this.$emit('returnGradeInfo',this.gradesInfo)
+            // }
         }
     },
     beforeDestroy() {
         this.checkedTarget = Object.assign({},this.$options.data().checkedTarget)
+        this.checkedTargets = Object.assign({},this.$options.data().checkedTargets)
         this.sequencesInfo = Object.assign({},this.$options.data().sequencesInfo)
         this.gradesInfo = Object.assign({},this.$options.data().gradesInfo)
     }
-    // watch: {
-    //     checkedTarget: {
-    //         handler(news,olds) {
-    //             console.log(news,olds)
-    //             this.$emit('transCheckedTarget',this.checkedTarget)
-    //         },
-    //         deep: true
-    //     }
-    // }
 }
 </script>
 <style scoped>

+ 102 - 31
src/views/modules/knowledge/warehouse/knowledgeAddUpdate.vue

@@ -101,12 +101,12 @@
               <!-- 最终节点审 核时 -->
               <a-form-model-item v-if="(isShowOrg || (type == 'knowledgeManageList' && !this.$route.query.show)) && (knowledgeForm.type == 1 || !knowledgeForm.type)" prop="actualApproverName">
                 <span slot="label">&emsp;&emsp;权限</span>
-                <div @click="showAuditFlag = true">
+                <div @click="handleAuthClickshow">
                   <a-select v-model="authName" :showArrow="false" :open="false" placeholder="请选择组织部门、职系、职称等授予知识访问权限"></a-select>
                 </div>
               </a-form-model-item>
               <a-row :gutter="24" type="flex" justify="end" style="margin-top: 20px;padding-right:12px;">
-                <a-button style="margin-right: 20px;" @click="$router.back()">取消</a-button>
+                <a-button style="margin-right: 20px;" @click="goBack">取消</a-button>
                 <a-button v-if="!!$route.query.isAudit || !pkId" type="primary" @click="handleSaveClick" :loading="saveLoading">保存</a-button>
               </a-row>
               <a-form-model-item label="审批流程:" style="font-size:16px;">
@@ -130,8 +130,11 @@
             okText="保存"
             @ok="handleSaveOk">
         <org-people :isOnlyOrg="false" 
+                    ref="orgPeopleRef"
+                    :organizationIdsInfo="organizationIdsInfo"
                     style="width:800px;height:65vh;" 
                     @transCheckedTarget="transCheckedTarget"
+                    @transCheckedTargets="transCheckedTargets"
                     @returnSequencesInfo="handleSequencesChange"
                     @returnGradeInfo="handleGradeChange" />
       </a-modal>  
@@ -181,7 +184,8 @@ export default {
         content: '',
         attachment: '', 
         attachmentName: '',
-        organizationId: ''
+        // organizationId: '',
+        organizationIds: {}
       },
       showAuditFlag: false,
       showOnlyOffice: false,
@@ -191,7 +195,8 @@ export default {
         remark:'',
         actualApprover: '',
         actualApproverName: '',
-        organizationId: ''
+        // organizationId: '',
+        organizationIds: {}
       },
       authName: undefined,
       accessAuthority: undefined,
@@ -252,11 +257,13 @@ export default {
       headers: {},
       // 组织架构
       checkedTarget: {},
+      checkedTargets: {},
       // 职系
       sequencesInfo: {},
       // 职等
       gradesInfo: {},
-      innerWidth: 800
+      widthVar: 800,
+      organizationIdsInfo: {}
     }
   },
   created() {
@@ -276,25 +283,51 @@ export default {
         this.knowledgeForm.content = res.data.content
         this.knowledgeForm.attachment = res.data.attachment
         this.knowledgeForm.attachmentName = res.data.attachmentName
-        this.knowledgeForm.organizationId = res.data.organizationId
+        // this.knowledgeForm.organizationId = res.data.organizationId
+        this.knowledgeForm.organizationIds = res.data.organizationIds
         this.approverData = res.data.approvals
         this.auditForm.actualApprover = this.$store.state.appSetting.user.userId
         this.auditForm.actualApproverName = this.$store.state.appSetting.user.fullName
-        if(res.data.organizationId) {
-          let organizationInfo = JSON.parse(res.data.organizationId)
+        if(res.data.organizationIds) {
+          let organizationInfo = res.data.organizationIds
           let info = []
-          for(let i of organizationInfo) {
-            if(i.organizationId) {
-              info.push(`${i.organizationTree.join('-')}`)
-            } else if(i.gradeId) {
-              info.push(`职系-${i.gradeName}`)
-            } else {
-              info.push(`职等-${i.gradeLevelName}`)
-            }
+          if(organizationInfo.organizationId) {
+            info.push(`组织:[${organizationInfo.organizationTree}]`)
+          }
+          if(organizationInfo.gradeId) {
+            info.push(`职系:[${organizationInfo.gradeName}]`)
+          }
+          if(organizationInfo.gradeLevelId) {
+            info.push(`职等:[${organizationInfo.gradeLevelName}]`)
           }
+          this.checkedTargets.organizationId = organizationInfo.organizationId
+          this.checkedTargets.organizationName = organizationInfo.organizationName
+          this.checkedTargets.organizationTree = organizationInfo.organizationTree
+          this.sequencesInfo.gradeId = organizationInfo.gradeId
+          this.sequencesInfo.gradeName = organizationInfo.gradeName
+          this.gradesInfo.gradeLevelId = organizationInfo.gradeLevelId
+          this.gradesInfo.gradeLevelName = organizationInfo.gradeLevelName
+          // console.log(this.checkedTargets)
+          // console.log(this.sequencesInfo)
+          // console.log(this.gradeLevelId)
           this.accessAuthority = info.join('/')
           this.authName = info.join('/')
         }
+        // if(res.data.organizationId) {
+        //   let organizationInfo = JSON.parse(res.data.organizationId)
+        //   let info = []
+        //   for(let i of organizationInfo) {
+        //     if(i.organizationId) {
+        //       info.push(`${i.organizationTree.join('-')}`)
+        //     } else if(i.gradeId) {
+        //       info.push(`职系-${i.gradeName}`)
+        //     } else {
+        //       info.push(`职等-${i.gradeLevelName}`)
+        //     }
+        //   }
+        //   this.accessAuthority = info.join('/')
+        //   this.authName = info.join('/')
+        // }
         // 待最终节点审批
         this.isShowOrg = res.data.approvalStatus == 3 ? true : false
       })
@@ -337,6 +370,14 @@ export default {
     this.$refs.knowledgeRef.clearValidate()
   },
   methods: {
+    handleAuthClickshow() {
+      this.organizationIdsInfo = this.knowledgeForm.organizationIds
+      this.showAuditFlag = true      
+    },
+    goBack(){
+      localStorage.setItem("cancle",true)
+      this.$router.back()
+    },
     getFindAllNodes(categoryId) {
       let arg = {}
       if(categoryId) {
@@ -399,6 +440,7 @@ export default {
     },
     // 保存
     handleSaveClick() {
+      console.log(this.knowledgeForm)
       // 新增
       if(!this.pkId) {
           this.$refs.knowledgeRef.validate(valid => {
@@ -455,6 +497,9 @@ export default {
     transCheckedTarget(arg) {
       this.checkedTarget = arg
     },
+    transCheckedTargets(arg) {
+      this.checkedTargets = arg
+    },
     handleSequencesChange(arg) {
       this.sequencesInfo = arg
     },
@@ -465,29 +510,55 @@ export default {
       // if(this.isShowOrg && this.knowledgeForm.type == 1) {
       if((this.isShowOrg || this.type == 'knowledgeManageList') && (this.knowledgeForm.type == 1 || !this.knowledgeForm.type)) {
         let info = []
-        let res = []
-        if(this.checkedTarget.organizationId) {
-          info.push(`${this.checkedTarget.organizationTree.join('-')}`)
-          res.push(this.checkedTarget)
+        let res = {}
+        if(this.checkedTargets && this.checkedTargets.organizationId) {
+          info.push(`组织:[${this.checkedTargets.organizationTree}]`)
+          res['organizationId'] = this.checkedTargets.organizationId
+          res['organizationName'] = this.checkedTargets.organizationName
+          res['organizationTree'] = this.checkedTargets.organizationTree
         }
-        if(this.sequencesInfo.gradeId) {
-          info.push(`职系-${this.sequencesInfo.gradeName}`)
-          res.push(this.sequencesInfo)
+        if(this.sequencesInfo && this.sequencesInfo.gradeId) {
+          info.push(`职系:[${this.sequencesInfo.gradeName}]`)
+          res['gradeId'] = this.sequencesInfo.gradeId
+          res['gradeName'] = this.sequencesInfo.gradeName
         }
-        if(this.gradesInfo.gradeLevelId) {
-          info.push(`职等-${this.gradesInfo.gradeLevelName}`)
-          res.push(this.gradesInfo)
+        if(this.gradesInfo && this.gradesInfo.gradeLevelId) {
+          info.push(`职等:[${this.gradesInfo.gradeLevelName}]`)
+          res['gradeLevelId'] = this.gradesInfo.gradeLevelId
+          res['gradeLevelName'] = this.gradesInfo.gradeLevelName
         }
         if(info.length) {
           this.authName = info.join('/')
         }
-        if(res.length) {
-          this.auditForm.organizationId = JSON.stringify([...res])
-          this.knowledgeForm.organizationId = JSON.stringify([...res])
+        if(Object.keys(res).length) {
+          this.auditForm.organizationIds = res
+          this.knowledgeForm.organizationIds = res
         } else {
-          this.auditForm.organizationId = ""
-          this.knowledgeForm.organizationId = ""
+          this.auditForm.organizationIds = {}
+          this.knowledgeForm.organizationIds = {}
         }
+        // if(this.checkedTarget.organizationId) {
+        //   info.push(`${this.checkedTarget.organizationTree.join('-')}`)
+        //   res.push(this.checkedTarget)
+        // }
+        // if(this.sequencesInfo.gradeId) {
+        //   info.push(`职系-${this.sequencesInfo.gradeName}`)
+        //   res.push(this.sequencesInfo)
+        // }
+        // if(this.gradesInfo.gradeLevelId) {
+        //   info.push(`职等-${this.gradesInfo.gradeLevelName}`)
+        //   res.push(this.gradesInfo)
+        // }
+        // if(info.length) {
+        //   this.authName = info.join('/')
+        // }
+        // if(res.length) {
+        //   this.auditForm.organizationId = JSON.stringify([...res])
+        //   this.knowledgeForm.organizationId = JSON.stringify([...res])
+        // } else {
+        //   this.auditForm.organizationId = ""
+        //   this.knowledgeForm.organizationId = ""
+        // }
       }
       this.showAuditFlag = false
     },

+ 7 - 0
src/views/modules/knowledge/warehouse/knowledgeManageList.vue

@@ -286,6 +286,13 @@ export default {
       widthVar: 800
     }
   },
+  activated() {
+    if(localStorage.getItem('cancle')=='true'){
+      localStorage.setItem('cancle',false)
+    }else{
+      this.reloadTable()
+    }
+  },
   async created() {
     this.init()
     this.getAuditNum()