浏览代码

车辆管理\车辆保养\取水口管理\水鹤管理\消火栓管理添加部门查询栏目

刘浩男 1 年之前
父节点
当前提交
7540079507

+ 16 - 2
data-ui/src/views/data/basicdata/car/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="licenseNum">
         <el-input
           v-model="queryParams.licenseNum"
@@ -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>
@@ -374,7 +383,7 @@
           maintenance: null,
           nextMaintenance: null,
           deptId: null,
-          deptName: null
+          deptName: 0
         },
         // 表单参数
         form: {
@@ -520,6 +529,7 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
@@ -581,6 +591,10 @@
         this.download('sooka-sponest-center-data/car/export', {
           ...this.queryParams
         }, `车辆管理_${new Date().getTime()}.xlsx`)
+      },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
       }
     }
   };

+ 19 - 4
data-ui/src/views/data/basicdata/carrepair/index.vue

@@ -1,7 +1,7 @@
 <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-item label="维修车牌号" prop="licenseNum" label-width="120px">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"  @submit.native.prevent>
+      <el-form-item label="维修车牌号" prop="licenseNum" label-width="80px">
         <el-input
           v-model="queryParams.licenseNum"
           placeholder="请输入维修车牌号"
@@ -9,7 +9,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="维修时间" prop="repairTime" label-width="120px">
+      <el-form-item label="维修时间" prop="repairTime" label-width="80px">
         <el-date-picker clearable
                         v-model="queryParams.repairTime"
                         type="date"
@@ -17,7 +17,7 @@
                         placeholder="请选择维修时间">
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="负责人" prop="charger" label-width="120px">
+      <el-form-item label="负责人" prop="charger" label-width="80px">
         <el-input
           v-model="queryParams.charger"
           placeholder="请输入负责人"
@@ -25,6 +25,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item prop="deptId" label-width="100px" >
+        <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>
@@ -245,6 +254,7 @@
           carId: null,
           licenseNum: null,
           repairTime: null,
+          deptName: 0,
           cost: null,
           charger: null,
           remarks: null
@@ -340,6 +350,7 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
@@ -418,6 +429,10 @@
         this.download('sooka-sponest-center-data/carrepair/export', {
           ...this.queryParams
         }, `车辆保养_${new Date().getTime()}.xlsx`)
+      },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
       }
     }
   };

+ 16 - 2
data-ui/src/views/data/basicdata/firehydrant/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" label-width="120px">
         <el-input
           v-model="queryParams.name"
@@ -19,6 +19,15 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item prop="deptId" label-width="120px">
+        <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="longitude">
          <el-input
            v-model="queryParams.longitude"
@@ -400,7 +409,7 @@
           firehydrantPerson: null,
           firehydrantTel: null,
           deptId: null,
-          deptName: null,
+          deptName: 0,
           dataStatus: null,
         },
         // 表单参数
@@ -555,6 +564,7 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName=0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
@@ -616,6 +626,10 @@
         this.download('sooka-sponest-center-data/firehydrant/export', {
           ...this.queryParams
         }, `消火栓_${new Date().getTime()}.xlsx`)
+      },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
       }
     }
   };

+ 17 - 1
data-ui/src/views/data/basicdata/watercrane/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"
@@ -9,6 +9,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="longitude" @dblclick.native="showMap">
          <el-input
            v-model="queryParams.longitude"
@@ -380,6 +390,7 @@
           watercraneTel: null,
           dataStatus: null,
           dataDeptId: null,
+          deptName: 0,
           specificLocation:null
         },
         // 表单参数
@@ -529,6 +540,7 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
@@ -590,6 +602,10 @@
         this.download('sooka-sponest-center-data/watercrane/export', {
           ...this.queryParams
         }, `水鹤管理_${new Date().getTime()}.xlsx`)
+      },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
       }
     }
   };

+ 16 - 1
data-ui/src/views/data/basicdata/waterintake/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"
@@ -41,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="数据所属部门(政或党的id)" prop="dataDeptId">-->
       <!--        <el-input-->
       <!--          v-model="queryParams.dataDeptId"-->
@@ -315,6 +324,7 @@
           waterintakeTel: null,
           dataStatus: null,
           dataDeptId: null,
+          deptName: 0,
           specificLocation:null
         },
         // 表单参数
@@ -446,6 +456,7 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.queryParams.deptName = 0;
         this.resetForm("queryForm");
         this.handleQuery();
       },
@@ -524,6 +535,10 @@
         this.download('sooka-sponest-center-data/waterintake/export', {
           ...this.queryParams
         }, `取水口_${new Date().getTime()}.xlsx`)
+      },
+      // 点击按钮修改是否只查询本级部门用户
+      changeQueryType() {
+        this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
       }
     }
   };

+ 8 - 2
src/main/resources/mapper/basicdata/CenterdataTForestCarMapper.xml

@@ -53,8 +53,14 @@
             <if test="purchaseDate != null ">and purchase_date = #{purchaseDate}</if>
             <if test="maintenance != null ">and maintenance = #{maintenance}</if>
             <if test="nextMaintenance != null ">and next_maintenance = #{nextMaintenance}</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="areaType != null ">and area_type = #{areaType}</if>
             ${params.dataScope}
         </where>

+ 8 - 2
src/main/resources/mapper/basicdata/CenterdataTForestCarrepairMapper.xml

@@ -40,8 +40,14 @@
             <if test="cost != null ">and a.cost = #{cost}</if>
             <if test="charger != null  and charger != ''">and a.charger like concat('%', #{charger}, '%')</if>
             <if test="remarks != null  and remarks != ''">and a.remarks = #{remarks}</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>
             ${params.dataScope}
         </where>
         order by a.create_time desc

+ 8 - 2
src/main/resources/mapper/basicdata/CenterdataTForestFirehydrantMapper.xml

@@ -53,8 +53,14 @@
             </if>
             <if test="firehydrantTel != null  and firehydrantTel != ''">and a.firehydrant_tel = #{firehydrantTel}</if>
             <if test="firehydrantType != null  and firehydrantType!= ''">and a.firehydrant_type = #{firehydrantType}</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="dataStatus != null  and dataStatus != ''">and a.data_status = #{dataStatus}</if>
             ${params.dataScope}
         </where>

+ 8 - 2
src/main/resources/mapper/basicdata/CenterdataTForestWatercraneMapper.xml

@@ -48,8 +48,14 @@
             </if>
             <if test="watercraneTel != null  and watercraneTel != ''">and a.watercrane_tel = #{watercraneTel}</if>
             <if test="dataStatus != null  and dataStatus != ''">and a.data_status = #{dataStatus}</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="specificLocation != null  and specificLocation != ''">and a.specific_location = #{specificLocation}</if>
             ${params.dataScope}
         </where>

+ 8 - 2
src/main/resources/mapper/basicdata/CenterdataTForestWaterintakeMapper.xml

@@ -46,8 +46,14 @@
             <if test="waterintakePerson != null  and waterintakePerson != ''">and a.waterintake_person like concat('%', #{waterintakePerson}, '%')</if>
             <if test="waterintakeTel != null  and waterintakeTel != ''">and a.waterintake_tel like concat('%', #{waterintakeTel}, '%')</if>
             <if test="dataStatus != null  and dataStatus != ''">and a.data_status = #{dataStatus}</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="specificLocation != null  and specificLocation != ''">and a.specific_location = #{specificLocation}</if>
             ${params.dataScope}
         </where>