Explorar el Código

fix:将需要体系文件审查的文件放进文件分类设置里,并在体系文件核查中添加文件类型选

liujiayin hace 2 años
padre
commit
a810f08a9a

+ 86 - 0
src/views/component/selectFileTypeToShenCha.vue

@@ -0,0 +1,86 @@
+<template>
+  <el-cascader ref="cascader"
+               v-model="selectDatas"
+               :options="options"
+               :props="props"
+               collapse-tags
+               class="cascader"
+               clearable>
+  </el-cascader>
+</template>
+  
+  <script>
+import curdPost from "@/business/platform/form/utils/custom/joinCURD.js";
+import TreeUtils from "@/utils/tree";
+
+export default {
+  data() {
+    const { level, userId, userInfo } = this.$store.getters;
+    return {
+      level,
+      userId,
+      userInfo,
+      props: {
+        children: "children",
+        label: "name_",
+        value: "ID_",
+        multiple: true,
+        expandTrigger: "hover",
+      },
+      sqlDatas: [],
+      options: [],
+      selectDatas: [],
+      iniselectDatas: [],
+    };
+  },
+  mounted() {
+    this.getPositionList();
+  },
+  methods: {
+    // 获取本账户所在的部门
+    getPositionList() {
+      let sql = `select *FROM ibps_cat_type where category_key_ ='FILE_TYPE' 
+      and AUTHORITY_NAME LIKE '%${this.level.second ? this.level.second : this.level.first}%'
+      and AUTHORITY_NAME LIKE '%"需要"%'`;
+      curdPost("sql", sql).then((res) => {
+        if (res.state === 200) {
+          const datas = res.variables.data;
+          this.sqlDatas = datas
+          let positionsValue = [];
+          if (datas.length > 0) {
+            this.options = this.toTree(datas);
+          }
+        }
+      });
+    },
+    toTree(data) {
+      return TreeUtils.transformToTreeFormat(data, {
+        idKey: "ID_",
+        pIdKey: "PARENT_ID_",
+        childrenKey: "children",
+      });
+    },
+  },
+  watch: {
+    selectDatas(v) {
+      let typeId = []
+      let typeNames = []
+      if (v.length !== 0) {
+        for (var i of v) {
+          let typeName = []
+          for (let index = 0; index < i.length; index++) {
+            typeName.push(this.sqlDatas.find(item => item.ID_ ==  i[index]).name_)
+          }
+          typeId.push(i[i.length - 1])
+          typeNames.push(typeName.join(' / '))
+        }
+        this.$emit("change-data", "xiLeiId", typeId.join(','));
+        this.$emit("change-data", "xiLeiXuanZe", typeNames.join(','));
+
+      }
+    },
+  }
+};
+</script>
+<style lang="less" scoped>
+</style>

+ 22 - 3
src/views/platform/cat/type/edit.vue

@@ -117,6 +117,20 @@
             </el-radio>
           </el-radio-group>
         </el-form-item>
+        <el-form-item label="体系审查:"
+                      prop="authorityObject.shenCha"
+                      v-show="categoryKey==='FILE_TYPE'">
+          <el-radio-group v-if="!readonly"
+                          v-model="type.authorityObject.shenCha"
+                          >
+            <el-radio label="需要">需要</el-radio>
+            <el-radio label="不需要">不需要</el-radio>
+          </el-radio-group>
+          <span v-else>{{ type.authorityObject.shenCha }}</span>
+        </el-form-item>
+        <el-form-item v-show="categoryKey==='FILE_TYPE'">
+            <span >需要进行体系文件审查的文件类型请选择“需要”,子节点有需要进行文件审查的话,父节点也需要选择“需要”</span>
+        </el-form-item>
       </el-form>
     </ibps-container>
   </div>
@@ -163,7 +177,6 @@ export default {
       dialogLoading: false,
       isPrivateLocal: false,
       topKey: '',
-
       srtuOptions: srtuOptions,
       defaultForm: {},
       type: {
@@ -172,7 +185,7 @@ export default {
         typeKey: '',
         ownerId: '0',
         authorityObject: {
-          chaYue: '', buMen: ''
+          chaYue: '', buMen: '',shenCha:''
         }
       },
       rules: {
@@ -180,7 +193,8 @@ export default {
         typeKey: [{ required: true, validator: validateKey }],
         authorityObject: {
           chaYue: [{ required: false }],
-          buMen: [{ required: false }]
+          buMen: [{ required: false }],
+          shenCha: [{ required: false }]
         }
       },
       toolbars: [
@@ -270,6 +284,11 @@ export default {
       } else {
         this.rules.authorityObject.chaYue = [{ required: false }]
       }
+      if (!this.type.authorityObject.shneCha && this.categoryKey === 'FILE_TYPE') {
+        this.rules.authorityObject.shneCha = [{ required: true, message: "审查选择不得为空!" }]
+      } else {
+        this.rules.authorityObject.shneCha = [{ required: false }]
+      }
       if (this.type.authorityObject.chaYue == '部门查阅' && (!this.type.authorityObject.buMen || this.type.authorityObject.buMen.length == 0)) {
         this.rules.authorityObject.buMen = [{ required: true, message: "部门选择不得为空!" }]
       } else {

+ 15 - 12
src/views/platform/cat/type/manage.vue

@@ -187,6 +187,16 @@ export default {
             })
         },
         handleTreeAction (command, position, selection, data) {
+            console.log('data',data)
+            if(data.sn == 0 && data.name == "文件分类"){
+                const object = {
+                    diDian:this.diDian,
+                    buMen:"",
+                    chaYue:"公用查阅",
+                    shenCha:"不需要"
+                }
+                data.authorityName = JSON.stringify(object)
+            }
             if (position === 'toolbar') {
                 if (command === 'refresh') {
                     this.loadTreeData()
@@ -200,14 +210,6 @@ export default {
                         return
                     }
                     this.editId = null
-                    if(data.sn == 0 && data.name == "文件分类"){
-                        const object = {
-                            diDian:this.diDian,
-                            buMen:"",
-                            chaYue:"公用查阅"
-                        }
-                        data.authorityName = JSON.stringify(object)
-                    }
                     this.nodeData = data
                     this.isPrivate = false
                     this.handTreeEdit()
@@ -218,6 +220,7 @@ export default {
                     if (this.isSpecial(data.name,3)) {
                         return
                     }
+                    
                     this.editId = null
                     this.isPrivate = true
                     this.nodeData = data
@@ -311,12 +314,12 @@ export default {
             //     return true
             // }
             if (this.categoryKey === 'FILE_TYPE' && fileType.includes(name) && type == '1') {
-                ActionUtils.warning('请不要操作内部文件、外部文件、记录表单分类!!如果需要更改,请联系管理员。')
-                return true
+                ActionUtils.warning('涉及系统代码逻辑,请谨慎操作内部文件、外部文件、记录表单分类!!如果需要更改,请联系管理员。')
+                return false
             }
              if (this.categoryKey === 'FILE_TYPE' && name=='记录表单' && type == '3') {
-                ActionUtils.warning('请不要操作记录表单!!如果需要更改,请联系管理员。')
-                return true
+                ActionUtils.warning('涉及系统代码逻辑,请谨慎操作记录表单!!如果需要更改,请联系管理员。')
+                return false
             }
             return false
         }