소스 검색

应急预案管理\文件管理\通讯录\请假管理\政策法规\工作日志添加部门查询栏目

刘浩男 1 년 전
부모
커밋
acd6a94e27

+ 17 - 1
data-ui/src/views/data/generalbusiness/communication/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"  @submit.native.prevent>
       <el-form-item label="姓名" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -17,6 +17,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -233,6 +242,8 @@
           name: null,
           sex: null,
           phone: null,
+          deptId: null,
+          deptName: 0,
           mobile: null,
           address: null,
           firstLetter: null,
@@ -328,6 +339,7 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
@@ -409,6 +421,10 @@
         this.download('sooka-sponest-center-data/communication/export', {
           ...this.queryParams
         }, `通讯录_${new Date().getTime()}.xlsx`)
+      },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
       }
     }
   };

+ 39 - 2
data-ui/src/views/data/generalbusiness/daily/index.vue

@@ -1,12 +1,21 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" l @submit.native.prevent>
       <el-form-item label="日报时间" prop="dailyTime">
         <el-date-picker clearable v-model="queryParams.dailyTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择日报时间"></el-date-picker>
       </el-form-item>
       <el-form-item label="日报标题" prop="dailyTitle">
         <el-input v-model="queryParams.dailyTitle" placeholder="请输入日报标题" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName === 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <!--<el-form-item label="部门名称" prop="deptName">
         <el-input
           v-model="queryParams.deptName"
@@ -121,8 +130,18 @@
 
 <script>
 import { listDaily, getDaily, delDaily, addDaily, updateDaily } from '@/api/data/generalbusiness/daily/daily';
+import {treeselect} from "@/api/system/dept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import deptselector from '@/views/components/deptselector.vue'
+import fileUpload from '@/views/components/FileUpload/index.vue'
 
 export default {
+  components:{
+    Treeselect,
+    deptselector,
+    fileUpload
+  },
   name: 'Daily',
   data() {
     return {
@@ -144,6 +163,8 @@ export default {
       title: '',
       // 是否显示弹出层
       open: false,
+      // 部门树选项
+      deptOptions: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -155,7 +176,7 @@ export default {
         dailyTitle: null,
         dailyContent: null,
         deptId: null,
-        deptName: null,
+        deptName: 0,
         createName:null
       },
       // 表单参数
@@ -166,8 +187,19 @@ export default {
   },
   created() {
     this.getList();
+    this.getTreeselect();
   },
   methods: {
+  hx(node) {
+    this.form.deptId = node.id
+    this.form.deptName = node.label
+  },
+  /** 查询部门下拉树结构 */
+  getTreeselect() {
+    treeselect().then(response => {
+      this.deptOptions = response.data;
+    });
+  },
     /** 查询日报列表 */
     getList() {
       this.loading = true;
@@ -208,6 +240,7 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.deptName = 0;
       this.resetForm('queryForm');
       this.handleQuery();
     },
@@ -276,6 +309,10 @@ export default {
         },
         `daily_${new Date().getTime()}.xlsx`
       );
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
     }
   }
 };

+ 16 - 1
data-ui/src/views/data/generalbusiness/file/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"  @submit.native.prevent>
       <!--      <el-form-item label="创建人姓名" prop="createName">-->
       <!--        <el-input-->
       <!--          v-model="queryParams.createName"-->
@@ -33,6 +33,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName === 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <!--      <el-form-item label="父项ID" prop="parentId">-->
       <!--        <el-input-->
       <!--          v-model="queryParams.parentId"-->
@@ -206,6 +215,7 @@
           updateName: null,
           dataStatus: null,
           deptId: null,
+          deptName: 0,
           name: null,
           parentId: null,
           type: null
@@ -306,6 +316,7 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
@@ -380,6 +391,10 @@
         this.download('sooka-sponest-center-data/file/export', {
           ...this.queryParams
         }, `文件管理_${new Date().getTime()}.xlsx`)
+      },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
       }
     }
   };

+ 15 - 2
data-ui/src/views/data/generalbusiness/leave/index.vue

@@ -6,7 +6,6 @@
       size="small"
       :inline="true"
       v-show="showSearch"
-      label-width="68px"
       @submit.native.prevent
     >
       <!--<el-form-item label="数据所属部门(政或党的id)" prop="dataDeptId">-->
@@ -42,6 +41,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <!--  <el-form-item label-width="auto" label="所属部门" prop="deptName">
         <el-input
           v-model="queryParams.deptName"
@@ -429,7 +437,7 @@ export default {
         forestLeaveStatus: null,
         leaveMatter: null,
         deptId: null,
-        deptName: null,
+        deptName: 0,
         leaveUserId: null,
         leaveUserName: null,
         id:null
@@ -558,6 +566,7 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.deptName = 0;
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -637,6 +646,10 @@ export default {
         `请假申请_${new Date().getTime()}.xlsx`
       );
     },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
+    }
   },
 };
 </script>

+ 17 - 3
data-ui/src/views/data/generalbusiness/regulations/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" @submit.native.prevent>
       <el-form-item label="名称" prop="regName">
         <el-input
           v-model="queryParams.regName"
@@ -9,6 +9,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName === 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -300,7 +309,7 @@
           regNumber: null,
           regTime: null,
           deptId: null,
-          deptName: null,
+          deptName: 0,
           attachId: null
         },
         // 表单参数
