shenqilong 1 год назад
Родитель
Сommit
59c8b4caac
2 измененных файлов с 24 добавлено и 19 удалено
  1. 14 12
      src/views/platform/cat/type/edit.vue
  2. 10 7
      src/views/platform/cat/type/manage.vue

+ 14 - 12
src/views/platform/cat/type/edit.vue

@@ -142,8 +142,8 @@
                         </el-radio>
                     </el-radio-group>
                 </el-form-item>
-                <el-form-item
-                    v-show="categoryKey==='FILE_TYPE'"
+                <!-- <el-form-item
+                    v-show="categoryKey==='FILE_TYPE(不显示)'"
                     label="体系审查:"
                     prop="authorityObject.shenCha"
                 >
@@ -156,11 +156,11 @@
                     </el-radio-group>
                     <span v-else>{{ type.authorityObject.shenCha }}</span>
                 </el-form-item>
-                <el-form-item v-show="categoryKey==='FILE_TYPE'">
+                <el-form-item v-show="categoryKey==='FILE_TYPE(不显示)'">
                     <span>需要进行体系文件审查的文件类型请选择“需要”,子节点有需要进行文件审查的话,父节点也需要选择“需要”</span>
                 </el-form-item>
                 <el-form-item
-                    v-show="categoryKey==='FILE_TYPE'"
+                    v-show="categoryKey==='FILE_TYPE(不显示)'"
                     label="审核审批走向:"
                     prop="authorityObject.shenHeZouXiang"
                 >
@@ -173,7 +173,7 @@
                         <el-radio label="jspbgz">仅审批、不盖章</el-radio>
                     </el-radio-group>
                     <span v-else>{{ zouXiang[type.authorityObject.shenHeZouXiang] }}</span>
-                </el-form-item>
+                </el-form-item> -->
 
                 <el-form-item v-show="categoryKey==='FLOW_TYPE'" label="分类类型:" prop="authorityObject.fenLei">
                     <el-radio-group v-model="type.authorityObject.fenLei" :disabled="readonly">
@@ -425,20 +425,20 @@ export default {
             }
             get({ typeId: this.formId }).then(response => {
                 this.$refs[this.formName].clearValidate()
-                this.type = response.data
-                console.log('bbb')
-
-                this.type.authorityObject = response.data.authorityObject ? JSON.parse(response.data.authorityObject) : { chaYue: '', buMen: '', shenCha: '', shenHeZouXiang: '', fenLei: '通用' }
-
+                const data = response.data
+                data.authorityName = response.data.authorityName ? JSON.parse(response.data.authorityName) : '{"chaYue":"","buMen":"","shenCha":"","shenHeZouXiang":"","fenLei":""}'
+                data.authorityObject = response.data.authorityObject ? JSON.parse(response.data.authorityObject) : { chaYue: '', buMen: '', shenCha: '', shenHeZouXiang: '', fenLei: '' }
+                this.type = data
                 this.isPrivateLocal = !((this.$utils.isEmpty(this.type.ownerId) || this.type.ownerId === '0'))
             }).catch(() => { })
         },
         getRadioOptions () {
             this.type.authorityObject.buMen = ''
-            const sql = `select * FROM  ibps_party_entity WHERE party_type_='position' )`
+            const sql = `select * FROM  ibps_party_org`
             curdPost('sql', sql).then(res => {
                 const datas = res.variables.data
-                const treeDatas = this.buildTree(datas, 'ID_', 'PARENT_ID_')
+                // const treeDatas = this.buildTree(datas, 'ID_', 'ID_')
+                const treeDatas = datas
                 const tree = []
                 for (const i in treeDatas) {
                     tree.push(treeDatas[i])
@@ -448,6 +448,8 @@ export default {
         },
         radioChangeHandle (h) {
             if (h === '部门查阅') {
+                console.log(this.type.authorityObject.buMen, this.parentData)
+
                 this.type.authorityObject.buMen = JSON.parse(this.parentData.authorityName).buMen
                 if (this.cascaderOptions.length === 0) {
                     this.getRadioOptions()

+ 10 - 7
src/views/platform/cat/type/manage.vue

@@ -90,10 +90,8 @@ export default {
     },
     mixins: [FixHeight],
     data () {
-        const { first, second } = this.$store.getters.level || {}
         return {
             width: 200,
-            level: second || first,
             height: document.clientHeight,
             importFormVisible: false,
             sortFormVisible: false,
@@ -216,19 +214,24 @@ export default {
             const whereParams = {
                 'categoryKey': this.categoryKey
             }
-            if (this.categoryKey === 'FILE_TYPE') {
-                whereParams.diDian = this.level
-            }
             findTreeData(whereParams).then(response => {
                 const data = response.data
-                this.treeData = data
+                // 处理isShow,父级节点不显示子节点都不显示
+                const noData = data.filter(item => item.isShow === '1')
+                const noIdList = noData.map((obj, index) => { return obj.id }).join(',').split(',')
+                const tree = data.filter(item => item.isShow !== '1' && !noIdList.includes(item.parentId))
+                // 处理authorityObject返回数据为空的问题
+                for (const item of tree) {
+                    item.authorityName = item.authorityName || '{"chaYue":"","buMen":"","shenCha":"","shenHeZouXiang":"","fenLei":""}'
+                    item.authorityObject = item.authorityObject || { chaYue: '', buMen: '', shenCha: '', shenHeZouXiang: '', fenLei: '' }
+                }
+                this.treeData = tree
                 this.show = isEdit
             })
         },
         handleTreeAction (command, position, selection, data) {
             if (data?.sn === 0 && data?.name === '文件分类') {
                 const object = {
-                    diDian: this.level,
                     buMen: '',
                     chaYue: '公用查阅',
                     shenCha: '不需要',