shenqilong 1 год назад
Родитель
Сommit
597a7373c1

+ 399 - 399
src/business/platform/org/employee/mixins/panelTree.js

@@ -6,410 +6,410 @@ import { getTreeData as getGroupTreeData } from '@/api/platform/org/group'
 import TreeUtils from '@/utils/tree'
 import { findAllSubsystem } from '@/api/platform/auth/subsystem'
 export default {
-  methods: {
-    checkTreeId(treeData) {
-      const arr = []
-      const filter = function(datas) {
-        datas.find(item => {
-          if (item.children && item.children !== []) {
-            item.children.forEach(i => {
-              arr.push(i.id)
+    methods: {
+        checkTreeId (treeData) {
+            const arr = []
+            const filter = function (datas) {
+                datas.find(item => {
+                    if (item.children && item.children !== []) {
+                        item.children.forEach(i => {
+                            arr.push(i.id)
+                        })
+                        filter(item.children)
+                    }
+                })
+                return arr
+            }
+            filter(treeData)
+            this.treeIds = arr
+            this.loadListData()
+        },
+        loadTreeData (init = false, resetParams = false) {
+            if (!this.showTree) return
+            this.hiddenTree = false
+            this.loadingTree = true
+            this.partyId = ''
+            this.treeData = []
+            if (this.partyType === 'org') {
+                this.lazyTree = true
+                this.defaultExpandedKeys = ['0']
+                this.defaultExpandAll = false
+                this.loadOrgTreeData(init, resetParams)
+            } else if (this.partyType === 'position') {
+                this.lazyTree = true
+                this.defaultExpandedKeys = ['0']
+                this.defaultExpandAll = false
+                this.loadPositionTreeData(init, resetParams)
+            } else {
+                this.lazyTree = false
+                this.defaultExpandedKeys = null
+                this.defaultExpandAll = true
+                if (this.partyType === 'role') {
+                    this.loadRoleTreeData()
+                } else if (this.partyType === 'group') {
+                    this.loadGroupTreeData()
+                }
+            }
+            this.loadListData()
+        },
+        toTree (data) {
+            return TreeUtils.transformToTreeFormat(data, {
+                idKey: 'id',
+                pIdKey: 'parentId',
+                childrenKey: 'children'
             })
-            filter(item.children)
-          }
-        })
-        return arr
-      }
-      filter(treeData)
-      this.treeIds = arr
-      this.loadListData()
-    },
-    loadTreeData(init = false, resetParams = false) {
-      if (!this.showTree) return
-      this.hiddenTree = false
-      this.loadingTree = true
-      this.partyId = ''
-      this.treeData = []
-      if (this.partyType === 'org') {
-        this.lazyTree = true
-        this.defaultExpandedKeys = ['0']
-        this.defaultExpandAll = false
-        this.loadOrgTreeData(init, resetParams)
-      } else if (this.partyType === 'position') {
-        this.lazyTree = true
-        this.defaultExpandedKeys = ['0']
-        this.defaultExpandAll = false
-        this.loadPositionTreeData(init, resetParams)
-      } else {
-        this.lazyTree = false
-        this.defaultExpandedKeys = null
-        this.defaultExpandAll = true
-        if (this.partyType === 'role') {
-          this.loadRoleTreeData()
-        } else if (this.partyType === 'group') {
-          this.loadGroupTreeData()
-        }
-      }
-      this.loadListData()
-    },
-    toTree(data) {
-      return TreeUtils.transformToTreeFormat(data, {
-        idKey: 'id',
-        pIdKey: 'parentId',
-        childrenKey: 'children'
-      })
-    },
-    // 根据渲染的数据范围类型,筛选目标节点
-    filterPositionTreeChildren(treeData, treeScope, nodeId) {
-      const data = []
-      // 返回设置的范围节点
-      if (treeScope === 'root') {
-        const currentOrgIds = this.currentOrgId.split(',')
-        treeData.forEach(f => {
-          if (currentOrgIds.includes(f.id)) {
-            f.leaf = true
-            data.push(f)
-          }
-        })
-      }
-      return data
-    },
-    setTree(lazy, data) {
-      const ref = this.$refs.elTree
-      ref.store.lazy = lazy
-      ref.store.defaultExpandAll = !lazy
-      ref.store.defaultExpandedKeys = lazy ? ['0'] : null
-      ref.store.setData(data)
-      if (lazy && !this.isUseScope && (this.partyType !== 'org' || (this.partyType === 'org' && this.partyTypeId !== '3'))) {
-        // 普通模式懒加载函数调用
-        ref.store.load = this.loadOrgTreeNode
-      } else if (lazy && this.isUseScope) {
-        if (this.partyType === 'org') {
-          ref.store.load = this.partyTypeId === '3' ? this.loadOrgTreeNode3 : this.loadOrgTreeNode
-        } else if (this.partyType === 'position') {
-          ref.store.load = this.partyTypeId === '3' ? this.loadPosTreeNode3 : this.loadPosTreeNode
-        }
-      }
-    },
-    handleTreeAction(command, position, selection, data) {
-      if (position === 'toolbar' && command.key === 'refresh') {
-        this.loadTreeData()
-      }
-      if (command.key === 'expand') {
-        this.expandCompressTree(true)
-      } else if (command.key === 'compress') {
-        this.expandCompressTree(false)
-      }
-    },
-    expandCompressTree(expanded) {
-      for (let i = 0; i < this.$refs.elTree.store._getAllNodes().length; i++) {
-        this.$refs.elTree.store._getAllNodes()[i].expanded = expanded
-      }
-    },
-    // 点击节点
-    handleNodeClick(data) {
-      const ids = []
-      this.getChildrenIds(data, ids)
-      if (data.id === '0') return
-      this.partyId = data.id
-      this.loadListData()
-    },
+        },
+        // 根据渲染的数据范围类型,筛选目标节点
+        filterPositionTreeChildren (treeData, treeScope, nodeId) {
+            const data = []
+            // 返回设置的范围节点
+            if (treeScope === 'root') {
+                const currentOrgIds = this.currentOrgId.split(',')
+                treeData.forEach(f => {
+                    if (currentOrgIds.includes(f.id)) {
+                        f.leaf = true
+                        data.push(f)
+                    }
+                })
+            }
+            return data
+        },
+        setTree (lazy, data) {
+            const ref = this.$refs.elTree
+            ref.store.lazy = lazy
+            ref.store.defaultExpandAll = !lazy
+            ref.store.defaultExpandedKeys = lazy ? ['0'] : null
+            ref.store.setData(data)
+            if (lazy && !this.isUseScope && (this.partyType !== 'org' || (this.partyType === 'org' && this.partyTypeId !== '3'))) {
+                // 普通模式懒加载函数调用
+                ref.store.load = this.loadOrgTreeNode
+            } else if (lazy && this.isUseScope) {
+                if (this.partyType === 'org') {
+                    ref.store.load = this.partyTypeId === '3' ? this.loadOrgTreeNode3 : this.loadOrgTreeNode
+                } else if (this.partyType === 'position') {
+                    ref.store.load = this.partyTypeId === '3' ? this.loadPosTreeNode3 : this.loadPosTreeNode
+                }
+            }
+        },
+        handleTreeAction (command, position, selection, data) {
+            if (position === 'toolbar' && command.key === 'refresh') {
+                this.loadTreeData()
+            }
+            if (command.key === 'expand') {
+                this.expandCompressTree(true)
+            } else if (command.key === 'compress') {
+                this.expandCompressTree(false)
+            }
+        },
+        expandCompressTree (expanded) {
+            for (let i = 0; i < this.$refs.elTree.store._getAllNodes().length; i++) {
+                this.$refs.elTree.store._getAllNodes()[i].expanded = expanded
+            }
+        },
+        // 点击节点
+        handleNodeClick (data) {
+            const ids = []
+            this.getChildrenIds(data, ids)
+            if (data.id === '0') return
+            this.partyId = data.id
+            this.loadListData()
+        },
 
-    // 加载机构树
-    loadOrgTreeData(init, resetParams = false) {
-      const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-      this.loadingTree = true
-      this.hiddenTree = true
-      if (type === 'script') {
-        this.getScriptData(this.scriptValue)
-        this.loadingTree = false
-        return
-      }
-      const params = {}
-      params.type = type
-      if (resetParams && this.isUseScope) {
-        params.partyId = this.currentOrgIdValue
-        params.includeSub = false
-      }
-      getOrgTreeData(params).then(response => {
-        this.loadingTree = false
-        this.hiddenTree = false
-        // 普通模式
-        if (!this.isUseScope) {
-          if (!init) {
-            const data = response.data
-            this.treeData = TreeUtils.transformToTreeFormat(data)
-            this.setTree(true, this.treeData)
-          }
-          this.treeDatas = response.data
-        } else {
-        // 选择器范围模式
-          if (resetParams) {
-            const data = response.data
-            this.treeData = TreeUtils.transformToTreeFormat(data)
-            this.setTree(true, this.treeData)
-          } else {
-            if (!init) {
-              const data = response.data
-              this.treeData = TreeUtils.transformToTreeFormat(data)
-              this.setTree(true, this.treeData)
+        // 加载机构树
+        loadOrgTreeData (init, resetParams = false) {
+            const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+            this.loadingTree = true
+            this.hiddenTree = true
+            if (type === 'script') {
+                this.getScriptData(this.scriptValue)
+                this.loadingTree = false
+                return
             }
-            this.treeDatas = response.data
-          }
-        }
-      }).catch(() => {
-        this.loadingTree = false
-      })
-    },
-    // 机构数节点函数【懒加载】
-    loadOrgTreeNode(node, resolve) {
-      this.loadingTree = true
-      const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-      const check = this.$utils.isNotEmpty(this.currentOrgIdValue) && node.data.id === '0' && !this.$store.getters.isSuper
-      const params = {}
-      params.type = type
-      if (type === 'script') {
-        if (this.$utils.isEmpty(node.data) || node.data.id === '0') {
-          this.getScriptData(this.scriptValue, true)
-          this.loadingTree = false
-          return
-        } else {
-          params.type = '2'
-        }
-      }
-      params.orgId = node.level === 0 ? null : check ? this.currentOrgIdValue : node.data.id
-      if (type === '5') {
-        params.includeSub = true
-      }
-      getOrgTreeData(params).then(res => {
-        this.loadingTree = false
-        let arr = JSON.parse(JSON.stringify(res.data))
-        //筛选客户 不要了
-        if(arr[0].id != '0' && this.orgAddIndex == 'qita'){
-            arr = arr.filter(item => item.id !== '1041786072788369408')
-        }
-        let treeData
-        if (this.$utils.isNotEmpty(this.isSuperInitTree)) {
-          if (!this.isSuperInitTree.initNode && node.level !== 0) {
-            const nodeData = this.filterTreeChildren(this.toTree(arr), 'node', node.data.id)
-            resolve(this.toTree(nodeData))
-          } else {
-            resolve(this.toTree(arr))
-          }
-        } else if (this.isUseScope && (this.$utils.isEmpty(node.data) || node.data.id === '0')) {
-          // 初始化和查询全部时得数据加载
-          if (this.$utils.isEmpty(node.data) || type === '1') {
-            treeData = arr
-            resolve(this.toTree(treeData))
-          } else {
-            // 类型2,3得初始化数据节点筛选
-            treeData = this.filterTreeChildren(arr, 'root')
-            resolve(this.toTree(treeData))
-          }
-        } else if (this.isUseScope && (this.$utils.isArray(node.data) && node.data[0].id === '0')) {
-          // 节点数据为数组时得初始化处理
-          treeData = arr
-          resolve(this.toTree(treeData))
-        } else if (this.isUseScope && type === '1' && node.data.id !== '0') {
-          resolve(this.toTree(arr))
-        }
-        if (!this.isUseScope && this.$utils.isEmpty(this.isSuperInitTree)) {
-          resolve(this.toTree(arr))
-        }
-      }).catch(res => {
-        this.loadingTree = false
-        resolve([])
-      })
-    },
-    // 加载岗位树
-    loadPositionTreeData(init, resetParams = false) {
-      const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-      this.loadingTree = true
-      this.hiddenTree = true
-      if (type === 'script') {
-        this.getScriptData(this.scriptValue)
-        this.loadingTree = false
-        return
-      }
-      const params = {}
-      params.type = type
-      if (resetParams && this.isUseScope) {
-        params.partyId = this.currentOrgIdValue
-        params.includeSub = false
-      }
-      getPositionTreeData(params).then(response => {
-        this.loadingTree = false
-        this.hiddenTree = false
-        // 普通模式
-        if (!this.isUseScope) {
-          if (!init) {
-            const data = response.data
-            this.treeData = TreeUtils.transformToTreeFormat(data)
-            this.setTree(true, this.treeData)
-          }
-          this.treeDatas = response.data
-        } else {
-        // 选择器范围模式
-          if (resetParams) {
-            const data = response.data
-            this.treeData = TreeUtils.transformToTreeFormat(data)
-            this.setTree(true, this.treeData)
-          } else {
-            if (!init) {
-              const data = response.data
-              this.treeData = TreeUtils.transformToTreeFormat(data)
-              this.setTree(true, this.treeData)
+            const params = {}
+            params.type = type
+            if (resetParams && this.isUseScope) {
+                params.partyId = this.currentOrgIdValue
+                params.includeSub = false
             }
-            this.treeDatas = response.data
-          }
-        }
-      }).catch(() => {
-        this.loadingTree = false
-      })
-    },
-    // 岗位树节点函数
-    loadPosTreeNode(node, resolve) {
-      let params = {}
-      const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-      if (this.isUseScope) {
-        // 选择器范围模式参数
-        params.type = type
-        params.includeSub = type === '1'
-        if (type === '2') {
-          params.partyId = node.level === 0 ? null : node.data.id
-        }
-        if (type === '3') {
-          params.partyId = this.currentOrgIdValue
-        }
-        if (type === '1') {
-          params.posId = node.level === 0 ? null : node.data.id
-        }
-        if (type === 'script') {
-          this.getScriptData(this.scriptValue)
-          this.loadingTree = false
-          return
-        }
-      } else {
-        params.type = '1'
-        params.posId = node.level === 0 ? null : node.data.id
-      }
-      if (this.moreSearchParams) {
-        Object.assign(params, this.moreSearchParams)
-      }
-      if (this.$utils.isEmpty(node.data) || node.data.id === '0') {
-        getPositionTreeData(params).then(res => {
-          this.loadingTree = false
-          const arr = JSON.parse(JSON.stringify(res.data))
-          let treeData
-          if (this.$utils.isEmpty(node.data)) {
-            treeData = arr
-            resolve(this.toTree(treeData))
-          } else {
-            treeData = type !== '2' ? arr : this.filterPositionTreeChildren(arr, 'root')
-            resolve(this.toTree(treeData))
-          }
-        }).catch(res => {
-          this.loadingTree = false
-          resolve([])
-        })
-      } else if (node.data.id !== '0') {
-        if (type === '2') {
-          params = {}
-          params.type = '1'
-          params.posId = node.data.id
-        }
-        getPositionTreeData(params).then(res => {
-          this.loadingTree = false
-          const arr = JSON.parse(JSON.stringify(res.data))
-          resolve(this.toTree(arr))
-        }).catch(res => {
-          this.loadingTree = false
-          resolve([])
-        })
-      }
-    },
-    // 加载角色树
-    loadRoleTreeData() {
-      if (this.isUseScope) {
-        // 选择器范围模式参数
-        const params = { parameters: [], requestPage: {}, sorts: [] }
-        const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-        params.parameters.push({ key: 'type', value: type })
-        if (this.isUseScope) {
-          params.parameters.push({ key: 'includeSub', value: this.partyTypeIdValue === '1' })
-          if (type === '3') {
-            params.parameters.push({ key: 'partyId', value: this.currentOrgIdValue })
-          }
-          if (type === 'script') {
-            this.getScriptData(this.scriptValue)
-            this.loadingTree = false
-            return
-          }
-        }
-        getUseScopeRoleTreeData(params).then(response => {
-          this.loadingTree = false
-          const data = response.data
-          this.treeData = TreeUtils.transformToTreeFormat(data)
-          this.setTree(false, this.treeData)
-          this.checkTreeId(this.treeData)
-        }).catch(() => {
-          this.loadingTree = false
-        })
-      } else {
-        getRoleTreeData().then(response => {
-          const data = response.data
-          data.unshift({
-            id: 0,
-            name: '角色树',
-            parentId: null
-          })
-          findAllSubsystem().then(response => {
-            this.loadingTree = false
-            const subSystemList = response.data
-            subSystemList.forEach(subSystem => {
-              data.push({
-                id: subSystem.id,
-                name: subSystem.name,
-                parentId: 0
-              })
+            getOrgTreeData(params).then(response => {
+                this.loadingTree = false
+                this.hiddenTree = false
+                // 普通模式
+                if (!this.isUseScope) {
+                    if (!init) {
+                        const data = response.data
+                        this.treeData = TreeUtils.transformToTreeFormat(data)
+                        this.setTree(true, this.treeData)
+                    }
+                    this.treeDatas = response.data
+                } else {
+                    // 选择器范围模式
+                    if (resetParams) {
+                        const data = response.data
+                        this.treeData = TreeUtils.transformToTreeFormat(data)
+                        this.setTree(true, this.treeData)
+                    } else {
+                        if (!init) {
+                            const data = response.data
+                            this.treeData = TreeUtils.transformToTreeFormat(data)
+                            this.setTree(true, this.treeData)
+                        }
+                        this.treeDatas = response.data
+                    }
+                }
+            }).catch(() => {
+                this.loadingTree = false
+            })
+        },
+        // 机构数节点函数【懒加载】
+        loadOrgTreeNode (node, resolve) {
+            this.loadingTree = true
+            const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+            const check = this.$utils.isNotEmpty(this.currentOrgIdValue) && node.data.id === '0' && !this.$store.getters.isSuper
+            const params = {}
+            params.type = type
+            if (type === 'script') {
+                if (this.$utils.isEmpty(node.data) || node.data.id === '0') {
+                    this.getScriptData(this.scriptValue, true)
+                    this.loadingTree = false
+                    return
+                } else {
+                    params.type = '2'
+                }
+            }
+            params.orgId = node.level === 0 ? null : check ? this.currentOrgIdValue : node.data.id
+            if (type === '5') {
+                params.includeSub = true
+            }
+            getOrgTreeData(params).then(res => {
+                this.loadingTree = false
+                let arr = JSON.parse(JSON.stringify(res.data))
+                // 筛选客户 不要了
+                // if (arr[0].id != '0' && this.orgAddIndex == 'qita') {
+                arr = arr.filter(item => item.id !== '1041786072788369408')
+                // }
+                let treeData
+                if (this.$utils.isNotEmpty(this.isSuperInitTree)) {
+                    if (!this.isSuperInitTree.initNode && node.level !== 0) {
+                        const nodeData = this.filterTreeChildren(this.toTree(arr), 'node', node.data.id)
+                        resolve(this.toTree(nodeData))
+                    } else {
+                        resolve(this.toTree(arr))
+                    }
+                } else if (this.isUseScope && (this.$utils.isEmpty(node.data) || node.data.id === '0')) {
+                    // 初始化和查询全部时得数据加载
+                    if (this.$utils.isEmpty(node.data) || type === '1') {
+                        treeData = arr
+                        resolve(this.toTree(treeData))
+                    } else {
+                        // 类型2,3得初始化数据节点筛选
+                        treeData = this.filterTreeChildren(arr, 'root')
+                        resolve(this.toTree(treeData))
+                    }
+                } else if (this.isUseScope && (this.$utils.isArray(node.data) && node.data[0].id === '0')) {
+                    // 节点数据为数组时得初始化处理
+                    treeData = arr
+                    resolve(this.toTree(treeData))
+                } else if (this.isUseScope && type === '1' && node.data.id !== '0') {
+                    resolve(this.toTree(arr))
+                }
+                if (!this.isUseScope && this.$utils.isEmpty(this.isSuperInitTree)) {
+                    resolve(this.toTree(arr))
+                }
+            }).catch(res => {
+                this.loadingTree = false
+                resolve([])
+            })
+        },
+        // 加载岗位树
+        loadPositionTreeData (init, resetParams = false) {
+            const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+            this.loadingTree = true
+            this.hiddenTree = true
+            if (type === 'script') {
+                this.getScriptData(this.scriptValue)
+                this.loadingTree = false
+                return
+            }
+            const params = {}
+            params.type = type
+            if (resetParams && this.isUseScope) {
+                params.partyId = this.currentOrgIdValue
+                params.includeSub = false
+            }
+            getPositionTreeData(params).then(response => {
+                this.loadingTree = false
+                this.hiddenTree = false
+                // 普通模式
+                if (!this.isUseScope) {
+                    if (!init) {
+                        const data = response.data
+                        this.treeData = TreeUtils.transformToTreeFormat(data)
+                        this.setTree(true, this.treeData)
+                    }
+                    this.treeDatas = response.data
+                } else {
+                    // 选择器范围模式
+                    if (resetParams) {
+                        const data = response.data
+                        this.treeData = TreeUtils.transformToTreeFormat(data)
+                        this.setTree(true, this.treeData)
+                    } else {
+                        if (!init) {
+                            const data = response.data
+                            this.treeData = TreeUtils.transformToTreeFormat(data)
+                            this.setTree(true, this.treeData)
+                        }
+                        this.treeDatas = response.data
+                    }
+                }
+            }).catch(() => {
+                this.loadingTree = false
+            })
+        },
+        // 岗位树节点函数
+        loadPosTreeNode (node, resolve) {
+            let params = {}
+            const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+            if (this.isUseScope) {
+                // 选择器范围模式参数
+                params.type = type
+                params.includeSub = type === '1'
+                if (type === '2') {
+                    params.partyId = node.level === 0 ? null : node.data.id
+                }
+                if (type === '3') {
+                    params.partyId = this.currentOrgIdValue
+                }
+                if (type === '1') {
+                    params.posId = node.level === 0 ? null : node.data.id
+                }
+                if (type === 'script') {
+                    this.getScriptData(this.scriptValue)
+                    this.loadingTree = false
+                    return
+                }
+            } else {
+                params.type = '1'
+                params.posId = node.level === 0 ? null : node.data.id
+            }
+            if (this.moreSearchParams) {
+                Object.assign(params, this.moreSearchParams)
+            }
+            if (this.$utils.isEmpty(node.data) || node.data.id === '0') {
+                getPositionTreeData(params).then(res => {
+                    this.loadingTree = false
+                    const arr = JSON.parse(JSON.stringify(res.data))
+                    let treeData
+                    if (this.$utils.isEmpty(node.data)) {
+                        treeData = arr
+                        resolve(this.toTree(treeData))
+                    } else {
+                        treeData = type !== '2' ? arr : this.filterPositionTreeChildren(arr, 'root')
+                        resolve(this.toTree(treeData))
+                    }
+                }).catch(res => {
+                    this.loadingTree = false
+                    resolve([])
+                })
+            } else if (node.data.id !== '0') {
+                if (type === '2') {
+                    params = {}
+                    params.type = '1'
+                    params.posId = node.data.id
+                }
+                getPositionTreeData(params).then(res => {
+                    this.loadingTree = false
+                    const arr = JSON.parse(JSON.stringify(res.data))
+                    resolve(this.toTree(arr))
+                }).catch(res => {
+                    this.loadingTree = false
+                    resolve([])
+                })
+            }
+        },
+        // 加载角色树
+        loadRoleTreeData () {
+            if (this.isUseScope) {
+                // 选择器范围模式参数
+                const params = { parameters: [], requestPage: {}, sorts: [] }
+                const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+                params.parameters.push({ key: 'type', value: type })
+                if (this.isUseScope) {
+                    params.parameters.push({ key: 'includeSub', value: this.partyTypeIdValue === '1' })
+                    if (type === '3') {
+                        params.parameters.push({ key: 'partyId', value: this.currentOrgIdValue })
+                    }
+                    if (type === 'script') {
+                        this.getScriptData(this.scriptValue)
+                        this.loadingTree = false
+                        return
+                    }
+                }
+                getUseScopeRoleTreeData(params).then(response => {
+                    this.loadingTree = false
+                    const data = response.data
+                    this.treeData = TreeUtils.transformToTreeFormat(data)
+                    this.setTree(false, this.treeData)
+                    this.checkTreeId(this.treeData)
+                }).catch(() => {
+                    this.loadingTree = false
+                })
+            } else {
+                getRoleTreeData().then(response => {
+                    const data = response.data
+                    data.unshift({
+                        id: 0,
+                        name: '角色树',
+                        parentId: null
+                    })
+                    findAllSubsystem().then(response => {
+                        this.loadingTree = false
+                        const subSystemList = response.data
+                        subSystemList.forEach(subSystem => {
+                            data.push({
+                                id: subSystem.id,
+                                name: subSystem.name,
+                                parentId: 0
+                            })
+                        })
+                        this.treeData = TreeUtils.transformToTreeFormat(data)
+                        this.setTree(false, this.treeData)
+                        this.checkTreeId(this.treeData)
+                    }).catch(() => {
+                        this.loadingTree = false
+                    })
+                }).catch(() => {
+                    this.loadingTree = false
+                })
+            }
+        },
+        // 加载用户组树
+        loadGroupTreeData () {
+            const params = {}
+            const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
+            params.type = type
+            if (this.isUseScope) {
+                // 选择器范围模式参数
+                params.includeSub = type === '1'
+                if (type === '3') {
+                    params.partyId = this.currentOrgIdValue
+                }
+                if (type === 'script') {
+                    this.getScriptData(this.scriptValue)
+                    this.loadingTree = false
+                    return
+                }
+            }
+            getGroupTreeData(params).then(response => {
+                this.loadingTree = false
+                const data = response.data
+                this.treeData = TreeUtils.transformToTreeFormat(data)
+                this.setTree(false, this.treeData)
+                this.checkTreeId(this.treeData)
+            }).catch(() => {
+                this.loadingTree = false
             })
-            this.treeData = TreeUtils.transformToTreeFormat(data)
-            this.setTree(false, this.treeData)
-            this.checkTreeId(this.treeData)
-          }).catch(() => {
-            this.loadingTree = false
-          })
-        }).catch(() => {
-          this.loadingTree = false
-        })
-      }
-    },
-    // 加载用户组树
-    loadGroupTreeData() {
-      const params = {}
-      const type = this.partyTypeIdValue !== '' ? this.partyTypeIdValue : '1'
-      params.type = type
-      if (this.isUseScope) {
-        // 选择器范围模式参数
-        params.includeSub = type === '1'
-        if (type === '3') {
-          params.partyId = this.currentOrgIdValue
-        }
-        if (type === 'script') {
-          this.getScriptData(this.scriptValue)
-          this.loadingTree = false
-          return
         }
-      }
-      getGroupTreeData(params).then(response => {
-        this.loadingTree = false
-        const data = response.data
-        this.treeData = TreeUtils.transformToTreeFormat(data)
-        this.setTree(false, this.treeData)
-        this.checkTreeId(this.treeData)
-      }).catch(() => {
-        this.loadingTree = false
-      })
     }
-  }
 }

+ 383 - 382
src/business/platform/org/employee/panel.vue

@@ -1,79 +1,80 @@
 <template>
-  <ibps-layout ref="layout" style="width: 99%;">
-    <div v-if="showTree" slot="west" :style="{width:width+'px'}"  class="ibps-employee-selector-tree">
-      <div ref="searchForm" class="ibps-tree-search-form">
-        <el-select
-          v-model="partyType"
-          :disabled="currentOrgIdValue===''?false:$store.getters.isSuper?false:!isUseScope"
-          placeholder="请选择"
-          @change="changePartyType"
-        >
-          <el-option
-            v-for="option in partyTypeOptions"
-            :key="option.value"
-            :value="option.value"
-            :label="option.label"
-          />
-        </el-select>
-        <!-- <el-checkbox v-model="inclueChild" :disabled="partyType==='role'||partyType==='group'" style="margin:5px 0 0 5px;">包含子项</el-checkbox> -->
-        <!-- 重置 -->
-      </div>
-      <div v-if="toolbars" ref="toolbar" class="ibps-tree-toolbar">
-        <ibps-toolbar
-          :actions="toolbars"
-          type="icon"
-          @action-event="handleTreeAction"
+    <ibps-layout ref="layout" style="width: 99%;">
+        <div v-if="showTree" slot="west" :style="{width:width+'px'}" class="ibps-employee-selector-tree">
+            <div ref="searchForm" class="ibps-tree-search-form">
+                {{ partyTypeOptions }}
+                <el-select
+                    v-model="partyType"
+                    :disabled="currentOrgIdValue===''?false:$store.getters.isSuper?false:!isUseScope"
+                    placeholder="请选择"
+                    @change="changePartyType"
+                >
+                    <el-option
+                        v-for="option in partyTypeOptions.filter(item => item.value !== 'group')"
+                        :key="option.value"
+                        :value="option.value"
+                        :label="option.label"
+                    />
+                </el-select>
+                <!-- <el-checkbox v-model="inclueChild" :disabled="partyType==='role'||partyType==='group'" style="margin:5px 0 0 5px;">包含子项</el-checkbox> -->
+                <!-- 重置 -->
+            </div>
+            <div v-if="toolbars" ref="toolbar" class="ibps-tree-toolbar">
+                <ibps-toolbar
+                    :actions="toolbars"
+                    type="icon"
+                    @action-event="handleTreeAction"
+                />
+            </div>
+            <div style="height: auto;">
+                <el-scrollbar
+                    style="height: 100%;width:100%; padding-bottom:8px;"
+                    wrap-class="ibps-tree-wrapper ibps-scrollbar-wrapper"
+                >
+                    <el-tree
+                        v-if="!isUseScope||!hiddenTree"
+                        ref="elTree"
+                        v-loading="loadingTree"
+                        :data="treeData"
+                        :expand-on-click-node="false"
+                        :props="{ children: 'children', label: 'name',isLeaf: 'leaf'}"
+                        :default-expanded-keys="defaultExpandedKeys"
+                        :default-expand-all="defaultExpandAll"
+                        :load="lazyTree?partyType==='org'&&partyTypeId==='3'?loadOrgTreeNode3:partyType==='position'?partyTypeId==='3'?loadPosTreeNode3:loadPosTreeNode:loadOrgTreeNode:null"
+                        :lazy="lazyTree"
+                        node-key="id"
+                        pid-key="parentId"
+                        highlight-current
+                        @node-click="handleNodeClick"
+                    />
+                </el-scrollbar>
+            </div>
+        </div>
+        <ibps-crud
+            ref="crud"
+            :height="'auto'"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :pagination="pagination"
+            :loading="loading"
+            :selection-type="multiple?'checkbox':'radio'"
+            @selection-change="handleSelectionChange"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
         />
-      </div>
-      <div style="height: auto;">
-        <el-scrollbar
-          style="height: 100%;width:100%; padding-bottom:8px;"
-          wrap-class="ibps-tree-wrapper ibps-scrollbar-wrapper"
-        >
-          <el-tree
-            v-if="!isUseScope||!hiddenTree"
-            ref="elTree"
-            v-loading="loadingTree"
-            :data="treeData"
-            :expand-on-click-node="false"
-            :props="{ children: 'children', label: 'name',isLeaf: 'leaf'}"
-            :default-expanded-keys="defaultExpandedKeys"
-            :default-expand-all="defaultExpandAll"
-            :load="lazyTree?partyType==='org'&&partyTypeId==='3'?loadOrgTreeNode3:partyType==='position'?partyTypeId==='3'?loadPosTreeNode3:loadPosTreeNode:loadOrgTreeNode:null"
-            :lazy="lazyTree"
-            node-key="id"
-            pid-key="parentId"
-            highlight-current
-            @node-click="handleNodeClick"
-          />
-        </el-scrollbar>
-      </div>
-    </div>
-    <ibps-crud
-      ref="crud"
-      :height="'auto'"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :pagination="pagination"
-      :loading="loading"
-      :selection-type="multiple?'checkbox':'radio'"
-      @selection-change="handleSelectionChange"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    />
-    <more-search
-      :title="title"
-      :visible="dialogFormVisible"
-      class-name="org-panel-more-search-dialog"
-      @callback="search"
-      @close="visible => dialogFormVisible = visible"
-      @action-event="handleMoreSearchAction"
-    />
-  </ibps-layout>
+        <more-search
+            :title="title"
+            :visible="dialogFormVisible"
+            class-name="org-panel-more-search-dialog"
+            @callback="search"
+            @close="visible => dialogFormVisible = visible"
+            @action-event="handleMoreSearchAction"
+        />
+    </ibps-layout>
 </template>
 <script>
 import { getScriptValue } from '@/api/platform/form/formDef'// 脚本
@@ -89,135 +90,135 @@ import MoreSearch from './more-search'
 import SelectionMixin from '@/components/ibps-selector/mixins/selection'
 
 export default {
-  components: {
-    MoreSearch
-  },
-  mixins: [SelectionMixin, selectorScope, panelTree],
-  props: {
-    value: [Object, Array],
-    multiple: Boolean,
-    seetingSearchPartyType: String, // 设置查询用户类型
-    height: {
-      type: String,
-    //   default: '400px'
-    },
-    partyTypeId: { // 类型节点ID
-      type: [String, Number],
-      default: ''
-    },
-    partyTypeScope: String,
-    currentOrgId: { // 当前用户组ID
-      type: [String, Number],
-      default: ''
-    },
-    script: String,
-    customPartyTypeOptions: {
-      type: [Object, Array],
-      default: () => {}
-    },
-    showTree: { // 是否显示左树
-      type: Boolean,
-      default: true
+    components: {
+        MoreSearch
     },
-    isSuperInitTree: { // 是否为超管初始化树类型数据
-      type: Object,
-      default: () => {}
-    },
-    orgAddIndex: {
-      type: String,
-      default: '',
-    },
-    orgAddId:{
-        type: String,
-      default: '',
-    },
-    orgAddList:{
-        type: Array,
-        default: ()=>{
-            return []
+    mixins: [SelectionMixin, selectorScope, panelTree],
+    props: {
+        value: [Object, Array],
+        multiple: Boolean,
+        seetingSearchPartyType: String, // 设置查询用户类型
+        height: {
+            type: String
+            //   default: '400px'
+        },
+        partyTypeId: { // 类型节点ID
+            type: [String, Number],
+            default: ''
+        },
+        partyTypeScope: String,
+        currentOrgId: { // 当前用户组ID
+            type: [String, Number],
+            default: ''
+        },
+        script: String,
+        customPartyTypeOptions: {
+            type: [Object, Array],
+            default: () => {}
+        },
+        showTree: { // 是否显示左树
+            type: Boolean,
+            default: true
+        },
+        isSuperInitTree: { // 是否为超管初始化树类型数据
+            type: Object,
+            default: () => {}
+        },
+        orgAddIndex: {
+            type: String,
+            default: 'qita'
+        },
+        orgAddId: {
+            type: String,
+            default: ''
+        },
+        orgAddList: {
+            type: Array,
+            default: () => {
+                return []
+            }
         }
     },
-  },
-  data() {
-    return {
-      width: 200,
-      dialogFormVisible: false, // 弹窗
-      editId: '',
-      title: '更多查询条件',
-      partyTypeOptions: this.orgAddIndex === 'qita'? this.orgAddList : this.$utils.isNotEmpty(this.customPartyTypeOptions) ? this.customPartyTypeOptions : partyTypeOptions,
-      statusOptions: statusOptions,
-      genderOptions: genderOptions,
-      partyType: this.$utils.isNotEmpty(this.customPartyTypeOptions) ? this.customPartyTypeOptions[0].value : 'org',
-      // inclueChild: true,
-      partyId: '',
-      treeDatas: [],
+    data () {
+        return {
+            width: 200,
+            dialogFormVisible: false, // 弹窗
+            editId: '',
+            title: '更多查询条件',
+            partyTypeOptions: this.orgAddIndex === 'qita' ? this.orgAddList : this.$utils.isNotEmpty(this.customPartyTypeOptions) ? this.customPartyTypeOptions : partyTypeOptions,
+            statusOptions: statusOptions,
+            genderOptions: genderOptions,
+            partyType: this.$utils.isNotEmpty(this.customPartyTypeOptions) ? this.customPartyTypeOptions[0].value : 'org',
+            // inclueChild: true,
+            partyId: '',
+            treeDatas: [],
 
-      // 树配置
-      loadingTree: false,
-      treeData: [],
-      toolbars: [{
-        key: 'refresh'
-      }, {
-        key: 'expand'
-      }, {
-        key: 'compress'
-      }],
-      // 列表配置
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      loading: false,
-      listData: [],
-      loazTreeData: [],
-      listConfig: {
-        // 工具栏
-        toolbars: [
-          { key: 'search' }
-          // { key: 'moreSearch' }
-        ],
-        // 查询条件
-        searchForm: {
-          labelWidth: 50,
-          forms: [
-            { prop: 'Q^FULL_NAME_^SL', label: '姓名', itemWidth: '200' },
-          ]
+            // 树配置
+            loadingTree: false,
+            treeData: [],
+            toolbars: [{
+                key: 'refresh'
+            }, {
+                key: 'expand'
+            }, {
+                key: 'compress'
+            }],
+            // 列表配置
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            loading: false,
+            listData: [],
+            loazTreeData: [],
+            listConfig: {
+                // 工具栏
+                toolbars: [
+                    { key: 'search' }
+                    // { key: 'moreSearch' }
+                ],
+                // 查询条件
+                searchForm: {
+                    labelWidth: 50,
+                    forms: [
+                        { prop: 'Q^FULL_NAME_^SL', label: '姓名', itemWidth: '200' }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '姓名', width: 100 },
+                    { prop: 'createTime', label: '创建时间', width: 100 }
+                ]
+            },
+            pagination: {},
+            sorts: {},
+            moreSearchParams: {},
+            lazyTree: true,
+            defaultExpandedKeys: ['0'],
+            defaultExpandAll: false,
+            lazyOrgTree: true,
+            partyTypeIdValue: '',
+            currentOrgIdValue: '',
+            scriptValue: '',
+            scriptExecuteTime: false, // 脚本函数是否只执行一次
+            hiddenTree: false // 由于树形懒加载load函数的变换,需要重现渲染tree,load才能生效
+        }
+    },
+    computed: {
+        tableHeight () {
+            const h = this.height.substr(0, this.height.length - 2)
+            return parseInt(h)
         },
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '姓名', width: 100 },
-          { prop: 'createTime', label: '创建时间', width: 100 },
-        ]
-      },
-      pagination: {},
-      sorts: {},
-      moreSearchParams: {},
-      lazyTree: true,
-      defaultExpandedKeys: ['0'],
-      defaultExpandAll: false,
-      lazyOrgTree: true,
-      partyTypeIdValue: '',
-      currentOrgIdValue: '',
-      scriptValue: '',
-      scriptExecuteTime: false, // 脚本函数是否只执行一次
-      hiddenTree: false // 由于树形懒加载load函数的变换,需要重现渲染tree,load才能生效
-    }
-  },
-  computed: {
-    tableHeight() {
-      const h = this.height.substr(0, this.height.length - 2)
-      return parseInt(h)
+        changeParams () {
+            const { partyTypeId, currentOrgId, isUseScope, script, partyTypeScope } = this
+            return {
+                partyTypeId,
+                currentOrgId,
+                isUseScope,
+                script,
+                partyTypeScope
+            }
+        }
     },
-    changeParams() {
-      const { partyTypeId, currentOrgId, isUseScope, script, partyTypeScope } = this
-      return {
-        partyTypeId,
-        currentOrgId,
-        isUseScope,
-        script,
-        partyTypeScope
-      }
-    }
-  },
-  watch: {
-    showTree: {
+    watch: {
+        showTree: {
             handler: function (val, oldVal) {
                 this.lazyTree = this.partyType === 'org'
                 if (val === false) {
@@ -239,215 +240,215 @@ export default {
                     ]
                 }
             },
-      immediate: true
+            immediate: true
+        },
+        changeParams: {
+            handler: function (newval, oldval) {
+                this.partyTypeIdValue = newval.partyTypeId
+                this.currentOrgIdValue = newval.currentOrgId
+                this.scriptValue = newval.script
+                // 普通模式与选择器范围模式切换调用
+                let initDesignatedAType // 机构和岗位懒加载时的特殊处理参数【类型为3时的切换】
+                if (oldval === undefined) {
+                    initDesignatedAType = false
+                } else {
+                    if ((newval.partyTypeScope === 'org' || newval.partyTypeScope === 'position') && newval.partyTypeId === '3') {
+                        initDesignatedAType = false
+                    } else {
+                        initDesignatedAType = true
+                    }
+                }
+                newval.isUseScope ? this.loadTreeData(true, initDesignatedAType) : null
+            },
+            deep: true,
+            immediate: true
+        }
     },
-    changeParams: {
-      handler: function(newval, oldval) {
-        this.partyTypeIdValue = newval.partyTypeId
-        this.currentOrgIdValue = newval.currentOrgId
-        this.scriptValue = newval.script
-        // 普通模式与选择器范围模式切换调用
-        let initDesignatedAType // 机构和岗位懒加载时的特殊处理参数【类型为3时的切换】
-        if (oldval === undefined) {
-          initDesignatedAType = false
+    mounted () {
+        if (this.showTree) {
+            if (this.isUseScope) return
+            this.loadTreeData(true)
         } else {
-          if ((newval.partyTypeScope === 'org' || newval.partyTypeScope === 'position') && newval.partyTypeId === '3') {
-            initDesignatedAType = false
-          } else {
-            initDesignatedAType = true
-          }
+            this.loadListData()
         }
-        newval.isUseScope ? this.loadTreeData(true, initDesignatedAType) : null
-      },
-      deep: true,
-      immediate: true
-    }
-  },
-  mounted() {
-    if (this.showTree) {
-      if (this.isUseScope) return
-      this.loadTreeData(true)
-    } else {
-      this.loadListData()
-    }
-  },
-  methods: {
+    },
+    methods: {
     /**
      * 加载数据
      */
-    loadListData() {
-      let type = this.partyType
-      this.loading = true
-      if (this.showTree) {
-        if (this.$utils.isNotEmpty(this.partyId) || this.isUseScope) {
-          type = this.partyType
-        } else if (this.currentOrgIdValue && this.currentOrgIdValue !== '') {
-          type = 'org'
-        }
-        query(type, this.getFormatParams()).then(response => {
-          this.loading = false
-          ActionUtils.handleListData(this, response.data)
-          this.setSelectRow()
-        }).catch(() => {
-          this.loading = false
-        })
-      } else if (this.seetingSearchPartyType === 'position') {
-        queryWithOrg4Position(this.getFormatParams()).then(response => {
-          this.loading = false
-          ActionUtils.handleListData(this, response.data)
-          this.setSelectRow()
-        }).catch(() => {
-          this.loading = false
-        })
-      } else if (this.$utils.isNotEmpty(this.currentOrgIdValue)) {
-        queryWoutOrg(this.getFormatParams()).then(response => {
-          this.loading = false
-          ActionUtils.handleListData(this, response.data)
-          this.setSelectRow()
-        }).catch(() => {
-          this.loading = false
-        })
-      } else {
-        queryPageList(this.getFormatParams()).then(response => {
-          this.loading = false
-          ActionUtils.handleListData(this, response.data)
-          this.setSelectRow()
-        }).catch(() => {
-          this.loading = false
-        })
-      }
-    },
-    getScriptData(scriptValue, once = false) {
-      if (this.scriptExecuteTime) return
-      getScriptValue({
-        script: scriptValue,
-        vars: ''
-      }).then(response => {
-        const data = JSON.parse(response.data)
-        this.treeData = TreeUtils.transformToTreeFormat(data.data)
-        this.setTree(this.partyType === 'org', this.treeData)
-        this.scriptExecuteTime = once
-      })
-    },
-    /**
+        loadListData () {
+            let type = this.partyType
+            this.loading = true
+            if (this.showTree) {
+                if (this.$utils.isNotEmpty(this.partyId) || this.isUseScope) {
+                    type = this.partyType
+                } else if (this.currentOrgIdValue && this.currentOrgIdValue !== '') {
+                    type = 'org'
+                }
+                query(type, this.getFormatParams()).then(response => {
+                    this.loading = false
+                    ActionUtils.handleListData(this, response.data)
+                    this.setSelectRow()
+                }).catch(() => {
+                    this.loading = false
+                })
+            } else if (this.seetingSearchPartyType === 'position') {
+                queryWithOrg4Position(this.getFormatParams()).then(response => {
+                    this.loading = false
+                    ActionUtils.handleListData(this, response.data)
+                    this.setSelectRow()
+                }).catch(() => {
+                    this.loading = false
+                })
+            } else if (this.$utils.isNotEmpty(this.currentOrgIdValue)) {
+                queryWoutOrg(this.getFormatParams()).then(response => {
+                    this.loading = false
+                    ActionUtils.handleListData(this, response.data)
+                    this.setSelectRow()
+                }).catch(() => {
+                    this.loading = false
+                })
+            } else {
+                queryPageList(this.getFormatParams()).then(response => {
+                    this.loading = false
+                    ActionUtils.handleListData(this, response.data)
+                    this.setSelectRow()
+                }).catch(() => {
+                    this.loading = false
+                })
+            }
+        },
+        getScriptData (scriptValue, once = false) {
+            if (this.scriptExecuteTime) return
+            getScriptValue({
+                script: scriptValue,
+                vars: ''
+            }).then(response => {
+                const data = JSON.parse(response.data)
+                this.treeData = TreeUtils.transformToTreeFormat(data.data)
+                this.setTree(this.partyType === 'org', this.treeData)
+                this.scriptExecuteTime = once
+            })
+        },
+        /**
      * 获取查询条件格式化参数
      */
-    getFormatParams() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      const key = this.partyType === 'org' ? 'orgId' : this.partyType === 'position' ? 'positionId' : this.partyType === 'role' ? 'roleId' : this.partyType === 'group' ? 'groupId' : ''
-      if (this.showTree) {
-        if (this.$utils.isNotEmpty(this.partyId) || this.currentOrgIdValue !== '') {
-          if (this.partyId !== 0 && this.partyId !== '0') {
-            params[key] = this.partyId === '' ? this.currentOrgIdValue : this.partyId
-          }
-        } else {
-          params[key] = this.partyTypeId === '1' ? '' : this.partyTypeId
-        }
-      }
-      if (this.seetingSearchPartyType === 'position') {
-        params['positionId'] = this.partyTypeId
-      }
-      if (this.moreSearchParams) {
-        Object.assign(params, this.moreSearchParams)
-      }
-      // if (this.$utils.isNotEmpty(this.currentOrgId)) {
-      //   params['orgId'] = this.partyId || this.currentOrgId
-      // }
-      //筛选客户不要了
-      if(this.orgAddIndex=='qita' && this.partyId=='' && this.partyType == 'org'){
-        params['orgId'] = this.orgAddId
-      }
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
-    },
-    /**
+        getFormatParams () {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            const key = this.partyType === 'org' ? 'orgId' : this.partyType === 'position' ? 'positionId' : this.partyType === 'role' ? 'roleId' : this.partyType === 'group' ? 'groupId' : ''
+            if (this.showTree) {
+                if (this.$utils.isNotEmpty(this.partyId) || this.currentOrgIdValue !== '') {
+                    if (this.partyId !== 0 && this.partyId !== '0') {
+                        params[key] = this.partyId === '' ? this.currentOrgIdValue : this.partyId
+                    }
+                } else {
+                    params[key] = this.partyTypeId === '1' ? '' : this.partyTypeId
+                }
+            }
+            if (this.seetingSearchPartyType === 'position') {
+                params['positionId'] = this.partyTypeId
+            }
+            if (this.moreSearchParams) {
+                Object.assign(params, this.moreSearchParams)
+            }
+            // if (this.$utils.isNotEmpty(this.currentOrgId)) {
+            //   params['orgId'] = this.partyId || this.currentOrgId
+            // }
+            // 筛选客户不要了
+            if (this.orgAddIndex == 'qita' && this.partyId == '' && this.partyType == 'org') {
+                params['orgId'] = this.orgAddId
+            }
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        /**
      * 处理分页事件
      */
-    handlePaginationChange(page) {
-      this.changePageCoreRecordData()
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadListData()
-    },
-    /**
+        handlePaginationChange (page) {
+            this.changePageCoreRecordData()
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadListData()
+        },
+        /**
      * 处理排序
      */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadListData()
-    },
-    /**
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadListData()
+        },
+        /**
      * 查询
      */
-    search() {
-      this.loadListData()
-    },
-    /**
+        search () {
+            this.loadListData()
+        },
+        /**
      * 重置查询条件
      */
-    reset() {
-      this.$refs['crud'].handleReset()
-    },
-    /**
+        reset () {
+            this.$refs['crud'].handleReset()
+        },
+        /**
      * 处理按钮事件
      */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        case 'moreSearch':// 更多
-          this.handleMoreSearch()
-          break
-        default:
-          break
-      }
-    },
-    /**
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                case 'moreSearch':// 更多
+                    this.handleMoreSearch()
+                    break
+                default:
+                    break
+            }
+        },
+        /**
      * 处理按钮事件
      */
-    handleMoreSearchAction(data) {
-      ActionUtils.setFirstPagination(this.pagination)
-      this.moreSearchParams = data
-      this.loadListData()
-    },
-    /**
+        handleMoreSearchAction (data) {
+            ActionUtils.setFirstPagination(this.pagination)
+            this.moreSearchParams = data
+            this.loadListData()
+        },
+        /**
      * 处理更多
      */
-    handleMoreSearch() {
-      this.dialogFormVisible = true
-    },
-    changePartyType(value) {
-      this.loadingTree = true
-      if (this.isUseScope) {
-        this.hiddenTree = true
-      }
-      this.partyType = value
-      const ref = this.$refs.elTree
-      const { loadPosTreeNode, loadPosTreeNode3, loadOrgTreeNode3, loadOrgTreeNode } = this
-      ref.store.load = value === 'position' ? this.partyTypeId === '3' ? loadPosTreeNode3 : loadPosTreeNode : value === 'org' ? this.partyTypeId === '3' ? loadOrgTreeNode3 : loadOrgTreeNode : null
-      // 选择器范围模式函数回调
-      this.moreSearchParams = {}
-      // 普通模式与选择器范围模式切换调用
-      !this.isUseScope ? this.loadTreeData() : null
-      this.scriptExecuteTime = false // 初始化脚本类型时的函数调用
-      this.$emit('change-party-type', value)
-    },
-    getChildrenIds(data, list) {
-      list.push(data.id)
-      const children = data.children
-      if (this.$utils.isNotEmpty(children)) {
-        for (let i = 0; i < children.length; i++) {
-          const element = children[i]
-          this.getChildrenIds(element, list)
+        handleMoreSearch () {
+            this.dialogFormVisible = true
+        },
+        changePartyType (value) {
+            this.loadingTree = true
+            if (this.isUseScope) {
+                this.hiddenTree = true
+            }
+            this.partyType = value
+            const ref = this.$refs.elTree
+            const { loadPosTreeNode, loadPosTreeNode3, loadOrgTreeNode3, loadOrgTreeNode } = this
+            ref.store.load = value === 'position' ? this.partyTypeId === '3' ? loadPosTreeNode3 : loadPosTreeNode : value === 'org' ? this.partyTypeId === '3' ? loadOrgTreeNode3 : loadOrgTreeNode : null
+            // 选择器范围模式函数回调
+            this.moreSearchParams = {}
+            // 普通模式与选择器范围模式切换调用
+            !this.isUseScope ? this.loadTreeData() : null
+            this.scriptExecuteTime = false // 初始化脚本类型时的函数调用
+            this.$emit('change-party-type', value)
+        },
+        getChildrenIds (data, list) {
+            list.push(data.id)
+            const children = data.children
+            if (this.$utils.isNotEmpty(children)) {
+                for (let i = 0; i < children.length; i++) {
+                    const element = children[i]
+                    this.getChildrenIds(element, list)
+                }
+            }
+            return list
         }
-      }
-      return list
-    }
 
-  }
+    }
 }
 </script>
 <style lang="scss" >

+ 1 - 1
src/views/component/personnelFile/components/gzjlTag.vue

@@ -361,7 +361,7 @@ export default {
             if (this.nowData.length % 10 === 0) {
                 this.currentPage = (this.nowData.length / 10) + 1
             }
-            const mid = { ruZhiShiJian: '2024-09-12', liZhiShiJian: '2024-09-13', uuid: this.$common.generateUUID() }
+            const mid = { ruZhiShiJian: '', liZhiShiJian: '', uuid: this.$common.generateUUID() }
             this.nowData.push(mid)
             this.nowDataObj = { nowData: [...this.nowData] }
         },