@@ -406,7 +415,7 @@
           regNumber: null,
           regTime: null,
           deptId: null,
-          deptName: null,
+          deptName: 0,
           attachId: null,
         };
         this.fileNames = []
@@ -419,6 +428,7 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
@@ -511,6 +521,10 @@
         this.download('sooka-sponest-center-data/regulations/export', {
           ...this.queryParams
         }, `政策法规_${new Date().getTime()}.xlsx`)
+      },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
       }
     }
   };

+ 17 - 3
data-ui/src/views/data/generalbusiness/reserve/index.vue

@@ -1,7 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"
-             @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" @submit.native.prevent>
       <!--      <el-form-item label="数据所属部门(政或党的id)" prop="dataDeptId">-->
       <!--        <el-input-->
       <!--          v-model="queryParams.dataDeptId"-->
@@ -18,6 +17,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName === 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
+
       <!-- <el-form-item label="简介" prop="resIntroduction">
          <el-input
            v-model="queryParams.resIntroduction"
@@ -276,7 +285,7 @@ export default {
         resIntroduction: null,
         releaseStatus: null,
         deptId: null,
-        deptName: null,
+        deptName: 0,
         attachId: null
       },
       // 表单参数
@@ -387,6 +396,7 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.deptName = 0;
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -481,6 +491,10 @@ export default {
       this.download('sooka-sponest-center-data/reserve/export', {
         ...this.queryParams
       }, `应急预案_${new Date().getTime()}.xlsx`)
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
     }
   }
 };

+ 8 - 0
src/main/resources/mapper/generalbusiness/CenterdataTCommunicationMapper.xml

@@ -48,6 +48,14 @@
             <if test="firstLetter != null  and firstLetter != ''">and first_letter = #{firstLetter}</if>
             <if test="pinyin != null  and pinyin != ''">and pinyin = #{pinyin}</if>
             <if test="releaseStatus != null and releaseStatus != ''">and release_status = #{releaseStatus}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 2
src/main/resources/mapper/generalbusiness/CenterdataTDailyMapper.xml

@@ -36,8 +36,14 @@
             <if test="dailyTime != null ">and daily_time = #{dailyTime}</if>
             <if test="dailyTitle != null  and dailyTitle != ''">and daily_title like concat('%',#{dailyTitle},'%') </if>
             <if test="dailyContent != null  and dailyContent != ''">and daily_content = #{dailyContent}</if>
-            <if test="deptId != null ">and dept_id = #{deptId}</if>
-            <if test="deptName != null  and deptName != ''">and a.dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 1
src/main/resources/mapper/generalbusiness/CenterdataTFileMapper.xml

@@ -35,7 +35,14 @@
             <if test="updateName != null  and updateName != ''">and update_name like concat('%', #{updateName}, '%')
             </if>
             <if test="dataStatus != null  and dataStatus != ''">and data_status = #{dataStatus}</if>
-            <if test="deptId != null ">and dept_id = #{deptId}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="parentId != null  and parentId != ''">and a.parent_id = #{parentId}</if>
             <if test="type != null  and type != ''">and type = #{type}</if>

+ 8 - 2
src/main/resources/mapper/generalbusiness/CenterdataTLeaveMapper.xml

@@ -166,8 +166,14 @@
                 #{forestLeaveStatus}
             </if>
             <if test="leaveMatter != null  and leaveMatter != ''">and leave_matter = #{leaveMatter}</if>
-            <if test="deptId != null ">and dept_id = #{deptId}</if>
-            <if test="deptName != null  and deptName != ''">and d.dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             <if test="leaveUserId != null ">and leave_user_id = #{leaveUserId}</if>
             <if test="leaveUserName != null  and leaveUserName != ''">and leave_user_name like concat('%',
                 #{leaveUserName}, '%')

+ 8 - 2
src/main/resources/mapper/generalbusiness/CenterdataTRegulationsMapper.xml

@@ -45,8 +45,14 @@
             <if test="regOffice != null  and regOffice != ''">and reg_office = #{regOffice}</if>
             <if test="regNumber != null  and regNumber != ''">and reg_number = #{regNumber}</if>
             <if test="regTime != null ">and reg_time = #{regTime}</if>
-            <if test="deptId != null ">and dept_id = #{deptId}</if>
-            <if test="deptName != null  and deptName != ''">and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             <if test="attachId != null  and attachId != ''">and attach_id = #{attachId}</if>
             <if test="releaseStatus != null  and releaseStatus != ''">and release_status = #{releaseStatus}</if>
             ${params.dataScope}

+ 8 - 2
src/main/resources/mapper/generalbusiness/CenterdataTReserveMapper.xml

@@ -38,8 +38,14 @@
             <if test="dataDeptId != null ">and a.data_dept_id = #{dataDeptId}</if>
             <if test="resTitle != null  and resTitle != ''">and a.res_title like concat('%', #{resTitle}, '%')</if>
             <if test="resIntroduction != null  and resIntroduction != ''">and a.res_introduction = #{resIntroduction}</if>
-            <if test="deptId != null ">and a.dept_id = #{deptId}</if>
-            <if test="deptName != null  and deptName != ''">and a.dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
             <if test="attachId != null  and attachId != ''">and a.attach_id = #{attachId}</if>
             <if test="releaseStatus != null  and releaseStatus != ''">and a.release_status = #{releaseStatus}</if>
             ${params.dataScope}